---
title: "Batch"
method: POST
path: "/{databaseId}/batch/"
tags: ["Miscellaneous"]
---

# Batch

`POST /{databaseId}/batch/`

Batch processing allows you to submit arbitrary sequence of requests within a single HTTPS request.

Any type of request from the above documentation may be used in the Batch, and the Batch may combine different types of requests arbitrarily as well.

Using Batch requests is beneficial for example, when synchronizing the catalog of items or uploading historical interaction data, as sending the data in Batch is considerably faster than sending the individual requests (thanks to optimizations and  reducing network and HTTPS overhead).

## Path parameters

- `databaseId` string, required

## Request body

- Batch
  - `requests` object[], required — JSON array containing the requests.
  - `distinctRecomms` boolean — Makes all the recommended items for a certain user distinct among multiple recommendation requests in the batch.

## Response `200`

Successful operation. There is an array with responses. The order of the responses in the array follows the order of the sent requests.

## Other responses

- `400` — Many possibilities, see the error description in the result JSON. Examples: invalid or missing Content-type (not `application/json`), request body is not a valid JSON, request JSON does not have the prescribed structure.
- `404` — There is at least one request in the batch with an invalid (non-existing) URL. In such a case, the batch as a whole **is not executed** and you'll get HTTP 404, because the batch is apriori erroneous.
- `413` — Too large batch (containing more than 10,000 requests in case of a server side request).

---

[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)
