# Set or clear the application-wide default origin

> Set or clear the application-wide default origin: CustomDomain™ API reference in the power group. Covers parameters, request body, responses and error codes.

Source: https://docs.customdomain.ai/docs/api-reference/power/setApplicationDefaultOrigin

## `PUT https://api.customdomain.ai/v1/applications/{id}/power:default`

Send `default_origin: ""` to clear it. The value is validated by the same guard a per-connection origin gets, and the edge re-validates the RESOLVED address at dial time: a hostname that passes here and is later repointed at a private address is refused when the edge connects.

### Authentication

`widgetJWT`, `apiKey`

### Parameters

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

### Request body (JSON)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `default_origin` | string | yes | Absolute http(s) URL, or "" to clear. |

### Responses

| Status | Description |
| --- | --- |
| `200` | The stored default |
| `400` | Error envelope: {code, title, details}. |
| `401` | Error envelope: {code, title, details}. |
| `402` | Error envelope: {code, title, details}. |
| `404` | Error envelope: {code, title, details}. |
| `503` | Error envelope: {code, title, details}. |

### `200` response body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `application_id` | string | no |  |
| `default_origin` | string | no | Absent when no default is set. |
| `configured` | boolean | no | Whether a default is set. Distinguishes "no default" from an empty value. |

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