put
https://api.customerly.io/v2/contacts//companies
Associates a contact with a company. If the company doesn't exist and you provide a custom
company ID (with cid: prefix), it will be automatically created.
How to Identify the Contact
Use any of these identifier formats in the URL path:
- Numeric ID:
12345 - Custom user ID:
cuid:user_123 - Custom lead ID:
clid:lead_456 - WhatsApp:
wa:+1234567890 - Email:
uem:[email protected]orlem:[email protected]
How to Identify the Company
In the request body, use company_id with one of these formats:
- Numeric ID:
12345(company must exist) - Custom company ID:
cid:company_abc123(will be created if it doesn't exist)
Auto-Create Company Behavior
- If you use a numeric company ID and it doesn't exist, the request will fail with 404
- If you use a custom company ID (
cid:...) and it doesn't exist, it will be automatically created- The new company will use the
company_namefrom the request (or the custom_company_id if name is not provided) - You can optionally set company
attributesin the same request
- The new company will use the
Request Body
company_id(required): Company identifier (numeric orcid:custom_id)company_name(optional): Company name (used when auto-creating a company)attributes(optional): Object with custom company attributes to set
Response
Returns HTTP 201 (Created) with an empty response body on success.
Example Requests
# Add contact to existing company
PUT /contacts/cuid:user_123/companies
{
"company_id": "12345"
}
# Add contact to company (auto-create if doesn't exist)
PUT /contacts/29911301/companies
{
"company_id": "cid:acme_corp",
"company_name": "Acme Corporation",
"attributes": {
"industry": "Technology",
"employees": "50-100"
}
}Recent Requests
Log in to see full request history
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
Loading…
201Contact successfully added to company. If the company didn't exist and a custom company ID was used, the company was created.
400Invalid request data
401Authentication credentials are missing or invalid
403You don't have permission to add contacts to companies
404Contact not found, or company not found (when using numeric company ID)
422Validation error: company_id is required or has invalid format