Skip to main content
GET
/
api
/
public
/
contacts
Get contacts by days
curl --request GET \
  --url https://api.example.com/api/public/contacts \
  --header 'x-api-key: <x-api-key>'
[
  {
    "id": "df980fc8-b6db-4820-bf22-2969482d106d",
    "name": "John Doe",
    "phone": "+56912345678",
    "email": "john@example.com",
    "platform": "whatsapp",
    "last_message_at": "2024-09-30T10:00:00.000Z",
    "chat_status": "ATTENDED",
    "created_at": "2024-01-15T10:00:00.000Z",
    "client_id": "123e4567-e89b-12d3-a456-426614174000",
    "ai_customer_id": "123e4567-e89b-12d3-a456-426614174000",
    "default_stage_id": "123e4567-e89b-12d3-a456-426614174000",
    "blocked": false,
    "is_chat_read": true,
    "active_ticket_v2": {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "current_stage_id": "123e4567-e89b-12d3-a456-426614174000"
    }
  }
]

Headers

x-api-key
string
required

API key needed to authorize the request

Query Parameters

days
number
required

Number of days to filter contacts (1-365)

Required range: 1 <= x <= 365
Example:

30

stage_id
string<uuid>

Stage ID to filter contacts

Pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
Example:

"123e4567-e89b-12d3-a456-426614174000"

pipeline_id
string<uuid>

Pipeline ID to filter contacts by their active ticket stage

Pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
Example:

"123e4567-e89b-12d3-a456-426614174000"

custom_field_key
string

The key of the custom field to filter by. Must be provided together with custom_field_value.

Minimum string length: 1
Example:

"status"

custom_field_value
string

The value to match for the custom field. Must be provided together with custom_field_key.

Minimum string length: 1
Example:

"Active"

entity_type
enum<string>

Specify "ticket" or "customer" to filter only by custom fields of that entity type. Only applies when custom_field_key and custom_field_value are provided.

Available options:
ticket,
customer

Response

Contacts retrieved successfully.

id
string
Example:

"df980fc8-b6db-4820-bf22-2969482d106d"

name
string
Example:

"John Doe"

phone
string
Example:

"+56912345678"

email
string
Example:

"john@example.com"

platform
string
Example:

"whatsapp"

last_message_at
string
Example:

"2024-09-30T10:00:00.000Z"

chat_status
string
Example:

"ATTENDED"

created_at
string
Example:

"2024-01-15T10:00:00.000Z"

client_id
string
Example:

"123e4567-e89b-12d3-a456-426614174000"

ai_customer_id
string | null
Example:

"123e4567-e89b-12d3-a456-426614174000"

default_stage_id
string | null
Example:

"123e4567-e89b-12d3-a456-426614174000"

blocked
boolean
Example:

false

is_chat_read
boolean
Example:

true

active_ticket_v2
object