---
docId: doc_8f696d40f4f74049b9e4cb3aa41570cd
title: Cancel a connection
description: "Cancel a pending connection and invalidate its links."
api:
  group: canales
  auth: bearer
  operations:
    - operationId: cancelChannelConnection
      method: DELETE
      path: '/v1/channels/connections/{connectionId}'
      postmanName: Cancel a connection
---

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

# Cancel a connection

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](/api-reference/channels/connections/renew-link): the previous one stops working and the connection stays pending.

## Example

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

```bash
curl -X DELETE https://api.platic.ai/v1/channels/connections/$CONNECTION_ID \
  -H "Authorization: Bearer $PLATIC_API_KEY"
```

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

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

</Ways.Way>
</Ways>

## Path parameters

| Parameter | Type | Description | Required |
|-----------|------|-------------|----------|
| `connectionId` | string | Connection id (`chc_…`) | ✓ |

## Query parameters

| Parameter | Type | Description | Required |
|-----------|------|-------------|----------|
| `workspace` | string | Only if your credential has several workspaces: which one the connection is in | — |

## Response

`data` is the connection, now `cancelled`.

```json
{
  "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](/api-reference/channels/connections/get#response-fields).

## Errors

<Collapsible summary="Show error codes and fixes">

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

| Status | `details.code` | When it happens |
|--------|----------------|-----------------|
| `400` | `INVALID_REQUEST` | Your 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 |
| `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 |
| `403` | `INSUFFICIENT_SCOPE` | The OAuth token does not have `platica:write` |
| `403` | `READ_ONLY_CREDENTIAL` | An internal Platica agent can only read |
| `404` | `CONNECTION_NOT_FOUND` | The connection does not exist in this workspace |
| `409` | `CONNECTION_INSTALLING` | The connection is installing (`installing`); it can no longer be cancelled |
| `409` | `CONNECTION_FINISHED` | The connection already finished: `connected`, `failed`, or `expired`, in `details.status` |
| `503` | `OPERATION_UNCONFIRMED` | Platica could not confirm the cancellation. [Get the connection](/api-reference/channels/connections/get) before retrying |

```json
{
  "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](/api-reference/errors).

</Collapsible>

## Notes

- It does not touch channels that already exist.
- To connect later, [request another connection](/api-reference/channels/connections/create).
- Needs a workspace API key, or an OAuth token with write access to Integrations and the `platica:write` scope.
