Request

URL

GET https://www.chatbase.co/api/v1/chatbots/{chatbotId}/contacts

Path Parameters

chatbotId
string
required

The ID of the chatbot to retrieve contacts from

Headers

Authorization
string
required

Bearer <YOUR_API_KEY>

Query Parameters

per_page
number

Number of contacts per page

  • Default: 100
  • Minimum: 10
  • Maximum: 1000
page
number

The page number for pagination

  • Default: 1
  • Minimum: 1

Response

Success Response

  • Status: 200 OK
  • Content-Type: application/json
message
string

Success message

data
array

Array of contact objects

total
number

Total number of contacts available

pages
object
page
number

Current page number

per_page
number

Number of contacts per page

total_pages
number

Total number of pages available

{
  "message": "Success",
  "data": [
    {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "external_id": "kX2b8YpI-jRmN3vQ5",
      "name": "John Doe",
      "email": "john.doe@example.com",
      "phonenumber": "+1234567890",
      "custom_attributes": {
        "age": 30,
        "location": "New York"
      },
      "created_at": 1571672154,
      "updated_at": 1571672154
    }
    // ... more contacts
  ],
  "total": 150,
  "pages": {
    "page": 1,
    "per_page": 100,
    "total_pages": 2
  }
}

Error Responses

400 Bad Request

  • Invalid page number or per_page value
  • Page number out of range
{
  "message": "Invalid request parameters",
  "issues": [
    {
      "field": "per_page",
      "message": "Number must be greater than or equal to 10"
    }
  ]
}

401 Unauthorized

  • Invalid or missing API key
{
  "message": "Unauthorized access"
}

404 Not Found

  • Chatbot not found
{
  "message": "Chatbot not found"
}

429 Too Many Requests

  • Rate limit exceeded
{
  "message": "Rate limit exceeded"
}

500 Internal Server Error

  • Server error occurred
{
  "message": "Error retrieving chatbot contacts"
}

Code Examples