Domains

Attach a custom domain

Attach a hostname to this Space. Spacefast checks the hostname and provisions SSL. Pass redirect to answer the hostname with a whole-host redirect instead of serving the Space. If the hostname is attached to another Space, the response is a Spacefast TXT ownership challenge; verifying it moves the attachment after provider cleanup.

post/v1/spaces/{spaceId}/domains

Request

  • Base URL: https://api.spacefast.com
  • URL: https://api.spacefast.com/v1/spaces/{spaceId}/domains
  • Auth: one of:
    • HTTP bearer
    • HTTP bearer
    • OAuth 2 (authorization code, authorization URL https://api.spacefast.com/v1/auth/oauth2/authorize, token URL https://api.spacefast.com/v1/auth/oauth2/token; client credentials, token URL https://api.spacefast.com/v1/auth/oauth2/token, scopes: domains:write)

Path parameters

spaceIdstring required

Request body

namestring required

Hostname to attach. An apex or www hostname also connects its counterpart.

primaryboolean

Whether this domain becomes the space's primary hostname.

Response

Response for status 201

$schemastring uri

Canonical JSON Schema URL for this response body. The server also sends it in the Link: rel="describedby" response header.

Changes

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