> ## Documentation Index
> Fetch the complete documentation index at: https://docs.getlurk.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Activity

> The ledger. One receipt per change: who or what did it, what changed, the balance after, and why.

A ledger never deletes. Undo writes a new receipt that reverses the first, and both stay. In the dashboard: [Read Activity](https://docs.getlurk.com/dashboard/read-activity.md).

Every receipt names who acted: a rule, a person or an agent. Agents show as "via agent". Read them with `GET /v1/activity` (filters: `user`, `rule`, `unit`, `cause`, `transfer`, `since`, `until`), explain one with `GET /v1/activity/{id}`, or see receipts, skipped rules and held changes together with `GET /v1/activity-feed`.

## What a receipt says

| Field | Means |
| - | - |
| `user` | The person it happened to |
| `by`, `via`, `agent` | Who acted: `rule:<key>`, a person, a key or an agent, and how. `via` is one of `api`, `agent`, `lurky`, `dashboard`, `system`, and later `chat` and `device`, which are not available yet: accept values you do not know |
| `event` | The event it came from, or `null` for a change made by hand or by a schedule |
| `lines` | One for each unit that changed: the change and the balance after |
| `cause` | Why, when it was not a rule's change: `spend`, `use`, `send` or `receive`. `null` for a rule, a give or an undo |
| `note`, `reference` | What the person wrote, or the reason on a spend; your own order or scan ID |
| `transfer` | On the two receipts of one `units.send`: the same ID on both |
| `reverses`, `reversed_by` | The receipt an undo reverses, and the one that reversed this |

## The feed

`GET /v1/activity-feed` is one list, newest first, of what happened and what did not: receipts (`given`), rules that heard an event and did nothing (`skipped`, with the reason; kept for at least 30 days), changes waiting for a person (`held`). Filter with `kind`, `user`, `rule`, `unit`, `since` and `until` (both times included).

* A `unit` filter keeps only receipts and held changes of that unit: a skip moved no unit.
* A held change that a person decides becomes a receipt or a `hold_refused` skip, never both.

## Undo a receipt

An owner or admin signed in to the dashboard can undo a receipt: it writes a new receipt that reverses the first, and both stay. A key, an agent or Lurky cannot.

* It is refused (`validation_failed`) when the receipt is itself an undo, was already undone, changed nothing, or the balance no longer allows taking it back (it would go below the unit's floor or past its cap; a unit's direction does not stop an undo).
* A receipt that is part of a merge is taken back with the merge (`POST /v1/users/unmerge`), and a send is two receipts that stand together: send it back with another send.
* Limits a rule counted are not given back.

## Export receipts

An owner or admin can save the receipts that match a filter as one CSV file from the dashboard: [Export a CSV](https://docs.getlurk.com/dashboard/read-activity.md#export-a-csv). It is not part of the public API.

## Skipped is an answer

When a rule does not apply, the event's answer says why in `skipped`: a limit was reached, a budget ran out, a condition was false, a supply is gone. Nothing was changed and nothing is wrong. Use it to explain to your user (and to yourself) why nothing happened.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.