Skip to main content
POST
/
associations
{
  "associations": [
    {
      "contactCRMId": "contact_8f3k2j",
      "companyCRMId": "account_4k8j2m"
    },
    {
      "contactCRMId": "contact_9x7m4n",
      "companyCRMId": "account_4k8j2m"
    }
  ]
}
{
  "success": true,
  "created": 2
}

Your Implementation Required

This endpoint must be implemented on your server
Enginy calls this endpoint to create relationships between contacts and companies after both have been created or synced.

Request

associations
array
required
Array of contact-company pairs to link

Association Object

contactCRMId
string
required
The CRM ID of the contact (returned from create/sync)
companyCRMId
string
required
The CRM ID of the company (returned from create/sync)
{
  "associations": [
    {
      "contactCRMId": "contact_8f3k2j",
      "companyCRMId": "account_4k8j2m"
    },
    {
      "contactCRMId": "contact_9x7m4n",
      "companyCRMId": "account_4k8j2m"
    }
  ]
}

Response

success
boolean
required
Whether the operation succeeded
created
number
Number of associations created
errors
array
Array of failed associations (if any)
{
  "success": true,
  "created": 2
}

Partial Success

{
  "success": true,
  "created": 1,
  "errors": [
    {
      "contactCRMId": "contact_invalid",
      "companyCRMId": "account_4k8j2m",
      "error": "Contact not found"
    }
  ]
}
Use upsert logic to handle duplicate associations gracefully (ignore if already exists).