Choose what to connect

SDK platic.channels.connections.select()

When an authorized account has several pages, accounts, or numbers, the connection waits in awaiting_selection. Choose which ones to connect; each becomes a channel. The person can also choose through shareUrl or authorizeIn. The first selection is accepted.

Example

await platic.channels.connections.select("connection_123", ["page_123"]);

Path parameters

ParameterTypeDescriptionRequired
connectionIdstringConnection id (chc_…)✓

Query parameters

ParameterTypeDescriptionRequired
workspacestringOnly if your credential has several workspaces: which one the connection is in—

Request body

FieldTypeDescriptionRequired
assetsstring[]The platformId of each thing to connect, taken from availableAssets. 1 to 50✓
{
  "assets": ["104857362918475"]
}

Response

data is the connection, in installing or already connected. If it is still installing, get it in a few seconds.

{
  "status": "success",
  "message": "Channel connected",
  "data": {
    "id": "chc_7f3k9QmX2pLwR4tZ",
    "type": "messenger",
    "completion": "authorize",
    "status": "connected",
    "authorizeIn": null,
    "shareUrl": null,
    "createdAt": "2026-11-12T18:40:00.000Z",
    "expiresAt": "2026-11-13T18:40:00.000Z",
    "agentId": "tVKljCHCNiebQdasHeit",
    "availableAssets": [],
    "channels": [
      {
        "id": "104857362918475",
        "prefixedChannelId": "fb-104857362918475",
        "platform": "messenger",
        "channelType": "messenger",
        "isConnected": true,
        "status": "CONNECTED",
        "defaultAgentId": "tVKljCHCNiebQdasHeit",
        "name": "Acme Store",
        "displayPhoneNumber": null,
        "phoneNumber": null,
        "businessId": null,
        "wabaId": null,
        "kind": "messaging",
        "commentAutoReply": null,
        "creationDate": "2026-11-12T18:42:10.000Z",
        "lastUpdate": "2026-11-12T18:42:10.000Z",
        "health": { "state": "ok", "reason": null, "since": "2026-11-12T18:42:10.000Z" }
      }
    ],
    "error": null,
    "nextStep": "Connected: 1 channel in channels."
  }
}

The fields are in get a connection.

Errors

Statusdetails.codeWhen it happens
400INVALID_REQUESTassets is missing, empty, or has more than 50. details.issues says what happened. Also when your credential covers several workspaces and ?workspace= is missing (details.available)
400INVALID_ASSETSA platformId is not in availableAssets. details.platformIds says which
401UNAUTHENTICATED / CREDENTIAL_REVOKEDThe credential is missing, invalid, or no longer covers this workspace
403FORBIDDENThe credential does not have write access to Integrations
403INSUFFICIENT_SCOPEThe OAuth token does not have platica:write
403READ_ONLY_CREDENTIALAn internal Platica agent can only read
404CONNECTION_NOT_FOUNDThe connection does not exist in this workspace
409CONNECTION_NOT_AWAITING_SELECTIONThe connection is not in awaiting_selection (for example, it was already chosen on the page). details.status says how it is going
409CONNECTION_FINISHEDThe connection already finished: connected, failed, cancelled, or expired, in details.status
409ASSET_CONNECTED_ELSEWHERESomething that was chosen is already connected in another workspace. details.platformIds says which
503OPERATION_UNCONFIRMEDPlatica could not confirm the installation. Get the connection before retrying
{
  "code": 409,
  "error": "Conflict - The resource state conflicts with this request",
  "details": {
    "code": "ASSET_CONNECTED_ELSEWHERE",
    "message": "Ya está conectado en otro workspace. Primero hay que desconectarlo allá.",
    "platformIds": ["209384756102938"]
  }
}

Messages that come from Platica (details.message) are in Spanish; code against details.code. The general format is in Errors.

If something fails while installing, the response is 200 with the connection in failed and the reason in error (why it fails).

Notes

  • Whatever has installedElsewhere: true is connected in another workspace. To bring it over, disconnect it there first.
  • Installation may take a few seconds.
  • Needs a workspace API key, or an OAuth token with write access to Integrations and the platica:write scope.