Skip to main content

Add a Custom Domain

A Custom Domain lets clients call your APIs on your own domain, such as api.yourcompany.com, instead of the default domain. The API Gateway serves the Custom Domain over HTTPS with the Certificate you select.

warning
  • You must own the domain and be able to edit its DNS records.
  • Your organization needs a Certificate whose Domains (SAN) include the domain to add, for example *.yourcompany.com includes api.yourcompany.com. If you don't have one yet, import a Certificate first, or import it directly in Step 2.
Step 1Open the Gateway Endpoint tab and click Add Domain
1 / 5
Step 1: Open the Gateway Endpoint tab and click Add Domain

Click the image to zoom in.

Add a Custom Domain​

To add a Custom Domain, follow these steps:

  1. In the left menu, select API Gateway → Gateway, click the API Gateway name, select the Gateway Endpoint tab, then click Add Domain.

Create Custom Domain form

  1. Enter the following information in the Create Custom Domain form:
FieldRequiredDescription
Domain nameYFull domain name, for example api.yourcompany.com. Without https://, without a path, and without wildcards. Must be unique among the Custom Domains of the organization.
DescriptionNWhat the domain is used for.
CertificateYA Certificate that includes the domain. Each Certificate in the list shows its Domains (SAN) and expiry date. To import a new Certificate, click + Import certificate at the bottom of the list.

Certificate list with the Domains (SAN) and expiry date of each Certificate

When the Certificate is valid and includes the domain, the form shows This certificate covers <domain>. The blue box below shows the Load Balancer IP of the API Gateway, with a copy icon.

Create Custom Domain form filled in

  1. Click Add domain. The button is enabled only when the domain and the Certificate are valid.

The message Create Custom Domain successfully appears. The new Custom Domain is at the top of the Gateway Endpoint tab with the Cert valid status. The domain also appears in the Gateway URL column of the API Gateway list and in the SNIs and Used by columns of the Certificate.

New Custom Domain with the Cert valid status

  1. Create a DNS record at your DNS provider that points the domain to the Load Balancer IP shown in the form. You can also find this IP in Service Configuration → Load Balancer Configuration → Load Balancer IP of the API Gateway.
note

The system does not check DNS. The domain serves traffic only after the DNS record points to the Load Balancer IP and the DNS change has finished updating.

tip

You can also add a Custom Domain while you create an API Gateway, on the Endpoint step. See Create an API Gateway.

Common issues​

ErrorCauseSolution
Domain name must be a valid domain, e.g. api.example.com.The domain has https://, a path, invalid characters, or only one levelEnter a full domain name, for example api.yourcompany.com.
Wildcard domains are not supported. Enter a fully qualified domain name, e.g. api.example.com.The domain contains *Enter one specific domain. Wildcards are used only in the Domains (SAN) of a Certificate.
A custom domain must be unique within the organizationThe domain is already a Custom Domain of another API Gateway in the organizationUse another domain, or delete the domain from the other API Gateway first.
<domain> is not in the domains (SAN) of this certificate, so clients would get a certificate name mismatch. Select a certificate that covers this domain.The Certificate does not include the domainSelect a Certificate whose Domains (SAN) contain the domain or a matching wildcard.
This certificate is expired. Select another certificate or renew it first. / This certificate is not yet valid …The Certificate has expired or is not valid yetSelect another Certificate, or renew this Certificate.

Verify the Custom Domain​

  1. Send a request to a Route through the Custom Domain with Postman or curl: https://<Custom Domain>/<path of the Route>. The response must be the same as when you call the default domain.

POST request to the Custom Domain that returns 200 OK

Common issues​

ErrorCauseSolution
Requests to the domain fail even though the status is Cert validThe DNS record is missing, points to the wrong IP, or the DNS change has not taken effect yetCompare the DNS record with the Load Balancer IP and wait for DNS to update.

Next steps​

Last updated on