ReferenceFlightcontrol APICustom DomainsOverview

Custom Domains API

This API allows you to add multiple custom domains to your service.

Endpoints

ActionMethodEndpoint
Create certificate group with domainsPOST/v1/services/{serviceId}/domain-certificate-groups
Get domains from a groupGET/v1/domain-certificate-groups/{domainGroupId}/domains
Get service domain groupsGET/v1/services/{serviceId}/domain-certificate-groups
Get a single domain groupGET/v1/domain-certificate-groups/{domainGroupId}
Get a single domainGET/v1/domains/{domainId}
Add domains to a groupPOST/v1/domain-certificate-groups/{domainGroupId}/domains
Delete a single domainDELETE/v1/domain-certificate-groups/{domainGroupId}/domains/{managedDomainId}

How It Works

Custom domains are linked to a CloudFront distribution that routes traffic to your service. To enable secure connections, this setup requires an SSL/TLS certificate.

We group these elements — domains, CloudFront distribution, and certificate — under the concept of a Domain Certificate Group.

A Domain Certificate Group can either:

  1. Use the default CloudFront distribution automatically provisioned with the service, or
  2. Be associated with a new, separately created CloudFront distribution.

Once you create a domain group with domains, we initiate the setup by requesting a certificate from AWS. This process generates DNS records required to verify domain ownership, which are labeled as CERTIFICATE_DOMAIN_VERIFICATION in our API.

Once you add these DNS records, the following happens automatically:

  1. AWS detects the records and issues the certificate.
  2. Flightcontrol attaches both the certificate and the domains to the CloudFront distribution.
  3. At this point, the domains are ready to serve traffic. If you haven’t already, you now need to update your DNS settings to point the domain to the CloudFront distribution.

The key endpoints you’ll need when first setting up the domains are:

  1. Create a domain certificate group → POST /v1/services/{serviceId}/domain-certificate-groups
  2. Get domains from a certificate group → GET /v1/domain-certificate-groups/{domainGroupId}/domains
    • Returns the domains and required DNS records after the group is created.
    • After adding the DNS records, use this endpoint to track domain attachment.