---
title: "Batch requests"
site: api
version: 2027.1
versions: "all"
url: https://docs-new.servicely.ai/api/2027.1/rest/batch-requests/
type: reference
application: platform_integration
last_updated: 2026-12-03
commit: 6777698daac5
---


The batch endpoint runs several REST API requests sent in one call and returns all their responses together. Use it to cut round trips when an integration makes many small reads and writes, or to group requests that belong together.

## Endpoint

Send a POST request with a JSON body to `https://<instance>.servicely.ai/v1/_batch`. Authenticate as for any other REST request.

Servicely runs the requests in the order of the array. Each one behaves exactly as it would on its own, with its own status code. A failing request does not stop the ones after it. The batch itself returns 200 once every request has run.

A body that cannot be parsed as a batch returns 400 with the text `Parsing exception: Invalid request format`, and no request runs.

## Request fields

| Field | Required | Description |
| --- | --- | --- |
| `id` | Yes | An identifier for the batch, returned in the response. |
| `requests` | Yes | The array of requests to run. |
| `include_headers` | No | `true` returns the response headers of every request. Default `false`. |
| `requests[].id` | Yes | A correlation ID that matches the response to the request. |
| `requests[].url` | Yes | The URL as you would send it on its own, starting at `/v1/`, with any query parameters. |
| `requests[].method` | Yes | `GET`, `POST`, `PUT`, `PATCH` or `DELETE`. |
| `requests[].body` | No | The request body as a JSON-encoded string, for POST, PUT and PATCH. |
| `requests[].include_headers` | No | `true` returns the response headers of this request only. |

## Response fields

| Field | Description |
| --- | --- |
| `id` | The batch identifier from the request. |
| `requests` | One entry per request, in the order they ran. |
| `requests[].id` | The correlation ID from the request. |
| `requests[].status_code` | The HTTP status code, as the request would return on its own. |
| `requests[].status_text` | The reason phrase for the status code. |
| `requests[].body` | The response body as a JSON-encoded string, or `null` when the response had none. |
| `requests[].headers` | The response headers, present only when `include_headers` is `true`. |
| `requests[].execution_time` | Milliseconds the request took. |

Branch on `status_code`, not `status_text`. Parse `body` as JSON to read the records.

## Example

This batch reads one user, creates an incident and deletes another incident.

**Request**

```http
POST /v1/_batch
Content-Type: application/json

{
    "id": "batch-0001",
    "requests": [
        {
            "id": "1",
            "method": "GET",
            "url": "/v1/User?fields=Name&page_size=1"
        },
        {
            "id": "2",
            "method": "POST",
            "url": "/v1/Incident",
            "body": "{\"ShortDescription\":\"Test incident\"}"
        },
        {
            "id": "3",
            "method": "DELETE",
            "url": "/v1/Incident/00000000000000000000000000000001"
        }
    ]
}
```

**Response**

```json
{
    "id": "batch-0001",
    "requests": [
        {
            "id": "1",
            "status_code": 200,
            "status_text": "OK",
            "body": "{\"data\":[{\"Name\":\"<user name>\"}]}",
            "execution_time": 62
        },
        {
            "id": "2",
            "status_code": 200,
            "status_text": "OK",
            "body": "{\"data\":{\"ShortDescription\":\"Test incident\", ...}}",
            "execution_time": 140
        },
        {
            "id": "3",
            "status_code": 404,
            "status_text": "Not Found",
            "body": null,
            "execution_time": 9
        }
    ]
}
```

<Callout type="info">
  **Changed in 2027.1.** `status_text` uses the standard reason phrases, so the wording changes for a few codes, including 413, 414, 416 and 422. A code without a standard phrase reads as its class and number, for example `Client Error (499)`. `status_code` is unchanged.
</Callout>

## Related

- [Query records and operators](page:rest/query-records)
- [Create, update and delete records](page:rest/create-update-and-delete-records)
- [Quick start](page:rest/quick-start)
