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

# Create an on-demand backup

> For a Database project, target_database (the logical database to back up) is required in the body. Omit the body entirely for App/VM projects.



## OpenAPI

````yaml /api-reference/openapi.json post /project/{project_id}/backups
openapi: 3.0.0
info:
  title: Shard Cloud API
  description: >-
    API reference for Shard Cloud's authenticated management endpoints — Apps,
    Databases, VMs, Custom Docker Images, and project-level Alerts & Backups.
    Every endpoint on this page requires a JWT bearer token (see Authentication
    below). CDN endpoints have their own reference under the CDN tab.
  version: 2.0.0
servers:
  - url: https://shardcloud.app/api
    description: API base path
security: []
tags:
  - name: Databases
    description: PostgreSQL, MySQL, MongoDB, and Redis database services.
  - name: Apps
    description: Web application deployment, files, domains, and configuration.
  - name: VMs
    description: Full Linux virtual machines with SSH access.
  - name: Custom Images
    description: User-built Docker images, deployable straight to an App.
  - name: Project
    description: >-
      Resource alerts and backups — shared across App, Database, and VM
      projects.
paths:
  /project/{project_id}/backups:
    post:
      tags:
        - Project
      summary: Create an on-demand backup
      description: >-
        For a Database project, target_database (the logical database to back
        up) is required in the body. Omit the body entirely for App/VM projects.
      parameters:
        - name: project_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RestoreOrCreateDatabaseBackupRequest'
      responses:
        '200':
          description: Backup created
          content:
            application/json:
              schema:
                type: object
                properties:
                  backup:
                    $ref: '#/components/schemas/Backup'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: No valid subscription
      security:
        - JWTAuth: []
components:
  schemas:
    RestoreOrCreateDatabaseBackupRequest:
      type: object
      description: >-
        Required body for POST .../backups and POST
        .../backups/{backup_id}/restore, but only when the target project is a
        Database (omit entirely for App/VM projects).
      required:
        - target_database
      properties:
        target_database:
          type: string
          description: >-
            Name of the logical database inside the database service to back up
            / restore into.
    Backup:
      type: object
      properties:
        id:
          type: string
          format: uuid
        created:
          type: string
          format: date-time
        project_id:
          type: string
          format: uuid
        done:
          type: boolean
        database_name:
          type: string
          description: Set only for database backups — the database that was backed up.
        is_vm:
          type: boolean
    Error:
      type: object
      properties:
        error:
          type: string
  securitySchemes:
    JWTAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Send your API token (Dashboard → Settings → API Token) as
        `Authorization: Bearer <token>`.

````