---
title: "Store items"
method: POST
path: "/v2/datasets/{datasetId}/items"
tags: ["Storage/Datasets"]
---

# Store items

`POST /v2/datasets/{datasetId}/items`

Appends an item or an array of items to the end of the dataset.
The POST payload is a JSON object or a JSON array of objects to save into the dataset.

If the data you attempt to store in the dataset is invalid (meaning any of the items received by the API fails the validation), the whole request is discarded and the API will return a response with status code 400.
For more information about dataset schema validation, see [Dataset schema](https://docs.apify.com/platform/actors/development/actor-definition/dataset-schema/validation).

**IMPORTANT:** The limit of request payload size for the dataset is 5 MB. If the array exceeds the size, you'll need to split it into a number of smaller arrays.

To save bandwidth and speed up your upload, you can send the request payload compressed and set the `Content-Encoding` header accordingly.

Below is a list of supported `Content-Encoding` types.

* Brotli: `Content-Encoding: br`
* Gzip: `Content-Encoding: gzip`
* Deflate: `Content-Encoding: deflate`

## Path parameters

- `datasetId` string, required

## Headers

- `Content-Encoding` 'br' | 'gzip' | 'deflate' | 'identity'

## Request body

- union
  - PutItemsRequest — The request body containing the item(s) to add to the dataset. Can be a single object or an array of objects. Each object represents one dataset item.
  - PutItemsRequest[]

## Response `201`

- object

## Other responses

- `400`
- `401` — Unauthorized - authentication required or invalid token.
- `403` — Forbidden - insufficient permissions to perform this action.
- `404` — Not found - the requested resource does not exist.
- `405` — Method not allowed.
- `413` — Payload too large - the request body exceeds the size limit.
- `415` — Unsupported media type - the Content-Encoding of the request is not supported.
- `429` — Too many requests - rate limit exceeded.

---

[API](https://skmtc.net/apify/apis/apify-api.md) · [All operations](https://skmtc.net/apify/apis/apify-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/apify/apify-api/versions/01a71794279b/schema)
