Cancel a connection

SDK platic.channels.connections.cancel()

Cancel a pending connection. shareUrl shows that it was cancelled, and authorizeIn no longer allows authorization. Use this if you requested the connection by mistake or no longer want to complete it.

If you only sent the link to the wrong person, you can also renew it: the previous one stops working and the connection stays pending.

Example

await platic.channels.connections.cancel("connection_123");

Path parameters

ParameterTypeDescriptionRequired
connectionIdstringConnection id (chc_…)✓

Query parameters

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

Response

data is the connection, now cancelled.

{
  "status": "success",
  "message": "Connection cancelled",
  "data": {
    "id": "chc_7f3k9QmX2pLwR4tZ",
    "type": "messenger",
    "completion": "authorize",
    "status": "cancelled",
    "authorizeIn": null,
    "shareUrl": null,
    "createdAt": "2026-11-12T18:40:00.000Z",
    "expiresAt": "2026-11-13T18:40:00.000Z",
    "agentId": "tVKljCHCNiebQdasHeit",
    "availableAssets": [],
    "channels": [],
    "error": null,
    "nextStep": "Cancelled. To connect this channel, start a new connection with POST /v1/channels/connections."
  }
}

The fields are in get a connection.

Errors

If already cancelled, it returns 200 with cancelled. You can repeat the call if you lost the response.

Statusdetails.codeWhen it happens
400INVALID_REQUESTYour credential covers several workspaces and you did not send ?workspace=, or you sent one it does not cover. details.available lists the ones you can use
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_INSTALLINGThe connection is installing (installing); it can no longer be cancelled
409CONNECTION_FINISHEDThe connection already finished: connected, failed, or expired, in details.status
503OPERATION_UNCONFIRMEDPlatica could not confirm the cancellation. Get the connection before retrying
{
  "code": 409,
  "error": "Conflict - The resource state conflicts with this request",
  "details": {
    "code": "CONNECTION_FINISHED",
    "message": "La conexión ya terminó: el canal quedó conectado.",
    "status": "connected"
  }
}

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

Notes

  • It does not touch channels that already exist.
  • To connect later, request another connection.
  • Needs a workspace API key, or an OAuth token with write access to Integrations and the platica:write scope.