Link copied to clipboard!
Mobile navigation button - closed state

Batch

Using a single API call to update multiple users and organizations


Check out our integration guide to understand how batch syncing fits in your backend workflow

Use this for cases where you need to take actions on several organizations or users at once. The action taken for each entity is “create or update”: If an existing user or organization with that ID exists, it will be updated with the provided data.

HTTP Request

POST https://api.cord.com/v1/batch

Request Body

You can add or remove users by setting the status as active or deleted

Field    
users user[] optional List of user objects. Every object must include the id field. If the user already exists, all other fields are optional and only updated when present. If the user does not already exist, fields are required as described in the Create or update a user API.
organizations organization[] optional List of organization objects. Every object must include the id field. If the organization already exists, all other fields are optional and only updated when present. If the organization does not already exist, fields are required as described in the Create or update an organization API.

Example request that operates on several users and organizations:

curl "https://api.cord.com/v1/batch" \
  -X POST \
  -H "Authorization: Bearer <ACCESS_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{
    "organizations": [
      {
        "id": "10",
        "name": "Planet Express",
        "members": ["4", "42"]
      }
    ],
    "users": [
      {
        "id": "4",
        "name": "Hubert Farnsworth",
        "email": "hubert@planetexpress.nny"
      },
      {
        "id": "42",
        "name": "Leela Turanga",
        "email": "leela@planetexpress.nny"
      }
    ]
  }'

Next up