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/domainAuthorization
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/jsondomainstringrequiredResponses
200The domain, with the records to add.
domainSiteDomain | anyShow propertiesHide properties
One of:
SiteDomain
hostnamestringstatusstringpending until the DNS records are in place and the domain is verified.
Allowed:
pendingactiverecordsobject[]DNS records still to add. Empty once the domain is live.
Show propertiesHide properties
Array of
objecttypestringAllowed:
ACNAMETXTnamestringRelative to the apex: @, help, _vercel.
valuestringproblemstring | nullWhy the last check could not finish, if it could not.
checkedAtnumber | nullWhen the domain was last checked, in milliseconds since the epoch.
any
any401The bearer token is missing, revoked, or expired.
errorobjectShow propertiesHide properties
codestringmessagestring429Too many requests. Wait the seconds in `Retry-After`. Limits depend on the plan. See [rate limits](/api/errors-and-limits#rate-limits).
errorobjectShow propertiesHide properties
codestringmessagestringRequest
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"
}'const response = await fetch("https://api.median.sh/v1/site/domain", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json"
},
body: JSON.stringify({
"domain": "help.example.com"
})
});Response
{
"domain": {
"hostname": "help.example.com",
"status": "pending",
"records": [
{
"type": "A",
"name": "string",
"value": "string"
}
],
"problem": "string",
"checkedAt": 0
}
}{
"error": {
"code": "string",
"message": "string"
}
}{
"error": {
"code": "string",
"message": "string"
}
}