You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Writes data to a bucket. Use this endpoint to send data in [line protocol](https://docs.influxdata.com/influxdb/latest/reference/syntax/line-protocol/) format to InfluxDB. #### InfluxDB Cloud - Does the following when you send a write request: 1. Validates the request and queues the write. 2. If queued, responds with _success_ (HTTP `2xx` status code); _error_ otherwise. 3. Handles the delete asynchronously and reaches eventual consistency. To ensure that InfluxDB Cloud handles writes and deletes in the order you request them, wait for a success response (HTTP `2xx` status code) before you send the next request. Because writes and deletes are asynchronous, your change might not yet be readable when you receive the response. #### InfluxDB OSS - Validates the request and handles the write synchronously. - If all points were written successfully, responds with HTTP `2xx` status code; otherwise, returns the first line that failed. #### Required permissions - `write-buckets` or `write-bucket BUCKET_ID`. *`BUCKET_ID`* is the ID of the destination bucket. #### Rate limits (with InfluxDB Cloud) `write` rate limits apply. For more information, see [limits and adjustable quotas](https://docs.influxdata.com/influxdb/cloud/account-management/limits/). #### Related guides - [Write data with the InfluxDB API](https://docs.influxdata.com/influxdb/latest/write-data/developer-tools/api) - [Optimize writes to InfluxDB](https://docs.influxdata.com/influxdb/latest/write-data/best-practices/optimize-writes/) - [Troubleshoot issues writing data](https://docs.influxdata.com/influxdb/latest/write-data/troubleshoot/)
57
+
Writes data to a bucket.
58
+
Use this endpoint to send data in
59
+
[line protocol](https://docs.influxdata.com/influxdb/latest/reference/syntax/line-protocol/) format
60
+
to InfluxDB.
61
+
#### InfluxDB Cloud
62
+
- Does the following when you send a write request:
63
+
1. Validates the request and queues the write.
64
+
2. If queued, responds with _success_ (HTTP `2xx` status code); _error_ otherwise.
65
+
3. Handles the delete asynchronously and reaches eventual consistency.
66
+
To ensure that InfluxDB Cloud handles writes and deletes in the order you request them, wait for a success
67
+
response (HTTP `2xx` status code) before you send the next request. Because writes and deletes are
68
+
asynchronous, your change might not yet be readable when you receive the response.
69
+
#### InfluxDB OSS
70
+
- Validates the request and handles the write synchronously.
71
+
- If all points were written successfully, responds with HTTP `2xx` status code;
72
+
otherwise, returns the first line that failed. #### Required permissions
73
+
- `write-buckets` or `write-bucket BUCKET_ID`. *`BUCKET_ID`* is the ID of the destination bucket.
:param str org: An organization name or ID. #### InfluxDB Cloud - Doesn't use the `org` parameter or `orgID` parameter. - Writes data to the bucket in the organization associated with the authorization (API token). #### InfluxDB OSS - Requires either the `org` parameter or the `orgID` parameter. - If you pass both `orgID` and `org`, they must both be valid. - Writes data to the bucket in the specified organization. (required)
68
-
:param str bucket: A bucket name or ID. InfluxDB writes all points in the batch to the specified bucket. (required)
69
-
:param str body: In the request body, provide data in [line protocol format](https://docs.influxdata.com/influxdb/latest/reference/syntax/line-protocol/). To send compressed data, do the following: 1. Use [GZIP](https://www.gzip.org/) to compress the line protocol data. 2. In your request, send the compressed data and the `Content-Encoding: gzip` header. #### Related guides - [Best practices for optimizing writes](https://docs.influxdata.com/influxdb/latest/write-data/best-practices/optimize-writes/) (required)
89
+
:param str org: An organization name or ID.
90
+
#### InfluxDB Cloud - Doesn't use the `org` parameter or `orgID` parameter.
91
+
- Writes data to the bucket in the organization associated with the authorization (API token).
92
+
#### InfluxDB OSS - Requires either the `org` parameter or the `orgID` parameter.
93
+
- If you pass both `orgID` and `org`, they must both be valid.
94
+
- Writes data to the bucket in the specified organization. (required)
95
+
:param str bucket: A bucket name or ID. InfluxDB writes all points in the batch to the
96
+
specified bucket. (required)
97
+
:param str body: In the request body, provide data in
:param str content_encoding: The compression applied to the line protocol in the request payload. To send a GZIP payload, pass `Content-Encoding: gzip` header.
72
-
:param str content_type: The format of the data in the request body. To send a line protocol payload, pass `Content-Type: text/plain; charset=utf-8`.
73
-
:param int content_length: The size of the entity-body, in bytes, sent to InfluxDB. If the length is greater than the `max body` configuration option, the server responds with status code `413`.
74
-
:param str accept: The content type that the client can understand. Writes only return a response body if they fail--for example, due to a formatting problem or quota limit. #### InfluxDB Cloud - Returns only `application/json` for format and limit errors. - Returns only `text/html` for some quota limit errors. #### InfluxDB OSS - Returns only `application/json` for format and limit errors. #### Related guides - [Troubleshoot issues writing data](https://docs.influxdata.com/influxdb/latest/write-data/troubleshoot/)
75
-
:param str org_id: An organization ID. #### InfluxDB Cloud - Doesn't use the `org` parameter or `orgID` parameter. - Writes data to the bucket in the organization associated with the authorization (API token). #### InfluxDB OSS - Requires either the `org` parameter or the `orgID` parameter. - If you pass both `orgID` and `org`, they must both be valid. - Writes data to the bucket in the specified organization.
106
+
:param str content_encoding: The compression applied to the line protocol in the request payload.
107
+
To send a GZIP payload, pass `Content-Encoding: gzip` header.
108
+
:param str content_type: The format of the data in the request body. To send a line protocol payload,
109
+
pass `Content-Type: text/plain; charset=utf-8`.
110
+
:param int content_length: The size of the entity-body, in bytes, sent to InfluxDB. If the length is greater
111
+
than the `max body` configuration option, the server responds with status code `413`.
112
+
:param str accept: The content type that the client can understand. Writes only return a response body
113
+
if they fail--for example, due to a formatting problem or quota limit.
114
+
#### InfluxDB Cloud
115
+
- Returns only `application/json` for format and limit errors.
116
+
- Returns only `text/html` for some quota limit errors.
117
+
#### InfluxDB OSS
118
+
- Returns only `application/json` for format and limit errors.
- Doesn't use the `org` parameter or `orgID` parameter.
124
+
- Writes data to the bucket in the organization associated with the authorization (API token).
125
+
#### InfluxDB OSS
126
+
- Requires either the `org` parameter or the `orgID` parameter.
127
+
- If you pass both `orgID` and `org`, they must both be valid.
128
+
- Writes data to the bucket in the specified organization.
76
129
:param WritePrecision precision: The precision for unix timestamps in the line protocol batch.
77
-
:param bool no_sync: Instructs the server whether to wait with the response until WAL persistence completes. True value means faster write but without the confirmation that the data was persisted. Note: This option is supported by InfluxDB 3 Core and Enterprise servers only. For other InfluxDB 3 server types (InfluxDB Clustered, InfluxDB Clould Serverless/Dedicated) the write operation will fail with an error.
130
+
:param bool no_sync: Instructs the server whether to wait with the response until WAL persistence completes.
131
+
True value means faster write but without the confirmation that the data was persisted.
132
+
Note: This option is supported by InfluxDB 3 Core and Enterprise servers only.
133
+
For other InfluxDB 3 server types (InfluxDB Clustered, InfluxDB Clould Serverless/Dedicated) the write
0 commit comments