Legacy Write

Write data using the v1-compatible /write endpoint in InfluxDB Cloud.
POST /write

Write time series data into InfluxDB in a V1-compatible format

Parameters

Query parameters
u string
The InfluxDB 1.x username to authenticate the request.
p string
The InfluxDB 1.x password to authenticate the request.
db required string
Bucket to write to. If none exists, InfluxDB creates a bucket with a default 3-day retention policy.
rp string
Retention policy name.
precision string
Write precision.
Header parameters
Zap-Trace-Span string
OpenTracing span context
Content-Encoding string
When present, its value indicates to the database that compression is applied to the line protocol body.
Allowed values: gzip , identity
Default: identity

Request body required

Line protocol body
Content-Type: application/json
Example request Ask AI about this
curl --request POST \
  "https://us-east-1-1.aws.cloud2.influxdata.com/write?db=DB" \
  --header "Authorization: Bearer INFLUX_TOKEN" \
  --header "Content-Type: text/plain" \
  --data-raw 'measurement,tag=value field=1.0'

Responses

204 Write data is correctly formatted and accepted for writing to the bucket.
400 Line protocol poorly formed and no points were written. Response can be used to determine the first malformed line in the body line-protocol. All data in body was rejected and not written.
code required string
Code is the machine-readable error code.
Allowed: internal error , not found , conflict , invalid , empty value , unavailable
err string
Stack of errors that occurred during processing of the request. Useful for debugging.
line integer <int32>
First line in the request body that contains malformed data.
message string
Human-readable message.
op string
Describes the logical code operation when the error occurred. Useful for debugging.
401 Token doesn’t have sufficient permissions to write to this organization and bucket or the organization and bucket do not exist.
code required string
code is the machine-readable error code.
Allowed: internal error , not implemented , not found , conflict , invalid , unprocessable entity , empty value , unavailable , forbidden , too many requests , unauthorized , method not allowed , request too large , unsupported media type
err string
Stack of errors that occurred during processing of the request. Useful for debugging.
message string
Human-readable message.
op string
Describes the logical code operation when the error occurred. Useful for debugging.
403 No token was sent and they are required.
code required string
code is the machine-readable error code.
Allowed: internal error , not implemented , not found , conflict , invalid , unprocessable entity , empty value , unavailable , forbidden , too many requests , unauthorized , method not allowed , request too large , unsupported media type
err string
Stack of errors that occurred during processing of the request. Useful for debugging.
message string
Human-readable message.
op string
Describes the logical code operation when the error occurred. Useful for debugging.
413 Write has been rejected because the payload is too large. Error message returns max size supported. All data in body was rejected and not written.
code required string
Code is the machine-readable error code.
Allowed: invalid
message required string
Human-readable message.
429 Token is temporarily over quota. The Retry-After header describes when to try the write again.
503 Server is temporarily unavailable to accept writes. The Retry-After header describes when to try the write again.
default Internal server error
code required string
code is the machine-readable error code.
Allowed: internal error , not implemented , not found , conflict , invalid , unprocessable entity , empty value , unavailable , forbidden , too many requests , unauthorized , method not allowed , request too large , unsupported media type
err string
Stack of errors that occurred during processing of the request. Useful for debugging.
message string
Human-readable message.
op string
Describes the logical code operation when the error occurred. Useful for debugging.

Was this page helpful?

Thank you for your feedback!