---
title: "Insert to Series"
method: POST
path: "/{databaseId}/series/{seriesId}/items/"
tags: ["Series"]
---

# Insert to Series

`POST /{databaseId}/series/{seriesId}/items/`

Inserts an existing item/series into a series of the given seriesId at a position determined by time.

## Path parameters

- `databaseId` string, required
- `seriesId` string, required

## Request body

- SeriesItem
  - `itemType` string, required — `item` iff the regular item from the catalog is to be inserted, `series` iff series is inserted as the item.
  - `itemId` string, required — ID of the item iff `itemType` is `item`. ID of the series iff `itemType` is `series`.
  - `time` number, double, required — Time index used for sorting items in the series. According to time, items are sorted within series in ascending order. In the example of TV show episodes, the episode number is a natural choice to be passed as time.
  - `cascadeCreate` boolean — Indicates that any non-existing entity specified within the request should be created (as if corresponding PUT requests were invoked). This concerns both the `seriesId` and the `itemId`. If `cascadeCreate` is set to true, the behavior also depends on the `itemType`. In case of `item`, an item is created, in case of `series` a series + corresponding item with the same ID is created.

## Response `200`

Successful operation.

## Other responses

- `400` — `seriesId` or `itemId` does not match ^[a-zA-Z0-9_\-:@\.]+$, or `itemType`∉{item,series}, or `time` is not a real number.
- `404` — Series of the given `seriesId` is not present in the database. Item of the given `itemId` is not present in the database if `itemType` is item. Series of the given `itemId` is not present in the database if `itemType` is series. If there is no additional info in the JSON response, you probably have an error in your URL.
- `409` — A series item of the exact same (`itemType`, `itemId`, `time`) is already present in the series of `seriesId`. In many cases, you may consider this code a success – it only tells you that nothing has been written to the database.

---

[API](https://skmtc.dev/recombee/apis/recombee-api.md) · [All operations](https://skmtc.dev/recombee/apis/recombee-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/recombee/recombee-api/revisions/a9c9c33eb2e8/schema)
