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

# Create a Deploy

> Create a new Deploy. A Deploy represents an intent to deploy new DAG code to an Astro Deployment.



## OpenAPI

````yaml /astro/api/v-1-beta-1/platform/openapi.yaml post /organizations/{organizationId}/deployments/{deploymentId}/deploys
openapi: 3.0.3
info:
  contact: {}
  description: Astro Platform API
  title: Astro Platform API
  version: v1beta1
servers:
  - url: https://api.astronomer.io/platform/v1beta1
security:
  - JWT: []
tags:
  - description: >-
      A `cluster` object represents an Astro cluster, which is a Kubernetes
      cluster that hosts the infrastructure required to run Deployments. Make
      requests to `cluster` endpoints to manage your standard and dedicated
      clusters. See [Create a dedicated
      cluster](https://astronomer.io/docs/astro/create-dedicated-cluster).
    name: Cluster
  - description: >-
      The `organization` object contains the metadata and configurations of an
      Astro Organization. It does not include objects within the Organization,
      such as users and clusters. Make requests to `organization` endpoints to
      view and update high level settings for your Organization, including
      settings related to authentication and billing. To manage resources within
      an Organization, make requests to the endpoints related to those
      resources, such as `users`. See
      [Billing](https://astronomer.io/docs/astro/manage-billing), [Set up single
      sign-on](https://astronomer.io/docs/astro/configure-idp), and [Manage
      domains](https://astronomer.io/docs/astro/manage-domains).
    name: Organization
  - description: >-
      The `options` object represents all possible configurations for a given
      Astro component. Make requests to the `options` object to get the
      configuration constraints for creating or updating a given Astro
      component.
    name: Options
  - description: >-
      The `workspace` object represents an Astro Workspace, which is a
      collection of Deployments that can be accessed by a specific group of
      users. It contains metadata about a Workspace, but does not contain
      objects within the Workspace such as users and Deployments. Make requests
      to `workspace` endpoints to manage high level details about your
      Workspace. To manage resources within a Workspace, make requests to the
      endpoints related to those resources, such as `users`, and use the
      `workspaceIds` parameter to filter results by Workspace. See [Configure
      Workspaces](https://astronomer.io/docs/astro/manage-workspaces).
    name: Workspace
  - name: notification-channels
    x-group: Notification Channels
paths:
  /organizations/{organizationId}/deployments/{deploymentId}/deploys:
    post:
      tags:
        - Deploy
      summary: Create a Deploy
      description: >-
        Create a new Deploy. A Deploy represents an intent to deploy new DAG
        code to an Astro Deployment.
      operationId: CreateDeploy
      parameters:
        - description: The ID of the Organization in which to create the Deployment.
          in: path
          name: organizationId
          required: true
          schema:
            type: string
        - description: The Deployment's ID.
          in: path
          name: deploymentId
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateDeployRequest'
        description: The Request body for creating a Deploy.
        required: true
        x-originalParamName: body
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Deploy'
          description: OK
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Bad Request
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Unauthorized
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Forbidden
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Not Found
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Internal Server Error
      security:
        - JWT: []
components:
  schemas:
    CreateDeployRequest:
      properties:
        bundleMountPath:
          description: >-
            The path where Astro mounts the bundle on the Airflow component
            pods. Required if deploy type is BUNDLE.
          type: string
        bundleType:
          description: The type of bundle deployed. Required if deploy type is BUNDLE.
          example: dbt
          type: string
        description:
          description: The deploy's description.
          example: My deploy description
          maxLength: 500
          type: string
        git:
          $ref: '#/components/schemas/CreateDeployGitRequest'
        type:
          description: The type of deploy.
          enum:
            - IMAGE_AND_DAG
            - IMAGE_ONLY
            - DAG_ONLY
            - BUNDLE
          example: IMAGE_AND_DAG
          type: string
      required:
        - type
      type: object
    Deploy:
      properties:
        airflowVersion:
          description: The deploy's Airflow version.
          example: 2.7.2, if airflow version is not found, it will return NA
          type: string
        astroRuntimeVersion:
          description: The deploy's Astro Runtime version.
          example: 9.1.0
          type: string
        bundleMountPath:
          description: >-
            The path where Astro mounts the bundle on the Airflow component
            pods.
          type: string
        bundleUploadUrl:
          description: >-
            The URL where the deploy uploads the bundle. Appears only if DAG
            deploys are enabled on the Deployment and deploy type is BUNDLE.
          type: string
        bundles:
          description: The bundles included in a specific Deployment.
          items:
            $ref: '#/components/schemas/Bundle'
          type: array
        createdAt:
          description: >-
            The time when the deploy was created in UTC, formatted as
            `YYYY-MM-DDTHH:MM:SSZ`.
          example: '2022-11-22T04:37:12Z'
          format: date-time
          type: string
        createdBySubject:
          $ref: '#/components/schemas/BasicSubjectProfile'
        dagTarballVersion:
          description: >-
            The deploy's DAG tarball version, also known as the Bundle Version
            in the Astro UI.
          example: '2024-01-12T18:32:20.5898930Z'
          type: string
        dagsUploadUrl:
          description: >-
            The deploy's upload URL to upload DAG bundles. Appears only if dag
            deploys are enabled on the Deployment.
          example: >-
            https://astroproddagdeploy.windows.core.net/clmh59gt0000308lbgswe5fvh/clmh57jtm000008lb58fe2wmv
          type: string
        deploymentId:
          description: The Deployment's ID.
          example: clmh57jtm000008lb58fe2wmv
          type: string
        description:
          description: The deploy's description.
          example: My deploy description
          type: string
        id:
          description: The deploy's ID.
          example: clvetru2w000201mowqwua63n
          type: string
        imageRepository:
          description: The URL of the deploy's image repository.
          example: https://my-image-repository
          type: string
        imageTag:
          description: >-
            The deploy's image tag. Appears only if specified in the most recent
            deploy.
          example: my-image-tag
          type: string
        isDagDeployEnabled:
          description: >-
            Whether the deploy was triggered on a Deployment with DAG deploys
            enabled.
          example: true
          type: boolean
        rollbackFromId:
          description: >-
            The ID of the deploy that you completed a rollback on. Appears only
            if a rollback has been performed.
          example: clvcz1lrq000101oitxtp276e
          type: string
        status:
          description: The status of the deploy.
          enum:
            - INITIALIZED
            - DEPLOYED
            - FAILED
          example: DEPLOYED
          type: string
        type:
          description: The type of deploy.
          enum:
            - IMAGE_AND_DAG
            - IMAGE_ONLY
            - DAG_ONLY
          example: IMAGE_AND_DAG
          type: string
        updatedAt:
          description: >-
            The time when the deploy was last updated in UTC, formatted as
            `YYYY-MM-DDTHH:MM:SSZ`.
          example: '2022-11-22T04:37:12Z'
          format: date-time
          type: string
        updatedBySubject:
          $ref: '#/components/schemas/BasicSubjectProfile'
      required:
        - createdAt
        - deploymentId
        - id
        - imageRepository
        - imageTag
        - isDagDeployEnabled
        - status
        - type
      type: object
    Error:
      properties:
        message:
          type: string
        requestId:
          type: string
        statusCode:
          maximum: 600
          minimum: 400
          type: integer
      required:
        - message
        - requestId
        - statusCode
      type: object
    CreateDeployGitRequest:
      properties:
        account:
          description: The git account or organization name.
          example: astronomer
          type: string
        authorName:
          description: The git author's display name.
          example: Astronomer Bot
          type: string
        authorUrl:
          description: The URL to the author's profile.
          example: https://github.com/astronomer-bot
          type: string
        authorUsername:
          description: The git author's username.
          example: astronomer-bot
          type: string
        beforeCommitSha:
          description: The commit SHA before the deploy commit.
          example: def456abc123
          type: string
        branch:
          description: The git branch name.
          example: main
          type: string
        commitSha:
          description: The git commit SHA.
          example: abc123def456
          type: string
        commitUrl:
          description: The URL to the commit.
          example: https://github.com/astronomer/astro-cli/commit/abc123def456
          type: string
        path:
          description: The path within the repository.
          example: dags/
          type: string
        provider:
          description: The git provider.
          enum:
            - GITHUB
          example: GITHUB
          type: string
        repo:
          description: The git repository name.
          example: astro-cli
          type: string
      required:
        - account
        - branch
        - commitSha
        - commitUrl
        - provider
        - repo
      type: object
    Bundle:
      properties:
        bundleType:
          description: The type of bundle.
          type: string
        currentVersion:
          description: The current bundle version.
          type: string
        deployId:
          description: The ID of the deploy that included the bundle.
          type: string
        desiredVersion:
          description: The desired version of the bundle.
          type: string
        mountPath:
          description: >-
            The path where the Astro mounts the bundle on the Airflow component
            pods.
          type: string
      required:
        - bundleType
        - deployId
        - mountPath
      type: object
    BasicSubjectProfile:
      properties:
        apiTokenName:
          description: >-
            The API token's name. Returned only when `SubjectType` is
            `SERVICEKEY`.
          example: my-token
          type: string
        avatarUrl:
          description: >-
            The URL for the user's profile image. Returned only when
            `SubjectType` is `USER`.
          example: https://avatar.url
          type: string
        fullName:
          description: The subject's full name. Returned only when `SubjectType` is `USER`.
          example: Jane Doe
          type: string
        id:
          description: The subject's ID.
          example: clm8qv74h000008mlf08scq7k
          type: string
        subjectType:
          description: The subject type.
          enum:
            - USER
            - SERVICEKEY
          example: USER
          type: string
        username:
          description: The subject's username. Returned only when `SubjectType` is `USER`.
          example: user1@company.com
          type: string
      required:
        - id
      type: object
  securitySchemes:
    JWT:
      scheme: bearer
      type: http

````