Create Tracking Domain
Add a custom tracking subdomain used for click and open tracking in emails.
/tracking-domainsRequires an API key with the tracking_domains:write permission.
Body Parameters
namestringrequiredThe tracking subdomain to add (e.g. track.example.com). Trimmed and lower-cased. Must be a hostname with a top-level domain; labels may contain letters, digits and hyphens. An invalid name, or one already used in this organization, returns 400 validation_error.
Response Fields
objectstringAlways "tracking_domain".
idstringThe tracking domain ID.
namestringThe tracking domain name.
statusstringThe verification status (pending, verified, or failed).
created_atstringISO 8601 timestamp.
recordsarrayThe DNS records to publish. Each item contains id, type (CNAME or TXT), name, value, status (pending, verified or error), and error_message (string | null). The status of a record is about that record, not the domain.
curl -X POST 'https://api.postflare.dev/tracking-domains' \
-H 'Authorization: Bearer sk_xxxxxxxxx' \
-H 'Content-Type: application/json' \
-d '{
"name": "track.example.com"
}'Response
{
"object": "tracking_domain",
"id": "a1b2c3d4-1234-5678-abcd-000000000001",
"name": "track.example.com",
"status": "pending",
"created_at": "2026-01-01T00:00:00.000Z",
"records": [
{
"id": "c3d4e5f6-a7b8-9012-cdef-123456789012",
"type": "CNAME",
"name": "track.example.com",
"value": "tracking.postflare.dev",
"status": "pending",
"error_message": null
},
{
"id": "d4e5f6a7-b8c9-0123-defa-234567890123",
"type": "TXT",
"name": "_cf-custom-hostname.track.example.com",
"value": "e5f6a7b8-c9d0-1234-efab-345678901234",
"status": "pending",
"error_message": null
}
]
}