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

# Create

> Restore a recovery point or timestamp into a newly provisioned isolated database. The source is never overwritten.



## OpenAPI

````yaml /openapi.json post /v1/orgs/{orgId}/projects/{projectId}/databases/{databaseId}/restores
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}/restores:
    post:
      tags:
        - databaseRestores
      summary: Create
      description: >-
        Restore a recovery point or timestamp into a newly provisioned isolated
        database. The source is never overwritten.
      operationId: databaseRestores.create
      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
      requestBody:
        required: true
        x-korve-max-bytes: 1048576
        content:
          application/json:
            schema:
              type: object
              properties:
                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
                targetName:
                  type: string
                  pattern: ^[a-z][a-z0-9-]{1,61}$
                  description: >-
                    Name for the new isolated database. The source is never
                    overwritten.
                targetEnvironment:
                  type: string
                  pattern: ^[a-z][a-z0-9-]{0,38}$
                targetRegion:
                  type: string
                targetSku:
                  type: string
              required:
                - source
                - targetName
                - targetEnvironment
                - targetRegion
                - targetSku
              additionalProperties: false
      responses:
        '202':
          description: Restore queued.
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                  sourceDatabaseId:
                    type: string
                  targetDatabaseId:
                    type:
                      - string
                      - 'null'
                  status:
                    type: string
                    enum:
                      - queued
                      - restoring
                      - verifying
                      - ready
                      - failed
                      - promoted
                  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
                  progressPercent:
                    type: integer
                  error:
                    type:
                      - string
                      - 'null'
                  createdAt:
                    type: string
                    format: date-time
                  completedAt:
                    type:
                      - string
                      - 'null'
                    format: date-time
                required:
                  - id
                  - sourceDatabaseId
                  - targetDatabaseId
                  - status
                  - source
                  - progressPercent
                  - error
                  - createdAt
                  - completedAt
        '404':
          description: No such source database, backup, environment, region, or SKU.
        '409':
          description: The target database name already exists.
        '422':
          description: >-
            Timestamp is outside the continuous recovery window or target is
            invalid.
      security:
        - apiKey: []
        - session: []
components:
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      bearerFormat: korve_api_key
    session:
      type: apiKey
      in: cookie
      name: korve.session_token

````