# Store items


```
POST 
https://api.apify.com/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.

## Request

### Path Parameters

* **datasetId** string required

  Dataset ID or `username~dataset-name`.

  **Example:** `WkzbQMuFYuamGv3YF`

### Body array**required**

* **property name\*** any

  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.

  **Example:** `{"title":"Example Item","url":"https://example.com","price":19.99}`

### Status 201

**Response Headers**

* **Location**


```
{}
```


**Schema**

* **object** object\
  **Example:** `{}`

### Status 400

**Response Headers**




```
{
  "error": {
    "type": "schema-validation-error",
    "message": "Schema validation failed",
    "data": {
      "invalidItems": [
        {
          "itemPosition": 2,
          "validationErrors": [
            {
              "instancePath": "/1/stringField",
              "schemaPath": "/items/properties/stringField/type",
              "keyword": "type",
              "params": {
                "type": "string"
              },
              "message": "must be string"
            }
          ]
        }
      ]
    }
  }
}
```


**Schema**

* **error** object required

  * **type** string

    The type of the error.

    **Example:** `schema-validation-error`

  * **message** string

    A human-readable message describing the error.

    **Example:** `Schema validation failed`

  * **data** object

    * **invalidItems** object\[] required

      A list of invalid items in the received array of items.

      * **itemPosition** integer

        The position of the invalid item in the array.

        **Example:** `2`

      * **validationErrors** object\[]

        A complete list of AJV validation error objects for the invalid item.

        * **instancePath** string

          The path to the instance being validated.

        * **schemaPath** string

          The path to the schema that failed the validation.

        * **keyword** string

          The validation keyword that caused the error.

        * **message** string

          A message describing the validation error.

        * **params** object

          Additional parameters specific to the validation error.

### Status 404

Not found - the requested resource was not found.


```
{
  "error": {
    "type": "record-not-found",
    "message": "Dataset was not found"
  }
}
```


**Schema**

* **error** object

  * **type** string

    **Possible values:** \[`record-not-found`]

  * **message** string\
    **Example:** `Dataset was not found`
