> ## Documentation Index
> Fetch the complete documentation index at: https://docs.appz.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Add a domain to a project

> Add a domain to the project by passing its domain name and by specifying the project by either passing the project id or name in the URL. If the domain is not yet verified to be used on this project, the request will return verified = false, and the domain will need to be verified according to the verification challenge via POST /projects/:idOrName/domains/:domain/verify. If the domain already exists on the project, the request will fail with a 400 status code.



## OpenAPI

````yaml POST /projects/{idOrName}/domains
openapi: 3.1.0
info:
  version: 1.0.0
  title: Appz Api
servers:
  - url: https://api.youappz.dev
    description: Production API
security:
  - Bearer: []
paths:
  /projects/{idOrName}/domains:
    post:
      tags:
        - projects
      description: >-
        Add a domain to the project by passing its domain name and specifying
        the project by either the project `id` or `name` in the URL.
      parameters:
        - schema:
            type: string
            description: The unique project identifier or the project name
            example: prj_LLHUOMOoDlqOp8wPE4kFo9pE or my-project-name
          required: true
          name: idOrName
          in: path
        - schema:
            type: string
            description: >-
              The Team identifier or Team slug to perform the request on behalf
              of.
            query:
              name: teamId
              in: query
            example: team_xbtegd63gdg5636gdg
          required: true
          name: teamId
          in: query
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                alias:
                  type: string
                target:
                  type: string
                redirect:
                  type:
                    - string
                    - 'null'
                redirectStatusCode:
                  type:
                    - string
                    - 'null'
                  enum:
                    - 301
                    - 302
                    - 307
                    - 308
                  description: Status code for domain redirect
                  example: 302
                deploymentId:
                  type: string
                projectId:
                  type: string
              required:
                - alias
                - target
                - deploymentId
                - projectId
      responses:
        '200':
          description: The domain was successfully added to the project
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: number
                  teamId:
                    type:
                      - string
                      - 'null'
                  alias:
                    type: string
                  domain:
                    type: string
                  zoneId:
                    type: string
                  target:
                    type: string
                  redirect:
                    type:
                      - string
                      - 'null'
                  redirectStatusCode:
                    type:
                      - string
                      - 'null'
                    enum:
                      - 301
                      - 302
                      - 307
                      - 308
                    description: Status code for domain redirect
                    example: 302
                  createdAt:
                    type: number
                  updatedAt:
                    type: number
                  createdBy:
                    type:
                      - number
                      - 'null'
                  deploymentId:
                    type: string
                  projectId:
                    type: string
                required:
                  - id
                  - teamId
                  - alias
                  - domain
                  - zoneId
                  - target
                  - redirect
                  - redirectStatusCode
                  - createdAt
                  - updatedAt
                  - createdBy
                  - deploymentId
                  - projectId
        '400':
          description: Returns a validation error
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: number
                    example: 400
                  message:
                    type: string
                    example: >-
                      One of the provided values in the request body/query is
                      invalid
                required:
                  - code
                  - message
        '403':
          description: You do not have permission to access this resource.
        '404':
          description: The projects was not found
        '409':
          description: A projects with the provided name/id already exists.
components:
  securitySchemes:
    Bearer:
      type: http
      scheme: bearer

````