> ## 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.

# Preview a workforce repair from an audit run's findings, named by their findingId

> Preview a workforce repair from an audit run's findings, named by their findingId; apply it with integrity/repairs/apply. Requires permission `workforce:manage`.



## OpenAPI

````yaml /forge/reference/openapi-v3.json post /api/v3/workforce-integrity-runs/{runId}/preview-repair
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/workforce-integrity-runs/{runId}/preview-repair:
    post:
      tags:
        - People and members
      summary: >-
        Preview a workforce repair from an audit run's findings, named by their
        findingId; apply it with integrity/repairs/apply.
      description: >-
        Requires permission `workforce:manage`.


        Preview a workforce repair from an audit run's findings, named by their
        findingId; apply it with integrity/repairs/apply. With an
        `Idempotency-Key`, a same-key repeat does not run again: once the
        caller's permissions pass again it answers the recorded status and body
        (`Idempotent-Replayed: true`); a response too large to store answers
        only the `data.id` it named (`Idempotency-Replay-Disclosure: id-only`),
        else `409 idempotency_result_unavailable`.
      operationId: previewWorkforceRepairAdmin
      parameters:
        - name: runId
          in: path
          required: true
          schema:
            type: string
          example: workforce_integrity_audit
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                dispositions:
                  type: array
                  items:
                    type: object
                    properties:
                      findingId:
                        type: string
                      decision:
                        anyOf:
                          - type: string
                            const: APPLY
                          - type: string
                            const: DISMISS
                          - type: string
                            const: ROUTE
                      reason:
                        type: string
                      action:
                        anyOf:
                          - type: object
                            properties:
                              kind:
                                type: string
                                const: END_ASSIGNMENT
                              assignmentId:
                                type: string
                              endDate:
                                type: number
                            required:
                              - kind
                              - assignmentId
                              - endDate
                            additionalProperties: false
                          - type: object
                            properties:
                              kind:
                                type: string
                                const: SUPERSEDE_ASSIGNMENT
                              assignmentId:
                                type: string
                              winnerAssignmentId:
                                type: string
                            required:
                              - kind
                              - assignmentId
                              - winnerAssignmentId
                            additionalProperties: false
                          - type: object
                            properties:
                              kind:
                                type: string
                                const: LINK_AND_CONSOLIDATE_SEAT
                              personId:
                                type: string
                              expectedPersonStatus:
                                type: string
                              reactivatePerson:
                                type: boolean
                              winningWorkerId:
                                type: string
                              losingWorkerId:
                                type: string
                              winningPositionId:
                                type: string
                              losingPositionId:
                                type: string
                              winningAssignmentId:
                                type: string
                              losingAssignmentId:
                                type: string
                              positionMerges:
                                type: array
                                items:
                                  type: object
                                  properties:
                                    losingPositionId:
                                      type: string
                                    winningPositionId:
                                      type: string
                                  required:
                                    - losingPositionId
                                    - winningPositionId
                                  additionalProperties: false
                              assignmentActions:
                                type: array
                                items:
                                  anyOf:
                                    - type: object
                                      properties:
                                        kind:
                                          type: string
                                          const: END_ASSIGNMENT
                                        assignmentId:
                                          type: string
                                        endDate:
                                          type: number
                                      required:
                                        - kind
                                        - assignmentId
                                        - endDate
                                      additionalProperties: false
                                    - type: object
                                      properties:
                                        kind:
                                          type: string
                                          const: SUPERSEDE_ASSIGNMENT
                                        assignmentId:
                                          type: string
                                        winnerAssignmentId:
                                          type: string
                                      required:
                                        - kind
                                        - assignmentId
                                        - winnerAssignmentId
                                      additionalProperties: false
                              reportingChanges:
                                type: array
                                items:
                                  type: object
                                  properties:
                                    positionId:
                                      type: string
                                    expectedReportsToPositionId:
                                      anyOf:
                                        - type: string
                                        - type: 'null'
                                    reportsToPositionId:
                                      anyOf:
                                        - type: string
                                        - type: 'null'
                                  required:
                                    - positionId
                                    - expectedReportsToPositionId
                                    - reportsToPositionId
                                  additionalProperties: false
                              mappingChanges:
                                type: array
                                items:
                                  type: object
                                  properties:
                                    mappingId:
                                      type: string
                                    expectedTargetId:
                                      type: string
                                    targetId:
                                      type: string
                                  required:
                                    - mappingId
                                    - expectedTargetId
                                    - targetId
                                  additionalProperties: false
                            required:
                              - kind
                              - personId
                              - expectedPersonStatus
                              - reactivatePerson
                              - winningWorkerId
                              - losingWorkerId
                              - winningPositionId
                              - losingPositionId
                              - winningAssignmentId
                              - losingAssignmentId
                              - positionMerges
                              - assignmentActions
                              - reportingChanges
                              - mappingChanges
                            additionalProperties: false
                          - type: object
                            properties:
                              kind:
                                type: string
                                const: LINK_WORKER_PERSON
                              workerId:
                                type: string
                              personId:
                                type: string
                              expectedWorkerPersonId:
                                type: string
                              reactivatePerson:
                                type: boolean
                            required:
                              - kind
                              - workerId
                              - personId
                              - reactivatePerson
                            additionalProperties: false
                          - type: object
                            properties:
                              kind:
                                type: string
                                const: CREATE_PERSON_AND_LINK_WORKER
                              workerId:
                                type: string
                              personId:
                                type: string
                              name:
                                type: string
                              userType:
                                anyOf:
                                  - type: string
                                    const: EMPLOYEE
                                  - type: string
                                    const: CONTRACTOR
                              expectedWorkerPersonId:
                                type: string
                            required:
                              - kind
                              - workerId
                              - personId
                              - name
                              - userType
                            additionalProperties: false
                          - type: object
                            properties:
                              kind:
                                type: string
                                const: RELINK_IDENTITY_CLAIM
                              identityId:
                                type: string
                              expectedPersonId:
                                type: string
                              personId:
                                type: string
                            required:
                              - kind
                              - identityId
                              - expectedPersonId
                              - personId
                            additionalProperties: false
                          - type: object
                            properties:
                              kind:
                                type: string
                                const: REVOKE_IDENTITY_CLAIM
                              identityId:
                                type: string
                              expectedPersonId:
                                type: string
                            required:
                              - kind
                              - identityId
                              - expectedPersonId
                            additionalProperties: false
                          - type: object
                            properties:
                              kind:
                                type: string
                                const: ARCHIVE_ORG_UNIT
                              orgUnitId:
                                type: string
                            required:
                              - kind
                              - orgUnitId
                            additionalProperties: false
                          - type: object
                            properties:
                              kind:
                                type: string
                                const: ARCHIVE_POSITION
                              positionId:
                                type: string
                            required:
                              - kind
                              - positionId
                            additionalProperties: false
                          - type: object
                            properties:
                              kind:
                                type: string
                                const: LINK_IDENTITY
                              personId:
                                type: string
                              provider:
                                type: string
                              externalId:
                                type: string
                            required:
                              - kind
                              - personId
                              - provider
                              - externalId
                            additionalProperties: false
                          - type: object
                            properties:
                              kind:
                                type: string
                                const: MERGE_PERSON
                              winnerPersonId:
                                type: string
                              loserPersonId:
                                type: string
                            required:
                              - kind
                              - winnerPersonId
                              - loserPersonId
                            additionalProperties: false
                          - type: object
                            properties:
                              kind:
                                type: string
                                const: RECLASSIFY_CAPITAL_PARTNER
                              orgUnitId:
                                type: string
                              code:
                                type: string
                            required:
                              - kind
                              - orgUnitId
                              - code
                            additionalProperties: false
                          - type: object
                            properties:
                              kind:
                                type: string
                                const: SUPERSEDE_MAPPING
                              mappingId:
                                type: string
                            required:
                              - kind
                              - mappingId
                            additionalProperties: false
                    required:
                      - findingId
                      - decision
                      - reason
                    additionalProperties: false
              required:
                - dispositions
              additionalProperties: false
            example:
              dispositions:
                - findingId: wf_dxFq_UcaIxTtiUxZ8QiAgA
                  decision: DISMISS
                  reason: Free text a person wrote.
      responses:
        '200':
          description: >-
            Preview a workforce repair from an audit run's findings, named by
            their findingId; apply it with integrity/repairs/apply.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      repairRunId:
                        type: string
                      auditRunId:
                        type: string
                      planHash:
                        type: string
                      targetStateHash:
                        type: string
                      actions:
                        type: array
                        items:
                          type: object
                          properties:
                            findingId:
                              type: string
                            kind:
                              type: string
                            before:
                              type: array
                              items:
                                type: object
                                properties:
                                  key:
                                    type: string
                                  value:
                                    anyOf:
                                      - type: string
                                      - type: 'null'
                                required:
                                  - key
                                  - value
                                additionalProperties: false
                            after:
                              type: array
                              items:
                                type: object
                                properties:
                                  key:
                                    type: string
                                  value:
                                    anyOf:
                                      - type: string
                                      - type: 'null'
                                required:
                                  - key
                                  - value
                                additionalProperties: false
                            effects:
                              type: array
                              items:
                                type: object
                                properties:
                                  key:
                                    type: string
                                  value:
                                    anyOf:
                                      - type: string
                                      - type: 'null'
                                required:
                                  - key
                                  - value
                                additionalProperties: false
                          required:
                            - findingId
                            - kind
                            - before
                            - after
                            - effects
                          additionalProperties: false
                      unresolvedFindingIds:
                        type: array
                        items:
                          type: string
                      counts:
                        type: object
                        properties:
                          hardViolations:
                            type: number
                          deterministicRepairs:
                            type: number
                          ambiguous:
                            type: number
                          advisory:
                            type: number
                          applied:
                            type: number
                          noOp:
                            type: number
                          blocked:
                            type: number
                        required:
                          - hardViolations
                          - deterministicRepairs
                          - ambiguous
                          - advisory
                          - applied
                          - noOp
                          - blocked
                        additionalProperties: false
                    required:
                      - repairRunId
                      - auditRunId
                      - planHash
                      - targetStateHash
                      - actions
                      - unresolvedFindingIds
                      - counts
                    additionalProperties: false
                  meta:
                    $ref: '#/components/schemas/PlatformMeta'
                required:
                  - data
                  - meta
              example:
                data:
                  repairRunId: workforce_repair_d857003c-f359-4462-9b4f-975bca3690de
                  auditRunId: workforce_integrity_audit
                  planHash: >-
                    0eb02d85e783f803aad594f5fb211c1f116a706bde7f45bdf4f95aab734cc003
                  targetStateHash: >-
                    4f53cda18c2baa0c0354bb5f9a3ecbe5ed12ab4d8e11ba873c2f11161202b945
                  actions: []
                  unresolvedFindingIds:
                    - wf_8uS1axM1HmgvkiBdV6ePhw
                    - wf_dxFq_UcaIxTtiUxZ8QiAgA
                    - wf_fG6nz8MUix3Zuhvyry4cKw
                  counts:
                    hardViolations: 0
                    deterministicRepairs: 0
                    ambiguous: 0
                    advisory: 0
                    applied: 0
                    noOp: 0
                    blocked: 0
                meta:
                  requestId: req_example
          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`: an unknown, repeated or invalid argument'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse400Keyed'
          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: `workforce:manage` is not held at the platform scope; an
            External App is refused: call with an API key
          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: >-
            `resource_missing`: an audit run no id names (or a run that is not
            an audit), or dispositions naming a finding whose people or
            placements are out of reach (decided as integrity/repairs/apply
            decides a plan, on each named finding with the action it would
            apply); decided before the dispositions are checked and before
            anything is written
          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'
        '409':
          description: >-
            `idempotency_result_unavailable`: an `Idempotency-Key` repeat;
            `invalid_state`: The audit run has not completed.; `conflict`: The
            audit run holds more findings than one preview reads.; `conflict`:
            The seat's person changed since the audit; run a new audit.;
            `conflict`: The person's status changed since the audit; run a new
            audit.; `conflict`: The identity claim's owner changed since the
            audit; run a new audit.; `invalid_state`: The identity claim's owner
            exists; it is not orphaned.; `invalid_state`: The person was merged
            into another.; `invalid_state`: The seat was already merged
            differently.; `conflict`: The seat consolidation is stale; run a new
            audit.; `conflict`: Both seats hold overlapping memberships in the
            same Pod; end one before consolidating the seats.; `invalid_state`:
            The seat being consolidated belongs to a Pod that is not active.;
            `conflict`: A pending request names the seat being consolidated and
            cannot be moved to the other seat.; `conflict`: The seat being
            consolidated holds more staffing assignments or pending requests
            than one repair moves.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse409Keyed'
          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'
        '422':
          description: >-
            `unprocessable`: A disposition names a finding this audit run does
            not hold; list the run's findings again (a finding's id changes when
            the deployment's signing key rotates).; `unprocessable`: The
            dispositions are invalid: each needs a reason of at most 1,000
            characters, names a finding once, and carries an action only to
            apply.; `unprocessable`: A finding with no proposed action needs a
            reviewed action to apply.; `unprocessable`: The reviewed action
            differs from the finding's proposed action.; `unprocessable`: The
            reviewed action does not repair this finding.; `unprocessable`: The
            reviewed action is not one a repair applies.; `unprocessable`: A
            repair applies at most 20 actions.; `unprocessable`: Two actions
            repair the same record.; `unprocessable`: The reviewed action names
            a worker that is not an active human seat.; `unprocessable`: The
            person to create does not match the seat, or already exists.;
            `unprocessable`: The reviewed action names a person that does not
            exist.; `unprocessable`: The reviewed action names a person who is
            not active.; `unprocessable`: The person is not active; set
            reactivatePerson to link them.; `unprocessable`: The person's type
            does not match the seat's.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse422Keyed'
          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'
        '500':
          description: Internal error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse500'
          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'
        '503':
          $ref: '#/components/responses/LimiterUnavailable'
      security:
        - PlatformApiKey: []
        - PersonalKey: []
components:
  parameters:
    IdempotencyKey:
      name: Idempotency-Key
      in: header
      required: false
      description: >-
        1–255 printable ASCII characters (`0x21`–`0x7E`, no spaces), scoped to
        the calling credential. A repeat with the same key and request never
        runs the write again, a 5xx included: once the operation's permissions
        pass again it answers the identical status and body of the first
        response (`Idempotent-Replayed: true`, also sent as
        `Idempotency-Replayed: true`), unless the operation's own replay policy
        withholds it; a first response that was not stored (over 32 KiB, or
        carrying a one-time secret) answers its first status with only `data.id`
        (`Idempotency-Replay-Disclosure: id-only`) when it named one; otherwise
        `409` `idempotency_result_unavailable`; a repeat while the first is
        still running is `409` `idempotency_key_in_flight`, and the same key
        with a different request is `422` `idempotency_key_reuse`. Honoured for
        External App JWTs and platform and Personal keys; an External App's
        static companion key is not protected.
      schema:
        type: string
        minLength: 1
        maxLength: 255
  schemas:
    PlatformMeta:
      type: object
      properties:
        requestId:
          type: string
        hasMore:
          type: boolean
        nextCursor:
          type:
            - string
            - 'null'
        asOf:
          anyOf:
            - type: integer
            - type: 'null'
      required:
        - requestId
      additionalProperties: true
    ErrorResponse400Keyed:
      allOf:
        - $ref: '#/components/schemas/ErrorResponse'
        - type: object
          properties:
            error:
              type: object
              properties:
                code:
                  type: string
                  enum:
                    - bad_request
                    - allowed_scopes_removed
                    - idempotency_key_invalid
    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
    ErrorResponse409Keyed:
      allOf:
        - $ref: '#/components/schemas/ErrorResponse'
        - type: object
          properties:
            error:
              type: object
              properties:
                code:
                  type: string
                  enum:
                    - conflict
                    - invalid_state
                    - idempotency_key_in_flight
                    - idempotency_result_unavailable
                    - idempotency_outcome_unknown
    ErrorResponse422Keyed:
      allOf:
        - $ref: '#/components/schemas/ErrorResponse'
        - type: object
          properties:
            error:
              type: object
              properties:
                code:
                  type: string
                  enum:
                    - unprocessable
                    - idempotency_key_reuse
    ErrorResponse500:
      allOf:
        - $ref: '#/components/schemas/ErrorResponse'
        - type: object
          properties:
            error:
              type: object
              properties:
                code:
                  type: string
                  enum:
                    - internal_error
    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.