Adds or removes record IDs (or organization member IDs for user type attributes) from a relation or user attribute on a CRM record.
Supply add with IDs to link and/or remove with IDs to unlink. At least one of the two arrays must be non-empty, and the same ID cannot appear in both.
Required scope: crm:write
curl --request PATCH \
--url https://api.zeeg.me/v2/crm/{objectSlug}/{recordId}/relation \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"attributeSlug": "products",
"add": [
"c1d2e3f4-a5b6-7890-cdef-123456789012"
],
"remove": []
}
'{
"success": true,
"status": 200,
"record": {
"id": "c1d2e3f4-a5b6-7890-cdef-123456789012",
"objectSlug": "products",
"attributes": {
"sku": "DRESS-001",
"price": 29,
"inventory_count": 150
},
"createdAt": "2025-06-01T10:00:00+00:00",
"updatedAt": "2025-06-01T12:00:00+00:00"
}
}Adds or removes individual IDs from aDocumentation Index
Fetch the complete documentation index at: https://developer.zeeg.me/llms.txt
Use this file to discover all available pages before exploring further.
relation or user attribute on a CRM record. Unlike Patch, which replaces the entire array, this endpoint performs surgical add/remove operations — existing linked IDs not mentioned in the request are untouched.
| Parameter | Type | Description |
|---|---|---|
objectSlug | string | The slug of the custom CRM object the record belongs to. |
recordId | string (UUID) | The UUID of the record whose relation attribute you want to modify. |
| Field | Type | Required | Description |
|---|---|---|---|
attributeSlug | string | Yes | The key of the relation or user attribute to modify. Must exist on the object and be of type relation or user. |
add | string[] | No | IDs to add to the relation. For relation attributes: UUIDs of records in the related object. For user attributes: UUIDs of organization members. |
remove | string[] | No | IDs to remove from the relation. The same ID format as add. |
add or remove must be present and non-empty.add and remove in the same request.add that is already linked is a no-op (not an error).remove that is not linked is a no-op (not an error).| Attribute type | What IDs to pass |
|---|---|
relation | UUIDs of records from the related object (obtained from GET /v2/crm/{relatedObjectSlug}) |
user | UUIDs of organization members (obtained from GET /v2/organizations/users) |
text, number, select, or any non-relation attribute returns an error. Use Patch for those.
orders object has a relation attribute called products that links to the products object. To add two products to an order:
PATCH /v2/crm/orders/a1b2c3d4-e5f6-7890-abcd-ef1234567890/relation
{
"attributeSlug": "products",
"add": [
"c1d2e3f4-a5b6-7890-cdef-123456789012",
"d2e3f4a5-b6c7-8901-defa-234567890123"
]
}
{
"attributeSlug": "products",
"add": ["new-product-uuid-here"],
"remove": ["old-product-uuid-here"]
}
remove:
{
"attributeSlug": "products",
"remove": ["c1d2e3f4-a5b6-7890-cdef-123456789012"]
}
deals object has a user attribute called owners. To assign a team member:
PATCH /v2/crm/deals/deal-uuid-here/relation
{
"attributeSlug": "owners",
"add": ["org-member-uuid-here"]
}
GET /v2/crm/objects/{slug} — look for attributes with type: relation or type: user and use their key field as attributeSlug.
PATCH /relation | PATCH /{recordId} | |
|---|---|---|
| Operation | Adds/removes individual IDs | Replaces the entire attribute value |
| Existing IDs | Preserved unless explicitly removed | Overwritten |
| Use case | Add or remove one or a few links | Set the complete list in one go |
PATCH /relation when you need additive or subtractive changes. Use PATCH /{recordId} when you want to set the exact final state of a relation (replacing whatever was there before).
Slug of the custom CRM object.
UUID of the record to update.
OK
true
200
A record for a custom CRM object.
Hide child attributes
Unique identifier for the record.
"c1d2e3f4-a5b6-7890-cdef-123456789012"
Slug of the CRM object this record belongs to.
"products"
Key/value pairs for the custom attributes defined on the object. Keys are attribute slugs.
{
"sku": "DRESS-001",
"price": 29,
"inventory_count": 150
}ISO 8601 timestamp when the record was created.
"2025-06-01T10:00:00+00:00"
ISO 8601 timestamp when the record was last updated.
"2025-06-01T12:00:00+00:00"
curl --request PATCH \
--url https://api.zeeg.me/v2/crm/{objectSlug}/{recordId}/relation \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"attributeSlug": "products",
"add": [
"c1d2e3f4-a5b6-7890-cdef-123456789012"
],
"remove": []
}
'{
"success": true,
"status": 200,
"record": {
"id": "c1d2e3f4-a5b6-7890-cdef-123456789012",
"objectSlug": "products",
"attributes": {
"sku": "DRESS-001",
"price": 29,
"inventory_count": 150
},
"createdAt": "2025-06-01T10:00:00+00:00",
"updatedAt": "2025-06-01T12:00:00+00:00"
}
}