Skip to main content

Overview

Contacts represent customers or users who interact with your business through Chatwoot. Each contact can have multiple conversations and be associated with different inboxes.

List All Contacts

Retrieve a paginated list of contacts in your account.
GET /api/v1/accounts/{account_id}/contacts

Path Parameters

account_id
integer
required
The ID of the account

Query Parameters

page
integer
default:"1"
Page number for pagination
sort
string
Sort field: email, name, phone_number, last_activity_at, created_at, company, city, country
labels
array
Filter by label names
include_contact_inboxes
boolean
default:"true"
Include contact inbox information

Response

id
integer
Contact ID
name
string
Contact full name
email
string
Contact email address
phone_number
string
Contact phone number
identifier
string
Unique identifier for the contact
thumbnail
string
Avatar thumbnail URL
blocked
boolean
Whether the contact is blocked
custom_attributes
object
Custom attributes for the contact
additional_attributes
object
Additional contact information
last_activity_at
integer
Unix timestamp of last activity
created_at
integer
Unix timestamp of creation

Example Request

curl -X GET https://app.chatwoot.com/api/v1/accounts/1/contacts?page=1 \
  -H "api_access_token: YOUR_ACCESS_TOKEN"

Example Response

{
  "payload": [
    {
      "id": 1,
      "name": "John Doe",
      "email": "[email protected]",
      "phone_number": "+1234567890",
      "identifier": "user_123",
      "thumbnail": "https://example.com/avatar.jpg",
      "blocked": false,
      "custom_attributes": {
        "plan": "premium",
        "signup_date": "2024-01-15"
      },
      "additional_attributes": {
        "city": "New York",
        "country": "USA"
      },
      "last_activity_at": 1704067200,
      "created_at": 1672531200,
      "contact_inboxes": [
        {
          "id": 1,
          "inbox_id": 1,
          "source_id": "external_123"
        }
      ]
    }
  ]
}

Get Contact

Retrieve details of a specific contact.
GET /api/v1/accounts/{account_id}/contacts/{id}

Path Parameters

account_id
integer
required
The ID of the account
id
integer
required
The ID of the contact

Example Request

curl -X GET https://app.chatwoot.com/api/v1/accounts/1/contacts/1 \
  -H "api_access_token: YOUR_ACCESS_TOKEN"

Create Contact

Create a new contact in your account.
POST /api/v1/accounts/{account_id}/contacts

Path Parameters

account_id
integer
required
The ID of the account

Request Body

name
string
Contact full name
email
string
Contact email address
phone_number
string
Contact phone number with country code
identifier
string
Unique identifier from your system
inbox_id
integer
Inbox ID to associate the contact with
source_id
string
External source ID for the contact inbox
blocked
boolean
default:"false"
Whether to block the contact
avatar
file
Avatar image file
avatar_url
string
URL to fetch avatar from
custom_attributes
object
Custom attributes as key-value pairs
additional_attributes
object
Additional attributes as key-value pairs

Example Request

curl -X POST https://app.chatwoot.com/api/v1/accounts/1/contacts \
  -H "api_access_token: YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Jane Smith",
    "email": "[email protected]",
    "phone_number": "+1987654321",
    "identifier": "user_456",
    "inbox_id": 1,
    "custom_attributes": {
      "plan": "basic",
      "signup_date": "2024-02-01"
    },
    "additional_attributes": {
      "city": "San Francisco",
      "country": "USA",
      "company": "Tech Corp"
    }
  }'

Example Response

{
  "id": 2,
  "name": "Jane Smith",
  "email": "[email protected]",
  "phone_number": "+1987654321",
  "identifier": "user_456",
  "blocked": false,
  "custom_attributes": {
    "plan": "basic",
    "signup_date": "2024-02-01"
  },
  "additional_attributes": {
    "city": "San Francisco",
    "country": "USA",
    "company": "Tech Corp"
  },
  "created_at": 1706745600
}

Update Contact

Update an existing contact’s information.
PATCH /api/v1/accounts/{account_id}/contacts/{id}

Path Parameters

account_id
integer
required
The ID of the account
id
integer
required
The ID of the contact to update

Request Body

Accepts the same parameters as Create Contact.

Example Request

curl -X PATCH https://app.chatwoot.com/api/v1/accounts/1/contacts/2 \
  -H "api_access_token: YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Jane Smith Updated",
    "custom_attributes": {
      "plan": "premium"
    }
  }'
Custom attributes are merged with existing attributes. To remove an attribute, use the delete custom attributes endpoint.

Delete Contact

Delete a contact from your account.
DELETE /api/v1/accounts/{account_id}/contacts/{id}

Path Parameters

account_id
integer
required
The ID of the account
id
integer
required
The ID of the contact to delete

Example Request

curl -X DELETE https://app.chatwoot.com/api/v1/accounts/1/contacts/2 \
  -H "api_access_token: YOUR_ACCESS_TOKEN"
You cannot delete a contact who is currently online. Wait for them to go offline before deleting.

Search Contacts

Search for contacts by name, email, phone number, or identifier.
GET /api/v1/accounts/{account_id}/contacts/search

Path Parameters

account_id
integer
required
The ID of the account

Query Parameters

q
string
required
Search query string
page
integer
default:"1"
Page number

Example Request

curl -X GET "https://app.chatwoot.com/api/v1/accounts/1/contacts/search?q=john" \
  -H "api_access_token: YOUR_ACCESS_TOKEN"

Filter Contacts

Filter contacts using advanced query filters.
POST /api/v1/accounts/{account_id}/contacts/filter

Path Parameters

account_id
integer
required
The ID of the account

Request Body

payload
array
required
Array of filter conditions

Example Request

curl -X POST https://app.chatwoot.com/api/v1/accounts/1/contacts/filter \
  -H "api_access_token: YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "payload": [
      {
        "attribute_key": "email",
        "filter_operator": "contains",
        "values": ["@example.com"]
      }
    ]
  }'

Get Active Contacts

Retrieve contacts who are currently online.
GET /api/v1/accounts/{account_id}/contacts/active

Example Request

curl -X GET https://app.chatwoot.com/api/v1/accounts/1/contacts/active \
  -H "api_access_token: YOUR_ACCESS_TOKEN"

Get Contactable Inboxes

Retrieve inboxes where you can contact this person.
GET /api/v1/accounts/{account_id}/contacts/{id}/contactable_inboxes

Path Parameters

account_id
integer
required
The ID of the account
id
integer
required
The ID of the contact

Example Request

curl -X GET https://app.chatwoot.com/api/v1/accounts/1/contacts/1/contactable_inboxes \
  -H "api_access_token: YOUR_ACCESS_TOKEN"

Delete Custom Attributes

Remove specific custom attributes from a contact.
POST /api/v1/accounts/{account_id}/contacts/{id}/destroy_custom_attributes

Path Parameters

account_id
integer
required
The ID of the account
id
integer
required
The ID of the contact

Request Body

custom_attributes
array
required
Array of custom attribute keys to remove

Example Request

curl -X POST https://app.chatwoot.com/api/v1/accounts/1/contacts/1/destroy_custom_attributes \
  -H "api_access_token: YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "custom_attributes": ["old_attribute", "unused_field"]
  }'

Delete Avatar

Remove the contact’s avatar image.
DELETE /api/v1/accounts/{account_id}/contacts/{id}/avatar

Path Parameters

account_id
integer
required
The ID of the account
id
integer
required
The ID of the contact

Example Request

curl -X DELETE https://app.chatwoot.com/api/v1/accounts/1/contacts/1/avatar \
  -H "api_access_token: YOUR_ACCESS_TOKEN"

Import Contacts

Import contacts from a CSV file.
POST /api/v1/accounts/{account_id}/contacts/import

Path Parameters

account_id
integer
required
The ID of the account

Request Body

import_file
file
required
CSV file containing contact data

Example Request

curl -X POST https://app.chatwoot.com/api/v1/accounts/1/contacts/import \
  -H "api_access_token: YOUR_ACCESS_TOKEN" \
  -F "[email protected]"

Export Contacts

Export contacts to a CSV file.
POST /api/v1/accounts/{account_id}/contacts/export

Path Parameters

account_id
integer
required
The ID of the account

Request Body

column_names
array
Array of column names to export
payload
object
Filter conditions for export

Example Request

curl -X POST https://app.chatwoot.com/api/v1/accounts/1/contacts/export \
  -H "api_access_token: YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "column_names": ["name", "email", "phone_number"]
  }'
The export is processed asynchronously. You’ll receive the CSV file via email when ready.

Error Responses

Contact Not Found

{
  "error": "Contact not found"
}

Cannot Delete Online Contact

{
  "message": "Cannot delete John while they are online"
}

Validation Errors

{
  "error": "Validation failed",
  "message": "Email is invalid"
}

Build docs developers (and LLMs) love