---
title: Access log of a grant
description: "The access log of one grant by cursor: who created, changed or revoked it (API key or app) and per-day read counts. No IP addresses. Kept 24 months."
canonical: "https://www.tracepass.eu/docs/list-access-grant-activity"
locale: en
source: "https://www.tracepass.eu/docs/list-access-grant-activity"
---

# Access log of a grant

> The access log of one grant by cursor: who created, changed or revoked it (API key or app) and per-day read counts. No IP addresses. Kept 24 months.

```http
GET /api/v1/access-grants/{id}/activity
```

The grant's log rows, newest first, by cursor. Grant events (`grant_created`, `grant_changed`, `grant_revoked`) name who acted: `via` is the API key (by its label) or the OAuth app, and is `null` for the dashboard; `actorId` is the user it acted for. `read` rows carry one count per passport, channel and day.

No IP addresses are kept, and rows are deleted after 24 months. An id that belongs to another company answers `404`.

**Who may call it.** An API key only when its owner switched on "May manage access grants" for that key on the Developer page (off by default; otherwise `403 access_grants_not_enabled`). An OAuth token needs the `access_grants:read` scope and an editor role or above.

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `Authorization` | header | string | yes | `Bearer <token>` — either a `tp_` API key (Developer → API Keys; simplest, for server-to-server) or an OAuth 2.0 access token (Developer → OAuth Apps; for user-authorized apps, scoped + revocable). The Authentication page has the full OAuth flow and scope list. |
| `id` | path | string (24 hex chars) | yes | Access grant ID. |
| `limit` | query | integer | no | Page size, 1 to 100 (default 50). |
| `cursor` | query | string (24 hex chars) | no | The `nextCursor` of the previous page. |

## Examples

```bash
curl -sS https://app.tracepass.eu/api/v1/access-grants/6650c1d2e3f4a5b6c7d8e9f0/activity \
  -H "Authorization: Bearer tp_REDACTED_xxxxxxxxxxxx"
```

```typescript
const res = await fetch(`https://app.tracepass.eu/api/v1/access-grants/${grantId}/activity`, {
  headers: { Authorization: `Bearer ${process.env.TRACEPASS_API_KEY}` },
});
const { data, nextCursor } = await res.json();
```

```python
import os, requests
res = requests.get(
    f"https://app.tracepass.eu/api/v1/access-grants/{grant_id}/activity",
    headers={"Authorization": f"Bearer {os.environ['TRACEPASS_API_KEY']}"},
)
res.raise_for_status()
rows = res.json()["data"]
```

## Responses

### 200 — Log rows

```json
{
  "data": [
    {
      "id": "6650d2e3f4a5b6c7d8e9f0a1",
      "kind": "grant_created",
      "day": "2026-06-01T00:00:00.000Z",
      "channel": null,
      "passportId": null,
      "count": null,
      "detail": null,
      "actorId": "6650a0a0a0a0a0a0a0a0a0a0",
      "via": { "kind": "api_key", "keyId": "6650b0b0b0b0b0b0b0b0b0b0", "label": "SAP prod" },
      "lastAt": "2026-06-01T09:30:00.000Z"
    }
  ],
  "nextCursor": null
}
```

### 403 — Switch off

```json
{
  "error": "access_grants_not_enabled",
  "message": "This API key may not manage access grants. Its owner can switch on 'May manage access grants' for the key on the Developer page."
}
```

### 404 — Not found

```json
{ "error": "Access grant not found" }
```

## Related

- [Read an access grant](https://www.tracepass.eu/docs/get-access-grant.md)
- [List access grants](https://www.tracepass.eu/docs/list-access-grants.md)
