Skip to content
Median
Esc
↑↓navigate↵open⌘Jpreview

Connect a custom domain

Connects a hostname like help.example.com, replacing any other. Add the returned records at your DNS provider; the domain goes live once they are in place. Needs the Site add-on or Pro. Admins and owners only.

POST/site/domain
Authorization
AuthorizationBearer token · headerrequired
`MEDIAN_KEY` from Settings under API, or an MCP OAuth access token. A key acts as the organization; a token acts as the person who approved it.
Request body
requiredapplication/json
domainstringrequired
Responses
200The domain, with the records to add.
domainSiteDomain | any
Show properties
One of:
SiteDomain
hostnamestring
statusstring
pending until the DNS records are in place and the domain is verified.
Allowed:pendingactive
recordsobject[]
DNS records still to add. Empty once the domain is live.
Show properties
Array of object
typestring
Allowed:ACNAMETXT
namestring
Relative to the apex: @, help, _vercel.
valuestring
problemstring | null
Why the last check could not finish, if it could not.
checkedAtnumber | null
When the domain was last checked, in milliseconds since the epoch.
any
any
401The bearer token is missing, revoked, or expired.
errorobject
Show properties
codestring
messagestring
429Too many requests. Wait the seconds in `Retry-After`. Limits depend on the plan. See [rate limits](/api/errors-and-limits#rate-limits).
errorobject
Show properties
codestring
messagestring
Request
curl -X POST "https://api.median.sh/v1/site/domain" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "domain": "help.example.com"
}'
Response
{
  "domain": {
    "hostname": "help.example.com",
    "status": "pending",
    "records": [
      {
        "type": "A",
        "name": "string",
        "value": "string"
      }
    ],
    "problem": "string",
    "checkedAt": 0
  }
}