---
title: "Add a custom object to a segment"
method: POST
path: "/objects/{id}/segments"
tags: ["Objects"]
---

# Add a custom object to a segment

`POST /objects/{id}/segments`

## Request

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

Add a custom object record to an existing object segment.

## Path parameters

- `id` string, required

## Request body

- object
  - `segmentId` string, required: The prefixed segment ID (format `s_<number>`)

## Response `200`

Updated custom object

- CustomObjectResponse
  - `success` true, required
  - `data` ApiCustomObject, required
    - `id` string, required: Prefixed custom object ID (format `co_<number>`)
    - `name` string, required: The object's display name
    - `url` string, uri: Common Room URL for this custom object
    - `recordKey` string: External record key for this object
    - `tags` string[]: Prefixed label IDs (format `l_<number>`)
    - `customFields` object: Map of custom-field ID (format `cf_<number>`) to its typed value.

## Other responses

- `400`: Bad Request
- `403`: Forbidden
- `404`: Object or segment 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)
