Write
/write endpoint./writeWrite data
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
Parameters
Query parameters
db
required
stringrp
stringprecision
stringn
, u
, ms
, s
, m
, hnu
stringp
stringRequest body required
@filename to write from a file.application/jsoncurl --request POST \
"http://localhost:8086/write?db=DB" \
--header "Authorization: Bearer INFLUX_TOKEN" \
--header "Content-Type: text/plain" \
--data-raw 'measurement,tag=value field=1.0'Responses
error
required
stringerror
required
stringerror
required
stringerror
required
stringerror
required
string/api/v2/write
v2Write data (v2 compatible)
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 policydatabase/ordatabase- default retention policy
The org parameter is ignored in InfluxDB 1.x.
Parameters
Query parameters
bucket
required
stringdatabase/retention-policy.
Use database/ or database for the default retention policy.org
stringprecision
stringns
, us
, ms
, snsRequest body required
application/jsoncurl --request POST \
"http://localhost:8086/api/v2/write?bucket=BUCKET" \
--header "Authorization: Bearer INFLUX_TOKEN" \
--header "Content-Type: text/plain" \
--data-raw 'measurement,tag=value field=1.0'Responses
error
required
stringerror
required
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 and this documentation. To find support, use the following resources:
Customers with an annual or support contract can contact InfluxData Support.