REST API v1
Contacts
Base URL https://your-site.com/wp-json/cliedesk-api/v1. See the overview for keys, scopes and errors.
List contacts
GET /contacts
Scope contacts:read · Cost 2
Parameters
| Name | Type | Description |
|---|---|---|
limit | query · integer | |
cursor | query · string | |
sort | query · string | |
fields | query · string | |
expand | query · string | |
filter | query · object | filter[field][op]=value. Fields: email, state, q. |
Create a contact
POST /contacts
Scope contacts:write · Cost 2
Parameters
| Name | Type | Description |
|---|---|---|
Idempotency-Key | header · string |
Request body (JSON)
| Name | Type | Description |
|---|---|---|
display_name | string | |
language | string | |
timezone | string | |
country | string | |
city | string | |
avatar_attachment_id | string | |
owner_id | integer | |
identities | array of object | |
product_id | string |
Import contacts or organizations from CSV (dry run or background job)
POST /contacts/import
Scope contacts:write · Cost 2
Parameters
| Name | Type | Description |
|---|---|---|
Idempotency-Key | header · string |
Request body (JSON)
| Name | Type | Description |
|---|---|---|
csv required | string | |
entity | string | One of: contact, organization |
mapping required | array of string | |
mode | string | One of: fill, overwrite |
dry_run | boolean | |
product_id | string |
Preview a contact or organization import file
POST /contacts/import/preview
Scope contacts:write · Cost 2
Parameters
| Name | Type | Description |
|---|---|---|
Idempotency-Key | header · string |
Request body (JSON)
| Name | Type | Description |
|---|---|---|
csv required | string | |
entity | string | One of: contact, organization |
Get a contact
GET /contacts/{id}
Scope contacts:read · Cost 1
Parameters
| Name | Type | Description |
|---|---|---|
id required | path · string |
Change a contact
PATCH /contacts/{id}
Scope contacts:write · Cost 2
Parameters
| Name | Type | Description |
|---|---|---|
id required | path · string | |
Idempotency-Key | header · string |
Request body (JSON)
| Name | Type | Description |
|---|---|---|
display_name | string | |
language | string | |
timezone | string | |
country | string | |
city | string | |
avatar_attachment_id | string | |
owner_id | integer |
Move a contact to Trash
DELETE /contacts/{id}
Scope contacts:delete · Cost 2
Parameters
| Name | Type | Description |
|---|---|---|
id required | path · string | |
Idempotency-Key | header · string |
Request body (JSON)
| Name | Type | Description |
|---|---|---|
restore | boolean |
Conversations of a contact
GET /contacts/{id}/conversations
Scope conversations:read · Cost 1
Parameters
| Name | Type | Description |
|---|---|---|
id required | path · string | |
limit | query · integer | |
cursor | query · string |
Record a custom customer event
POST /contacts/{id}/events
Scope events:write · Cost 2
Parameters
| Name | Type | Description |
|---|---|---|
id required | path · string | |
Idempotency-Key | header · string |
Request body (JSON)
| Name | Type | Description |
|---|---|---|
type required | string | |
data | string |
Merge contacts
POST /contacts/{id}/merge
Scope contacts:write · Cost 2
Parameters
| Name | Type | Description |
|---|---|---|
id required | path · string | |
Idempotency-Key | header · string |
Request body (JSON)
| Name | Type | Description |
|---|---|---|
source_id required | string | |
attributes | array of object | |
fields | array of object | |
confirm_wp_users | boolean |
Timeline of a contact
GET /contacts/{id}/timeline
Scope events:read · Cost 1
Parameters
| Name | Type | Description |
|---|---|---|
id required | path · string | |
types | query · array of string | |
from | query · string | |
to | query · string | |
limit | query · integer | |
cursor | query · string |