Domains

Set or clear the redirect target and the redirect status code (www ↔ apex)

patch/projects/{projectId}/domains/{hostname}

Request

  • Base URL: https://hostingsurge.com/api/v1
  • URL: https://hostingsurge.com/api/v1/projects/{projectId}/domains/{hostname}
  • Auth: one of:
    • HTTP bearer
    • API key in cookie __Host-hs_session

Path parameters

projectIdstring uuid required
Example:3f2b8a4e-5c1d-4e8f-9a7b-2c6d1e0f4a5b
hostnamestring required

Request body

redirectTostring nullable

another domain of the same project that does not redirect itself; null clears the redirect

Response

Updated domain

idstring uuid required
hostnamestring required

a hostname, or a wildcard domain such as *.example.com (see wildcard)

kind'default' | 'custom' required
redirectTostring nullable required
status'valid' | 'pending' | 'invalid' required

valid: ownership verified and DNS points at the platform (the domain serves); pending: waiting for DNS or the ownership TXT record; invalid: DNS points elsewhere

statusReasonstring nullable required

the result of the last check in words, e.g. which record is missing

ssl'active' | 'pending' | 'error' | 'none' required
phase'waiting_dns' | 'dns_points_here' | 'issuing_https' | 'live' required

waiting_dns: the records do not point here yet; dns_points_here: they do (ownership or the first deployment may still be missing); issuing_https: attached, the certificate is being issued; live: served over HTTPS

checkedAtstring nullable required

ISO-8601 timestamp

createdAtstring required

ISO-8601 timestamp

Changes

No recorded changes to this operation across all 1 revision of this API.