# Revert edit

`POST` `https://streetartcities.com/api/edits/{id}/revert`

Undo an accepted edit, restoring the fields it changed. Only works if the entity hasn't changed since. Merges and deletions can't be reverted.

## Path parameters

- **id** `string` — required

## Request body

- **reviewComment** `string`

## Requirements

Needs an [access token](/authentication/tokens/). When using OAuth, the token needs the [`edits:review`](/authentication/scopes/) scope.

## Responses

### `200` The reverted edit

- **edit** `Edit` — required
  - **id** `string` — required
  - **entityId** `string`
    Missing for pending edits that create a new entity.
  - **entityType** `string` — required
    The kind of entity being changed. `site` is a city.
    Allowed values: `marker`, `artist`, `site`, `tag`, `calendar-event`, `community-note`
  - **actions** `object` — required
    A map of changes. Keys are dot-paths into the entity (e.g. `title` or `attributes.access_note`). Values are either a literal to set, or an operation: `{ "$add": [...], "$remove": [...] }` for arrays, or `{ "$unset": true }` to remove a field. The special keys `$mergeInto` (another entity id), `$delete` (`true`, must be the only action) and `$renameTo` (a new name, tags only, not combined with `$mergeInto`) merge, delete or rename an existing entity.
    - ***** `any`
  - **status** `string` — required
    Allowed values: `submitted`, `accepted`, `rejected`, `reverted`
  - **createdBy** `string` — required
  - **createdAt** `string` — required
  - **reviewedBy** `string`
    `system` when the edit was applied automatically.
  - **reviewedAt** `string`
  - **revertedBy** `string`
  - **revertedAt** `string`
  - **editComment** `string`
  - **editAttachments** `array string[]`
    Links to images attached to the edit comment.
  - **reviewComment** `string`
  - **assignedReviewers** `array string[]` — required
    Groups and/or user ids that may review this edit.
  - **snapshotOld** `object`
    - ***** `any`
  - **snapshotNew** `object`
    - ***** `any`
  - **history** `array object[]` — required
    - _Array of object_
      - **status** `string` — required
        Allowed values: `submitted`, `accepted`, `rejected`, `reverted`
      - **at** `string` — required
      - **by** `string` — required
      - **comment** `string`
  - **site** `string`
  - **country** `string`
  - **attributes** `object`
    Extra details about the edit. `oauthClientId` is set when it was made through a third-party app.
    - ***** `any`
  - **reviewUrl** `string` — required
    Link to the page on the website where the edit can be reviewed, or its status seen.

### `400` Invalid request

- **error** `string` — required

### `401` Not logged in

- **error** `string` — required

### `403` No permission

- **error** `string` — required

### `404` Not found

- **error** `string` — required
