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

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.

Endpoint: POST /WebsiteBackup/create_backup
Version: 11.138.0.10
Security: BasicAuth

## Request fields (application/x-www-form-urlencoded):

  - `database` (array)
    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.
    Example: ["user_wordpress","user_store"]

  - `domain` (string, required)
    The website to back up.

Note:
The account must own this domain.
    Example: "example.com"

  - `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.
    Example: "user@example.com"

## Response 200 fields (application/json):

  - `apiversion` (integer)
    The version of the API.
    Example: 3

  - `func` (string)
    The name of the method called.
    Example: "create_backup"

  - `module` (string)
    The name of the module called.
    Example: "WebsiteBackup"

  - `result` (object)

  - `result.data` (object)
    The identifier of the background operation this call
started.

  - `result.data.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.
    Example: "2026-08-18T12:53:12Z.1"

  - `result.errors` (array,null)
    List of errors if the API failed.

  - `result.messages` (array,null)
    List of messages generated by the API.

  - `result.metadata` (object)

  - `result.status` (integer)
    * 1 - Success.
* 0 - Failed. Check the errors field for more
  details.
    Enum: 0, 1

  - `result.warnings` (array,null)
    List of warnings generated by the API. Warnings
describe non-critical failures or other problematic
conditions noted while running an API.


