---
title: "Perform batch operations"
method: POST
path: "/v1/{appId}/batch"
tags: ["Batch operations"]
---

# Perform batch operations

`POST /v1/{appId}/batch`

## Request

- Base URL: `https://api.talkjs.com`
- URL: `https://api.talkjs.com/v1/{appId}/batch`
- Auth: one of:
  - HTTP bearer
  - HTTP bearer
- TypeScript: <https://skmtc.dev/talkjs/apis/talkjs-api/docs/v1/:appId/batch/post.ts> (a function with typed inputs; its response is checked against the schema)

Performs multiple operations in a batch with a single request. You can include a maximum of 10 operations in a single batch request. For batch requests, the REST API rate limits support 500 burst requests, a maximum of 100 requests in the queue, and 1 batch request per second.

### Request

The payload must be an array of operations. Each operation must have the following format:

`[sequence_number, method, path, payload, options]`

You can include any TalkJS REST API operation in a batch operation, as long as its request has JSON content, or is empty. 

You can't upload files as part of a batch operation, because file uploads require `multipart/form-data`-formatted data. To upload a file, use the 'Upload file' resource instead.

### Response

The response is an array of operation responses. Each operation response has the format:

`[sequence_number, http_status_code, operation_response]`

## Path parameters

- `appId` string, required

## Request body

- union[]: An array of operations to perform in a batch.
  - union
    - integer
    - string
    - object
      - `sequence_number` integer, required: Integer that uniquely identifies the operation. **Note:** The sequence number only acts as an identifier, and doesn't determine the order in which operations are executed. If your operations need to happen in a specific order, then request those operations in separate calls.
      - `method` 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE', required: HTTP method for the operation
      - `path` string, required: Path of the REST API endpoint for the operation that's appended to the `/v1/{appId}` baseUrl
      - `payload` object: JSON payload. You can use `payload` for PUT and POST requests to specify the payload associated with the REST API operation. You can also use `payload` with string keys and values to specify query parameters to filter results of a GET request.
      - `options` object: Mapping containing the key `api_version`, and a string value with the API version

## Response `200`

Batch operation performed successfully.

- union[]: An array of operation responses.
  - union: A single operation response
    - integer
    - unknown[]
      - unknown
    - object
      - `sequence_number` integer: Unique identifier of the operation. Corresponds to the `sequence_number` that was set in the request.
      - `http_status_code` integer: Numeric HTTP status code for the REST operation
      - `operation_response` union: JSON data returned by the REST operation
        - string
        - object
        - unknown[]
          - unknown
    - string

## Other responses

- `400`: Bad request
- `401`: Authorization information is missing or invalid.
- `404`: Resource not found
- `415`: Unsupported media type
- `429`: Too many requests
- `500`: Internal server error

---

[API](https://skmtc.dev/talkjs/apis/talkjs-api.md) - [All operations](https://skmtc.dev/talkjs/apis/talkjs-api/llms.txt) - [OpenAPI document](https://skmtc.dev/talkjs/apis/talkjs-api/revisions/9d4acc9cfa43?raw)
