All Products
Search
Document Center

Time Series Database:Write data

Last Updated:Mar 28, 2026

Use POST /api/put to write one or more data points to Time Series Database (TSDB) in a single request.

Quick start

The following example writes two data points using curl. Replace the placeholder values before running.

curl -X POST 'http://<your-tsdb-endpoint>/api/put?summary' \
  -H 'Content-Type: application/json' \
  -d '[
    {
      "metric": "sys.cpu.nice",
      "timestamp": 1346846400,
      "value": 18,
      "tags": {"host": "web01", "dc": "lga"}
    },
    {
      "metric": "sys.cpu.nice",
      "timestamp": 1346846400,
      "value": 9,
      "tags": {"host": "web02", "dc": "lga"}
    }
  ]'
PlaceholderDescriptionExample
<your-tsdb-endpoint>Your TSDB instance addresstsdb.example.com:4242

Endpoint

Request pathRequest methodDescription
/api/putPOSTWrites multiple data points at a time

Query parameters

Append these parameters to the request URL to control the response format.

ParameterTypeRequiredDefaultDescriptionExample
summaryUntypedNofalseReturns the count of successful and failed writes/api/put?summary
detailsUntypedNofalseReturns the count plus error details for failed data points/api/put?details
sync_timeoutIntegerNo0Timeout in milliseconds. 0 means no timeout./api/put?sync&sync_timeout=60000
ignoreErrorsUntypedNofalseContinues writing remaining data points when one fails/api/put?ignoreErrors
For untyped parameters, the system treats the parameter as true whenever it appears in the URL, regardless of the value assigned. For example, both ?summary=true and ?summary=false activate summary mode. If you specify both details and summary, the API returns details.

Request body

Specify data points as a JSON array. Each element represents one data point.

ParameterTypeRequiredConstraintDescriptionExample
metricStringYesLetters, digits, and - _ . / ( ) : , [ ] = ' #The metric namesys.cpu.nice
timestampLongYesSee Timestamp rulesUnix timestamp in seconds or milliseconds1346846400
valueLong, Double, String, BooleanYesString values cannot exceed 20 KBThe data point value18, "High CPU Load", true
tagsMapNoSame character set as metric; at least one key-value pair requiredTag key-value pairs{"host": "web01", "dc": "lga"}
In the High-availability Edition, the metric name can be up to 255 bytes in length.

Tags that are not of the String type are automatically converted to String.

Timestamp rules

TSDB automatically determines whether a timestamp is in seconds or milliseconds based on its numeric value. The same rules apply to both /api/put and /api/query.

Value rangeUnitCorresponding date range
4,294,968 – 4,294,967,295Seconds1970-02-20 01:02:48 – 2106-02-07 14:28:15
4,294,967,296 – 9,999,999,999,999Milliseconds1970-02-20 01:02:47.296 – 2286-11-21 01:46:39.999
Outside both rangesInvalid

Write modes and responses

By default, POST /api/put returns HTTP 204 with no body if all data points are written successfully. Add query parameters to get additional response detail or to isolate individual write failures.

Simple mode (default)

Send the request with no mode parameters.

  • Success: HTTP 204, no response body

  • Failure: HTTP error code and error message

Use this mode for general monitoring data where minimal overhead is needed.

Statistical mode

Add ?summary to get a count of successes and failures.

POST /api/put?summary

Response parameters:

ParameterTypeDescription
successIntegerNumber of data points written successfully
failedIntegerNumber of data points that failed to write

Example response:

{
  "failed": 0,
  "success": 20
}
Important

In statistical mode, all data points in a single request either succeed or fail together. If any write fails, failed equals the total number of data points in the request.

Use this mode when you need to track how many data points were accepted.

Detailed mode

Add ?details to get error information alongside the success and failure counts. Detailed mode is an extension of statistical mode.

POST /api/put?details

Response parameters:

ParameterTypeDescription
successIntegerNumber of data points written successfully
failedIntegerNumber of data points that failed to write
errorsArrayThe first failed data point and its failure cause

Example response:

{
  "errors": [
    {
      "datapoint": {
        "metric": "sys.cpu.nice",
        "timestamp": 1365465600,
        "value": "NaN",
        "tags": {"host": "web01"}
      },
      "error": "Unable to parse value to a number"
    }
  ],
  "failed": 1,
  "success": 0
}
Important

In detailed mode, all data points in a single request either succeed or fail together. The errors array contains only the first failed data point. To see how many data points failed, check the failed parameter.

Use this mode when you need to locate write failures.

Fault-tolerant mode

Add ?ignoreErrors to allow the request to continue writing remaining data points when one fails.

POST /api/put?ignoreErrors

Response parameters:

ParameterTypeDescription
successIntegerNumber of data points written successfully
failedIntegerNumber of data points that failed to write
errorsArrayEach failed data point and its failure cause
Important

Unlike statistical and detailed modes, fault-tolerant mode does not treat the request atomically — a failure in one data point does not affect the others. The errors array contains every failed data point, not just the first. Data points not listed in errors were written successfully.

  • If some (but not all) data points fail: HTTP 200

  • If all data points fail due to a critical error (such as underlying storage failure): non-200 status code

Use this mode when you need to maximize the number of data points written and handle individual failures separately.

Limitations

Maximum tag keys per time series

The maximum number of tag keys in a single time series depends on the instance type.

Instance typeMaximum tag keys
mLarge16
Large16
3xLarge20
4xLarge20
6xLarge20
12xLarge20
24xLarge24
48xLarge24
96xLarge24

String values

String values can contain any characters and can be stored in JSON format. The maximum size of a string value is 20 KB.