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.
| Setting | Value |
|---|---|
| Method | POST |
| Path | /api/v1/accounts/{account_id}/contacts/{contact_id}/contact_inboxes |
| Authorization | User token. The caller must be allowed to view the inbox. Agent-bot tokens: not allowed. |
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
account_id | integer | Yes | Account ID. |
contact_id | integer | Yes | Contact ID. |
Body parameters (JSON)
| Name | Type | Required | Description |
|---|---|---|---|
inbox_id | integer | Yes | Inbox ID. |
source_id | string | No | The 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_verified | boolean | No | Mark 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
- 200
- 401
- 403
- 404
The contact inbox.
The access token is missing or wrong, or its user does not belong to this account.
The token's role does not have the permission this endpoint needs, or the endpoint is not open to agent-bot tokens. See Authorization.
The contact or the inbox does not exist in this account.