Skip to navigation

Connect a channel

Connects a Telegram or Instagram channel to a robot. Other channel types are connected in the ParsChat panel.

Channels you hold credentials for, such as Telegram, connect immediately. Pass the credential in config and the response is a live channel with is_active: true.

Instagram is different. Meta requires the page owner to authorise in their own browser, so nothing is connected yet: the response is a pending channel carrying an authorisation_url. Send the page owner there. The channel becomes active only when they finish, and holds no capacity until then. Configure your return URL with us before the first connection, or the page owner’s browser lands on a ParsChat screen instead of yours.

A robot holds at most one channel per type. An open Instagram handshake blocks a second one with 409 until it expires; once it has expired, retrying returns 410 and you start again.

A Telegram bot can be connected to one robot at a time; connecting a bot that is already connected elsewhere returns 409. Reconnecting a bot you disconnected from the same robot brings the channel back with its conversation history.

Authentication

AuthorizationBearer

Your API key, issued by ParsChat sales. One key per account, spanning every robot you own. Send it as Authorization: Bearer pk_live_….

Path parameters

robot_idstringRequired
The robot's id, as returned by the create call.

Request

This endpoint expects an object.
typeenumRequired

The channel type to connect. Telegram and Instagram can be connected over the API; other channel types are connected in the ParsChat panel and then appear in your channel lists.

Allowed values:
configobjectOptional

Credentials for channels you hold the credentials for, such as a Telegram bot token. Instagram takes no config: the page owner authorises in their own browser instead.

Response

The channel was created. What you get back depends on the type: a live channel for one you hold credentials for, or a pending handshake for Instagram.

connectedobject
A connected surface, such as an Instagram page. A channel always belongs to one robot.
OR
pending_authorisationobject

A started Instagram handshake. Nothing is connected yet: the page owner has to authorise in their own browser before the channel becomes active.

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
404
Not Found Error
409
Conflict Error
410
Gone Error
422
Unprocessable Entity Error
429
Too Many Requests Error
500
Internal Server Error
503
Service Unavailable Error