WebsiteBackup

Start a backup of a website's files and databases

Changed on

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.
post/WebsiteBackup/create_backup

Request

  • Base URL
    https://cpanel-server.tld:2083/execute
  • Auth
    HTTP basic

Request body application/x-www-form-urlencoded

databasestring[]

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.
domainstring required

The website to back up.

Note: The account must own this domain.

emailstring

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 request

{
  "database": [
    "user_wordpress",
    "user_store"
  ],
  "domain": "example.com",
  "email": "user@example.com"
}

Response

HTTP Request was successful.

apiversioninteger

The version of the API.

funcstring

The name of the method called.

modulestring

The name of the module called.

Example response

{
  "apiversion": 3,
  "func": "create_backup",
  "module": "WebsiteBackup",
  "result": {
    "data": {
      "operationId": "2026-08-18T12:53:12Z.1"
    },
    "status": 1
  }
}

Changes