Verify a domain - Spacefast Docs
Verify a domain
Checks public DNS for proof of control over the hostname, updates the verification state, and resyncs the Space serving it. Returns the domain and the runtime operation. Limited to 6 checks per hour per domain and 120 per hour per team.
POST /v1/domains/{domainId}/verify
Authorization
Authorization Bearer token · header required
Authorization: Bearer <key> with the Space key (sfc_ prefix) of an unclaimed Space. The same key is the fragment of the claim URL and the token in the Space's /_/<key> sign-in URL.
or
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
domainId string required
Responses
200 Response for status 200
$schema string
Canonical JSON Schema URL for this response body. The server also sends it in the Link: rel="describedby" response header.
data object required
idstring required Domain inventory record ID (dom_prefix).namestring required Canonical hostname in lowercase ASCII A-labels, punycoded per IDNA2008, with no trailing dot and no wildcard label.unicodeNamestring Unicode U-label form ofname. Absent when the two are identical.kindstring requiredapexwhennameequalsderivedGroup,hostnameotherwise. Server-derived; never accepted as input. Allowed:hostname,apexwildcardEnabledboolean required Whether wildcard hostnames may be derived under this record.spaceIdstring | any required Space this hostname serves (spc_prefix). Null while the record is inventory only. One Space per hostname; a Space may hold many.
primary boolean required
Whether the Space points its liveUrl at this hostname.
redirect object
Whole-host redirect this hostname answers with instead of serving. Absent when it serves.
toobject required Where the hostname redirects: an absolute URL, or a Space with an optional path.urlstringrequired Absolute URL the hostname redirects to. spaceIdstring required Space the hostname redirects to (spc_prefix).pathstring Path to land on at the target Space. Omit to redirect to its root.statusstring required Allowed:301,302,307,308
derivedGroupstring required Registrable domain ofnameunder the Public Suffix List. Server-computed; never accepted as input.registrarobject Registration state. Present only on apex records.providerstring Registrar the registration lives with, for examplewpcom. Absent whilemodeisexternal.statusstring Where the registration sits in its lifecycle.expiringis derived fromexpiresAtrather than stored, andexpiredkeeps serving intact untilredemptionEndsAtpasses. Allowed:active,pending_purchase,pending_transfer_in,expiring,expired,lockedexpiresAtstringISO 8601 timestamp when the registration lapses. Absent until the registrar reports one. redemptionEndsAtstringISO 8601 timestamp when the registrar closes the redemption window opened by expiry. Serving stays intact until then. autoRenewboolean Whether the registrar renews the domain before it expires. Absent when no registration record exists yet.transferLockboolean Whether the registrar refuses outbound transfers. Absent when no registration record exists yet.
dnsobject DNS hosting state. Present only on records that own their zone cut: the apex, or a hostname whose own nameservers are observed in public DNS.managementKindstring Who actually holds the zone:unmanaged_externalwith no credential or delegation,connected_providerthrough a linked provider account,registrar_dnson the Spacefast registrar,stattic_nameserversonce delegation lands on Spacefast nameservers. Allowed:unmanaged_external,connected_provider,registrar_dns,stattic_nameserversdnsModestringauthoritativewhen Spacefast answers for the zone,adapterwhen records are written to or observed on another DNS host. Derived frommanagementKind. Allowed:authoritative,adapter
providerstring DNS host that answers for the zone, for exampleroute53orcloudflare. Absent on an external zone with no provider connection attached.assignedNameserversstring[] Nameservers the registrar delegation has to point at. Present only whilemodeisstattic.observedNameserversstring[] Nameservers seen in public DNS at the last poll, in either mode. Absent until a poll observes any.snapshotobject Freshness of the cached record read from the connected provider. Present only once a provider zone is attached.freshnessstring required Allowed:fresh,stale,refresh_running,refresh_failed,never_fetched
lastFetchedAtstring| any required
version string | any required
Snapshot version string the provider returned. Null when it returns none.
lastOperationobject Newest DNS operation on this zone. Absent until one runs.idstring requiredkindstring requiredstatusstring required Allowed:queued,running,observing,succeeded,failed,canceledupdatedAtstringrequired
verificationobject required Proof-of-DNS-control state for this hostname.statusstring required Current proof of DNS control:not_requiredwhile the domain serves no Space,pendingonce it selects one,verifiedon a positive DNS signal,failedafter a check stops proving control. Afailedstatus never tears down serving on its own. Allowed:not_required,pending,verified,failed
requiredRecordsobject[] Records the caller still has to create to prove control and route traffic. Absent once the hostname serves, and while the domain serves no Space.typestring required Allowed:A,AAAA,CNAME,TXT,ALIASnamestring required Record name, relative to the zone.valuestring required Exact value to set on the record.ttlinteger min -9007199254740991 · max 9007199254740991purposestring required Why the record is needed:verificationproves ownership,routingsends traffic to the Space,sslallows certificate issuance. Allowed:verification,routing,ssllastCheckedAtstring| any ISO 8601 timestamp of the last DNS check. Null before the first one. lastVerifiedAtstring| any ISO 8601 timestamp when this domain last proved DNS control. Null if it never has. diagnosticsobject[] Stable-coded observations about verification, delegation, and registration state. Absent when there are none.codestring requiredseveritystring required Allowed:info,warning,errormessagestring required What happened, in a sentence a person can act on.pathstring | 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.
providerstring | any Upstream system that raised the diagnostic. Absent when Spacefast raised it.detailsobject | any Machine-readable context keyed by the diagnostic code.fixstring | any What to change to clear the diagnostic. Absent when there is no known fix.retryableboolean | any True when repeating the same operation unchanged can clear the diagnostic.hintsobject[] Recovery guidance derived from the newest failed DNS operation. Absent when the last operation did not fail.idstring requiredcodestring requiredseveritystring required Allowed:info,warning,errorpainLevelstring required Allowed:info,needs_attention,blocked,broken,dangeroussubjectFacetstring required Allowed:dns_zone,registrar,hosting_binding,email,forwarding,provider_connectionsubjectRefobject requireddomainIdstring requiredzoneIdstringbindingIdstringconnectionIdstring
ownerstring required Who has to move next.statticis Spacefast itself,waitingmeans nobody acts until a timer or an external system settles. Allowed:stattic,user,registrar,provider,support,waitingstatusstring required Allowed:active,waiting,running,resolved,dismissedsummarystring requireddescriptionstring requiredimpactstring requiredevidenceobject[] requiredlabelstring requiredvaluestring requiredobservedAtstringmatches ^(?:(?:\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))$ sourcestring required Allowed:provider_api,public_dns,registrar,stattic_db,operation,user_input
suggestionsobject[] requiredlabelstring requireddescriptionstring requiredactionobject required- One of:
typestring requiredactionIdstring requiredrecordsobject[] requiredtypestring required Allowed:A,AAAA,CNAME,TXT,ALIASnamestring required Record name, relative to the zone.valuestring required Exact value to set on the record.ttlinteger min -9007199254740991 · max 9007199254740991
targetstring requiredconnectionIdstring requiredurlstringrequired retryAfterstringrequired 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))$
- One of:
primarybooleandestructivebooleandocsUrlstringoperationIdstringrequestIdstringproviderRequestIdstringexpiresAtstringISO 8601 timestamp after which this hint stops applying. Absent when it has no deadline. createdAtstringrequired ISO 8601 timestamp when the record was added to inventory. updatedAtstringrequired ISO 8601 timestamp when the record last changed.
operationobject | any required Background operation still running after this call. Null when all work finished before the response.idstring requiredkindstring requiredstatusstring required Allowed:queued,running,succeeded,failed,canceledresourcesobject[] requiredtypestring requiredidstring required
progressobjecttotalinteger required min 0 · max 9007199254740991completedinteger required min 0 · max 9007199254740991failedinteger required min 0 · max 9007199254740991
diagnosticsobject[]codestring requiredseveritystring required Allowed:info,warning,errormessagestring requiredpathstring | anyproviderstring | anydetailsobject | anyfixstring | anyretryableboolean | any
createdAtstringrequired finishedAtstring
Try it
Server
Base URL https://api.spacefast.com
Custom base URL Overrides the selected server when set.
Authorization
Bearer token Remember on this device Include my values in samples
Parameters
domainId path*
Send
Request
cURL
curl -X POST "https://api.spacefast.com/v1/domains/string/verify" \
-H "Authorization: Bearer YOUR_TOKEN"
JavaScript
const response = await fetch("https://api.spacefast.com/v1/domains/string/verify", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_TOKEN"
}
});
Python
import requests
response = requests.post(
"https://api.spacefast.com/v1/domains/string/verify",
headers={
"Authorization": "Bearer YOUR_TOKEN"
},
)
Response
200 default
{
"$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"
}
}
Error Response
{
"$schema": "http://example.com",
"type": "string",
"title": "string",
"status": -9007199254740991,
"detail": "string",
"code": "string",
"pointer": "string",
"details": {
"property1": null,
"property2": null
},
"suggestions": [
"string"
],
"next": [
"string"
],
"requestId": "string"
}