Redeploy an application, pulling source updates first.
Changed onThis 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.
When the source's selected SSH key is currently passphrase-protected, the pull cannot happen inside the asynchronous task -- its arguments are serialized to disk, and a passphrase must never persist there -- so this function requires sshkeypass, validates it, and runs the pull synchronously (adding to this call's latency) before queuing the rest of the pipeline, which never needs the key.
GET is also available, without a request body, when the source's selected SSH key is not currently passphrase-protected.
Request
- Base URLhttps://cpanel-server.tld:2083/execute
- AuthHTTP basic
Query parameters
The application's unique name (slug).
Request body application/x-www-form-urlencoded
Example request
{
"sshkeypass": "correct-horse-battery-staple"
}Response
HTTP Request was successful.
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
}
}Changes
- warning
added the new
internal_errorenum value to the//response property for the response status
- warning
- info
endpoint added
- info