# Activity

The team's audit log for API access: keys, Spaces and command line sign-ins.

Web version: https://www.svanja.com/docs/api/activity/

Activity is your team's audit log for API access. It shows who created a Space, changed an API key, or signed in through the command line, along with when it happened. Actions taken in the app are logged too, so a key created on the API Keys page appears here alongside a Space created by a script.

To read the log, your API key needs the Activity area, which is included in Full access and Read-only keys. If a key is limited to specific Spaces, it sees events for those Spaces plus team-wide key and sign-in events. See [The REST API](https://www.svanja.com/docs/api/) for more on how keys work.

`GET /activity` records three kinds of events:

- Spaces created, changed, or deleted
- API keys created, changed, rotated, or revoked
- Command line sign-ins approved or denied

You can filter the list, for example by event type or key. Results use cursor pagination, so pass `meta.pagination.next_cursor` as `cursor` to get the next page.

## Operations

| Operation | What it does | Effect | Endpoints |
| --- | --- | --- | --- |
| `activity.read` | Read public API activity. | Reads only | `GET /activity` |

## Endpoints

### GET /api/v1/activity

List public API activity

Lists public API audit activity for the authenticated team. Project rows are narrowed for selected-project keys, while team-level API key and CLI authorization rows remain team-scoped. Raw activity properties, internal ids, names, token material, provider payloads, mail content, and assistant prompts are never exposed.

| Parameter | In | Type | Required | Notes |
| --- | --- | --- | --- | --- |
| `per_page` | query | integer | no | Page size. Defaults to 25 and is capped at 100. |
| `cursor` | query | string | no | Signed cursor returned by the previous activity page. |
| `sort` | query | one of occurred_at, -occurred_at | no | Sort activity by occurrence time. A leading dash means descending. |
| `resource_type` | query | one of project, api_key, cli_device_authorization | no | Filter activity by public resource family. |
| `resource_id` | query | string | no | Public resource id. When resource_type is present, the id must match that resource family's public id shape. |
| `actor_key_id` | query | string | no | API key display id for key-originated activity. |
| `actor_user_id` | query | string | no | Public user ULID for user-originated activity. |
| `event_type` | query | one of project_created, project_updated, project_deleted, team_api_key_created, team_api_key_renamed, team_api_key_preset_changed, team_api_key_expiration_changed, team_api_key_rotated, team_api_key_revoked, team_api_key_project_scope_changed, cli_device_authorization_approved, cli_device_authorization_denied, cli_device_authorization_consumed | no | Public activity event identifier. |
| `created_from` | query | string | no | Inclusive occurred_at lower bound. Must include seconds and Z or an explicit UTC offset. |
| `created_to` | query | string | no | Inclusive occurred_at upper bound. Must include seconds and Z or an explicit UTC offset. |
