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

# Update database settings

> **Token scope:** `account` · `org` · `project` — read-only tokens refused (not a GET).

Update postgres settings: connection pooling, scale-to-zero, idle timeout, storage, and deletion protection.



## OpenAPI

````yaml /openapi/project.json patch /projects/{projectId}/database/settings
openapi: 3.1.0
info:
  title: InstaCloud API — Project level
  version: 0.1.0
  description: >-
    Endpoints under `/projects/{projectId}`: branches, services, deploys,
    secrets, databases, storage, cron, observability, governance. Callable with
    any token whose binding covers the project.


    Generated from the platform's own OpenAPI document
    (https://api.instacloud.com/openapi.json); see the [API
    overview](/reference/api/overview) for authentication and token scopes.
servers:
  - url: https://api.instacloud.com
    description: InstaCloud
security:
  - bearerAuth: []
tags:
  - name: Projects
    description: Projects inside an organization.
  - name: Branches
    description: >-
      Branch environments of a project: isolated database, storage and compute
      per branch.
  - name: Services
    description: 'Services on a branch: compute, postgres, storage and managed databases.'
  - name: Deploy
    description: Deploy an image or a source to a compute service.
  - name: Compute
    description: Build output of a compute service.
  - name: Secrets
    description: User secrets, service credentials and how they bind into compute env.
  - name: Database
    description: Postgres databases, extensions, credentials and ad-hoc SQL.
  - name: Storage
    description: Objects in a storage service.
  - name: Backups
    description: Database backups and restores.
  - name: Cron
    description: Scheduled HTTP calls against a service or an external URL.
  - name: Observability
    description: Logs, metrics, deploy events and database insight.
  - name: Governance
    description: Per-project agent policy and the approval queue.
  - name: Audit
    description: The project's event timeline, including agent-ingested events.
  - name: Domains
    description: >-
      Domains bought through InstaCloud, bring-your-own zones and their DNS
      records.
  - name: Billing
    description: Usage, cycles, invoices and credits.
  - name: Templates
    description: Deploy a template into a project.
paths:
  /projects/{projectId}/database/settings:
    patch:
      tags:
        - Database
      summary: Update database settings
      description: >-
        **Token scope:** `account` · `org` · `project` — read-only tokens
        refused (not a GET).


        Update postgres settings: connection pooling, scale-to-zero, idle
        timeout, storage, and deletion protection.
      operationId: updateDatabaseSettings
      parameters:
        - schema:
            type: string
          in: query
          name: branch
          required: false
          description: branch name (default branch if omitted)
        - schema:
            type: string
          in: query
          name: group
          required: false
          description: 'postgres service name (default: the sole postgres service)'
        - schema:
            format: uuid
            type: string
          in: path
          name: projectId
          required: true
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                connectionPooling:
                  description: enable provider-managed PgBouncer/connection pooling
                  type: boolean
                deletionProtection:
                  type: boolean
                scaleToZero:
                  description: enable or disable scale-to-zero
                  type: boolean
                cpu:
                  description: >-
                    resource ceiling — vCPU as a provider quantity ('2', '4',
                    '2500m'). PAID PLANS: the ceiling is the tier lever. Moves
                    both directions (insta-db only)
                  type: string
                memory:
                  description: >-
                    resource ceiling — memory as a provider quantity ('4Gi',
                    '8Gi'). PAID PLANS. Moves both directions (insta-db only)
                  type: string
                idleTimeout:
                  minimum: 0
                  description: scale-to-zero idle timeout in seconds
                  type: integer
                volumeSize:
                  description: >-
                    the volume (block disk) size cap as whole Gi ('10Gi'). PAID
                    PLANS: the ceiling is the tier lever. Grow-only — a
                    provisioned disk cannot shrink (insta-db only)
                  type: string
                storageSize:
                  deprecated: true
                  description: DEPRECATED alias of volumeSize — dropped next release
                  type: string
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DbInstanceInfo'
        '202':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                  approvalId:
                    type: string
                  action:
                    type: string
                  actions:
                    type: array
                    items:
                      type: string
                  message:
                    type: string
                  url:
                    type: string
                required:
                  - status
                  - approvalId
                  - action
                  - actions
                  - message
                  - url
        '400':
          description: Default Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
        '404':
          description: Default Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: Default Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '502':
          description: Default Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    DbInstanceInfo:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        state:
          type: string
        routeKey:
          type: string
        host:
          type: string
        port:
          type: integer
        connectionPooling:
          type: boolean
        deletionProtection:
          type: boolean
        scaleToZero:
          type: boolean
        idleTimeoutSecs:
          type: integer
        volumeSize:
          example: 10Gi
          description: the service's volume (block disk) size
          type: string
        volumeGib:
          type: number
        storageSize:
          deprecated: true
          description: DEPRECATED alias of volumeSize — dropped next release
          type: string
        storageGiB:
          deprecated: true
          description: DEPRECATED alias of volumeGib — dropped next release
          type: number
        enabledExtensions:
          type: array
          items:
            type: string
        cpuMilli:
          description: current cpu ceiling in millicores (2000 = 2 vCPU)
          type: integer
        memoryMib:
          description: current memory ceiling in MiB
          type: integer
        cap:
          description: >-
            this plan's maximum for the ceilings — render sliders with their
            plan-limit markers. These are the caller's own tier caps and they
            move with the plan (and with env overrides per deployment), so read
            them from THIS field rather than assuming a tier's numbers; the
            parenthetical example that used to live here said 'pro 4
            vCPU/4Gi/10Gi' and was stale on all three by the time anyone
            noticed.
          type: object
          properties:
            cpuMilli:
              type: integer
            memoryMib:
              type: integer
            volumeGib:
              type: integer
          required:
            - cpuMilli
            - memoryMib
            - volumeGib
    Error:
      type: object
      properties:
        error:
          type: string
      required:
        - error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Session access JWT or an API token (`insta_<prefix>_<secret>`).

````