---
title: "Undo your own last move of your own hours."
method: POST
path: "/work-sessions/move/undo"
tags: ["work-sessions"]
---

# Undo your own last move of your own hours.

`POST /work-sessions/move/undo`

## Request

- Base URL: `https://restivity.ai/api/v1`
- URL: `https://restivity.ai/api/v1/work-sessions/move/undo`
- Auth: OAuth 2 (authorization code, authorization URL `https://restivity.ai/oauth/authorize`, token URL `https://restivity.ai/api/oauth/token`, scopes: `pomodoro:write`)

The sessions go back to the project and workspace the last move took them from (and their task, when it is still there), priced again there, and the owner/admins of that workspace are told. Only the person who moved their own hours may undo — the one who moved alone, or the requester of an approved request (never the admin who approved) — and only while the sessions are still where the move left them and the project they came from still takes them. Billed or invoiced sessions never move (`sessions_frozen`, `session_ids`). Anyone else, or a session never moved: 409 `move_not_undoable`.

## Request body

- UndoWorkSessionMoveInput
  - `session_ids` string[], required: The ids of the sessions whose last move is undone (1–500) — the caller’s own hours, moved by the caller (alone, or approved on the caller’s request), from one workspace to one workspace.

## Response `200`

Undone: per session `before` (where the move had left it) and `after` (back home).

- WorkSessionMoveResult
  - `status` 'moved' | 'pending' | 'declined' | 'undone', required
  - `code` 'move_needs_approval': On 202: the move waits for the owner/admins of the workspace the hours leave.
  - `message` string
  - `request_id` string, uuid, nullable, required
  - `origin_workspace_id` string, uuid, required
  - `destination_workspace_id` string, uuid, required
  - `approver_ids` string[]
  - `session_ids` string[]
  - `moved` object[]
    - `session_id` string, uuid, required
    - `before` object, required: The anchors and price before the move (an Undo — `POST /work-sessions/move/undo` — puts it back there). Money as the preview shows it: a rate or amount the caller may not read is null.
    - `after` object, required
  - `undone` object[]: On an undo (status `undone`): per session the anchors and price before the undo (`before`, where the move had left it) and after (`after`, back where it was earned, priced again there). Money the caller may not read is null.
    - `session_id` string, uuid, required
    - `before` object, required: The anchors and price before the move (an Undo — `POST /work-sessions/move/undo` — puts it back there). Money as the preview shows it: a rate or amount the caller may not read is null.
    - `after` object, required

## Other responses

- `400`: Invalid request shape.
- `401`: Missing or invalid access token.
- `403`: Token lacks the required scope.
- `404`: No such session among those the caller can see.
- `409`: `move_not_undoable` (not your own last move of your own hours, or the hours left where it put them), `sessions_frozen` (billed or invoiced since — `session_ids`), or a Trash code.
- `422`: Request body failed schema validation.
- `429`: Rate-limit exceeded for this tier.

---

[API](https://skmtc.dev/restivity/apis/restivity-rest-api.md) · [All operations](https://skmtc.dev/restivity/apis/restivity-rest-api/llms.txt) · [OpenAPI document](https://skmtc.dev/restivity/apis/restivity-rest-api/revisions/5764e41ebb3a?raw)
