Domains API
Overview
Section titled “Overview”Domain management allows you to use custom domains for your campaigns with automatic DNS verification and SSL provisioning via Cloudflare.
Authentication
Section titled “Authentication”All endpoints require either a JWT token or an API key (gf_...) in the Authorization header.
Endpoints
Section titled “Endpoints”| Method | Path | Scope | Description |
|---|---|---|---|
| GET | /api/v1/domains | read:domains | List all domains |
| POST | /api/v1/domains | write:domains | Add a new domain |
| GET | /api/v1/domains/{id} | read:domains | Get domain details |
| DELETE | /api/v1/domains/{id} | write:domains | Remove a domain |
| POST | /api/v1/domains/{id}/verify | write:domains | Trigger DNS verification |
| GET | /api/v1/domains/{id}/dns-records | read:domains | Get required DNS records |
Examples
Section titled “Examples”Add a Domain
Section titled “Add a Domain”curl -X POST https://devcore.getghostflow.io/api/v1/domains \ -H "Authorization: Bearer gf_your_api_key" \ -H "Content-Type: application/json" \ -d '{ "domain": "trk.example.com", "type": "tracking" }'const response = await fetch('https://devcore.getghostflow.io/api/v1/domains', { method: 'POST', headers: { 'Authorization': `Bearer ${API_KEY}`, 'Content-Type': 'application/json', }, body: JSON.stringify({ domain: 'trk.example.com', type: 'tracking', }),});const domain = await response.json();import requests
resp = requests.post( "https://devcore.getghostflow.io/api/v1/domains", headers={"Authorization": f"Bearer {api_key}"}, json={ "domain": "trk.example.com", "type": "tracking", },)domain = resp.json()Verify DNS
Section titled “Verify DNS”curl -X POST https://devcore.getghostflow.io/api/v1/domains/{id}/verify \ -H "Authorization: Bearer gf_your_api_key"Get Required DNS Records
Section titled “Get Required DNS Records”curl https://devcore.getghostflow.io/api/v1/domains/{id}/dns-records \ -H "Authorization: Bearer gf_your_api_key"Response 200 OK:
{ "records": [ { "type": "CNAME", "name": "trk", "value": "proxy.getghostflow.io", "ttl": 300 } ]}