Skip to main content

Endpoint

POST /v1/domains/:id/verify

Authentication

Requires a developer API key in the Authorization header.

Request Headers

HeaderValue
AuthorizationBearer <api_key>

Path Parameters

ParameterTypeDescription
idstringThe domain ID to verify (e.g. dom_01HXYZ...)

Example Request

curl -X POST https://grantex-auth-dd4mtrt2gq-uc.a.run.app/v1/domains/dom_01HXYZ.../verify \
  -H "Authorization: Bearer gx_..."

Response — 200 OK

When DNS verification succeeds:
{
  "verified": true,
  "message": "Domain verified successfully"
}
If the domain was already verified:
{
  "verified": true,
  "message": "Domain already verified"
}

Response Fields

FieldTypeDescription
verifiedbooleanWhether the domain is now verified
messagestringHuman-readable status message

Error Responses

StatusCodeDescription
400VERIFICATION_FAILEDDNS verification failed — ensure the TXT record is set correctly
401UNAUTHORIZEDInvalid or missing API key
404NOT_FOUNDDomain not found or does not belong to developer

Rate Limits

This endpoint is limited to 10 requests per minute to prevent abuse of DNS lookups.

DNS Setup

Before calling this endpoint, add a DNS TXT record:
_grantex.<your-domain> = <verificationToken>
The verificationToken is returned by the Register Domain endpoint. DNS propagation may take up to 24 hours.

SDK Examples

import Grantex from '@grantex/sdk';

const grantex = new Grantex({ apiKey: 'gx_...' });

const result = await grantex.domains.verify('dom_01HXYZ...');
console.log(result.verified); // true