WebApp
Web Apps

Delete an application.

Changed on

This function deletes an application: it stops the application's running process and removes its container, moves the application's directory aside to a .bak sibling (kept for verification or rollback rather than deleted), and removes the application from the account's registry.

Deleting an application cannot be undone, so it requires an explicit confirmation: verify must be 1 to proceed. A verify of 0 makes no changes and returns a confirmation-required error.

The application's domain is not affected; subdomains are managed independently.

On failure, the metadata.error_category field carries a machine-readable failure category.

Important:

The verify parameter is required and has no default. You must set it to 1 to confirm this irreversible operation.

get/WebApp/delete

Request

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

Query parameters

namestring required
Example:my-app

The application's unique name (slug).

verify0 | 1 required
Example:1

Confirmation that this irreversible deletion should proceed.

  • 1 — Confirm and delete: the container is torn down and the application's directory is moved aside to <name>.bak (kept for verification or rollback, not hard-deleted).
  • 0 — Make no changes; the call returns a confirmation-required error.

This parameter is required and has no default.

delete_database0 | 1
Example:1

Whether to also delete the application's database and its user.

  • 1 — Delete the database along with the application.
  • 0 — Delete the application and leave the database in place.

Warning: for a database this application created, 1 destroys it and everything in it, and this cannot be undone. For a linked one (db.origin is link), 1 is refused instead — see below.

This parameter is required, with no default, whenever the application has a database it created. Omitting it then fails the call and changes nothing at all — the database, the container, and the registry record are all left untouched, so the call can simply be retried with a choice supplied. The system never guesses about data loss.

For a linked database, this parameter is never required — 0 or omitting it both succeed, and the dedicated dbuser created for the link is always removed either way, since it holds no data of its own. Passing 1 is refused instead: the application is not deleted, and nothing changes. An application with no database ignores this parameter entirely.

Check the application's db field (from WebApp::list) to know which case applies.

Deleting a created database requires the account's mysql feature and the server's MySQLClient role. Without them the application is still deleted, the database is left in place, and the response carries a warning. A linked application's dbuser removal is skipped the same way.

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": "delete",
  "module": "WebApp",
  "result": {
    "data": {
      "removed": 1
    },
    "status": 1
  }
}

Changes

    • info

      added the new optional query request parameter delete_database

    • info

      added the optional property // to the response with the status

    • info

      api operation id WebApp_delete removed and replaced with WebApp-delete