Create Contact
Developers can send messages to specified conversations through the API.
Request Method
POST
Request URL
https://livedesk-api.engagelab.com/api/v2/accounts/contacts
Authentication
For details, see the authentication method description in API Overview.
Request
Request Example
curl -X POST https://livedesk-api.engagelab.com/api/v2/accounts/contacts \
-H 'Content-Type: application/json' \
-H 'Authorization: Basic base64(api_key:api_secret)' \
{
"inbox_id": 407,
"name": "Test", // Optional
"email": "alice@acme.inc",
"phone_number": "+123456789",
"avatar_url": "https://example.com/avatar.png",
"identifier": "1234567890",
}
curl -X POST https://livedesk-api.engagelab.com/api/v2/accounts/contacts \
-H 'Content-Type: application/json' \
-H 'Authorization: Basic base64(api_key:api_secret)' \
{
"inbox_id": 407,
"name": "Test", // Optional
"email": "alice@acme.inc",
"phone_number": "+123456789",
"avatar_url": "https://example.com/avatar.png",
"identifier": "1234567890",
}
Afficher ce bloc de code dans la fenêtre flottante
Request Headers
| Field | Type | Description |
|---|---|---|
| Authorization | string | Use Authorization: Basic base64(API Key:API Secret) for authentication. Please go to the API Key page to get the API Key and API Secret, and encode them with Base64 after connecting them with a colon. |
| Content-Type | application/json | Data type, use application/json for plain text messages. |
Request Body Parameters
| Field | Type | Required | Description |
|---|---|---|---|
| inbox_id | String | Yes | channel ID. Corresponds to the Channel ID in "Project Settings - Channels - specific channel - Settings". |
| name | String | No | Contact name. |
| String | No | Email address. | |
| phone_number | String | No | Contact number. |
| avatar_url | String | No | Attachment link. |
| identifier | String | No | User identifier. |
Response
Response Example
{
"payload": {
"contact": {
"additional_attributes": {},
"availability_status": "offline",
"email": null,
"id": 2219259,
"name": "Test",
"phone_number": null,
"blocked": false,
"identifier": null,
"thumbnail": "",
"custom_attributes": {},
"created_at": 1766571703,
"contact_inboxes": []
},
"contact_inbox": {
"inbox": null,
"source_id": null
}
}
}
{
"payload": {
"contact": {
"additional_attributes": {},
"availability_status": "offline",
"email": null,
"id": 2219259,
"name": "Test",
"phone_number": null,
"blocked": false,
"identifier": null,
"thumbnail": "",
"custom_attributes": {},
"created_at": 1766571703,
"contact_inboxes": []
},
"contact_inbox": {
"inbox": null,
"source_id": null
}
}
}
Afficher ce bloc de code dans la fenêtre flottante
Response Parameters
| Field | Type | Required | Description |
|---|---|---|---|
| additional_attributes | Object | No | Additional attributes. |
| availability_status | String | No | Online status, default is offline. |
| String | No | Email address. | |
| id | String | No | Contact ID. |
| name | String | No | Name |
| phone_number | String | No | Phone number. |
| blocked | String | No | Whether blocked, default is false. |
| identifier | String | No | User identifier. |
| thumbnail | String | No | User identifier. |
| custom_attributes | String | No | Customer attributes. |
| created_at | String | No | Creation timestamp. |
| contact_inboxes | Array | No | User identifier. |
| inbox | String | No | Channel. |
| source_id | String | No | Source ID. |
