Documentation Index
Fetch the complete documentation index at: https://docs.gateways.app/llms.txt
Use this file to discover all available pages before exploring further.
DNS Management API
The DNS Management API allows you to manage DNS hosted zones and records across multiple providers (Route53 and Cloudflare).Base URL
All DNS endpoints are prefixed with:projectSlug- The slug of your projectenvironmentSlug- The slug of your environment
Create DNS Hosted Zone
Create a new DNS hosted zone. Endpoint:POST /api/:projectSlug/:environmentSlug/dns
Authentication: Required
Request Body:
- If
provideris set to"native"(or not provided), the system automatically detects the DNS provider:- If
cloudflareApiTokenis provided → uses Cloudflare - If project has an AWS cloud connection → uses Route53
- Otherwise, returns an error requesting either a Cloudflare token or AWS connection
- If
400 Bad Request: Missing required fields, invalid domain name format, invalid provider, missing Cloudflare API token (for Cloudflare), or Cloudflare zone not found for domain401 Unauthorized: Missing or invalid authentication token403 Forbidden: Insufficient permissions or project access denied404 Not Found: Project, environment, cloud connection, or Cloudflare zone not found500 Internal Server Error: Failed to create/import hosted zone
List DNS Hosted Zones
Get all DNS hosted zones for a project and environment. Endpoint:GET /api/:projectSlug/:environmentSlug/dns
Authentication: Required
Example Request:
401 Unauthorized: Missing or invalid authentication token404 Not Found: Project or environment not found500 Internal Server Error: Failed to retrieve DNS zones
Get DNS Hosted Zone
Get details of a specific DNS hosted zone. Endpoint:GET /api/:projectSlug/:environmentSlug/dns/:id
Authentication: Required
Parameters:
id(path) - The DNS zone ID
400 Bad Request: Invalid DNS zone ID401 Unauthorized: Missing or invalid authentication token403 Forbidden: Access denied to this DNS zone404 Not Found: DNS zone not found500 Internal Server Error: Failed to retrieve DNS zone
List DNS Records
List all DNS records in a hosted zone. Endpoint:GET /api/:projectSlug/:environmentSlug/dns/:id/records
Authentication: Required
Parameters:
id(path) - The DNS zone ID
DNS zone metadata: dns_active
Each DNS zone resource has a metadata.dns_active flag indicating whether the Gateways verification TXT record is present for a domain in that zone.
- On zone create:
dns_activeis set tofalse. - When a subdomain DNS record is created (via resource connections, e.g. subdomain → instance with DNS): a TXT record
_gateways_app.<recordName>with valueinstalledis created and the zone’sdns_activeis set totrue. - To refresh
dns_active: use the unified sync endpoint (do not use the verify-domain GET for this). Sync resolves the verification TXT and updatesmetadata.dns_activetotrueorfalse.
PUT /api/:projectSlug/:environmentSlug/resources/:resourceId/sync
Use the DNS zone’s resource id as resourceId. The sync checks _gateways_app.<domain> (using a subdomain in the zone if connected, otherwise the zone domain) and sets metadata.dns_active accordingly.
Example:
400 Bad Request: Invalid DNS zone ID401 Unauthorized: Missing or invalid authentication token403 Forbidden: Access denied to this DNS zone404 Not Found: DNS zone or cloud connection not found500 Internal Server Error: Failed to list DNS records
Create DNS Record
Create or update a DNS record in a hosted zone. Endpoint:POST /api/:projectSlug/:environmentSlug/dns/:id/records
Authentication: Required
Parameters:
id(path) - The DNS zone ID
A- IPv4 addressAAAA- IPv6 addressCNAME- Canonical nameMX- Mail exchangeTXT- Text recordSRV- Service recordPTR- Pointer recordNS- Name server (managed automatically)SOA- Start of authority (managed automatically)
400 Bad Request: Missing required fields, invalid record type, or invalid values401 Unauthorized: Missing or invalid authentication token403 Forbidden: Access denied to this DNS zone404 Not Found: DNS zone or cloud connection not found500 Internal Server Error: Failed to create DNS record
Delete DNS Record
Delete a DNS record from a hosted zone. Endpoint:DELETE /api/:projectSlug/:environmentSlug/dns/:id/records
Authentication: Required
Parameters:
id(path) - The DNS zone ID
values array must match the exact values of the record you want to delete. If the record has multiple values, all values must be included.
Example Request (A Record):
400 Bad Request: Missing required fields, invalid record type, or invalid values401 Unauthorized: Missing or invalid authentication token403 Forbidden: Access denied to this DNS zone404 Not Found: DNS zone or cloud connection not found500 Internal Server Error: Failed to delete DNS record
Delete DNS Hosted Zone
Path:DELETE /api/:projectSlug/:environmentSlug/resources/:resourceIdUse the DNS resource’s database ID as
resourceId. See Resources API — Delete Resource by ID. All resource types (including DNS) are deleted via this unified path.
Query parameter: deleteFromCloud (optional)
true(default): Delete connection-created DNS records and the hosted zone in the cloud (Route53, Cloudflare, GCP, Azure, etc.), remove resource connections, then soft-delete the resource.false: Only remove the resource from the database (and its resource connections). The hosted zone and records are not deleted from the cloud.
DELETE /api/:projectSlug/:environmentSlug/dns/:id/records (see above). That endpoint remains type-specific.
DNS Providers
Currently Supported
-
AWS Route53 (
route53) - Fully supported- Create hosted zones
- List hosted zones
- Create/update/delete DNS records
- Automatic name server assignment
- Alias A records for AWS resources (S3, CloudFront, ELB)
-
Cloudflare (
cloudflare) - Fully supported- Create hosted zones
- List hosted zones
- Create/update/delete DNS records
- Automatic name server assignment
- Supports standard DNS record types (A, AAAA, CNAME, MX, TXT, etc.)
Notes
- Domain Registration: This API manages DNS hosted zones and records only. You must register your domain name with a domain registrar separately.
- Name Servers: After creating a hosted zone, you’ll receive name servers. You need to update your domain’s name servers at your domain registrar to point to these name servers for DNS to work.
- DNS Propagation: DNS changes may take several minutes to propagate globally. Changes made through this API are applied immediately but may not be visible everywhere right away.
-
TTL (Time To Live): The TTL value determines how long DNS resolvers cache your DNS records. Lower TTL values mean faster updates but more DNS queries. Common values:
300(5 minutes) - Fast updates, suitable for development3600(1 hour) - Balanced, suitable for production86400(24 hours) - Slow updates, maximum caching
-
Record Name ”@”: Using
"@"as the record name refers to the root domain (e.g.,example.comfor a zone with domainexample.com). -
Route53 Global Service: Route53 is a global service, so region is set to
"global"for all Route53 hosted zones. - Cloud Connection Required for Route53: A valid AWS cloud connection is required for Route53 DNS management. Ensure your project has an active cloud connection before creating Route53 zones.
-
Cloudflare Zone Import: For Cloudflare, the API searches for an existing zone by
domainNamein your Cloudflare account. The API does not create new Cloudflare zones - it only imports existing ones. If no zone is found for the domain, an error is returned. -
Cloudflare Authentication: For Cloudflare DNS zones, provide
cloudflareApiTokenin the request body when creating the DNS resource. The API token is encrypted and stored securely in the DNS resource’ssecret_datacolumn. Each DNS resource can have its own Cloudflare API token, allowing you to use different accounts/tokens for different zones. Thesecret_datacolumn is a generic field that can store encrypted sensitive data for various integrations. - Cloudflare Record Types: Cloudflare supports standard DNS record types (A, AAAA, CNAME, MX, TXT, etc.). Note that Cloudflare does not support alias records like Route53, so CNAME records are used for hostnames and A records for IP addresses.
-
Provider-Specific Features:
- Route53: Supports alias A records for AWS resources (S3, etc.), which are automatically created when connecting DNS to static websites where configured
- Cloudflare: Supports DNS proxy (orange cloud) feature, but this API uses DNS-only mode by default