Syndai Docs

Add a custom domain to an app

POST
/api/v1/external/coding/customers/{customer_id}/apps/{publication_id}/domain

Attach hostname (pasted URLs and bare domains are accepted: bakery.com becomes www.bakery.com). One address per site; the same address again is a no-op and a failed one is retried. Refusals: invalid_hostname, reserved_hostname, domain_exists (remove the current one first), hostname_taken (another site in this workspace), hostname_in_use (a site in this workspace's SEO tab), hostname_contested (another workspace has the address or removed it in the last 30 days: the problem's records name the TXT _syndai.<address> that proves it is this workspace's, to add at the DNS host (dns_provider / dns_url say where); once DNS answers it, adding again takes the address over). Refusals are 409 or 422 with that code; 503 domains_not_configured, 502 cloudflare_unavailable. Needs coding:apps:publish.

Authorization

CustomerApiKey
headerAuthorizationBearer <API Key>

Customer API key sent as a bearer token

Path Parameters

customer_id*string
Formatuuid
publication_id*string
Formatuuid

Request Body

application/json
  1. body
hostname*string

Response Body

Request fulfilled, document follows

application/json
  1. response
delete_records?array<>
dns_provider?string|null
dns_url?string|null
domain_connect_url?string|null
hostname?string|null
records*array<>
status*string
Example Request
curl -X POST 'https://api.syndai.ai/api/v1/external/coding/customers/497f6eca-6276-4993-bfeb-53cbbbba6f08/apps/497f6eca-6276-4993-bfeb-53cbbbba6f08/domain' \  -H 'Content-Type: application/json' \  -d '{  "hostname": "string"}'
Example Response
{  "delete_records": [    {      "name": "string",      "type": "string",      "value": "string"    }  ],  "dns_provider": "string",  "dns_url": "string",  "domain_connect_url": "string",  "hostname": "string",  "records": [    {      "name": "string",      "type": "string",      "value": "string"    }  ],  "status": "string"}