Skip to main content

Overview

The domains 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 calling verify().

Parameters

string
required
The custom domain to register (e.g., 'auth.example.com').

Response: DomainRegistration

string
Unique domain registration identifier.
string
The registered domain name.
boolean
Whether the domain has been verified (initially false).
string
The token value to add as a DNS TXT record.
string
Human-readable instructions for adding the DNS TXT record.

domains.list()

List all registered custom domains for the authenticated developer.

Response: ListDomainsResponse

DomainRegistration[]
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

string
required
The domain registration ID to verify.

Response: DomainVerifyResponse

boolean
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

string
required
The domain registration ID to delete.

Response

Returns void. The domain registration is immediately removed.

Full example

Last modified on April 14, 2026