---
title: "Start a manual backup"
method: POST
path: "/api/projects/{projectName}/backups"
tags: ["backups"]
---

# Start a manual backup

`POST /api/projects/{projectName}/backups`

## Request

- Base URL: `https://api.hostim.dev`
- URL: `https://api.hostim.dev/api/projects/{projectName}/backups`
- Auth: HTTP bearer

Creates a manual backup run of the whole project, or of one database or volume when kind and name are given.

## Path parameters

- `projectName` string, required

## Request body

- BackupItemRef: Selects one database or volume for a manual backup. Both fields empty or missing means the whole project.
  - `kind` 'postgres' | 'mysql' | 'volume'
  - `name` string: Name of the database or volume

## Response `202`

Manual backup started

- BackupRun
  - `name` string, required: The name of the Backup custom resource
  - `trigger` string, required: What created the run
  - `scheduledTime` string, date-time: The cron tick this run belongs to
  - `phase` string, required: Pending, Running, Succeeded, PartiallyFailed or Failed
  - `startedAt` string, date-time: When the run started
  - `completedAt` string, date-time: When the run reached a terminal phase
  - `items` BackupItem[], required: The state of each database and volume in the run
    - `kind` string, required: postgres, mysql or volume
    - `name` string, required: Name of the database or volume
    - `phase` string, required: Pending, Running, Succeeded or Failed
    - `id` string: The restic short snapshot ID of this item
    - `sizeBytes` integer: Full size of the backed up data. Missing for backups made before sizes were recorded.
    - `error` string: The reason the item failed
    - `pruned` boolean: Restic removed this snapshot under the retention policy; it can no longer be downloaded

## Other responses

- `400`: Invalid kind or name
- `401`: User is not authorized
- `404`: Project or resource not found
- `409`: Backups are not enabled, the repository is not ready, or a manual backup is already running
- `500`: Internal server error

---

[API](https://skmtc.dev/hostim/apis/hostim-api.md) · [All operations](https://skmtc.dev/hostim/apis/hostim-api/llms.txt) · [OpenAPI document](https://skmtc.dev/hostim/apis/hostim-api/revisions/37c35e1026a9?raw)
