---
title: "Redeploy an application, pulling source updates first."
method: POST
path: "/WebApp/redeploy"
tags: ["WebApp", "Web Apps"]
---

# Redeploy an application, pulling source updates first.

`POST /WebApp/redeploy`

## Request

- Base URL: `https://cpanel-server.tld:2083/execute`
- URL: `https://cpanel-server.tld:2083/execute/WebApp/redeploy`
- Auth: HTTP basic

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`.

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.

## Query parameters

- `name` string, required

## Request body `application/x-www-form-urlencoded`

- object
  - `sshkeypass` string: The one-off passphrase to unlock the source's selected SSH key for this pull only; it is never stored. Required when that key is currently passphrase-protected; irrelevant, and ignored, otherwise. **Security note:** This parameter carries a secret and must ride only in the POST request body. The system rejects both a non-`POST` request and a `sshkeypass` key in the URL query string before it reads the passphrase, so it cannot leak into access logs, proxy logs, or browser history. This check does not apply to the `bin/uapi` CLI or LiveAPI Perl/PHP bindings; on the CLI in particular, passing `sshkeypass` inline puts it in `ps` output and shell history, so prefer an interactive or file-based passphrase input there instead.

## Response `200`

HTTP Request was successful.

- object
  - `apiversion` integer: The version of the API.
  - `func` string: The name of the method called.
  - `module` string: The name of the module called.
  - `result` object
    - `data` object
      - `deploy_id` string: The unique identifier of this deploy.
      - `sse_url` string, url-path: The SSE URL to stream the deploy's progress.
      - `task_id` string: The task id of the SSE process.
    - `errors` string[], nullable: List of errors if the API failed.
    - `messages` string[], nullable: List of messages generated by the API.
    - `metadata` object
      - `error_category` 'build_failed' | 'port_conflict' | 'requires_build' | 'start_failed' | 'missing_output' | 'limit_exceeded' | 'domain_in_use' | 'domain_unavailable' | 'domain_temporary' | 'internal_error' | 'source_passphrase_required' | 'concurrent_update', nullable: The machine-readable failure category. Only present when `status` is `0` and the error occurred before the background task was dispatched. Build and runtime pipeline failures occur asynchronously; they are recorded in `last_deploy.error_category` after the task finishes and are accessible via `WebApp::list`. * `build_failed` — The build step failed. The error message includes the breached resource cap when one applied. * `port_conflict` — The application's port is already in use. * `requires_build` — The application must be built before it can deploy, and no build command is configured. * `start_failed` — The container started but is not listening on a port, so the application is unreachable; it most likely exited immediately. * `missing_output` — The build finished, but the directory the application is served from does not exist. The output directory does not match what the build writes. * `limit_exceeded` — Deploying this application would push the account's number of running application containers to or past its maximum allowed applications. * `domain_in_use` — Another of this account's applications has claimed the application's domain since it was last configured. * `domain_unavailable` — The application's domain now exists on the account as a non-webapp domain since it was last configured, and `use_existing_domain` was not set on it. * `domain_temporary` — The application's domain does not exist and sits under one of the server's temporary domains, which the system cannot create a domain beneath. Point the application at the temporary domain itself, confirmed with `use_existing_domain`. * `internal_error` — The deploy task stopped on an unexpected internal error. Recorded only in `last_deploy.error_category`. * `source_passphrase_required` — The source's selected SSH key is currently passphrase-protected and `sshkeypass` was missing or incorrect. * `concurrent_update` — The application's source configuration changed while a passphrase-protected key pull was in progress for it. Retry the request.
    - `status` 0 | 1: - `1` - Success. - `0` - Failed. Check the `errors` field for more details.
    - `warnings` string[], nullable: List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.

## Changes

- **2026-11-04** `05239220da37`: 1 warning
  - added the new `internal_error` enum value to the `result/metadata/error_category` response property for the response status `200`
- **2026-09-12** `99adb57e7a5d`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/cpanel/apis/cpanel-uapi/changes/WebApp/redeploy/post.md)

---

[API](https://skmtc.dev/cpanel/apis/cpanel-uapi.md) - [All operations](https://skmtc.dev/cpanel/apis/cpanel-uapi/llms.txt) - [OpenAPI document](https://skmtc.dev/cpanel/apis/cpanel-uapi/revisions/05239220da37?raw)
