Skip to content
Live $100 credit at signup, up to $300 total Offer ends December 31, 2026 Get started →

Manage DNS with the API

Manage DNS records over the REST API. Every request uses the base URL https://api.zcp.zsoftly.ca/api and sends a Bearer token in the Authorization header. See Authentication to create a token.

curl -s "https://api.zcp.zsoftly.ca/api/dns/domains" \
-H "Authorization: Bearer your-token" \
-H "Accept: application/json" | jq '.data'

Response:

{
"status": "Success",
"message": "OK",
"total": 1,
"data": [{ "name": "example.com", "slug": "examplecom", "status": true }]
}

Pass the zone slug. The response lists every record, including the SOA and NS records ZCP adds for you.

curl -s "https://api.zcp.zsoftly.ca/api/dns/domains/examplecom" \
-H "Authorization: Bearer your-token" \
-H "Accept: application/json" | jq '.data.records'

The API groups records by name and type. A record set holds one or more values under contents:

{
"name": "www.example.com.",
"type": "A",
"ttl": 14400,
"contents": ["203.0.113.10"]
}

POST to the zone’s records path. The name field is relative to the zone. Send www, not www.example.com. Use @ for the zone root.

curl -s -X POST "https://api.zcp.zsoftly.ca/api/dns/domains/examplecom/records" \
-H "Authorization: Bearer your-token" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{ "name": "www", "type": "A", "content": "203.0.113.10", "ttl": 14400 }'

Response:

{ "status": "Success", "message": "Domain record created successfully." }

There is no update endpoint. To change a record, delete it and create it again with the new value.

An MX record needs a priority field alongside content. Send the mail server in content and the preference number in priority.

curl -s -X POST "https://api.zcp.zsoftly.ca/api/dns/domains/examplecom/records" \
-H "Authorization: Bearer your-token" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{ "name": "@", "type": "MX", "content": "mail.example.com.", "priority": 10, "ttl": 3600 }'

The record then resolves as 10 mail.example.com.. Omitting priority on an MX record fails.

DELETE the zone’s records path with name and type query parameters. Here name is the fully qualified record name with a trailing dot.

curl -s -X DELETE \
"https://api.zcp.zsoftly.ca/api/dns/domains/examplecom/records?name=www.example.com.&type=A" \
-H "Authorization: Bearer your-token" \
-H "Accept: application/json"

Response:

{ "status": "Success", "message": "Domain record deleted successfully." }

The complete interactive reference is the Swagger UI: Open the Cloud Platform API.

See also: DNS Overview, Domains, DNS Records, Worked examples, Manage DNS with the CLI, Troubleshooting, API Quickstart