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

# Get database by ID



## OpenAPI

````yaml /api-reference/openapi.yaml get /database/{databaseId}
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: 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
paths:
  /database/{databaseId}:
    get:
      tags:
        - Database Main Calls
      summary: Get database by ID
      operationId: getDatabase
      parameters:
        - $ref: '#/components/parameters/databaseId'
      responses:
        '200':
          description: Get database  by ID
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Database'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
components:
  parameters:
    databaseId:
      name: databaseId
      in: path
      description: Database ID
      required: true
      schema:
        type: string
        format: uuid
  schemas:
    Database:
      allOf:
        - $ref: '#/components/schemas/Base'
        - $ref: '#/components/schemas/DatabaseRequest'
        - type: object
          required:
            - environment
            - icon_uri
            - service_type
          properties:
            environment:
              $ref: '#/components/schemas/ReferenceObject'
            host:
              type: string
            port:
              type: integer
              example: 5432
            maximum_cpu:
              type: integer
              description: >-
                Maximum cpu that can be allocated to the database based on
                organization cluster configuration. unit is millicores (m).
                1000m = 1 cpu
              example: 1250
            maximum_memory:
              type: integer
              description: >-
                Maximum memory that can be allocated to the database based on
                organization cluster configuration. unit is MB. 1024 MB = 1GB
              example: 1024
            disk_encrypted:
              type: boolean
              description: indicates if the database disk is encrypted or not
            instance_type:
              type: string
              example: db.t3.medium
              description: >-
                Database instance type to be used for this database. The list of
                values can be retrieved via the endpoint
                /{CloudProvider}/managedDatabase/instanceType/{region}/{dbType}.
                This field is null for container DB.
            disk_type:
              type: string
              nullable: true
              description: >-
                EBS disk type for the database. Only applicable for MANAGED mode
                (gp2 or gp3). Null for CONTAINER mode.
              enum:
                - gp2
                - gp3
            annotations_groups:
              $ref: '#/components/schemas/OrganizationAnnotationsGroupResponseList'
            labels_groups:
              $ref: '#/components/schemas/OrganizationLabelsGroupResponseList'
            icon_uri:
              type: string
              format: uri
              description: Icon URI representing the database.
            service_type:
              $ref: '#/components/schemas/ServiceTypeEnum'
    Base:
      type: object
      required:
        - id
        - created_at
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        created_at:
          type: string
          readOnly: true
          format: date-time
        updated_at:
          type: string
          readOnly: true
          format: date-time
    DatabaseRequest:
      type: object
      required:
        - name
        - type
        - version
        - mode
      properties:
        name:
          type: string
          description: name is case insensitive
        description:
          type: string
          description: give a description to this database
        type:
          $ref: '#/components/schemas/DatabaseTypeEnum'
        version:
          type: string
          example: '10.1'
        mode:
          $ref: '#/components/schemas/DatabaseModeEnum'
        accessibility:
          $ref: '#/components/schemas/DatabaseAccessibilityEnum'
        cpu:
          type: integer
          description: >
            unit is millicores (m). 1000m = 1 cpu

            This field will be ignored for managed DB (instance type will be
            used instead).
          default: 250
          example: 1250
        instance_type:
          type: string
          example: db.t3.medium
          description: >-
            Database instance type to be used for this database. The list of
            values can be retrieved via the endpoint
            /{CloudProvider}/managedDatabase/instanceType/{region}/{dbType}.
            This field SHOULD NOT be set for container DB.
        memory:
          type: integer
          description: >
            unit is MB. 1024 MB = 1GB

            This field will be ignored for managed DB (instance type will be
            used instead).

            Default value is linked to the database type:

            - MANAGED: `100`

            - CONTAINER
              - POSTGRES: `100`
              - REDIS: `100`
              - MYSQL: `512`
              - MONGODB: `256`
          example: 1024
        storage:
          type: integer
          description: unit is GB
          default: 10
        annotations_groups:
          $ref: '#/components/schemas/ServiceAnnotationsRequestList'
        labels_groups:
          $ref: '#/components/schemas/ServiceLabelsRequestList'
        icon_uri:
          type: string
          format: uri
          description: Icon URI representing the database.
          x-stoplight:
            id: ls6yevnhskd5y
    ReferenceObject:
      type: object
      required:
        - id
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
    OrganizationAnnotationsGroupResponseList:
      type: array
      items:
        $ref: '#/components/schemas/OrganizationAnnotationsGroupResponse'
    OrganizationLabelsGroupResponseList:
      type: array
      items:
        $ref: '#/components/schemas/OrganizationLabelsGroupResponse'
      title: ''
    ServiceTypeEnum:
      type: string
      x-stoplight:
        id: d66063cd29913
      description: type of the service (application, database, job, ...)
      enum:
        - APPLICATION
        - DATABASE
        - CONTAINER
        - JOB
        - HELM
        - TERRAFORM
        - ARGOCD_APP
    DatabaseTypeEnum:
      type: string
      enum:
        - MONGODB
        - MYSQL
        - POSTGRESQL
        - REDIS
    DatabaseModeEnum:
      type: string
      enum:
        - CONTAINER
        - MANAGED
    DatabaseAccessibilityEnum:
      type: string
      default: PRIVATE
      enum:
        - PRIVATE
        - PUBLIC
    ServiceAnnotationsRequestList:
      type: array
      items:
        $ref: '#/components/schemas/ServiceAnnotationRequest'
    ServiceLabelsRequestList:
      type: array
      items:
        $ref: '#/components/schemas/ServiceLabelRequest'
    OrganizationAnnotationsGroupResponse:
      allOf:
        - $ref: '#/components/schemas/Base'
        - type: object
          required:
            - name
            - annotations
            - scopes
          properties:
            name:
              type: string
            annotations:
              type: array
              items:
                $ref: '#/components/schemas/Annotation'
            scopes:
              type: array
              items:
                $ref: '#/components/schemas/OrganizationAnnotationsGroupScopeEnum'
    OrganizationLabelsGroupResponse:
      allOf:
        - $ref: '#/components/schemas/Base'
        - type: object
          required:
            - name
            - labels
          properties:
            name:
              type: string
            labels:
              type: array
              items:
                $ref: '#/components/schemas/Label'
      title: ''
    ServiceAnnotationRequest:
      type: object
      required:
        - id
      properties:
        id:
          type: string
          format: uuid
    ServiceLabelRequest:
      type: object
      required:
        - id
      properties:
        id:
          type: string
          format: uuid
    Annotation:
      type: object
      required:
        - key
        - value
      properties:
        key:
          type: string
        value:
          type: string
    OrganizationAnnotationsGroupScopeEnum:
      type: string
      description: Annotations Group Scope
      enum:
        - DEPLOYMENTS
        - STATEFUL_SETS
        - SERVICES
        - INGRESS
        - GATEWAY_API_ROUTES
        - HPA
        - PODS
        - SECRETS
        - JOBS
        - CRON_JOBS
    Label:
      type: object
      required:
        - key
        - value
        - propagate_to_cloud_provider
      properties:
        key:
          type: string
        value:
          type: string
        propagate_to_cloud_provider:
          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" '

````