Domains

Add a custom domain (optionally redirecting to another), or a wildcard domain such as *.example.com (docs/PLATFORM_API.md "Wildcard domains"; not_configured while free certificates are off); returns the DNS records, including the ownership TXT record

post/projects/{projectId}/domains

Request

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

Path parameters

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

Request body

hostnamestring required

e.g. www.example.com; *.example.com serves every name one label below example.com (not example.com itself)

redirectTostring

never for a wildcard domain

Response

Added (verification attempted)

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.