Verify and connect a domain
verify_domain
Finishes a domain ownership check and adds the domain to the site once its TXT record matches.
It finishes a verification started with start_domain_verification, or by add_custom_domain when its answer carried verification. It checks one thing: the TXT record at exactly _modulify-verification.<domain>, never through a CNAME, against the token that call returned. Add that record, not the records get_domain_status lists, since the pending domain is not in get_domain_status until this call adds it.
When the TXT record matches, the domain joins the site's custom domains, with its www companion when it is a root domain and that hostname is not on another site in this workspace. It is added even while its A, AAAA and CNAME records are still missing, so it comes back with IsConnected false until those are in place. The answer carries the new domainId, so call get_domain_status with it afterwards to track that.
A site in another workspace that has the domain, or its www companion, loses it to this site, because the record proves you own it. That site stops answering on it straight away, and the message ends with example.com was moved here from another site. The tool tells the client to confirm with you first. See One site per domain.
When the workspace bought the domain on its Domains page and it uses Modulify's nameservers, Modulify adds those records by itself and replaces the A, AAAA, ANAME and CNAME records already at each hostname it adds, so whatever they pointed at stops answering there. The tool tells the client to confirm with you first. See Records Modulify manages.
It is refused when no verification is pending, when the domain is already on this site, when another site in this workspace has it, with that site's name in the message, and when the site already has 10 custom domains. When the domain is already on this site, the refusal also clears the pending verification, and when another site in this workspace has it, the verification stays pending until you remove it there. When DNS cannot be checked at that moment, it answers 503 with DNS could not be checked right now, so the domain was not verified. Please try again in a minute! and nothing changes, so try again a minute later. It needs a paid plan and the Manage domains permission.
DNS can take a while to propagate, so a failure here often just means not yet. Wait a few minutes and try again rather than changing anything. See A domain waiting on verification.
Request
Call it with a POST to https://api.modulify.ai/v1/verify_domain, sending the inputs below as a JSON object. The token needs the config:write scope.
This method is marked destructive: it deletes or overwrites data. Check the inputs before you call it, and send an Idempotency-Key header whenever you might retry it.
curl -X POST https://api.modulify.ai/v1/verify_domain \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"projectId":"PROJECT_ID"}'Over MCP, the same method is the verify_domain tool.
Inputs
| Input | Type | Required | Description |
|---|---|---|---|
projectId |
string | Yes | The site id. The domain being verified is the site's pending verification, recorded by start_domain_verification or add_custom_domain. |
Response
Every call answers with the JSON envelope of success, message, data, code and version. data holds the result described above, and on a method that returns a total, count carries it. The response headers carry the call's X-Request-Id and what is left of your per-minute budget in X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset. Errors explains every status code a call can answer with.