---
title: "POST /v1/{+parent}/domains"
method: POST
path: "/v1/{+parent}/domains"
tags: ["projects"]
---

# POST /v1/{+parent}/domains

`POST /v1/{+parent}/domains`

Links a new domain to a backend.

## Path parameters

- `parent` string, required

## Query parameters

- `domainId` string
- `requestId` string
- `validateOnly` boolean

## Request body

- Domain — A domain name that is associated with a backend.
  - `displayName` string — Optional. Mutable human-readable name for the domain. 63 character limit. e.g. `prod domain`.
  - `type` 'TYPE_UNSPECIFIED' | 'DEFAULT' | 'CUSTOM' — Output only. The type of the domain.
  - `createTime` string, google-datetime — Output only. Time at which the domain was created.
  - `updateTime` string, google-datetime — Output only. Time at which the domain was last updated.
  - `annotations` object — Optional. Annotations as key value pairs.
  - `etag` string — Output only. Server-computed checksum based on other values; may be sent on update or delete to ensure operation is done on expected resource.
  - `deleteTime` string, google-datetime — Output only. Time at which the domain was deleted.
  - `reconciling` boolean — Output only. A field that, if true, indicates that the build has an ongoing LRO.
  - `labels` object — Optional. Labels as key value pairs.
  - `uid` string — Output only. System-assigned, unique identifier.
  - `disabled` boolean — Optional. Whether the domain is disabled. Defaults to false.
  - `name` string — Identifier. The resource name of the domain, e.g. `/projects/p/locations/l/backends/b/domains/foo.com`
  - `customDomainStatus` CustomDomainStatus — The status of a custom domain's linkage to a backend.
    - `ownershipState` 'OWNERSHIP_STATE_UNSPECIFIED' | 'OWNERSHIP_MISSING' | 'OWNERSHIP_UNREACHABLE' | 'OWNERSHIP_MISMATCH' | 'OWNERSHIP_CONFLICT' | 'OWNERSHIP_PENDING' | 'OWNERSHIP_ACTIVE' — Output only. Tracks whether the backend is permitted to serve content on the domain, based off the domain's DNS records.
    - `certState` 'CERT_STATE_UNSPECIFIED' | 'CERT_PREPARING' | 'CERT_VALIDATING' | 'CERT_PROPAGATING' | 'CERT_ACTIVE' | 'CERT_EXPIRING_SOON' | 'CERT_EXPIRED' — Output only. Tracks SSL certificate status for the domain.
    - `hostState` 'HOST_STATE_UNSPECIFIED' | 'HOST_UNHOSTED' | 'HOST_UNREACHABLE' | 'HOST_NON_FAH' | 'HOST_CONFLICT' | 'HOST_WRONG_SHARD' | 'HOST_ACTIVE' — Output only. Tracks whether a custom domain is detected as appropriately directing traffic to App Hosting.
    - `issues` Status[] — Output only. A list of issues with domain configuration. Allows users to self-correct problems with DNS records.
      - `message` string — A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.
      - `code` integer — The status code, which should be an enum value of google.rpc.Code.
      - `details` object[] — A list of messages that carry the error details. There is a common set of message types for APIs to use.
    - `requiredDnsUpdates` DnsUpdates[] — Output only. Lists the records that must added or removed to a custom domain's DNS in order to finish setup and start serving content. Field is present during onboarding. Also present after onboarding if one or more of the above states is not *_ACTIVE, indicating the domain's DNS records are in a bad state.
      - `domainName` string — Output only. The domain name the DNS updates pertain to.
      - `checkTime` string, google-datetime — Output only. The last time App Hosting checked your custom domain's DNS records.
      - `discovered` DnsRecordSet[] — Output only. The set of DNS records App Hosting discovered when inspecting a domain.
        - `records` DnsRecord[] — Output only. Records on the domain.
          - `rdata` string — Output only. The data of the record. The meaning of the value depends on record type: - A and AAAA: IP addresses for the domain. - CNAME: Another domain to check for records. - TXT: Arbitrary text strings associated with the domain. App Hosting uses TXT records to determine which Firebase projects have permission to act on the domain's behalf. - CAA: The record's flags, tag, and value, e.g. `0 issue "pki.goog"`.
          - `domainName` string — Output only. The domain the record pertains to, e.g. `foo.bar.com.`.
          - `requiredAction` 'NONE' | 'ADD' | 'REMOVE' — Output only. An enum that indicates the a required action for this record. Populated when the record is part of a required change in a `DnsUpdates` `discovered` or `desired` record set.
          - `type` 'TYPE_UNSPECIFIED' | 'A' | 'CNAME' | 'TXT' | 'AAAA' | 'CAA' — Output only. The record's type, which determines what data the record contains.
          - `relevantState` string[] — Output only. An enum that indicates which state(s) this DNS record applies to. Populated for all records with an `ADD` or `REMOVE` required action.
        - `checkError` Status — The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors).
          - `message` string — A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.
          - `code` integer — The status code, which should be an enum value of google.rpc.Code.
          - `details` object[] — A list of messages that carry the error details. There is a common set of message types for APIs to use.
        - `domainName` string — Output only. The domain name the record set pertains to.
      - `desired` DnsRecordSet[] — Output only. The set of DNS records App Hosting needs in order to be able to serve secure content on the domain.
        - `records` DnsRecord[] — Output only. Records on the domain.
          - `rdata` string — Output only. The data of the record. The meaning of the value depends on record type: - A and AAAA: IP addresses for the domain. - CNAME: Another domain to check for records. - TXT: Arbitrary text strings associated with the domain. App Hosting uses TXT records to determine which Firebase projects have permission to act on the domain's behalf. - CAA: The record's flags, tag, and value, e.g. `0 issue "pki.goog"`.
          - `domainName` string — Output only. The domain the record pertains to, e.g. `foo.bar.com.`.
          - `requiredAction` 'NONE' | 'ADD' | 'REMOVE' — Output only. An enum that indicates the a required action for this record. Populated when the record is part of a required change in a `DnsUpdates` `discovered` or `desired` record set.
          - `type` 'TYPE_UNSPECIFIED' | 'A' | 'CNAME' | 'TXT' | 'AAAA' | 'CAA' — Output only. The record's type, which determines what data the record contains.
          - `relevantState` string[] — Output only. An enum that indicates which state(s) this DNS record applies to. Populated for all records with an `ADD` or `REMOVE` required action.
        - `checkError` Status — The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors).
          - `message` string — A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.
          - `code` integer — The status code, which should be an enum value of google.rpc.Code.
          - `details` object[] — A list of messages that carry the error details. There is a common set of message types for APIs to use.
        - `domainName` string — Output only. The domain name the record set pertains to.
  - `serve` ServingBehavior — Indicates whether App Hosting will serve content on the domain.
    - `redirect` Redirect — Specifies redirect behavior for a domain.
      - `status` string, int64 — Optional. The status code to use in a redirect response. Must be a valid HTTP 3XX status code. Defaults to 302 if not present.
      - `uri` string — Required. The URI of the redirect's intended destination. This URI will be prepended to the original request path. URI without a scheme are assumed to be HTTPS.

## Response `200`

Successful response

---

[API](https://skmtc.dev/google/apis/firebaseapphosting.md) · [All operations](https://skmtc.dev/google/apis/firebaseapphosting/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/google/firebaseapphosting/revisions/487a88f26666/schema)
