Skip to main content
Version: v1.0.0(int)

E039: Link contact to entity

POST /api/contacts/:id/links

Associates an existing contact with a customer, vendor, or other entity. Triggered from Customer Detail or Vendor Detail, "Add contact" with an existing contact.

Authentication

Standard tenant route. Requires Authorization: Bearer <firebase-id-token> and X-Org-Id: <org-id>. Access: Member.

Request

{
"entityType": "customer",
"entityId": "uuid",
"role": "billing",
"isPrimary": true
}

entityType is "customer" or "vendor" (the polymorphic set in v1.0.0).

Response — 201 Created

{
"id": "uuid",
"contactId": "uuid",
"entityType": "customer",
"entityId": "uuid",
"role": "billing",
"isPrimary": true,
"createdAt": "..."
}

Errors

HTTPcodeCondition
404not_foundContact or entity not found.
409invalid_transitionContact already linked to that entity with the same role.
422validation_failedShape invalid.

Workflow

Calls W039 Link contact to entity.