Skip to main content
PATCH
/
crm
/
{objectSlug}
/
{recordId}
/
relation
Update a CRM record relation
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"
  }
}

Documentation Index

Fetch the complete documentation index at: https://developer.zeeg.me/llms.txt

Use this file to discover all available pages before exploring further.

Adds or removes individual IDs from a 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.

Path parameters

ParameterTypeDescription
objectSlugstringThe slug of the custom CRM object the record belongs to.
recordIdstring (UUID)The UUID of the record whose relation attribute you want to modify.

Request body

FieldTypeRequiredDescription
attributeSlugstringYesThe key of the relation or user attribute to modify. Must exist on the object and be of type relation or user.
addstring[]NoIDs to add to the relation. For relation attributes: UUIDs of records in the related object. For user attributes: UUIDs of organization members.
removestring[]NoIDs to remove from the relation. The same ID format as add.
Rules:
  • At least one of add or remove must be present and non-empty.
  • The same ID cannot appear in both add and remove in the same request.
  • Passing an ID in add that is already linked is a no-op (not an error).
  • Passing an ID in remove that is not linked is a no-op (not an error).

Attribute types that support this endpoint

Attribute typeWhat IDs to pass
relationUUIDs of records from the related object (obtained from GET /v2/crm/{relatedObjectSlug})
userUUIDs of organization members (obtained from GET /v2/organizations/users)
Passing this endpoint for a text, number, select, or any non-relation attribute returns an error. Use Patch for those. Your 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"
  ]
}

Example: swap a linked record

Remove one product and add a replacement in a single request:
{
  "attributeSlug": "products",
  "add": ["new-product-uuid-here"],
  "remove": ["old-product-uuid-here"]
}
To remove products, pass their IDs in remove:
{
  "attributeSlug": "products",
  "remove": ["c1d2e3f4-a5b6-7890-cdef-123456789012"]
}

Example: assign a team member to a deal

Your 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"]
}

Finding the attribute slug

Relation attribute slugs are defined when the attribute is created. You can look them up via GET /v2/crm/objects/{slug} — look for attributes with type: relation or type: user and use their key field as attributeSlug.

Update Relation vs. PATCH

PATCH /relationPATCH /{recordId}
OperationAdds/removes individual IDsReplaces the entire attribute value
Existing IDsPreserved unless explicitly removedOverwritten
Use caseAdd or remove one or a few linksSet the complete list in one go
Use 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).

When to use this endpoint

  • Add a linked record — a user picks a related product, company, or person to attach.
  • Remove a linked record — a user detaches a relation without affecting others.
  • Assign / unassign owners — add or remove team members from a user-type attribute.
  • Incremental sync — when your source system sends delta events (“product X was added to order Y”) rather than full state.

Authorizations

Authorization
string
header
required

Path Parameters

objectSlug
string
required

Slug of the custom CRM object.

recordId
string<uuid>
required

UUID of the record to update.

Body

application/json
attributeSlug
string
required

Key of the relation or user attribute to modify.

Example:

"products"

add
string[]

IDs to add to the relation.

Example:
["c1d2e3f4-a5b6-7890-cdef-123456789012"]
remove
string[]

IDs to remove from the relation.

Example:
[]

Response

OK

success
boolean
Example:

true

status
integer
Example:

200

record
object

A record for a custom CRM object.

Last modified on May 7, 2026