# Rotate an application's edge auth secret

> Rotate an application's edge auth secret: CustomDomain™ API reference in the applications group. Covers parameters, request body, responses and error codes.

Source: https://docs.customdomain.ai/docs/api-reference/applications/rotateEdgeSecret

## `POST https://api.customdomain.ai/v1/applications/{id}/edge-secret:rotate`

Mints a new `edge_auth_secret` for the application and invalidates the previous one immediately. There is no overlap window, so the edge must be reconfigured with the returned value before it can authenticate again. Requires `app:write` (member and above); a widget token cannot call it. The secret is returned once and is not retrievable afterwards.

### Authentication

`apiKey`

### Parameters

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

### Responses

| Status | Description |
| --- | --- |
| `200` | The new secret. Store it now; it is never shown again. |
| `403` | Error envelope: {code, title, details}. |
| `404` | Error envelope: {code, title, details}. |

### `200` response body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `application_id` | string | yes |  |
| `edge_auth_secret` | string | yes | The new shared secret. Shown exactly once. |

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