Add a domain
Requires the partner:write scope. Registers a domain for the enrolled partner team with an initial status of pending. Domains can be prepared before the team's vanity tip accounts are live. hostname must be a lowercase ASCII DNS name with at least three labels, at most 253 characters overall and at most 63 per label. Names under zerocopy.sh are reserved; schemes, ports, paths and wildcard domains are invalid. target is required. The domain inherits the team's partner products. The team can have up to 20 domains across all statuses; creation at the limit returns 409 domain_limit. A duplicate domain within the team returns 409 hostname_taken. Claims from several teams can coexist until DNS verification. The first team to verify wins the domain; other claims are deleted and subsequently return 404.
managementKeyAuthorizationBearer <zc_mgmt_>Idempotency-Key?stringMakes a retry return the first successful response instead of adding another domain
1 <= length <= 255application/json- body
hostname*string^(?!.*\.zerocopy\.sh$)(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.){2,}[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$length <= 253target*string"sol""fra""ams""lon""nyc""lax""tyo"The domain and its DNS records
application/json- response
Both dns_records have type CNAME. The sending record points to sol.zerocopy.sh or <metro>.sol.zerocopy.sh. The challenge record value is null while preparing, then contains the assigned name under acme.zerocopy.sh. See White label domains for setup.
hostname*string^(?!.*\.zerocopy\.sh$)(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.){2,}[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$length <= 253target*string"sol""fra""ams""lon""nyc""lax""tyo"products*array<string>status*string"pending""awaiting_dns""active""failed"acme_dns_fulldomain*|Assigned challenge target, or null while preparing
not_after*|Certificate expiry timestamp, or null before issuance
last_error*|Setup or renewal error, or null
created_at*stringRFC 3339 time
date-timeupdated_at*stringRFC 3339 time
date-timedns_records*array<never>2 <= items <= 2// src/bin/management_create_domain.rs
// Builds on the example project (/reference/json-rpc#example-project).
use swqos_examples::swqos::{Result, required};
use serde::Serialize;
#[derive(Serialize)]
struct DomainCreate {
hostname: String,
target: &'static str,
}
#[tokio::main]
async fn main() -> Result<()> {
let payload = DomainCreate { hostname: required("DOMAIN_HOSTNAME")?, target: "sol" };
let endpoint = reqwest::Url::parse("https://console.zerocopy.sh/api/v1/domains")?;
let request = reqwest::Client::new()
.post(endpoint)
.bearer_auth(required("MANAGEMENT_API_KEY")?);
// Reuse this key and the same body when retrying this creation attempt.
let request = request.header("Idempotency-Key", required("DOMAIN_REQUEST_ID")?);
let request = request.json(&payload);
let response = request.send().await?;
let status = response.status();
let request_id = response.headers().get("Request-Id")
.map(|value| value.to_str()).transpose()?.unwrap_or("<missing>").to_owned();
if let Some(etag) = response.headers().get("ETag") {
eprintln!("ETag: {}", etag.to_str()?);
}
let body = response.text().await?;
if !status.is_success() {
return Err(format!("HTTP {status}; Request-Id: {request_id}; {body}").into());
}
eprintln!("Request-Id: {request_id}");
println!("{body}");
Ok(())
}{
"hostname": "send.partner.example",
"target": "sol",
"products": [
"send"
],
"status": "pending",
"acme_dns_fulldomain": null,
"not_after": null,
"last_error": null,
"created_at": "2026-11-12T09:00:00Z",
"updated_at": "2026-11-12T09:00:00Z",
"dns_records": [
{
"type": "CNAME",
"name": "send.partner.example",
"value": "sol.zerocopy.sh"
},
{
"type": "CNAME",
"name": "_acme-challenge.send.partner.example",
"value": null
}
]
}