Docs
On this page

The preview domain API lets you map your own apex domain (e.g. cliniciq.com) to sandbox preview URLs. When configured, sandboxes created under your tenant will be accessible at {sandbox-slug}.{your-domain} instead of the default *.sandbox.miosa.ai.


Endpoints

MethodPathDescription
GET/api/v1/tenant/preview-domainGet current domain and verification status
PUT/api/v1/tenant/preview-domainSet or replace the preview domain
POST/api/v1/tenant/preview-domain/verifyRecheck DNS verification
DELETE/api/v1/tenant/preview-domainRemove the custom domain

Get Preview Domain

GET /api/v1/tenant/preview-domain

Returns the configured domain and its DNS verification status.

Auth

Authorization: Bearer msk_...

Response - 200 OK (domain configured)

{
  "preview_domain": "cliniciq.com",
  "status": "configured",
  "dns_instructions": {
    "type": "CNAME",
    "name": "*.cliniciq.com",
    "value": "proxy.miosa.ai"
  }
}

Response - 200 OK (not configured)

{
  "preview_domain": null,
  "default_domain": "miosa.ai",
  "status": "not_configured",
  "dns_instructions": null
}
FieldTypeDescription
preview_domainstring|nullConfigured apex domain, or null
default_domainstringFallback domain used when no custom domain is set
statusstring"not_configured", "pending_dns", or "configured"
dns_instructionsobject|nullCNAME record to add at your DNS registrar

Set Preview Domain

PUT /api/v1/tenant/preview-domain

Sets or replaces the custom preview domain. DNS verification is asynchronous - status transitions from pending_dns to configured once the CNAME resolves correctly.

Request Body

FieldTypeRequiredDescription
preview_domainstringYesApex domain (e.g. "cliniciq.com")
{
  "preview_domain": "cliniciq.com"
}

Response - 200 OK

{
  "preview_domain": "cliniciq.com",
  "status": "pending_dns",
  "dns_status": "pending",
  "dns_instructions": {
    "type": "CNAME",
    "name": "*.cliniciq.com",
    "value": "proxy.miosa.ai"
  }
}

DNS Setup

Add a wildcard CNAME at your registrar:

TypeNameValue
CNAME* (or *.cliniciq.com)proxy.miosa.ai

Verify DNS

POST /api/v1/tenant/preview-domain/verify

Triggers an immediate DNS re-check. Returns the current verification status without waiting for the background poller.

Response - 200 OK

{
  "preview_domain": "cliniciq.com",
  "status": "configured",
  "dns_status": "verified"
}

Delete Preview Domain

DELETE /api/v1/tenant/preview-domain

Removes the custom domain. Sandbox preview URLs revert to *.sandbox.miosa.ai.

Response - 200 OK

{
  "preview_domain": null,
  "status": "removed"
}

Errors

StatusCodeCause
400preview_domain is requiredMissing body field
422invalid_domainProtocol prefix, wildcard, path, or subdomain detected
404tenant not foundTenant does not exist

Examples

Was this helpful?