---
title: "Start a backup of a website's files and databases"
method: POST
path: "/WebsiteBackup/create_backup"
tags: ["WebsiteBackup"]
---

# Start a backup of a website's files and databases

`POST /WebsiteBackup/create_backup`

## Request

- Base URL: `https://cpanel-server.tld:2083/execute`
- URL: `https://cpanel-server.tld:2083/execute/WebsiteBackup/create_backup`
- Auth: HTTP basic

This function starts a backup of the document root of the `domain`
parameter and returns an `operationId` return value immediately.

**Note:**

* A detached background process writes the archive, so a large backup
  never holds the request open.
* Pass the `operationId` return value to the
  `WebsiteBackup::operation_status` function to poll progress and read
  the terminal state. The `WebsiteBackup::list_operations` function
  recovers the id if the client loses it.
* Pre-flight checks run synchronously and fail this call. The account
  must own the domain, no other backup or restore may be running for the
  account, each named database must be a safe single path component, and
  the estimated archive must fit in the remaining disk quota.
* The function records anything that goes wrong after it backgrounds the
  work in the operation log, and reports it through the
  `WebsiteBackup::operation_status` function.
* The operation runs under a two-hour wall-clock cap. Exceeding that cap
  fails the operation.
* This function requires the account's `backup` feature and is
  unavailable to demo (shared) accounts.

## Request body `application/x-www-form-urlencoded`

- object
  - `database` string[]: A database to include in the archive. **Note:** * The function dumps the database with its schema, data, routines, events and triggers. * This parameter is repeatable. Omit it entirely for a files-only backup. * The function checks only the name's path safety before this call returns. The privileged dump step inside the background operation enforces whether the account owns the database, so naming a database you do not own still returns an `operationId` and then reports `failed` through the `WebsiteBackup::operation_status` function.
  - `domain` string, required: The website to back up. **Note:** The account must own this domain.
  - `email` string: Address to notify when the backup finishes. Omit it to send none. **Note:** * The function notifies on **failure as well as success**, and the message states which. * The function rejects the address synchronously if it is not a valid email address, but it is not otherwise restricted to the account. * Delivery is best-effort. The function logs a send failure server-side and never fails the operation, so a successful `ready` status is not evidence the mail arrived.

## Response `200`

HTTP Request was successful.

- object
  - `apiversion` integer: The version of the API.
  - `func` string: The name of the method called.
  - `module` string: The name of the module called.
  - `result` object
    - `data` object: The identifier of the background operation this call started.
      - `operationId` string: Identifier of the detached operation that performs the work. **Note:** Pass it to the `WebsiteBackup::operation_status` function to poll progress. The `WebsiteBackup::list_operations` function recovers it if the client loses it.
    - `errors` string[], nullable: List of errors if the API failed.
    - `messages` string[], nullable: List of messages generated by the API.
    - `metadata` object
    - `status` 0 | 1: * `1` - Success. * `0` - Failed. Check the `errors` field for more details.
    - `warnings` string[], nullable: List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running an API.

## Changes

- **2026-09-12** `99adb57e7a5d`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/cpanel/apis/cpanel-uapi/changes/WebsiteBackup/create_backup/post.md)

---

[API](https://skmtc.dev/cpanel/apis/cpanel-uapi.md) - [All operations](https://skmtc.dev/cpanel/apis/cpanel-uapi/llms.txt) - [OpenAPI document](https://skmtc.dev/cpanel/apis/cpanel-uapi/revisions/05239220da37?raw)
