View a markdown version of this page

CreateDomainName - Amazon API Gateway

CreateDomainName

Creates a new domain name.

Request Syntax

POST /domainnames HTTP/1.1 Content-type: application/json { "certificateArn": "string", "certificateBody": "string", "certificateChain": "string", "certificateName": "string", "certificatePrivateKey": "string", "domainName": "string", "endpointAccessMode": "string", "endpointConfiguration": { "ipAddressType": "string", "types": [ "string" ], "vpcEndpointIds": [ "string" ] }, "mutualTlsAuthentication": { "truststoreUri": "string", "truststoreVersion": "string" }, "ownershipVerificationCertificateArn": "string", "policy": "string", "regionalCertificateArn": "string", "regionalCertificateName": "string", "routingMode": "string", "securityPolicy": "string", "tags": { "string" : "string" } }

URI Request Parameters

The request does not use any URI parameters.

Request Body

The request accepts the following data in JSON format.

certificateArn

The reference to an AWS-managed certificate that will be used by edge-optimized endpoint or private endpoint for this domain name. AWS Certificate Manager is the only supported source.

Type: String

Required: No

certificateBody

[Deprecated] The body of the server certificate that will be used by edge-optimized endpoint or private endpoint for this domain name provided by your certificate authority.

Type: String

Required: No

certificateChain

[Deprecated] The intermediate certificates and optionally the root certificate, one after the other without any blank lines, used by an edge-optimized endpoint for this domain name. If you include the root certificate, your certificate chain must start with intermediate certificates and end with the root certificate. Use the intermediate certificates that were provided by your certificate authority. Do not include any intermediaries that are not in the chain of trust path.

Type: String

Required: No

certificateName

The user-friendly name of the certificate that will be used by edge-optimized endpoint or private endpoint for this domain name.

Type: String

Required: No

certificatePrivateKey

[Deprecated] Your edge-optimized endpoint's domain name certificate's private key.

Type: String

Required: No

domainName

The name of the DomainName resource.

Type: String

Required: Yes

endpointAccessMode

The endpoint access mode of the DomainName. Only available for DomainNames that use security policies that start with SecurityPolicy_.

Type: String

Valid Values: BASIC | STRICT

Required: No

endpointConfiguration

The endpoint configuration of this DomainName showing the endpoint types and IP address types of the domain name.

Type: EndpointConfiguration object

Required: No

mutualTlsAuthentication

The mutual TLS authentication configuration for a custom domain name. If specified, API Gateway performs two-way authentication between the client and the server. Clients must present a trusted certificate to access your API.

Type: MutualTlsAuthenticationInput object

Required: No

ownershipVerificationCertificateArn

The ARN of the public certificate issued by ACM to validate ownership of your custom domain. Only required when configuring mutual TLS and using an ACM imported or private CA certificate ARN as the regionalCertificateArn.

Type: String

Required: No

policy

A stringified JSON policy document that applies to the execute-api service for this DomainName regardless of the caller and Method configuration. Supported only for private custom domain names.

Type: String

Required: No

regionalCertificateArn

The reference to an AWS-managed certificate that will be used by regional endpoint for this domain name. AWS Certificate Manager is the only supported source.

Type: String

Required: No

regionalCertificateName

The user-friendly name of the certificate that will be used by regional endpoint for this domain name.

Type: String

Required: No

routingMode

The routing mode for this domain name. The routing mode determines how API Gateway sends traffic from your custom domain name to your APIs.

Type: String

Valid Values: BASE_PATH_MAPPING_ONLY | ROUTING_RULE_ONLY | ROUTING_RULE_THEN_BASE_PATH_MAPPING

Required: No

securityPolicy

The Transport Layer Security (TLS) version + cipher suite for this DomainName.

Type: String

Valid Values: TLS_1_0 | TLS_1_2 | SecurityPolicy_TLS13_1_3_2025_09 | SecurityPolicy_TLS13_1_3_FIPS_2025_09 | SecurityPolicy_TLS13_1_2_PFS_PQ_2025_09 | SecurityPolicy_TLS13_1_2_FIPS_PQ_2025_09 | SecurityPolicy_TLS13_1_2_PQ_2025_09 | SecurityPolicy_TLS13_1_2_2021_06 | SecurityPolicy_TLS13_2025_EDGE | SecurityPolicy_TLS12_PFS_2025_EDGE | SecurityPolicy_TLS12_2018_EDGE

Required: No

tags

The key-value map of strings. The valid character set is [a-zA-Z+-=._:/]. The tag key can be up to 128 characters and must not start with aws:. The tag value can be up to 256 characters.

Type: String to string map

Required: No

Response Syntax

HTTP/1.1 201 Content-type: application/json { "certificateArn": "string", "certificateName": "string", "certificateUploadDate": number, "distributionDomainName": "string", "distributionHostedZoneId": "string", "domainName": "string", "domainNameArn": "string", "domainNameId": "string", "domainNameStatus": "string", "domainNameStatusMessage": "