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

# sabaoth backup create

> Take an on-demand backup of a PostgreSQL service

Requests an on-demand backup of a service. Asks for confirmation unless you pass `--yes`, because running it twice queues two backups.

```bash theme={null}
sabaoth backup create <service-id> [--name <name>] [--yes] [--org <org-id>] [--json]
```

## Arguments

**service-id** `string` *required*

The ID of the service to back up, for example `clu_abc`.

## Flags

**--name** `string`

A name for the backup, such as `pre-upgrade`. Use lowercase letters, numbers and hyphens only. If left out, the server picks a name.

**--yes** `boolean` (default: false)

Skip the confirmation prompt. Required when there's no terminal.

**--org** `string`

Organization the service belongs to, instead of the selected one.

**--json** `boolean` (default: false)

Print the result as JSON on stdout.

## Examples

```bash theme={null}
sabaoth backup create clu_abc
sabaoth backup create clu_abc --name pre-upgrade
sabaoth backup create clu_abc --name pre-migration --yes --json
```

## Confirmation

```text theme={null}
Create a backup in Acme (org_abc):
  Cluster:  clu_abc
  Name:     pre-upgrade

Backup creation is queued, not immediate, and repeating it queues duplicate work.
Continue? [y/N]
```

Only `y` continues. Anything else cancels with `DECLINED` (exit `2`).

If there's no terminal and you didn't pass `--yes`, the command fails with `CONFIRMATION_REQUIRED` (exit `2`) and **sends no request**.

## Output

The command returns as soon as the backup is queued, not when it finishes:

```json theme={null}
{
  "id": "bak_abc",
  "service_id": "clu_abc",
  "name": "pre-upgrade",
  "status": "scheduled",
  "backup_type": "on-demand",
  "created_at": "2026-01-01T00:00:00Z",
  "expires_at": "2026-02-01T00:00:00Z"
}
```

Check on progress with [`sabaoth backup list`](https://docs.sabaothcloud.com/cli/commands/backup-list).

### Backup statuses

| Status | Meaning |
| - | - |
| `scheduled` | Queued and waiting to start. |
| `running` | In progress. |
| `completed` | Finished and ready to restore from. |
| `failed` | The backup didn't succeed. |
| `expired` | Past its retention period. |

## Behavior

* The organization check happens on the server. Unlike `postgres delete`, this command doesn't look up the service first, so it sends a single request. A service in another organization is reported as `CLUSTER_NOT_FOUND`.
* Restoring a backup is done in the dashboard. See [Backups](https://docs.sabaothcloud.com/dashboard/backups.md).

## If the result is unknown

If the request was sent but no response came back, the backup may or may not have started. The CLI **never retries**, to avoid starting a second one. It fails with `UNKNOWN_MUTATION_OUTCOME`. Run `sabaoth backup list <service-id>` to check before trying again.

## Errors

| Code | Exit | Meaning |
| - | - | - |
| `DECLINED` | 2 | You didn't confirm. No backup was requested. |
| `CONFIRMATION_REQUIRED` | 2 | No terminal to ask for confirmation. Re-run with `--yes`. |
| `CLUSTER_NOT_FOUND` | 1 | No service with this ID in the effective organization. |
| `BACKUP_CONFLICT` | 1 | A backup may already be running, or the service can't take one yet. Check with `sabaoth backup list`. |
| `BACKUP_NOT_PERMITTED` | 1 | The server refused. Common causes, in order: your email isn't verified, your role can't start backups, the organization has no active subscription, or backups aren't allowed for this service. |
| `BACKUP_REQUEST_REJECTED` | 1 | The API rejected the request, for example because the name isn't valid. |
| `INVALID_CLUSTER_ID` | 1 | The API rejected the value as a service ID. |
| `UNKNOWN_MUTATION_OUTCOME` | 1 | No response. See [above](#if-the-result-is-unknown). |

## Related

* [`sabaoth backup list`](https://docs.sabaothcloud.com/cli/commands/backup-list)
* [Backups in the dashboard](https://docs.sabaothcloud.com/dashboard/backups.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.