# Rename an application or change its settings

> Rename an application or change its settings: CustomDomain™ API reference in the applications group. Covers parameters, request body, responses and error codes.

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

## `PATCH https://api.customdomain.ai/v1/applications/{id}`

Send any of `name`, `nameserver_migration`, `end_user_saved_access` and `challenge_mode` (at least one); everything is checked before anything is saved. `challenge_mode` (`off`, `report` or `on`) sets whether the widget's calls must pass a quick browser check (see the `428` above).

`nameserver_migration` sets whether the application offers to move an end user's nameservers and where to (`{"mode": "off"}` clears it). A `dns_host` target names a connected provider account of the workspace with continuous access at a DNS host whose API creates zones; only this application's migrations ever use it. The account is chosen under the same rule as an account a move uses: an admin or an owner may name any, a member the accounts they connected, and another member's is refused `403 forbidden` with nothing saved. Keeping the account the application already has is not a new choice: a member may change the mode and send the same target.

`end_user_saved_access` sets whether a returning end user may reuse the access their own secure sign-in kept (`true` is the default; see the `Application` schema). It takes `true` or `false`, never `null`. A test mode application keeps no saved access, so `true` is refused for it with `400`. Needs a key that may write the application (a viewer's key is a `403`). A delegated agent token needs `app:write`.

### Authentication

`apiKey`, `agentToken`

### Parameters

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

### Request body (JSON)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `name` | string | no |  |
| `nameserver_migration` | object | no |  |
| `end_user_saved_access` | boolean | no | Whether a returning end user may reuse the access their own secure sign-in kept, for their next domain in this application, after one tap of consent. |
| `challenge_mode` | `off`, `report`, `on` | no | Whether the widget's calls must pass a quick browser check. |

### Responses

| Status | Description |
| --- | --- |
| `200` | Application |
| `400` | Error envelope: {code, title, details}. |
| `401` | Error envelope: {code, title, details}. |
| `403` | Error envelope: {code, title, details}. |
| `404` | Error envelope: {code, title, details}. |

### `200` response body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | yes |  |
| `tenant_id` | string | no |  |
| `name` | string | yes |  |
| `environment` | `production`, `staging`, `development` | no |  |
| `default_origin` | string | no |  |
| `connect_target` | object | no |  |
| `sandbox` | boolean | no | `true` for a **test mode** application, made with `"sandbox": true` on `POST /applications`. It runs the whole connect flow end to end (the widget, the API, webhooks) against simulated DNS, on reserved `.test` names only, and never touches a real domain, the free domain, the quota or billing. Fixed when the application is created. Omitted (treated as `false`) on a live application. |
| `nameserver_migration` | object | no | Whether and how the application offers to move an end user's nameservers. It is the one switch for every DNS hosting offer the widget makes. `off` (the default): never offered, and the setting is omitted; a widget token can't start managed DNS either, nor while the target is `dns_host` or `custom`. `offer`: the widget shows the move as a quiet second choice beside adding records. `prefer`: the move is the first choice. Send `{"mode": "off"}` to clear it. |
| `challenge_mode` | `off`, `report`, `on` | no | Whether the widget's calls that start or check a setup must pass a quick browser check (`on`), are only logged when they would not (`report`), or neither (`off`, the default). |
| `end_user_saved_access` | boolean | no | A returning end user may reuse the access their own secure sign-in kept, for their next domain in this application, after one tap of consent. On by default; set it with `PATCH /applications/{id}`. The access is that end user's own: bound to them and to this application, never usable by your team or by another end user. Always `false` for a test mode application, whose sign-ins are simulated and keep nothing. |
| `secure_sign_in` | object | no | Whether the secure sign-in (the widget's cloud browser way to connect) can run for this application's workspace at all, for any provider. Read only: it follows how this deployment is set up, not a setting of the application. Whether it runs for one domain is the `cloud_browser` entry of that domain's `rails`. |
| `first_key_mint_at` | string | no | When one of your API keys first minted a widget token for this application. Absent until then, and for a test mode application. |
| `created_at` | string | no |  |

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