curl -X POST "https://app.runtm.com/api/v0/deployments/dep_abc123xyz/domains" \
-H "Authorization: Bearer runtm_xxx" \
-H "Content-Type: application/json" \
-d '{"hostname": "api.example.com"}'
import requests
response = requests.post(
"https://app.runtm.com/api/v0/deployments/dep_abc123xyz/domains",
headers={
"Authorization": "Bearer runtm_xxx",
"Content-Type": "application/json"
},
json={"hostname": "api.example.com"}
)
data = response.json()
print(f"Domain: {data['hostname']}")
print(f"Certificate: {data['certificate_status']}")
for record in data["dns_records"]:
print(f"Add {record['record_type']} record: {record['name']} -> {record['value']}")
const response = await fetch(
"https://app.runtm.com/api/v0/deployments/dep_abc123xyz/domains",
{
method: "POST",
headers: {
"Authorization": "Bearer runtm_xxx",
"Content-Type": "application/json"
},
body: JSON.stringify({
hostname: "api.example.com"
})
}
);
const data = await response.json();
console.log(`Domain: ${data.hostname}`);
console.log(`Certificate: ${data.certificate_status}`);
data.dns_records.forEach(record => {
console.log(`Add ${record.record_type} record: ${record.name} -> ${record.value}`);
});
{
"hostname": "api.example.com",
"configured": false,
"certificate_status": "pending",
"dns_records": [
{
"record_type": "CNAME",
"name": "api",
"value": "my-api-abc123.fly.dev"
}
],
"check_url": "https://app.runtm.com/api/v0/deployments/dep_abc123xyz/domains/api.example.com"
}
{
"detail": {
"error": "Cannot add domain to deployment in 'building' state",
"recovery_hint": "Wait for the deployment to be ready, then try again."
}
}
Domains
Add Domain
Add a custom domain to a deployment
POST
/
v0
/
deployments
/
{deployment_id}
/
domains
curl -X POST "https://app.runtm.com/api/v0/deployments/dep_abc123xyz/domains" \
-H "Authorization: Bearer runtm_xxx" \
-H "Content-Type: application/json" \
-d '{"hostname": "api.example.com"}'
import requests
response = requests.post(
"https://app.runtm.com/api/v0/deployments/dep_abc123xyz/domains",
headers={
"Authorization": "Bearer runtm_xxx",
"Content-Type": "application/json"
},
json={"hostname": "api.example.com"}
)
data = response.json()
print(f"Domain: {data['hostname']}")
print(f"Certificate: {data['certificate_status']}")
for record in data["dns_records"]:
print(f"Add {record['record_type']} record: {record['name']} -> {record['value']}")
const response = await fetch(
"https://app.runtm.com/api/v0/deployments/dep_abc123xyz/domains",
{
method: "POST",
headers: {
"Authorization": "Bearer runtm_xxx",
"Content-Type": "application/json"
},
body: JSON.stringify({
hostname: "api.example.com"
})
}
);
const data = await response.json();
console.log(`Domain: ${data.hostname}`);
console.log(`Certificate: ${data.certificate_status}`);
data.dns_records.forEach(record => {
console.log(`Add ${record.record_type} record: ${record.name} -> ${record.value}`);
});
{
"hostname": "api.example.com",
"configured": false,
"certificate_status": "pending",
"dns_records": [
{
"record_type": "CNAME",
"name": "api",
"value": "my-api-abc123.fly.dev"
}
],
"check_url": "https://app.runtm.com/api/v0/deployments/dep_abc123xyz/domains/api.example.com"
}
{
"detail": {
"error": "Cannot add domain to deployment in 'building' state",
"recovery_hint": "Wait for the deployment to be ready, then try again."
}
}
Add a custom domain to a deployment. Automatically provisions an SSL certificate via Let’s Encrypt.
Path Parameters
string
required
The deployment ID (e.g.,
dep_abc123xyz)Request Body
string
required
The custom domain hostname (e.g.,
api.example.com)Response
string
The configured hostname
boolean
Whether the domain is fully configured
string
Certificate status:
pending, issued, failedarray
string
URL to check domain status
curl -X POST "https://app.runtm.com/api/v0/deployments/dep_abc123xyz/domains" \
-H "Authorization: Bearer runtm_xxx" \
-H "Content-Type: application/json" \
-d '{"hostname": "api.example.com"}'
import requests
response = requests.post(
"https://app.runtm.com/api/v0/deployments/dep_abc123xyz/domains",
headers={
"Authorization": "Bearer runtm_xxx",
"Content-Type": "application/json"
},
json={"hostname": "api.example.com"}
)
data = response.json()
print(f"Domain: {data['hostname']}")
print(f"Certificate: {data['certificate_status']}")
for record in data["dns_records"]:
print(f"Add {record['record_type']} record: {record['name']} -> {record['value']}")
const response = await fetch(
"https://app.runtm.com/api/v0/deployments/dep_abc123xyz/domains",
{
method: "POST",
headers: {
"Authorization": "Bearer runtm_xxx",
"Content-Type": "application/json"
},
body: JSON.stringify({
hostname: "api.example.com"
})
}
);
const data = await response.json();
console.log(`Domain: ${data.hostname}`);
console.log(`Certificate: ${data.certificate_status}`);
data.dns_records.forEach(record => {
console.log(`Add ${record.record_type} record: ${record.name} -> ${record.value}`);
});
{
"hostname": "api.example.com",
"configured": false,
"certificate_status": "pending",
"dns_records": [
{
"record_type": "CNAME",
"name": "api",
"value": "my-api-abc123.fly.dev"
}
],
"check_url": "https://app.runtm.com/api/v0/deployments/dep_abc123xyz/domains/api.example.com"
}
{
"detail": {
"error": "Cannot add domain to deployment in 'building' state",
"recovery_hint": "Wait for the deployment to be ready, then try again."
}
}
The deployment must be in
ready state before adding a custom domain.1
Add the domain
Call this endpoint to register the domain
2
Configure DNS
Add the CNAME record at your domain registrar
3
Wait for certificate
Certificate is issued automatically after DNS propagates (usually 1-5 minutes)