Write
/write endpoint./writeWrite data
Write time series data to InfluxDB Enterprise 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.
Enterprise write consistency
In a cluster, the consistency query parameter controls when /write returns success based on how many data nodes have acknowledged a write.
| Value | Returns success when… |
|---|---|
any | Any node acknowledges the write, or the receiving node queues it for hinted handoff. |
one (default) | Any node acknowledges the write (hinted handoff alone does not count). |
quorum | A majority of replicas acknowledge the write. Equivalent to all when replication factor ≤ 2. |
all | All replicas acknowledge the write. |
For replication-factor interactions and recovery semantics, see Write consistency.
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
, hnconsistency
stringany
, one
, quorum
, alloneu
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 Enterprise 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 Enterprise v1 and this documentation. To find support, use the following resources:
Customers with an annual or support contract can contact InfluxData Support.