v1

latestOpenAPI 3.0.2cPanel License2026-08-06657427.1 MB
WebApp
Web Apps

Redeploy an application, pulling source updates first.

This function redeploys an already-deployed application. For Git-sourced applications, it pulls the latest changes from the configured branch before deploying. Otherwise it behaves exactly like WebApp::deploy.

Note:

This function starts an asynchronous task and returns immediately. Stream the returned sse_url for live progress, or poll the task. While the task runs, the application's status is deploying. When the task finishes the status transitions to running on success or errored on failure. Use WebApp::list to read the current status and inspect last_deploy for the outcome and any failure category.

Important:

This function is idempotent. If you call it while a deploy for the same application is already running, it returns the in-flight task's identifiers instead of starting a new deploy.

If this call fails before the task is dispatched (for example, when the application does not exist), metadata.error_category carries a machine-readable failure category. Build and runtime failures occur inside the background task and are recorded asynchronously in last_deploy.error_category, which is accessible via WebApp::list.

get/WebApp/redeploy

Query parameters

namestring required
Example:my-app

The application's unique name (slug).

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": "redeploy",
  "module": "WebApp",
  "result": {
    "data": {
      "deploy_id": "dp-20260612-0002",
      "sse_url": "/sse/UserTasks/00000000_5c6c8b18228a35/deploy.log",
      "task_id": "00000000/5c76ec5566332c"
    },
    "status": 1
  }
}