---
title: Write data to InfluxDB 3 Core
description: Collect and write time series data to InfluxDB 3 Core.
url: https://docs.influxdata.com/influxdb3/core/write-data/
estimated_tokens: 1855
product: InfluxDB 3 Core
version: core
publisher: InfluxData
canonical: https://docs.influxdata.com/influxdb3/core/write-data/
date: '2025-04-29T21:12:44-05:00'
lastmod: '2025-04-29T21:12:44-05:00'
---

Use tools like the

`influxdb3`CLI, Telegraf, and InfluxDB client libraries
to write time series data to InfluxDB 3 Core.[line protocol](#line-protocol)is the text-based format used to write data to InfluxDB.

> [!Tip]
> Tools are available to convert other formats (for example—[CSV](/influxdb3/core/write-data/use-telegraf/csv/)) to line protocol.

* [Choose the write endpoint for your workload](#choose-the-write-endpoint-for-your-workload)

  * [Timestamp precision across write APIs](#timestamp-precision-across-write-apis)

* [Line protocol](#line-protocol)

  * [Line protocol elements](#line-protocol-elements)

* [Write data to InfluxDB](#write-data-to-influxdb)

  * [Use InfluxDB client libraries to write data](#use-influxdb-client-libraries-to-write-data)
  * [Use the InfluxDB HTTP API to write data](#use-the-influxdb-http-api-to-write-data)
  * [Use Telegraf to write data](#use-telegraf-to-write-data)
  * [Use the influxdb3 CLI to write data](#use-the-influxdb3-cli-to-write-data)
  * [Best practices for writing data](#best-practices-for-writing-data)
  * [Troubleshoot issues writing data](#troubleshoot-issues-writing-data)

#### Choose the write endpoint for your workload

When creating new write workloads, use the[InfluxDB HTTP API `/api/v3/write_lp` endpoint](/influxdb3/core/write-data/http-api/v3-write-lp/)and [client libraries](/influxdb3/core/write-data/client-libraries/).

When bringing existing *v1* write workloads, use the InfluxDB 3 Core
HTTP API [`/write` endpoint](/influxdb3/core/api/write-data/#operation/PostV1Write).

When bringing existing *v2* write workloads, use the InfluxDB 3 Core
HTTP API [`/api/v2/write` endpoint](/influxdb3/core/api/write-data/).

**For Telegraf**, use the InfluxDB v1.x [`outputs.influxdb`](/telegraf/v1/output-plugins/influxdb/) or v2.x [`outputs.influxdb_v2`](/telegraf/v1/output-plugins/influxdb_v2/) output plugins.
See how to [use Telegraf to write data](/influxdb3/core/write-data/use-telegraf/).

## Timestamp precision across write APIs

InfluxDB 3 Core provides multiple write endpoints for compatibility with different InfluxDB versions.
The following table compares timestamp precision support across v1, v2, and v3 write APIs:

|    Precision     |v1 (`/write`)|v2 (`/api/v2/write`)|v3 (`/api/v3/write_lp`)|
|------------------|-------------|--------------------|-----------------------|
|**Auto detection**|    ❌ No     |        ❌ No        |  ✅ `auto` (default)   |
|   **Seconds**    |    ✅ `s`    |       ✅ `s`        |      ✅ `second`       |
| **Milliseconds** |   ✅ `ms`    |       ✅ `ms`       |    ✅ `millisecond`    |
| **Microseconds** |✅ `u` or `µ` |       ✅ `us`       |    ✅ `microsecond`    |
| **Nanoseconds**  |   ✅ `ns`    |       ✅ `ns`       |    ✅ `nanosecond`     |
|   **Minutes**    |    ✅ `m`    |        ❌ No        |         ❌ No          |
|    **Hours**     |    ✅ `h`    |        ❌ No        |         ❌ No          |
|   **Default**    | Nanosecond  |     Nanosecond     |  **Auto** (guessed)   |

* All write endpoints accept timestamps in line protocol format.
* InfluxDB 3 Core multiplies timestamps by the appropriate precision value to convert them to nanoseconds for internal storage.
* All timestamps are stored internally as nanoseconds regardless of the precision specified when writing.

## Line protocol

All data written to InfluxDB is written using[line protocol](/influxdb3/core/reference/line-protocol/), a text-based format
that lets you provide the necessary information to write a data point to InfluxDB.

### Line protocol elements

In InfluxDB, a point contains a table name, one or more fields, a timestamp,
and optional tags that provide metadata about the observation.

Each line of line protocol contains the following elements:

\* Required

* \* **table**: A string that identifies the
  table to store the data in.
* **tag set**: Comma-delimited list of key value pairs, each representing a tag.
  Tag keys and values are unquoted strings. *Spaces, commas, and equal characters
  must be escaped.*
* \* **field set**: Comma-delimited list of key value pairs, each
  representing a field.
  Field keys are unquoted strings. *Spaces and commas must be escaped.*Field values can be [strings](/influxdb3/core/reference/line-protocol/#string)(quoted),[floats](/influxdb3/core/reference/line-protocol/#float),[integers](/influxdb3/core/reference/line-protocol/#integer),[unsigned integers](/influxdb3/core/reference/line-protocol/#uinteger),
  or [booleans](/influxdb3/core/reference/line-protocol/#boolean).
* **timestamp**: [Unix timestamp](/influxdb3/core/reference/line-protocol/#unix-timestamp)associated with the data. InfluxDB supports up to nanosecond precision.*If the precision of the timestamp is not in nanoseconds, you must specify the
  precision when writing the data to InfluxDB.*

#### Line protocol element parsing

* **table**: Everything before the *first unescaped comma before the first
  whitespace*.
* **tag set**: Key-value pairs between the *first unescaped comma* and the *first
  unescaped whitespace*.
* **field set**: Key-value pairs between the *first and second unescaped whitespaces*.
* **timestamp**: Integer value after the *second unescaped whitespace*.
* Lines are separated by the newline character (`\n`).
  Line protocol is whitespace sensitive.

myTable,tag1=val1,tag2=val2 field1="v1",field2=1i 0000000000000000000

*For schema design recommendations, see[InfluxDB schema design](/influxdb3/core/write-data/best-practices/schema-design/).*

## Write data to InfluxDB

### [Use InfluxDB client libraries to write data](/influxdb3/core/write-data/client-libraries/)

Use InfluxDB API clients to write points as line protocol data to InfluxDB 3 Core.

### [Use the InfluxDB HTTP API to write data](/influxdb3/core/write-data/http-api/)

Use the `/api/v3/write_lp`, `/api/v2/write`, or `/write` HTTP API endpoints to write data to InfluxDB 3 Core.

### [Use Telegraf to write data](/influxdb3/core/write-data/use-telegraf/)

Use Telegraf to collect and write data to InfluxDB 3 Core.

### [Use the influxdb3 CLI to write data](/influxdb3/core/write-data/influxdb3-cli/)

Use the [`influxdb3` CLI](/influxdb3/core/reference/cli/influxdb3/) to write line protocol data to InfluxDB 3 Core.

### [Best practices for writing data](/influxdb3/core/write-data/best-practices/)

Learn about the recommendations and best practices for writing data to InfluxDB 3 Core.

### [Troubleshoot issues writing data](/influxdb3/core/write-data/troubleshoot/)

Troubleshoot issues writing data. Find response codes for failed writes. Discover how writes fail, from exceeding rate or payload limits, to syntax errors and schema conflicts.

[write](/influxdb3/core/tags/write/)[line protocol](/influxdb3/core/tags/line-protocol/)
| Precision | v1 ( /write ) | v2 ( /api/v2/write ) | v3 ( /api/v3/write_lp ) |
| --- | --- | --- | --- |
| Precision | v1 ( /write ) | v2 ( /api/v2/write ) | v3 ( /api/v3/write_lp ) |
| Auto detection | ❌ No | ❌ No | ✅  auto  (default) |
| Seconds | ✅  s | ✅  s | ✅  second |
| Milliseconds | ✅  ms | ✅  ms | ✅  millisecond |
| Microseconds | ✅  u  or  µ | ✅  us | ✅  microsecond |
| Nanoseconds | ✅  ns | ✅  ns | ✅  nanosecond |
| Minutes | ✅  m | ❌ No | ❌ No |
| Hours | ✅  h | ❌ No | ❌ No |
| Default | Nanosecond | Nanosecond | Auto  (guessed) |
