Skip to main content

Create Contact Inbox

POST 

/accounts/:account_id/contacts/:contact_id/contact_inboxes

Links an existing contact to an inbox.

This creates the contact inbox (and its source_id) needed to open a conversation in that inbox. If the link already exists, it is returned unchanged.

SettingValue
MethodPOST
Path/api/v1/accounts/{account_id}/contacts/{contact_id}/contact_inboxes
AuthorizationUser token. The caller must be allowed to view the inbox. Agent-bot tokens: not allowed.

Path parameters

NameTypeRequiredDescription
account_idintegerYesAccount ID.
contact_idintegerYesContact ID.

Body parameters (JSON)

NameTypeRequiredDescription
inbox_idintegerYesInbox ID.
source_idstringNoThe contact's ID on that channel. Generated if omitted. For phone channels it defaults to the contact's phone; for email inboxes to the contact's email.
hmac_verifiedbooleanNoMark the contact inbox as HMAC-verified (website widget identity validation).

Example request

curl -X POST 'https://online.99digital.co.il/api/v1/accounts/12/contacts/801/contact_inboxes' \
-H 'api_access_token: <YOUR_API_ACCESS_TOKEN>' \
-H 'Content-Type: application/json' \
-d '{ "inbox_id": 31, "source_id": "5f0c1a2b-3c4d-4e5f-8a9b-0c1d2e3f4a5b" }'

Example response (200 OK). The inbox object is truncated.

{
"source_id": "5f0c1a2b-3c4d-4e5f-8a9b-0c1d2e3f4a5b",
"inbox": {
"id": 31,
"channel_id": 9,
"name": "Website API",
"channel_type": "Channel::Api",
"enable_auto_assignment": true,
"webhook_url": ""
}
}

Error responses: 404 {"error": "Resource could not be found"} when the contact or inbox does not exist.

Request​

Responses​

The contact inbox.