---
title: "POST /apps/{appId}/domains"
method: POST
path: "/apps/{appId}/domains"
---

# POST /apps/{appId}/domains

`POST /apps/{appId}/domains`

Creates a new domain association for an Amplify app. This action associates a custom domain with the Amplify app

## Path parameters

- `appId` string, required

## Request body

- object
  - `domainName` string, required — The domain name for the domain association.
  - `enableAutoSubDomain` boolean — Enables the automated creation of subdomains for branches.
  - `subDomainSettings` SubDomainSetting[], required — The setting for the subdomain.
    - `prefix` string, required — The prefix setting for the subdomain.
    - `branchName` string, required — The branch name setting for the subdomain.
  - `autoSubDomainCreationPatterns` AutoSubDomainCreationPattern[] — Sets the branch patterns for automatic subdomain creation.
  - `autoSubDomainIAMRole` string — The required AWS Identity and Access Management (IAM) service role for the Amazon Resource Name (ARN) for automatically creating subdomains.

## Response `200`

Success

- CreateDomainAssociationResult — The result structure for the create domain association request.
  - `domainAssociation` object, required — Describes the structure of a domain association, which associates a custom domain with an Amplify app.
    - `domainAssociationArn` string, required — The Amazon Resource Name (ARN) for the domain association.
    - `domainName` string, required — The name of the domain.
    - `enableAutoSubDomain` boolean, required — Enables the automated creation of subdomains for branches.
    - `autoSubDomainCreationPatterns` AutoSubDomainCreationPattern[] — Sets branch patterns for automatic subdomain creation.
    - `autoSubDomainIAMRole` string — The required AWS Identity and Access Management (IAM) service role for the Amazon Resource Name (ARN) for automatically creating subdomains.
    - `domainStatus` 'PENDING_VERIFICATION' | 'IN_PROGRESS' | 'AVAILABLE' | 'PENDING_DEPLOYMENT' | 'FAILED' | 'CREATING' | 'REQUESTING_CERTIFICATE' | 'UPDATING', required — The current status of the domain association.
    - `statusReason` string, required — The reason for the current status of the domain association.
    - `certificateVerificationDNSRecord` string — The DNS record for certificate verification.
    - `subDomains` SubDomain[], required — The subdomains for the domain association.
      - `subDomainSetting` object, required — Describes the settings for the subdomain.
        - `prefix` string, required — The prefix setting for the subdomain.
        - `branchName` string, required — The branch name setting for the subdomain.
      - `verified` boolean, required — The verified status of the subdomain
      - `dnsRecord` string, required — The DNS record for the subdomain.

## Other responses

- `480` — BadRequestException
- `481` — UnauthorizedException
- `482` — NotFoundException
- `483` — InternalFailureException
- `484` — LimitExceededException
- `485` — DependentServiceFailureException

---

[API](https://skmtc.net/aws/apis/amplify.md) · [All operations](https://skmtc.net/aws/apis/amplify/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/aws/amplify/revisions/573daadbd119/schema)
