openapi: 3.0.0 info: title: InfluxDB v1 HTTP API version: 1.12.3 description: > The InfluxDB v1 HTTP API provides a simple way to interact with the database. It uses HTTP response codes, authentication with username and password credentials or API tokens, and JSON-formatted response data. ## InfluxDB 3 Compatibility InfluxDB 3 supports the v1 `/write` and `/query` HTTP API endpoints. For more information, see the following: - [Use compatibility APIs to write data in InfluxDB 3](https://docs.influxdata.com/influxdb3/core/write-data/http-api/compatibility-apis/) - [Get started using using InfluxQL in InfluxDB 3](https://docs.influxdata.com/influxdb3/core/get-started/query/#influxql) contact: name: InfluxData url: https://www.influxdata.com license: name: MIT url: https://opensource.org/licenses/MIT x-influxdata-short-title: InfluxDB v1 API x-influxdata-short-description: >- The InfluxDB v1 HTTP API provides a programmatic interface for writing, querying, and managing InfluxDB v1 databases. servers: - url: http://localhost:8086 description: Local InfluxDB instance security: - BasicAuth: [] - QueryAuth: [] tags: - name: System Information description: >- Check server status, health, and version information for an InfluxDB v1 instance. - name: Query description: >- Query data using InfluxQL via the `/query` endpoint, supporting both read queries (SELECT, SHOW) and management queries (CREATE, DROP, ALTER). - name: Write description: >- Write time series data to InfluxDB v1 in line protocol format using the `/write` endpoint. - name: Debug description: >- Access debugging and profiling endpoints for troubleshooting and performance analysis of an InfluxDB v1 instance. - name: Buckets (v2 compatible) description: >- Manage databases as buckets using InfluxDB v2-compatible endpoints. Provides forward compatibility with InfluxDB 2.x client libraries and InfluxDB 1.8+. - name: Delete (v2 compatible) description: >- Delete data using InfluxDB v2-compatible predicate expressions. Provides forward compatibility with InfluxDB 2.x client libraries and InfluxDB 1.8+. - name: Authentication x-traitTag: true description: |- Authentication is **disabled by default** in InfluxDB v1. When disabled, the database accepts any request without checking credentials—supplied credentials are silently ignored. When enabled, every HTTP request must include valid credentials. Use one of the following schemes to authenticate to the InfluxDB v1 API: - [Basic authentication](#section/Authentication/BasicAuth) - [Query string authentication](#section/Authentication/QueryAuth) - [Token authentication](#section/Authentication/TokenAuth) x-related: - title: Manage authentication and authorization href: >- https://docs.influxdata.com/influxdb/v1/administration/authentication_and_authorization/ paths: /ping: get: operationId: GetPing summary: Check server status description: > Check the status of your InfluxDB instance and retrieve version information. The `/ping` endpoint returns a `204 No Content` response by default. Use the `verbose=true` query parameter to return a `200 OK` response, which is required for [Google Cloud Load Balancing](https://cloud.google.com/load-balancing/docs/health-check-concepts) health checks. tags: - System Information parameters: - name: verbose in: query description: > When `true`, returns HTTP 200 instead of 204. Required for Google Cloud Load Balancing health checks. schema: type: boolean default: false responses: '200': description: Server is running (verbose mode) headers: X-Influxdb-Build: description: InfluxDB build type (`OSS` or `ENT`) schema: type: string enum: - OSS - ENT X-Influxdb-Version: description: InfluxDB version schema: type: string '204': description: Server is running headers: X-Influxdb-Build: description: InfluxDB build type (`OSS` or `ENT`) schema: type: string enum: - OSS - ENT X-Influxdb-Version: description: InfluxDB version schema: type: string head: operationId: HeadPing summary: Check server status (HEAD) description: | Check the status of your InfluxDB instance using a HEAD request. Returns the same headers as GET but without a response body. tags: - System Information responses: '204': description: Server is running headers: X-Influxdb-Build: description: InfluxDB build type (`OSS` or `ENT`) schema: type: string enum: - OSS - ENT X-Influxdb-Version: description: InfluxDB version schema: type: string /health: get: operationId: GetHealth summary: Check server health description: | Check the health of your InfluxDB instance. Returns health status as JSON with a `pass` or `fail` status. x-compatibility-version: v2 tags: - System Information responses: '200': description: Server is healthy content: application/json: schema: $ref: '#/components/schemas/HealthCheck' example: name: influxdb message: ready for queries and writes status: pass version: 1.8.10 '503': description: Server is unhealthy content: application/json: schema: $ref: '#/components/schemas/HealthCheck' example: name: influxdb message: service unavailable status: fail version: 1.8.10 /query: get: operationId: GetQuery summary: Query data (GET) description: > Query data using InfluxQL. Use GET for read-only queries that start with: - `SELECT` (except queries with `INTO` clause) - `SHOW` For write operations (CREATE, DROP, ALTER, etc.), use POST. tags: - Query parameters: - $ref: '#/components/parameters/QueryDB' - $ref: '#/components/parameters/QueryQ' - $ref: '#/components/parameters/QueryEpoch' - $ref: '#/components/parameters/QueryPretty' - $ref: '#/components/parameters/QueryChunked' - $ref: '#/components/parameters/AuthUsername' - $ref: '#/components/parameters/AuthPassword' responses: '200': description: Query executed successfully content: application/json: schema: $ref: '#/components/schemas/QueryResponse' example: results: - statement_id: 0 series: - name: mymeas columns: - time - myfield - mytag1 - mytag2 values: - - '2017-03-01T00:16:18Z' - 33.1 - null - null - - '2017-03-01T00:17:18Z' - 12.4 - '12' - '14' application/csv: schema: type: string example: | name,tags,time,myfield,mytag1,mytag2 mymeas,,1488327378000000000,33.1,, mymeas,,1488327438000000000,12.4,12,14 '400': description: Bad request (syntax error in query) content: application/json: schema: $ref: '#/components/schemas/Error' example: error: >- error parsing query: found EOF, expected FROM at line 1, char 9 '401': description: Unauthorized content: application/json: schema: $ref: '#/components/schemas/Error' example: error: authorization failed post: operationId: PostQuery summary: Query data (POST) description: | Query data or execute database management commands using InfluxQL. Use POST for queries that start with: - `SELECT` with `INTO` clause - `ALTER` - `CREATE` - `DELETE` - `DROP` - `GRANT` - `KILL` - `REVOKE` tags: - Query parameters: - $ref: '#/components/parameters/QueryDB' - $ref: '#/components/parameters/QueryEpoch' - $ref: '#/components/parameters/QueryPretty' - $ref: '#/components/parameters/QueryChunked' - $ref: '#/components/parameters/AuthUsername' - $ref: '#/components/parameters/AuthPassword' requestBody: required: true content: application/x-www-form-urlencoded: schema: type: object required: - q properties: q: type: string description: InfluxQL query string example: CREATE DATABASE mydb params: type: string description: | JSON object containing bind parameter values. Use `$` syntax in the query to reference parameters. example: '{"tag_value":"12","field_value":30}' multipart/form-data: schema: type: object properties: q: type: string format: binary description: File containing InfluxQL queries (separated by semicolons) async: type: boolean description: Execute queries asynchronously default: false responses: '200': description: Query executed successfully content: application/json: schema: $ref: '#/components/schemas/QueryResponse' '400': description: Bad request content: application/json: schema: $ref: '#/components/schemas/Error' '401': description: Unauthorized content: application/json: schema: $ref: '#/components/schemas/Error' /write: post: operationId: PostWrite summary: Write data description: > Write time series data to InfluxDB using line protocol format. Data must be sent as binary encoded line protocol in the request body. Use the `--data-binary` flag with curl to preserve newlines. **Best Practices:** - Write points in batches of 5,000 to 10,000 for optimal performance - Use the least precise timestamp precision possible for better compression tags: - Write parameters: - name: db in: query required: true description: Target database for the write schema: type: string example: mydb - name: rp in: query description: > Target retention policy. If not specified, writes to the default retention policy. schema: type: string - name: precision in: query description: | Timestamp precision. InfluxDB assumes nanoseconds if not specified. schema: type: string enum: - 'n' - u - ms - s - m - h default: 'n' - $ref: '#/components/parameters/AuthUsername' - $ref: '#/components/parameters/AuthPassword' requestBody: required: true description: | Line protocol data. Multiple points should be separated by newlines. Use `@filename` to write from a file. content: text/plain: schema: type: string example: | mymeas,mytag=1 myfield=90 1463683075000000000 mymeas,mytag=2 myfield=34 1463683076000000000 responses: '204': description: Write successful '400': description: Bad request (line protocol syntax error or type conflict) content: application/json: schema: $ref: '#/components/schemas/Error' examples: badTimestamp: summary: Invalid timestamp value: error: >- unable to parse 'mymeas,mytag=1 myfield=91 abc123': bad timestamp typeConflict: summary: Field type conflict value: error: >- field type conflict: input field "myfield" on measurement "mymeas" is type int64, already exists as type float '401': description: Unauthorized content: application/json: schema: $ref: '#/components/schemas/Error' '404': description: Database not found content: application/json: schema: $ref: '#/components/schemas/Error' example: error: 'database not found: "mydb1"' '413': description: Request entity too large content: application/json: schema: $ref: '#/components/schemas/Error' example: error: Request Entity Too Large '500': description: Internal server error (e.g., retention policy not found) content: application/json: schema: $ref: '#/components/schemas/Error' example: error: 'retention policy not found: myrp' /debug/pprof: get: operationId: GetDebugPprof summary: Get profiling index description: | Returns an HTML page listing available Go pprof profiles. Use the individual profile endpoints to retrieve specific profile data. tags: - Debug responses: '200': description: HTML page with profile links content: text/html: schema: type: string /debug/pprof/{profile}: get: operationId: GetDebugPprofProfile summary: Get profile data description: > Retrieve a specific Go pprof profile. Available profiles: - `block`: Stack traces that led to blocking on synchronization primitives - `goroutine`: Stack traces of all current goroutines - `heap`: Sampling of stack traces for heap allocations - `mutex`: Stack traces of holders of contended mutexes - `threadcreate`: Stack traces that led to creation of new OS threads - `profile`: CPU profile (use `seconds` parameter to specify duration) - `trace`: Execution trace (use `seconds` parameter to specify duration) tags: - Debug parameters: - name: profile in: path required: true description: Profile name schema: type: string enum: - block - goroutine - heap - mutex - threadcreate - profile - trace - allocs - cmdline - name: seconds in: query description: Duration in seconds for CPU profile or trace schema: type: integer default: 30 - name: debug in: query description: Return human-readable text output instead of binary schema: type: integer enum: - 0 - 1 default: 0 responses: '200': description: Profile data content: application/octet-stream: schema: type: string format: binary text/plain: schema: type: string /debug/pprof/all: get: operationId: GetDebugPprofAll summary: Get all profiles archive description: > Generate a `profiles.tar.gz` archive containing all standard Go profiling information and additional debugging data. Intended primarily for use by InfluxData support. Use the `cpu` parameter to include a CPU profile of the specified duration. tags: - Debug parameters: - name: cpu in: query description: > Duration for CPU profile. Specify as a duration string (e.g., `30s`). For InfluxDB 1.8.3 and earlier, use `cpu=true`. schema: type: string example: 30s responses: '200': description: Compressed archive containing all profiles content: application/gzip: schema: type: string format: binary /debug/requests: get: operationId: GetDebugRequests summary: Track HTTP requests description: | Track HTTP client requests to the `/write` and `/query` endpoints. Returns the number of writes and queries per username and IP address over the specified time interval. tags: - Debug parameters: - name: seconds in: query description: Duration in seconds to collect request data schema: type: integer default: 10 responses: '200': description: Request statistics by user and IP content: application/json: schema: type: object additionalProperties: type: object properties: writes: type: integer queries: type: integer example: user1:123.45.678.91: writes: 1 queries: 0 user1:000.0.0.0: writes: 0 queries: 16 /debug/vars: get: operationId: GetDebugVars summary: Get server statistics description: > Retrieve runtime statistics and information about the InfluxDB instance. Returns detailed metrics in JSON format including memory usage, goroutine counts, and database statistics. The [InfluxDB Telegraf input plugin](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/influxdb) can collect these metrics automatically. tags: - Debug responses: '200': description: Server statistics in JSON format content: application/json: schema: type: object description: Server runtime statistics /api/v2/query: post: operationId: PostApiV2Query summary: Query with Flux (v2 compatible) description: > Query data using [Flux](https://docs.influxdata.com/influxdb/v1/flux/) language. This endpoint provides forward compatibility with InfluxDB 2.x client libraries. **Required Headers:** - `Accept: application/csv` - `Content-type: application/vnd.flux` - `Authorization: Token username:password` (if authentication is enabled) x-compatibility-version: v2 tags: - Query security: - TokenAuth: [] requestBody: required: true content: application/vnd.flux: schema: type: string example: | from(bucket:"telegraf") |> range(start:-5m) |> filter(fn:(r) => r._measurement == "cpu") responses: '200': description: Query results in CSV format content: application/csv: schema: type: string '401': description: Unauthorized content: application/json: schema: $ref: '#/components/schemas/Error' /api/v2/write: post: operationId: PostApiV2Write summary: Write data (v2 compatible) description: > Write data using the InfluxDB 2.x API format. This endpoint provides forward compatibility with InfluxDB 2.x client libraries. **Bucket Mapping:** The `bucket` parameter maps to InfluxDB 1.x database and retention policy: - `database/retention-policy` - specific retention policy - `database/` or `database` - default retention policy The `org` parameter is ignored in InfluxDB 1.x. x-compatibility-version: v2 tags: - Write security: - TokenAuth: [] parameters: - name: bucket in: query required: true description: | Database and retention policy in format `database/retention-policy`. Use `database/` or `database` for the default retention policy. schema: type: string example: mydb/autogen - name: org in: query description: Organization (ignored in InfluxDB 1.x) schema: type: string - name: precision in: query description: Timestamp precision schema: type: string enum: - ns - us - ms - s default: ns requestBody: required: true content: text/plain: schema: type: string example: mem,host=host1 used_percent=23.43234543 1556896326 responses: '204': description: Write successful '400': description: Bad request content: application/json: schema: $ref: '#/components/schemas/Error' '401': description: Unauthorized content: application/json: schema: $ref: '#/components/schemas/Error' /api/v2/buckets: get: operationId: GetApiV2Buckets summary: List buckets (v2 compatible) description: | List all databases as buckets. Provides forward compatibility with InfluxDB 2.x client libraries. x-compatibility-version: v2 tags: - Buckets (v2 compatible) security: - TokenAuth: [] responses: '200': description: List of buckets content: application/json: schema: $ref: '#/components/schemas/BucketList' '401': description: Unauthorized content: application/json: schema: $ref: '#/components/schemas/Error' post: operationId: PostApiV2Buckets summary: Create bucket (v2 compatible) description: | Create a new database as a bucket. Provides forward compatibility with InfluxDB 2.x client libraries. x-compatibility-version: v2 tags: - Buckets (v2 compatible) security: - TokenAuth: [] requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/BucketCreate' responses: '201': description: Bucket created content: application/json: schema: $ref: '#/components/schemas/Bucket' '401': description: Unauthorized content: application/json: schema: $ref: '#/components/schemas/Error' /api/v2/buckets/{bucketID}: delete: operationId: DeleteApiV2BucketsBucketID summary: Delete bucket (v2 compatible) description: | Delete a database/retention policy combination. The bucketID format is `database/retention-policy`. x-compatibility-version: v2 tags: - Buckets (v2 compatible) security: - TokenAuth: [] parameters: - name: bucketID in: path required: true description: Bucket ID in format `database/retention-policy` schema: type: string example: test/autogen responses: '204': description: Bucket deleted '401': description: Unauthorized content: application/json: schema: $ref: '#/components/schemas/Error' '404': description: Bucket not found content: application/json: schema: $ref: '#/components/schemas/Error' /api/v2/delete: post: operationId: PostApiV2Delete summary: Delete data (v2 compatible) description: > Delete data from InfluxDB using predicate expressions. Supports deletion by tag value, timestamp, and measurement. **Predicate Syntax:** ``` _measurement="example" AND tagKey="tagValue" ``` See [delete predicate syntax](https://docs.influxdata.com/influxdb/v2/reference/syntax/delete-predicate/) for detailed syntax and [limitations](https://docs.influxdata.com/influxdb/v2/reference/syntax/delete-predicate/#limitations). x-compatibility-version: v2 tags: - Delete (v2 compatible) security: - TokenAuth: [] parameters: - name: bucket in: query required: true description: Database and retention policy in format `database/retention-policy` schema: type: string example: exampleDB/autogen - name: precision in: query description: Timestamp precision schema: type: string enum: - ns - us - ms - s requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/DeleteRequest' examples: timeRange: summary: Delete by time range value: start: '2020-03-01T00:00:00Z' stop: '2020-11-14T00:00:00Z' withPredicate: summary: Delete with predicate value: start: '2020-03-01T00:00:00Z' stop: '2020-11-14T00:00:00Z' predicate: >- _measurement="example-measurement" AND exampleTag="exampleTagValue" responses: '204': description: Delete successful '400': description: Bad request content: application/json: schema: $ref: '#/components/schemas/Error' '401': description: Unauthorized content: application/json: schema: $ref: '#/components/schemas/Error' components: securitySchemes: BasicAuth: type: http scheme: basic description: > Use HTTP Basic Authentication by including your username and password in the request. ```bash curl -u username:password "http://localhost:8086/query?q=SHOW+DATABASES" ``` Or encode credentials in the URL (not recommended for production): ```bash curl "http://username:password@localhost:8086/query?q=SHOW+DATABASES" ``` QueryAuth: type: apiKey in: query name: u description: > Pass your credentials as query parameters. Use `u` for username and `p` for password. ```bash curl "http://localhost:8086/query?u=username&p=password&q=SHOW+DATABASES" ``` > [!Note] > Query string authentication exposes credentials in URLs and server logs. > Use Basic Authentication or Token Authentication for production environments. TokenAuth: type: http scheme: bearer bearerFormat: Token description: > For v2-compatible endpoints (`/api/v2/*`), use the `Authorization` header with the `Token` scheme. Include your InfluxDB 1.x username and password separated by a colon: ```bash curl -H "Authorization: Token username:password" \ "http://localhost:8086/api/v2/query" ``` This format is compatible with InfluxDB 2.x client libraries, allowing you to use the same code with both InfluxDB 1.8+ and InfluxDB 2.x. parameters: QueryDB: name: db in: query description: Target database for the query schema: type: string example: mydb QueryQ: name: q in: query required: true description: InfluxQL query string schema: type: string example: SELECT * FROM "mymeas" QueryEpoch: name: epoch in: query description: | Return timestamps as Unix epoch values with specified precision. By default, timestamps are returned in RFC3339 format. schema: type: string enum: - ns - u - µ - ms - s - m - h QueryPretty: name: pretty in: query description: Enable pretty-printed JSON output (not recommended for production) schema: type: boolean default: false QueryChunked: name: chunked in: query description: | Return results in streamed batches. Set to `true` to chunk by series or every 10,000 points. Set to a number to chunk by that many points. schema: oneOf: - type: boolean - type: integer AuthUsername: name: u in: query description: Username for authentication schema: type: string AuthPassword: name: p in: query description: Password for authentication schema: type: string schemas: HealthCheck: type: object properties: name: type: string example: influxdb message: type: string example: ready for queries and writes status: type: string enum: - pass - fail version: type: string example: 1.8.10 QueryResponse: type: object properties: results: type: array items: type: object properties: statement_id: type: integer series: type: array items: $ref: '#/components/schemas/Series' error: type: string Series: type: object properties: name: type: string description: Measurement name tags: type: object additionalProperties: type: string columns: type: array items: type: string values: type: array items: type: array items: {} Error: type: object required: - error properties: error: type: string description: Error message DeleteRequest: type: object required: - start - stop properties: start: type: string format: date-time description: Start time (inclusive) stop: type: string format: date-time description: Stop time (exclusive) predicate: type: string description: | InfluxQL-like predicate expression to filter data to delete. Example: `_measurement="example" AND tagKey="tagValue"` BucketList: type: object properties: buckets: type: array items: $ref: '#/components/schemas/Bucket' Bucket: type: object properties: id: type: string description: Bucket ID (database/retention-policy) name: type: string description: Bucket name retentionRules: type: array items: type: object properties: type: type: string enum: - expire everySeconds: type: integer BucketCreate: type: object required: - name properties: name: type: string description: Database name retentionRules: type: array items: type: object properties: type: type: string enum: - expire everySeconds: type: integer description: Retention period in seconds