# A link the end user opens to renew the domain's lasting API key

> A link the end user opens to renew the domain's lasting API key: CustomDomain™ API reference. Covers parameters, request body, responses and error codes.

Source: https://docs.customdomain.ai/docs/api-reference/cloud-browser/createConnectionReconnectLink

## `POST https://api.customdomain.ai/v1/connections/{id}:reconnect-link`

For a connection whose records were written with a lasting API key the cloud browser's agent made at the DNS provider. The link opens the hosted connect page in reconnect mode, straight on the sign in for that provider: after the end user signs in, the agent makes a new key with the same scopes, checks it and swaps it in, and no DNS record changes. It is a shared flow link (`/connect/{token}`): it works once and expires after 14 days.

With `send: true` and the end user's email address on the connection (and the end user email feature on), CustomDomain™ emails the link on the application's behalf and the answer is `emailed: true` with no `link`; otherwise the answer carries the `link` to pass on. The control plane also emails one by itself 30 and 7 days before the key's end and when the provider stops accepting it. A connection with no such key answers `409` `not_reconnectable`. A delegated agent token needs `domains:connect`.

### Authentication

`widgetJWT`, `apiKey`, `agentToken`

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes |  |

### Request body (JSON)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `send` | boolean | no | Email the link to the end user when their address is known. |

### Responses

| Status | Description |
| --- | --- |
| `200` | The link, or that it was emailed. |
| `401` | Error envelope: {code, title, details}. |
| `403` | Error envelope: {code, title, details}. |
| `404` | Error envelope: {code, title, details}. |
| `409` | Error envelope: {code, title, details}. |

### `200` response body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `link` | string | no | The reconnect link; absent when it was emailed. |
| `emailed` | boolean | yes |  |

The full specification is served at `GET https://api.customdomain.ai/v1/openapi.json`.
