Add a domain for a partner principal - Spacefast Docs

Add a domain for a partner principal

Creates a custom domain owned by the Space’s external principal, assigns it to that Space, and starts DNS verification. Counts against the principal’s custom domain quota. Returns the domain and the runtime operation.

POST /v1/spaces/{spaceId}/domains

Authorization

Authorization Bearer token · header required

Authorization: Bearer <token> with an API key (sfa_ prefix), an OAuth access token, a session token, or a Space machine credential (sfm_ prefix).

or

Authorization OAuth2 access token · header required

OAuth 2.0 with Spacefast scopes. People use the authorization code flow; machines use client credentials.

Scopes: domains:write

Path parameters

Request body

Responses

201 Response for status 201

Any of:

Show properties
Hide properties

- `to` object required  
  Where the hostname redirects: an absolute URL, or a Space with an optional path.

Show properties
Hide properties

  - Any of:
    - object
    - `url` string <uri> required  
      Absolute URL the hostname redirects to.
    - object
    - `spaceId` string required  
      Space the hostname redirects to (`spc_` prefix).
      - min length 1
    - `path` string  
      Path to land on at the target Space. Omit to redirect to its root.
      - max length 255
  - `status` string required
    Allowed: `301`, `302`, `307`, `308`

Show properties
Hide properties

Show properties
Hide properties

Show properties
Hide properties

Show properties
Hide properties

Any of: - string - string - any - any - version string | any required

Show properties
Hide properties

Any of: - string - string - any - any

Show properties
Hide properties

Show properties
Hide properties

Array of object - type string required
Allowed: A, AAAA, CNAME, TXT, ALIAS - name string required
Record name, relative to the zone. - value string required
Exact value to set on the record. - ttl integer min -9007199254740991 · max 9007199254740991 - purpose string required
Why the record is needed: verification proves ownership, routing sends traffic to the Space, ssl allows certificate issuance. Allowed: verification, routing, ssl - lastCheckedAt string | any ISO 8601 timestamp of the last DNS check. Null before the first one.

Show properties
Hide properties

Any of: - string - string - any - any - lastVerifiedAt string | any ISO 8601 timestamp when this domain last proved DNS control. Null if it never has.

Show properties
Hide properties

Any of: - string - string - any - any - diagnostics object[]
Stable-coded observations about verification, delegation, and registration state. Absent when there are none.

Show properties
Hide properties

Array of object - code string required
Stable snake_case code for this diagnostic. - severity string required
How serious the diagnostic is. Allowed: info, warning, error - message string required
What happened, in a sentence a person can act on. - path string | any
File or artifact path the diagnostic refers to, with a line number when known, for example _headers:12. Absent when it applies to the whole resource.

Show properties
Hide properties

Any of: - string - string - any - any - provider string | any Upstream system that raised the diagnostic. Absent when Spacefast raised it.

Show properties
Hide properties

Any of: - string - string - any - any - details object | any
Machine-readable context keyed by the diagnostic code.

Show properties
Hide properties

Any of: - object - object - any - any - fix string | any
What to change to clear the diagnostic. Absent when there is no known fix.

Show properties
Hide properties

Any of: - string - string - any - any - retryable boolean | any True when repeating the same operation unchanged can clear the diagnostic.

Show properties
Hide properties

Any of: - boolean - boolean - any - any - hints object[]
Recovery guidance derived from the newest failed DNS operation. Absent when the last operation did not fail.

Show properties
Hide properties

Array of object - id string required
- code string required
Stable snake_case code naming the condition this hint was raised for. - severity string required Allowed: info, warning, error - painLevel string required Allowed: info, needs_attention, blocked, broken, dangerous - subjectFacet string required Allowed: dns_zone, registrar, hosting_binding, email, forwarding, provider_connection - subjectRef object required

Show properties
Hide properties

Show properties
Hide properties

Array of object - label string required - value string required - observedAt string matches ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:.\d+)?)?(?:Z))$ - source string required Allowed: provider_api, public_dns, registrar, stattic_db, operation, user_input - suggestions object[] required

Show properties
Hide properties

Array of object - label string required - description string required - action object required

Show properties
Hide properties

One of: - object - type string required - actionId string required - object - type string required - object - type string required - connectionId string required - object - type string required - url string required - object - type string required - retryAfter string required matches ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:.\d+)?)?(?:Z))$

  - `primary` boolean
  - `destructive` boolean
  - `docsUrl` string <uri>
  - `operationId` string
  - `requestId` string
  - `providerRequestId` string
  - `expiresAt` string <date-time>
  ISO 8601 timestamp after which this hint stops applying. Absent when it has no deadline.
  matches ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
- `createdAt` string <date-time> required
  ISO 8601 timestamp when the record was added to inventory.
- `updatedAt` string <date-time> required
  ISO 8601 timestamp when the record last changed.

Example Response

{
  "$schema": "http://example.com",
  "data": {
    "id": "string",
    "name": "string",
    "unicodeName": "string",
    "kind": "hostname",
    "wildcardEnabled": true,
    "spaceId": "string",
    "primary": true,
    "redirect": {
      "to": {
        "url": "http://example.com"
      },
      "status": 301
    },
    "derivedGroup": "string",
    "registrar": {
      "provider": "string",
      "status": "active",
      "expiresAt": "2019-08-24T14:15:22Z",
      "redemptionEndsAt": "2019-08-24T14:15:22Z",
      "autoRenew": true,
      "transferLock": true
    },
    "dns": {
      "managementKind": "unmanaged_external",
      "dnsMode": "authoritative",
      "provider": "string",
      "assignedNameservers": [
        "string"
      ],
      "observedNameservers": [
        "string"
      ],
      "snapshot": {
        "freshness": "fresh",
        "lastFetchedAt": "2019-08-24T14:15:22Z",
        "version": "string"
      },
      "lastOperation": {
        "id": "string",
        "kind": "string",
        "status": "queued",
        "updatedAt": "2019-08-24T14:15:22Z"
      }
    },
    "verification": {
      "status": "not_required",
      "requiredRecords": [
        {
          "type": "A",
          "name": "string",
          "value": "string",
          "ttl": -9007199254740991,
          "purpose": "verification"
        }
      ],
      "lastCheckedAt": "2019-08-24T14:15:22Z",
      "lastVerifiedAt": "2019-08-24T14:15:22Z",
      "diagnostics": [
        {
          "code": "string",
          "severity": "info",
          "message": "string",
          "path": "string",
          "provider": "infra",
          "details": {
            "property1": null,
            "property2": null
          },
          "fix": "string",
          "retryable": true
        }
      ]
    },
    "hints": [
      {
        "id": "string",
        "code": "string",
        "severity": "info",
        "painLevel": "info",
        "subjectFacet": "dns_zone",
        "subjectRef": {
          "domainId": "string",
          "zoneId": "string",
          "bindingId": "string",
          "connectionId": "string"
        },
        "owner": "stattic",
        "status": "active",
        "summary": "string",
        "description": "string",
        "impact": "string",
        "evidence": [
          {
            "label": "string",
            "value": "string",
            "observedAt": "2019-08-24T14:15:22Z",
            "source": "provider_api"
          }
        ],
        "suggestions": [
          {
            "label": "string",
            "description": "string",
            "action": {
              "type": "open_pending_action",
              "actionId": "string"
            },
            "primary": true,
            "destructive": true
          }
        ],
        "docsUrl": "http://example.com",
        "operationId": "string",
        "requestId": "string",
        "providerRequestId": "string",
        "expiresAt": "2019-08-24T14:15:22Z"
      }
    ],
    "createdAt": "2019-08-24T14:15:22Z",
    "updatedAt": "2019-08-24T14:15:22Z"
  },
  "operation": {
    "id": "string",
    "kind": "string",
    "status": "queued",
    "resources": [
      {
        "type": "string",
        "id": "string"
      }
    ],
    "progress": {
      "total": 9007199254740991,
      "completed": 9007199254740991,
      "failed": 9007199254740991
    },
    "diagnostics": [
      {
        "code": "string",
        "severity": "info",
        "message": "string",
        "path": "string",
        "provider": "infra",
        "details": {
          "property1": null,
          "property2": null
        },
        "fix": "string",
        "retryable": true
      }
    ],
    "createdAt": "2019-08-24T14:15:22Z",
    "finishedAt": "2019-08-24T14:15:22Z"
  }
}