> ## 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.

# Redeploy database



## OpenAPI

````yaml /api-reference/openapi.yaml post /database/{databaseId}/redeploy
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: IPs
  - name: Alert Receivers
  - name: Alert Rules
  - name: Admin
  - name: ArgoCD
  - name: Agentic Workflows
  - name: Application
  - name: Application Actions
  - name: Application Build Analysis
  - 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 Build Analysis
  - 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: Blueprint Catalog
  - name: Cloud Provider
  - name: Cloud Provider Credentials
  - name: Clusters
  - name: Cluster Deployment History
  - name: Cluster Operator
  - name: Platform Configuration
  - name: Custom Domain
  - name: Container Custom Domain
  - name: LLM Providers
  - name: MCP Servers
  - 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 Policy 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: Secret Manager Access
  - 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
  - name: Blueprint Main Calls
paths:
  /database/{databaseId}/redeploy:
    post:
      tags:
        - Database Actions
      summary: Redeploy database
      operationId: redeployDatabase
      parameters:
        - $ref: '#/components/parameters/databaseId'
        - in: query
          name: applyImmediately
          schema:
            type: boolean
          description: Apply immediately regardless of the maintenance window
          required: false
      responses:
        '202':
          description: Database redeploy has been requested
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Status'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '409':
          description: Operation is in progress
components:
  parameters:
    databaseId:
      name: databaseId
      in: path
      description: Database ID
      required: true
      schema:
        type: string
        format: uuid
  schemas:
    Status:
      type: object
      required:
        - id
        - state
        - service_deployment_status
        - status_details
        - is_part_last_deployment
        - deployment_requests_count
        - deployment_request_id
      properties:
        id:
          type: string
          format: uuid
        state:
          $ref: '#/components/schemas/StateEnum'
        service_deployment_status:
          $ref: '#/components/schemas/ServiceDeploymentStatusEnum'
        last_deployment_date:
          type: string
          format: date-time
        is_part_last_deployment:
          type: boolean
        steps:
          $ref: '#/components/schemas/ServiceStepMetrics'
        execution_id:
          type: string
          x-stoplight:
            id: 3o9tz4272s2ct
        status_details:
          $ref: '#/components/schemas/StatusDetails'
        deployment_request_id:
          type: string
          x-stoplight:
            id: bepixrb7tyzme
          format: uuid
          nullable: true
        deployment_requests_count:
          type: integer
          x-stoplight:
            id: crku532vt3v4p
    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
    ServiceDeploymentStatusEnum:
      type: string
      enum:
        - NEVER_DEPLOYED
        - OUT_OF_DATE
        - UP_TO_DATE
    ServiceStepMetrics:
      type: object
      required:
        - total_duration_sec
        - total_computing_duration_sec
        - details
      properties:
        total_duration_sec:
          description: >-
            The total duration in seconds of the service deployment or null if
            the deployment is not completed.
          type: integer
          nullable: true
        total_computing_duration_sec:
          description: >-
            The total duration in seconds of the service deployment without
            queuing steps.
          type: integer
        details:
          description: A list of metrics for deployment steps of the service.
          type: array
          items:
            $ref: '#/components/schemas/ServiceStepMetric'
    StatusDetails:
      type: object
      required:
        - action
        - status
        - sub_action
      properties:
        action:
          $ref: '#/components/schemas/ServiceActionEnum'
        status:
          $ref: '#/components/schemas/ServiceActionStatusEnum'
        sub_action:
          $ref: '#/components/schemas/ServiceSubActionEnum'
    ServiceStepMetric:
      type: object
      properties:
        step_name:
          $ref: '#/components/schemas/ServiceStepMetricNameEnum'
        status:
          $ref: '#/components/schemas/StepMetricStatusEnum'
        duration_sec:
          description: The duration of the step in seconds.
          type: integer
        started_at:
          description: >-
            The time at which the step started. Present while the step is
            ongoing and may be retained after completion.
          type: string
          format: date-time
          nullable: true
        sub_steps:
          description: >
            Steps that ran inside this one. Only set on BUILD. Their time is
            already part of this

            step's duration: never add it to a total.
          type: array
          items:
            $ref: '#/components/schemas/ServiceSubStepMetric'
        builder_usage:
          $ref: '#/components/schemas/BuilderUsage'
    ServiceActionEnum:
      type: string
      enum:
        - DEPLOY
        - DELETE
        - RESTART
        - STOP
        - UNKNOWN
    ServiceActionStatusEnum:
      type: string
      enum:
        - QUEUED
        - ONGOING
        - SUCCESS
        - ERROR
        - EXECUTING
        - CANCELED
        - CANCELING
        - NEVER
    ServiceSubActionEnum:
      type: string
      default: NONE
      enum:
        - NONE
        - TERRAFORM_PLAN_ONLY
        - TERRAFORM_PLAN_AND_APPLY
        - TERRAFORM_DESTROY
        - TERRAFORM_FORCE_UNLOCK_STATE
        - TERRAFORM_MIGRATE_STATE
    ServiceStepMetricNameEnum:
      type: string
      enum:
        - REGISTRY_CREATE_REPOSITORY
        - GIT_CLONE
        - BUILD_QUEUEING
        - BUILD
        - DEPLOYMENT_QUEUEING
        - DEPLOYMENT
        - ROUTER_DEPLOYMENT
        - MIRROR_IMAGE
        - EXECUTING
      description: >
        The name of the deployment step at the service level:

        - REGISTRY_CREATE_REPOSITORY: The step to create the repository in the
        registry.

        - GIT_CLONE: The step to clone the source code repository. 

        - BUILD_QUEUEING: The queuing time preceding the actual building step.

        - BUILD: The step to build the source code.

        - DEPLOYMENT_QUEUEING: The queuing time preceding the actual deployment
        step.

        - DEPLOYMENT: The step to deploy the service. 

        - ROUTER_DEPLOYMENT: The step to deploy the router. 

        - MIRROR_IMAGE: The step to mirror the image to the private registry.

        - EXECUTING: The step to execute a job or terraform apply.
    StepMetricStatusEnum:
      type: string
      enum:
        - ONGOING
        - SUCCESS
        - ERROR
        - CANCEL
        - SKIP
      description: |
        The lifecycle status of the step:
        - ONGOING: The step is currently running.
        - 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.
    ServiceSubStepMetric:
      type: object
      required:
        - name
        - status
        - duration_sec
      properties:
        name:
          description: >
            PROVISION_BUILDER, IMAGE_PUSH or CACHE_EXPORT. A string, not an
            enum, so a new

            sub-step never breaks a client: accept values not listed here.
          type: string
        status:
          $ref: '#/components/schemas/StepMetricStatusEnum'
        duration_sec:
          description: The duration of the sub-step in seconds.
          type: integer
        started_at:
          description: The time at which the sub-step started.
          type: string
          format: date-time
          nullable: true
    BuilderUsage:
      type: object
      description: >
        Resources the builder used during this build, image push and cache
        export included. Only

        set on BUILD. Compare them with the service's build CPU and memory
        settings. The four usage

        fields come together, or are all absent when no sample was taken (a
        build shorter than the

        sampling interval, or a cluster without a metrics API).
      properties:
        cpu_milli_max:
          description: Highest CPU use seen, in millicores.
          type: integer
        cpu_milli_avg:
          description: Average CPU use over the samples, in millicores.
          type: integer
        memory_mib_max:
          description: Highest memory use seen, in MiB.
          type: integer
        samples:
          description: >
            Number of samples the values above come from. Usage is sampled
            periodically, so a

            short build has few samples and its peaks can be missed.
          type: integer
        oom_killed:
          description: >
            Present, and true, only when the builder was killed for running out
            of memory. Absent

            otherwise: never test it against false. Raising the build memory
            setting fixes it.
          type: boolean
  responses:
    '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" '

````

## Related topics

- [qovery database](https://www.qovery.com/docs/cli/commands/database.md)
- [Create a Database](https://www.qovery.com/docs/getting-started/guides/getting-started/connect-database.md)
- [Database Seeding with Lifecycle Jobs](https://www.qovery.com/docs/getting-started/guides/others/database-seeding-lifecycle-job.md)
- [Databases](https://www.qovery.com/docs/configuration/database.md)
- [Security Overview](https://www.qovery.com/docs/getting-started/security-and-compliance/overview.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.