---
title: "Restore a soft-deleted Pomodoro session."
method: POST
path: "/pomodoro/{id}/restore"
tags: ["pomodoro"]
---

# Restore a soft-deleted Pomodoro session.

`POST /pomodoro/{id}/restore`

## Request

- Base URL: `https://restivity.ai/api/v1`
- URL: `https://restivity.ai/api/v1/pomodoro/{id}/restore`
- Auth: OAuth 2 (authorization code, authorization URL `https://restivity.ai/oauth/authorize`, token URL `https://restivity.ai/api/oauth/token`, scopes: `pomodoro:write`)

Clears deleted_at if the row was soft-deleted within the last 30 days. Returns 404 outside the window — the pg_cron purge has already run.

## Path parameters

- `id` string, uuid, required

## Response `200`

The restored Pomodoro session.

- PomodoroSession
  - `id` string, uuid, required
  - `user_id` string, uuid, required
  - `task_id` string, uuid, nullable, required
  - `project_id` string, uuid, nullable, required
  - `start_time` string, required
  - `end_time` string, required
  - `duration` integer, required: Planned duration in seconds.
  - `elapsed_time` integer, required: Actual elapsed time in seconds.
  - `type` 'work' | 'short-break' | 'long-break', required
  - `status` 'active' | 'paused' | 'completed' | 'interrupted' | 'abandoned', required
  - `notes` string, required
  - `completion_notes` string, nullable
  - `interruptions` integer, required
  - `created_at` string, required
  - `deleted_at` string, nullable, required
  - `time_remaining` integer, nullable: Seconds remaining when paused / interrupted; null otherwise.
  - `resumed_at` string, nullable
  - `subtask_ids` string[], nullable
  - `firestore_id` string, nullable
  - `workspace_id` string, uuid, nullable

## Other responses

- `400`: Invalid request shape.
- `401`: Missing or invalid access token.
- `403`: Token lacks the required scope.
- `404`: No such Pomodoro session in the 30-day restore window.
- `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)
