# Undo a practice answer

Source: https://workroad.app/docs/api/undo-practice-answer

`POST https://workroad.app/api/v1/practice-sessions/{sessionId}/undo`

Takes back an answer, as the app's undo does: the review is removed from the card's history, the card's schedule goes back to what it was, and the card is queued in the session again under a new `itemId`. Use `undoableItemId` from `getPracticeSession`. Undoing the same answer again changes nothing.

- MCP tool: `undoPracticeAnswer` on `https://workroad.app/api/mcp`
- Required scopes: activity:delete
- Test mode: `POST https://workroad.app/api/test/v1/practice-sessions/{sessionId}/undo` checks the request and returns the example response without changing anything.

## Path parameters

- `sessionId`: string (uuid), required. Practice session id from `startPracticeSession`, scoped to the key's user.

## Headers

- `Idempotency-Key`: string, optional, 1-255 visible ASCII characters. Makes the POST safe to retry: a retry with the same key and body replays the first response, and the same key with a different body returns 409 `idempotency_conflict`. Kept for 24 hours. Over MCP it is the `idempotencyKey` argument.

## Request body

JSON.

- `itemId`: string (uuid), required. `undoableItemId` from `getPracticeSession`: the session's newest answer.

## Response

`200` OK

- `data`: object, required
  - `itemId`: string (uuid), required
  - `undone`: `true`, required. The answer's review was removed and the card restored. It is queued in the session again under a new `itemId`.

### Example

```json
{
  "data": {
    "itemId": "1e2d3c4b-5a69-4788-9a0b-1c2d3e4f5a6b",
    "undone": true
  }
}
```

## Errors

Every error has the body `{ "error": { "code", "message", "details" } }`.

- `400`: Invalid request body or query
- `401`: Missing, invalid, disabled or expired API key
- `403`: The API key lacks the required scope
- `404`: `not_found`: no answered card with that `itemId` in this session, or it was a cram session.
- `405`: Method not allowed. Use a method from the Allow header.
- `409`: `conflict`: the card was reviewed again since this answer, so it is no longer the newest review and can't be taken back. The Idempotency-Key was reused with a different request body, or a request with the same key is still in progress.
- `429`: Rate limit exceeded. Wait for Retry-After before retrying. The rate-limit headers are absent when the key's own limiter rejected the request before the per-endpoint bucket check ran.
- `500`: Internal server error
