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.
| Capability | API | Webhook |
|---|---|---|
| Initiator | Your application | 3Chat |
| Direction | Your server → 3Chat | 3Chat → your server |
| Best for | Queries and commands | Real-time notifications |
| Timing | When your application makes a request | When a subscribed event occurs |
| Data | Requested resource or operation result | Event 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.
All API operations in this reference use:
https://app.3chat.aiThe API version is part of the endpoint path. Do not remove or rewrite it:
/api/open/v3/...
/api/open/v4/...The App Key identifies an OpenAPI application in a 3Chat Workspace. It is used with the App Secret to create an Access Token.
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.
The Access Token authorizes calls to protected APIs. Send it in the Authorization header:
Authorization: Bearer your_access_tokenThe 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.
- Create a token with
POST /api/open/v3/tokenand the App Key and App Secret. - Cache the Access Token, Refresh Token, and expiration values securely.
- Send the Access Token with protected API requests.
- Refresh with
PUT /api/open/v3/tokenbefore the Access Token expires. - If the Refresh Token expires, create a new pair with the App Key and App Secret.
See Get started for runnable curl examples.
Most 3Chat endpoints use JSON over HTTPS:
Content-Type: application/json
Authorization: Bearer your_access_tokenMany 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.
The reference groups operations by 3Chat business entity:
| Group | Typical operations |
|---|---|
| Authentication | Create and refresh tokens; check access permission |
| Agent | Send a message to an Agent; deploy an Agent |
| Channel | Send messages, list channels, and use supported Facebook operations |
| Dialog | List customer dialogs |
| Visitor | List, create, and update visitors |
| Conversation | Transfer, assign, update, list, and close conversations |
| Message | List messages |
| Knowledge Base | Upload files and manage knowledge processing tasks |
| Chat Group | List and update chat groups |
| Skill | List and create or update Agent skills |
| User & Tenant Domain | Manage staff and staff-department relationships |
Open the API Reference for complete request and response schemas.
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
codeand expected fields indata. - Log a request or correlation identifier when the response provides one.
- Avoid logging tokens, secrets, or unnecessary customer data.
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.
- 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.