---
title: "Redeploy a custom deployment in place"
method: POST
path: "/platform/deployments/custom/{id}/redeploy"
tags: ["Platform"]
---

# Redeploy a custom deployment in place

`POST /platform/deployments/custom/{id}/redeploy`

## Request

- Base URL: `https://api.imprezahost.com/v1`
- URL: `https://api.imprezahost.com/v1/platform/deployments/custom/{id}/redeploy`
- Auth: API key in header `X-API-Key` and API key in header `X-API-Secret`

Rebuilds an existing custom deployment from its **current source**
on the same agent — re-pulls the image, re-clones the watched git
ref at its new HEAD, or rebuilds, using the existing startup and
retained-release recovery policy.

Crucially, this reuses the **same deployment**, so the domain, the
host port, and the reverse-proxy route are all preserved: your URL
never changes. Prefer this over uninstall + recreate for shipping a
new build — recreate is a heavier flow (and only the auto-allocated
`*.imprezaapps.com` subdomain is reused across a recreate, via the
per-name stickiness).

Uploaded-source apps may select a retained context_id; omission
rebuilds the selected retained archive. Build recipe, paths and public
build variables remain fixed. The selected source can differ from the
running release after failure or rollback. Image refs and Git URLs
remain create-time choices.

Same effect as a git push when auto-deploy is connected, but
triggered explicitly with your API key.

## Path parameters

- `id` string, required

## Request body

- object
  - `context_id` string: Optional retained archive version for an uploaded-source app.
  - `vars` object: Optional env vars merged over the deployment's stored env before the rebuild — rotate a secret or add a var without an uninstall+recreate. System vars (DEPLOYMENT_ID, DOMAIN_URL, HOST_PORT, …) are preserved.

## Response `202`

Redeploy enqueued (deployment flips to `updating`)

## Other responses

- `401`: Invalid or missing API credentials
- `404`: Resource not found
- `409`: Deployment is mid-operation (still installing/updating/removing), its agent was revoked, a concurrent operation changed the app, or its selected upload is temporary/consumed. Upload a fresh retained source and supply context_id to migrate an older uploaded-source app.

---

[API](https://skmtc.dev/imprezahost/apis/impreza-host-public-api.md) · [All operations](https://skmtc.dev/imprezahost/apis/impreza-host-public-api/llms.txt) · [OpenAPI document](https://skmtc.dev/imprezahost/apis/impreza-host-public-api/revisions/db86511f604f?raw)
