Enable a custom tracking domain
Enable a custom tracking domain. Request: POST /v1/email/domains/{id}/custom-tracking. Scope: domains:update.
POST
Provisions a custom tracking domain for a verified sending domain so open/click links redirect through the customer's own host, <label>.<parentDomain> (default track.<sending domain>). parentDomain may be a parent of the sending domain, so send.example.com can use track.example.com. Calling it again with a different label or parent moves the host. Requires a plan that includes custom tracking domains. Returns the resulting state including the two DNS records the customer must create; a hostname another domain already uses is a conflict.
apiKeyheader
x-api-key<token>id*stringMatch
^dom_[0-9a-hjkmnp-tv-z]{16,24}$application/json- body
label?|nullparentDomain?|nullCustomTrackingStatus
application/json- response
enabled*booleancustomTracking*|nullparentDomains*array<string>import { createClient } from "samva";
const samva = createClient({ apiKey: process.env.SAMVA_API_KEY! });
const result = await samva.email.enableCustomTracking({
"id": "example"
});Example Response
{
"enabled": true,
"customTracking": {
"status": "pending",
"label": "string",
"hostname": "string",
"parentDomain": "string",
"region": "string",
"sslStatus": "string",
"certificate": {
"reason": {
"code": "initializing",
"message": "string"
},
"lastCheckedAt": "string",
"nextCheckAt": "string"
},
"dnsRecords": {
"tracking": {
"name": "string",
"type": "string",
"value": "string"
},
"dcvDelegation": {
"name": "string",
"type": "string",
"value": "string"
}
},
"caaBlocked": true,
"verificationErrors": [
"string"
],
"teardownScheduledAt": "string"
},
"parentDomains": [
"string"
]
}