InfluxDB 3 Serverless Docs Submit API issue

InfluxDB v1 HTTP API for InfluxDB 3 Cloud Serverless

The InfluxDB v1 HTTP API provides v1 compatibility for writing and querying data in an InfluxDB 3 Cloud Serverless bucket.

The InfluxDB 1.x /write and /query endpoints work with InfluxDB 1.x client libraries and third-party integrations like Grafana and others.

This documentation is generated from the InfluxDB OpenAPI specification.

InfluxDB /api/v2 API for InfluxDB 3 Cloud Serverless

Authentication

The InfluxDB 1.x API requires authentication for all requests. InfluxDB Cloud uses InfluxDB API tokens to authenticate requests.

For more information, see the following:

TokenAuthentication

Use the Token authentication scheme to authenticate to the InfluxDB API.

In your API requests, send an Authorization header. For the header value, provide the word Token followed by a space and an InfluxDB API token. The word Token is case-sensitive.

Syntax

Authorization: Token YOUR_INFLUX_TOKEN

For examples and more information, see the following:

Security Scheme TypeAPI Key
Header parameter name:Authorization

BasicAuthentication

Use the HTTP Basic authentication scheme with clients that support the InfluxDB 1.x convention of username and password (that don't support the Authorization: Token scheme):

For examples and more information, see how to authenticate with a username and password.

Security Scheme TypeHTTP
HTTP Authorization Schemebasic

QuerystringAuthentication

Use the Querystring authentication scheme with InfluxDB 1.x API parameters to provide credentials through the query string.

For examples and more information, see how to authenticate with a username and password.

Security Scheme TypeAPI Key
Query parameter name:u=&p=

Query

Query using the InfluxDB v1 HTTP API

query Parameters
chunk_size
integer
Default: 10000

The number of records that will go into a chunk. This parameter is only used if chunked=true.

chunked
boolean
Default: false

If true, the response is divided into chunks of size chunk_size.

db
required
string

The database name for InfluxQL queries

Required parameter that specifies the database to query via DBRP (Database Retention Policy) mapping. In Cloud Serverless, this parameter is used together with DBRP mappings to identify which bucket to query.

The db parameter (optionally combined with rp) must have an existing DBRP mapping that points to a bucket. Without a valid DBRP mapping, queries will fail with an authorization error.

DBRP mapping requirements:

  • A DBRP mapping must exist before querying
  • Mappings can be created automatically when writing data with the v1 API (if your token has permissions)
  • Mappings can be created manually using the InfluxDB CLI or API

Examples

  • db=mydb - uses the default DBRP mapping for mydb
  • db=mydb with rp=weekly - uses the DBRP mapping for mydb/weekly

Note: Unlike the v1 /write endpoint which can auto-create buckets and mappings, the /query endpoint requires pre-existing DBRP mappings. The actual data is stored in and queried from the bucket that the DBRP mapping points to.

epoch
string
Enum: "h" "m" "s" "ms" "u" "µ" "ns"

Formats timestamps as unix (epoch) timestamps with the specified precision instead of RFC3339 timestamps with nanosecond precision.

p
string

User token.

pretty
boolean
Default: false

If true, the JSON response is formatted in a human-readable format.

q
required
string

Defines the InfluxQL query to run.

rp
string

The retention policy name for InfluxQL queries

Optional parameter that specifies the retention policy to use when querying data with InfluxQL. In Cloud Serverless, this parameter works with DBRP (Database Retention Policy) mappings to identify the target bucket.

When provided together with the db parameter, Cloud Serverless uses the DBRP mapping to determine which bucket to query. The combination of db and rp must have an existing DBRP mapping that points to a bucket. If no rp is specified, Cloud Serverless uses the default retention policy mapping for the database.

Requirements: A DBRP mapping must exist for the db/rp combination before you can query data. DBRP mappings can be created:

  • Automatically when writing data with the v1 API (if your token has sufficient permissions)
  • Manually using the InfluxDB CLI or API

Example: If db=mydb and rp=weekly, the query uses the DBRP mapping for mydb/weekly to determine which bucket to query.

Note: The retention policy name is used only for DBRP mapping. Actual data retention is controlled by the target bucket's retention period setting, not by the retention policy name.

u
string

Username.

header Parameters
Accept
string
Default: application/json
Enum: "application/json" "application/csv" "text/csv" "application/x-msgpack"

Specifies how query results should be encoded in the response. Note: With application/csv, query results include epoch timestamps instead of RFC3339 timestamps.

Accept-Encoding
string
Default: identity
Enum: "gzip" "identity"

The Accept-Encoding request HTTP header advertises which content encoding, usually a compression algorithm, the client is able to understand.

Zap-Trace-Span
string
Example: trace_id,1,span_id,1,baggage,[object Object]

OpenTracing span context

Responses

Response samples

Content type
No sample

Query using the InfluxDB v1 HTTP API

query Parameters
db
required
string

Bucket to query.

p
string

User token.

q
string

Defines the influxql query to run.

rp
string

Retention policy name.

u
string

Username.

header Parameters
Accept
string
Default: application/json
Enum: "application/json" "application/csv" "text/csv" "application/x-msgpack"

Specifies how query results should be encoded in the response. Note: With application/csv, query results include epoch timestamps instead of RFC3339 timestamps.

Accept-Encoding
string
Default: identity
Enum: "gzip" "identity"

The Accept-Encoding request HTTP header advertises which content encoding, usually a compression algorithm, the client is able to understand.

Content-Type
string
Value: "application/vnd.influxql"
Zap-Trace-Span
string
Example: trace_id,1,span_id,1,baggage,[object Object]

OpenTracing span context

Request Body schema:

InfluxQL query to execute.

string

Responses

Request samples

Content type
No sample

Response samples

Content type
No sample

Write

Write time series data into InfluxDB in a V1-compatible format

query Parameters
db
required
string

Database to write to. If none exists, InfluxDB creates a database with a default 3-day retention policy.

p
string

User token.

precision
string

Write precision.

rp
string

Retention policy name.

u
string

Username.

header Parameters
Content-Encoding
string
Default: identity
Enum: "gzip" "identity"

When present, its value indicates to the database that compression is applied to the line protocol body.

Zap-Trace-Span
string
Example: trace_id,1,span_id,1,baggage,[object Object]

OpenTracing span context

Request Body schema: text/plain

Line protocol body

string

Responses

Response samples

Content type
application/json
{
  • "code": "internal error",
  • "message": "string",
  • "op": "string",
  • "err": "string",
  • "line": 0
}