InfluxDB HTTP API
Use the InfluxDB HTTP API to write data, query data, and manage databases, tables, and tokens.
Use the InfluxDB 3 Enterprise HTTP API to write data, query data, and manage databases, tables, and tokens.
Auth token
Manage tokens for authentication and authorization
Authentication
Depending on your workflow, use one of the following schemes to authenticate to the InfluxDB 3 API:
| Authentication scheme | Works with |
|---|---|
| Bearer authentication | All endpoints |
| Token authentication | v1 and v2 compatibility endpoints (/write, /query, /api/v2/write) |
| Basic authentication | v1 compatibility endpoints (/write, /query) |
| Querystring authentication | v1 compatibility endpoints (/write, /query) |
| See the Security Schemes section below for details on each authentication method. |
Cache data
Manage the in-memory cache.
Distinct Value Cache
The Distinct Value Cache (DVC) lets you cache distinct values of one or more columns in a table, improving the performance of queries that return distinct tag and field values. The DVC is an in-memory cache that stores distinct values for specific columns in a table. When you create an DVC, you can specify what columns’ distinct values to cache, the maximum number of distinct value combinations to cache, and the maximum age of cached values. A DVC is associated with a table, which can have multiple DVCs.
Last value cache
The Last Value Cache (LVC) lets you cache the most recent values for specific fields in a table, improving the performance of queries that return the most recent value of a field for specific series or the last N values of a field. The LVC is an in-memory cache that stores the last N number of values for specific fields of series in a table. When you create an LVC, you can specify what fields to cache, what tags to use to identify each series, and the number of values to cache for each unique series. An LVC is associated with a table, which can have multiple LVCs.
Related guides
Database
Manage databases
Headers and parameters
Most InfluxDB API endpoints require parameters in the request–for example, specifying the database to use.
Common parameters
The following table shows common parameters used by many InfluxDB API endpoints. Many endpoints may require other parameters in the query string or in the request body that perform functions specific to those endpoints.
| Query parameter | Value type | Description |
|---|---|---|
db | string | The database name |
| InfluxDB HTTP API endpoints use standard HTTP request and response headers. | ||
| The following table shows common headers used by many InfluxDB API endpoints. | ||
| Some endpoints may use other headers that perform functions more specific to those endpoints–for example, | ||
the write endpoints accept the Content-Encoding header to indicate that line protocol is compressed in the request body. | ||
| Header | Value type | Description |
| :———————— | :——————— | :——————————————- |
Accept | string | The content type that the client can understand. |
Authorization | string | The authorization scheme and credential. |
Content-Length | integer | The size of the entity-body, in bytes. |
Content-Type | string | The format of the data in the request body. |
Migrate from InfluxDB v1 or v2
Migrate your existing InfluxDB v1 or v2 workloads to InfluxDB 3. InfluxDB 3 provides compatibility endpoints that work with InfluxDB 1.x and 2.x client libraries and tools. Operations marked with v1 or v2 badges are compatible with the respective InfluxDB version.
Migration guides
- Migrate from InfluxDB v1 - For users migrating from InfluxDB 1.x
- Migrate from InfluxDB v2 - For users migrating from InfluxDB 2.x or Cloud
- Use compatibility APIs to write data - v1 and v2 write endpoints
- Use the v1 HTTP query API - InfluxQL queries via HTTP
Processing engine
Manage Processing engine triggers, test plugins, and send requests to trigger On Request plugins. InfluxDB 3 Enterprise provides the InfluxDB 3 processing engine, an embedded Python VM that can dynamically load and trigger Python plugins in response to events in your database. Use Processing engine plugins and triggers to run code and perform tasks for different database events. To get started with the processing engine, see the Processing engine and Python plugins guide.
Query data
Query data using SQL or InfluxQL
Quick start
Create an admin token to authorize API requests.
curl -X POST "http://localhost:8181/api/v3/configure/token/admin"Check the status of the InfluxDB server.
curl "http://localhost:8181/health" \ --header "Authorization: Bearer ADMIN_TOKEN"Write data to InfluxDB.
curl "http://localhost:8181/api/v3/write_lp?db=sensors&precision=auto" --header "Authorization: Bearer ADMIN_TOKEN" \ --data-raw "home,room=Kitchen temp=72.0 home,room=Living\ room temp=71.5"If all data is written, the response is
204 No Content.Query data from InfluxDB.
curl -G "http://localhost:8181/api/v3/query_sql" \ --header "Authorization: Bearer ADMIN_TOKEN" \ --data-urlencode "db=sensors" \ --data-urlencode "q=SELECT * FROM home WHERE room='Living room'" \ --data-urlencode "format=jsonl"Output:
{"room":"Living room","temp":71.5,"time":"2025-02-25T20:19:34.984098"}
For more information about using InfluxDB 3 Enterprise, see the Get started guide.
Server information
Retrieve server metrics, status, and version information
Table
Manage table schemas and data
Write data
Write data to InfluxDB 3 using line protocol format.
Timestamp precision across write APIs
InfluxDB 3 provides multiple write endpoints for compatibility with different InfluxDB versions. The following table compares timestamp precision support across v1, v2, and v3 write APIs:
| Precision | v1 (/write) | v2 (/api/v2/write) | v3 (/api/v3/write_lp) |
|---|---|---|---|
| Auto detection | ❌ No | ❌ No | ✅ auto (default) |
| Seconds | ✅ s | ✅ s | ✅ second |
| Milliseconds | ✅ ms | ✅ ms | ✅ millisecond |
| Microseconds | ✅ u or µ | ✅ us | ✅ microsecond |
| Nanoseconds | ✅ ns | ✅ ns | ✅ nanosecond |
| Minutes | ✅ m | ❌ No | ❌ No |
| Hours | ✅ h | ❌ No | ❌ No |
| Default | Nanosecond | Nanosecond | Auto (guessed) |
| All timestamps are stored internally as nanoseconds. |
Create a database
API reference for POST /api/v3/configure/database
Create a resource token
API reference for POST /api/v3/configure/enterprise/token
Create a table
API reference for POST /api/v3/configure/table
Create admin token
API reference for POST /api/v3/configure/token/admin
Create distinct cache
API reference for POST /api/v3/configure/distinct_cache
Create last cache
API reference for POST /api/v3/configure/last_cache
Create named admin token
API reference for POST /api/v3/configure/token/named_admin
Create processing engine trigger
API reference for POST /api/v3/configure/processing_engine_trigger
Delete a database
API reference for DELETE /api/v3/configure/database
Delete a table
API reference for DELETE /api/v3/configure/table
Delete distinct cache
API reference for DELETE /api/v3/configure/distinct_cache
Delete last cache
API reference for DELETE /api/v3/configure/last_cache
Delete processing engine trigger
API reference for DELETE /api/v3/configure/processing_engine_trigger
Delete token
API reference for DELETE /api/v3/configure/token
Disable processing engine trigger
API reference for POST /api/v3/configure/processing_engine_trigger/disable
Enable processing engine trigger
API reference for POST /api/v3/configure/processing_engine_trigger/enable
Execute InfluxQL query
API reference for GET /api/v3/query_influxql
Execute InfluxQL query
API reference for POST /api/v3/query_influxql
Execute InfluxQL query (v1-compatible)
API reference for GET /query
Execute InfluxQL query (v1-compatible)
API reference for POST /query
Execute SQL query
API reference for GET /api/v3/query_sql
Execute SQL query
API reference for POST /api/v3/query_sql
Health check (v1-compatible)
API reference for GET /api/v1/health
Install plugin packages
API reference for POST /api/v3/configure/plugin_environment/install_packages
Install plugin requirements
API reference for POST /api/v3/configure/plugin_environment/install_requirements
List databases
API reference for GET /api/v3/configure/database
Metrics
API reference for GET /metrics
On Request processing engine plugin request
API reference for GET /api/v3/engine/{request_path}
On Request processing engine plugin request
API reference for POST /api/v3/engine/{request_path}
Ping the server
API reference for GET /ping
Regenerate admin token
API reference for POST /api/v3/configure/token/admin/regenerate
Remove database retention period
API reference for DELETE /api/v3/configure/database/retention_period
Show license information
API reference for GET /api/v3/show/license
Test scheduling plugin
API reference for POST /api/v3/plugin_test/schedule
Test WAL plugin
API reference for POST /api/v3/plugin_test/wal
Update a database
API reference for PATCH /api/v3/configure/database/{db}
Update a table
API reference for PATCH /api/v3/configure/table
Update plugin directory
API reference for PUT /api/v3/plugins/directory
Update plugin file
API reference for PUT /api/v3/plugins/files
Write line protocol
API reference for POST /api/v3/write_lp
Write line protocol (v1-compatible)
API reference for POST /write
Write line protocol (v2-compatible)
API reference for POST /api/v2/write
Authentication
Depending on your workflow, use one of the following schemes to authenticate to the InfluxDB 3 API:
| Authentication scheme | Works with |
|---|---|
| Bearer… |
Headers and parameters
Most InfluxDB API endpoints require parameters in the request–for example, specifying the database to use.
Common parameters
The following table shows common parameters used by many InfluxDB API…
Migrate from InfluxDB v1 or v2
Migrate your existing InfluxDB v1 or v2 workloads to InfluxDB 3. InfluxDB 3 provides compatibility endpoints that work with InfluxDB 1.x and 2.x client libraries and tools. Operations marked with…
Quick start
- Create an admin token to authorize API requests.
curl -X POST "http://localhost:8181/api/v3/configure/token/admin" - [Check the…
Auth token
Manage tokens for authentication and authorization
Cache data
Manage the in-memory cache.
Distinct Value Cache
The Distinct Value Cache (DVC) lets you cache distinct values of one or more columns in a table, improving the performance of queries that return…
Database
Manage databases
Processing engine
Manage Processing engine triggers, test plugins, and send requests to trigger On Request plugins. InfluxDB 3 Enterprise provides the InfluxDB 3 processing engine, an embedded Python VM that can…
Query data
Query data using SQL or InfluxQL
Server information
Retrieve server metrics, status, and version information
Table
Manage table schemas and data
Write data
Write data to InfluxDB 3 using line protocol format.
Timestamp precision across write APIs
InfluxDB 3 provides multiple write endpoints for compatibility with different InfluxDB versions. The…