---
title: "CLI: Domains"
description: "The commands of the doorman command line under Domains. Account-owned mail domains, DNS records, verification and setup."
url: https://doorman.fyi/docs/cli/commands/domains
markdown: https://doorman.fyi/docs/cli/commands/domains.md
area: "SDKs and tools"
section: "Command line"
---

# CLI: Domains

The commands of the doorman command line under Domains. Account-owned mail domains, DNS records, verification and setup.

Source: https://doorman.fyi/docs/cli/commands/domains

## doorman domains list

Command:
```sh
doorman domains list
```

Operation [`domains.list`](https://doorman.fyi/docs/reference/domains.md#domains-list): `GET /v1/domains`

List custom domains. Access `account`: an account-scoped key or a console session; an inbox-scoped key gets 403 `forbidden`. App tokens are refused.

## doorman domains create

Command:
```sh
doorman domains create [flags]
```

Operation [`domains.create`](https://doorman.fyi/docs/reference/domains.md#domains-create): `POST /v1/domains`

Add a custom domain. Access `account`: an account-scoped key or a console session; an inbox-scoped key gets 403 `forbidden`. App tokens are refused.

**Flags**

| Flag | Type | Required | Description |
| --- | --- | --- | --- |
| `--name` | `string` | yes | Trimmed, lowercased and validated as a domain by the Worker. |
| `--json` | `object` | no | The request body as one JSON object. A flag given beside it replaces the field of the same name. |

Example:
```sh
doorman domains create \
  --name agents.example.com
```

## doorman domains get

Command:
```sh
doorman domains get <domainId> [flags]
```

Operation [`domains.get`](https://doorman.fyi/docs/reference/domains.md#domains-get): `GET /v1/domains/{domainId}`

Read a custom domain. Access `account`: an account-scoped key or a console session; an inbox-scoped key gets 403 `forbidden`. App tokens are refused.

**Flags**

| Flag | Type | Required | Description |
| --- | --- | --- | --- |
| `--domain-id` | `string` | no | The same as the argument `<domainId>`, for a script that names everything. |

Example:
```sh
doorman domains get dom_01jc5f1a2b3c4d5e6f7g8h9j0k
```

## doorman domains verify

Command:
```sh
doorman domains verify <domainId> [flags]
```

Operation [`domains.verify`](https://doorman.fyi/docs/reference/domains.md#domains-verify): `POST /v1/domains/{domainId}/verify`

Check the domain's DNS. Access `account`: an account-scoped key or a console session; an inbox-scoped key gets 403 `forbidden`. App tokens are refused.

**Flags**

| Flag | Type | Required | Description |
| --- | --- | --- | --- |
| `--domain-id` | `string` | no | The same as the argument `<domainId>`, for a script that names everything. |

Example:
```sh
doorman domains verify dom_01jc5f1a2b3c4d5e6f7g8h9j0k
```

## doorman domains delete

Command:
```sh
doorman domains delete <domainId> [flags]
```

Operation [`domains.delete`](https://doorman.fyi/docs/reference/domains.md#domains-delete): `DELETE /v1/domains/{domainId}`

Remove a custom domain. Access `account`: an account-scoped key or a console session; an inbox-scoped key gets 403 `forbidden`. App tokens are refused.

**Flags**

| Flag | Type | Required | Description |
| --- | --- | --- | --- |
| `--domain-id` | `string` | no | The same as the argument `<domainId>`, for a script that names everything. |

Example:
```sh
doorman domains delete dom_01jc5f1a2b3c4d5e6f7g8h9j0k
```
