---
title: "Rollback an app definition"
method: POST
path: "/api/apps/{id}/rollback"
tags: ["Apps"]
---

# Rollback an app definition

`POST /api/apps/{id}/rollback`

Restores a snapshot through the ordinary schema migration engine. Lossy restores require migration directives.

## Path parameters

- `id` string, required

## Request body

- object
  - `version` integer, required
  - `migration` object
  - `forceElementBreak` string[]

## Response `200`

Rolled back app

- object
  - `app` object, required
    - `id` string, required
    - `name` string, required
    - `description` string
    - `definition` union, required
      - object
      - unknown[]
        - unknown
      - string
      - number
      - boolean
    - `definitionError` object[]
      - `path` string, required
      - `message` string, required
    - `createdAt` string, required
    - `updatedAt` string, required
  - `migration` object, required
    - `scanned` integer, required
    - `backfilled` integer, required
    - `coerced` integer, required
    - `mapped` integer, required
    - `elsed` integer, required
    - `purgedValues` integer, required
    - `idxRebuilt` integer, required
    - `detachedRows` integer, required
    - `orphanFields` string[], required
    - `userConfigChanged` string[], required

## Other responses

- `400` — Invalid rollback definition or schema migration
- `403` — Permission denied
- `404` — App or app version not found

## Changes

- **2026-08-07** `0375890be8c4` — 1 info
  - added the required property `migration/detachedRows` to the response with the `200` status
- **2026-08-07** `06cac6a7c5bc` — 1 breaking, 11 info
  - the `app` response's property type changed from no type to `object` for status `200`
  - added the media type `application/json` for the response with the status `400`
  - added the media type `application/json` for the response with the status `403`
  - added the media type `application/json` for the response with the status `404`
  - …8 more
- **2026-08-05** `2ecf536b66f2` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/desplega-ai/apis/agent-swarm-api/changes/api/apps/:id/rollback/post.md)

---

[API](https://skmtc.dev/desplega-ai/apis/agent-swarm-api.md) · [All operations](https://skmtc.dev/desplega-ai/apis/agent-swarm-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/desplega-ai/agent-swarm-api/revisions/db1079e034dc/schema)
