# Activity tools

[All tool areas](/docs/tools.md). Each tool acts within your access.

## Activity

### list_activity

List the organization's activity log, newest first: what changed, who or what did it (a person, an agent, the system), and the changeset it came from. An entry's data needs orders:amounts and customers:contact where it belongs (and organization-level billing:read for billing events, members:read for member/invitation events, agents:read for agent events, or api_keys:write for API-key events); otherwise it's null and the entry is marked masked. Someone limited to a location, entity, or product sees only events that say they're about what they're covered for. Page back with `before`.

Reads · Members of an organization · Needs activity:read

#### Input

- `limit` — integer; optional. The most results to return (default 50) minimum: 1; maximum: 100; default: 50
- `before` — string; optional. An event id; returns events older than it

#### Output

- `events` — array; required. 
  - `events[]` — object; optional. 
    - `events[].id` — string; required. 
    - `events[].type` — string; required. 
    - `events[].actor` — object; required. 
      - `events[].actor.type` — string; required.  Allowed: "user", "agent", "system", "guest"
      - `events[].actor.id` — string or null; required. 
      - `events[].actor.via` — string; required.  Allowed: "session", "api\_key", "oauth", "internal", "public"
      - `events[].actor.name` — string or null; required. 
    - `events[].subject` — object; required. 
      - `events[].subject.type` — string; required. 
      - `events[].subject.id` — string; required. 
      - `events[].subject.label` — string or null; required. 
    - `events[].locationName` — string or null; required. 
    - `events[].changes` — array or null; required. 
      - `events[].changes[]` — object; optional. 
        - `events[].changes[].field` — string; required. 
        - `events[].changes[].before` — string or null; required. 
        - `events[].changes[].after` — string or null; required. 
    - `events[].changesetId` — string or null; required. 
    - `events[].draftedBy` — object or null; optional. Set when the command bar's assistant drafted the change this event came from, and the person (the actor) previewed and applied it: the assistant (agt_...) and its model call (aic_...). Always sent; null otherwise
      - `events[].draftedBy.agentId` — string; required. 
      - `events[].draftedBy.callId` — string; required. 
    - `events[].data` — object or null; required. What the event recorded, which can hold amounts and guests' names. Null without both orders:amounts and customers:contact where the event belongs; billing, member/invitation, agent, and API-key events also need billing:read, members:read, agents:read, and api_keys:write respectively at the organization
      - `events[].data.*` — any value; optional. 
    - `events[].masked` — boolean; optional. True when `data` was withheld
    - `events[].createdAt` — string; required.  format: "date-time"
- `nextBefore` — string or null; required. 
