Documentation
Account and keys
View .mdOpenAPI

Claim a workspace domain

POSThttps://weights.fyi/run/v1/workspaces/domainsscope: manage
text
POST https://weights.fyi/run/v1/workspaces/domains
Authorization: Bearer <token>                    scope: manage
Content-Type: application/json
Available since
2026-11-15 workspace domains: included in this build; see What is live for deployment status.
Answer time
synchronous: one database write.

Claims an organisation email domain for the calling workspace and returns the DNS TXT record to publish before calling POST /v1/workspaces/domains/{domain}/verify. Public mailbox domains and special-use names are refused.

Sending the same domain again is safe: it keeps the issued challenge token so a record already published in DNS stays valid, updates join_mode if changed, and answers 200.

Request

NameWhereRequiredMeaning
AuthorizationheaderyesBearer and a token with manage on the workspace.
domainbodyyesThe organisation's email domain, such as awow.io.
join_modebodynoinvite_only (default), discoverable or auto_join.

Return value

201 Created when newly claimed, 200 OK when already claimed:

FieldMeaning
domain, status, join_modeLower-case domain, pending or verified, and the chosen admission mode.
created_at, verified_at, last_checked_atTimestamps in UTC (null before verification).
dns_recordCanonical TXT record (name, type, value) to publish at _zyxio-domain-challenge.<domain>.
accepted_recordsEvery TXT name and value accepted, including shared _weights-challenge and _rattle-challenge labels.

Errors

StatusCodeWhen it happensWhat to do
400invalid_request, invalid_json, invalid_domain, public_email_domain_refusedMalformed body, invalid hostname, or a public mailbox domain.Pass an organisation DNS domain you control.
401unauthorized, invalid_token, token_revoked, token_expiredNo token, or one that does not work.Use a valid token.
403scope_required, workspace_role_required, operator_workspace_domainToken lacks manage, caller is not an owner or admin, or workspace is restricted to invite_only.Use an owner or admin manage token on a team workspace.

Examples

sh
curl -s -X POST https://weights.fyi/run/v1/workspaces/domains \
  -H "Authorization: Bearer $WEIGHTS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"domain": "awow.io", "join_mode": "discoverable"}'
json
{"domain": "awow.io", "status": "pending", "join_mode": "discoverable", "created_at": "2026-11-15T10:00:00Z", "verified_at": null, "last_checked_at": null, "dns_record": {"name": "_zyxio-domain-challenge.awow.io", "type": "TXT", "value": "zyxio-domain-verify=a1b2c3d4a1b2c3d4a1b2c3d4a1b2c3d4a1b2c3d4a1b2c3d4a1b2c3d4a1b2c3d4"}}

History

  • 2026-11-15 workspace domains: added.

See also