cloadyDocs
API ReferenceEndpointsWorkspaces

Add a domain without an app

Adds a domain you own to the workspace before any app serves it. Its zone on Cloady's nameservers (ns1 and ns2.cloady.io) is created once the domain is proven yours: by the `verification` TXT record from getWorkspaceDomain (then verifyDomain), or by its nameservers already pointing at ns1 and ns2.cloady.io. Attach it to an app later with createDomain. Answers 409 `host_taken` when another workspace has the host, 409 `domain_claimed` when another workspace registered, verified or holds the zone of the domain it belongs to, 409 `host_reserved` for a name under cloady.io or cloady.com, and 400 `bad_domain` for a public suffix like co.uk. Needs the developer role.

POST
/api/workspaces/{workspaceSlug}/domains
AuthorizationBearer <token>

Personal API token (cldy_…)

In: header

Path Parameters

workspaceSlug*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/api/workspaces/string/domains" \  -H "Content-Type: application/json" \  -d '{    "host": "string"  }'
{  "domain": {    "id": "string",    "host": "string",    "isPrimary": true,    "redirectTo": "string",    "port": 0,    "app": {      "slug": "string",      "env": "production",      "region": "string"    },    "registration": {      "expiresAt": "string",      "autoRenew": true,      "nameservers": [        "string"      ]    },    "verified": true,    "zone": "string",    "createdAt": "string"  }}