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

# Update

> Change branch expiry or automatic preview cleanup without changing its data source.



## OpenAPI

````yaml /openapi.json patch /v1/orgs/{orgId}/projects/{projectId}/databases/{databaseId}/branches/{branchId}
openapi: 3.1.0
info:
  title: Korve API
  version: 0.1.0
  description: >-
    Typed control plane for deploying applications and explicitly provisioning
    their managed infrastructure.
servers:
  - url: https://api.korve.dev
security: []
paths:
  /v1/orgs/{orgId}/projects/{projectId}/databases/{databaseId}/branches/{branchId}:
    patch:
      tags:
        - databaseBranches
      summary: Update
      description: >-
        Change branch expiry or automatic preview cleanup without changing its
        data source.
      operationId: databaseBranches.update
      parameters:
        - name: orgId
          in: path
          required: true
          schema:
            type: string
          description: The organization's id (UUID) or slug — either form is accepted.
        - name: projectId
          in: path
          required: true
          schema:
            type: string
          description: The project's id (UUID) or slug — either form is accepted.
        - name: databaseId
          in: path
          required: true
          schema:
            type: string
        - name: branchId
          in: path
          required: true
          schema:
            type: string
      requestBody:
        required: true
        x-korve-max-bytes: 1048576
        content:
          application/json:
            schema:
              type: object
              properties:
                expiresInDays:
                  type:
                    - integer
                    - 'null'
                deleteOnPreviewClose:
                  type: boolean
              additionalProperties: false
      responses:
        '200':
          description: Updated database branch.
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                  sourceDatabaseId:
                    type: string
                  databaseId:
                    type:
                      - string
                      - 'null'
                  name:
                    type: string
                    pattern: ^[a-z][a-z0-9-]{1,61}$
                  environment:
                    type: string
                    pattern: ^[a-z][a-z0-9-]{0,38}$
                  source:
                    type: object
                    properties:
                      kind:
                        type: string
                        enum:
                          - current
                          - backup
                          - point_in_time
                      backupId:
                        type: string
                      pointInTime:
                        type: string
                        format: date-time
                    required:
                      - kind
                    additionalProperties: false
                  status:
                    type: string
                    enum:
                      - queued
                      - hydrating
                      - ready
                      - failed
                      - expired
                      - promoted
                  progressPercent:
                    type: integer
                  hydrationMode:
                    type: string
                    enum:
                      - full_copy
                    description: >-
                      Launch implementation hydrates a full independent copy; it
                      is not copy-on-write.
                  hydrationProgressPercent:
                    type: integer
                  connectionReady:
                    type: boolean
                    description: >-
                      True only when the independent database safely accepts
                      customer connections.
                  fullyHydrated:
                    type: boolean
                    description: >-
                      True only after every data block is copied and verified.
                      Full-copy branches never report connectionReady before
                      this is true.
                  deleteOnPreviewClose:
                    type: boolean
                  expiresAt:
                    type:
                      - string
                      - 'null'
                    format: date-time
                    description: Defaults to seven days; null disables automatic expiry.
                  createdAt:
                    type: string
                    format: date-time
                required:
                  - id
                  - sourceDatabaseId
                  - databaseId
                  - name
                  - environment
                  - source
                  - status
                  - progressPercent
                  - hydrationMode
                  - hydrationProgressPercent
                  - connectionReady
                  - fullyHydrated
                  - deleteOnPreviewClose
                  - expiresAt
                  - createdAt
        '404':
          description: No such branch for this database.
        '422':
          description: Invalid expiry.
      security:
        - apiKey: []
        - session: []
components:
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      bearerFormat: korve_api_key
    session:
      type: apiKey
      in: cookie
      name: korve.session_token

````