tm_add_domain
Register a domain for TrafficMorph verification. Receive a verification token along with DNS and HTTP setup instructions.
Instructions
Register a new domain for verification. Returns the
VerifiedDomainResponse record carrying a single
verificationToken plus pre-formatted setup instructions
for both verification methods.
Verification is required before TrafficMorph will run traffic against the domain — it's the gate that prevents arbitrary abuse-as-a-service. Two verification methods are offered; the same token is used for both — pick whichever method is easier to set up:
DNS — install the token as a TXT record at
_trafficmorph-verify.<domain>. Best for users who control DNS. Use :func:tm_verify_domain_dnsafter the record propagates.HTTP — serve the token at
https://<domain>/.well-known/trafficmorph-verify.txt. Best when DNS access is restricted. Use :func:tm_verify_domain_httponce the file is live.
Response shape::
{
"id": 7,
"domain": "api.example.com",
"verificationToken": "tm-verify-abc123…",
"verificationMethod": null, # set after verification
"verified": false,
"verifiedAt": null,
"createdAt": "2026-05-16T12:00:00Z",
"dnsInstruction": "Add a TXT record for _trafficmorph-verify.api.example.com with value: tm-verify-abc123…",
"httpInstruction": "Place a file at https://api.example.com/.well-known/trafficmorph-verify.txt containing: tm-verify-abc123…"
}The dnsInstruction / httpInstruction strings are
pre-formatted by the server for verbatim display — the AI
host can read either back to the user without composing the
setup steps itself.
Idempotent: calling again with the same domain returns the existing record with the same token (the server treats repeat registrations as no-ops).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| domain | Yes |