{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-guides/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"API overview","description":"Build integrations with 3Chat APIs and webhook events."},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"api-overview","__idx":0},"children":["API overview"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["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."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"api-or-webhook","__idx":1},"children":["API or webhook?"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Capability"},"children":["Capability"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"API"},"children":["API"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Webhook"},"children":["Webhook"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Initiator"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Your application"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["3Chat"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Direction"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Your server → 3Chat"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["3Chat → your server"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Best for"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Queries and commands"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Real-time notifications"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Timing"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["When your application makes a request"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["When a subscribed event occurs"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Data"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Requested resource or operation result"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Event and identifiers related to what occurred"]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["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."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"base-url-and-versions","__idx":2},"children":["Base URL and versions"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["All API operations in this reference use:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"text","header":{"controls":{"copy":{}}},"source":"https://app.3chat.ai\n","lang":"text"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The API version is part of the endpoint path. Do not remove or rewrite it:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"text","header":{"controls":{"copy":{}}},"source":"/api/open/v3/...\n/api/open/v4/...\n","lang":"text"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"application-credentials","__idx":3},"children":["Application credentials"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"app-key","__idx":4},"children":["App Key"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The App Key identifies an OpenAPI application in a 3Chat Workspace. It is used with the App Secret to create an Access Token."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"app-secret","__idx":5},"children":["App Secret"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["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."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"access-token","__idx":6},"children":["Access Token"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The Access Token authorizes calls to protected APIs. Send it in the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Authorization"]}," header:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"http","header":{"controls":{"copy":{}}},"source":"Authorization: Bearer your_access_token\n","lang":"http"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"refresh-token","__idx":7},"children":["Refresh Token"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["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."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"authentication-flow","__idx":8},"children":["Authentication flow"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Create a token with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /api/open/v3/token"]}," and the App Key and App Secret."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Cache the Access Token, Refresh Token, and expiration values securely."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Send the Access Token with protected API requests."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Refresh with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PUT /api/open/v3/token"]}," before the Access Token expires."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["If the Refresh Token expires, create a new pair with the App Key and App Secret."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["See ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/guides/getting-started"},"children":["Get started"]}," for runnable curl examples."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"request-conventions","__idx":9},"children":["Request conventions"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Most 3Chat endpoints use JSON over HTTPS:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"http","header":{"controls":{"copy":{}}},"source":"Content-Type: application/json\nAuthorization: Bearer your_access_token\n","lang":"http"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Many request schemas place operation parameters in a top-level ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["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."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Do not add an empty ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Cookie"]}," header. Do not use ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--insecure"]}," in production requests."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"api-groups","__idx":10},"children":["API groups"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The reference groups operations by 3Chat business entity:"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Group"},"children":["Group"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Typical operations"},"children":["Typical operations"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Authentication"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Create and refresh tokens; check access permission"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Agent"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Send a message to an Agent; deploy an Agent"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Channel"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Send messages, list channels, and use supported Facebook operations"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Dialog"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["List customer dialogs"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Visitor"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["List, create, and update visitors"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Conversation"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Transfer, assign, update, list, and close conversations"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Message"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["List messages"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Knowledge Base"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Upload files and manage knowledge processing tasks"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Chat Group"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["List and update chat groups"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Skill"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["List and create or update Agent skills"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["User & Tenant Domain"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Manage staff and staff-department relationships"]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Open the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/apis/3chat-api"},"children":["API Reference"]}," for complete request and response schemas."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"responses-and-application-level-status","__idx":11},"children":["Responses and application-level status"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Check both the HTTP status and the JSON response body. Many endpoints use a response envelope containing fields such as ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["code"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["message"]},", and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data"]},"."]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Treat a non-success HTTP status as a transport or authorization failure."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["For an HTTP success response, also inspect the application-level ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["code"]}," and expected fields in ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Log a request or correlation identifier when the response provides one."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Avoid logging tokens, secrets, or unnecessary customer data."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"error-handling","__idx":12},"children":["Error handling"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Handle errors according to the endpoint contract and response body:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Authentication failure:"]}," obtain a valid token and confirm the application has access."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Validation failure:"]}," compare the request with the operation's schema and required fields."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Missing resource:"]}," verify that resource identifiers belong to the correct Workspace."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Rate or temporary service failure:"]}," retry only when the response indicates the request is retryable; use bounded exponential backoff with jitter."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Unexpected server failure:"]}," record the HTTP status, response code, endpoint, and a safe correlation identifier before contacting 3Chat support."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Do not retry non-idempotent operations automatically unless your integration prevents duplicate business actions."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"security-checklist","__idx":13},"children":["Security checklist"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Use HTTPS for every request."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Keep App Secrets and tokens on the server."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Grant the application only the permissions it needs."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Rotate or replace credentials if exposure is suspected."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Redact credentials and personal data from logs."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Validate identifiers and request data before calling write operations."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"related-documentation","__idx":14},"children":["Related documentation"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/guides/getting-started"},"children":["Get started"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/apis/3chat-api"},"children":["API Reference"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/guides/webhooks-overview"},"children":["Webhooks overview"]}]}]}]},"headings":[{"value":"API overview","id":"api-overview","depth":1},{"value":"API or webhook?","id":"api-or-webhook","depth":2},{"value":"Base URL and versions","id":"base-url-and-versions","depth":2},{"value":"Application credentials","id":"application-credentials","depth":2},{"value":"App Key","id":"app-key","depth":3},{"value":"App Secret","id":"app-secret","depth":3},{"value":"Access Token","id":"access-token","depth":3},{"value":"Refresh Token","id":"refresh-token","depth":3},{"value":"Authentication flow","id":"authentication-flow","depth":2},{"value":"Request conventions","id":"request-conventions","depth":2},{"value":"API groups","id":"api-groups","depth":2},{"value":"Responses and application-level status","id":"responses-and-application-level-status","depth":2},{"value":"Error handling","id":"error-handling","depth":2},{"value":"Security checklist","id":"security-checklist","depth":2},{"value":"Related documentation","id":"related-documentation","depth":2}],"frontmatter":{"title":"API overview","description":"Understand 3Chat authentication, requests, resource groups, and responses.","seo":{"title":"API overview"}},"lastModified":"2026-09-18T09:18:24.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/guides/quickstart","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}