---
docId: doc_429e9e5b9cfd46f79298397f306a98b2
title: Renew the link
description: "Renew a pending connection link and invalidate the previous one."
api:
  group: canales
  auth: bearer
  operations:
    - operationId: renewChannelConnectionLink
      method: POST
      path: '/v1/channels/connections/{connectionId}/link'
      postmanName: Renew the link
---

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

# Renew the link

Generate a new `shareUrl` for a pending Messenger, Instagram, or comments connection (`completion: "authorize"`). The previous link stops working immediately. The new link and the connection expire together.

Use it if you sent the link to the wrong person, if it leaked, or if more time is needed. See [sending the link to someone else](/api-reference/channels#sending-the-link-to-someone-else).

## Example

```bash
curl -X POST https://api.platic.ai/v1/channels/connections/$CONNECTION_ID/link \
  -H "Authorization: Bearer $PLATIC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "expiresInMinutes": 4320 }'
```

## Path parameters

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

## Query parameters

| Parameter | Type | Description | Required |
|-----------|------|-------------|----------|
| `workspace` | string | Workspace ID. Required if your credential covers several workspaces; without it the answer is `400` | If the credential has several |

## Request body

| Parameter | Type | Description | Required |
|-----------|------|-------------|----------|
| `expiresInMinutes` | integer | New validity, in minutes, counted from now: `15` to `10080` (7 days). Default `1440` (24 hours). It can shorten the validity, not only extend it | — |

The body is optional.

```json
{
  "expiresInMinutes": 4320
}
```

## Response

`data` is the connection, with its new `shareUrl` and its new `expiresAt`.

```json
{
  "status": "success",
  "message": "New shareable link: the previous one no longer works",
  "data": {
    "id": "chc_7f3k9QmX2pLwR4tZ",
    "type": "messenger",
    "completion": "authorize",
    "status": "awaiting_user",
    "authorizeIn": "https://app.platica.mx/workspace/g6yCA16pkWl5eXo7KszB/connect/channel/chc_7f3k9QmX2pLwR4tZ",
    "shareUrl": "https://app.platica.mx/connect/chl_Hk4nW8pZ2tY6vB1qR5sX9cM3jF7dL0gA2eU8iO6wNyb",
    "createdAt": "2026-11-12T18:40:00.000Z",
    "expiresAt": "2026-11-16T09:15:00.000Z",
    "agentId": "tVKljCHCNiebQdasHeit",
    "availableAssets": [],
    "channels": [],
    "error": null,
    "nextStep": "Send shareUrl to whoever manages the Facebook page: it works without a Platica account until expiresAt. They sign in with Facebook and choose the pages. A member of this workspace with access to Integrations can also open authorizeIn. Then check this connection again with GET /v1/channels/connections/chc_7f3k9QmX2pLwR4tZ. To send a new link (the current one stops working), use POST /v1/channels/connections/chc_7f3k9QmX2pLwR4tZ/link."
  }
}
```

The fields are in [get a connection](/api-reference/channels/connections/get#response-fields).

## Errors

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

| Status | `details.code` | When it happens |
|--------|----------------|-----------------|
| `400` | `INVALID_REQUEST` | `expiresInMinutes` is not an integer between 15 and 10080. `details.issues` says so. Also when your credential covers several workspaces and `?workspace=` is missing (`details.available`) |
| `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` | `SHARE_LINK_NOT_AVAILABLE` | It is a `wizard` connection (WhatsApp, email, Gmail, or Outlook): it is completed in Platica, with a session, and has no share link. `details.type` says the type |
| `409` | `CONNECTION_FINISHED` | The connection already finished: `connected`, `failed`, `cancelled`, or `expired`, in `details.status`. If it expired or was cancelled, [request another one](/api-reference/channels/connections/create) |
| `409` | `CONNECTION_INSTALLING` | The connection is installing (`installing`); it no longer needs a link |
| `503` | `OPERATION_UNCONFIRMED` | Platica could not confirm whether it issued the link. [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 venció.",
    "status": "expired"
  }
}
```

Messages that come from Platica (`details.message`) are in Spanish; code against `details.code`. The general format is in [Errors](/api-reference/errors).

<Note type="note">

Renew before `expiresAt`. An expired connection returns `409 CONNECTION_FINISHED`: request another connection.

</Note>

</Collapsible>

## Notes

- It works while the connection is `awaiting_user`, `authorizing`, or `awaiting_selection`.
- `authorizeIn` does not change.
- Needs a workspace API key, or an OAuth token with write access to Integrations and the `platica:write` scope.
