Skip to main content

Batch Operations

POST 

/batch

Perform multiple operations in a single request.

This endpoint allows you to perform multiple API operations in a single request. The requests can be to different resources (endpoints or URLs) or to the same resource. The operations can be of different types, namely GET, POST, PUT, and DELETE. The batch request itself should always be a POST request.

In general, this is mostly intended for creating, modifying, or deleting multiple resources at once, as opposed to reading multiple collections or objects (using GET). It's important to note that when modifying objects through a batch request, you still need to include the If-Match header with the current ETag value in each modification request as documented here. There is no way to automatically fetch the current ETag and apply it to a modification within the same batch request.

Maximum batch size

Note: the maximum length of a batch request is 100 requests. If the batch array is longer than 100, the server will return an error.

Note that you cannot make a nested batch request within a batch request.

Authentication

The batch request itself should be authenticated using the normal authentication methods. The server will ignore any authentication headers within each request. The same user account (identity) will be used for all requests in the batch.

The request body should be a JSON object with the following structure:

Request

Responses

The batch operation was successful. The response body contains the results of each individual operation.

:::info About response codes

The response code for each operation is included in the response body. The response code for the batch operation itself is always 200, even if individual operations failed. However, the batch operation itself can return a non-200 error code if the batch request is malformed or if the server is unable to process the request for another reason.

:::

Note that the index of each response in the array corresponds to the index of the request in the original batch request. If stop_on_error is true, the response array will stop at the first error encountered.