curl -X GET "https://app.runtm.com/api/v0/deployments/dep_abc123xyz/domains/api.example.com" \
-H "Authorization: Bearer runtm_xxx"
import requests
import time
def wait_for_certificate(deployment_id: str, hostname: str):
"""Poll until certificate is issued."""
while True:
response = requests.get(
f"https://app.runtm.com/api/v0/deployments/{deployment_id}/domains/{hostname}",
headers={"Authorization": "Bearer runtm_xxx"}
)
data = response.json()
if data["certificate_status"] == "issued":
print(f"✓ Certificate issued for {hostname}")
return True
elif data["certificate_status"] == "failed":
print(f"✗ Certificate failed: {data.get('error')}")
return False
print(f"Certificate pending... (check DNS configuration)")
time.sleep(30)
wait_for_certificate("dep_abc123xyz", "api.example.com")
async function waitForCertificate(deploymentId, hostname) {
while (true) {
const response = await fetch(
`https://app.runtm.com/api/v0/deployments/${deploymentId}/domains/${hostname}`,
{
headers: {
"Authorization": "Bearer runtm_xxx"
}
}
);
const data = await response.json();
if (data.certificate_status === "issued") {
console.log(`✓ Certificate issued for ${hostname}`);
return true;
} else if (data.certificate_status === "failed") {
console.log(`✗ Certificate failed: ${data.error}`);
return false;
}
console.log("Certificate pending... (check DNS configuration)");
await new Promise(r => setTimeout(r, 30000));
}
}
waitForCertificate("dep_abc123xyz", "api.example.com");
{
"hostname": "api.example.com",
"configured": false,
"certificate_status": "pending",
"dns_records": [
{
"record_type": "CNAME",
"name": "api",
"value": "my-api-abc123.fly.dev"
}
],
"error": null
}
{
"hostname": "api.example.com",
"configured": true,
"certificate_status": "issued",
"dns_records": [
{
"record_type": "CNAME",
"name": "api",
"value": "my-api-abc123.fly.dev"
}
],
"error": null
}
{
"hostname": "api.example.com",
"configured": false,
"certificate_status": "failed",
"dns_records": [
{
"record_type": "CNAME",
"name": "api",
"value": "my-api-abc123.fly.dev"
}
],
"error": "DNS verification failed. Ensure CNAME record is configured correctly."
}
Domains
Get Domain Status
Check the status of a custom domain
GET
/
v0
/
deployments
/
{deployment_id}
/
domains
/
{hostname}
curl -X GET "https://app.runtm.com/api/v0/deployments/dep_abc123xyz/domains/api.example.com" \
-H "Authorization: Bearer runtm_xxx"
import requests
import time
def wait_for_certificate(deployment_id: str, hostname: str):
"""Poll until certificate is issued."""
while True:
response = requests.get(
f"https://app.runtm.com/api/v0/deployments/{deployment_id}/domains/{hostname}",
headers={"Authorization": "Bearer runtm_xxx"}
)
data = response.json()
if data["certificate_status"] == "issued":
print(f"✓ Certificate issued for {hostname}")
return True
elif data["certificate_status"] == "failed":
print(f"✗ Certificate failed: {data.get('error')}")
return False
print(f"Certificate pending... (check DNS configuration)")
time.sleep(30)
wait_for_certificate("dep_abc123xyz", "api.example.com")
async function waitForCertificate(deploymentId, hostname) {
while (true) {
const response = await fetch(
`https://app.runtm.com/api/v0/deployments/${deploymentId}/domains/${hostname}`,
{
headers: {
"Authorization": "Bearer runtm_xxx"
}
}
);
const data = await response.json();
if (data.certificate_status === "issued") {
console.log(`✓ Certificate issued for ${hostname}`);
return true;
} else if (data.certificate_status === "failed") {
console.log(`✗ Certificate failed: ${data.error}`);
return false;
}
console.log("Certificate pending... (check DNS configuration)");
await new Promise(r => setTimeout(r, 30000));
}
}
waitForCertificate("dep_abc123xyz", "api.example.com");
{
"hostname": "api.example.com",
"configured": false,
"certificate_status": "pending",
"dns_records": [
{
"record_type": "CNAME",
"name": "api",
"value": "my-api-abc123.fly.dev"
}
],
"error": null
}
{
"hostname": "api.example.com",
"configured": true,
"certificate_status": "issued",
"dns_records": [
{
"record_type": "CNAME",
"name": "api",
"value": "my-api-abc123.fly.dev"
}
],
"error": null
}
{
"hostname": "api.example.com",
"configured": false,
"certificate_status": "failed",
"dns_records": [
{
"record_type": "CNAME",
"name": "api",
"value": "my-api-abc123.fly.dev"
}
],
"error": "DNS verification failed. Ensure CNAME record is configured correctly."
}
Get the current status of a custom domain, including certificate status and DNS configuration.
Path Parameters
string
required
The deployment ID (e.g.,
dep_abc123xyz)string
required
The custom domain hostname (e.g.,
api.example.com)Response
string
The configured hostname
boolean
Whether the domain is fully configured and working
string
Certificate status:
pending, issued, failedarray
Required DNS records
string
Error message if configuration failed
curl -X GET "https://app.runtm.com/api/v0/deployments/dep_abc123xyz/domains/api.example.com" \
-H "Authorization: Bearer runtm_xxx"
import requests
import time
def wait_for_certificate(deployment_id: str, hostname: str):
"""Poll until certificate is issued."""
while True:
response = requests.get(
f"https://app.runtm.com/api/v0/deployments/{deployment_id}/domains/{hostname}",
headers={"Authorization": "Bearer runtm_xxx"}
)
data = response.json()
if data["certificate_status"] == "issued":
print(f"✓ Certificate issued for {hostname}")
return True
elif data["certificate_status"] == "failed":
print(f"✗ Certificate failed: {data.get('error')}")
return False
print(f"Certificate pending... (check DNS configuration)")
time.sleep(30)
wait_for_certificate("dep_abc123xyz", "api.example.com")
async function waitForCertificate(deploymentId, hostname) {
while (true) {
const response = await fetch(
`https://app.runtm.com/api/v0/deployments/${deploymentId}/domains/${hostname}`,
{
headers: {
"Authorization": "Bearer runtm_xxx"
}
}
);
const data = await response.json();
if (data.certificate_status === "issued") {
console.log(`✓ Certificate issued for ${hostname}`);
return true;
} else if (data.certificate_status === "failed") {
console.log(`✗ Certificate failed: ${data.error}`);
return false;
}
console.log("Certificate pending... (check DNS configuration)");
await new Promise(r => setTimeout(r, 30000));
}
}
waitForCertificate("dep_abc123xyz", "api.example.com");
{
"hostname": "api.example.com",
"configured": false,
"certificate_status": "pending",
"dns_records": [
{
"record_type": "CNAME",
"name": "api",
"value": "my-api-abc123.fly.dev"
}
],
"error": null
}
{
"hostname": "api.example.com",
"configured": true,
"certificate_status": "issued",
"dns_records": [
{
"record_type": "CNAME",
"name": "api",
"value": "my-api-abc123.fly.dev"
}
],
"error": null
}
{
"hostname": "api.example.com",
"configured": false,
"certificate_status": "failed",
"dns_records": [
{
"record_type": "CNAME",
"name": "api",
"value": "my-api-abc123.fly.dev"
}
],
"error": "DNS verification failed. Ensure CNAME record is configured correctly."
}