---
docId: doc_d074e653e22e42e1816c4014561a58d4
title: 'Channels'
description: "Connect channels, check their health, and assign their responding agent."
---

<script>
  import { Note, Ways } from '$lib/components';
</script>

# Channels

Connect WhatsApp, Messenger, Instagram, email, or web chat to publish your agents or add communication to your product. These endpoints connect the channel, check its health, and change its assigned agent.

You can connect a channel without an agent: incoming messages are saved in supervised conversations and sent to your [webhooks](/api-reference/webhooks). Assign an agent when you want automatic replies.

## Quick example

<Ways tabs="api,sdk">
<Ways.Way name="api">

```bash
# 1. Request the connection. It returns shareUrl, the link to send, valid for 24 hours
curl -X POST https://api.platic.ai/v1/channels/connections \
  -H "Authorization: Bearer $PLATIC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"type": "messenger", "agentId": "'"$AGENT_ID"'"}'

# 2. Check it until it is connected (or awaiting_selection)
curl https://api.platic.ai/v1/channels/connections/$CONNECTION_ID \
  -H "Authorization: Bearer $PLATIC_API_KEY"
```

</Ways.Way>
<Ways.Way name="sdk">

```ts
// 1. Request a connection and hand the link to whoever will authorize
const conn = await platic.channels.connect({ type: 'messenger', agentId });
console.log('Authorize here:', conn.authorizeIn);

// 2. Wait until it finishes (or select assets if it returns awaiting_selection)
const done = await platic.channels.connections.wait(conn.id);

// 3. Change the agent of any channel whenever you want
await platic.channels.update(done.channels[0].id, { defaultAgentId: agentId });
```

</Ways.Way>
</Ways>

## What you need to know

- **Connect:** [start the connection](/api-reference/channels/connections/create) and ask a person to complete it. It can create one or more channels. It expires in 24 hours by default; `expiresInMinutes` allows 15 minutes to 7 days.
- **How it is completed (`completion`):**
  - `authorize` (`messenger`, `instagram`, `facebook-comments`, `instagram-comments`): someone authorizes with Meta. The response has `shareUrl`, a link you can send to whoever manages the page or account even if they have no Platica account, and `authorizeIn`, the same step inside Platica for someone on your team. If the account has several pages or accounts, they are chosen in `awaiting_selection`.
  - `wizard` (`whatsapp`, `email`, `gmail`, `outlook`): `authorizeIn` opens that channel's wizard in Platica, with a session. There is no `shareUrl`. The connection becomes `connected` when the wizard creates the channel.
- **Other types:** your site's chat is created directly in [Web chat](/api-reference/web-chats#endpoints) (`409 USE_WEBCHATS` here). Telegram, SMS, and voice are not available yet (`409 CHANNEL_TYPE_NOT_AVAILABLE`).
- **Channel health (`health`):** every channel reports `ok`, `needs_reconnection`, `action_required`, `paused`, or `disconnected` with its `reason` (see [list channels](/api-reference/channels/list#health)). To reconnect a channel, request another connection of the same `type`.
- **What each channel is (`platform`):** `whatsapp`, `messenger`, `instagram`, `facebook_comments`, `instagram_comments`, `webchat`, or `email`. Every mailbox is `email`, whether it is on your domain, Gmail, or Outlook. The service Platica uses underneath is not part of the channel.
- **Disconnect vs delete:** disconnecting stops messages but keeps history and agent; deleting removes it from the workspace.
- **Permissions:** requires **Integrations**. Reading needs `platica:read`; creating or changing needs write access to Integrations and, with OAuth, `platica:write`. Whoever opens `authorizeIn` needs a Platica session and write access to Integrations; whoever opens `shareUrl` needs neither.

## Sending the link to someone else

Send `shareUrl` to the person who manages the Facebook page or Instagram account. It is available for Messenger, Instagram, and comments.

- **Who opens it:** anyone with access to the page or account in Meta. They need no Platica account and do not have to be in your workspace. For someone on your team with a session there is `authorizeIn`, which does the same inside Platica; sending the link does not change how connecting works from inside the platform.
- **What they see:** a Platica page (`https://app.platica.mx/connect/chl_…`) that says which workspace it connects to, which channel, who requested it (the API key's or the person's name), and when it expires. **Continue** signs them in with Facebook, they authorize, and they come back to the same page. If they authorized several pages or accounts, they choose which ones to connect there. They see nothing else of your workspace.
- **When it expires:** at the same time as the connection, at `expiresAt`. An expired, cancelled, or replaced link says it no longer works and asks them to request a new one from whoever sent it.
- **If you need another one:** [renew the link](/api-reference/channels/connections/renew-link) while the connection is still pending, for example if you sent it to the wrong person or need more time. The previous link stops working right away and the connection expires with the new one. If the connection already expired, request another one.
- **To stop it:** [cancel the connection](/api-reference/channels/connections/cancel). Neither `shareUrl` nor `authorizeIn` lets anyone authorize after that.

When they are done, [get the connection](/api-reference/channels/connections/get) or [list the pending ones](/api-reference/channels/connections/list): `shareUrl` comes back in every read while it is pending.

<Note type="warning">

The token in the URL (`chl_…`) is the link's only credential: whoever has it can connect to your workspace the pages or accounts they have access to. Send it only to the person who will use it, through a private channel, and do not post it publicly. If it leaks, renew it or cancel the connection.

</Note>

## Endpoints

| Method | Endpoint | What it does |
|--------|----------|--------------|
| `GET` | [`/v1/channels`](/api-reference/channels/list) | List channels and their `health` |
| `GET` | [`/v1/channels/{channelId}`](/api-reference/channels/get) | Get a channel |
| `PATCH` | [`/v1/channels/{channelId}`](/api-reference/channels/update) | Change the name or `defaultAgentId` |
| `POST` | [`/v1/channels/connections`](/api-reference/channels/connections/create) | Request a connection |
| `GET` | [`/v1/channels/connections`](/api-reference/channels/connections/list) | List connections, newest first |
| `GET` | [`/v1/channels/connections/{connectionId}`](/api-reference/channels/connections/get) | Check how a connection is going |
| `POST` | [`/v1/channels/connections/{connectionId}/link`](/api-reference/channels/connections/renew-link) | Issue another `shareUrl`; the previous one stops working |
| `POST` | [`/v1/channels/connections/{connectionId}/select`](/api-reference/channels/connections/select-assets) | Choose pages or accounts in `awaiting_selection` |
| `DELETE` | [`/v1/channels/connections/{connectionId}`](/api-reference/channels/connections/cancel) | Cancel a pending connection |
| `POST` | [`/v1/channels/{channelId}/disconnect`](/api-reference/channels/disconnect) | Disconnect the channel |
| `DELETE` | [`/v1/channels/{channelId}`](/api-reference/channels/delete) | Remove the channel from the workspace |

Step-by-step guides are in [Put it on a channel](/guides/connect-a-channel), errors in [Errors](/api-reference/errors), and AI tools in [Channels MCP](/mcp/tools#channels).
