---
title: Write
description: Write time series data to InfluxDB Enterprise v1 in line protocol format using the /write endpoint.
url: https://docs.influxdata.com/enterprise_influxdb/v1/api/write/
estimated_tokens: 4070
product: InfluxDB Enterprise v1
version: v1
---

[Download InfluxDB Enterprise v1 API Spec](/openapi/influxdb-enterprise-v1-openapi.yml)

Write time series data to InfluxDB Enterprise v1 in line protocol format using the `/write` endpoint.

POST `/write`

### Write 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`](/enterprise_influxdb/v1/concepts/clustering/#write-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](/enterprise_influxdb/v1/concepts/clustering/#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 string

Target database for the write

`rp` string

Target retention policy. If not specified, writes to the default retention policy.

`precision` string

Timestamp precision. InfluxDB assumes nanoseconds if not specified.

Allowed values: `n` , `u` , `ms` , `s` , `m` , `h`

Default: `n`

`consistency` string

**Enterprise only.** Sets the write consistency for the point. See [write consistency documentation](/enterprise_influxdb/v1/concepts/clustering#write-consistency) for detailed descriptions of each option.

Allowed values: `any` , `one` , `quorum` , `all`

Default: `one`

`u` string

Username for authentication

`p` string

Password for authentication

#### Request body required

Line protocol data. Multiple points should be separated by newlines. Use `@filename` to write from a file.

Content-Type: `application/json`

Example request [Ask AI about this](#)

```sh
curl --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

204 Write successful

400 Bad request (line protocol syntax error or type conflict)

`error` required string

Error message

401 Unauthorized

`error` required string

Error message

404 Database not found

`error` required string

Error message

413 Request entity too large

`error` required string

Error message

500 Internal server error (e.g., retention policy not found)

`error` required string

Error message

POST `/api/v2/write` v2

### Write 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 policy
-   `database/` or `database` - default retention policy

The `org` parameter is ignored in InfluxDB Enterprise 1.x.

#### Parameters

##### Query parameters

`bucket` required string

Database and retention policy in format `database/retention-policy`. Use `database/` or `database` for the default retention policy.

`org` string

Organization (ignored in InfluxDB Enterprise 1.x)

`precision` string

Timestamp precision

Allowed values: `ns` , `us` , `ms` , `s`

Default: `ns`

#### Request body required

Content-Type: `application/json`

Example request [Ask AI about this](#)

```sh
curl --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

204 Write successful

400 Bad request

`error` required string

Error message

401 Unauthorized

`error` required string

Error message
