---
title: "List Api Events"
method: GET
path: "/events"
tags: ["usage"]
---

# List Api Events

`GET /events`

Cursor-paginated activity log for the caller's team.

Role-scoped identically to ``GET /v1/usage``: admins/owners see every
row in the team, members see only rows attributable to their own API
keys plus their own MCP-origin rows. Sort is ``(timestamp DESC,
id DESC)``; iterate ``next_cursor`` until ``null`` to drain.

## Query parameters

- `api_key_id` string, nullable — Optional API-key UUID filter.
- `operation_id` string, nullable — Optional exact-match filter on the event's OpenAPI ``operationId``.
- `trigger_source` 'api' | 'mcp', nullable — Restrict to ``api`` or ``mcp`` origin rows.
- `status` 'succeeded' | 'failed', nullable — ``succeeded`` → 200-399; ``failed`` → status >= 400.
- `from` string, date-time, nullable — ISO8601 UTC lower bound (inclusive). Defaults to ``to - 7d``.
- `to` string, date-time, nullable — ISO8601 UTC upper bound (exclusive). Defaults to ``now``.
- `limit` integer — Max rows per page (cap: 200).
- `cursor` string, nullable — Opaque cursor from the previous page's ``next_cursor``.

## Headers

- `Moda-Version` '2026-04-12' | '2026-05-01'

## Response `200`

Successful Response

- CursorPageEventResponse
  - `data` EventResponse[], required — Items in this page, in the endpoint's declared sort order.
    - `id` string, required — Raw UUID of the event row (UUIDv7, time-sortable).
    - `timestamp` string, date-time, required — When the request was received (naive UTC).
    - `operation_id` string, required — OpenAPI operationId for REST calls; MCP tool name for MCP calls.
    - `endpoint` string, required — HTTP method + path template, e.g. ``POST /v1/tasks``.
    - `trigger_source` string, required — ``api`` or ``mcp``.
    - `status_code` integer, required — HTTP status returned to the caller.
    - `duration_ms` integer, required — Wall-clock duration of the request in milliseconds.
    - `error_code` string, nullable
    - `error_message` string, nullable
    - `credits_charged` integer, nullable — Credits charged for this call; ``null`` for non-billable rows.
    - `prompt_preview` string, nullable — First ~200 chars of the prompt for task-type handlers. ``null`` for historical rows or non-task operations.
    - `api_key` ApiKeyRef, required — Reference to the API key that originated an event. ``id`` and ``name`` are ``null`` for MCP-origin rows (no key) or rows whose key was deleted (FK ``ON DELETE SET NULL``). ``created_by_name`` is the human name of the key's creator (admin view only -- members always see their own keys and don't need this cue).
      - `id` string, nullable, required — Raw UUID of the key, or ``null`` when unavailable.
      - `name` string, nullable, required — Human-readable key name, or ``null`` when unavailable.
      - `created_by_name` string, nullable — Display name of the user who created the key; ``null`` if unavailable.
    - `resource` ResourceRef — Reference to the resource an event produced or addressed. Only present when ``resource_type`` is ``'task'`` or ``'canvas'``. Canvas fields are individually nullable: the canvas may have been deleted, or the task may pre-date its eventual canvas.
      - `id` string, required — Raw UUID of the resource.
      - `type` string, required — Resource kind, e.g. ``task`` or ``canvas``.
      - `canvas_id` string, nullable — Raw UUID of the associated canvas, if any.
      - `canvas_name` string, nullable — Canvas name, if the canvas still exists.
      - `canvas_url` string, nullable — Frontend URL for the canvas, if any.
  - `next_cursor` string, nullable — Opaque cursor to pass as ``?cursor=`` on the next request. ``null`` means you've reached the end of the collection.

## Other responses

- `401` — Authentication required.
- `403` — Permission denied for this scope.
- `404` — Resource not found.
- `409` — Conflict (idempotency / resource state).
- `422` — Request validation failed.
- `429` — Rate limit exceeded.
- `500` — Internal error.

---

[API](https://skmtc.dev/moda/apis/moda-public-api.md) · [All operations](https://skmtc.dev/moda/apis/moda-public-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/moda/moda-public-api/revisions/b34cb4cca59e/schema)
