Overview
Thedomains sub-client manages the registration and ownership-verification lifecycle for custom domains on your Grantex account. Register a domain, verify ownership via a DNS TXT record, list registered domains, and remove them.
Today the API covers registration, DNS verification, listing, and deletion. Runtime traffic routing — having Grantex consent UI and API endpoints actually served from your verified domain — is on the roadmap; both still resolve under
*.grantex.dev.domains.create()
Register a new custom domain. Returns a verification token that you must add as a DNS TXT record before callingverify().
Parameters
The custom domain to register (e.g.,
'auth.example.com').Response: DomainRegistration
Unique domain registration identifier.
The registered domain name.
Whether the domain has been verified (initially
false).The token value to add as a DNS TXT record.
Human-readable instructions for adding the DNS TXT record.
domains.list()
List all registered custom domains for the authenticated developer.Response: ListDomainsResponse
Array of registered domain objects.
domains.verify()
Verify ownership of a registered domain by checking the DNS TXT record. Call this after adding the verification token to your DNS configuration.DNS propagation can take up to 48 hours. If verification fails, wait and try again. The verification token does not expire.
Parameters
The domain registration ID to verify.
Response: DomainVerifyResponse
Whether the DNS TXT record was found and matches the expected verification token.
domains.delete()
Remove a custom domain registration. The domain is immediately disassociated from your Grantex endpoints.Parameters
The domain registration ID to delete.
Response
Returnsvoid. The domain registration is immediately removed.