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

# Reset superuser password of the PostgreSQL database



## OpenAPI

````yaml /api-reference/openapi.yml post /project/{project_id}/location/{location}/postgres/{postgres_database_reference}/reset-superuser-password
openapi: 3.0.3
info:
  description: API for managing resources on Ubicloud
  title: Clover API
  version: 0.1.0
  contact:
    url: https://www.ubicloud.com/
    email: support@ubicloud.com
  license:
    name: GNU Affero General Public License v3.0 (AGPL-3.0)
    url: https://www.gnu.org/licenses/agpl-3.0.en.html
servers:
  - url: https://api.ubicloud.com
security:
  - BearerAuth: []
tags:
  - description: Firewall Operations
    name: Firewall
  - description: Firewall Rule Operations
    name: Firewall Rule
  - description: Inference API Key Operations
    name: Inference Api Key
  - description: Inference Endpoint Operations
    name: Inference Endpoint
  - description: Load Balancer Operations
    name: Load Balancer
  - description: Login Operations
    name: Login
  - description: Machine Image Operations
    name: Machine Image
  - description: Postgres Database Operations
    name: Postgres Database
  - description: Postgres Firewall Rule Operations
    name: Postgres Firewall Rule
  - description: Postgres Metric Destination
    name: Postgres Metric Destination
  - description: Postgres Log Destination
    name: Postgres Log Destination
  - description: Private Subnet Operations
    name: Private Subnet
  - description: Project Operations
    name: Project
  - description: Virtual Machine Operations
    name: Virtual Machine
  - description: Private Location Operations
    name: Private Location
  - description: Kubernetes Cluster Operations
    name: Kubernetes Cluster
  - description: SSH Public Key Operations
    name: SSH Public Key
  - description: GitHub Operations
    name: GitHub
  - description: Audit Log Operations
    name: Audit Log
paths:
  /project/{project_id}/location/{location}/postgres/{postgres_database_reference}/reset-superuser-password:
    post:
      tags:
        - Postgres Database
      summary: Reset superuser password of the PostgreSQL database
      operationId: resetSuperuserPassword
      parameters:
        - $ref: '#/components/parameters/project_id'
        - $ref: '#/components/parameters/location'
        - $ref: '#/components/parameters/postgres_database_reference'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                password:
                  type: string
              additionalProperties: false
              required:
                - password
      responses:
        '200':
          $ref: '#/components/responses/PostgresDatabase'
        default:
          $ref: '#/components/responses/Error'
components:
  parameters:
    project_id:
      description: ID of the project
      in: path
      name: project_id
      required: true
      schema:
        type: string
        example: pjkkmx0f2vke4h36nk9cm8v8q0
        pattern: ^pj[0-9a-hj-km-np-tv-z]{24}$
    location:
      description: The Ubicloud location/region
      in: path
      name: location
      required: true
      schema:
        type: string
        example: eu-central-h1
    postgres_database_reference:
      description: Postgres database ID or name
      examples:
        id:
          value: pgn30gjk1d1e2jj34v9x0dq4rp
        name:
          value: postgres-database-name
      in: path
      name: postgres_database_reference
      required: true
      schema:
        $ref: '#/components/schemas/Reference'
  responses:
    PostgresDatabase:
      description: A Postgres Database
      content:
        application/json:
          schema:
            type: object
            additionalProperties: false
            allOf:
              - $ref: '#/components/schemas/PostgresDatabase'
              - additionalProperties: false
                properties:
                  connection_string:
                    description: Connection string to the Postgres database
                    type: string
                    nullable: true
                  username:
                    description: Username for the Postgres database
                    type: string
                    nullable: true
                  password:
                    description: Password for the Postgres database
                    type: string
                    nullable: true
                  hostname:
                    description: Hostname for the Postgres database
                    type: string
                    nullable: true
                  earliest_restore_time:
                    description: Earliest restore time (if primary)
                    type: string
                    nullable: true
                  firewall_rules:
                    description: List of Postgres firewall rules
                    type: array
                    items:
                      $ref: '#/components/schemas/PostgresFirewallRule'
                  latest_restore_time:
                    description: Latest restore time (if primary)"
                    type: string
                  primary:
                    description: Is the database primary
                    type: boolean
                  maintenance_window_start_at:
                    description: Maintenance window start time
                    type: integer
                  tags:
                    description: Tags of the Postgres database
                    type: array
                    items:
                      $ref: '#/components/schemas/PostgresTag'
                required:
                  - connection_string
                  - username
                  - password
                  - hostname
                  - earliest_restore_time
                  - firewall_rules
                  - latest_restore_time
                  - primary
                  - maintenance_window_start_at
                  - tags
    Error:
      description: An error response
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  schemas:
    Reference:
      description: Resource ID or name
      type: string
      pattern: ^[a-z0-9](?:[a-z0-9\-]{0,61}[a-z0-9])?$
    PostgresDatabase:
      type: object
      properties:
        flavor:
          description: Kind of Postgres database
          type: string
        ha_type:
          description: High availability type
          type: string
        target_server_count:
          description: Target number of servers (primary + standbys)
          type: integer
        id:
          description: ID of the Postgres database
          type: string
          example: pgn30gjk1d1e2jj34v9x0dq4rp
          pattern: ^pg[0-9a-hj-km-np-tv-z]{24}$
        location:
          description: Location of the Postgres database
          type: string
        name:
          description: Name of the Postgres database
          type: string
        state:
          description: State of the Postgres database
          type: string
        storage_size_gib:
          description: Storage size in GiB
          type: integer
        target_storage_size_gib:
          description: Desired storage size in GiB
          type: integer
        version:
          description: Current Postgres version
          type: string
          enum:
            - '16'
            - '17'
            - '18'
        target_version:
          description: Target Postgres version
          type: string
          enum:
            - '16'
            - '17'
            - '18'
        vm_size:
          description: Size of the underlying VM
          type: string
        target_vm_size:
          description: Desired VM size
          type: string
        ca_certificates:
          description: >-
            CA certificates of the root CA used to issue postgres server
            certificates
          type: string
          nullable: true
        maintenance_window_start_at:
          description: Maintenance window start time
          type: integer
          nullable: true
        read_replica:
          description: If the database is a read replica or not
          type: boolean
        parent:
          description: Parent Postgres database
          type: string
          nullable: true
        fallback_active:
          description: Whether the primary server is running on a fallback instance type
          type: boolean
        tags:
          description: Tags of the Postgres database
          type: array
          items:
            $ref: '#/components/schemas/PostgresTag'
        created_at:
          description: Creation timestamp of the Postgres database
          type: string
          format: date-time
      additionalProperties: false
      required:
        - flavor
        - ha_type
        - target_server_count
        - id
        - location
        - name
        - state
        - storage_size_gib
        - version
        - target_version
        - vm_size
        - maintenance_window_start_at
        - read_replica
        - fallback_active
        - tags
        - created_at
    PostgresFirewallRule:
      type: object
      properties:
        cidr:
          description: CIDR of the firewall rule
          type: string
        description:
          description: Port information for the firewall rule
          type: string
        id:
          description: ID of the firewall rule
          type: string
          example: frmjgkgbktw62k53005jpx8tt7
          pattern: ^fr[0-9a-hj-km-np-tv-z]{24}$
        port:
          description: Port for the Postgres firewall rule
          type: integer
      additionalProperties: false
      required:
        - cidr
        - id
    PostgresTag:
      type: object
      properties:
        key:
          description: Key of the Postgres tag
          type: string
        value:
          description: Value of the Postgres tag
          type: string
      additionalProperties: false
      required:
        - key
        - value
    Error:
      type: object
      properties:
        error:
          type: object
          additionalProperties: false
          properties:
            code:
              type: integer
              example: 401
            message:
              type: string
              example: There was an error logging in
            type:
              type: string
              example: InvalidCredentials
            details:
              type: object
              nullable: true
          required:
            - code
            - message
            - type
      additionalProperties: false
      required:
        - error
  securitySchemes:
    BearerAuth:
      bearerFormat: JWT
      scheme: bearer
      type: http

````