---
title: "Update many custom objects"
method: POST
path: "/objects/bulk"
tags: ["Objects"]
---

# Update many custom objects

`POST /objects/bulk`

## Request

- Base URL: `https://api.commonroom.io/api/v2`
- URL: `https://api.commonroom.io/api/v2/objects/bulk`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/commonroom/apis/common-room-api-v2/docs/objects/bulk/post.ts> (a function with typed inputs; its response is checked against the schema)

Apply the same change to up to 100 custom objects in one request. The request must include at least one of segmentId, tagIdsToAdd, tagIdsToRemove, or customFields. Every ID, the segment, the tags, and the custom fields are validated before anything is written, and an error names every offending ID. A tag must be scoped to the object type of every listed object. Each change is idempotent: custom objects already in the segment are skipped, so a request that fails part-way can be retried as a whole. Requires the `objects:write` scope.

## Request body

- object
  - `objectIds` string[], required: Prefixed custom object IDs (format `co_<number>`). Duplicates are ignored.
  - `segmentId` string: Add every custom object to this segment (format `s_<number>`).
  - `tagIdsToAdd` string[]: Tag IDs (format `l_<number>`) to add to every record.
  - `tagIdsToRemove` string[]: Tag IDs (format `l_<number>`) to remove from every record.
  - `customFields` object[]: Custom-field values to set on every record in the request.
    - `customFieldId` string, required: Custom field ID (format `cf_<number>`)
    - `customFieldValue` union, required: A typed custom-field value. The `type` discriminator indicates the value's runtime type.
      - object
        - `type` 'string', required
        - `value` string, required
      - object
        - `type` 'url', required
        - `value` string, uri, required
      - object
        - `type` 'int', required
        - `value` integer, required
      - object
        - `type` 'number', required
        - `value` number, required
      - object
        - `type` 'date', required
        - `value` string, date-time, required
      - object
        - `type` 'boolean', required
        - `value` boolean, required

## Response `200`

The custom objects were updated

- BulkUpdateResponse
  - `success` true, required
  - `data` object, required
    - `ids` string[], required: The prefixed IDs of the records that were updated, deduplicated.

## Other responses

- `400`: Bad Request
- `403`: Forbidden
- `404`: A custom object, the segment, or a tag was not found
- `429`: Rate Limited

---

[API](https://skmtc.dev/commonroom/apis/common-room-api-v2.md) - [All operations](https://skmtc.dev/commonroom/apis/common-room-api-v2/llms.txt) - [OpenAPI document](https://skmtc.dev/commonroom/apis/common-room-api-v2/revisions/865d4d43dadf?raw)
