ZeroCopyZeroCopy
ReferenceManagement API

Add a domain

POST
/domains

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.

Authorization

managementKey
headerAuthorizationBearer <zc_mgmt_>

Header Parameters

Idempotency-Key?string

Makes a retry return the first successful response instead of adding another domain

Length1 <= length <= 255

Request Body

application/json
  1. body
hostname*string
Match^(?!.*\.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])?$
Lengthlength <= 253
target*string
Value in"sol""fra""ams""lon""nyc""lax""tyo"

Response Body

The domain and its DNS records

application/json
  1. 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
Match^(?!.*\.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])?$
Lengthlength <= 253
target*string
Value in"sol""fra""ams""lon""nyc""lax""tyo"
products*array<string>
status*string
Value in"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*string

RFC 3339 time

Formatdate-time
updated_at*string

RFC 3339 time

Formatdate-time
dns_records*array<never>
Items2 <= items <= 2
Example request
// 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(())
}
Example response
{
  "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
    }
  ]
}