---
title: "Undo a habit's Done or Skip in today's routine"
method: POST
path: "/completed-activity/{activity_id}/undo"
tags: ["completed-activity"]
---

# Undo a habit's Done or Skip in today's routine

`POST /completed-activity/{activity_id}/undo`

## Request

- Base URL: `https://api.focusbear.io` (the document declares no server; this is the origin it was published from)
- URL: `https://api.focusbear.io/completed-activity/{activity_id}/undo`
- Auth: HTTP bearer

Deletes the habit's log in today's routine and rebuilds routine state from the logs left. A routine that was completed normally is reopened and the user is pointed back at the undone habit (409 if another routine is active). A force-completed routine stays completed. Sent webhooks, push notifications and competency level changes are not reversed. Clients must also drop the entry from their offline sync queue, otherwise a later sync re-creates the log.

## Path parameters

- `activity_id` string, uuid, required

## Response `200`

- UndoCompletedActivityResponse
  - `activity_sequence_id` string, required
  - `current_activity_id` string, nullable, required: The user's current habit after the undo, or null when the routine is not the active one.
  - `routine_reopened` boolean, required: Whether a completed routine was reopened because its habit was undone.

## Other responses

- `404`: The habit has no log in today's routine.
- `409`: Another routine is active, or the routine has nothing left to resume.

---

[API](https://skmtc.dev/focusbear/apis/focusbear-api.md) - [All operations](https://skmtc.dev/focusbear/apis/focusbear-api/llms.txt) - [OpenAPI document](https://skmtc.dev/focusbear/apis/focusbear-api/revisions/3a83a3b9a811?raw)
