---
title: "Attach a custom domain to a status page"
method: POST
path: "/status-pages/{status_page_id}/domains"
tags: ["Status Page"]
---

# Attach a custom domain to a status page

`POST /status-pages/{status_page_id}/domains`

## Request

- Base URL: `/api` (relative, and the document was published on a file host, not at the API’s origin)
- URL: `/api/status-pages/{status_page_id}/domains`
- Auth: HTTP bearer

The hostname is checked against every hostname this instance already
serves. It is served only after ownership is verified through ACME.

## Path parameters

- `status_page_id` integer, required

## Request body

- AddStatusPageDomainRequest
  - `hostname` string, required: Hostname to serve the page on, e.g. `status.example.com`. Unicode names are converted to punycode; wildcards and IP addresses are refused.
  - `verification_method` 'http-01' | 'dns-01': Defaults to `http-01`.

## Response `201`

Domain attached; create the DNS records, then verify

- StatusPageDomainResponse
  - `certificate_expires_at` string, date-time, nullable
  - `created_at` string, date-time, required
  - `dns_records` DnsRecordInstruction[], required
    - `name` string, required: Fully qualified record name.
    - `purpose` string, required: Why the record is needed.
    - `record_type` string, required: `CNAME`, `A` or `TXT`.
    - `value` string, required: Record value.
  - `hostname` string, required
  - `id` integer, required
  - `last_error` string, nullable: Reason the last verification failed, if it did.
  - `serving` boolean, required: True when visitors can open the page on this hostname right now: the hostname is verified and the page is published.
  - `status` 'pending' | 'active' | 'failed' | 'unverified' | 'renewal_pending' | 'renewal_failed', required: Lifecycle of a custom hostname.
  - `verification_method` 'http-01' | 'dns-01', required: How ownership of a hostname is proven.

## Other responses

- `400`: Invalid hostname
- `401`: Unauthorized
- `403`: Insufficient permissions
- `404`: Status page not found
- `409`: Hostname already in use, or domain limit reached
- `502`: Certificate order could not be started
- `503`: Hostname availability could not be checked

## Changes

- **2026-10-12** `0fda1aa1af69`: 2 warning
  - added the new `renewal_failed` enum value to the `status` response property for the response status `201`
  - added the new `renewal_pending` enum value to the `status` response property for the response status `201`
- **2026-10-12** `a76c9be89da5`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/gotempsh/apis/temps/changes/status-pages/:status_page_id/domains/post.md)

---

[API](https://skmtc.dev/gotempsh/apis/temps.md) - [All operations](https://skmtc.dev/gotempsh/apis/temps/llms.txt) - [OpenAPI document](https://skmtc.dev/gotempsh/apis/temps/revisions/3b040526eb43?raw)
