Skip to main content
The Synchronous Batch API lets you create or update a list of entities of the same type in a single API request, processed synchronously in linear and atomic order. All records are either fully processed or fail together. This is in contrast to the asynchronous Batch API, which processes records in the background in any order.
The maximum number of entities that can be processed synchronously is 100 for primary entities and 50 for included entities. These are default limits and can be changed by an administrator.
If the request exceeds the configured processing timeout (default: 25 seconds), it will automatically fall back to asynchronous Batch API processing.

Usage

The API resources and input data format are identical to the Batch API. To use synchronous processing, add the X-Mode: sync request header.
PATCH /api/accounts HTTP/1.1
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
X-Mode: sync
The response contains all entities from the request in the same order as the request.
  • Primary entity identifiers from the request are returned in the dataId meta attribute in the response.
  • Included entity identifiers are returned in the includeId meta attribute.
Use these to match entities between the request and response.

Example

Request
PATCH /api/accounts HTTP/1.1
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
X-Mode: sync
Request body
{
   "data": [
      {
          "type": "accounts",
          "id": "account_1",
          "attributes": {
             "name": "Account 1"
          },
          "relationships": {
              "contacts": {
                  "data": [
                      {"type": "contacts", "id": "contact_1"}
                  ]
              }
          }
      },
      {
          "type": "accounts",
          "id": "account_2",
          "attributes": {
             "name": "Account 2"
          },
          "relationships": {
              "contacts": {
                  "data": [
                      {"type": "contacts", "id": "contact_2"}
                  ]
              }
          }
      }
   ],
   "included": [
      {
          "type": "contacts",
          "id": "contact_1",
          "attributes": {
              "primaryEmail": "[email protected]"
          }
      },
      {
          "type": "contacts",
          "id": "contact_2",
          "attributes": {
              "primaryEmail": "[email protected]"
          }
      }
   ]
}
Response
{
   "data": [
      {
          "type": "accounts",
          "id": "101",
          "meta": {
            "dataId": "account_1"
          },
          "attributes": {
             "name": "Account 1"
          },
          "relationships": {
              "contacts": {
                  "data": [
                      {"type": "contacts", "id": "1001"}
                  ]
              }
          }
      },
      {
          "type": "accounts",
          "id": "102",
          "meta": {
            "dataId": "account_2"
          },
          "attributes": {
             "name": "Account 2"
          },
          "relationships": {
              "contacts": {
                  "data": [
                      {"type": "contacts", "id": "1002"}
                  ]
              }
          }
      }
   ],
   "included": [
      {
          "type": "contacts",
          "id": "1001",
          "meta": {
            "includeId": "contact_1"
          },
          "attributes": {
              "primaryEmail": "[email protected]"
          }
      },
      {
          "type": "contacts",
          "id": "1002",
          "meta": {
            "includeId": "contact_2"
          },
          "attributes": {
              "primaryEmail": "[email protected]"
          }
      }
   ]
}

Build docs developers (and LLMs) love