Connect a channel
Start a pending connection. A person completes it to create one or more channels in the workspace. Check the connection until its state is connected.
completion tells you how to finish the connection for its type:
authorize(messenger,instagram,facebook-comments,instagram-comments): someone authorizes with Meta and chooses which pages or accounts to connect. The response hasshareUrl, a link you can send to whoever manages the Facebook page or the Instagram account, even if they have no Platica account or are not part of your workspace. It also hasauthorizeIn, the same step inside Platica for someone on your team with a session. See sending the link to someone else.wizard(whatsapp,email,gmail,outlook):authorizeInopens that channel's wizard in Platica, with?connection=chc_…. Someone on your team with a session and write access to Integrations finishes it there. There is noshareUrl. The connection becomesconnectedwhen a channel of that type is created in the workspace.
It also works to reconnect a channel that stopped working: request another connection of the same type.
For your site's chat or a web page, use create a web chat.
Example
curl https://api.platic.ai/v1/channels/connections \
-H "Authorization: Bearer $PLATIC_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "type": "messenger", "agentId": "'"$AGENT_ID"'" }' await platic.channels.connect({ type: "messenger", agentId: "agent_123" }); Query parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
workspace | string | Workspace ID. Required if your credential covers several workspaces; without it the answer is 400 | If the credential has several |
Request body
| Field | Type | Description | Required |
|---|---|---|---|
type | string | The channel. With a shareable link: messenger, instagram, facebook-comments, or instagram-comments. With a wizard in Platica: whatsapp, email, gmail, or outlook. The rest are explained in other types | ✓ |
agentId | string | null | The agent that will answer the resulting channels. It must exist in the workspace. If you omit it, they are left without an agent and you choose it later with update a channel | — |
expiresInMinutes | integer | How long the connection and its link last, in minutes: 15 to 10080 (7 days). If you omit it, 1440 (24 hours) | — |
{
"type": "messenger",
"agentId": "tVKljCHCNiebQdasHeit",
"expiresInMinutes": 2880
} Response
201 Created. data is the connection, in awaiting_user.
Messenger, Instagram, or comments (completion: "authorize"):
{
"status": "success",
"message": "Pending: a person must complete this connection — see nextStep",
"data": {
"id": "chc_7f3k9QmX2pLwR4tZ",
"type": "messenger",
"completion": "authorize",
"status": "awaiting_user",
"authorizeIn": "https://app.platica.mx/workspace/g6yCA16pkWl5eXo7KszB/connect/channel/chc_7f3k9QmX2pLwR4tZ",
"shareUrl": "https://app.platica.mx/connect/chl_Q2x7vR9mK4pT1sW8yZ3bN6cF0hJ5gL2dA7eU9iO4qXk",
"createdAt": "2026-11-12T18:40:00.000Z",
"expiresAt": "2026-11-14T18:40:00.000Z",
"agentId": "tVKljCHCNiebQdasHeit",
"availableAssets": [],
"channels": [],
"error": null,
"nextStep": "Send shareUrl to whoever manages the Facebook page: it works without a Platica account until expiresAt. They sign in with Facebook and choose the pages. A member of this workspace with access to Integrations can also open authorizeIn. Then check this connection again with GET /v1/channels/connections/chc_7f3k9QmX2pLwR4tZ. To send a new link (the current one stops working), use POST /v1/channels/connections/chc_7f3k9QmX2pLwR4tZ/link."
}
} WhatsApp, email, Gmail, or Outlook (completion: "wizard"):
{
"status": "success",
"message": "Pending: a person must complete this connection — see nextStep",
"data": {
"id": "chc_Vn2sQ8rT5wYk1LmP",
"type": "whatsapp",
"completion": "wizard",
"status": "awaiting_user",
"authorizeIn": "https://app.platica.mx/workspace/g6yCA16pkWl5eXo7KszB/integrations/channels/whatsapp/new?connection=chc_Vn2sQ8rT5wYk1LmP",
"shareUrl": null,
"createdAt": "2026-11-12T18:40:00.000Z",
"expiresAt": "2026-11-13T18:40:00.000Z",
"agentId": null,
"availableAssets": [],
"channels": [],
"error": null,
"nextStep": "Ask a person with access to Integrations in this workspace to open authorizeIn and finish the WhatsApp wizard in Platica. This connection becomes connected when the channel is created; check it with GET /v1/channels/connections/chc_Vn2sQ8rT5wYk1LmP."
}
} The fields are in get a connection. Save the id: you check the connection with it.
Other types
type | Response |
|---|---|
webchat, webpage | 409 USE_WEBCHATS. Web chat and the web page do not use a connection: they are created with POST /v1/webchats (the web page with mode: "page"). details.nextStep says how |
telegram, sms, voice | 409 CHANNEL_TYPE_NOT_AVAILABLE. They cannot be connected yet. details.channelsUrl opens the channels in Platica, where they show as coming soon |
| Any other | 400 INVALID_REQUEST |
{
"code": 409,
"error": "Conflict - The resource state conflicts with this request",
"details": {
"code": "CHANNEL_TYPE_NOT_AVAILABLE",
"message": "A \"telegram\" channel cannot be connected yet.",
"channelsUrl": "https://app.platica.mx/workspace/g6yCA16pkWl5eXo7KszB/integrations/channels",
"nextStep": "It is not available yet. channelsUrl opens the channels in Platica, where it shows as coming soon."
}
} Errors
| Status | details.code | When it happens |
|---|---|---|
400 | INVALID_REQUEST | type is missing or is not a type Platica knows, agentId is not valid, or expiresInMinutes is not an integer between 15 and 10080. details.issues says which field. Also when your credential covers several workspaces and ?workspace= is missing (details.available) |
401 | UNAUTHENTICATED / CREDENTIAL_REVOKED | The credential is missing, invalid, or no longer covers this workspace |
403 | FORBIDDEN | The credential does not have write access to Integrations, or does not have access to the agentId agent |
403 | INSUFFICIENT_SCOPE | The OAuth token does not have platica:write |
403 | READ_ONLY_CREDENTIAL | An internal Platica agent can only read |
404 | AGENT_NOT_FOUND | The agentId agent does not exist in this workspace |
409 | USE_WEBCHATS | type is webchat or webpage. Create it with create a web chat |
409 | CHANNEL_TYPE_NOT_AVAILABLE | type is telegram, sms, or voice. details.channelsUrl opens the channels in Platica |
503 | CHANNEL_NOT_CONFIGURED | That type is not available in this environment yet |
503 | OPERATION_UNCONFIRMED | Platica could not confirm whether it created the connection. List the connections before retrying |
{
"code": 400,
"error": "Bad Request - The request has validation errors",
"details": {
"code": "INVALID_REQUEST",
"message": "expiresInMinutes must be at most 10080 (7 days)",
"issues": [
{ "path": ["expiresInMinutes"], "message": "expiresInMinutes must be at most 10080 (7 days)" }
]
}
} Messages that come from Platica (AGENT_NOT_FOUND, CHANNEL_NOT_CONFIGURED, and the permission ones) are in Spanish; code against details.code. The general format is in Errors.
The connection and its link expire at expiresAt: 24 hours after requesting it, or what you say in expiresInMinutes. If the link was sent to the wrong person or more time is needed, renew it before it expires. If it already expired, request another connection.
Notes
authorizeInis completed by a workspace member with write access to Integrations, with their Platica session. It does not have to be whoever requested the connection.shareUrldoes not ask for a session: whoever has access to the page or account in Meta opens it.- On a
wizardconnection, any channel of that type created in the workspace after you request it completes it, even if it was not opened fromauthorizeIn. It is checked every time you get or list connections. - One connection can create several channels. If the account has several pages or accounts, the connection waits in
awaiting_selection: choose what to connect, or let the person choose on the page where they authorized. - To stop it before it finishes, cancel it.
- Needs a workspace API key, or an OAuth token with write access to Integrations and the
platica:writescope.