> ## Documentation Index
> Fetch the complete documentation index at: https://www.text.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Sending batch requests

> Manage multiple agents or bots in a single request using batch methods.

Batch methods let you run the same operation on multiple resources at once, reducing the number of requests needed to manage your license at scale. Each item in a batch is processed concurrently — the response is returned as an array in the same order as the request.

<Note>
  Batch requests require the same scopes as their non-batch equivalents. It's
  not possible to mix different methods in a single batch request.
</Note>

## How it works

Send a `POST` request to the batch method URL with a `requests` array. Each object in the array is a standard request payload for the corresponding method.

There's no guarantee on execution order, but the response array preserves the order of the input.

```json title="Request format" theme={null}
{
  "requests": [
    { <request object> },
    { <another request object> }
  ]
}
```

```json title="Response format" theme={null}
{
  "responses": [
    { <response object or error> },
    { <another response object or error> }
  ]
}
```

### Example: delete multiple agents

```shell title="Request" theme={null}
curl -X POST \
  https://api.livechatinc.com/v3.5/configuration/action/batch_delete_agents \
  -H 'Authorization: Basic <your_personal_access_token>' \
  -H 'Content-Type: application/json' \
  -d '{
        "requests": [
          { "id": "smith@example.com" },
          { "id": "brown@example.com" },
          {}
        ]
      }'
```

```json title="Response" theme={null}
{
  "responses": [
    {},
    {},
    {
      "error": {
        "type": "validation",
        "message": "`id` is required"
      }
    }
  ]
}
```

Errors are returned inline — a failure on one item doesn't affect the others.

## Supported methods

### Agents

| Method          | Batch URL                                                                      |
| --------------- | ------------------------------------------------------------------------------ |
| Create agent    | `https://api.livechatinc.com/v3.5/configuration/action/batch_create_agents`    |
| Update agent    | `https://api.livechatinc.com/v3.5/configuration/action/batch_update_agents`    |
| Delete agent    | `https://api.livechatinc.com/v3.5/configuration/action/batch_delete_agents`    |
| Suspend agent   | `https://api.livechatinc.com/v3.5/configuration/action/batch_suspend_agents`   |
| Unsuspend agent | `https://api.livechatinc.com/v3.5/configuration/action/batch_unsuspend_agents` |
| Approve agent   | `https://api.livechatinc.com/v3.5/configuration/action/batch_approve_agents`   |

### Bots

| Method     | Batch URL                                                                 |
| ---------- | ------------------------------------------------------------------------- |
| Create bot | `https://api.livechatinc.com/v3.5/configuration/action/batch_create_bots` |
| Update bot | `https://api.livechatinc.com/v3.5/configuration/action/batch_update_bots` |
| Delete bot | `https://api.livechatinc.com/v3.5/configuration/action/batch_delete_bots` |
