Skip to content

Create a custom domain

POST
/api/v1/domains
curl --request POST \
--url https://api.deploybase.eu/api/v1/api/v1/domains \
--header 'Authorization: <Authorization>' \
--header 'Content-Type: application/json' \
--data '{ "connection_mode": "byo_dns", "domain": "example", "project_id": "example" }'

Creates a new custom domain for a project with DNS verification

Domain details

Media type application/json
object
connection_mode

ConnectionMode selects bring-your-own DNS (default) or managed DNS (deploybase nameservers). Empty defaults to byo_dns.

string
Allowed values: byo_dns managed_dns
domain
required
string
project_id
required
string

Created

Media type application/json
object
data
meta
object
request_id
string
timestamp
string
trace_id
string
data
object
bunny_dns_ns1
string
bunny_dns_ns2
string
bunny_dns_zone_id
integer
connection_mode
string
Allowed values: byo_dns managed_dns
created_at
string
deleted_at
string
domain
string
geo_countries
Array<string>
geo_mode

GeoMode + GeoCountries hold the CDN geo-filtering policy (BACK-210). GeoCountries is the set the customer chose (allow set or block set per GeoMode), NOT the inverted Bunny list; the block-list sent to Bunny is derived on the fly by ComputeBlockedCountries. Effective only when the domain is on a dedicated pull zone (UsesDedicatedPullZone()).

string
Allowed values: off allowlist blocklist
id
string
last_verification_attempt
string
ns_delegated_at
string
project_id
string
pull_zone_id

PullZoneID is the dedicated Bunny pull zone for this custom domain in the 1:1 architecture (BACK-197/198), set at creation. NULL only when the CDN isn’t configured (dev/mock), in which case the domain has no CDN serving and falls back to the shared-PZ DNS instructions (see PointingTarget).

integer
ssl_attempts

NOTE: the explicit column tag is REQUIRED — GORM’s default namer mangles “SSLAttempts” to “s_slattempts” (it treats the embedded “SLA” as a known initialism), which doesn’t match the ssl_attempts column created in migration 000055. Without it every domains write fails with column "s_slattempts" does not exist. The other SSL* fields don’t collide, so only this one needs the override.

integer
ssl_error
string
ssl_error_code

Machine-readable failure reason (SSLErrorCode); drives reason-specific UI guidance

string
ssl_issued_at
string
ssl_last_attempt_at
string
ssl_provisioning_started_at
string
ssl_status
string
Allowed values: pending provisioning issued failed
status
string
Allowed values: pending_verification verified failed awaiting_delegation
team_id
string
updated_at
string
verification_token
string
verified_at
string
Example
{
"data": {
"connection_mode": "byo_dns",
"geo_mode": "off",
"ssl_status": "pending",
"status": "pending_verification"
}
}

Bad Request

Media type application/json
object
code
string
details
error
string
meta
object
request_id
string
timestamp
string
trace_id
string
Example generated
{
"code": "example",
"details": "example",
"error": "example",
"meta": {
"request_id": "example",
"timestamp": "example",
"trace_id": "example"
}
}

Unauthorized

Media type application/json
object
code
string
details
error
string
meta
object
request_id
string
timestamp
string
trace_id
string
Example generated
{
"code": "example",
"details": "example",
"error": "example",
"meta": {
"request_id": "example",
"timestamp": "example",
"trace_id": "example"
}
}

Project not found

Media type application/json
object
code
string
details
error
string
meta
object
request_id
string
timestamp
string
trace_id
string
Example generated
{
"code": "example",
"details": "example",
"error": "example",
"meta": {
"request_id": "example",
"timestamp": "example",
"trace_id": "example"
}
}

Domain already exists

Media type application/json
object
code
string
details
error
string
meta
object
request_id
string
timestamp
string
trace_id
string
Example generated
{
"code": "example",
"details": "example",
"error": "example",
"meta": {
"request_id": "example",
"timestamp": "example",
"trace_id": "example"
}
}