POST
/
api
/
v1
/
accounts
/
{account_id}
/
contacts
Create Contact
curl --request POST \
  --url https://app.chatwoot.com/api/v1/accounts/{account_id}/contacts \
  --header 'Content-Type: application/json' \
  --header 'api_access_token: <api-key>' \
  --data '{
  "inbox_id": 1,
  "name": "Alice",
  "email": "alice@acme.inc",
  "blocked": false,
  "phone_number": "+123456789",
  "avatar_url": "https://example.com/avatar.png",
  "identifier": "1234567890",
  "additional_attributes": {
    "type": "customer",
    "age": 30
  },
  "custom_attributes": {}
}'
{
  "payload": [
    {
      "additional_attributes": {},
      "availability_status": "<string>",
      "email": "<string>",
      "id": 123,
      "name": "<string>",
      "phone_number": "<string>",
      "blocked": true,
      "identifier": "<string>",
      "thumbnail": "<string>",
      "custom_attributes": {
        "attribute_key": "attribute_value",
        "signed_up_at": "dd/mm/yyyy"
      },
      "last_activity_at": 123,
      "created_at": 123,
      "contact_inboxes": [
        {
          "source_id": "<string>",
          "inbox": {
            "id": 123,
            "avatar_url": "<string>",
            "channel_id": 123,
            "name": "<string>",
            "channel_type": "<string>",
            "provider": "<string>"
          }
        }
      ]
    }
  ],
  "id": 123,
  "availability_status": "online"
}

Authorizations

api_access_token
string
header
required

This token can be obtained by visiting the profile page or via rails console. Provides access to endpoints based on the user permissions levels. This token can be saved by an external system when user is created via API, to perform activities on behalf of the user.

Path Parameters

account_id
integer
required

The numeric ID of the account

Body

application/json
inbox_id
number
required

ID of the inbox to which the contact belongs

Example:

1

name
string

name of the contact

Example:

"Alice"

email
string

email of the contact

Example:

"alice@acme.inc"

blocked
boolean

whether the contact is blocked or not

Example:

false

phone_number
string

phone number of the contact

Example:

"+123456789"

avatar
file

Send the form data with the avatar image binary or use the avatar_url

avatar_url
string

The url to a jpeg, png file for the contact avatar

Example:

"https://example.com/avatar.png"

identifier
string

A unique identifier for the contact in external system

Example:

"1234567890"

additional_attributes
object

An object where you can store additional attributes for contact. example {"type":"customer", "age":30}

Example:
{ "type": "customer", "age": 30 }
custom_attributes
object

An object where you can store custom attributes for contact. example {"type":"customer", "age":30}, this should have a valid custom attribute definition.

Example:
{}

Response

Success

payload
object[]
id
number

Id of the user

availability_status
enum<string>

Availability status of the user

Available options:
online,
offline