> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gloo.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Events

> GET /api/v2/events — the cursor-paginated canonical event log an External App reconciles webhook delivery against. Opaque cursors, type filtering, the two-layer visibility rule, and the 30-day window.

{/* forge-v2-compatibility-notes */}

> [!NOTE]
>
> The reference panel describes the current **v3** operation. The notes below describe its **v2 compatibility** API. Follow the v3 request schema for current calls: v3 can move identifiers from the body or query into the URL. Keep the v2 method, path, and payload together when using the compatibility API.

## v2 compatibility notes

Webhooks notify; this endpoint is the source of truth. Deliveries are scheduled and retried independently and carry no sequence counter, so a receiver cannot tell from the delivery stream alone whether it missed something. `GET /api/v2/events` returns the same events out of the canonical log in insertion order behind an opaque cursor — which is what makes a gap detectable and recoverable.

```
GET /api/v2/events
```

Every event returned is a [v2 envelope](https://docs.gloo.com/forge/run/webhooks.md#the-v2-envelope), the same shape a webhook delivery carries. The envelope's `id` is the join key between the two surfaces.

Every webhook's `id` is readable here within the 30-day window: Forge does not deliver an event it could not write to this log.

## Authentication

External App credential. Requires the `events:read` permission as the **entry** point — but holding it alone returns nothing. See [Visibility](#visibility) below.

## Query parameters

**cursor** `string`

Opaque pagination token from a previous response's `nextCursor`. Omit to start at the beginning of the retention window.

Treat the value as opaque: its encoding is not part of the contract and may change. Round-trip it verbatim — do not parse, truncate, or reconstruct it. A cursor advances past the **last row of the page you received**, so paging with the cursor you were handed neither repeats nor skips a row.

> [!WARNING]
>
> Two events emitted in the same millisecond may straddle a page boundary. The cursor is stable across that boundary, but you must still deduplicate on each envelope's `id` — that is the only identity guaranteed to be unique and stable across pages, replays, and webhook delivery.

**types** `string`

Comma-separated event types to restrict the page to, e.g. `workflow.completed,step.completed`. Omit for every event visible to the caller.

Filtering narrows the result set only — it never widens visibility. An event you have no scope for stays invisible whether or not you name its type.

**limit** `number`

Page size, 1 to `100`. Defaults to `50`. A value above `100` is `400` `too_big`; a non-integer is a `400`.

## Response

**events** `object[]`

Events in insertion order, oldest first.

**event envelope**

**id** `string`

Canonical event id. **The dedupe key** — stable across pages, replays, and webhook delivery of the same event.

**type** `string`

Event type, e.g. `workflow.completed`.

**apiVersion** `string`

Envelope version — currently `2026-08-01`. Treat an unrecognised value as "stop parsing", not "parse optimistically".

**occurredAt** `number`

Unix epoch milliseconds.

**orderingKey** `string | null`

The natural stream this event belongs to — `run_<runId>` for run-scoped events. `null` when there is no natural stream.

**initiator** `object | null`

`{ kind: "externalApp" | "user" | "system", id }`, or `null` when attribution could not be resolved.

**data** `object`

The event payload — byte-identical to the v1 webhook body for the same event.

**nextCursor** `string | null`

Cursor for the next page, in `data.nextCursor` (not `meta`), or `null` when the window is exhausted. A page is read first and filtered afterwards, so a **short or empty page with a non-null cursor is normal**: keep paging until the cursor is `null`. `null` means "you are caught up as of this read", not "no more events will ever exist" — poll again later with the last non-null cursor you stored.

> [!NOTE]
>
> There is deliberately **no `sequence` field** on the envelope. A per-`orderingKey` counter would be a transactional write on the run or session row, putting every parallel branch of a workflow DAG into write contention for the same document. Ordering comes from paging this endpoint, not from a counter on the event.

## Visibility

Three conditions, all required. Failing any one of them means the event is simply absent from your pages — there is no error, and no way to tell it existed.

**1. Entry scope: the app holds `events:read`**

Without it the request itself is a `403`. This is the gate on the endpoint, not on any particular event.

**2. Per-event scope: the app's roles cover that event's `subscriptionScope`**

Each event type declares the catalog permissions required to see it — `runs:read` for `workflow.*` and `step.*`, `audit:read`, `grants:read` and `policies:read` for `approval.*`, and so on (the [full map](https://docs.gloo.com/forge/run/webhooks.md#event-types-and-subscription-scopes)). An app with `events:read` and nothing else sees an empty log. `"admin"`-scoped events are operator-only and never appear here for any app, whatever scopes it holds.

**3. Initiator match: the app caused the event**

An app sees only events it initiated. This is the same predicate the webhook fan-out uses — one shared function, so the push surface and the pull surface cannot drift into disagreeing about what an app is allowed to see.

> [!WARNING]
>
> Scope is evaluated **at read time** against the scopes the app's role grants cover, not at the time the event was emitted. Revoking a role retroactively hides matching events from this endpoint, including ones the app already received by webhook. Giving a role does not backfill visibility beyond the retention window.

## Retention

The window is **30 days**, matching webhook delivery retention. Events older than that are pruned and are not recoverable through this endpoint. An outage longer than the window is a data-loss event for your integration — alert on your reconciliation cursor falling behind long before it approaches 30 days.

## Worked example: recovering from an outage

Your receiver was down from 02:00 to 06:00. Some deliveries were retried into your endpoint and failed; some dead-lettered. Rather than replaying each delivery, page the log forward from the last cursor you committed.

```bash cURL
curl -G https://api.forge.gloo.com/v2/events \
  -H "Authorization: Bearer $FORGE_API_KEY" \
  --data-urlencode "cursor=eyJvIjoxNzg1NTAwMDAwMDAwfQ" \
  --data-urlencode "types=workflow.completed,workflow.started" \
  --data-urlencode "limit=100"
```

```ts TypeScript
const EVENT_ENVELOPE_API_VERSION = "2026-08-01";

let cursor: string | undefined = await store.getCursor();
for (;;) {
  const search = new URLSearchParams({ types: "workflow.completed,workflow.started", limit: "100" });
  if (cursor) search.set("cursor", cursor);
  const response = await fetch(`${baseUrl}/api/v2/events?${search}`, {
    headers: { Authorization: `Bearer ${apiKey}` },
  });
  if (!response.ok) throw new Error(`Event read failed: ${response.status}`);
  const { data } = await response.json();

  for (const event of data.events) {
    if (event.apiVersion !== EVENT_ENVELOPE_API_VERSION) continue; // shape we don't know
    if (await store.alreadySeen(event.id)) continue; // the webhook already landed it
    await handle(event);
    await store.markSeen(event.id);
  }

  if (data.nextCursor == null) break;
  cursor = data.nextCursor;
  // Commit the cursor with the work it covers, so a crash resumes, not repeats.
  await store.putCursor(cursor);
}
```

```python Python
cursor = store.get_cursor()
while True:
    resp = session.get(
        f"{base_url}/api/v2/events",
        params={"cursor": cursor, "types": "workflow.completed", "limit": 100},
        headers={"Authorization": f"Bearer {api_key}"},
    )
    resp.raise_for_status()
    page = resp.json()["data"]

    for event in page["events"]:
        if store.already_seen(event["id"]):
            continue
        handle(event)
        store.mark_seen(event["id"])

    cursor = page["nextCursor"]
    if cursor is None:
        break
    store.put_cursor(cursor)
```

```json 200
{
  "data": {
    "events": [
      {
        "id": "evt_01J8ZK3QW9",
        "type": "workflow.completed",
        "apiVersion": "2026-08-01",
        "occurredAt": 1785500000000,
        "orderingKey": "run_k17abc",
        "initiator": { "kind": "externalApp", "id": "fca_01J8" },
        "data": {
          "event": "workflow.completed",
          "runId": "k17abc",
          "workflowId": "k17def",
          "outcome": "succeeded"
        }
      }
    ],
    "nextCursor": "eyJvIjoxNzg1NTAwMDAwMDAxfQ"
  },
  "meta": { "requestId": "req_01J8ZK3R2T" }
}
```

> [!TIP]
>
> Your handler is a no-op when called twice with the same `event.id`. That single property is what turns at-least-once delivery plus a cursor walk into an exactly-once integration.

## Errors

> [accordion] 400 bad\_request
>
> A non-integer `limit`, or a malformed `cursor`. A cursor from a different deployment or a hand-edited one lands here rather than silently returning the wrong window.

> [accordion] 403 permission\_denied or forbidden
>
> `permission_denied`: missing the `events:read` entry permission (named in `error.requiredPermission`). `forbidden`: the caller is not an External App. Note that an app **with** `events:read` but no per-event scopes gets `200` and an empty `events` array — not a `403`.

## Related

* [Webhooks (operator guide)](https://docs.gloo.com/forge/run/webhooks.md) — the scope map, the v2 envelope, and the reconciliation recipe in full
* [Webhooks HTTP API](https://docs.gloo.com/forge/reference/http-api/webhooks) — subscriptions, signing, and delivery replay
* [Native HTTP quickstart](https://docs.gloo.com/forge/quickstart.md#raw-http) — call these endpoints with `fetch` and a bearer token
* [MCP server](https://docs.gloo.com/forge/reference/mcp-server.md) — `forge_call_operation` with operationId `listEvents`


## OpenAPI

````yaml /forge/reference/openapi-v3.json get /api/v3/events
openapi: 3.1.0
info:
  title: Forge Platform API v3
  version: 0.23.0
  description: >-
    The Forge Platform API in its resource grammar: plural kebab-case
    collections, ids in the path, standard methods for the standard verbs and
    `POST …/{verb}` for the rest, and `/api/v3/me` for the caller's own records.
    Each operation is served by the same handler as the `/api/v2` operation it
    names: its operation id, credentials, permissions, refusals and idempotency
    are that operation's.
  contact:
    name: Forge Platform Team
servers:
  - url: https://api.forge.gloo.com
    description: Production
security:
  - BearerAuth: []
  - PlatformApiKey: []
  - PersonalKey: []
tags:
  - name: Agents
    description: >-
      Agent definitions: CRUD on the definition layer (create, get, list,
      update, delete) plus the A2A AgentCard endpoint, an agent's configuration,
      readiness and open setup request, the template gallery, the delegated work
      agents dispatched (sub-agent task runs and consultations), and agent
      administration: the kill switch, accountability repairs and setup
      requests.
  - name: Skills
    description: >-
      Skill definitions composed into agent prompts. List, fetch, and write
      skills owned by your External Application, and list and manage the skill
      sets that group them.
  - name: Tools
    description: >-
      Safe tool and tool-set catalog metadata and a tool's insights: the agents
      holding it, its calls, usage, history and sandbox rejections; workspace
      tool-set writes; no invocation.
  - name: Models
    description: Read-only access to the model catalog (provider, context window, status).
  - name: Workforce
    description: >-
      Organization units and positions in the caller’s workforce scope closure,
      and pods, pod membership previews and writes, pod lifecycle, ownership,
      internal profiles and Customer assignments, people (create, update, merge,
      offboard, reactivate), the worker directory, worker detail and seat
      budgets, assignment history, position assignment writes and the worker
      role list at the platform scope.
  - name: Objectives
    description: Read-only objective and key-result progress at the deployment root.
  - name: Planning
    description: >-
      Blueprint roadmaps, workstreams and milestones, and the critical-path and
      blocked-task projections, at the deployment root.
  - name: Projects
    description: Read-only project, customer relationship, and objective-link projections.
  - name: Workflows
    description: >-
      Workflow definitions and dispatch. List/get pinned workflow graphs and
      trigger runs by name.
  - name: Runs
    description: >-
      Workflow runs: list and read runs, their steps with runtime content,
      files, timeline, validator passes, recalled context, citations,
      notifications and governance status, the debug bundle, a Markdown export,
      agent conversations, the diagnostic timeline and AI analyses; cancel or
      restart a run, retry a failed notification, start an AI analysis and set a
      run's kill switch.
  - name: Chat
    description: >-
      Hybrid Workforce Chat — channels, sessions, and messages. Read
      channel/session state and post messages.
  - name: Memory
    description: >-
      Agent memory — channel and long-term layers. List, read, and write memory
      entries.
  - name: Knowledge
    description: >-
      Scoped knowledge: vector search, grounded answers, ingestion, entry reads
      and deletion. Every call is limited to the namespaces the credential may
      read or write, resolved server-side.
  - name: Factories
    description: >-
      Factory production units, their workers and tasks, spend and blueprints;
      operating a factory: messaging its manager agent and pausing, resuming or
      archiving it.
  - name: Sandboxes
    description: >-
      A run's sandboxes: recent runs that used them, the cached fleet summary, a
      run's lineage graph, its active sandboxes and a step's commands with
      masked output; diff two snapshots and replay a command against one in a
      fresh VM. Decided at the run's home and companies (factories:read; replay
      factories:manage).
  - name: Governance
    description: >-
      Approvals, policies and recorded decisions. List pending approvals, fetch
      detail, record decisions, list approval policies, list trust policies and
      their revisions, replay a trust policy against recorded decisions
      (historical, never an authorization), explain a recorded Trust Fabric
      decision, page recorded decision evidence, and read the permission catalog
      and role definitions.
  - name: Synthesis
    description: >-
      The synthesis queue: list and read synthesis requests, their Builder
      conversations and the procedures held for operator review, and promote,
      demote, accept or assign a reviewer to up to 50 requests per call. Decided
      at the platform scope.
  - name: Judges
    description: >-
      Machine judges: the judge catalog with metrics and rubrics, drift alerts,
      each judge's verdicts, pending primitive admissions, and the verdicts and
      live judge activity on a skill, agent, procedure, workflow draft or run.
      Decided at the platform scope.
  - name: Evals
    description: Evaluation sets and their runs.
  - name: External apps
    description: >-
      External Application registry: admin-only CRUD for the OAuth2 client
      credentials issued to integrating systems, an app's own record, and the
      agents an External App owns.
  - name: Costs and budgets
    description: >-
      Token spend and budgets. Bucketed and per-customer cost summaries are
      served from cron-populated rollups, so responses carry `meta.asOf`: an
      empty result with a null `asOf` means 'not accrued yet', not 'no spend'.
      Also agent and chat cost aggregates, the budget hierarchy, budget status
      and budget alerts.
  - name: Customers
    description: >-
      End-customer records, organizations and individuals. A customer row is
      shared across apps by `workosId`. The `/api/v2/external/customers` routes
      are an External Application's own view: per-app visibility comes from a
      `customerScopes` link, and those reads are fenced to the calling app. The
      `/api/v2/customers/*` routes are the organization's whole directory,
      decided at the deployment root for any credential holding `customers:read`
      there.
  - name: Procedures
    description: >-
      Read-only Procedures catalog — the deterministic, versioned units a
      workflow graph can bind. Compact projection only: never source code or
      bundled files.
  - name: Health
    description: Authenticated liveness check for integration smoke tests.
  - name: Capabilities
    description: >-
      Read-only deployment configuration: capability domains, their active
      provider chains, the provider catalog, credential health and a
      capability's recent changes. Decided at the deployment root; never
      credential values or option values.
  - name: Actor
    description: >-
      Request-scoped self-discovery: the calling credential's verified actor,
      its current narrowed permissions and each documented operation's advisory
      prerequisites.
  - name: API keys
    description: >-
      Personal keys and host sign-ins: a key owner lists and revokes their own;
      an administrator lists and revokes any person's.
  - name: Connections
    description: >-
      Connection credentials and the credential registry: list, create, review,
      revoke and delete credentials, and the vendors and connections they bind.
  - name: Email
    description: >-
      Inbound and outbound email: the outbox, received mail, the inbound ingress
      and its routes, and the sending domain.
  - name: Environments
    description: >-
      Environment Connections and their credentials: list, create, rename,
      replace the credential, and delete.
  - name: Identity
    description: >-
      Person profiles and avatars, and unmapped sign-in attempts waiting to be
      mapped or dismissed.
  - name: Notifications
    description: >-
      Notification event types with their payload fields, and the outbound Slack
      sends.
  - name: Observe and ops
    description: >-
      Operational reads: attention items, investigation notes, workflow
      performance and reliability overviews, failed runs, slow steps and a run's
      audit events.
  - name: Org units and positions
    description: >-
      The org chart: drafts that stage org unit and position changes, and the
      org units, positions and assignments they publish.
  - name: People and members
    description: >-
      People, their worker seats and org unit memberships, expertise tags, and
      the person-identity integrity check.
  - name: Projects and staffing
    description: Intake requests, their plans, and tasks across projects.
  - name: Roles and grants
    description: >-
      Job roles, the tools and skills they grant or deny, a holder's role
      grants, and AI-drafted role content.
  - name: Trust Fabric
    description: >-
      Governance controls and evidence: decisions, command tiers, trust
      assurance, policies, the governance door, the publish judge and the
      platform kill switch.
  - name: Vendors
    description: >-
      Vendors and their connections, attached API specs, generated client
      surfaces and remote MCP tool catalogs.
  - name: Webhooks
    description: >-
      Webhook subscriptions, deliveries and their attempts, replay and
      redelivery, dead letters, delivery health and the canonical event log.
  - name: Files
    description: >-
      Raw-byte file upload and authorized content redirects for uploaded files
      and readable run outputs.
  - name: Compliance
    description: >-
      Deployment-wide audit and governance record exports and a decision
      summary, for auditors holding `audit:read` at the deployment root.
paths:
  /api/v3/events:
    get:
      tags:
        - Webhooks
      summary: Page the canonical event log
      description: >-
        Requires permission `events:read`.


        The reconciliation surface behind webhook delivery: events the calling
        app initiated whose subscription scope it currently holds, in ascending
        order, within the last 30 days. The next cursor is in `data.nextCursor`
        (null at the end of the log). Filtering happens after each page is read,
        so a short or empty page with a non-null cursor is normal: keep paging.
        A cursor older than the window restarts at the window's start.
      operationId: listEvents
      parameters:
        - name: cursor
          in: query
          required: false
          schema:
            type: string
          description: Opaque `nextCursor` from a previous page; omit to start the window
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 50
          description: Rows read per page, 1 to 100; a larger value is `400` `too_big`
        - name: types
          in: query
          required: false
          schema:
            type: string
          description: Comma-separated event types to keep, e.g. `workflow.completed`
      responses:
        '200':
          description: One page of the event log
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/EventPage'
                  meta:
                    allOf:
                      - $ref: '#/components/schemas/PlatformMeta'
                      - $ref: '#/components/schemas/ListPageMeta'
                required:
                  - data
                  - meta
          headers:
            X-Request-Id:
              $ref: '#/components/headers/RequestId'
            RateLimit-Limit:
              $ref: '#/components/headers/RateLimitLimit'
            RateLimit-Remaining:
              $ref: '#/components/headers/RateLimitRemaining'
            RateLimit-Reset:
              $ref: '#/components/headers/RateLimitReset'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse400'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/RequestId'
            RateLimit-Limit:
              $ref: '#/components/headers/RateLimitLimit'
            RateLimit-Remaining:
              $ref: '#/components/headers/RateLimitRemaining'
            RateLimit-Reset:
              $ref: '#/components/headers/RateLimitReset'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse401'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/RequestId'
            RateLimit-Limit:
              $ref: '#/components/headers/RateLimitLimit'
            RateLimit-Remaining:
              $ref: '#/components/headers/RateLimitRemaining'
            RateLimit-Reset:
              $ref: '#/components/headers/RateLimitReset'
        '403':
          description: Forbidden, or the credential is not an External Application
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse403'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/RequestId'
            RateLimit-Limit:
              $ref: '#/components/headers/RateLimitLimit'
            RateLimit-Remaining:
              $ref: '#/components/headers/RateLimitRemaining'
            RateLimit-Reset:
              $ref: '#/components/headers/RateLimitReset'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse404'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/RequestId'
            RateLimit-Limit:
              $ref: '#/components/headers/RateLimitLimit'
            RateLimit-Remaining:
              $ref: '#/components/headers/RateLimitRemaining'
            RateLimit-Reset:
              $ref: '#/components/headers/RateLimitReset'
        '429':
          $ref: '#/components/responses/RateLimited'
        '503':
          $ref: '#/components/responses/LimiterUnavailable'
      security:
        - BearerAuth: []
components:
  schemas:
    EventPage:
      type: object
      properties:
        events:
          type: array
          items:
            $ref: '#/components/schemas/EventEnvelope'
        nextCursor:
          type:
            - string
            - 'null'
      required:
        - events
        - nextCursor
      additionalProperties: false
    PlatformMeta:
      type: object
      properties:
        requestId:
          type: string
        hasMore:
          type: boolean
        nextCursor:
          type:
            - string
            - 'null'
        asOf:
          anyOf:
            - type: integer
            - type: 'null'
      required:
        - requestId
      additionalProperties: true
    ListPageMeta:
      type: object
      description: >-
        A list page's continuation. While `hasMore` is true, `nextCursor` is a
        string: pass it as `cursor` for the next page. `hasMore: false` ends the
        list; with `truncated: true`, more exist past what this list reads, and
        no cursor reaches them.
      properties:
        hasMore:
          type: boolean
        nextCursor:
          type:
            - string
            - 'null'
        truncated:
          type: boolean
          description: >-
            Present and true on a last page when the list holds more rows than
            this operation reads. Narrow the request with its filters to reach
            them.
      required:
        - hasMore
        - nextCursor
      anyOf:
        - properties:
            hasMore:
              const: false
        - properties:
            nextCursor:
              type: string
    ErrorResponse400:
      allOf:
        - $ref: '#/components/schemas/ErrorResponse'
        - type: object
          properties:
            error:
              type: object
              properties:
                code:
                  type: string
                  enum:
                    - bad_request
                    - allowed_scopes_removed
    ErrorResponse401:
      allOf:
        - $ref: '#/components/schemas/ErrorResponse'
        - type: object
          properties:
            error:
              type: object
              properties:
                code:
                  type: string
                  enum:
                    - unauthorized
    ErrorResponse403:
      allOf:
        - $ref: '#/components/schemas/ErrorResponse'
        - type: object
          properties:
            error:
              type: object
              properties:
                code:
                  type: string
                  enum:
                    - forbidden
                    - permission_denied
                    - operator_stopped
    ErrorResponse404:
      allOf:
        - $ref: '#/components/schemas/ErrorResponse'
        - type: object
          properties:
            error:
              type: object
              properties:
                code:
                  type: string
                  enum:
                    - resource_missing
    EventEnvelope:
      type: object
      properties:
        id:
          type: string
          minLength: 1
        type:
          type: string
          minLength: 1
        apiVersion:
          type: string
          minLength: 1
        occurredAt:
          type: number
        orderingKey:
          type:
            - string
            - 'null'
        initiator:
          anyOf:
            - type: object
              properties:
                kind:
                  type: string
                id:
                  type:
                    - string
                    - 'null'
              required:
                - kind
                - id
              additionalProperties: false
            - type: 'null'
        data: {}
      required:
        - id
        - type
        - apiVersion
        - occurredAt
        - orderingKey
        - initiator
        - data
      additionalProperties: false
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - unauthorized
                - forbidden
                - permission_denied
                - not_found
                - resource_missing
                - method_not_allowed
                - bad_request
                - unprocessable
                - conflict
                - invalid_state
                - gone
                - payment_required
                - idempotency_key_invalid
                - idempotency_key_in_flight
                - idempotency_key_reuse
                - idempotency_result_unavailable
                - idempotency_outcome_unknown
                - allowed_scopes_removed
                - governance_door_stopped
                - operator_stopped
                - payload_too_large
                - rate_limited
                - internal_error
            message:
              type: string
            docUrl:
              type: string
              format: uri
            reason:
              type: string
              enum:
                - requester_unavailable
                - invalid_body
                - form_invalid
                - form_secret_like
                - eligibility_invalid
                - due_out_of_range
                - no_candidates
                - org_unit_required
                - requester_open_cap
                - person_open_cap
                - rate_limited
                - role_giving_refused
            requiredPermission:
              type:
                - string
                - 'null'
            personRequired:
              type: boolean
            decisionId:
              type: string
            capHeadroom:
              type: object
              properties:
                remainingCents:
                  type: number
                capCents:
                  type: number
                consumedCents:
                  type: number
                estimateCents:
                  type: number
              required:
                - remainingCents
                - capCents
                - consumedCents
                - estimateCents
              additionalProperties: false
            details:
              type: array
              items:
                type: object
                properties:
                  path:
                    type: string
                  param:
                    type: string
                  message:
                    type: string
                  code:
                    type: string
                    enum:
                      - required
                      - invalid_type
                      - invalid_value
                      - invalid_format
                      - too_small
                      - too_big
                      - unknown_field
                      - invalid_json
                      - invalid
                required:
                  - path
                  - param
                  - message
                  - code
                additionalProperties: false
              maxItems: 50
          required:
            - code
            - message
          additionalProperties: true
        meta:
          type: object
          properties:
            requestId:
              type: string
            hasMore:
              type: boolean
            nextCursor:
              type:
                - string
                - 'null'
            asOf:
              anyOf:
                - type: integer
                - type: 'null'
          required:
            - requestId
          additionalProperties: true
      required:
        - error
        - meta
      additionalProperties: true
  headers:
    RequestId:
      description: >-
        This answer's request id, the same as the envelope's `meta.requestId`:
        `req_` and 16 lowercase hex digits. Every response carries it. Quote it
        to support, or look the request up with `GET
        /api/v3/me/requests/{requestId}`.
      schema:
        type: string
    RateLimitLimit:
      description: >-
        The capacity of the bucket this request spent from: the most requests it
        admits at once. Sent on every response to a request that spent from its
        bucket, whatever its status: a 401 or 503 the operation answers after
        that spend carries it too. Absent on a refusal before the spend (a 401
        from authentication, a stopped `api_keys` door's 503
        `governance_door_stopped`, a credential's 403 at sign-in), on a route's
        own tighter 429, and on the limiter's own 503, which could not spend.
      schema:
        type: integer
        minimum: 0
    RateLimitRemaining:
      description: >-
        Requests left in the bucket this request spent from; 0 on a refusal.
        While the limiter is degraded (its fallback bucket admitted the
        request), an estimate.
      schema:
        type: integer
        minimum: 0
    RateLimitReset:
      description: Seconds until the bucket this request spent from is full again.
      schema:
        type: integer
        minimum: 0
    RetryAfter:
      description: >-
        Seconds to wait before sending the request again. Sent on a 429 and on a
        transient 503.
      schema:
        type: integer
        minimum: 1
  responses:
    RateLimited:
      description: >-
        `rate_limited`: this credential, or the organization as a whole, has
        spent the requests of this operation's class for now. Each credential
        has three buckets: `read` (GET, HEAD), `write` (every other method) and
        `expensive` (an operation that starts a model turn, a run, a billable VM
        or a bulk job); each operation names its class in `x-forge-rate-limit`
        and spends from that bucket only. Every credential's requests also spend
        from the organization ceiling, one bucket per class at ten times a
        credential's limit, shared by every credential of the deployment; the
        message names which one refused. Wait `Retry-After` seconds, then retry.
        Every authenticated response carries the `RateLimit-*` headers for the
        bucket it spent from, so a client can slow down before it is refused;
        `GET /api/v2/me/limits` answers all three buckets and the ceiling.
      headers:
        Retry-After:
          $ref: '#/components/headers/RetryAfter'
        RateLimit-Limit:
          $ref: '#/components/headers/RateLimitLimit'
        RateLimit-Remaining:
          $ref: '#/components/headers/RateLimitRemaining'
        RateLimit-Reset:
          $ref: '#/components/headers/RateLimitReset'
        X-Request-Id:
          $ref: '#/components/headers/RequestId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    LimiterUnavailable:
      description: >-
        `internal_error`: The server could not complete the request. Wait for
        `Retry-After`, then retry; resend a write only with the same
        `Idempotency-Key`. Forge answers it when its rate limiter is briefly
        unavailable (a read or write request falls back to a second bucket
        before it is refused; an `expensive` request is refused at once), or
        when a transient runtime fault stops the request.
      headers:
        Retry-After:
          $ref: '#/components/headers/RetryAfter'
        RateLimit-Limit:
          $ref: '#/components/headers/RateLimitLimit'
        RateLimit-Remaining:
          $ref: '#/components/headers/RateLimitRemaining'
        RateLimit-Reset:
          $ref: '#/components/headers/RateLimitReset'
        X-Request-Id:
          $ref: '#/components/headers/RequestId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        An External App: the JWT it obtains from `POST /oauth/token` with OAuth2
        client_credentials. Pass as `Authorization: Bearer <jwt>`. An app's
        static companion key also authenticates as the app, but is deprecated
        and is not protected by `Idempotency-Key`.
    PlatformApiKey:
      type: http
      scheme: bearer
      description: >-
        A platform API key, created in the Console under Developers. Pass as
        `Authorization: Bearer <key>`. It acts as itself, under its role grants
        narrowed by its scopes.
    PersonalKey:
      type: http
      scheme: bearer
      description: >-
        A Personal key (`fmcp_…`), bound to the person who created it, or an
        interactive MCP sign-in that resolves to one. Pass as `Authorization:
        Bearer <key>`. It acts for that person, under their role grants narrowed
        by its scopes; an operation that acts for a person admits only this
        kind.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.