Overview

The Domains API manages the single custom domain attached to a project. HolyDocs always keeps the default *.holydocs.com subdomain available; the custom domain is an additional hostname with DNS verification and Cloudflare-managed SSL.

Base path: https://api.holydocs.com/api/v1/domains/:projectId

Get Domain Configuration

bash
GET /api/v1/domains/:projectId
bash
curl "https://api.holydocs.com/api/v1/domains/$PROJECT_ID" \ -H "Authorization: Bearer $HOLYDOCS_API_KEY"

Response

json
{ "data": { "subdomain": "my-project.holydocs.com", "customDomain": "docs.mycompany.com", "cnameTarget": "proxy.holydocs.com", "analysis": { "hostname": "docs.mycompany.com", "cnameTarget": "proxy.holydocs.com", "currentCname": "proxy.holydocs.com", "cnameMatchesTarget": true, "hostnameId": "cf_hostname_123", "hostnameStatus": "active", "sslStatus": "active", "hostnameReady": true, "ownershipVerification": null } }}

Response Fields

FieldTypeDescription
subdomainstringDefault HolyDocs subdomain
customDomainstring | nullConfigured custom domain, if any
cnameTargetstringDNS target to point your CNAME or flattened ALIAS at
analysisobject | nullCurrent DNS and hostname-registration state

analysis Fields

FieldTypeDescription
hostnamestringThe custom hostname being analyzed
currentCnamestring | nullCurrent DNS CNAME result
cnameMatchesTargetbooleanWhether DNS points at HolyDocs
hostnameIdstring | nullCloudflare custom-hostname ID, when registered
hostnameStatusstring | nullCloudflare hostname state, such as pending or active
sslStatusstring | nullSSL/DCV state
hostnameReadybooleantrue when the hostname is active and SSL is active
ownershipVerificationobject | nullCloudflare ownership-verification details when required

Set Custom Domain

Configure or replace the custom domain on a project.

bash
PUT /api/v1/domains/:projectId

Request Body

json
{ "customDomain": "docs.mycompany.com"}

Validation

  • Lowercase alphanumeric characters and hyphens only
  • Valid domain segments separated by dots
  • Regex rule: start with a lowercase alphanumeric character, allow internal hyphens, and repeat dot-separated labels.
bash
curl -X PUT "https://api.holydocs.com/api/v1/domains/$PROJECT_ID" \ -H "Authorization: Bearer $HOLYDOCS_API_KEY" \ -H "Content-Type: application/json" \ -d '{"customDomain":"docs.mycompany.com"}'

Response

Returns the same shape as GET /domains/:projectId, including the latest analysis.

When Cloudflare SaaS bindings are configured on the backend, HolyDocs attempts to register the hostname immediately. If DNS is not pointed yet, analysis.hostnameReady remains false until verification succeeds.

Analyze Domain

Force a fresh DNS and hostname-state lookup without changing the domain.

bash
POST /api/v1/domains/:projectId/analyze
bash
holydocs api post /domains/$PROJECT_ID/analyze

Verify Domain

Force a verification pass. If DNS already points at HolyDocs and the hostname has not been registered yet, HolyDocs attempts registration during this call.

bash
POST /api/v1/domains/:projectId/verify
bash
curl -X POST "https://api.holydocs.com/api/v1/domains/$PROJECT_ID/verify" \ -H "Authorization: Bearer $HOLYDOCS_API_KEY"

Domain Connect Launch

If the domain is managed by Cloudflare DNS, generate a signed Domain Connect launch URL that opens the one-click DNS flow in the Cloudflare dashboard.

bash
POST /api/v1/domains/:projectId/domain-connect
bash
holydocs api post /domains/$PROJECT_ID/domain-connect

Remove Custom Domain

bash
DELETE /api/v1/domains/:projectId
bash
curl -X DELETE "https://api.holydocs.com/api/v1/domains/$PROJECT_ID" \ -H "Authorization: Bearer $HOLYDOCS_API_KEY"

Error Codes

CodeStatusDescription
NOT_FOUND404Project not found
VALIDATION_ERROR400Invalid hostname format or no custom domain configured
ALREADY_EXISTS409Domain is already attached to another project
FEATURE_NOT_AVAILABLE403Your plan cannot attach another custom domain
Ask a question... ⌘I