## Connect a collector

Workspace administrators can use the Audit Logs API with an active paid Kit subscription. If you’re on a trial, access begins when your paid subscription starts. The token owner must remain a workspace administrator, and the workspace’s [API IP restrictions](/docs/api-reference#ip-restrictions) apply.

1. Open [API Tokens](/account/api_tokens) and select **Create Token**.
2. On **New API Token**, name the token for your collector, select **Audit logs** (`audit_logs:read`), then select **Create Token**.
3. On **Save your API token**, select **Copy Token** and store it securely. Kit shows the value once. Open **Usage Examples** for ready-to-copy HTTP and cURL requests.

## Test the connection

Set the `KIT_AUDIT_TOKEN` environment variable to the token you saved and run an unfiltered request.

```bash
curl --include 'https://startupkit.app/api/v1/audit_logs?limit=1' \
  -H "Authorization: Bearer $KIT_AUDIT_TOKEN"
```

A `200 OK` response confirms the connection. An empty `data` array means there are no events available to return.

The endpoints return `401 Unauthorized` when the token is missing or invalid, and `403 Forbidden` when a valid token lacks access. If the request meets those access checks but the workspace lacks an active paid Kit subscription, both endpoints return `402 Payment Required`.

## List events

Use `action` and `since` to fetch a specific kind of event from a given time onward.

```bash
curl --get 'https://startupkit.app/api/v1/audit_logs' \
  -H "Authorization: Bearer $KIT_AUDIT_TOKEN" \
  --data-urlencode 'action=data_export.requested' \
  --data-urlencode 'since=2026-11-27T10:00:00Z'
```

| Parameter | Meaning |
|---|---|
| `action` | One exact action from the catalog. |
| `since` | Include events recorded at or after this RFC 3339 timestamp with a time zone. |
| `until` | Include events recorded before this RFC 3339 timestamp with a time zone. |
| `limit` | Page size from 1 to 100. Defaults to 100. |
| `cursor` | The opaque `next_cursor` from the previous successful page. |

For `since` and `until`, use uppercase `T` and either uppercase `Z` or a numeric UTC offset such as `-05:00`. You can include up to six fractional digits for seconds. The API rejects leap seconds.

The response is ordered from earliest to latest in the feed. Each event has a stable ID, a UTC `recorded_at` timestamp, an actor, a target, and an action-specific `context` object. When Kit attributes an event to no workspace member, the actor has type `system` and its ID is `null`. This includes automated activity and support actions where Kit omits the operator’s identity.

```json
{
  "data": [
    {
      "id": "aevt_example",
      "action": "data_export.requested",
      "recorded_at": "2026-11-27T10:01:00.000000Z",
      "actor": { "type": "member", "id": "memb_example" },
      "target": { "type": "data_export", "id": "dex_example" },
      "context": { "verification_method": "password" }
    }
  ],
  "pagination": {
    "next_cursor": "opaque_cursor",
    "has_more": false
  }
}
```

## Resume polling

1. Request the first page without a cursor. For ongoing collection, leave `until` unset.
2. Store the events using `id` to deduplicate them. Save `pagination.next_cursor` only after the page has been stored.
3. Pass that cursor in the next request and keep your filters unchanged. Request the next page immediately while `has_more` is true. Otherwise, keep the cursor and use it at your next polling interval, even when the page was empty.

Kit has recorded supported activity since launch for workspaces with an active paid Kit subscription. It retains each event for 90 days. If you reactivate a subscription, you can still read any events within that window.

A checkpoint remains usable as long as it covers the expired history. If a request returns `410 Gone`, it means events after the checkpoint have already expired from the workspace feed. Start a fresh query without the cursor to read the surviving events. Keep deduplicating by ID when you replay a page or restart collection.

Invalid filters and cursors that do not match the current workspace or filters return `400 Bad Request`. The response includes `error: invalid_parameter` and the affected `parameter`.

## Discover actions

```bash
curl 'https://startupkit.app/api/v1/audit_logs/actions' \
  -H "Authorization: Bearer $KIT_AUDIT_TOKEN"
```

The catalog returns `data` with the supported `action` and `target_type` pairs. It covers the account export lifecycle, manual API token creation and revocation, changes to API IP restrictions, and revocation of workspace member access.

`api_token.created` records creation in workspace API settings. `api_token.revoked` records revocation from those settings or from the token owner’s personal API token list.

`data_export.download_started` records an authorized handoff to file storage. The feed contains audit metadata. A request event can include the export verification method, and an IP restriction change can report whether the restriction is enabled.