Write data
Write data to InfluxDB 3 Core 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.
/api/v3/write_lpWrite line protocol
Writes line protocol to the specified database.
This is the native InfluxDB 3 Core write endpoint that provides enhanced control over write behavior with advanced parameters for high-performance and fault-tolerant operations.
Use this endpoint to send data in line protocol format to InfluxDB. Use query parameters to specify options for writing data.
Features
- Partial writes: Use
accept_partial=trueto allow partial success when some lines in a batch fail - Asynchronous writes: Use
no_sync=trueto skip waiting for WAL synchronization, allowing faster response times but sacrificing durability guarantees - Flexible precision: Automatic timestamp precision detection with
precision=auto(default)
Auto precision detection
When you use precision=auto or omit the precision parameter, InfluxDB 3 automatically detects
the timestamp precision based on the magnitude of the timestamp value:
- Timestamps < 5e9 → Second precision (multiplied by 1,000,000,000 to convert to nanoseconds)
- Timestamps < 5e12 → Millisecond precision (multiplied by 1,000,000)
- Timestamps < 5e15 → Microsecond precision (multiplied by 1,000)
- Larger timestamps → Nanosecond precision (no conversion needed)
Related
Parameters
Query parameters
db
required
stringaccept_partial
stringprecision
stringno_sync
stringHeader parameters
Content-Type
stringAccept
stringapplication/jsonapplication/jsonContent-Encoding
stringContent-Encoding: gzip header.Content-Length
stringRequest body
application/jsoncurl --request POST \
"https://localhost:8181/api/v3/write_lp?db=DB" \
--header "Authorization: Bearer INFLUX_TOKEN" \
--header "Content-Type: text/plain" \
--data-raw 'measurement,tag=value field=1 1234567890'Responses
data
objecterror
string/api/v2/write
v2Write line protocol (v2-compatible)
Writes line protocol to the specified database.
This endpoint provides backward compatibility for InfluxDB 2.x write workloads using tools such as InfluxDB 2.x client libraries, the Telegraf outputs.influxdb_v2 output plugin, or third-party tools.
Use this endpoint to send data in line protocol format to InfluxDB. Use query parameters to specify options for writing data.
Related
Parameters
Query parameters
bucket
required
stringA database name. InfluxDB creates the database if it doesn’t already exist, and then writes all points in the batch to the database.
This parameter is named bucket for compatibility with InfluxDB v2 client libraries.
accept_partial
stringprecision
stringHeader parameters
Content-Type
stringContent-Encoding
stringContent-Encoding: gzip header.gzip
, identityidentityContent-Length
integerAccept
stringapplication/jsonapplication/jsonRequest body
application/jsoncurl --request POST \
"https://localhost:8181/api/v2/write?bucket=BUCKET" \
--header "Authorization: Bearer INFLUX_TOKEN" \
--header "Content-Type: text/plain" \
--data-raw 'measurement,tag=value field=1 1234567890'Responses
data
objecterror
string/write
v1Write line protocol (v1-compatible)
Writes line protocol to the specified database.
This endpoint provides backward compatibility for InfluxDB 1.x write workloads using tools such as InfluxDB 1.x client libraries, the Telegraf outputs.influxdb output plugin, or third-party tools.
Use this endpoint to send data in line protocol format to InfluxDB. Use query parameters to specify options for writing data.
Related
Parameters
Query parameters
db
required
stringprecision
stringu
stringp
stringp value is an authorized token.rp
stringconsistency
stringHeader parameters
Authorization
stringAuthorization header for token-based authentication. Supported schemes:
Bearer AUTH_TOKEN- OAuth bearer token schemeToken AUTH_TOKEN- InfluxDB v2 token schemeBasic <base64-encoded USERNAME:AUTH_TOKEN>- Basic authentication (username is ignored)
Content-Type
stringAccept
stringapplication/jsonapplication/jsonContent-Encoding
stringContent-Encoding: gzip header.Content-Length
stringRequest body
application/jsoncurl --request POST \
"https://localhost:8181/write?db=DB" \
--header "Authorization: Bearer INFLUX_TOKEN" \
--header "Content-Type: text/plain" \
--data-raw 'measurement,tag=value field=1 1234567890'Responses
Bad request. Some (a partial write) or all of the data from the batch was rejected and not written. If a partial write occurred, then some points from the batch are written and queryable.
The response body:
- indicates if a partial write occurred or all data was rejected.
- contains details about the rejected points, up to 100 points.
data
objecterror
stringWas this page helpful?
Thank you for your feedback!
Support and feedback
Thank you for being part of our community! We welcome and encourage your feedback and bug reports for InfluxDB 3 Core and this documentation. To find support, use the following resources:
Customers with an annual or support contract can contact InfluxData Support.