Skip to main content
The Chatling API lets your code do what your team does in the dashboard. Set up AI agents and train them on your content, chat with them as a user from your own app, and handle their conversations on every channel, from replying as a team member to assigning, labeling, and ending them.

Base URL

Get started

1

Create an API key

In the dashboard, go to Project settings > API and generate a key. See Authentication.
2

Make your first request

Retrieve the key to check that it works:
3

Build

Browse the endpoints in the reference, and learn how authentication, errors, and pagination work.
To use Chatling from AI apps such as Claude, ChatGPT, or Cursor without writing code, connect the MCP server.

Conventions

AI agents and chatbots

Chatling has two kinds of agent: AI agents and flow-builder chatbots.
  • Most endpoints work with both. Resources that belong to an agent, such as conversations, contacts, knowledge base sources, labels, teams, channels, and analytics, take either kind’s ID as agent_id.
  • Only the endpoints that manage the agent itself are separate: /agents for AI agents and /chatbots for chatbots. Using one kind’s ID at the other’s path returns 404, with a message pointing to the right path.
  • Some endpoints, such as WhatsApp templates and variables, are marked Available for AI agents only. They return 409 unsupported_agent_type for a chatbot.
  • A chatbot’s flow doesn’t run through the API. When you send a chatbot a user message, it answers from its knowledge base using the AI settings you pass in ai.

Idempotent requests

The API supports idempotency for safely retrying POST requests without performing the same operation twice. If a request times out or fails because of a network error, retry it with the same Idempotency-Key header. Use a unique value, such as a V4 UUID:
For 24 hours, retrying with the same key and the same request returns the saved response, with an Idempotent-Replayed: true header. Only successful responses are saved, so you can retry a failed request with the same key. Use a new key for each new request. Reusing a key for a different request returns 422 idempotency_key_reused.

Request IDs

Each API request has a request ID, returned in the X-Request-Id header and in error responses. Include it when you contact support.

Authentication

API keys, key restrictions, and rate limits.

Errors

The error format and error codes.

Pagination

Paginate through lists with cursors.