Skip to content
Last updated

API overview

The 3Chat API lets an external application actively query 3Chat data or perform an action. Common integrations invoke Agents, synchronize customer conversations, send messages, and manage knowledge and staff data.

API or webhook?

CapabilityAPIWebhook
InitiatorYour application3Chat
DirectionYour server → 3Chat3Chat → your server
Best forQueries and commandsReal-time notifications
TimingWhen your application makes a requestWhen a subscribed event occurs
DataRequested resource or operation resultEvent and identifiers related to what occurred

Many integrations use both. A webhook can tell your application that a dialog was created; your application can then call APIs to query related dialogs, visitors, conversations, or messages.

Base URL and versions

All API operations in this reference use:

https://app.3chat.ai

The API version is part of the endpoint path. Do not remove or rewrite it:

/api/open/v3/...
/api/open/v4/...

Application credentials

App Key

The App Key identifies an OpenAPI application in a 3Chat Workspace. It is used with the App Secret to create an Access Token.

App Secret

The App Secret authenticates the application when it requests a token. Treat it as a password and store it only in a server-side secret store.

Access Token

The Access Token authorizes calls to protected APIs. Send it in the Authorization header:

Authorization: Bearer your_access_token

Refresh Token

The Refresh Token creates a new token pair without resending the App Secret. Both token types have expiration values; always use the values returned by the authentication response.

Authentication flow

  1. Create a token with POST /api/open/v3/token and the App Key and App Secret.
  2. Cache the Access Token, Refresh Token, and expiration values securely.
  3. Send the Access Token with protected API requests.
  4. Refresh with PUT /api/open/v3/token before the Access Token expires.
  5. If the Refresh Token expires, create a new pair with the App Key and App Secret.

See Get started for runnable curl examples.

Request conventions

Most 3Chat endpoints use JSON over HTTPS:

Content-Type: application/json
Authorization: Bearer your_access_token

Many request schemas place operation parameters in a top-level body object. Query operations may include conditions, sorting, and paging. Always follow the request schema shown on the individual endpoint page because fields vary by operation.

Do not add an empty Cookie header. Do not use --insecure in production requests.

API groups

The reference groups operations by 3Chat business entity:

GroupTypical operations
AuthenticationCreate and refresh tokens; check access permission
AgentSend a message to an Agent; deploy an Agent
ChannelSend messages, list channels, and use supported Facebook operations
DialogList customer dialogs
VisitorList, create, and update visitors
ConversationTransfer, assign, update, list, and close conversations
MessageList messages
Knowledge BaseUpload files and manage knowledge processing tasks
Chat GroupList and update chat groups
SkillList and create or update Agent skills
User & Tenant DomainManage staff and staff-department relationships

Open the API Reference for complete request and response schemas.

Responses and application-level status

Check both the HTTP status and the JSON response body. Many endpoints use a response envelope containing fields such as code, message, and data.

  • Treat a non-success HTTP status as a transport or authorization failure.
  • For an HTTP success response, also inspect the application-level code and expected fields in data.
  • Log a request or correlation identifier when the response provides one.
  • Avoid logging tokens, secrets, or unnecessary customer data.

Error handling

Handle errors according to the endpoint contract and response body:

  • Authentication failure: obtain a valid token and confirm the application has access.
  • Validation failure: compare the request with the operation's schema and required fields.
  • Missing resource: verify that resource identifiers belong to the correct Workspace.
  • Rate or temporary service failure: retry only when the response indicates the request is retryable; use bounded exponential backoff with jitter.
  • Unexpected server failure: record the HTTP status, response code, endpoint, and a safe correlation identifier before contacting 3Chat support.

Do not retry non-idempotent operations automatically unless your integration prevents duplicate business actions.

Security checklist

  • Use HTTPS for every request.
  • Keep App Secrets and tokens on the server.
  • Grant the application only the permissions it needs.
  • Rotate or replace credentials if exposure is suspected.
  • Redact credentials and personal data from logs.
  • Validate identifiers and request data before calling write operations.