# Azion CLI custom-pages

The Azion CLI `custom-pages` commands create, list, describe, update, and delete custom page sets, the [Custom Pages](/en/documentation/platform/workloads/custom-pages/settings/) resource that replaces the error responses of a workload with pages served from a connector. These commands manage the set and do not assign it to a workload: `azion create workload-deployment --custom-page` does. The options every command accepts, such as `--format`, `--out`, and `-y`, are on [Global options](/en/documentation/devtools/cli/globals/).

---

## Create

`azion create custom-pages` creates a custom page set from a JSON file. The command has no flag per field:

```bash
azion create custom-pages [flags]
```

| Flag     | Short | Type   | Default | Description                                                                                                                                                            |
| -------- | ----- | ------ | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--file` | —     | string | —       | **Required**. Path to a JSON file with the attributes of the custom page set. Use `-` to read the JSON from standard input. Without it, the command asks for the path. |

This file describes an active set named `my-pages` with one page. A `404` status code gets the page at `/404.html` on the connector with ID `123475`:

```json
{
  "name": "my-pages",
  "active": true,
  "pages": [
    {
      "code": "404",
      "page": {
        "type": "page_connector",
        "attributes": {
          "connector": 123475,
          "ttl": 0,
          "uri": "/404.html"
        }
      }
    }
  ]
}
```

Pass the file to the create command:

```bash
azion create custom-pages --file cp-create.json
```

The command prints the ID of the set:

```text
Created Custom Page with ID 123
```

---

## List

`azion list custom-pages` lists the custom page sets of your account, 50 to a page:

```bash
azion list custom-pages [flags]
```

| Flag          | Short | Type   | Default | Description                                                                                   |
| ------------- | ----- | ------ | ------- | --------------------------------------------------------------------------------------------- |
| `--details`   | —     | —      | —       | Adds the `LAST EDITOR` and `LAST MODIFIED` columns to the `ID`, `NAME`, and `ACTIVE` columns. |
| `--filter`    | —     | string | —       | Name to filter the list by.                                                                   |
| `--order-by`  | —     | string | —       | Field to sort the list by.                                                                    |
| `--page`      | —     | int    | `1`     | Number of the page to return.                                                                 |
| `--page-size` | —     | int    | `50`    | Number of sets on each page.                                                                  |

This command returns the first page of a list split into pages of one set:

```bash
azion list custom-pages --page 1 --page-size 1
```

The command prints one row per set:

```text
ID   NAME      ACTIVE
123  my-pages  true
```

---

## Describe

`azion describe custom-pages` prints the settings of one custom page set:

```bash
azion describe custom-pages [flags]
```

| Flag               | Short | Type | Default | Description                            |
| ------------------ | ----- | ---- | ------- | -------------------------------------- |
| `--custom-page-id` | —     | int  | —       | ID of the custom page set to describe. |

This command describes the set with ID `123`:

```bash
azion describe custom-pages --custom-page-id 123
```

The command prints the ID, the name, the last change, and the state of the set:

```text
ID:            123
Name:          my-pages
Last Editor:   you@example.com
Modified at:   "2026-01-01T12:00:00.403268Z"
Active:        true
```

With `--format json`, the command prints the full object: `active`, `created_at`, `id`, `is_versioned`, `last_editor`, `last_modified`, `name`, `pages`, `product_version`, `version`, `version_id`, and `version_state`. Each entry of `pages` holds a `code` and a `page` object with a `type` and `attributes`: `connector`, `custom_status_code`, `ttl`, and `uri`.

An ID that does not exist fails with this error:

```text
Error: Failed to get the Custom Page: The given ID or API's endpoint doesn't exist or isn't available. Check that the identifying information is correct. Check your settings and try again. If the error persists, contact Azion support
```

---

## Update

`azion update custom-pages` changes the name, the active state, or the pages of a custom page set from a JSON file:

```bash
azion update custom-pages [flags]
```

| Flag               | Short | Type   | Default | Description                                                                                                                                               |
| ------------------ | ----- | ------ | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--custom-page-id` | —     | int    | —       | ID of the custom page set to update.                                                                                                                      |
| `--file`           | —     | string | —       | **Required**. Path to a JSON file with the attributes to change. Use `-` to read the JSON from standard input. Without it, the command asks for the path. |

This file renames the set to `my-pages-updated`:

```json
{
  "name": "my-pages-updated"
}
```

Pass the file to the update command with the ID of the set:

```bash
azion update custom-pages --custom-page-id 123 --file cp-update.json
```

The command prints the ID of the updated set:

```text
Updated Custom Page with ID 123
```

The fields that the file leaves out keep their values. After this update, the set is still active and keeps its `404` page.

---

## Delete

`azion delete custom-pages` deletes a custom page set:

```bash
azion delete custom-pages [flags]
```

| Flag               | Short | Type | Default | Description                          |
| ------------------ | ----- | ---- | ------- | ------------------------------------ |
| `--custom-page-id` | —     | int  | —       | ID of the custom page set to delete. |

This command deletes the set with ID `123`:

```bash
azion delete custom-pages --custom-page-id 123
```

The command confirms the deletion:

```text
Custom Page 123 was successfully deleted
```

---

## Use a JSON file

`azion create custom-pages` and `azion update custom-pages` read the custom page set from a JSON file with `--file`. This is the only way to pass its attributes.

The file carries the fields of the set:

- `name` and `active` describe the set.
- `pages` holds one entry per status code. Each entry carries the status code in `code`, as a string such as `"404"`, and a `page` object.
- `page.type` is `page_connector`, and `page.attributes` carries `connector`, the ID of the connector that serves the page, `ttl`, and `uri`, the path of the page on that connector.

For what each field does and the values it takes, refer to [Custom page settings](/en/documentation/platform/workloads/custom-pages/settings/).

A page of type `page_default` that carries only `ttl` is refused before the set is created, although the file is valid JSON:

```text
Error: Failed to decode the given 'json' file. Verify if the file format is JSON or fix its content according to the JSON format specification at https://www.json.org/json-en.html
```

On update, the file carries only the fields to change, and the fields it leaves out keep their values.

---

## Related resources

- [Global options](/en/documentation/devtools/cli/globals.md): The options every command accepts, such as `--format`, `--out`, and `-y`.
- [Custom page settings](/en/documentation/platform/workloads/custom-pages/settings.md): The fields of a custom page set, the status codes it can replace, and how a page takes its content from a connector.
- [Azion CLI connector](/en/documentation/devtools/cli/resources/connector.md): The commands that create and manage the connector that serves the pages of a set.
- [Azion CLI workload-deployment](/en/documentation/devtools/cli/resources/workload-deployment.md): The commands that assign a custom page set to a workload with `--custom-page`.
