---
title: "Get Domain"
url: "https://docs.yoagent.dev/reference/rest-api/operations/getdomain"
---

# Get Domain

GET

/v0/domains/{domain_id}

```sh
curl -s "https://api.yoagent.dev/v0/domains/dom_01je56wqswfmn9pgbc1wq8tjgq" \
  -H "Authorization: Bearer $YOAGENT_KEY"
```

```js
const response = await fetch("https://api.yoagent.dev/v0/domains/dom_01je56wqswfmn9pgbc1wq8tjgq", {
  headers: {
    Authorization: `Bearer ${process.env.YOAGENT_KEY}`,
  },
});
if (!response.ok) throw new Error(await response.text());
const data = await response.json();
```

```python
import os

import requests

response = requests.get(
    "https://api.yoagent.dev/v0/domains/dom_01je56wqswfmn9pgbc1wq8tjgq",
    headers={"Authorization": f"Bearer {os.environ['YOAGENT_KEY']}"},
    timeout=60,
)
response.raise_for_status()
data = response.json()
```

- api.yoagent.dev/v0/domains/{domain_id}

Get a domain with the DNS records it needs and which of them were found.

## Authorizations

- **[ApiKey](https://docs.yoagent.dev/reference/rest-api#apikey)**

## Parameters

### Path Parameters

**domain_id**

required

_Domain Id_

string

/^dom\_\[0-7]\[0-9a-hjkmnp-tv-z]{25}$/

## Responses

### 200

Successful Response

application/json

_DomainOut_

A mail domain as the caller sees it: what it may do with it, and when mail to it stops being accepted.

object

**version**

required

_Version_

Goes up by one on every change: of two copies, the one with the higher version is the newer.

integer

**domain_id**

required

_Domain Id_

string

/^dom\_\[0-7]\[0-9a-hjkmnp-tv-z]{25}$/

**project_id**

required

_Project Id_

string

/^prj\_\[0-7]\[0-9a-hjkmnp-tv-z]{25}$/

**name**

required

_Name_

Chosen by whoever added it (a person or another agent).

string

**kind**

required

_DomainKind_

Where a domain comes from: our shared domain or the customer’s own.

string

Allowed values: shared custom

**status**

required

_DomainStatus_

Whether mail for the domain is accepted: `pending` (a custom domain waiting for its DNS records), `verified` (accepted), `failed` (its records were not found in time, or were lost: its `failure` says which).

string

Allowed values: pending verified failed

**failure**

required

Why it is `failed`: a record missing (`txt_missing`, `mx_missing`), another MX beside ours (`mx_foreign`), or another organization holds the name (`taken`).

Any of:

**DomainFailure**

_DomainFailure_

Why a custom domain is `failed`: what its DNS lacked at the last check, or that another organization holds the name.

string

Allowed values: txt_missing mx_missing mx_foreign taken

**null**

null

**sending_status**

required

_SendingStatus_

Whether its inboxes send: `off`; `pending` until SES finds its DKIM records; `verified`; `failed` — SES did not find them in time, or lost them (turn it off and on again).

string

Allowed values: off pending verified failed

**records**

required

_Records_

The records to add at the domain’s DNS host, each marked when the last check saw it (none for a shared domain).

Array\<object>

_DnsRecord_

One DNS record the customer adds at their DNS host, and whether the last check that got an answer saw it.

object

**key**

required

_RecordKey_

What it is for: receiving (`verification`, `mx`), sending (`dkim`) or recommended for it — the bounce domain’s MX (`mail_from`) and SPF (`spf`), the domain’s DMARC (`dmarc`).

string

Allowed values: verification mx dkim mail_from spf dmarc

**type**

required

_Type_

string

Allowed values: TXT MX CNAME

**name**

required

_Name_

The record’s full name, without a trailing dot (the domain’s name: chosen by whoever added it).

string

**value**

required

_Value_

string

**priority**

_Priority_

An MX record’s priority.

Any of:

**integer**

integer

**null**

null

**found**

required

_Found_

The last reading that got an answer saw it (an MX: only ours there); `dkim` and `mail_from`: as SES last saw them.

boolean

**zone_file**

required

_Zone File_

The same records as a zone file, for DNS hosts that import one (empty for a shared domain).

string

**checked_at**

required

_Checked At_

Any of:

**string**

string format: date-time

**null**

null

**next_check_at**

required

_Next Check At_

When its DNS is read next (null: no more checks — a shared domain, a claim given up).

Any of:

**string**

string format: date-time

**null**

null

**failing_since**

required

_Failing Since_

Since when a verified domain’s records are missing: three days later it is failed and mail to it refused.

Any of:

**string**

string format: date-time

**null**

null

**verified_at**

required

_Verified At_

Any of:

**string**

string format: date-time

**null**

null

**fails_at**

required

_Fails At_

When it fails unless its records are found by then (mail to it is refused from then on): a claim’s deadline, or a verified domain’s while its records are missing; null otherwise, and once it has passed (only a resolver that does not answer keeps the domain as it was).

Any of:

**string**

string format: date-time

**null**

null

**editable**

required

_Editable_

Whether the caller may check it now and turn its sending on or off (`domain_update` in its project; a custom domain only).

boolean

**deletable**

required

_Deletable_

Whether the caller may delete it with its inboxes (`domain_delete` in its project; a custom domain only).

boolean

**sendable**

required

_Sendable_

Whether its inboxes may send now: a custom domain’s sending verified on a plan that has it (the send refuses otherwise); a shared domain always.

boolean

#### Example

```json
{
  "version": 1,
  "domain_id": "dom_01je56wqswfmn9pgbc1wq8tjgq",
  "project_id": "prj_01je56wqswfmn9pgbc1wq8tjgq",
  "name": "mail.example.com",
  "kind": "custom",
  "status": "verified",
  "failure": null,
  "sending_status": "off",
  "records": [
    {
      "key": "verification",
      "type": "TXT",
      "name": "_yoagent.mail.example.com",
      "value": "yoagent-verification=4f8a2c9e1b7d3f6a0c5e8b2d9f1a4c7e",
      "priority": null,
      "found": true
    },
    {
      "key": "mx",
      "type": "MX",
      "name": "mail.example.com",
      "value": "mx.yoagent.email",
      "priority": 10,
      "found": true
    }
  ],
  "zone_file": "; DNS records for mail.example.com\n_yoagent.mail.example.com.\t3600\tIN\tTXT\t\"yoagent-verification=4f8a2c9e1b7d3f6a0c5e8b2d9f1a4c7e\"\nmail.example.com.\t3600\tIN\tMX\t10 mx.yoagent.email.\n",
  "checked_at": "2026-12-01T12:00:00Z",
  "next_check_at": "2026-12-01T18:00:00Z",
  "failing_since": null,
  "verified_at": "2026-12-01T12:00:00Z",
  "fails_at": null,
  "editable": true,
  "deletable": true,
  "sendable": false
}
```

### default

An error (400, 401, 403, 404, 405, 409, 413, 429, 500, 503), in the one shape every call answers: [Errors](https://docs.yoagent.dev/reference/conventions#errors).
