---
title: "Create Backup"
method: POST
path: "/v0/sites/{site_id}/environments/{env_id}/backups"
tags: ["sites"]
---

# Create Backup

`POST /v0/sites/{site_id}/environments/{env_id}/backups`

Creates a new backup for an environment.

## Path parameters

- `site_id` string, required
- `env_id` string, required

## Request body

- BackupCreationRequest
  - `element` 'all' | 'code' | 'database' | 'files', required — Backup element type
  - `keep_for` integer, required — Number of days to keep the backup

## Response `200`

- WorkflowCreationResponse
  - `active_description` string — Active description of the workflow
  - `id` string, required — Workflow ID
  - `number_of_tasks` integer — Number of tasks in the workflow

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `403` — Forbidden
- `404` — Not Found
- `500` — Internal Server Error
- `503` — Service Unavailable

---

[API](https://skmtc.net/pantheon/apis/pantheon-public-api-service.md) · [All operations](https://skmtc.net/pantheon/apis/pantheon-public-api-service/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/pantheon/pantheon-public-api-service/revisions/94758829689e/schema)
