---
title: "Roll back a patch."
method: POST
path: "/apps/{appId}/releases/{releaseId}/patches/{patchId}/rollback"
tags: ["patches"]
---

# Roll back a patch.

`POST /apps/{appId}/releases/{releaseId}/patches/{patchId}/rollback`

## Request

- Base URL: `https://api.shorebird.dev/api/v1`
- URL: `https://api.shorebird.dev/api/v1/apps/{appId}/releases/{releaseId}/patches/{patchId}/rollback`
- Auth: one of:
  - HTTP bearer
  - HTTP bearer

Marks the patch rolled back. A rolled-back patch is no longer
served by the patch check, and devices running it on Flutter
versions newer than 3.22.3 revert to the most recent patch that is
not rolled back, or to the base release. Undo with `rollforward`.
Requires the `patches.rollback` permission.

Rolling back a patch that is already rolled back changes nothing
and answers `304`. Either way the cached patch-check responses for
the release are cleared; if that fails the request answers `424`
(`patch_rollback_cache_error`) with the patch already rolled back,
and repeating the request retries the clear.

## Response `204`

The patch was rolled back.

## Other responses

- `304`: The patch was already rolled back.
- `400`: A path id is not an integer (`release_id_malformed`, `patch_id_malformed`), the release does not belong to the app (`release_app_mismatch`), or the patch does not belong to the release (`patch_release_mismatch`).
- `403`: The caller lacks the `patches.rollback` permission.
- `404`: The app (`app_not_found`), release (`release_not_found`) or patch (`patch_not_found`) does not exist.
- `424`: Updating the patch failed (`patch_rollback_error`), or the patch was rolled back but clearing cached patch-check responses failed (`patch_rollback_cache_error`); repeat the request to retry.
- `default`: Standard error response. Emitted for any non-2xx status where a body can be decoded into an [ErrorResponse].

---

[API](https://skmtc.dev/shorebird/apis/shorebird-codepush-api.md) - [All operations](https://skmtc.dev/shorebird/apis/shorebird-codepush-api/llms.txt) - [OpenAPI document](https://skmtc.dev/shorebird/apis/shorebird-codepush-api/revisions/941da8871d10?raw)
