Skip to main content
Prisma Documentation Docs

Search documentation

Type to search this documentation.

Create a custom domain

POST/v1/services/{serviceId}/domainsCreate a custom domain

⚠️ Experimental endpoint: this API is in active development and may change at any time without notice. ⚠️

Registers a custom hostname for the service. The hostname must CNAME to the regional switchboard target before DNS verification can succeed. Returns 429 if the service has reached its domain quota (default: 3).

Parameters

serviceIdstringpathrequired

pattern ^(cps_)?([cC][^\s-]{8,}|[a-z0-9]+)$

Request body

application/json
object
hostnamestringrequired

maxLength 253 · minLength 1 · pattern ^(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)*[a-z]{2,}$

Example request
{
  "hostname": "string"
}

Responses

200Custom domain already registered on this service.application/json
object
dataobjectrequired
Show child attributes
appIdstringrequired
certExpiresAtnull | string · date-timerequired
computeServiceIdstringrequired

Deprecated: use `appId` instead.

createdAtstring · date-timerequired
dnsRecordsarray of objectrequired
Show child attributes
Show array items
namestringrequired
ttlnull | numberrequired
typestringrequired

const "CNAME"

valuestringrequired
failureCategorynull | stringrequired

one of "dns", "acme", "storage", "unknown", null

failureReasonnull | stringrequired
foundryStatusstringrequired
hostnamestringrequired
idstringrequired
statusstringrequired

one of "pending_dns", "verifying", "verified_routing_blocked", "provisioning_tls", "active", "failed", "removing"

typestringrequired

const "custom-domain"

updatedAtstring · date-timerequired
urlstring · urirequired
Example response
{
  "data": {
    "appId": "string",
    "certExpiresAt": "2026-06-09T00:00:00Z",
    "computeServiceId": "string",
    "createdAt": "2026-06-09T00:00:00Z",
    "dnsRecords": [
      {
        "name": "string",
        "ttl": 0,
        "type": "CNAME",
        "value": "string"
      }
    ],
    "failureCategory": "acme",
    "failureReason": "string",
    "foundryStatus": "string",
    "hostname": "string",
    "id": "string",
    "status": "active",
    "type": "custom-domain",
    "updatedAt": "2026-06-09T00:00:00Z",
    "url": "https://example.com"
  }
}
201Custom domain created.application/json
object
dataobjectrequired
Show child attributes
appIdstringrequired
certExpiresAtnull | string · date-timerequired
computeServiceIdstringrequired

Deprecated: use `appId` instead.

createdAtstring · date-timerequired
dnsRecordsarray of objectrequired
Show child attributes
Show array items
namestringrequired
ttlnull | numberrequired
typestringrequired

const "CNAME"

valuestringrequired
failureCategorynull | stringrequired

one of "dns", "acme", "storage", "unknown", null

failureReasonnull | stringrequired
foundryStatusstringrequired
hostnamestringrequired
idstringrequired
statusstringrequired

one of "pending_dns", "verifying", "verified_routing_blocked", "provisioning_tls", "active", "failed", "removing"

typestringrequired

const "custom-domain"

updatedAtstring · date-timerequired
urlstring · urirequired
Example response
{
  "data": {
    "appId": "string",
    "certExpiresAt": "2026-06-09T00:00:00Z",
    "computeServiceId": "string",
    "createdAt": "2026-06-09T00:00:00Z",
    "dnsRecords": [
      {
        "name": "string",
        "ttl": 0,
        "type": "CNAME",
        "value": "string"
      }
    ],
    "failureCategory": "acme",
    "failureReason": "string",
    "foundryStatus": "string",
    "hostname": "string",
    "id": "string",
    "status": "active",
    "type": "custom-domain",
    "updatedAt": "2026-06-09T00:00:00Z",
    "url": "https://example.com"
  }
}
400Invalid hostname or DNS verification failed.application/json
object
errorobjectrequired
Show child attributes
codestringrequired
hintstring
messagestringrequired
Example response
{
  "error": {
    "code": "string",
    "hint": "string",
    "message": "string"
  }
}
401Missing or invalid authorization token.application/json
object
errorobjectrequired
Show child attributes
codestringrequired
hintstring
messagestringrequired
Example response
{
  "error": {
    "code": "string",
    "hint": "string",
    "message": "string"
  }
}
403Insufficient permissions.application/json
object
errorobjectrequired
Show child attributes
codestringrequired
hintstring
messagestringrequired
Example response
{
  "error": {
    "code": "string",
    "hint": "string",
    "message": "string"
  }
}
404Service not found.application/json
object
errorobjectrequired
Show child attributes
codestringrequired
hintstring
messagestringrequired
Example response
{
  "error": {
    "code": "string",
    "hint": "string",
    "message": "string"
  }
}
409Hostname already registered.application/json
object
errorobjectrequired
Show child attributes
codestringrequired
hintstring
messagestringrequired
Example response
{
  "error": {
    "code": "string",
    "hint": "string",
    "message": "string"
  }
}
413Request body exceeds this endpoint's size cap.application/json
object
errorobjectrequired
Show child attributes
codestringrequired
hintstring
messagestringrequired
Example response
{
  "error": {
    "code": "string",
    "hint": "string",
    "message": "string"
  }
}
422Service has no promoted deployment.application/json
object
errorobjectrequired
Show child attributes
codestringrequired
hintstring
messagestringrequired
Example response
{
  "error": {
    "code": "string",
    "hint": "string",
    "message": "string"
  }
}
429Domain quota exceeded or rate limit exceeded.application/json
object
errorobjectrequired
Show child attributes
codestringrequired
hintstring
messagestringrequired
Example response
{
  "error": {
    "code": "string",
    "hint": "string",
    "message": "string"
  }
}
Documentation menu