> ## Documentation Index
> Fetch the complete documentation index at: https://vetta.sh/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# domains

> Sending and receiving domains — client.domains.

A domain is **org-level** (inboxes and numbers are identity-level) and backs the addresses inboxes mint. Eight methods. API detail: [Domains](https://vetta.sh/docs/api/domains.md).

## create

```ts theme={"system"}
client.domains.create(body: DomainCreate): Promise<Domain>
```

`POST /v1/domains`. `DomainCreate` is `{ name?, kind, receive? }` — connect a BYOD domain by `name`, or mint the org's system subdomain. Idempotent on the name.

## quote

```ts theme={"system"}
client.domains.quote(name: string): Promise<DomainQuote>
```

`POST /v1/domains/quote`, scope `billing:read`. Read-only: it checks availability and one-year pricing
and neither reserves the name nor moves credits. A `DomainQuote` is:

| Field | Type | Meaning |
| - | - | - |
| `object` | `"domain_quote"` | |
| `name` | `string` | The name quoted. |
| `available` | `boolean` | Whether it can be bought now. |
| `tier` | `"standard" \| "premium" \| null` | Premium names are refused by `purchase`. |
| `registration_price_micro_usd` | `integer \| null` | First-year price in micro-USD (`12000000` is \$12). |
| `renewal_price_micro_usd` | `integer \| null` | Yearly renewal price in micro-USD. Automatic renewal is off. |
| `currency` | `"usd"` | |
| `reason` | `string \| null` | Why the name is not available, when it is not. |

## purchase

```ts theme={"system"}
client.domains.purchase(body: { name: string; max_price_micro_usd: number; receive?: boolean }): Promise<Domain>
```

`POST /v1/domains/purchase`, scope `billing:write`. Buys the name for one year with the organization's
credits: the server rechecks availability and price, refuses premium names, refuses a live price above
`max_price_micro_usd`, and debits the balance before registering. No card is taken. `receive` asks for
inbound email on the new domain. The result is a `Domain` with `kind: "purchased"`; while registration
is still processing it comes back as `pending_dns` (HTTP `202`) and the platform finishes it within
about 10 minutes, so poll with `get`. A rejected registration refunds the debit. The SDK sends an
`Idempotency-Key` for you.

```ts theme={"system"}
const quote = await client.domains.quote("example.com");
if (quote.available && quote.registration_price_micro_usd !== null) {
  await client.domains.purchase({ name: quote.name, max_price_micro_usd: quote.registration_price_micro_usd });
}
```

Errors: `insufficient_credits` (402), `validation_failed` (400) for an unavailable name or a price over
the ceiling, `name_conflict` (409) for a name the organization already connected as its own domain, `state_conflict` (409). Full contract: [Buy a domain](https://vetta.sh/docs/api/domains.md#buy-a-domain-with-naive-credits).

## list

```ts theme={"system"}
client.domains.list(query?: ListQuery): Promise<Page<Domain>>
```

`GET /v1/domains`, cursor-paginated.

## get

```ts theme={"system"}
client.domains.get(id: string): Promise<Domain>
```

`GET /v1/domains/{id}` — including the readiness tracks (`dns_status`, …).

## verify

```ts theme={"system"}
client.domains.verify(id: string): Promise<Domain>
```

`POST /v1/domains/{id}/verify`. Re-runnable; each readiness track advances on its own, and the domain comes back as the answer. Run it after publishing the DNS records.

## records

```ts theme={"system"}
client.domains.records(id: string): Promise<{ object: "list"; data: DnsRecord[] }>
```

`GET /v1/domains/{id}/records` — the DNS records to publish. Always allowed, on every kind: reading the zone is never the dangerous half.

## delete

```ts theme={"system"}
client.domains.delete(id: string): Promise<Deleted>
```

`DELETE /v1/domains/{id}`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.