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

# Deploy services

> Update and deploy the selected services



## OpenAPI

````yaml /api-reference/openapi.yaml post /environment/{environmentId}/service/deploy
openapi: 3.0.0
info:
  version: 1.0.4
  title: Qovery API
  description: >
    - Qovery is the fastest way to deploy your full-stack apps on any Cloud
    provider.

    - ℹ️ The API is stable and still in development.
  contact:
    name: Qovery Product Team
    url: https://www.qovery.com
    email: support+api+documentation@qovery.com
  x-logo:
    url: https://console.qovery.com/assets/logos/logo-white.svg
    altText: Qovery
servers:
  - url: https://api.qovery.com
security:
  - bearerAuth: []
  - ApiKeyAuth: []
tags:
  - name: Account
  - name: Account Info
  - name: Alert Receivers
  - name: Alert Rules
  - name: Admin
  - name: ArgoCD
  - name: Application
  - name: Application Actions
  - name: Application Configuration
  - name: Application Database
  - name: Application Deployment Restriction
  - name: Application Deployment History
  - name: Application Environment Variable
  - name: Application Logs
  - name: Application Main Calls
  - name: Application Secret
  - name: Application Annotations Group
  - name: Applications
  - name: AutoscalingPolicy
  - name: Container
  - name: Container Actions
  - name: Container Configuration
  - name: Container Database
  - name: Container Deployment History
  - name: Container Environment Variable
  - name: Container Logs
  - name: Container Main Calls
  - name: Container Registry
  - name: Container Secret
  - name: Container Annotations Group
  - name: Containers
  - name: Deployment Stage Main Calls
  - name: Job
  - name: Job Actions
  - name: Job Configuration
  - name: Job Database
  - name: Job Deployment Restriction
  - name: Job Deployment History
  - name: Job Environment Variable
  - name: Job Logs
  - name: Job Main Calls
  - name: Job Registry
  - name: Job Secret
  - name: Job Annotations Group
  - name: Jobs
  - name: KedaTriggerAuthentication
  - name: Helm
  - name: Helm Actions
  - name: Helm Configuration
  - name: Helm Database
  - name: Helm Deployment Restriction
  - name: Helm Deployment History
  - name: Helm Logs
  - name: Helm Main Calls
  - name: Helm Repository
  - name: Helms
  - name: Backups
  - name: Billing
  - name: Cloud Provider
  - name: Cloud Provider Credentials
  - name: Clusters
  - name: Custom Domain
  - name: Container Custom Domain
  - name: Database
  - name: Database Actions
  - name: Database Application
  - name: Database Container
  - name: Database Deployment History
  - name: Database Main Calls
  - name: Database Annotations Group
  - name: Databases
  - name: Environment
  - name: Environment Actions
  - name: Environment Deployment History
  - name: Environment Deployment Rule
  - name: Environment Logs
  - name: Environment Main Calls
  - name: Environment Secret
  - name: Environment Variable
  - name: Environments
  - name: Git
  - name: Github App
  - name: Git repositories
  - name: Members
  - name: Organization
  - name: Organization Account Git Repositories
  - name: Organization Cluster Lock
  - name: Organization Main Calls
  - name: Organization Custom Role
  - name: Organization Event
  - name: Organization Api Token
  - name: Organization Webhook
  - name: Organization Annotations Group
  - name: Organization Labels Group
  - name: Organization Enterprise Connection
  - name: Project
  - name: Project Deployment Rule
  - name: Project Environment Variable
  - name: Project Main Calls
  - name: Project Secret
  - name: Projects
  - name: Referral & Rewards
  - name: Terraforms
  - name: Terraform Main Calls
  - name: Terraform Resources
  - name: Terraform Deployment History
  - name: Terraform Deployment Restriction
  - name: Container Registries
  - name: Helm Repositories
  - name: User Sign Up
  - name: Variable Main Calls
  - name: Helm Custom Domain
  - name: Lifecycle Template Main Calls
paths:
  /environment/{environmentId}/service/deploy:
    post:
      tags:
        - Environment Actions
      summary: Deploy services
      description: Update and deploy the selected services
      operationId: deployAllServices
      parameters:
        - $ref: '#/components/parameters/environmentId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DeployAllRequest'
      responses:
        '202':
          description: Deployed services
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EnvironmentStatus'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '409':
          description: Operation is in progress
components:
  parameters:
    environmentId:
      name: environmentId
      in: path
      description: Environment ID
      required: true
      schema:
        type: string
        format: uuid
  schemas:
    DeployAllRequest:
      type: object
      properties:
        applications:
          type: array
          items:
            type: object
            required:
              - application_id
            properties:
              application_id:
                type: string
                format: uuid
                description: id of the application to be deployed.
              git_commit_id:
                type: string
                description: >-
                  Commit ID to deploy. Can be empty only if the service has been
                  already deployed (in this case the service version won't be
                  changed)
        databases:
          type: array
          items:
            type: string
            format: uuid
        containers:
          type: array
          items:
            type: object
            required:
              - id
            properties:
              id:
                type: string
                format: uuid
                description: id of the container to be updated.
              image_tag:
                type: string
                description: >-
                  new tag for the container. Can be empty only if the service
                  has been already deployed (in this case the service version
                  won't be changed)
        jobs:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
                format: uuid
                description: id of the job to be updated.
              image_tag:
                type: string
                description: >-
                  new tag for the job image. Use only if job is an image source.
                  Can be empty only if the service has been already deployed (in
                  this case the service version won't be changed)
              git_commit_id:
                type: string
                description: >-
                  Commit ID to deploy. Use only if job is a repository source.
                  Can be empty only if the service has been already deployed (in
                  this case the service version won't be changed)
        helms:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
                format: uuid
                description: id of the helm to be updated.
              chart_version:
                type: string
                description: >-
                  The new chart version for the Helm source. Use this only if
                  the helm has a Helm repository source.
              git_commit_id:
                type: string
                description: >-
                  The commit Id to deploy. Use this only if the helm has a Git
                  repository source.
              values_override_git_commit_id:
                type: string
                description: >-
                  The commit Id of the override values to deploy. Use only if
                  the helm has a Git override values repository.
        terraforms:
          type: array
          items:
            $ref: '#/components/schemas/TerraformDeployRequest'
    EnvironmentStatus:
      type: object
      required:
        - id
        - state
        - last_deployment_state
      properties:
        id:
          type: string
          format: uuid
        state:
          $ref: '#/components/schemas/StateEnum'
        last_deployment_date:
          type: string
          format: date-time
          nullable: true
        last_deployment_state:
          $ref: '#/components/schemas/StateEnum'
        last_deployment_id:
          type: string
          nullable: true
        total_deployment_duration_in_seconds:
          type: integer
          nullable: true
        origin:
          $ref: '#/components/schemas/EnvironmentStatusEventOriginEnum'
        triggered_by:
          type: string
          nullable: true
        deployment_status:
          $ref: '#/components/schemas/EnvironmentDeploymentStatusEnum'
        deployment_request_id:
          type: string
          format: uuid
          nullable: true
        metrics:
          type: array
          nullable: true
          items:
            $ref: '#/components/schemas/StageStepMetrics'
    TerraformDeployRequest:
      type: object
      properties:
        id:
          type: string
          format: uuid
          nullable: true
          description: Terraform service identifier
        git_commit_id:
          type: string
          description: Commit to deploy for chart source.
        action:
          type: string
          nullable: true
          description: Terraform action to execute.
          enum:
            - PLAN
            - FORCE_UNLOCK
            - MIGRATE_STATE
    StateEnum:
      type: string
      enum:
        - BUILDING
        - BUILD_ERROR
        - CANCELED
        - CANCELING
        - DELETED
        - DELETE_ERROR
        - DELETE_QUEUED
        - DELETING
        - DEPLOYED
        - DEPLOYING
        - DEPLOYMENT_ERROR
        - DEPLOYMENT_QUEUED
        - EXECUTING
        - QUEUED
        - READY
        - RECAP
        - RESTARTED
        - RESTARTING
        - RESTART_ERROR
        - RESTART_QUEUED
        - STOPPED
        - STOPPING
        - STOP_ERROR
        - STOP_QUEUED
        - UNAVAILABLE
        - WAITING_DELETING
        - WAITING_RESTARTING
        - WAITING_RUNNING
        - WAITING_STOPPING
    EnvironmentStatusEventOriginEnum:
      type: string
      nullable: true
      description: Origin of the organization event
      enum:
        - API
        - CLI
        - CONSOLE
        - GIT
        - QOVERY_INTERNAL
        - TERRAFORM_PROVIDER
      example: API
    EnvironmentDeploymentStatusEnum:
      title: EnvironmentDeploymentStatusEnum
      x-stoplight:
        id: sbw3iw6yteyba
      enum:
        - NEVER_DEPLOYED
        - UP_TO_DATE
        - OUT_OF_DATE
    StageStepMetrics:
      type: object
      properties:
        stage_id:
          type: string
          format: uuid
        total_duration_sec:
          description: >-
            The total duration in seconds of the stage deployment or null if the
            deployment is not completed.
          type: integer
          nullable: true
        details:
          description: A list of metrics for deployment steps of the stage.
          type: array
          items:
            $ref: '#/components/schemas/StageStepMetric'
    StageStepMetric:
      type: object
      properties:
        stage_id:
          type: string
          format: uuid
        step_name:
          $ref: '#/components/schemas/StageStepMetricNameEnum'
        status:
          $ref: '#/components/schemas/StepMetricStatusEnum'
        duration_sec:
          description: The duration of the step in seconds.
          type: integer
    StageStepMetricNameEnum:
      type: string
      enum:
        - TOTAL
        - QUEUEING
        - PROVISION_BUILDER
      description: >
        The name of the deployment step at the stage level:

        - TOTAL: The total duration of the stage deployment.

        - QUEUEING: The step preceding the actual stage deployment step.

        - PROVISION_BUILDER: The step to provision builders before the actual
        build.
    StepMetricStatusEnum:
      type: string
      enum:
        - SUCCESS
        - ERROR
        - CANCEL
        - SKIP
      description: |
        The status of completion for the step:
        - SUCCESS: The step completed successfully.
        - ERROR: The step completed with an error.
        - CANCEL: The step was canceled.
        - SKIP: The step was skipped because it was not necessary.
  responses:
    '400':
      description: Bad request
    '401':
      description: Access token is missing or invalid
    '403':
      description: Access forbidden
    '404':
      description: Resource not found
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        JWT tokens should be used with OIDC account (human to machine). JWT
        tokens used by the Qovery console to communicate with the API have a
        TTL. Curl Example ' curl https://console.qovery.com/organization -H
        "Authorization: Bearer $qovery_token" '
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: >-
        Token API are generated by Qovery to manage machine to machine
        interaction and do not have a TTL. Curl Example ' curl
        https://console.qovery.com/organization -H "Authorization: Token
        $qovery_token" '

````