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

# Restart database

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

Restart the postgres server (insta-db only) so settings written with ALTER SYSTEM that need a restart (wal_level, max_wal_senders, max_replication_slots, …) take effect. Connections drop while it restarts. Waits for the restart to finish. `pending: true` means it was still in progress when the wait ran out — GET .../database/instance reads `running` throughout, so confirm with `SHOW <setting>` instead. A suspended database stays suspended — its next connection starts it with the new settings. Gated — deploy.



## OpenAPI

````yaml /openapi/project.json post /projects/{projectId}/database/restart
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/restart:
    post:
      tags:
        - Database
      summary: Restart database
      description: >-
        **Token scope:** `account` · `org` · `project` — read-only tokens
        refused (not a GET).


        Restart the postgres server (insta-db only) so settings written with
        ALTER SYSTEM that need a restart (wal_level, max_wal_senders,
        max_replication_slots, …) take effect. Connections drop while it
        restarts. Waits for the restart to finish. `pending: true` means it was
        still in progress when the wait ran out — GET .../database/instance
        reads `running` throughout, so confirm with `SHOW <setting>` instead. A
        suspended database stays suspended — its next connection starts it with
        the new settings. Gated — deploy.
      operationId: restartDatabase
      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
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DbInstanceInfo'
        '202':
          description: Default Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApprovalRequired'
        '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
        pending:
          description: >-
            true when the provider accepted the change asynchronously and it has
            not been applied yet — the ceiling/volume fields are then the
            PRE-change values. Re-read (GET) to see the applied state. Absent
            when the change was applied synchronously.
          type: boolean
        publicAccess:
          description: >-
            postgres (insta-db) — false: the public endpoint refuses every
            connection (SQLSTATE 28000) and the database is not reachable from
            the internet; only the private network lane connects. Change it with
            PUT .../services/{serviceId}/access. Absent when the provider does
            not report it.
          type: boolean
        privateAccess:
          description: >-
            postgres (insta-db) — true: the database has a private network
            connection string (privateConnString, and DATABASE_PRIVATE_URL in
            the service credentials) for compute services on the insta-compute
            provider. Change it with PATCH .../database/settings
            {privateAccess}. Absent when the provider does not report it.
          type: boolean
        privateConnString:
          description: >-
            the connection string over the private network lane, WITHOUT the
            password (the full URL is DATABASE_PRIVATE_URL in the service
            credentials). Present only while privateAccess is on.
          type: string
        privateLane:
          description: >-
            GET .../database/instance only — this deployment's private-lane
            switches, so a UI can render the toggles without a probing write
          type: object
          properties:
            enabled:
              description: >-
                the private network access toggle and closing public access are
                available on this deployment; false: both answer 409 {code:
                private_lane_disabled}
              type: boolean
            console:
              description: >-
                the platform console reaches databases over the private network
                lane; false: it uses the public endpoint, so it cannot browse a
                database whose public access is closed
              type: boolean
          required:
            - enabled
            - console
        warnings:
          description: >-
            what this change will break and how to fix it (e.g. compute services
            bound to DATABASE_PRIVATE_URL when private access is turned off).
            Advisory: the change was applied.
          type: array
          items:
            type: string
    ApprovalRequired:
      type: object
      properties:
        status:
          type: string
          enum:
            - approval_required
        approvalId:
          format: uuid
          type: string
        action:
          description: the gated action, or a comma-joined compound set — prefer `actions`
          type: string
        actions:
          description: every capability this approval covers
          type: array
          items:
            type: string
        message:
          type: string
        url:
          description: the console page where a project admin reviews this request
          type: string
        nextActions:
          type: array
          items:
            $ref: '#/components/schemas/NextAction'
    Error:
      type: object
      properties:
        error:
          type: string
      required:
        - error
    NextAction:
      type: object
      properties:
        op:
          description: >-
            Neutral logical action id, e.g. "service.add" — NOT an operationId
            or a CLI/MCP tool name; each client maps it to its own surface.
          type: string
        reason:
          description: Natural-language, human/LLM-facing "why do this now".
          type: string
        args:
          description: >-
            Suggested, flat named arguments; "<placeholder>"s where a value is
            unknown.
          type: object
          additionalProperties: true
        gated:
          description: True if the action passes a governance gate.
          type: boolean
      required:
        - op
        - reason
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Session access JWT or an API token (`insta_<prefix>_<secret>`).

````