# Domains

Monitored domains: expiry, certificate, DNS, reachability and uptime, and the verification of ownership.

Its operations need the scopes `domains.edit`, `domains.view`, `domains.delete` or `security.edit`.

**Endpoints**

- `POST/v1/domains`
- `PUT/v1/domains/{domain_uuid}`
- `GET/v1/domains/{domain_uuid}`
- `GET/v1/domains`
- `DELETE/v1/domains/{domain_uuid}`
- `GET/v1/domains/{domain_uuid}/changes`
- `POST/v1/domains/{domain_uuid}/verification/check`
- `POST/v1/domains/{domain_uuid}/scans/{scan_type}`
- `GET/v1/domains/{domain_uuid}/scans`
- `POST/v1/domains/{domain_uuid}/verification`
- `GET/v1/domains/{domain_uuid}/timeline`
- `GET/v1/domains/{domain_uuid}/uptime`

## The Domain object

### Attributes

- `uuid` (string): The domain’s uuid.
- `name` (string): The domain name.
- `domain_type` (string or null): `apex`, `subdomain` or `wildcard`.
- `status` (string): One of `active`, `expired`, `pending` (no expiry scan yet) and `suspended` (switched off). Values:`suspended``pending``expired``active`(an open set: new values may be added)
- `health_status` (string): One of `unknown`, `healthy`, `warning`, `critical`.
- `active` (boolean): Whether monitoring is switched on.
- `checks` (object): Which reachability endpoints are checked.
  - `https_www` (boolean): Whether `https://www.` is checked.
  - `https_non_www` (boolean): Whether `https://` on the bare domain is checked.
  - `http_www` (boolean): Whether `http://www.` is checked.
  - `http_non_www` (boolean): Whether `http://` on the bare domain is checked.
- `scans_enabled` (object): Which scan types are switched on.
  - `expiry` (boolean): Whether the registration expiry scan is on.
  - `dns` (boolean): Whether the DNS change scan is on.
  - `ssl` (boolean): Whether the SSL certificate expiry scan is on.
  - `whois` (boolean): Whether the WHOIS change scan is on.
  - `reachability` (boolean): Whether the reachability scan is on.
- `registration` (object or null): The latest completed expiry scan; null until one completes.
  - `registrar` (string or null): The registrar of the domain; null when the registry does not publish it.
  - `registration_date` (string or null): The registration date as `YYYY-MM-DD`; null when unknown.
  - `expiry_date` (string or null): The registration expiry date as `YYYY-MM-DD`; null when unknown.
  - `updated_date` (string or null): The date the registration was last updated, as `YYYY-MM-DD`; null when unknown.
  - `days_until_expiry` (integer or null): Whole days left until the registration expires; negative once expired, null when unknown.
  - `is_expired` (boolean): Whether the registration has expired.
  - `nameservers` (array of strings): The domain’s name servers, one per item.
  - `status_codes` (array of strings): The registry status codes of the domain, one per item.
  - `checked_at` (integer or null): Epoch milliseconds. When the expiry scan completed; null when unknown. An instant: epoch milliseconds, UTC.
- `certificate` (object or null): The latest completed certificate scan; null until one completes.
  - `common_name` (string or null): The common name of the certificate; null when it has none.
  - `issuer_cn` (string or null): The common name of the certificate’s issuer; null when unknown.
  - `issuer_org` (string or null): The organisation of the certificate’s issuer; null when unknown.
  - `valid_from` (integer or null): Epoch milliseconds. When the certificate becomes valid; null when unknown. An instant: epoch milliseconds, UTC.
  - `valid_until` (integer or null): Epoch milliseconds. When the certificate stops being valid; null when unknown. An instant: epoch milliseconds, UTC.
  - `days_until_expiry` (integer or null): Whole days left until the certificate expires; negative once expired, null when unknown.
  - `is_expired` (boolean or null): Whether the certificate has expired; null when unknown.
  - `is_self_signed` (boolean or null): Whether the certificate is self-signed; null when unknown.
  - `chain_valid` (boolean or null): Whether the certificate chain validates; null when unknown.
  - `ssl_status` (string or null): One of `valid`, `warn` (30 days or fewer left), `expired`; null with no verdict.
- `dns` (object or null): The newest completed DNS scan; null with none.
  - `checked_at` (integer or null): Epoch milliseconds. When the DNS scan completed; null when unknown. An instant: epoch milliseconds, UTC.
  - `records` (object): The DNS records of the scan, by record type.
    - `a` (array of strings): The A records, as text lines.
    - `aaaa` (array of strings): The AAAA records, as text lines.
    - `mx` (array of strings): The MX records, as text lines.
    - `txt` (array of strings): The TXT records, as text lines.
    - `cname` (array of strings): The CNAME records, as text lines.
    - `ns` (array of strings): The NS records, as text lines.
    - `soa` (array of strings): The SOA records, as text lines.
    - `caa` (array of strings): The CAA records, as text lines.
- `next_scans` (array of anys): When each scan type runs next.
- `tags` (array of objects): The tags attached to the domain.
  - `uuid` (string): The tag’s uuid.
  - `name` (string): The tag’s name.
- `console_url` (string): The domain’s page in the console.

**The Domain object**

```json
{
  "uuid": "0f8c7a52-3c1e-4b9e-9d2a-6c41e5b7a913",
  "name": "example.com",
  "domain_type": "apex",
  "status": "active",
  "health_status": "healthy",
  "active": true,
  "checks": {
    "https_www": true,
    "https_non_www": true,
    "http_www": false,
    "http_non_www": false
  },
  "scans_enabled": {
    "expiry": true,
    "dns": true,
    "ssl": true,
    "whois": true,
    "reachability": true
  },
  "registration": {
    "registrar": "Example Registrar, Inc.",
    "registration_date": "2014-03-11",
    "expiry_date": "2027-03-11",
    "updated_date": "2026-02-20",
    "days_until_expiry": 122,
    "is_expired": false,
    "nameservers": [
      "ns1.example-dns.net",
      "ns2.example-dns.net"
    ],
    "status_codes": [
      "clientTransferProhibited"
    ],
    "checked_at": 1794106800000
  },
  "certificate": {
    "common_name": "example.com",
    "issuer_cn": "R11",
    "issuer_org": "Let's Encrypt",
    "valid_from": 1792627200000,
    "valid_until": 1800489599000,
    "days_until_expiry": 72,
    "is_expired": false,
    "is_self_signed": false,
    "chain_valid": true,
    "ssl_status": "valid"
  },
  "dns": {
    "checked_at": 1794215520000,
    "records": {
      "a": [
        "203.0.113.10"
      ],
      "aaaa": [],
      "mx": [
        "10 mail.example.com"
      ],
      "txt": [
        "v=spf1 -all"
      ],
      "cname": [],
      "ns": [
        "ns1.example-dns.net",
        "ns2.example-dns.net"
      ],
      "soa": [
        "ns1.example-dns.net hostmaster.example.com 2026110901 7200 3600 1209600 300"
      ],
      "caa": [
        "0 issue \"letsencrypt.org\""
      ]
    }
  },
  "next_scans": [
    {
      "kind": "dns",
      "at": "2026-11-09T09:17:00Z"
    },
    {
      "kind": "expiry",
      "at": "2026-11-10T03:00:00Z"
    },
    {
      "kind": "ssl",
      "at": "2026-11-10T03:00:00Z"
    }
  ],
  "tags": [
    {
      "uuid": "3b1d6e2a-9c4f-4a7e-b5d8-0e2f4a6c8b1d",
      "name": "production"
    }
  ],
  "console_url": "https://app.watchtower15.com/domains/0f8c7a52-3c1e-4b9e-9d2a-6c41e5b7a913"
}
```

## Create a domain

POST/v1/domains

Adds a domain to monitor under the organisation, with optional notes, monitoring switch, reachability endpoints, scan switches and tags; the hostname cannot be changed afterwards. Refuses a name already monitored by the organisation, an organisation over its domain limit, and an organisation that needs a payment method. Default alarms are created as in the console.

Needs the scope `domains.edit`.

### Headers

- `Idempotency-Key` (string): Any text of 1 to 255 visible ASCII characters. A repeat of the same request within 24 hours returns the first answer without running again (the response carries `Idempotent-Replayed: true`); the same key on a different request is refused 422 `invalid_request`.

### Body parameters

- `name` (string, required): The hostname to monitor; an optional `*.` wildcard prefix is allowed. It cannot be changed afterwards.
- `notes` (string or null): Free-form notes about the domain; null or omitted stores none.
- `active` (boolean or null): Whether monitoring is switched on.
- `checks` (object): Which reachability endpoints are checked.
  - `http_www` (boolean or null): Whether `http://www.` is checked for reachability. Omit to use the default.
  - `http_non_www` (boolean or null): Whether `http://` on the bare domain is checked for reachability. Omit to use the default.
  - `https_www` (boolean or null): Whether `https://www.` is checked for reachability. Omit to use the default.
  - `https_non_www` (boolean or null): Whether `https://` on the bare domain is checked for reachability. Omit to use the default.
- `scans_enabled` (object): Which scan types are switched on.
  - `expiry` (boolean or null): Whether the registration expiry scan is on. Omit to use the default.
  - `dns` (boolean or null): Whether the DNS change scan is on. Omit to use the default.
  - `ssl` (boolean or null): Whether the SSL certificate expiry scan is on. Omit to use the default.
  - `whois` (boolean or null): Whether the WHOIS change scan is on. Omit to use the default.
  - `reachability` (boolean or null): Whether the reachability scan is on; at least one reachability endpoint must stay checked while it is. Omit to use the default. A wildcard domain never runs it.
- `tag_uuids` (array of strings or null): The uuids of the tags the domain carries.

### Returns

`201 Created`:

The domain that was created.

Each failure is a problem document with a stable `code`; the response panel's status selector shows each one this operation can answer, and [errors](https://developer.watchtower15.com/api/errors/) lists them all.

**POST /v1/domains**

curl:

```bash
curl -X POST https://rest.watchtower15.com/v1/domains \
  -H "Authorization: Bearer $WT15_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "name": "example.com",
    "checks": {
      "https_www": true,
      "https_non_www": true
    }
  }'
```

PHP:

```php
$wt15 = WatchTower15\Client::fromEnvironment();

$domain = $wt15->domains->create([
    'name' => 'example.com',
    'checks' => ['https_www' => true, 'https_non_www' => true],
]);
```

Node.js:

```ts
const wt15 = WatchTower15.fromEnvironment();

const result = await wt15.domains.create({ name: 'example.com', checks: { https_www: true, https_non_www: true } });
```

Python:

```python
client = Client.from_environment()

result = client.domains.create(name='example.com', checks={'https_www': True, 'https_non_www': True})
```

**Response (201 Created)**

```json
{
  "data": {
    "uuid": "0f8c7a52-3c1e-4b9e-9d2a-6c41e5b7a913",
    "name": "example.com",
    "domain_type": "apex",
    "status": "pending",
    "health_status": "unknown",
    "active": true,
    "checks": {
      "https_www": true,
      "https_non_www": true,
      "http_www": false,
      "http_non_www": false
    },
    "scans_enabled": {
      "expiry": true,
      "dns": true,
      "ssl": true,
      "whois": true,
      "reachability": true
    },
    "registration": null,
    "certificate": null,
    "dns": null,
    "next_scans": [
      {
        "kind": "dns",
        "at": "2026-11-09T09:14:00Z"
      },
      {
        "kind": "expiry",
        "at": "2026-11-09T09:14:00Z"
      },
      {
        "kind": "ssl",
        "at": "2026-11-09T09:14:00Z"
      }
    ],
    "tags": [],
    "console_url": "https://app.watchtower15.com/domains/0f8c7a52-3c1e-4b9e-9d2a-6c41e5b7a913"
  }
}
```

**Response (401 Unauthorized)**

The API key is missing, malformed, expired or revoked.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/unauthorized/",
  "title": "Unauthorized",
  "status": 401,
  "code": "unauthorized",
  "detail": "The API key is missing, malformed, expired or revoked",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (402 Payment Required)**

The organisation's payment gate blocks the action: `payment_required` (no payment method) or `invoice_overdue`. Nothing is billed and nothing is started.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/payment_required/",
  "title": "Payment required",
  "status": 402,
  "code": "payment_required",
  "detail": "A payment method must be set before adding resources for monitoring.",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (403 Forbidden)**

The key or its owner does not hold what the operation needs.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/forbidden/",
  "title": "Forbidden",
  "status": 403,
  "code": "forbidden",
  "detail": "This key does not have the domains.edit scope",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (404 Not Found)**

No such record in this organisation (an absent id and another organisation's answer alike).

```json
{
  "type": "https://docs.watchtower15.com/api/errors/not_found/",
  "title": "Not found",
  "status": 404,
  "code": "not_found",
  "detail": "No record with that id exists in this organisation.",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (422 Unprocessable Content)**

The request is invalid; `errors` names the parameters.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/invalid_request/",
  "title": "Invalid request",
  "status": 422,
  "code": "invalid_request",
  "detail": "The request is invalid",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d",
  "errors": {
    "name": [
      "The name field is required."
    ]
  }
}
```

**Response (429 Too Many Requests)**

A rate limit or the organisation's daily limit is reached; `Retry-After` says when to retry.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/rate_limited/",
  "title": "Rate limited",
  "status": 429,
  "code": "rate_limited",
  "detail": "Too many requests: the limit is 240 a minute",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d",
  "limit": 60
}
```

**Response (500 Internal Server Error)**

An unexpected error.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/internal_error/",
  "title": "Internal error",
  "status": 500,
  "code": "internal_error",
  "detail": "An unexpected error has happened",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

## Update a domain

PUT/v1/domains/{domain\_uuid}

Changes a domain’s monitoring switch, notes, reachability endpoints, scan switches and tags; the monitoring switch is required, and the other fields change only when sent. Alarm rules are not edited here. Answers the domain as the single-domain read does.

Needs the scope `domains.edit`.

### Headers

- `Idempotency-Key` (string): Any text of 1 to 255 visible ASCII characters. A repeat of the same request within 24 hours returns the first answer without running again (the response carries `Idempotent-Replayed: true`); the same key on a different request is refused 422 `invalid_request`.

### Path parameters

- `domain_uuid` (string (uuid), required): The uuid of the domain.

### Body parameters

- `notes` (string or null): Free-form notes about the domain; send null to clear them. Omit to keep the current notes.
- `active` (boolean, required): Whether monitoring is switched on.
- `checks` (object): Which reachability endpoints are checked.
  - `http_www` (boolean or null): Whether `http://www.` is checked for reachability. Omit to keep the current value.
  - `http_non_www` (boolean or null): Whether `http://` on the bare domain is checked for reachability. Omit to keep the current value.
  - `https_www` (boolean or null): Whether `https://www.` is checked for reachability. Omit to keep the current value.
  - `https_non_www` (boolean or null): Whether `https://` on the bare domain is checked for reachability. Omit to keep the current value.
- `scans_enabled` (object): Which scan types are switched on.
  - `expiry` (boolean or null): Whether the registration expiry scan is on. Omit to keep the current value.
  - `dns` (boolean or null): Whether the DNS change scan is on. Omit to keep the current value.
  - `ssl` (boolean or null): Whether the SSL certificate expiry scan is on. Omit to keep the current value.
  - `whois` (boolean or null): Whether the WHOIS change scan is on. Omit to keep the current value.
  - `reachability` (boolean or null): Whether the reachability scan is on; at least one reachability endpoint must stay checked while it is. Omit to keep the current value. A wildcard domain never runs it.
- `tag_uuids` (array of strings or null): The uuids of the tags the domain carries.

### Returns

`200 OK`:

The domain after the update.

Each failure is a problem document with a stable `code`; the response panel's status selector shows each one this operation can answer, and [errors](https://developer.watchtower15.com/api/errors/) lists them all.

**PUT /v1/domains/{domain_uuid}**

curl:

```bash
curl -X PUT https://rest.watchtower15.com/v1/domains/67b3f541-4111-4930-921e-7cdc105c9fdb \
  -H "Authorization: Bearer $WT15_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "active": true
  }'
```

PHP:

```php
$wt15 = WatchTower15\Client::fromEnvironment();

$domain = $wt15->domains->update('67b3f541-4111-4930-921e-7cdc105c9fdb', ['active' => true]);
```

Node.js:

```ts
const wt15 = WatchTower15.fromEnvironment();

const result = await wt15.domains.update('67b3f541-4111-4930-921e-7cdc105c9fdb', { active: true });
```

Python:

```python
client = Client.from_environment()

result = client.domains.update('67b3f541-4111-4930-921e-7cdc105c9fdb', active=True)
```

**Response (200 OK)**

```json
{
  "data": {
    "uuid": "75666699-b77d-4631-b576-041e8102a55b",
    "name": "example.com",
    "domain_type": "example",
    "status": "suspended",
    "health_status": "example",
    "active": true,
    "checks": {
      "https_www": true,
      "https_non_www": true,
      "http_www": true,
      "http_non_www": true
    },
    "scans_enabled": {
      "expiry": true,
      "dns": true,
      "ssl": true,
      "whois": true,
      "reachability": true
    },
    "registration": {
      "registrar": "example",
      "registration_date": "example",
      "expiry_date": "example",
      "updated_date": "example",
      "days_until_expiry": 1,
      "is_expired": true,
      "nameservers": [
        "example"
      ],
      "status_codes": [
        "example"
      ],
      "checked_at": 1794214800000
    },
    "certificate": {
      "common_name": "example",
      "issuer_cn": "example",
      "issuer_org": "example",
      "valid_from": 1794214800000,
      "valid_until": 1794214800000,
      "days_until_expiry": 1,
      "is_expired": true,
      "is_self_signed": true,
      "chain_valid": true,
      "ssl_status": "example"
    },
    "dns": {
      "checked_at": 1794214800000,
      "records": {
        "a": [
          "example"
        ],
        "aaaa": [
          "example"
        ],
        "mx": [
          "example"
        ],
        "txt": [
          "example"
        ],
        "cname": [
          "example"
        ],
        "ns": [
          "example"
        ],
        "soa": [
          "example"
        ],
        "caa": [
          "example"
        ]
      }
    },
    "next_scans": [
      null
    ],
    "tags": [
      {
        "uuid": "75666699-b77d-4631-b576-041e8102a55b",
        "name": "example.com"
      }
    ],
    "console_url": "example"
  }
}
```

**Response (401 Unauthorized)**

The API key is missing, malformed, expired or revoked.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/unauthorized/",
  "title": "Unauthorized",
  "status": 401,
  "code": "unauthorized",
  "detail": "The API key is missing, malformed, expired or revoked",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (402 Payment Required)**

The organisation's payment gate blocks the action: `payment_required` (no payment method) or `invoice_overdue`. Nothing is billed and nothing is started.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/payment_required/",
  "title": "Payment required",
  "status": 402,
  "code": "payment_required",
  "detail": "A payment method must be set before adding resources for monitoring.",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (403 Forbidden)**

The key or its owner does not hold what the operation needs.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/forbidden/",
  "title": "Forbidden",
  "status": 403,
  "code": "forbidden",
  "detail": "This key does not have the domains.edit scope",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (404 Not Found)**

No such record in this organisation (an absent id and another organisation's answer alike).

```json
{
  "type": "https://docs.watchtower15.com/api/errors/not_found/",
  "title": "Not found",
  "status": 404,
  "code": "not_found",
  "detail": "No record with that id exists in this organisation.",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (422 Unprocessable Content)**

The request is invalid; `errors` names the parameters.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/invalid_request/",
  "title": "Invalid request",
  "status": 422,
  "code": "invalid_request",
  "detail": "The request is invalid",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d",
  "errors": {
    "name": [
      "The name field is required."
    ]
  }
}
```

**Response (429 Too Many Requests)**

A rate limit or the organisation's daily limit is reached; `Retry-After` says when to retry.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/rate_limited/",
  "title": "Rate limited",
  "status": 429,
  "code": "rate_limited",
  "detail": "Too many requests: the limit is 240 a minute",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d",
  "limit": 60
}
```

**Response (500 Internal Server Error)**

An unexpected error.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/internal_error/",
  "title": "Internal error",
  "status": 500,
  "code": "internal_error",
  "detail": "An unexpected error has happened",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

## Get a domain

GET/v1/domains/{domain\_uuid}

Returns one domain with its latest completed expiry and SSL certificate scans, its newest completed DNS scan, when each scan type runs next, and its tags. Opening a domain may also add any default alarms the catalogue gained since the domain was created, as the console’s page does.

Needs the scope `domains.view`.

### Path parameters

- `domain_uuid` (string (uuid), required): The uuid of the domain.

### Returns

`200 OK`:

The domain.

Each failure is a problem document with a stable `code`; the response panel's status selector shows each one this operation can answer, and [errors](https://developer.watchtower15.com/api/errors/) lists them all.

**GET /v1/domains/{domain_uuid}**

curl:

```bash
curl https://rest.watchtower15.com/v1/domains/0f8c7a52-3c1e-4b9e-9d2a-6c41e5b7a913 \
  -H "Authorization: Bearer $WT15_API_KEY"
```

PHP:

```php
$wt15 = WatchTower15\Client::fromEnvironment();

$domain = $wt15->domains->view('0f8c7a52-3c1e-4b9e-9d2a-6c41e5b7a913');
```

Node.js:

```ts
const wt15 = WatchTower15.fromEnvironment();

const result = await wt15.domains.view('0f8c7a52-3c1e-4b9e-9d2a-6c41e5b7a913');
```

Python:

```python
client = Client.from_environment()

result = client.domains.view('0f8c7a52-3c1e-4b9e-9d2a-6c41e5b7a913')
```

**Response (200 OK)**

```json
{
  "data": {
    "uuid": "0f8c7a52-3c1e-4b9e-9d2a-6c41e5b7a913",
    "name": "example.com",
    "domain_type": "apex",
    "status": "active",
    "health_status": "healthy",
    "active": true,
    "checks": {
      "https_www": true,
      "https_non_www": true,
      "http_www": false,
      "http_non_www": false
    },
    "scans_enabled": {
      "expiry": true,
      "dns": true,
      "ssl": true,
      "whois": true,
      "reachability": true
    },
    "registration": {
      "registrar": "Example Registrar, Inc.",
      "registration_date": "2014-03-11",
      "expiry_date": "2027-03-11",
      "updated_date": "2026-02-20",
      "days_until_expiry": 122,
      "is_expired": false,
      "nameservers": [
        "ns1.example-dns.net",
        "ns2.example-dns.net"
      ],
      "status_codes": [
        "clientTransferProhibited"
      ],
      "checked_at": 1794106800000
    },
    "certificate": {
      "common_name": "example.com",
      "issuer_cn": "R11",
      "issuer_org": "Let's Encrypt",
      "valid_from": 1792627200000,
      "valid_until": 1800489599000,
      "days_until_expiry": 72,
      "is_expired": false,
      "is_self_signed": false,
      "chain_valid": true,
      "ssl_status": "valid"
    },
    "dns": {
      "checked_at": 1794215520000,
      "records": {
        "a": [
          "203.0.113.10"
        ],
        "aaaa": [],
        "mx": [
          "10 mail.example.com"
        ],
        "txt": [
          "v=spf1 -all"
        ],
        "cname": [],
        "ns": [
          "ns1.example-dns.net",
          "ns2.example-dns.net"
        ],
        "soa": [
          "ns1.example-dns.net hostmaster.example.com 2026110901 7200 3600 1209600 300"
        ],
        "caa": [
          "0 issue \"letsencrypt.org\""
        ]
      }
    },
    "next_scans": [
      {
        "kind": "dns",
        "at": "2026-11-09T09:17:00Z"
      },
      {
        "kind": "expiry",
        "at": "2026-11-10T03:00:00Z"
      },
      {
        "kind": "ssl",
        "at": "2026-11-10T03:00:00Z"
      }
    ],
    "tags": [
      {
        "uuid": "3b1d6e2a-9c4f-4a7e-b5d8-0e2f4a6c8b1d",
        "name": "production"
      }
    ],
    "console_url": "https://app.watchtower15.com/domains/0f8c7a52-3c1e-4b9e-9d2a-6c41e5b7a913"
  }
}
```

**Response (401 Unauthorized)**

The API key is missing, malformed, expired or revoked.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/unauthorized/",
  "title": "Unauthorized",
  "status": 401,
  "code": "unauthorized",
  "detail": "The API key is missing, malformed, expired or revoked",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (403 Forbidden)**

The key or its owner does not hold what the operation needs.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/forbidden/",
  "title": "Forbidden",
  "status": 403,
  "code": "forbidden",
  "detail": "This key does not have the domains.view scope",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (404 Not Found)**

No such record in this organisation (an absent id and another organisation's answer alike).

```json
{
  "type": "https://docs.watchtower15.com/api/errors/not_found/",
  "title": "Not found",
  "status": 404,
  "code": "not_found",
  "detail": "No record with that id exists in this organisation.",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (422 Unprocessable Content)**

The request is invalid (`invalid_request`; `errors` names the parameters).

```json
{
  "type": "https://docs.watchtower15.com/api/errors/invalid_request/",
  "title": "Invalid request",
  "status": 422,
  "code": "invalid_request",
  "detail": "The request is invalid",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d",
  "errors": {
    "name": [
      "The name field is required."
    ]
  }
}
```

**Response (429 Too Many Requests)**

A rate limit or the organisation's daily limit is reached; `Retry-After` says when to retry.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/rate_limited/",
  "title": "Rate limited",
  "status": 429,
  "code": "rate_limited",
  "detail": "Too many requests: the limit is 240 a minute",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d",
  "limit": 60
}
```

**Response (500 Internal Server Error)**

An unexpected error.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/internal_error/",
  "title": "Internal error",
  "status": 500,
  "code": "internal_error",
  "detail": "An unexpected error has happened",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

## List domains

GET/v1/domains

Returns the organisation’s domains, filtered by search text, status, health, registrar or tags and sorted by name, health, expiry dates or uptime. Each row summarises the domain’s status, registration and certificate expiry, last DNS change and 7-day uptime. Pages by `page` and `per_page` (`limit` is the same as `per_page`); every page carries `current_page`, `per_page`, `last_page` and `total`.

Needs the scope `domains.view`.

### Query parameters

- `search` (string or null): Only domains whose name contains this text.
- `status` (string or null): Only domains with this status: `active`, `expired`, `pending` (no expiry scan yet) or `suspended` (switched off). Values:`active``expired``pending``suspended`(an open set: new values may be added)
- `health` (array of strings or null): Only domains with one of these health statuses: `unknown`, `healthy`, `warning` or `critical`. A list: repeat the parameter (`health=unknown&health=healthy`) or send one value (`health=unknown`); `health[]=unknown` is accepted too. Values:`unknown``healthy``warning``critical`(an open set: new values may be added)
- `registrar` (string or null): Only domains whose registrar, as the latest expiry scan reports it, starts with this text.
- `tag_uuids` (array of strings or null): Only domains carrying at least one of these tags, as tag UUIDs. A list: repeat the parameter (`tag_uuids=<uuid>&tag_uuids=<uuid>`) or send one value (`tag_uuids=<uuid>`); `tag_uuids[]=<uuid>` is accepted too.
- `sort` (string or null): The column to sort by: `name`, `health`, `registration_expiry`, `ssl_expiry`, `dns_last_change` or `uptime`. Values:`name``health``registration_expiry``ssl_expiry``dns_last_change``uptime`(an open set: new values may be added)
- `direction` (string or null): The sort direction, `asc` (the default) or `desc`. Values:`asc``desc`(an open set: new values may be added)
- `limit` (integer or null): The same as `per_page`, kept for existing clients.
- `include_total` (string or null): Ignored: `total` is always present. Values:`true``false``1``0`(an open set: new values may be added)
- `per_page` (integer or null): How many items one page holds, from 1 to 100; 25 when omitted.
- `page` (integer or null): The page to read, from 1; 1 when omitted. A page past the last answers no rows.

### Returns

`200 OK`:

One page of the organisation’s domains.

Each item of the page:

- `uuid` (string): The domain’s uuid.
- `name` (string): The domain name.
- `domain_type` (string or null): `apex`, `subdomain` or `wildcard`.
- `status` (string): One of `active`, `expired`, `pending` (no expiry scan yet) and `suspended` (switched off). Values:`suspended``pending``expired``active`(an open set: new values may be added)
- `health_status` (string): One of `unknown`, `healthy`, `warning`, `critical`.
- `active` (boolean): Whether monitoring is switched on.
- `registrar` (string or null): The registrar of the latest expiry scan.
- `expiry_date` (string or null): `YYYY-MM-DD`: the registration expiry of the latest expiry scan.
- `ssl_status` (string or null): One of `valid`, `warn` (30 days or fewer left), `expired`; null with no certificate scan.
- `ssl_expiry_date` (integer or null): Epoch milliseconds. When the latest certificate expires; null with no certificate scan. An instant: epoch milliseconds, UTC.
- `dns_last_changed_at` (integer or null): Epoch milliseconds. When the DNS records last changed; null when the last scan was the baseline or there is none. An instant: epoch milliseconds, UTC.
- `uptime_7d_percent` (number or null): The last 7 days’ reachability, one decimal; null with no data.
- `scans_enabled` (object): Which scan types are switched on.
  - `expiry` (boolean): Whether the registration expiry scan is on.
  - `dns` (boolean): Whether the DNS change scan is on.
  - `ssl` (boolean): Whether the SSL certificate expiry scan is on.
  - `whois` (boolean): Whether the WHOIS change scan is on.
  - `reachability` (boolean): Whether the reachability scan is on.
- `console_url` (string): The domain’s page in the console.

Each failure is a problem document with a stable `code`; the response panel's status selector shows each one this operation can answer, and [errors](https://developer.watchtower15.com/api/errors/) lists them all.

**GET /v1/domains**

curl:

```bash
curl -G https://rest.watchtower15.com/v1/domains \
  -H "Authorization: Bearer $WT15_API_KEY" \
  -d "health[]=critical" \
  -d "health[]=warning" \
  -d sort=ssl_expiry \
  -d per_page=25
```

PHP:

```php
$wt15 = WatchTower15\Client::fromEnvironment();

foreach ($wt15->domains->list(['health' => ['critical', 'warning'], 'sort' => 'ssl_expiry', 'per_page' => 25])->autoPaging() as $domain) { echo $domain->uuid, "\n"; }
```

Node.js:

```ts
const wt15 = WatchTower15.fromEnvironment();

for await (const item of wt15.domains.list({ health: ['critical', 'warning'], sort: 'ssl_expiry', per_page: 25 })) {
  console.log(item.uuid);
}
```

Python:

```python
client = Client.from_environment()

for item in client.domains.list(health=['critical', 'warning'], sort='ssl_expiry', per_page=25):
    print(item.uuid)
```

**Response (200 OK)**

```json
{
  "data": [
    {
      "uuid": "5d2e9b14-7a3f-4c6d-8e1b-2f4a6c8e0b37",
      "name": "shop.example.com",
      "domain_type": "subdomain",
      "status": "active",
      "health_status": "warning",
      "active": true,
      "registrar": null,
      "expiry_date": null,
      "ssl_status": "warn",
      "ssl_expiry_date": 1795737599000,
      "dns_last_changed_at": null,
      "uptime_7d_percent": 99.8,
      "scans_enabled": {
        "expiry": false,
        "dns": true,
        "ssl": true,
        "whois": false,
        "reachability": true
      },
      "console_url": "https://app.watchtower15.com/domains/5d2e9b14-7a3f-4c6d-8e1b-2f4a6c8e0b37"
    }
  ],
  "current_page": 1,
  "per_page": 25,
  "last_page": 1,
  "total": 1
}
```

**Response (401 Unauthorized)**

The API key is missing, malformed, expired or revoked.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/unauthorized/",
  "title": "Unauthorized",
  "status": 401,
  "code": "unauthorized",
  "detail": "The API key is missing, malformed, expired or revoked",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (403 Forbidden)**

The key or its owner does not hold what the operation needs.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/forbidden/",
  "title": "Forbidden",
  "status": 403,
  "code": "forbidden",
  "detail": "This key does not have the domains.view scope",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (404 Not Found)**

No such record in this organisation (an absent id and another organisation's answer alike).

```json
{
  "type": "https://docs.watchtower15.com/api/errors/not_found/",
  "title": "Not found",
  "status": 404,
  "code": "not_found",
  "detail": "No record with that id exists in this organisation.",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (422 Unprocessable Content)**

The request is invalid (`invalid_request`; `errors` names the parameters).

```json
{
  "type": "https://docs.watchtower15.com/api/errors/invalid_request/",
  "title": "Invalid request",
  "status": 422,
  "code": "invalid_request",
  "detail": "The request is invalid",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d",
  "errors": {
    "name": [
      "The name field is required."
    ]
  }
}
```

**Response (429 Too Many Requests)**

A rate limit or the organisation's daily limit is reached; `Retry-After` says when to retry.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/rate_limited/",
  "title": "Rate limited",
  "status": 429,
  "code": "rate_limited",
  "detail": "Too many requests: the limit is 240 a minute",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d",
  "limit": 60
}
```

**Response (500 Internal Server Error)**

An unexpected error.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/internal_error/",
  "title": "Internal error",
  "status": 500,
  "code": "internal_error",
  "detail": "An unexpected error has happened",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

## Delete a domain

DELETE/v1/domains/{domain\_uuid}

Deletes the domain and stops monitoring it.

Needs the scope `domains.delete`.

### Headers

- `Idempotency-Key` (string): Any text of 1 to 255 visible ASCII characters. A repeat of the same request within 24 hours returns the first answer without running again (the response carries `Idempotent-Replayed: true`); the same key on a different request is refused 422 `invalid_request`.

### Path parameters

- `domain_uuid` (string (uuid), required): The uuid of the domain.

### Returns

`204 No Content`:

The domain was deleted; there is no body.

Each failure is a problem document with a stable `code`; the response panel's status selector shows each one this operation can answer, and [errors](https://developer.watchtower15.com/api/errors/) lists them all.

**DELETE /v1/domains/{domain_uuid}**

curl:

```bash
curl -X DELETE https://rest.watchtower15.com/v1/domains/0f8c7a52-3c1e-4b9e-9d2a-6c41e5b7a913 \
  -H "Authorization: Bearer $WT15_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"
```

PHP:

```php
$wt15 = WatchTower15\Client::fromEnvironment();

$wt15->domains->delete('0f8c7a52-3c1e-4b9e-9d2a-6c41e5b7a913');
```

Node.js:

```ts
const wt15 = WatchTower15.fromEnvironment();

await wt15.domains.delete('0f8c7a52-3c1e-4b9e-9d2a-6c41e5b7a913');
```

Python:

```python
client = Client.from_environment()

client.domains.delete('0f8c7a52-3c1e-4b9e-9d2a-6c41e5b7a913')
```

**Response (204 No Content)**

```http
HTTP/1.1 204 No Content
```

**Response (401 Unauthorized)**

The API key is missing, malformed, expired or revoked.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/unauthorized/",
  "title": "Unauthorized",
  "status": 401,
  "code": "unauthorized",
  "detail": "The API key is missing, malformed, expired or revoked",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (403 Forbidden)**

The key or its owner does not hold what the operation needs.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/forbidden/",
  "title": "Forbidden",
  "status": 403,
  "code": "forbidden",
  "detail": "This key does not have the domains.delete scope",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (404 Not Found)**

No such record in this organisation (an absent id and another organisation's answer alike).

```json
{
  "type": "https://docs.watchtower15.com/api/errors/not_found/",
  "title": "Not found",
  "status": 404,
  "code": "not_found",
  "detail": "No record with that id exists in this organisation.",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (422 Unprocessable Content)**

The request is invalid; `errors` names the parameters.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/invalid_request/",
  "title": "Invalid request",
  "status": 422,
  "code": "invalid_request",
  "detail": "The request is invalid",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d",
  "errors": {
    "name": [
      "The name field is required."
    ]
  }
}
```

**Response (429 Too Many Requests)**

A rate limit or the organisation's daily limit is reached; `Retry-After` says when to retry.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/rate_limited/",
  "title": "Rate limited",
  "status": 429,
  "code": "rate_limited",
  "detail": "Too many requests: the limit is 240 a minute",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d",
  "limit": 60
}
```

**Response (500 Internal Server Error)**

An unexpected error.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/internal_error/",
  "title": "Internal error",
  "status": 500,
  "code": "internal_error",
  "detail": "An unexpected error has happened",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

## List a domain's changes

GET/v1/domains/{domain\_uuid}/changes

Returns the scans of one type (`dns`, `expiry` or `ssl`) that changed something, newest first. Only the newest 20 changed scans of the type are available. Each row maps the changed fields to their old and new values; the first scan is a baseline. Pages by `page` and `per_page` (`limit` is the same as `per_page`); every page carries `current_page`, `per_page`, `last_page` and `total`.

Needs the scope `domains.view`.

### Path parameters

- `domain_uuid` (string (uuid), required): The uuid of the domain.

### Query parameters

- `type` (string, required): The scan type to list: `dns`, `expiry` or `ssl`. Values:`dns``expiry``ssl`(an open set: new values may be added)
- `limit` (integer or null): The same as `per_page`, kept for existing clients.
- `include_total` (string or null): Ignored: `total` is always present. Values:`true``false``1``0`(an open set: new values may be added)
- `per_page` (integer or null): How many items one page holds, from 1 to 100; 25 when omitted.
- `page` (integer or null): The page to read, from 1; 1 when omitted. A page past the last answers no rows.

### Returns

`200 OK`:

One page of the domain’s scans of the requested type that changed something.

Each item of the page:

- `uuid` (string): The uuid of the scan that changed something.
- `completed_at` (integer or null): Epoch milliseconds: when the scan completed; null when it has not. An instant: epoch milliseconds, UTC.
- `is_baseline` (boolean): Whether this is the first scan, or one whose previous scan was pruned, so nothing was compared.
- `changes` (object or null): Each changed field mapped to its old and new value; null when there is nothing to show.
- `has_changes` (boolean or null): Whether the scan found a change against the previous one; null when the scan has not completed or its outcome kept it out of change detection.
- `records` (object): The DNS records the scan found, by record type.
  - `a` (array of strings): The A records, as text lines.
  - `aaaa` (array of strings): The AAAA records, as text lines.
  - `mx` (array of strings): The MX records, as text lines.
  - `txt` (array of strings): The TXT records, as text lines.
  - `cname` (array of strings): The CNAME records, as text lines.
  - `ns` (array of strings): The NS records, as text lines.
  - `soa` (array of strings): The SOA records, as text lines.
  - `caa` (array of strings): The CAA records, as text lines.
- `registrar` (string or null): The registrar of the domain; null when the registry does not publish it.
- `registration_date` (string or null): The registration date as `YYYY-MM-DD`; null when the registry does not publish it.
- `expiry_date` (string or null): The registration expiry date as `YYYY-MM-DD`; null when the registry does not publish it.
- `updated_date` (string or null): The date the registration was last updated, as `YYYY-MM-DD`; null when the registry does not publish it.
- `days_until_expiry` (integer or null): Whole days left until the expiry; negative once expired, null when unknown.
- `is_expired` (boolean or null): Whether the registration or the certificate has expired; null when unknown.
- `nameservers` (array of strings): The domain’s name servers, one per item.
- `status_codes` (array of strings): The registry status codes of the domain, one per item.
- `common_name` (string or null): The common name of the certificate; null when it has none.
- `issuer_cn` (string or null): The common name of the certificate’s issuer; null when unknown.
- `issuer_org` (string or null): The organisation of the certificate’s issuer; null when unknown.
- `valid_from` (integer or null): Epoch milliseconds: when the certificate becomes valid; null when unknown. An instant: epoch milliseconds, UTC.
- `valid_until` (integer or null): Epoch milliseconds: when the certificate stops being valid; null when unknown. An instant: epoch milliseconds, UTC.
- `is_self_signed` (boolean or null): Whether the certificate is self-signed; null when unknown.
- `chain_valid` (boolean or null): Whether the certificate chain validates; null when unknown.

Each failure is a problem document with a stable `code`; the response panel's status selector shows each one this operation can answer, and [errors](https://developer.watchtower15.com/api/errors/) lists them all.

**GET /v1/domains/{domain_uuid}/changes**

curl:

```bash
curl -G https://rest.watchtower15.com/v1/domains/67b3f541-4111-4930-921e-7cdc105c9fdb/changes \
  -H "Authorization: Bearer $WT15_API_KEY" \
  -d type=dns
```

PHP:

```php
$wt15 = WatchTower15\Client::fromEnvironment();

foreach ($wt15->domains->changes('67b3f541-4111-4930-921e-7cdc105c9fdb', ['type' => 'dns'])->autoPaging() as $item) { echo $item->uuid, "\n"; }
```

Node.js:

```ts
const wt15 = WatchTower15.fromEnvironment();

for await (const item of wt15.domains.changes('67b3f541-4111-4930-921e-7cdc105c9fdb', { type: 'dns' })) {
  console.log(item.uuid);
}
```

Python:

```python
client = Client.from_environment()

for item in client.domains.changes('67b3f541-4111-4930-921e-7cdc105c9fdb', type='dns'):
    print(item.uuid)
```

**Response (200 OK)**

```json
{
  "data": [
    {
      "uuid": "75666699-b77d-4631-b576-041e8102a55b",
      "completed_at": 1794214800000,
      "is_baseline": true,
      "changes": {},
      "has_changes": true,
      "records": {
        "a": [
          "example"
        ],
        "aaaa": [
          "example"
        ],
        "mx": [
          "example"
        ],
        "txt": [
          "example"
        ],
        "cname": [
          "example"
        ],
        "ns": [
          "example"
        ],
        "soa": [
          "example"
        ],
        "caa": [
          "example"
        ]
      },
      "registrar": "example",
      "registration_date": "example",
      "expiry_date": "example",
      "updated_date": "example",
      "days_until_expiry": 1,
      "is_expired": true,
      "nameservers": [
        "example"
      ],
      "status_codes": [
        "example"
      ],
      "common_name": "example",
      "issuer_cn": "example",
      "issuer_org": "example",
      "valid_from": 1794214800000,
      "valid_until": 1794214800000,
      "is_self_signed": true,
      "chain_valid": true
    }
  ],
  "current_page": 1,
  "per_page": 1,
  "last_page": 1,
  "total": 1
}
```

**Response (401 Unauthorized)**

The API key is missing, malformed, expired or revoked.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/unauthorized/",
  "title": "Unauthorized",
  "status": 401,
  "code": "unauthorized",
  "detail": "The API key is missing, malformed, expired or revoked",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (403 Forbidden)**

The key or its owner does not hold what the operation needs.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/forbidden/",
  "title": "Forbidden",
  "status": 403,
  "code": "forbidden",
  "detail": "This key does not have the domains.view scope",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (404 Not Found)**

No such record in this organisation (an absent id and another organisation's answer alike).

```json
{
  "type": "https://docs.watchtower15.com/api/errors/not_found/",
  "title": "Not found",
  "status": 404,
  "code": "not_found",
  "detail": "No record with that id exists in this organisation.",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (422 Unprocessable Content)**

The request is invalid (`invalid_request`; `errors` names the parameters).

```json
{
  "type": "https://docs.watchtower15.com/api/errors/invalid_request/",
  "title": "Invalid request",
  "status": 422,
  "code": "invalid_request",
  "detail": "The request is invalid",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d",
  "errors": {
    "name": [
      "The name field is required."
    ]
  }
}
```

**Response (429 Too Many Requests)**

A rate limit or the organisation's daily limit is reached; `Retry-After` says when to retry.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/rate_limited/",
  "title": "Rate limited",
  "status": 429,
  "code": "rate_limited",
  "detail": "Too many requests: the limit is 240 a minute",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d",
  "limit": 60
}
```

**Response (500 Internal Server Error)**

An unexpected error.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/internal_error/",
  "title": "Internal error",
  "status": 500,
  "code": "internal_error",
  "detail": "An unexpected error has happened",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

## Check domain verification

POST/v1/domains/{domain\_uuid}/verification/check

Looks up the verification TXT record of the domain’s apex now and answers the verification state with the result of the lookup. Within the cooldown after a lookup, the stored result is returned instead of a new lookup.

Needs the scopes `domains.view` and `security.edit`.

### Headers

- `Idempotency-Key` (string): Any text of 1 to 255 visible ASCII characters. A repeat of the same request within 24 hours returns the first answer without running again (the response carries `Idempotent-Replayed: true`); the same key on a different request is refused 422 `invalid_request`.

### Path parameters

- `domain_uuid` (string (uuid), required): The uuid of the domain.

### Returns

`200 OK`:

The apex’s verification state and the result of the lookup.

Each failure is a problem document with a stable `code`; the response panel's status selector shows each one this operation can answer, and [errors](https://developer.watchtower15.com/api/errors/) lists them all.

**POST /v1/domains/{domain_uuid}/verification/check**

curl:

```bash
curl -X POST https://rest.watchtower15.com/v1/domains/67b3f541-4111-4930-921e-7cdc105c9fdb/verification/check \
  -H "Authorization: Bearer $WT15_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"
```

PHP:

```php
$wt15 = WatchTower15\Client::fromEnvironment();

$result = $wt15->domains->checkVerification('67b3f541-4111-4930-921e-7cdc105c9fdb');
```

Node.js:

```ts
const wt15 = WatchTower15.fromEnvironment();

const result = await wt15.domains.checkVerification('67b3f541-4111-4930-921e-7cdc105c9fdb');
```

Python:

```python
client = Client.from_environment()

result = client.domains.check_verification('67b3f541-4111-4930-921e-7cdc105c9fdb')
```

**Response (200 OK)**

```json
{
  "data": {
    "apex": "example",
    "status": "example",
    "txt_host": "example",
    "txt_value": "example",
    "verified_at": 1794214800000,
    "first_verified_at": 1794214800000,
    "lost_at": 1794214800000,
    "last_checked_at": 1794214800000,
    "last_check_result": "example",
    "last_absent_at": 1794214800000,
    "consecutive_absent": 1,
    "recheck_until": 1794214800000,
    "authorised_by": {
      "uuid": "75666699-b77d-4631-b576-041e8102a55b",
      "name": "example.com"
    },
    "authorised_at": 1794214800000,
    "terms_version": "example",
    "covers": [
      {
        "uuid": "75666699-b77d-4631-b576-041e8102a55b",
        "name": "example.com"
      }
    ],
    "check": {
      "result": "example",
      "message": "example"
    }
  }
}
```

**Response (401 Unauthorized)**

The API key is missing, malformed, expired or revoked.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/unauthorized/",
  "title": "Unauthorized",
  "status": 401,
  "code": "unauthorized",
  "detail": "The API key is missing, malformed, expired or revoked",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (403 Forbidden)**

The key or its owner does not hold what the operation needs.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/forbidden/",
  "title": "Forbidden",
  "status": 403,
  "code": "forbidden",
  "detail": "This key does not have the domains.view scope",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (404 Not Found)**

No such record in this organisation (an absent id and another organisation's answer alike).

```json
{
  "type": "https://docs.watchtower15.com/api/errors/not_found/",
  "title": "Not found",
  "status": 404,
  "code": "not_found",
  "detail": "No record with that id exists in this organisation.",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (422 Unprocessable Content)**

The request is invalid; `errors` names the parameters.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/invalid_request/",
  "title": "Invalid request",
  "status": 422,
  "code": "invalid_request",
  "detail": "The request is invalid",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d",
  "errors": {
    "name": [
      "The name field is required."
    ]
  }
}
```

**Response (429 Too Many Requests)**

A rate limit or the organisation's daily limit is reached; `Retry-After` says when to retry.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/rate_limited/",
  "title": "Rate limited",
  "status": 429,
  "code": "rate_limited",
  "detail": "Too many requests: the limit is 240 a minute",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d",
  "limit": 60
}
```

**Response (500 Internal Server Error)**

An unexpected error.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/internal_error/",
  "title": "Internal error",
  "status": 500,
  "code": "internal_error",
  "detail": "An unexpected error has happened",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

## Run a domain scan

POST/v1/domains/{domain\_uuid}/scans/{scan\_type}

Queues a scan of one type (`dns`, `expiry`, `information` or `ssl`) on the domain now and returns a receipt; follow it with `GET /v1/scans/{scan_uuid}` until it ends. A scan of the same type and domain is refused during the cooldown, with the seconds left.

Needs the scope `domains.edit`.

### Headers

- `Idempotency-Key` (string): Any text of 1 to 255 visible ASCII characters. A repeat of the same request within 24 hours returns the first answer without running again (the response carries `Idempotent-Replayed: true`); the same key on a different request is refused 422 `invalid_request`.

### Path parameters

- `domain_uuid` (string (uuid), required): The uuid of the domain.
- `scan_type` (string, required): The scan to queue: `dns`, `expiry`, `information` or `ssl`. Values:`dns``expiry``information``ssl`(an open set: new values may be added)

### Returns

`202 Accepted`:

The scan was queued; the receipt names it.

Each failure is a problem document with a stable `code`; the response panel's status selector shows each one this operation can answer, and [errors](https://developer.watchtower15.com/api/errors/) lists them all.

**POST /v1/domains/{domain_uuid}/scans/{scan_type}**

curl:

```bash
curl -X POST https://rest.watchtower15.com/v1/domains/67b3f541-4111-4930-921e-7cdc105c9fdb/scans/dns \
  -H "Authorization: Bearer $WT15_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"
```

PHP:

```php
$wt15 = WatchTower15\Client::fromEnvironment();

$result = $wt15->domains->runScan('67b3f541-4111-4930-921e-7cdc105c9fdb', 'dns');
```

Node.js:

```ts
const wt15 = WatchTower15.fromEnvironment();

const result = await wt15.domains.runScan('67b3f541-4111-4930-921e-7cdc105c9fdb', 'dns');
```

Python:

```python
client = Client.from_environment()

result = client.domains.run_scan('67b3f541-4111-4930-921e-7cdc105c9fdb', 'dns')
```

**Response (202 Accepted)**

```json
{
  "data": {
    "scan_uuid": "7edfbf48-4812-43c4-b362-63f374779348",
    "scan_type": "example",
    "status": "example",
    "queued_at": 1794214800000,
    "domain_uuid": "67b3f541-4111-4930-921e-7cdc105c9fdb"
  }
}
```

**Response (401 Unauthorized)**

The API key is missing, malformed, expired or revoked.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/unauthorized/",
  "title": "Unauthorized",
  "status": 401,
  "code": "unauthorized",
  "detail": "The API key is missing, malformed, expired or revoked",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (402 Payment Required)**

The organisation's payment gate blocks the action: `payment_required` (no payment method) or `invoice_overdue`. Nothing is billed and nothing is started.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/payment_required/",
  "title": "Payment required",
  "status": 402,
  "code": "payment_required",
  "detail": "A payment method must be set before adding resources for monitoring.",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (403 Forbidden)**

The key or its owner does not hold what the operation needs.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/forbidden/",
  "title": "Forbidden",
  "status": 403,
  "code": "forbidden",
  "detail": "This key does not have the domains.edit scope",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (404 Not Found)**

No such record in this organisation (an absent id and another organisation's answer alike).

```json
{
  "type": "https://docs.watchtower15.com/api/errors/not_found/",
  "title": "Not found",
  "status": 404,
  "code": "not_found",
  "detail": "No record with that id exists in this organisation.",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (422 Unprocessable Content)**

The request is invalid; `errors` names the parameters.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/invalid_request/",
  "title": "Invalid request",
  "status": 422,
  "code": "invalid_request",
  "detail": "The request is invalid",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d",
  "errors": {
    "name": [
      "The name field is required."
    ]
  }
}
```

**Response (429 Too Many Requests)**

A rate limit or the organisation's daily limit is reached; `Retry-After` says when to retry.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/rate_limited/",
  "title": "Rate limited",
  "status": 429,
  "code": "rate_limited",
  "detail": "Too many requests: the limit is 240 a minute",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d",
  "limit": 60
}
```

**Response (500 Internal Server Error)**

An unexpected error.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/internal_error/",
  "title": "Internal error",
  "status": 500,
  "code": "internal_error",
  "detail": "An unexpected error has happened",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

## List a domain's scans

GET/v1/domains/{domain\_uuid}/scans

Returns the domain’s completed scans of one type (`dns`, `expiry` or `ssl`), newest first. Only the newest 20 completed scans of the type are available. Each row has the scan’s common fields and those of its type. Pages by `page` and `per_page` (`limit` is the same as `per_page`); every page carries `current_page`, `per_page`, `last_page` and `total`.

Needs the scope `domains.view`.

### Path parameters

- `domain_uuid` (string (uuid), required): The uuid of the domain.

### Query parameters

- `type` (string, required): The scan type to list: `dns`, `expiry` or `ssl`. Values:`dns``expiry``ssl`(an open set: new values may be added)
- `limit` (integer or null): The same as `per_page`, kept for existing clients.
- `include_total` (string or null): Ignored: `total` is always present. Values:`true``false``1``0`(an open set: new values may be added)
- `per_page` (integer or null): How many items one page holds, from 1 to 100; 25 when omitted.
- `page` (integer or null): The page to read, from 1; 1 when omitted. A page past the last answers no rows.

### Returns

`200 OK`:

One page of the domain’s completed scans of the requested type.

Each item of the page:

- `uuid` (string): The scan’s uuid.
- `status` (string): The scan’s state: `queued`, `running`, `completed`, `failed` or `timeout`.
- `outcome` (string or null): The scanner’s verdict on a completed scan: `data_found`, `no_data`, `target_not_found`, `blocked` or `lookup_unavailable`; null when the scan did not get that far.
- `completed_at` (integer or null): Epoch milliseconds: when the scan completed; null while it has not. An instant: epoch milliseconds, UTC.
- `execution_time_ms` (integer or null): How long the scan took, in milliseconds; null when it did not complete.
- `error_message` (string or null): The error that ended a failed scan; null otherwise.
- `has_changes` (boolean or null): Whether the scan found a change against the previous one; null when the scan has not completed or its outcome kept it out of change detection.
- `records` (object): The DNS records the scan found, by record type.
  - `a` (array of strings): The A records, as text lines.
  - `aaaa` (array of strings): The AAAA records, as text lines.
  - `mx` (array of strings): The MX records, as text lines.
  - `txt` (array of strings): The TXT records, as text lines.
  - `cname` (array of strings): The CNAME records, as text lines.
  - `ns` (array of strings): The NS records, as text lines.
  - `soa` (array of strings): The SOA records, as text lines.
  - `caa` (array of strings): The CAA records, as text lines.
- `registrar` (string or null): The registrar of the domain; null when the registry does not publish it.
- `registration_date` (string or null): The registration date as `YYYY-MM-DD`; null when the registry does not publish it.
- `expiry_date` (string or null): The registration expiry date as `YYYY-MM-DD`; null when the registry does not publish it.
- `updated_date` (string or null): The date the registration was last updated, as `YYYY-MM-DD`; null when the registry does not publish it.
- `days_until_expiry` (integer or null): Whole days left until the expiry; negative once expired, null when unknown.
- `is_expired` (boolean or null): Whether the registration or the certificate has expired; null when unknown.
- `nameservers` (array of strings): The domain’s name servers, one per item.
- `status_codes` (array of strings): The registry status codes of the domain, one per item.
- `common_name` (string or null): The common name of the certificate; null when it has none.
- `issuer_cn` (string or null): The common name of the certificate’s issuer; null when unknown.
- `issuer_org` (string or null): The organisation of the certificate’s issuer; null when unknown.
- `valid_from` (integer or null): Epoch milliseconds: when the certificate becomes valid; null when unknown. An instant: epoch milliseconds, UTC.
- `valid_until` (integer or null): Epoch milliseconds: when the certificate stops being valid; null when unknown. An instant: epoch milliseconds, UTC.
- `is_self_signed` (boolean or null): Whether the certificate is self-signed; null when unknown.
- `chain_valid` (boolean or null): Whether the certificate chain validates; null when unknown.

Each failure is a problem document with a stable `code`; the response panel's status selector shows each one this operation can answer, and [errors](https://developer.watchtower15.com/api/errors/) lists them all.

**GET /v1/domains/{domain_uuid}/scans**

curl:

```bash
curl -G https://rest.watchtower15.com/v1/domains/67b3f541-4111-4930-921e-7cdc105c9fdb/scans \
  -H "Authorization: Bearer $WT15_API_KEY" \
  -d type=dns
```

PHP:

```php
$wt15 = WatchTower15\Client::fromEnvironment();

foreach ($wt15->domains->scans('67b3f541-4111-4930-921e-7cdc105c9fdb', ['type' => 'dns'])->autoPaging() as $item) { echo $item->uuid, "\n"; }
```

Node.js:

```ts
const wt15 = WatchTower15.fromEnvironment();

for await (const item of wt15.domains.scans('67b3f541-4111-4930-921e-7cdc105c9fdb', { type: 'dns' })) {
  console.log(item.uuid);
}
```

Python:

```python
client = Client.from_environment()

for item in client.domains.scans('67b3f541-4111-4930-921e-7cdc105c9fdb', type='dns'):
    print(item.uuid)
```

**Response (200 OK)**

```json
{
  "data": [
    {
      "uuid": "75666699-b77d-4631-b576-041e8102a55b",
      "status": "example",
      "outcome": "example",
      "completed_at": 1794214800000,
      "execution_time_ms": 1,
      "error_message": "example",
      "has_changes": true,
      "records": {
        "a": [
          "example"
        ],
        "aaaa": [
          "example"
        ],
        "mx": [
          "example"
        ],
        "txt": [
          "example"
        ],
        "cname": [
          "example"
        ],
        "ns": [
          "example"
        ],
        "soa": [
          "example"
        ],
        "caa": [
          "example"
        ]
      },
      "registrar": "example",
      "registration_date": "example",
      "expiry_date": "example",
      "updated_date": "example",
      "days_until_expiry": 1,
      "is_expired": true,
      "nameservers": [
        "example"
      ],
      "status_codes": [
        "example"
      ],
      "common_name": "example",
      "issuer_cn": "example",
      "issuer_org": "example",
      "valid_from": 1794214800000,
      "valid_until": 1794214800000,
      "is_self_signed": true,
      "chain_valid": true
    }
  ],
  "current_page": 1,
  "per_page": 1,
  "last_page": 1,
  "total": 1
}
```

**Response (401 Unauthorized)**

The API key is missing, malformed, expired or revoked.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/unauthorized/",
  "title": "Unauthorized",
  "status": 401,
  "code": "unauthorized",
  "detail": "The API key is missing, malformed, expired or revoked",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (403 Forbidden)**

The key or its owner does not hold what the operation needs.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/forbidden/",
  "title": "Forbidden",
  "status": 403,
  "code": "forbidden",
  "detail": "This key does not have the domains.view scope",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (404 Not Found)**

No such record in this organisation (an absent id and another organisation's answer alike).

```json
{
  "type": "https://docs.watchtower15.com/api/errors/not_found/",
  "title": "Not found",
  "status": 404,
  "code": "not_found",
  "detail": "No record with that id exists in this organisation.",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (422 Unprocessable Content)**

The request is invalid (`invalid_request`; `errors` names the parameters).

```json
{
  "type": "https://docs.watchtower15.com/api/errors/invalid_request/",
  "title": "Invalid request",
  "status": 422,
  "code": "invalid_request",
  "detail": "The request is invalid",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d",
  "errors": {
    "name": [
      "The name field is required."
    ]
  }
}
```

**Response (429 Too Many Requests)**

A rate limit or the organisation's daily limit is reached; `Retry-After` says when to retry.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/rate_limited/",
  "title": "Rate limited",
  "status": 429,
  "code": "rate_limited",
  "detail": "Too many requests: the limit is 240 a minute",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d",
  "limit": 60
}
```

**Response (500 Internal Server Error)**

An unexpected error.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/internal_error/",
  "title": "Internal error",
  "status": 500,
  "code": "internal_error",
  "detail": "An unexpected error has happened",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

## Start domain verification

POST/v1/domains/{domain\_uuid}/verification

Starts the ownership verification of the domain’s apex. It records the key’s owner as the authorising user, with the time and the Terms version, and answers the TXT record to publish. `authorised` must be true, confirming control of the domain.

Needs the scopes `domains.view` and `security.edit`.

### Headers

- `Idempotency-Key` (string): Any text of 1 to 255 visible ASCII characters. A repeat of the same request within 24 hours returns the first answer without running again (the response carries `Idempotent-Replayed: true`); the same key on a different request is refused 422 `invalid_request`.

### Path parameters

- `domain_uuid` (string (uuid), required): The uuid of the domain.

### Body parameters

- `authorised` (any, required): Must be true: confirms that the organisation controls the domain and authorises WatchTower15 to scan it, as the Terms require. Values:`yes``on``1``1``true``true`(an open set: new values may be added)

### Returns

`200 OK`:

The apex’s verification state and the TXT record to publish.

Each failure is a problem document with a stable `code`; the response panel's status selector shows each one this operation can answer, and [errors](https://developer.watchtower15.com/api/errors/) lists them all.

**POST /v1/domains/{domain_uuid}/verification**

curl:

```bash
curl -X POST https://rest.watchtower15.com/v1/domains/67b3f541-4111-4930-921e-7cdc105c9fdb/verification \
  -H "Authorization: Bearer $WT15_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "authorised": "yes"
  }'
```

PHP:

```php
$wt15 = WatchTower15\Client::fromEnvironment();

$result = $wt15->domains->startVerification('67b3f541-4111-4930-921e-7cdc105c9fdb', ['authorised' => 'yes']);
```

Node.js:

```ts
const wt15 = WatchTower15.fromEnvironment();

const result = await wt15.domains.startVerification('67b3f541-4111-4930-921e-7cdc105c9fdb', { authorised: 'yes' });
```

Python:

```python
client = Client.from_environment()

result = client.domains.start_verification('67b3f541-4111-4930-921e-7cdc105c9fdb', authorised='yes')
```

**Response (200 OK)**

```json
{
  "data": {
    "apex": "example",
    "status": "example",
    "txt_host": "example",
    "txt_value": "example",
    "verified_at": 1794214800000,
    "first_verified_at": 1794214800000,
    "lost_at": 1794214800000,
    "last_checked_at": 1794214800000,
    "last_check_result": "example",
    "last_absent_at": 1794214800000,
    "consecutive_absent": 1,
    "recheck_until": 1794214800000,
    "authorised_by": {
      "uuid": "75666699-b77d-4631-b576-041e8102a55b",
      "name": "example.com"
    },
    "authorised_at": 1794214800000,
    "terms_version": "example",
    "covers": [
      {
        "uuid": "75666699-b77d-4631-b576-041e8102a55b",
        "name": "example.com"
      }
    ]
  }
}
```

**Response (401 Unauthorized)**

The API key is missing, malformed, expired or revoked.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/unauthorized/",
  "title": "Unauthorized",
  "status": 401,
  "code": "unauthorized",
  "detail": "The API key is missing, malformed, expired or revoked",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (403 Forbidden)**

The key or its owner does not hold what the operation needs.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/forbidden/",
  "title": "Forbidden",
  "status": 403,
  "code": "forbidden",
  "detail": "This key does not have the domains.view scope",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (404 Not Found)**

No such record in this organisation (an absent id and another organisation's answer alike).

```json
{
  "type": "https://docs.watchtower15.com/api/errors/not_found/",
  "title": "Not found",
  "status": 404,
  "code": "not_found",
  "detail": "No record with that id exists in this organisation.",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (422 Unprocessable Content)**

The request is invalid; `errors` names the parameters.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/invalid_request/",
  "title": "Invalid request",
  "status": 422,
  "code": "invalid_request",
  "detail": "The request is invalid",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d",
  "errors": {
    "name": [
      "The name field is required."
    ]
  }
}
```

**Response (429 Too Many Requests)**

A rate limit or the organisation's daily limit is reached; `Retry-After` says when to retry.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/rate_limited/",
  "title": "Rate limited",
  "status": 429,
  "code": "rate_limited",
  "detail": "Too many requests: the limit is 240 a minute",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d",
  "limit": 60
}
```

**Response (500 Internal Server Error)**

An unexpected error.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/internal_error/",
  "title": "Internal error",
  "status": 500,
  "code": "internal_error",
  "detail": "An unexpected error has happened",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

## List a domain's timeline

GET/v1/domains/{domain\_uuid}/timeline

Returns why a domain failed or changed, newest first, one cursor page at a time, kept as long as its uptime (ten years): an endpoint gone down with the reason it gave and the HTTP status that came back, an endpoint that is still down, a recovery with how long it was down, a scan of any type that failed or recovered, and every change the DNS, SSL, registration and WHOIS scans flagged, with what changed. Failures are recorded from the date in `recorded_from`; changes go back to the domain’s first scan. WHOIS contact details are never kept: a contact change says only that it changed. Send no window for the whole history, `period` for a relative window, or `from` and `to` for a pinned one.

Needs the scope `domains.view`.

### Path parameters

- `domain_uuid` (string (uuid), required): The uuid of the domain.

### Query parameters

- `period` (string or null): A relative window ending now: 1 to 9999 minutes, hours, days or weeks (`3h`, `2w`). Not with `from` and `to`. The operation names its longest window and its default.
- `from` (string or null): The start of a pinned window, epoch milliseconds or RFC 3339 with an offset. Needs `to`. A start before the oldest data kept is served from it.
- `to` (string or null): The end of a pinned window, epoch milliseconds or RFC 3339 with an offset, after `from`. A window that ends before the oldest data kept, or in the future, is refused.
- `kind` (array of strings or null): Only events of these kinds: `domain_endpoint_down`, `domain_endpoint_still_down`, `domain_endpoint_up`, `domain_scan_failed`, `domain_scan_recovered` or `domain_change`. Repeat the parameter (`kind[]=domain_endpoint_down&kind[]=domain_endpoint_up`) for several. A list: repeat the parameter (`kind=domain_endpoint_down&kind=domain_endpoint_still_down`) or send one value (`kind=domain_endpoint_down`); `kind[]=domain_endpoint_down` is accepted too. Values:`domain_endpoint_down``domain_endpoint_still_down``domain_endpoint_up``domain_scan_failed``domain_scan_recovered``domain_change`(an open set: new values may be added)
- `endpoint` (string or null): Only events of this endpoint: `http_www`, `http_non_www`, `https_www` or `https_non_www`. Values:`http_www``http_non_www``https_www``https_non_www`(an open set: new values may be added)
- `limit` (integer or null): The same as `per_page`, kept for existing clients.
- `cursor` (string or null): The `next_cursor` of the previous page; omit it for the first page.
- `per_page` (integer or null): How many events one page holds, from 1 to 100; 25 when omitted.

### Returns

`200 OK`:

One page of the domain’s timeline.

Each item of the page:

- `event_uuid` (string): The event’s uuid.
- `kind` (string): One of `domain_endpoint_down` (an endpoint failed its scans in a row), `domain_endpoint_still_down` (it is still down, written at most hourly), `domain_endpoint_up` (it answered again), `domain_scan_failed` and `domain_scan_recovered` (a scan of any type failed, and passed again), and `domain_change` (a scan flagged a change).
- `at` (integer): Epoch milliseconds: when the scan that caused the event ran. An instant: epoch milliseconds, UTC.
- `scan_type` (string): The scan the event came from: `domain_reachability`, `domain_dns`, `domain_ssl`, `domain_expiry` or `domain_information`.
- `scan_uuid` (string): The uuid of that scan.
- `endpoint` (string or null): The endpoint of an endpoint event: `http_www`, `http_non_www`, `https_www` or `https_non_www`; null for the others.
- `reason` (string or null): Why an endpoint went down (`dns`, `blocked_destination`, `refused`, `timeout`, `tls_expired`, `tls_hostname`, `tls_untrusted` or `no_reply`) or a scan failed (`scanner_failed`, `reaped_running`, `reaped_queued`, `blocked` or `lookup_unavailable`); null otherwise.
- `http_status` (integer or null): The HTTP status the endpoint answered with, when one came back; null otherwise.
- `response_ms` (integer or null): How long a recovered endpoint took to answer, in milliseconds; null otherwise.
- `since` (integer or null): Epoch milliseconds: when the failure began; null for a change. An instant: epoch milliseconds, UTC.
- `down_for_seconds` (integer or null): How long the endpoint was down, in seconds, on a recovery; null otherwise.
- `failed_for_seconds` (integer or null): How long the scan type kept failing, in seconds, on a scan recovery; null otherwise.
- `status` (string or null): The failed scan’s status, `failed` or `completed`; null for other events.
- `outcome` (string or null): The failed scan’s outcome, such as `blocked` or `lookup_unavailable`; null otherwise.
- `flags` (array of strings): On a change, the names of the change flags the scan set; an empty list otherwise.
- `summary` (object or null): On a change, what changed: `changes` maps each field to its `old` and `new` values (lists of text, at most 20 values of 256 characters in all, WHOIS contacts reduced to one line), and `truncated` says a cap cut something; null otherwise.
- `baseline` (boolean or null): On a change, true when it is the domain’s first scan of that type, which establishes the baseline; null otherwise.

Each failure is a problem document with a stable `code`; the response panel's status selector shows each one this operation can answer, and [errors](https://developer.watchtower15.com/api/errors/) lists them all.

**GET /v1/domains/{domain_uuid}/timeline**

curl:

```bash
curl https://rest.watchtower15.com/v1/domains/67b3f541-4111-4930-921e-7cdc105c9fdb/timeline \
  -H "Authorization: Bearer $WT15_API_KEY"
```

PHP:

```php
$wt15 = WatchTower15\Client::fromEnvironment();

foreach ($wt15->domains->timeline('67b3f541-4111-4930-921e-7cdc105c9fdb')->autoPaging() as $item) { echo $item->eventUuid, "\n"; }
```

Node.js:

```ts
const wt15 = WatchTower15.fromEnvironment();

for await (const item of wt15.domains.timeline('67b3f541-4111-4930-921e-7cdc105c9fdb')) {
  console.log(item.event_uuid);
}
```

Python:

```python
client = Client.from_environment()

for item in client.domains.timeline('67b3f541-4111-4930-921e-7cdc105c9fdb'):
    print(item.event_uuid)
```

**Response (200 OK)**

```json
{
  "data": [
    {
      "event_uuid": "a2b46615-94ce-4459-839d-eb74264ddf20",
      "kind": "example",
      "at": 1794214800000,
      "scan_type": "example",
      "scan_uuid": "7edfbf48-4812-43c4-b362-63f374779348",
      "endpoint": "example",
      "reason": "example",
      "http_status": 1,
      "response_ms": 1,
      "since": 1794214800000,
      "down_for_seconds": 1,
      "failed_for_seconds": 1,
      "status": "example",
      "outcome": "example",
      "flags": [
        "example"
      ],
      "summary": {},
      "baseline": true
    }
  ],
  "next_cursor": "example",
  "total": 1,
  "meta": {
    "recorded_from": 1794214800000
  }
}
```

**Response (401 Unauthorized)**

The API key is missing, malformed, expired or revoked.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/unauthorized/",
  "title": "Unauthorized",
  "status": 401,
  "code": "unauthorized",
  "detail": "The API key is missing, malformed, expired or revoked",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (403 Forbidden)**

The key or its owner does not hold what the operation needs.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/forbidden/",
  "title": "Forbidden",
  "status": 403,
  "code": "forbidden",
  "detail": "This key does not have the domains.view scope",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (404 Not Found)**

No such record in this organisation (an absent id and another organisation's answer alike).

```json
{
  "type": "https://docs.watchtower15.com/api/errors/not_found/",
  "title": "Not found",
  "status": 404,
  "code": "not_found",
  "detail": "No record with that id exists in this organisation.",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (422 Unprocessable Content)**

The request is invalid (`invalid_request`; `errors` names the parameters).

```json
{
  "type": "https://docs.watchtower15.com/api/errors/invalid_request/",
  "title": "Invalid request",
  "status": 422,
  "code": "invalid_request",
  "detail": "The request is invalid",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d",
  "errors": {
    "name": [
      "The name field is required."
    ]
  }
}
```

**Response (429 Too Many Requests)**

A rate limit or the organisation's daily limit is reached; `Retry-After` says when to retry.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/rate_limited/",
  "title": "Rate limited",
  "status": 429,
  "code": "rate_limited",
  "detail": "Too many requests: the limit is 240 a minute",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d",
  "limit": 60
}
```

**Response (500 Internal Server Error)**

An unexpected error.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/internal_error/",
  "title": "Internal error",
  "status": 500,
  "code": "internal_error",
  "detail": "An unexpected error has happened",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

## Get a domain's uptime

GET/v1/domains/{domain\_uuid}/uptime

Returns the reachability uptime of each configured endpoint over the last 24 hours, 7 days and 30 days, weighted by the number of checks in each hour. With `include_buckets=true` it also returns the hourly buckets the figures come from, oldest first.

Needs the scope `domains.view`.

### Path parameters

- `domain_uuid` (string (uuid), required): The uuid of the domain.

### Query parameters

- `include_buckets` (string or null): Absent or false answers the figures only; true adds the hourly buckets they come from (`true`, `false`, `1` or `0`). Values:`true``false``1``0`(an open set: new values may be added)

### Returns

`200 OK`:

The domain’s uptime figures per endpoint, and the hourly buckets when asked for.

Each failure is a problem document with a stable `code`; the response panel's status selector shows each one this operation can answer, and [errors](https://developer.watchtower15.com/api/errors/) lists them all.

**GET /v1/domains/{domain_uuid}/uptime**

curl:

```bash
curl https://rest.watchtower15.com/v1/domains/67b3f541-4111-4930-921e-7cdc105c9fdb/uptime \
  -H "Authorization: Bearer $WT15_API_KEY"
```

PHP:

```php
$wt15 = WatchTower15\Client::fromEnvironment();

$result = $wt15->domains->uptime('67b3f541-4111-4930-921e-7cdc105c9fdb');
```

Node.js:

```ts
const wt15 = WatchTower15.fromEnvironment();

const result = await wt15.domains.uptime('67b3f541-4111-4930-921e-7cdc105c9fdb');
```

Python:

```python
client = Client.from_environment()

result = client.domains.uptime('67b3f541-4111-4930-921e-7cdc105c9fdb')
```

**Response (200 OK)**

```json
{
  "data": {
    "endpoints": [
      {
        "endpoint": "example",
        "uptime_24h_percent": 0,
        "uptime_7d_percent": 0,
        "uptime_30d_percent": 0,
        "checks_30d": 1
      }
    ],
    "buckets": [
      {
        "bucket": 1794214800000,
        "total": 1,
        "https_www": 0,
        "https_non_www": 0,
        "http_www": 0,
        "http_non_www": 0
      }
    ]
  }
}
```

**Response (401 Unauthorized)**

The API key is missing, malformed, expired or revoked.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/unauthorized/",
  "title": "Unauthorized",
  "status": 401,
  "code": "unauthorized",
  "detail": "The API key is missing, malformed, expired or revoked",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (403 Forbidden)**

The key or its owner does not hold what the operation needs.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/forbidden/",
  "title": "Forbidden",
  "status": 403,
  "code": "forbidden",
  "detail": "This key does not have the domains.view scope",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (404 Not Found)**

No such record in this organisation (an absent id and another organisation's answer alike).

```json
{
  "type": "https://docs.watchtower15.com/api/errors/not_found/",
  "title": "Not found",
  "status": 404,
  "code": "not_found",
  "detail": "No record with that id exists in this organisation.",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (422 Unprocessable Content)**

The request is invalid (`invalid_request`; `errors` names the parameters).

```json
{
  "type": "https://docs.watchtower15.com/api/errors/invalid_request/",
  "title": "Invalid request",
  "status": 422,
  "code": "invalid_request",
  "detail": "The request is invalid",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d",
  "errors": {
    "name": [
      "The name field is required."
    ]
  }
}
```

**Response (429 Too Many Requests)**

A rate limit or the organisation's daily limit is reached; `Retry-After` says when to retry.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/rate_limited/",
  "title": "Rate limited",
  "status": 429,
  "code": "rate_limited",
  "detail": "Too many requests: the limit is 240 a minute",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d",
  "limit": 60
}
```

**Response (500 Internal Server Error)**

An unexpected error.

```json
{
  "type": "https://docs.watchtower15.com/api/errors/internal_error/",
  "title": "Internal error",
  "status": 500,
  "code": "internal_error",
  "detail": "An unexpected error has happened",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

**Response (503 Service Unavailable)**

A data store did not answer within the request's 10 seconds; try again shortly (`store_unavailable`).

```json
{
  "type": "https://docs.watchtower15.com/api/errors/store_unavailable/",
  "title": "Store unavailable",
  "status": 503,
  "code": "store_unavailable",
  "detail": "A data store did not answer; try again shortly",
  "request_id": "4d1e8b7a-2c9f-4a3e-b6d5-7f0c1a2e3b4d"
}
```

Source: https://developer.watchtower15.com/api/reference/domains/
