{
  "openapi": "3.1.0",
  "info": {
    "title": "Augenta API",
    "version": "1.0.0",
    "description": "Add experiences to a Workspace and recall what it remembers, or consolidate messages into engrams in a single request."
  },
  "servers": [
    {
      "url": "https://api.augenta.ai",
      "description": "Production"
    }
  ],
  "security": [
    {
      "AugentaKey": []
    }
  ],
  "components": {
    "securitySchemes": {
      "AugentaKey": {
        "type": "apiKey",
        "in": "header",
        "name": "Authorization",
        "description": "`AugentaKey <your key>`, with the literal word `AugentaKey`, a space, then the key from Console → API Keys."
      },
      "PersonToken": {
        "type": "http",
        "scheme": "bearer",
        "description": "A person's sign-in token: the access token the Augenta CLI or plugin holds after signing in, sent as `Authorization: Bearer <token>`. API keys are refused."
      }
    },
    "schemas": {
      "ExperiencesAccepted": {
        "type": "object",
        "properties": {
          "billing": {
            "$ref": "#/components/schemas/BillingReceipt"
          },
          "accepted": {
            "type": "integer",
            "description": "How many experiences were accepted."
          },
          "connectorId": {
            "type": "string",
            "description": "Present for Connector-backed writes."
          },
          "source": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "api-key"
                ]
              },
              "id": {
                "type": "string"
              }
            },
            "required": [
              "type",
              "id"
            ],
            "description": "Present for writes made with the API key's Workspace permissions, instead of connectorId."
          },
          "workspace": {
            "type": "string",
            "description": "The destination Workspace for writes made with the API key's Workspace permissions."
          },
          "experiences": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ExperienceRef"
            },
            "description": "One per experience, in request order."
          }
        },
        "required": [
          "accepted",
          "experiences"
        ]
      },
      "BillingReceipt": {
        "type": "object",
        "properties": {
          "operationId": {
            "type": "string"
          },
          "priceVersion": {
            "type": "string"
          },
          "sourceTokens": {
            "type": "integer",
            "minimum": 0
          },
          "memoryTokens": {
            "type": "integer",
            "minimum": 0
          },
          "measuredMemoryTokens": {
            "type": "integer",
            "minimum": 0
          },
          "replayed": {
            "type": "boolean"
          },
          "complimentary": {
            "type": "boolean"
          },
          "ratedAmount": {
            "type": "string",
            "pattern": "^\\d+\\.\\d{9}$"
          },
          "amount": {
            "type": "string",
            "pattern": "^\\d+\\.\\d{9}$"
          },
          "receiptIds": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "operationId",
          "priceVersion",
          "sourceTokens",
          "memoryTokens",
          "measuredMemoryTokens",
          "replayed",
          "amount",
          "receiptIds"
        ],
        "description": "Present when billing is enabled. USD amount is exact. Receipt references settle only on successful server delivery; retries reuse the original debit."
      },
      "ExperienceRef": {
        "allOf": [
          {
            "$ref": "#/components/schemas/ExperienceReference"
          },
          {
            "type": "object",
            "properties": {
              "object": {
                "type": "string",
                "enum": [
                  "experience"
                ]
              },
              "id": {
                "type": "string",
                "description": "Poll `GET /v1/experiences/{id}` with it. The same experience sent again gets the same id.",
                "example": "exp_9b2f6c1e4d7a0b3c5e8f1a2d"
              },
              "status": {
                "type": "string",
                "enum": [
                  "accepted",
                  "processed",
                  "consolidated",
                  "failed"
                ]
              },
              "billingOperationId": {
                "type": "string",
                "description": "Source receipt reference when billing is enabled. It settles with successful durable processing."
              }
            }
          }
        ]
      },
      "ExperienceReference": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "experience"
            ],
            "description": "The resource type. Always experience."
          },
          "id": {
            "type": "string",
            "pattern": "^exp_[0-9a-f]{24}$",
            "description": "The ID Augenta assigns to this submitted source. In Workspace mode, use it with GET /v1/experiences/{id} to check processing status. One-shot source references have no stored status URL."
          },
          "status": {
            "type": "string",
            "enum": [
              "accepted",
              "processed",
              "consolidated",
              "failed",
              "skipped",
              "superseded"
            ],
            "description": "What happened to this source. Workspace receipts report processing progress; one-shot references report the result of this call."
          },
          "billingOperationId": {
            "type": "string",
            "description": "Reference to this source's billing operation, when billing is enabled."
          },
          "claimIds": {
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^clm_[0-9a-f]{24}$"
            },
            "description": "IDs of Claims extracted from this source, when returned. Read extractedClaims.data or an Engram's claims.data for their text."
          }
        },
        "required": [
          "object",
          "id",
          "status"
        ]
      },
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string",
                "description": "Stable. The Errors page lists every code."
              },
              "message": {
                "type": "string",
                "description": "Human-readable. May change; don't parse it."
              },
              "retryable": {
                "type": "boolean"
              },
              "retryAfterSeconds": {
                "type": "integer",
                "minimum": 1,
                "description": "Capacity retry interval, also present as Retry-After before stream headers commit. SSE error events retain this field after HTTP 200 is committed."
              },
              "billingUrl": {
                "type": "string",
                "description": "Top-up action when error.code is insufficient_balance (HTTP 402)."
              }
            },
            "required": [
              "code",
              "message",
              "retryable"
            ]
          },
          "requestId": {
            "type": "string",
            "description": "The request's id, as in the `X-Request-Id` response header."
          }
        },
        "required": [
          "error",
          "requestId"
        ],
        "description": "Every failure, in one shape. Branch on `error.code`; retry only when `error.retryable` is `true`. `requestId` is also the `X-Request-Id` response header."
      },
      "ExperiencesRequest": {
        "type": "object",
        "properties": {
          "workspace": {
            "type": "string",
            "minLength": 1,
            "description": "One Workspace assigned to the key. Required when the key has multiple assignments; inferred for one."
          },
          "experiences": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ExperienceInput"
            },
            "minItems": 1,
            "description": "One or more experiences, up to 1,000 steps and data items in all."
          }
        },
        "required": [
          "experiences"
        ],
        "additionalProperties": false,
        "description": "Any other top-level field is refused rather than ignored."
      },
      "ExperienceInput": {
        "type": "object",
        "properties": {
          "src": {
            "type": "string",
            "enum": [
              "service",
              "claude-code",
              "codex"
            ],
            "description": "Who composed it. Send `service` from your own code."
          },
          "sid": {
            "type": "string",
            "minLength": 1,
            "description": "The session id: one conversation, one agent run, or one document. Experiences that share it are one stream."
          },
          "proj": {
            "type": "string",
            "description": "An optional project name, for your own grouping. Defaults to empty."
          },
          "type": {
            "type": "string",
            "description": "`trajectory` (the default) for conversations and agent runs, `doc` for a document."
          },
          "events": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Step"
            },
            "description": "A trajectory's steps. Required for a trajectory; not allowed on other types."
          },
          "data": {
            "description": "Any JSON. A document's content: `{documentId, title?, text, capturedAt?, deleted?}`. Optional on a trajectory, where it is kept as raw telemetry."
          }
        },
        "required": [
          "src",
          "sid"
        ],
        "description": "Source envelope submitted for processing."
      },
      "Step": {
        "type": "object",
        "properties": {
          "seq": {
            "type": "integer",
            "description": "The step's position in the session. Integer; give each step its own, increasing across calls."
          },
          "ts": {
            "type": "string",
            "description": "When it happened: ISO-8601 with an offset."
          },
          "kind": {
            "type": "string",
            "enum": [
              "msg",
              "tool",
              "error",
              "outcome",
              "session"
            ],
            "description": "`msg` for a message; `session` for context such as a system prompt; `tool` for a tool call or result."
          },
          "role": {
            "type": "string",
            "enum": [
              "user",
              "assistant",
              "tool",
              "system"
            ]
          },
          "text": {
            "type": "string",
            "description": "What was said or done. Scrub secrets before sending."
          }
        },
        "required": [
          "seq",
          "ts",
          "kind",
          "role",
          "text"
        ],
        "additionalProperties": {},
        "description": "One step of a trajectory: a message, or a tool call or result. Only an integer `seq` is checked; the other fields are what processing reads."
      },
      "ConsolidateResponse": {
        "anyOf": [
          {
            "$ref": "#/components/schemas/StatelessConsolidateResponse"
          },
          {
            "$ref": "#/components/schemas/StatefulConsolidateResponse"
          }
        ]
      },
      "StatelessConsolidateResponse": {
        "type": "object",
        "properties": {
          "billing": {
            "$ref": "#/components/schemas/BillingReceipt"
          },
          "experiences": {
            "type": "array",
            "items": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/ExperienceReference"
                },
                {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "consolidated",
                        "skipped"
                      ]
                    },
                    "claimIds": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "required": [
                    "claimIds"
                  ]
                }
              ]
            }
          },
          "extractedClaims": {
            "$ref": "#/components/schemas/ClaimList"
          },
          "extractedClaimsComplete": {
            "type": "boolean",
            "description": "Whether extraction coverage could be verified for the selected source material. This is not page completion: check extractedClaims.truncated for omitted output. Omitted when extractedClaims is not requested."
          },
          "engrams": {
            "$ref": "#/components/schemas/EngramCollection"
          },
          "events": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Event"
            }
          },
          "usage": {
            "type": "object",
            "properties": {
              "tokensSent": {
                "type": "integer"
              },
              "tokensSentSource": {
                "type": "string"
              },
              "modelInputTokens": {
                "type": "integer"
              },
              "modelOutputTokens": {
                "type": "integer"
              }
            },
            "required": [
              "tokensSent"
            ]
          },
          "timing": {
            "type": "object",
            "properties": {
              "firstClaimMs": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "firstEngramMs": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "totalMs": {
                "type": "number"
              }
            },
            "required": [
              "firstClaimMs",
              "firstEngramMs",
              "totalMs"
            ]
          }
        },
        "required": [
          "experiences",
          "engrams",
          "events",
          "usage",
          "timing"
        ]
      },
      "ClaimList": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "list"
            ],
            "description": "The collection type. Always list."
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Claim"
            },
            "description": "Claims loaded on this page. A short or empty page can still have a continuation."
          },
          "nextPageUrl": {
            "type": [
              "string",
              "null"
            ],
            "description": "Follow this relative URL unchanged. Null means there is no next page. One-shot output can still omit items when truncated is true."
          },
          "url": {
            "type": "string",
            "description": "The collection's resource path, when available. Use nextPageUrl, rather than this path, to load the next page."
          },
          "truncated": {
            "type": "boolean",
            "description": "True when a bounded one-shot result omitted items. One-shot results have no browsing continuation; use Workspace-backed memory when you need subsequent retrieval. False means all selected items were returned. Workspace lists use nextPageUrl instead."
          },
          "billing": {
            "$ref": "#/components/schemas/BillingReceipt"
          }
        },
        "required": [
          "object",
          "data",
          "nextPageUrl"
        ],
        "example": {
          "object": "list",
          "data": [
            {
              "object": "claim",
              "id": "clm_000000000000000000000001",
              "text": "Production releases require owner approval.",
              "experience": "exp_000000000000000000000001",
              "at": "2026-10-28T12:00:00.000Z"
            }
          ],
          "nextPageUrl": null
        },
        "description": "A page of Claims from this call's source material, including Claims that did not form an Engram. A Claim can also appear in an Engram's claims.data with the same ID. Omitted when not requested."
      },
      "Claim": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "claim"
            ],
            "description": "The resource type. Always claim."
          },
          "id": {
            "type": "string",
            "pattern": "^clm_[0-9a-f]{24}$",
            "description": "The ID Augenta assigns to this statement, starting with clm_. Use it to match a Claim in extractedClaims.data with the same Claim in an Engram's claims.data. It belongs to the Workspace or one-shot result that returned it."
          },
          "text": {
            "type": "string",
            "description": "The statement extracted from your source, such as Production releases require owner approval. Read this field for the Claim's content. Claims do not have labels."
          },
          "experience": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^exp_[0-9a-f]{24}$",
            "description": "The id of the Experience this Claim came from. In Workspace mode, use it with GET /v1/experiences/{id} to check processing status. Null means the source could not be identified for an older Claim."
          },
          "at": {
            "type": "string",
            "format": "date-time",
            "description": "When this statement was observed in its source, as an ISO-8601 timestamp. This is not the time you fetched the Claim."
          },
          "source": {
            "type": "object",
            "additionalProperties": {},
            "description": "Additional source details, such as a conversation session or document path, when available. The fields depend on how the source was submitted. Omitted when no source details are available."
          }
        },
        "required": [
          "object",
          "id",
          "text",
          "experience",
          "at"
        ],
        "example": {
          "object": "claim",
          "id": "clm_000000000000000000000001",
          "text": "Production releases require owner approval.",
          "experience": "exp_000000000000000000000001",
          "at": "2026-10-28T12:00:00.000Z"
        }
      },
      "EngramCollection": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "list"
            ]
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Engram"
            }
          },
          "nextPageUrl": {
            "type": [
              "string",
              "null"
            ]
          },
          "url": {
            "type": "string"
          },
          "truncated": {
            "type": "boolean",
            "description": "True when a bounded one-shot result omitted items. One-shot results have no browsing continuation; use Workspace-backed memory when you need subsequent retrieval. False means all selected items were returned. Workspace lists use nextPageUrl instead."
          },
          "billing": {
            "$ref": "#/components/schemas/BillingReceipt"
          }
        },
        "required": [
          "object",
          "data",
          "nextPageUrl"
        ]
      },
      "Engram": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "engram"
            ],
            "description": "The resource type. Always engram. Use this field to recognize Engram objects in API results."
          },
          "id": {
            "type": "string",
            "pattern": "^eng_[0-9a-f]{24}$",
            "description": "The ID Augenta assigns to this Engram, starting with `eng_`. In a Workspace, put this value in `GET /v1/engrams/{id}` to retrieve it. A one-shot Engram exists only in that result and has no standalone lookup URL. See [Engram IDs](/engrams#engram-ids) for examples and how IDs behave as memory changes."
          },
          "summary": {
            "type": [
              "string",
              "null"
            ],
            "description": "A readable summary of the Claims grouped in this Engram. Use it to display what the Engram is about. It can change as Claims or summary text change. Null when no summary is available; omitted when summaries:false is requested."
          },
          "label": {
            "type": [
              "string",
              "null"
            ],
            "description": "A short topic label, such as releases · rollback, for display in lists. Augenta chooses terms that distinguish this Engram from others in the same Workspace or one-shot result. An empty string means no terms qualified; null means a label is unavailable. Omitted with summaries:false."
          },
          "labelSupport": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0,
            "maximum": 1,
            "description": "How widely the label's terms appear in this Engram's Claims. For each term, Augenta calculates the share of Claims containing it, then averages those shares. Ranges from 0 to 1: at 1, every label term appears in every Claim. It is not confidence in the label's accuracy. Null when unavailable; omitted with summaries:false."
          },
          "memoryClass": {
            "type": [
              "string",
              "null"
            ],
            "description": "The kind of content Augenta identified. Common values are `semantic` for facts, `episodic` for past events, `procedural` for how-to knowledge and `prospective` for commitments or future tasks. This does not select one-shot or Workspace mode. Null when unavailable."
          },
          "status": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "active",
              "weakened",
              null
            ],
            "description": "The Engram's recorded state. `weakened` means its strength fell below half its recorded peak; it can return to `active` when its strength recovers. This describes retained memory, not Experience processing progress. Null when unavailable."
          },
          "strength": {
            "type": [
              "number",
              "null"
            ],
            "description": "A score describing the structural support for this Engram's group of Claims. Larger values indicate a stronger grouping under the memory process's scoring rules; this is not a probability or a measure of factual correctness. One-shot scores describe its last rebuild; Workspace scores come from its persisted memory history. Compare within the same memory, not across modes. Null when unavailable."
          },
          "heatShare": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0,
            "maximum": 1,
            "description": "A relative activity measure: this Engram's share of the memory's recorded activity signal, called heat. Ranges from 0 to 1; 0.25 means one quarter of that memory's heat at the last evaluation. Workspace heat reflects incoming Claims and recorded recall activity; one-shot heat has no recorded recall activity. This is not confidence or billing usage. Null when unavailable."
          },
          "claimCount": {
            "type": "integer",
            "minimum": 0,
            "description": "The total number of Claims currently in this Engram. Use it to show the size of the group. It can exceed claims.data.length because only one page may be loaded; Claims that have left the Engram are excluded."
          },
          "claimTokenCount": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "description": "The total number of text tokens in this Engram's current Claims, excluding its summary. It describes content size, not tokens billed for a request or the size of your eventual model prompt. Null when unavailable."
          },
          "bornAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When this Engram ID was first published, as an ISO-8601 timestamp. It is not the date of the oldest source Claim. Null when the publication time is unknown for older memory."
          },
          "updatedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the Engram's Claim membership or summary text last changed, as an ISO-8601 timestamp. A summary written after consolidation can advance it. Reads and changes only to scores, status or labels do not. It is not a version for the entire object. Null when the content-change time is unknown."
          },
          "claims": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ClaimList"
              },
              {
                "description": "A page of Claims currently in this Engram. Read claims.data for the statements and follow claims.nextPageUrl for more. Workspace detail and completed-memory results load an initial page by default; list requests need include=claims. An omitted field means Claims were not loaded, not that the Engram is empty."
              }
            ]
          }
        },
        "required": [
          "object",
          "id",
          "memoryClass",
          "status",
          "strength",
          "heatShare",
          "claimCount",
          "claimTokenCount",
          "bornAt",
          "updatedAt"
        ],
        "example": {
          "object": "engram",
          "id": "eng_000000000000000000000001",
          "summary": "Production releases require owner approval.",
          "label": "production · approval",
          "labelSupport": 1,
          "memoryClass": "semantic",
          "status": "active",
          "strength": 1.5,
          "heatShare": 0.25,
          "claimCount": 1,
          "claimTokenCount": 7,
          "bornAt": "2026-10-28T12:00:00.000Z",
          "updatedAt": "2026-10-28T12:00:00.000Z",
          "claims": {
            "object": "list",
            "data": [
              {
                "object": "claim",
                "id": "clm_000000000000000000000001",
                "text": "Production releases require owner approval.",
                "experience": "exp_000000000000000000000001",
                "at": "2026-10-28T12:00:00.000Z"
              }
            ],
            "nextPageUrl": null
          }
        }
      },
      "Event": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "event"
            ],
            "description": "The resource type. Always event."
          },
          "id": {
            "type": "string",
            "pattern": "^evt_[0-9a-f]{52}$",
            "description": "The ID of this recorded Event, starting with evt_. Use it with GET /v1/events/{id} in the same Workspace. Read data.object.id for the affected Engram's eng_ ID. Snapshot Events are returned inline and have no stored lookup URL."
          },
          "type": {
            "type": "string",
            "enum": [
              "engram.created",
              "engram.changed",
              "engram.split",
              "engram.merged",
              "engram.retired"
            ],
            "description": "What happened: an Engram was created, changed membership, split, merged or retired. These Events do not report every score or summary update."
          },
          "created": {
            "type": "integer",
            "description": "Recorded event time as Unix seconds. Workspace event feeds follow committed order even when source clocks go backward; one-shot events describe the completed rebuild."
          },
          "data": {
            "type": "object",
            "properties": {
              "object": {
                "$ref": "#/components/schemas/EngramChange"
              }
            },
            "required": [
              "object"
            ],
            "description": "The recorded identity-lineage payload. Completed memory results return the same Event resource in events. This is not a historical Engram snapshot or a complete score/prose audit."
          }
        },
        "required": [
          "object",
          "id",
          "type",
          "created",
          "data"
        ],
        "example": {
          "object": "event",
          "id": "evt_2226fd14918857cbd289a8930000000000000100000000000001",
          "type": "engram.created",
          "created": 1790812800,
          "data": {
            "object": {
              "object": "engram_change",
              "id": "eng_000000000000000000000001",
              "kind": "born",
              "claimCountBefore": 0,
              "claimCountAfter": 1,
              "into": [],
              "absorbed": [],
              "at": "2026-10-01T00:00:00.000Z"
            }
          }
        }
      },
      "EngramChange": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "engram_change"
            ],
            "description": "The recorded payload type. Always engram_change."
          },
          "kind": {
            "type": "string",
            "enum": [
              "born",
              "update",
              "split",
              "merge",
              "retire"
            ],
            "description": "What happened to the affected Engram's identity or Claim membership. The enclosing Event exposes the corresponding dotted type, such as engram.created for born."
          },
          "id": {
            "type": "string",
            "pattern": "^eng_[0-9a-f]{24}$",
            "description": "The ID of the Engram affected by this transition. This is an eng_ ID, not the Event's evt_ ID. The Engram may have been retired since this Event was recorded."
          },
          "claimCountBefore": {
            "type": "integer",
            "minimum": 0,
            "description": "The affected Engram's total current Claims immediately before this transition. Zero for a new Engram."
          },
          "claimCountAfter": {
            "type": "integer",
            "minimum": 0,
            "description": "The affected Engram's total current Claims immediately after this transition. Zero when the identity is retired."
          },
          "into": {
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^eng_[0-9a-f]{24}$"
            },
            "description": "New Engram IDs created by a split. Empty for other transition kinds."
          },
          "absorbed": {
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^eng_[0-9a-f]{24}$"
            },
            "description": "Engram IDs merged into this surviving Engram and retired. Empty for other transition kinds."
          },
          "at": {
            "type": "string",
            "format": "date-time",
            "description": "When this transition was recorded, as an ISO-8601 timestamp. The enclosing Event's created field represents the same time in Unix seconds."
          }
        },
        "required": [
          "object",
          "kind",
          "id",
          "claimCountBefore",
          "claimCountAfter",
          "into",
          "absorbed",
          "at"
        ]
      },
      "StatefulConsolidateResponse": {
        "type": "object",
        "properties": {
          "billing": {
            "$ref": "#/components/schemas/BillingReceipt"
          },
          "workspace": {
            "type": "string"
          },
          "operation": {
            "type": "string"
          },
          "experiences": {
            "type": "array",
            "items": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/ExperienceReference"
                },
                {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "processed",
                        "superseded"
                      ]
                    }
                  }
                }
              ]
            }
          },
          "extractedClaims": {
            "$ref": "#/components/schemas/ClaimList"
          },
          "extractedClaimsComplete": {
            "type": "boolean"
          },
          "usage": {
            "type": "object",
            "properties": {
              "tokensSent": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "tokensSentSource": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "modelInputTokens": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "modelOutputTokens": {
                "type": [
                  "integer",
                  "null"
                ]
              }
            },
            "required": [
              "tokensSent",
              "tokensSentSource",
              "modelInputTokens",
              "modelOutputTokens"
            ]
          },
          "context": {
            "type": "object",
            "properties": {
              "memory": {
                "type": "array",
                "items": {}
              },
              "messages": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/ConsolidateMessage"
                }
              },
              "budget_tokens": {
                "type": "integer"
              },
              "tokensEstimated": {
                "type": "integer"
              },
              "tokenEstimateSource": {
                "type": "string",
                "enum": [
                  "estimate:utf8-bytes/3.5"
                ]
              },
              "memoryTruncated": {
                "type": "boolean"
              }
            },
            "required": [
              "memory",
              "messages",
              "budget_tokens",
              "tokensEstimated",
              "tokenEstimateSource",
              "memoryTruncated"
            ]
          },
          "recall": {
            "type": "object",
            "additionalProperties": {}
          },
          "timing": {
            "type": "object",
            "properties": {
              "firstClaimMs": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "firstEngramMs": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "totalMs": {
                "type": "number"
              }
            },
            "required": [
              "firstClaimMs",
              "firstEngramMs",
              "totalMs"
            ]
          }
        },
        "required": [
          "workspace",
          "operation",
          "experiences",
          "usage",
          "context",
          "timing"
        ]
      },
      "ConsolidateMessage": {
        "type": "object",
        "properties": {
          "role": {
            "type": "string",
            "enum": [
              "system",
              "developer",
              "user",
              "assistant",
              "tool"
            ]
          },
          "content": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              },
              {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": {}
                }
              }
            ]
          },
          "tool_calls": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "type": {
                  "type": "string"
                },
                "function": {
                  "type": "object",
                  "properties": {
                    "name": {
                      "type": "string"
                    },
                    "arguments": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "name",
                    "arguments"
                  ]
                }
              },
              "required": [
                "id",
                "function"
              ]
            }
          },
          "tool_call_id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "ts": {
            "type": "string"
          },
          "seq": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": [
          "role",
          "content"
        ],
        "additionalProperties": {},
        "description": "Native OpenAI text/function messages or Anthropic text/tool content blocks. Full arguments and results are retained. Unsupported media and orphan tool results are rejected."
      },
      "ConsolidateRequest": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "stream": {
                "type": "boolean"
              },
              "include": {
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "claims",
                    "extractedClaims"
                  ]
                },
                "maxItems": 2,
                "default": [
                  "claims",
                  "extractedClaims"
                ],
                "description": "Which Claim collections to load in a completed-memory result. `claims` loads each Engram's initial Claim page; `extractedClaims` loads a separate page for this call's extraction. Omit this parameter for both, or send [] for neither. Asynchronous Workspace Experiences rejects output controls."
              },
              "claims_limit": {
                "type": "integer",
                "minimum": 1,
                "maximum": 500,
                "default": 100,
                "description": "Maximum Claims per initial collection page. It does not cap the Engram's total claimCount. Workspace results expose nextPageUrl for more. One-shot results report truncated when items were omitted and cannot be browsed later."
              },
              "engrams_limit": {
                "type": "integer",
                "minimum": 1,
                "maximum": 500,
                "default": 100,
                "description": "Maximum Engrams in the initial result page. A shared output bound can make output shorter. Follow Workspace engrams.nextPageUrl for more; one-shot results report truncated instead of a browsing URL."
              },
              "summaries": {
                "type": "boolean",
                "description": "Write summaries for one-shot Engrams (default true). false skips summary writing and omits summary, label and labelSupport. Workspace summaries follow its synthesis policy. Stateless output is not saved."
              },
              "session": {
                "type": "string",
                "minLength": 1,
                "maxLength": 256
              },
              "messages": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/ConsolidateMessage"
                },
                "minItems": 1,
                "maxItems": 100000
              }
            },
            "required": [
              "session",
              "messages"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "stream": {
                "type": "boolean"
              },
              "include": {
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "claims",
                    "extractedClaims"
                  ]
                },
                "maxItems": 2,
                "default": [
                  "claims",
                  "extractedClaims"
                ],
                "description": "Which Claim collections to load in a completed-memory result. `claims` loads each Engram's initial Claim page; `extractedClaims` loads a separate page for this call's extraction. Omit this parameter for both, or send [] for neither. Asynchronous Workspace Experiences rejects output controls."
              },
              "claims_limit": {
                "type": "integer",
                "minimum": 1,
                "maximum": 500,
                "default": 100,
                "description": "Maximum Claims per initial collection page. It does not cap the Engram's total claimCount. Workspace results expose nextPageUrl for more. One-shot results report truncated when items were omitted and cannot be browsed later."
              },
              "engrams_limit": {
                "type": "integer",
                "minimum": 1,
                "maximum": 500,
                "default": 100,
                "description": "Maximum Engrams in the initial result page. A shared output bound can make output shorter. Follow Workspace engrams.nextPageUrl for more; one-shot results report truncated instead of a browsing URL."
              },
              "summaries": {
                "type": "boolean",
                "description": "Write summaries for one-shot Engrams (default true). false skips summary writing and omits summary, label and labelSupport. Workspace summaries follow its synthesis policy. Stateless output is not saved."
              },
              "experiences": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/ExperienceInput"
                },
                "minItems": 1,
                "maxItems": 50
              }
            },
            "required": [
              "experiences"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "stream": {
                "type": "boolean"
              },
              "claims_limit": {
                "type": "integer",
                "minimum": 1,
                "maximum": 500,
                "default": 100,
                "description": "Maximum Claims per initial collection page. It does not cap the Engram's total claimCount. Workspace results expose nextPageUrl for more. One-shot results report truncated when items were omitted and cannot be browsed later."
              },
              "include": {
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "extractedClaims"
                  ]
                }
              },
              "query": {
                "type": "string",
                "minLength": 1,
                "maxLength": 4096
              },
              "budget_tokens": {
                "type": "integer",
                "minimum": 1,
                "maximum": 128000
              },
              "keep_recent": {
                "type": "integer",
                "minimum": 0,
                "maximum": 100000
              },
              "workspace": {
                "type": "string",
                "minLength": 1
              },
              "session": {
                "type": "string",
                "minLength": 1,
                "maxLength": 256
              },
              "messages": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/ConsolidateMessage"
                },
                "minItems": 1,
                "maxItems": 100000
              }
            },
            "required": [
              "workspace",
              "session",
              "messages"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "stream": {
                "type": "boolean"
              },
              "claims_limit": {
                "type": "integer",
                "minimum": 1,
                "maximum": 500,
                "default": 100,
                "description": "Maximum Claims per initial collection page. It does not cap the Engram's total claimCount. Workspace results expose nextPageUrl for more. One-shot results report truncated when items were omitted and cannot be browsed later."
              },
              "include": {
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "extractedClaims"
                  ]
                }
              },
              "query": {
                "type": "string",
                "minLength": 1,
                "maxLength": 4096
              },
              "budget_tokens": {
                "type": "integer",
                "minimum": 1,
                "maximum": 128000
              },
              "keep_recent": {
                "type": "integer",
                "minimum": 0,
                "maximum": 100000
              },
              "workspace": {
                "type": "string",
                "minLength": 1
              },
              "experiences": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/ExperienceInput"
                },
                "minItems": 1,
                "maxItems": 50
              }
            },
            "required": [
              "workspace",
              "experiences"
            ],
            "additionalProperties": false
          }
        ],
        "description": "Send messages with session, or experience envelopes. Include workspace for durable processing and optional Recall/context. Omit workspace for one-shot stateless processing: no data is retained and no continuation is returned. query, budget_tokens and keep_recent apply only to Workspace mode; summaries applies only to one-shot mode."
      },
      "EngramList": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "list"
            ]
          },
          "url": {
            "type": "string",
            "description": "The list's own path."
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Engram"
            }
          },
          "nextPageUrl": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "object",
          "url",
          "data",
          "nextPageUrl"
        ],
        "example": {
          "object": "list",
          "url": "/v1/engrams",
          "data": [
            {
              "object": "engram",
              "id": "eng_000000000000000000000001",
              "summary": "Production releases require owner approval.",
              "label": "production · approval",
              "labelSupport": 1,
              "memoryClass": "semantic",
              "status": "active",
              "strength": 1.5,
              "heatShare": 0.25,
              "claimCount": 1,
              "claimTokenCount": 7,
              "bornAt": "2026-10-28T12:00:00.000Z",
              "updatedAt": "2026-10-28T12:00:00.000Z"
            }
          ],
          "nextPageUrl": null
        }
      },
      "EventList": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "list"
            ]
          },
          "url": {
            "type": "string",
            "enum": [
              "/v1/events"
            ]
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Event"
            }
          },
          "nextPageUrl": {
            "type": [
              "string",
              "null"
            ]
          },
          "since": {
            "type": "string"
          }
        },
        "required": [
          "object",
          "url",
          "data",
          "nextPageUrl",
          "since"
        ]
      },
      "CreatedApiKey": {
        "allOf": [
          {
            "$ref": "#/components/schemas/ApiKey"
          },
          {
            "type": "object",
            "properties": {
              "secret": {
                "type": "string"
              }
            },
            "required": [
              "secret"
            ]
          }
        ],
        "example": {
          "object": "api_key",
          "id": "sk-aug-example",
          "orgId": "org_example",
          "label": "Release assistant",
          "workspaceIds": [
            "release-guides"
          ],
          "createdByUserId": "user_example",
          "createdAt": "2026-10-27T12:00:00Z",
          "secret": "<one-time-secret>"
        },
        "description": "The ApiKey resource plus its one-time secret. List and retrieve never return the secret or its hash."
      },
      "ApiKey": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "api_key"
            ],
            "description": "The resource type. Always api_key."
          },
          "id": {
            "type": "string",
            "minLength": 1,
            "description": "Public credential identity used in administration routes. It is not the authentication secret."
          },
          "orgId": {
            "type": "string",
            "minLength": 1,
            "description": "Owning Organization's Augenta ID."
          },
          "label": {
            "type": "string",
            "description": "Human-readable credential name."
          },
          "createdByUserId": {
            "type": "string",
            "description": "Person who issued the credential."
          },
          "createdAt": {
            "type": "string",
            "description": "Recorded credential creation time."
          },
          "scope": {
            "type": "string",
            "description": "Scope metadata, when present."
          },
          "workspaceIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Assigned Workspaces. An empty array permits one-shot Consolidate only."
          },
          "workspaceId": {
            "type": "string",
            "description": "Legacy single-Workspace assignment, when applicable."
          },
          "connectorId": {
            "type": "string",
            "description": "Legacy Connector-backed credential reference, when applicable."
          },
          "lastActiveAt": {
            "type": "string",
            "description": "Last recorded authentication activity, when available."
          },
          "revokedAt": {
            "type": "string",
            "description": "Recorded revocation time, when revoked."
          }
        },
        "required": [
          "object",
          "id",
          "orgId",
          "label",
          "createdByUserId",
          "createdAt"
        ],
        "example": {
          "object": "api_key",
          "id": "sk-aug-example",
          "orgId": "org_example",
          "label": "Release assistant",
          "workspaceIds": [
            "release-guides"
          ],
          "createdByUserId": "user_example",
          "createdAt": "2026-10-27T12:00:00Z"
        }
      },
      "CreateApiKeyRequest": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "label": {
                "type": "string",
                "minLength": 1
              },
              "workspaceIds": {
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1
                },
                "default": []
              }
            },
            "required": [
              "label"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "label": {
                "type": "string",
                "minLength": 1
              },
              "connectorId": {
                "type": "string",
                "minLength": 1
              }
            },
            "required": [
              "label",
              "connectorId"
            ],
            "additionalProperties": false
          }
        ],
        "description": "Create a key with zero or more assigned Workspaces. Omit workspaceIds or send [] for stateless-only access. Each assigned Workspace grants reads and writes. Legacy Connector issuance is also supported. Labels are trimmed and capped at 120 characters."
      },
      "ApiKeyList": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "list"
            ]
          },
          "url": {
            "type": "string"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiKey"
            }
          },
          "nextPageUrl": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "object",
          "url",
          "data",
          "nextPageUrl"
        ]
      },
      "RevokedApiKey": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "api_key"
            ]
          },
          "id": {
            "type": "string",
            "minLength": 1
          },
          "revoked": {
            "type": "boolean",
            "enum": [
              true
            ]
          }
        },
        "required": [
          "object",
          "id",
          "revoked"
        ]
      },
      "OrganizationList": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "list"
            ]
          },
          "url": {
            "type": "string"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Organization"
            }
          },
          "nextPageUrl": {
            "type": [
              "string",
              "null"
            ]
          },
          "activeOrgId": {
            "type": "string"
          },
          "personalOrgPolicy": {
            "type": "string",
            "enum": [
              "visible"
            ]
          }
        },
        "required": [
          "object",
          "url",
          "data",
          "nextPageUrl",
          "activeOrgId",
          "personalOrgPolicy"
        ]
      },
      "Organization": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "organization"
            ],
            "description": "The resource type. Always organization."
          },
          "id": {
            "type": "string",
            "minLength": 1,
            "description": "Augenta Organization ID used in resource routes."
          },
          "name": {
            "type": "string",
            "description": "Organization display name."
          },
          "role": {
            "type": "string",
            "description": "The signed-in person's organization role, when loaded."
          },
          "workosOrgId": {
            "type": "string",
            "description": "External identity-provider reference, when present. Resource routes use id instead."
          },
          "memberCount": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "description": "Full roster count, or null when the roster has not been read."
          },
          "members": {
            "$ref": "#/components/schemas/MemberList"
          }
        },
        "required": [
          "object",
          "id",
          "name",
          "memberCount"
        ],
        "example": {
          "object": "organization",
          "id": "org_example",
          "name": "Example",
          "memberCount": 2,
          "role": "Owner"
        }
      },
      "MemberList": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "list"
            ]
          },
          "url": {
            "type": "string"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AdministrationMember"
            }
          },
          "nextPageUrl": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "object",
          "url",
          "data",
          "nextPageUrl"
        ],
        "description": "Initial membership page, loaded by include=members on the detail read. Follow its nextPageUrl for more."
      },
      "AdministrationMember": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "organization_member",
              "workspace_member"
            ]
          },
          "id": {
            "type": "string",
            "minLength": 1
          },
          "userId": {
            "type": "string",
            "minLength": 1
          },
          "organization": {
            "type": "string"
          },
          "workspace": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "role": {
            "type": "string"
          },
          "workspaceRole": {
            "type": "string"
          },
          "orgRole": {
            "type": "string"
          },
          "via": {
            "type": "string"
          },
          "addedAt": {
            "type": "string"
          },
          "addedByUserId": {
            "type": "string"
          },
          "permissions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "memberClass": {
            "type": "string"
          },
          "hasSignedIn": {
            "type": "boolean"
          },
          "joinedAt": {
            "type": "string"
          }
        },
        "required": [
          "object",
          "id",
          "userId",
          "organization"
        ]
      },
      "WorkspaceList": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "list"
            ]
          },
          "url": {
            "type": "string"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Workspace"
            }
          },
          "nextPageUrl": {
            "type": [
              "string",
              "null"
            ]
          },
          "organization": {
            "$ref": "#/components/schemas/Organization"
          }
        },
        "required": [
          "object",
          "url",
          "data",
          "nextPageUrl",
          "organization"
        ]
      },
      "Workspace": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "workspace"
            ],
            "description": "The resource type. Always workspace."
          },
          "id": {
            "type": "string",
            "minLength": 1,
            "description": "Workspace identity used in routes and memory selectors."
          },
          "orgId": {
            "type": "string",
            "minLength": 1,
            "description": "Owning Organization's Augenta ID."
          },
          "name": {
            "type": "string",
            "description": "Display name. Renaming does not change the Workspace ID."
          },
          "status": {
            "type": "string",
            "description": "Current Workspace lifecycle state."
          },
          "kind": {
            "type": "string",
            "description": "Shared Workspace or provisioned personal Default Workspace. Personal Workspaces have separate lifecycle rules."
          },
          "ownerUserId": {
            "type": "string",
            "description": "Owner of a personal Workspace, when applicable."
          },
          "synthesisCadence": {
            "type": "string",
            "description": "Configured consolidation cadence, when set."
          },
          "createdByUserId": {
            "type": "string",
            "description": "Person who created the Workspace."
          },
          "createdAt": {
            "type": "string",
            "description": "Recorded Workspace creation time."
          },
          "updatedAt": {
            "type": "string",
            "description": "Recorded Workspace configuration update time."
          },
          "_etag": {
            "type": "string",
            "description": "Revision for an If-Match update or archive, when available."
          },
          "workspaceRole": {
            "type": "string",
            "description": "The signed-in person's effective Workspace role, when loaded."
          },
          "via": {
            "type": "string",
            "description": "Source of effective access, such as direct or inherited membership, when loaded."
          },
          "members": {
            "$ref": "#/components/schemas/MemberList"
          }
        },
        "required": [
          "object",
          "id",
          "orgId",
          "name",
          "status",
          "kind",
          "createdByUserId",
          "createdAt",
          "updatedAt"
        ],
        "example": {
          "object": "workspace",
          "id": "release-guides",
          "orgId": "org_example",
          "name": "Release guides",
          "status": "active",
          "kind": "shared",
          "createdByUserId": "user_example",
          "createdAt": "2026-10-27T12:00:00Z",
          "updatedAt": "2026-10-27T12:00:00Z",
          "workspaceRole": "admin"
        }
      },
      "WorkspaceMemberList": {
        "allOf": [
          {
            "$ref": "#/components/schemas/MemberList"
          },
          {
            "type": "object",
            "properties": {
              "workspace": {
                "$ref": "#/components/schemas/Workspace"
              }
            },
            "required": [
              "workspace"
            ]
          }
        ]
      },
      "Experience": {
        "allOf": [
          {
            "$ref": "#/components/schemas/ExperienceReference"
          },
          {
            "type": "object",
            "properties": {
              "object": {
                "type": "string",
                "enum": [
                  "experience"
                ]
              },
              "status": {
                "type": "string",
                "enum": [
                  "accepted",
                  "processed",
                  "consolidated",
                  "failed"
                ],
                "description": "accepted: the source is stored and waiting for processing. processed: its Claims have been extracted and stored; Recall can search them even before they form an Engram. consolidated: a Workspace consolidation has covered those Claims. failed: processing could not complete; read error. Acceptance or a bounded wait does not promise immediate consolidation."
              },
              "billing": {
                "$ref": "#/components/schemas/BillingReceipt"
              },
              "type": {
                "type": "string",
                "description": "The kind of source submitted: for example, trajectory for a conversation or agent run, or doc for a document."
              },
              "workspace": {
                "type": "string",
                "description": "The ID of the Workspace storing this Experience."
              },
              "acceptedAt": {
                "type": "string",
                "description": "When Augenta accepted and stored this source."
              },
              "processedAt": {
                "type": "string",
                "description": "When processing completed, if it has finished."
              },
              "consolidatedAt": {
                "type": "string",
                "description": "When consolidation covered this Experience, if it has been consolidated."
              },
              "experienceId": {
                "type": "string",
                "description": "An additional processing reference, when available. Use id, the exp_ identifier, in public resource URLs."
              },
              "claimCount": {
                "type": "integer",
                "description": "How many claims were extracted, once processed."
              },
              "error": {
                "type": "object",
                "properties": {
                  "code": {
                    "type": "string"
                  },
                  "message": {
                    "type": "string"
                  }
                },
                "required": [
                  "code",
                  "message"
                ],
                "description": "Why it failed. Present only when `status` is `failed`."
              }
            },
            "required": [
              "type",
              "workspace",
              "acceptedAt"
            ]
          }
        ],
        "example": {
          "object": "experience",
          "id": "exp_000000000000000000000001",
          "type": "doc",
          "workspace": "ws-product",
          "status": "processed",
          "acceptedAt": "2026-10-28T12:00:00.000Z",
          "processedAt": "2026-10-28T12:00:01.000Z",
          "claimCount": 1
        }
      },
      "WorkspaceDeletion": {
        "type": "object",
        "properties": {
          "workspaceId": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "deleting",
              "deleted"
            ],
            "description": "`deleting`: call again (see `Retry-After`). `deleted`: every store reads zero for this Workspace."
          },
          "counts": {
            "type": "object",
            "additionalProperties": {
              "type": "integer"
            },
            "description": "What has been deleted so far, by store and table, summed across calls. Counts only, never content."
          },
          "pending": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The stores this call left unfinished. Empty once deleted."
          }
        },
        "required": [
          "workspaceId",
          "status",
          "counts",
          "pending"
        ]
      },
      "DeadLetterRedriveResponse": {
        "type": "object",
        "properties": {
          "requeued": {
            "type": "integer",
            "description": "Dead letters queued again, each with its eight deliveries back."
          },
          "remaining": {
            "type": "integer",
            "description": "Dead letters the filters match that were not re-queued by this call."
          }
        },
        "required": [
          "requeued",
          "remaining"
        ]
      },
      "DeadLetterRedriveRequest": {
        "type": "object",
        "properties": {
          "codes": {
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_-]{0,63}$"
            },
            "minItems": 1,
            "maxItems": 32,
            "description": "Only dead letters that failed with one of these codes. Absent: every code."
          },
          "since": {
            "type": "string",
            "format": "date-time",
            "description": "Only dead letters that finished at or after this instant."
          },
          "until": {
            "type": "string",
            "format": "date-time",
            "description": "Only dead letters that finished before this instant."
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1000,
            "default": 500,
            "description": "The most to re-queue in one call, oldest first; `remaining` says how many more match."
          }
        },
        "additionalProperties": false
      },
      "RecallResponse": {
        "type": "object",
        "properties": {
          "billing": {
            "$ref": "#/components/schemas/BillingReceipt"
          },
          "noMatch": {
            "type": "boolean",
            "description": "true when a valid recall has no candidates. Returns 200 with empty content and no model call; service failures remain errors."
          },
          "score": {
            "type": "object",
            "properties": {
              "method": {
                "type": "string"
              },
              "value": {
                "type": "number"
              },
              "parameters": {
                "type": "object",
                "additionalProperties": {}
              },
              "components": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "method": {
                      "type": "string"
                    },
                    "value": {
                      "type": "number"
                    },
                    "rank": {
                      "type": "integer",
                      "exclusiveMinimum": 0
                    }
                  },
                  "required": [
                    "method",
                    "value",
                    "rank"
                  ]
                }
              }
            },
            "required": [
              "method",
              "value"
            ],
            "description": "Actual retrieval ranking score, with its method and contributing channels. Raw reciprocal-rank-fusion, inner-product and BM25 values are not confidence probabilities and are not comparable across queries or Workspaces. Absent for noMatch."
          },
          "workspace": {
            "type": "string",
            "description": "The authorized Workspace this recall read. "
          },
          "mode": {
            "type": "string",
            "enum": [
              "answer",
              "context"
            ],
            "description": "Which mode produced this response."
          },
          "reference_date": {
            "type": [
              "string",
              "null"
            ],
            "description": "The latest date (`YYYY-MM-DD`) any returned claim was observed, or `null`. Resolve \"recently\" against this."
          },
          "claim_count": {
            "type": "integer",
            "description": "How many claims retrieval selected, before response limits. Not a count of every claim in the Workspace."
          },
          "claims_truncated": {
            "type": "boolean",
            "description": "`true` when `content` holds fewer claims than `claim_count` (at most 100 are returned, fewer if the token budget runs out first)."
          },
          "window": {
            "type": "object",
            "properties": {
              "from": {
                "type": "string",
                "description": "Start of the window, an ISO 8601 instant (inclusive)."
              },
              "to": {
                "type": "string",
                "description": "End of the window, an ISO 8601 instant (exclusive)."
              },
              "timezone": {
                "type": "string",
                "description": "The zone the window's days were taken in: the request's `timezone`, or `UTC`."
              },
              "claim_count": {
                "type": "integer",
                "description": "How many claims were recorded in the window."
              },
              "session_count": {
                "type": "integer",
                "description": "How many sessions those claims come from. A subagent counts with its parent."
              },
              "document_count": {
                "type": "integer",
                "description": "How many documents those claims come from."
              },
              "claims_shown": {
                "type": "integer",
                "description": "How many of the window's claims this response's evidence holds."
              },
              "sessions_shown": {
                "type": "integer",
                "description": "How many of the window's sessions those claims come from."
              },
              "selection": {
                "type": "string",
                "enum": [
                  "coverage",
                  "ranked"
                ],
                "description": "`coverage`: the question asked what happened in the window, so the claims are spread across every session and every active stretch of it. `ranked`: the question named a topic too, so they are the window's claims that best match it."
              }
            },
            "required": [
              "from",
              "to",
              "timezone",
              "claim_count",
              "session_count",
              "document_count",
              "claims_shown",
              "sessions_shown",
              "selection"
            ],
            "description": "Present when the question named a time that claims were recorded in (\"what was done on October 13?\"): which span was read, how much memory was recorded in it, and how much of that this response holds. Absent otherwise. A time selects claims by when they were recorded, never by a date their text mentions."
          },
          "content": {
            "type": "array",
            "items": {
              "oneOf": [
                {
                  "$ref": "#/components/schemas/AnswerBlock"
                },
                {
                  "$ref": "#/components/schemas/EngramBlock"
                },
                {
                  "$ref": "#/components/schemas/ClaimBlock"
                },
                {
                  "$ref": "#/components/schemas/LineageBlock"
                }
              ],
              "discriminator": {
                "propertyName": "type",
                "mapping": {
                  "answer": "#/components/schemas/AnswerBlock",
                  "engram": "#/components/schemas/EngramBlock",
                  "claim": "#/components/schemas/ClaimBlock",
                  "lineage": "#/components/schemas/LineageBlock"
                }
              }
            },
            "description": "Ordered blocks: `answer` (answer mode only), then `engram`, then `claim`s oldest first, then `lineage`. Every block has `type` and `text`. Ignore block types you don't recognize; new ones may be added."
          }
        },
        "required": [
          "noMatch",
          "workspace",
          "mode",
          "reference_date",
          "claim_count",
          "claims_truncated",
          "content"
        ],
        "description": "The `content-v3` response, sent when the request asks for it with `X-Augenta-Content: content-v3`. A `content-v2` response is the same with `note_count`, `notes_truncated` and `note` blocks."
      },
      "AnswerBlock": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "answer"
            ]
          },
          "text": {
            "type": "string",
            "description": "The written answer."
          }
        },
        "required": [
          "type",
          "text"
        ],
        "title": "Answer"
      },
      "EngramBlock": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "engram"
            ]
          },
          "text": {
            "type": "string",
            "description": "The engram's summary: what the Workspace has consolidated on this topic."
          },
          "engram_id": {
            "type": "string",
            "description": "A stable handle for this engram."
          },
          "memory_class": {
            "type": [
              "string",
              "null"
            ],
            "description": "The kind of memory, e.g. procedural or semantic."
          },
          "born_t": {
            "type": [
              "string",
              "null"
            ],
            "description": "When the engram formed."
          },
          "contradiction": {
            "type": "boolean",
            "description": "`true` when its claims disagree with each other."
          },
          "quality_verdict": {
            "type": "string",
            "description": "Quality assessment, or `unscored`."
          }
        },
        "required": [
          "type",
          "text",
          "engram_id",
          "memory_class",
          "born_t",
          "contradiction",
          "quality_verdict"
        ],
        "title": "Engram"
      },
      "ClaimBlock": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "claim"
            ]
          },
          "text": {
            "type": "string",
            "description": "One statement the engram was built from. A model wrote it from captured experience, such as an agent's session, so it describes what happened rather than quoting anyone."
          },
          "timestamp": {
            "type": [
              "string",
              "null"
            ],
            "description": "When it was observed, as the producer wrote it."
          },
          "question": {
            "type": "boolean",
            "description": "`true` when the claim records a question rather than a statement."
          },
          "frame": {
            "type": "object",
            "additionalProperties": {},
            "description": "Structured fields extracted with the claim. May be empty."
          },
          "metadata": {
            "type": "object",
            "additionalProperties": {},
            "description": "Where the observation came from, e.g. `src`. May be empty."
          }
        },
        "required": [
          "type",
          "text",
          "timestamp",
          "question",
          "frame",
          "metadata"
        ],
        "title": "Claim"
      },
      "LineageBlock": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "lineage"
            ]
          },
          "text": {
            "type": "string",
            "description": "One event in the engram's history, e.g. `BORN (0->3 members)`."
          },
          "t": {
            "type": "string",
            "description": "When it happened."
          },
          "kind": {
            "type": "string",
            "description": "The event kind, e.g. `born`."
          },
          "members_before": {
            "type": [
              "integer",
              "null"
            ]
          },
          "members_after": {
            "type": [
              "integer",
              "null"
            ]
          }
        },
        "required": [
          "type",
          "text",
          "t",
          "kind",
          "members_before",
          "members_after"
        ],
        "title": "Lineage"
      },
      "RecallRequest": {
        "type": "object",
        "properties": {
          "record": {
            "type": "boolean",
            "default": true,
            "description": "Whether to record a reuse activation. false performs no activation lookup or write and needs no Idempotency-Key."
          },
          "query": {
            "type": "string",
            "minLength": 1,
            "maxLength": 4096,
            "description": "The question, in plain language."
          },
          "workspace": {
            "type": "string",
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._=-]{0,63}$",
            "description": "One Workspace assigned to the key. Required for multiple assignments, inferred for one. A Workspace outside the assignments returns 403; a key with no assignments cannot use Recall."
          },
          "origin": {
            "type": "string",
            "enum": [
              "manual",
              "auto"
            ],
            "default": "manual",
            "description": "Who asked. `manual` (a person asked) records a full-weight activation. `auto` (your code asks on every request, unprompted) records a quarter-weight one, so frequent automatic calls don't drown out deliberate reuse."
          },
          "budget_tokens": {
            "type": "integer",
            "minimum": 1,
            "description": "Context mode only: about how many tokens of claim and summary text you want back. Clamped to 100–8000. Defaults to 6000 for `manual` and 1500 for `auto`. Ignored in answer mode."
          },
          "timezone": {
            "type": "string",
            "maxLength": 64,
            "default": "UTC",
            "example": "America/New_York",
            "description": "The asker's IANA time zone. A time in the question (\"on October 13\", \"yesterday\", \"last week\") selects the claims recorded in that span of the asker's calendar, and `reference_date` is the asker's date. Send the zone the person asking is in; the browser's is `Intl.DateTimeFormat().resolvedOptions().timeZone`."
          }
        },
        "required": [
          "query"
        ],
        "additionalProperties": false
      }
    },
    "parameters": {}
  },
  "paths": {
    "/v1/experiences": {
      "post": {
        "operationId": "createExperiences",
        "summary": "Create experiences",
        "description": "Submit source Experiences for durable Workspace processing. Processing extracts Claims; scheduled consolidation groups them into Engrams. Poll GET /v1/experiences/{id}, or use wait for a bounded processing wait, which does not promise immediate consolidation. For one-shot processing without persistence, use POST /v1/consolidate without workspace.",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "example": "10"
            },
            "required": false,
            "name": "wait",
            "in": "query",
            "description": "Seconds (0–30) to wait for processing before answering. 200 when every experience finished in time, else 202."
          },
          {
            "schema": {
              "type": "string"
            },
            "required": false,
            "name": "X-Augenta-Connector-Id",
            "in": "header",
            "description": "With a person's sign-in, the Connector to write through. Existing Connector keys infer it. Direct keys select an assigned Workspace with the body workspace field (inferred for one assignment) and refuse this header. Keys need an assigned Workspace for this route."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "example": {
                "experiences": [
                  {
                    "src": "service",
                    "sid": "handbook-deploys",
                    "type": "doc",
                    "data": {
                      "documentId": "handbook/deploys.md",
                      "title": "How we deploy",
                      "text": "Merging to main deploys to dev.",
                      "capturedAt": "2026-10-14T09:30:00Z"
                    }
                  }
                ]
              },
              "schema": {
                "$ref": "#/components/schemas/ExperiencesRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Every Experience finished processing within wait.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExperiencesAccepted"
                }
              }
            }
          },
          "202": {
            "description": "Accepted; processing continues.",
            "content": {
              "application/json": {
                "example": {
                  "accepted": 1,
                  "connectorId": "3f6c2b1e-6d0a-4b7e-9a51-2f0c8e7d4a10",
                  "experiences": [
                    {
                      "id": "exp_9b2f6c1e4d7a0b3c5e8f1a2d",
                      "status": "accepted"
                    }
                  ]
                },
                "schema": {
                  "$ref": "#/components/schemas/ExperiencesAccepted"
                }
              }
            }
          },
          "400": {
            "description": "`invalid_request`: invalid experience envelopes or unsupported fields. Send `{experiences, workspace?}` for durable ingestion; use POST /v1/consolidate for one-shot processing. Unsupported state/snapshot fields are rejected; `wait` must be 0–30; a person's durable call needs `X-Augenta-Connector-Id`.",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "invalid_request",
                    "message": "experiences[0]: a trajectory needs a non-empty events array",
                    "retryable": false
                  },
                  "requestId": "req_7f9c2b1e-6d0a-4b7e-9a51-2f0c8e7d4a10"
                },
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "`unauthenticated`: missing, invalid or revoked credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "insufficient_balance: add credits before retrying the same source revision.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "`forbidden`: the Connector does not accept experiences from this credential. `connector_inactive`: the Connector is disabled.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "`payload_too_large`: an experience is over the 1 MiB limit, or the body is too large.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited` (retryable): wait the number of seconds in `Retry-After`. `at_capacity` (retryable): the service is temporarily full; wait the same way.",
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "rate limit exceeded",
                    "retryable": true
                  },
                  "requestId": "req_7f9c2b1e-6d0a-4b7e-9a51-2f0c8e7d4a10"
                },
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "`internal_error`: an unexpected failure; quote the `requestId`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "501": {
            "description": "`stateless_not_available`: Consolidate is not configured in this environment.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "`service_unavailable` (retryable): retry the same request; it is safe. `workos_unavailable` (retryable).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/consolidate": {
      "post": {
        "operationId": "consolidate",
        "summary": "Consolidate",
        "description": "Extract Claims and group them into Engrams. With workspace, submit source Experiences, wait for committed Recall-ready claims and schedule background consolidation; an optional query also runs Recall. Without workspace, process only this request and return bounded results without persistence or a continuation. stream=true emits provisional claims and one authoritative completed result; one-shot mode also emits engram previews. Workspace collections have resource page URLs; one-shot collections have nextPageUrl:null and a truncated flag. No query endpoints or saved snapshots are supported.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConsolidateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "JSON final result or SSE. Computation-stage first claim/engram timings exclude authentication, request parsing and progress events; null means no such item formed. Provisional engrams may be revised; completed Engrams are authoritative.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConsolidateResponse"
                }
              },
              "text/event-stream": {
                "schema": {
                  "type": "string",
                  "description": "SSE events: accepted (Workspace), progress, claims, engrams, reset (observation gap), completed, error. JSON data payloads. Each provisional engrams event replaces the previous preview; previews are provisional."
                }
              }
            }
          },
          "400": {
            "description": "invalid_request: malformed input, changed immutable ranges, unsupported native media/tool pairing, a Workspace call's recent group exceeds its budget, query/keep_recent/budget_tokens sent without workspace, summaries sent with a Workspace, or unsupported state/snapshot fields.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthenticated: invalid or missing credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "insufficient_balance: add credits and explicitly retry with the same Idempotency-Key. Streaming errors retain status 402.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "forbidden or connector_inactive: credential cannot use the inbound Connector.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "cursor_stale: Workspace memory changed repeatedly during the final read.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "payload_too_large, experiences_too_large: configured input or computation output limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "at_capacity (retryable): the deployment is full, or every model provider stayed throttled through the model calls' retries; send the same request after the number of seconds in Retry-After. A stream that already answered 200 ends with an error event carrying error.retryAfterSeconds instead. rate_limited (retryable): your own rate limit.",
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "501": {
            "description": "stateless_not_available: computation is not configured.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "cognition_failed or cognition_unavailable: processing failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "service_unconfigured, cognition_unconfigured or service_unavailable: managed processing is unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "504": {
            "description": "recall_timeout: a processing or Workspace recall deadline was exceeded. operation_timeout: a JSON call ran past its synchronous deadline (90 s by default); send it with stream: true.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/engrams": {
      "get": {
        "tags": [
          "Memory"
        ],
        "operationId": "listEngrams",
        "summary": "List a Workspace's engrams",
        "description": "Stable public ids in ascending order. Select a Workspace assigned to the key; it can be omitted only when the key has exactly one assignment. A person must name a Workspace they can access. Filters narrow the list; an engram without a filtered field never matches it. Follow nextPageUrl with the same Workspace, filters and limit; a new fold invalidates the list snapshot.",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._=-]{0,63}$",
              "description": "One assigned Workspace. Required for keys with multiple assignments; inferred for one."
            },
            "required": false,
            "description": "One assigned Workspace. Required for keys with multiple assignments; inferred for one.",
            "name": "workspace",
            "in": "query"
          },
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 500,
              "default": 100
            },
            "required": false,
            "name": "limit",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 131072,
              "description": "The previous memory cursor, with the same selection. Follow the returned nextPageUrl unchanged."
            },
            "required": false,
            "description": "The previous memory cursor, with the same selection. Follow the returned nextPageUrl unchanged.",
            "name": "page",
            "in": "query"
          },
          {
            "schema": {
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "claims"
                ]
              },
              "maxItems": 1
            },
            "required": false,
            "name": "include",
            "in": "query"
          },
          {
            "schema": {
              "type": [
                "number",
                "null"
              ],
              "minimum": 0,
              "description": "Engram strength greater than this value."
            },
            "required": false,
            "description": "Engram strength greater than this value.",
            "name": "strength[gt]",
            "in": "query"
          },
          {
            "schema": {
              "type": [
                "number",
                "null"
              ],
              "minimum": 0,
              "description": "Engram strength at least this value."
            },
            "required": false,
            "description": "Engram strength at least this value.",
            "name": "strength[gte]",
            "in": "query"
          },
          {
            "schema": {
              "type": [
                "number",
                "null"
              ],
              "minimum": 0,
              "description": "Engram strength less than this value."
            },
            "required": false,
            "description": "Engram strength less than this value.",
            "name": "strength[lt]",
            "in": "query"
          },
          {
            "schema": {
              "type": [
                "number",
                "null"
              ],
              "minimum": 0,
              "description": "Engram strength at most this value."
            },
            "required": false,
            "description": "Engram strength at most this value.",
            "name": "strength[lte]",
            "in": "query"
          },
          {
            "schema": {
              "type": [
                "number",
                "null"
              ],
              "minimum": 0,
              "maximum": 1,
              "description": "Heat share greater than this value."
            },
            "required": false,
            "description": "Heat share greater than this value.",
            "name": "heatShare[gt]",
            "in": "query"
          },
          {
            "schema": {
              "type": [
                "number",
                "null"
              ],
              "minimum": 0,
              "maximum": 1,
              "description": "Heat share at least this value."
            },
            "required": false,
            "description": "Heat share at least this value.",
            "name": "heatShare[gte]",
            "in": "query"
          },
          {
            "schema": {
              "type": [
                "number",
                "null"
              ],
              "minimum": 0,
              "maximum": 1,
              "description": "Heat share less than this value."
            },
            "required": false,
            "description": "Heat share less than this value.",
            "name": "heatShare[lt]",
            "in": "query"
          },
          {
            "schema": {
              "type": [
                "number",
                "null"
              ],
              "minimum": 0,
              "maximum": 1,
              "description": "Heat share at most this value."
            },
            "required": false,
            "description": "Heat share at most this value.",
            "name": "heatShare[lte]",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256,
              "description": "Only engrams of this memory class."
            },
            "required": false,
            "description": "Only engrams of this memory class.",
            "name": "memoryClass",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256,
              "description": "Only engrams whose label has this term, ignoring case. A term can be two words (\"exact scan\")."
            },
            "required": false,
            "description": "Only engrams whose label has this term, ignoring case. A term can be two words (\"exact scan\").",
            "name": "label",
            "in": "query"
          },
          {
            "schema": {
              "type": [
                "number",
                "null"
              ],
              "minimum": 0,
              "maximum": 1,
              "description": "Label support greater than this value."
            },
            "required": false,
            "description": "Label support greater than this value.",
            "name": "labelSupport[gt]",
            "in": "query"
          },
          {
            "schema": {
              "type": [
                "number",
                "null"
              ],
              "minimum": 0,
              "maximum": 1,
              "description": "Label support at least this value."
            },
            "required": false,
            "description": "Label support at least this value.",
            "name": "labelSupport[gte]",
            "in": "query"
          },
          {
            "schema": {
              "type": [
                "number",
                "null"
              ],
              "minimum": 0,
              "maximum": 1,
              "description": "Label support less than this value."
            },
            "required": false,
            "description": "Label support less than this value.",
            "name": "labelSupport[lt]",
            "in": "query"
          },
          {
            "schema": {
              "type": [
                "number",
                "null"
              ],
              "minimum": 0,
              "maximum": 1,
              "description": "Label support at most this value."
            },
            "required": false,
            "description": "Label support at most this value.",
            "name": "labelSupport[lte]",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "One bounded page.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EngramList"
                }
              }
            }
          },
          "400": {
            "description": "Invalid cursor, filter, limit or missing Workspace for a person or a key with multiple assignments.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required; revoked credentials are refused.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "insufficient_balance: add credits before reading billable memory.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Workspace access denied or Connector disabled.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Workspace or engram not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Workspace archived, or cursor_stale: a new fold changed the list snapshot; restart without a cursor.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited: retry after the Retry-After header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "An internal failure; quote the requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Cognition failed or returned an invalid response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Cognition is unavailable or unconfigured.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/engrams/{id}": {
      "get": {
        "tags": [
          "Memory"
        ],
        "operationId": "getEngram",
        "summary": "Read an engram",
        "description": "Its claims are a list of their own: GET /v1/engrams/{id}/claims.",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "pattern": "^eng_[0-9a-f]{24}$"
            },
            "required": true,
            "name": "id",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._=-]{0,63}$",
              "description": "One assigned Workspace. Required for keys with multiple assignments; inferred for one."
            },
            "required": false,
            "description": "One assigned Workspace. Required for keys with multiple assignments; inferred for one.",
            "name": "workspace",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "The shared Engram resource emitted by Consolidate and resource lists; Recall context blocks have a separate renderer contract.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Engram"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "billing": {
                          "$ref": "#/components/schemas/BillingReceipt"
                        }
                      }
                    }
                  ],
                  "example": {
                    "object": "engram",
                    "id": "eng_000000000000000000000001",
                    "summary": "Production releases require owner approval.",
                    "label": "production · approval",
                    "labelSupport": 1,
                    "memoryClass": "semantic",
                    "status": "active",
                    "strength": 1.5,
                    "heatShare": 0.25,
                    "claimCount": 1,
                    "claimTokenCount": 7,
                    "bornAt": "2026-10-28T12:00:00.000Z",
                    "updatedAt": "2026-10-28T12:00:00.000Z",
                    "claims": {
                      "object": "list",
                      "data": [
                        {
                          "object": "claim",
                          "id": "clm_000000000000000000000001",
                          "text": "Production releases require owner approval.",
                          "experience": "exp_000000000000000000000001",
                          "at": "2026-10-28T12:00:00.000Z"
                        }
                      ],
                      "nextPageUrl": null
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid cursor, filter, limit or missing Workspace for a person or a key with multiple assignments.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required; revoked credentials are refused.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "insufficient_balance: add credits before reading billable memory.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Workspace access denied or Connector disabled.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Workspace or engram not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Workspace archived, or cursor_stale: a new fold changed the list snapshot; restart without a cursor.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited: retry after the Retry-After header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "An internal failure; quote the requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Cognition failed or returned an invalid response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Cognition is unavailable or unconfigured.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/engrams/{id}/claims": {
      "get": {
        "tags": [
          "Memory"
        ],
        "operationId": "listEngramClaims",
        "summary": "List an engram's claims",
        "description": "The claims an engram holds now, in a stable order, each with the id Consolidate gave it. A filtered page can hold fewer than limit claims, even none, while more remain: follow nextPageUrl until it is null. Follow it with the same Workspace, filters and limit; a new fold invalidates the cursor.",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "pattern": "^eng_[0-9a-f]{24}$"
            },
            "required": true,
            "name": "id",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._=-]{0,63}$",
              "description": "One assigned Workspace. Required for keys with multiple assignments; inferred for one."
            },
            "required": false,
            "description": "One assigned Workspace. Required for keys with multiple assignments; inferred for one.",
            "name": "workspace",
            "in": "query"
          },
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 500,
              "default": 100
            },
            "required": false,
            "name": "limit",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 131072,
              "description": "The previous memory cursor, with the same selection. Follow the returned nextPageUrl unchanged."
            },
            "required": false,
            "description": "The previous memory cursor, with the same selection. Follow the returned nextPageUrl unchanged.",
            "name": "page",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "pattern": "^exp_[0-9a-f]{24}$",
              "description": "Only the claims this experience contributed (an id POST /v1/experiences returned)."
            },
            "required": false,
            "description": "Only the claims this experience contributed (an id POST /v1/experiences returned).",
            "name": "experience",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "format": "date-time",
              "description": "Claim observation time greater than this value."
            },
            "required": false,
            "description": "Claim observation time greater than this value.",
            "name": "at[gt]",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "format": "date-time",
              "description": "Claim observation time at least this value."
            },
            "required": false,
            "description": "Claim observation time at least this value.",
            "name": "at[gte]",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "format": "date-time",
              "description": "Claim observation time less than this value."
            },
            "required": false,
            "description": "Claim observation time less than this value.",
            "name": "at[lt]",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "format": "date-time",
              "description": "Claim observation time at most this value."
            },
            "required": false,
            "description": "Claim observation time at most this value.",
            "name": "at[lte]",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "One bounded page of claims.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClaimList"
                }
              }
            }
          },
          "400": {
            "description": "Invalid cursor, filter, limit or missing Workspace for a person or a key with multiple assignments.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required; revoked credentials are refused.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "insufficient_balance: add credits before reading billable memory.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Workspace access denied or Connector disabled.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Workspace or engram not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Workspace archived, or cursor_stale: a new fold changed the list snapshot; restart without a cursor.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited: retry after the Retry-After header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "An internal failure; quote the requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Cognition failed or returned an invalid response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Cognition is unavailable or unconfigured.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/events": {
      "get": {
        "tags": [
          "Events"
        ],
        "operationId": "listEvents",
        "summary": "List events",
        "description": "Recorded Engram lifecycle events in committed order, including when source clocks go backward. Each event has its own stable id and a recorded identity-lineage payload in data.object. This feed does not contain every score or summary update. Follow nextPageUrl to finish the selected event range. Save since to poll for later events, using the same Workspace, engram filter and limit. One-shot results have no durable event feed.",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._=-]{0,63}$",
              "description": "One assigned Workspace. Required for keys with multiple assignments; inferred for one."
            },
            "required": false,
            "description": "One assigned Workspace. Required for keys with multiple assignments; inferred for one.",
            "name": "workspace",
            "in": "query"
          },
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 500,
              "default": 100
            },
            "required": false,
            "name": "limit",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 131072,
              "description": "The previous memory cursor, with the same selection. Follow the returned nextPageUrl unchanged."
            },
            "required": false,
            "description": "The previous memory cursor, with the same selection. Follow the returned nextPageUrl unchanged.",
            "name": "page",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 4096
            },
            "required": false,
            "name": "since",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "pattern": "^eng_[0-9a-f]{24}$"
            },
            "required": false,
            "name": "engram",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "A page and an opaque polling bookmark.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EventList"
                }
              }
            }
          },
          "400": {
            "description": "Invalid cursor, filter, limit or missing Workspace for a person or a key with multiple assignments.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required; revoked credentials are refused.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "insufficient_balance: add credits before reading billable memory.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Workspace access denied or Connector disabled.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Workspace or engram not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Workspace archived.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited: retry after the Retry-After header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "An internal failure; quote the requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Cognition failed or returned an invalid response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Cognition is unavailable or unconfigured.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/events/{id}": {
      "get": {
        "tags": [
          "Events"
        ],
        "operationId": "getEvent",
        "summary": "Retrieve an event",
        "description": "Read an immutable recorded Engram lifecycle event by its evt_ id. Workspace access is checked on every request. The payload is the recorded lineage record, not the current Engram resource.",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "pattern": "^evt_[0-9a-f]{52}$"
            },
            "required": true,
            "name": "id",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._=-]{0,63}$",
              "description": "One assigned Workspace. Required for keys with multiple assignments; inferred for one."
            },
            "required": false,
            "description": "One assigned Workspace. Required for keys with multiple assignments; inferred for one.",
            "name": "workspace",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "The same Event resource returned in event lists.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Event"
                }
              }
            }
          },
          "400": {
            "description": "Invalid Event id or missing Workspace selection.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required; revoked credentials are refused.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "insufficient_balance: add credits before reading billable memory.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Workspace access denied or Connector disabled.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Workspace or event not found in the selected Workspace.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Workspace archived.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited: retry after the Retry-After header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "An internal failure; quote the requestId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Cognition failed or returned an invalid response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Cognition is unavailable or unconfigured.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/orgs/{id}/keys": {
      "post": {
        "operationId": "createApiKey",
        "tags": [
          "API keys"
        ],
        "security": [
          {
            "PersonToken": []
          }
        ],
        "summary": "Create an API key",
        "description": "Use workspaceIds to assign zero or more active Workspaces in the organization. The issuer must administer every assignment. With no assignments, the key is stateless-only and requires an organization owner/admin to issue. No Connector is required. Legacy Connector keys require the Connector owner or an organization owner/admin. The secret appears once. Direct keys are organization-owned and survive removal of their creator.",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "minLength": 1
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "example": {
                "label": "Hello world",
                "workspaceIds": []
              },
              "schema": {
                "$ref": "#/components/schemas/CreateApiKeyRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Save the secret now; it cannot be retrieved later.",
            "content": {
              "application/json": {
                "example": {
                  "secret": "<copy this one-time secret>",
                  "object": "api_key",
                  "id": "sk-aug-example-public-id",
                  "orgId": "aug-example",
                  "workspaceIds": [],
                  "label": "Hello world",
                  "createdByUserId": "user-example",
                  "createdAt": "2026-10-22T12:00:00Z"
                },
                "schema": {
                  "$ref": "#/components/schemas/CreatedApiKey"
                }
              }
            }
          },
          "400": {
            "description": "invalid_request: invalid fields or destination.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthenticated: sign in first.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "forbidden: this action requires a person with the necessary role; API keys cannot administer resources.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "not_found: the key is unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "conflict: the operation could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited: retry after Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "internal_error: quote requestId when reporting a failure.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "listApiKeys",
        "tags": [
          "API keys"
        ],
        "security": [
          {
            "PersonToken": []
          }
        ],
        "summary": "List API keys",
        "description": "Organization owners/admins can list all keys in their organization, including keys whose creator has left. Other members see only keys they created. No secret or secret hash is returned.",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "minLength": 1
            },
            "required": true,
            "name": "id",
            "in": "path"
          },
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            },
            "required": false,
            "name": "limit",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 4096
            },
            "required": false,
            "name": "page",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Key metadata visible to you.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiKeyList"
                }
              }
            }
          },
          "400": {
            "description": "invalid_request: invalid fields or destination.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthenticated: sign in first.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "forbidden: this action requires a person with the necessary role; API keys cannot administer resources.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "not_found: the key is unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "conflict: the operation could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited: retry after Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "internal_error: quote requestId when reporting a failure.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/orgs/{id}/keys/{keyId}": {
      "delete": {
        "operationId": "revokeApiKey",
        "tags": [
          "API keys"
        ],
        "security": [
          {
            "PersonToken": []
          }
        ],
        "summary": "Revoke an API key",
        "description": "The creator or an organization owner/admin may revoke a key. Future authentication fails; durable work already accepted is retained.",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "minLength": 1
            },
            "required": true,
            "name": "id",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": true,
            "name": "keyId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RevokedApiKey"
                }
              }
            }
          },
          "400": {
            "description": "invalid_request: invalid fields or destination.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthenticated: sign in first.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "forbidden: this action requires a person with the necessary role; API keys cannot administer resources.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "not_found: the key is unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "conflict: the operation could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited: retry after Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "internal_error: quote requestId when reporting a failure.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "getApiKey",
        "tags": [
          "API keys"
        ],
        "security": [
          {
            "PersonToken": []
          }
        ],
        "summary": "Retrieve an API key",
        "description": "Read key metadata as its creator or an organization administrator. The secret and secret hash are never returned.",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "minLength": 1
            },
            "required": true,
            "name": "id",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1
            },
            "required": true,
            "name": "keyId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "API key resource.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiKey"
                }
              }
            }
          },
          "400": {
            "description": "invalid_request: invalid fields or destination.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthenticated: sign in first.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "forbidden: this action requires a person with the necessary role; API keys cannot administer resources.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "not_found: the key is unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "conflict: the operation could not be completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited: retry after Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "internal_error: quote requestId when reporting a failure.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/orgs": {
      "get": {
        "operationId": "listOrganizations",
        "tags": [
          "Organizations"
        ],
        "summary": "List organizations",
        "description": "Organizations the signed-in person can access. Personal organizations remain visible. The active organization is returned separately as activeOrgId.",
        "security": [
          {
            "PersonToken": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            },
            "required": false,
            "name": "limit",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 4096
            },
            "required": false,
            "name": "page",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "One bounded resource page. Follow nextPageUrl unchanged; the authenticated page retains caller, active organization, filters and limit. Access is rechecked on every request. Administration lists use live keyset reads and may change between pages.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationList"
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameters, unavailable resource, changed revision or insufficient human permissions. API keys cannot administer organizations or Workspaces.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid parameters, unavailable resource, changed revision or insufficient human permissions. API keys cannot administer organizations or Workspaces.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Invalid parameters, unavailable resource, changed revision or insufficient human permissions. API keys cannot administer organizations or Workspaces.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Invalid parameters, unavailable resource, changed revision or insufficient human permissions. API keys cannot administer organizations or Workspaces.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Invalid parameters, unavailable resource, changed revision or insufficient human permissions. API keys cannot administer organizations or Workspaces.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Invalid parameters, unavailable resource, changed revision or insufficient human permissions. API keys cannot administer organizations or Workspaces.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Invalid parameters, unavailable resource, changed revision or insufficient human permissions. API keys cannot administer organizations or Workspaces.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Invalid parameters, unavailable resource, changed revision or insufficient human permissions. API keys cannot administer organizations or Workspaces.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/orgs/{id}": {
      "get": {
        "operationId": "getOrganization",
        "tags": [
          "Organizations"
        ],
        "summary": "Retrieve an organization",
        "description": "Select the active organization from the signed-in session. include=members adds its initial membership page. Organization names and organization membership are managed through the identity provider.",
        "security": [
          {
            "PersonToken": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "minLength": 1
            },
            "required": true,
            "name": "id",
            "in": "path"
          },
          {
            "schema": {
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "members"
                ]
              },
              "maxItems": 1
            },
            "required": false,
            "name": "include",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Organization resource, optionally including membership.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Organization"
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameters, unavailable resource, changed revision or insufficient human permissions. API keys cannot administer organizations or Workspaces.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid parameters, unavailable resource, changed revision or insufficient human permissions. API keys cannot administer organizations or Workspaces.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Invalid parameters, unavailable resource, changed revision or insufficient human permissions. API keys cannot administer organizations or Workspaces.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Invalid parameters, unavailable resource, changed revision or insufficient human permissions. API keys cannot administer organizations or Workspaces.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Invalid parameters, unavailable resource, changed revision or insufficient human permissions. API keys cannot administer organizations or Workspaces.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Invalid parameters, unavailable resource, changed revision or insufficient human permissions. API keys cannot administer organizations or Workspaces.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Invalid parameters, unavailable resource, changed revision or insufficient human permissions. API keys cannot administer organizations or Workspaces.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Invalid parameters, unavailable resource, changed revision or insufficient human permissions. API keys cannot administer organizations or Workspaces.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/orgs/{id}/members": {
      "get": {
        "operationId": "listOrganizationMembers",
        "tags": [
          "Organizations"
        ],
        "summary": "List organization members",
        "description": "Read the organization roster, including provisioned people who have not signed in. Local membership is used if the identity provider cannot supply the roster.",
        "security": [
          {
            "PersonToken": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "minLength": 1
            },
            "required": true,
            "name": "id",
            "in": "path"
          },
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            },
            "required": false,
            "name": "limit",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 4096
            },
            "required": false,
            "name": "page",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "One bounded resource page. Follow nextPageUrl unchanged; the authenticated page retains caller, active organization, filters and limit. Access is rechecked on every request. Administration lists use live keyset reads and may change between pages.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MemberList"
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameters, unavailable resource, changed revision or insufficient human permissions. API keys cannot administer organizations or Workspaces.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid parameters, unavailable resource, changed revision or insufficient human permissions. API keys cannot administer organizations or Workspaces.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Invalid parameters, unavailable resource, changed revision or insufficient human permissions. API keys cannot administer organizations or Workspaces.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Invalid parameters, unavailable resource, changed revision or insufficient human permissions. API keys cannot administer organizations or Workspaces.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Invalid parameters, unavailable resource, changed revision or insufficient human permissions. API keys cannot administer organizations or Workspaces.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Invalid parameters, unavailable resource, changed revision or insufficient human permissions. API keys cannot administer organizations or Workspaces.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Invalid parameters, unavailable resource, changed revision or insufficient human permissions. API keys cannot administer organizations or Workspaces.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Invalid parameters, unavailable resource, changed revision or insufficient human permissions. API keys cannot administer organizations or Workspaces.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces": {
      "get": {
        "operationId": "listWorkspaces",
        "tags": [
          "Workspaces"
        ],
        "summary": "List Workspaces",
        "description": "List Workspaces visible to the signed-in person, with their effective role. personal=all also lists colleagues' personal Workspaces when the caller has permission; otherwise the list stays limited to directly assigned personal Workspaces.",
        "security": [
          {
            "PersonToken": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            },
            "required": false,
            "name": "limit",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 4096
            },
            "required": false,
            "name": "page",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "enum": [
                "all"
              ]
            },
            "required": false,
            "name": "personal",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "One bounded resource page. Follow nextPageUrl unchanged; the authenticated page retains caller, active organization, filters and limit. Access is rechecked on every request. Administration lists use live keyset reads and may change between pages.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkspaceList"
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameters, unavailable resource, changed revision or insufficient human permissions. API keys cannot administer organizations or Workspaces.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid parameters, unavailable resource, changed revision or insufficient human permissions. API keys cannot administer organizations or Workspaces.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Invalid parameters, unavailable resource, changed revision or insufficient human permissions. API keys cannot administer organizations or Workspaces.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Invalid parameters, unavailable resource, changed revision or insufficient human permissions. API keys cannot administer organizations or Workspaces.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Invalid parameters, unavailable resource, changed revision or insufficient human permissions. API keys cannot administer organizations or Workspaces.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Invalid parameters, unavailable resource, changed revision or insufficient human permissions. API keys cannot administer organizations or Workspaces.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Invalid parameters, unavailable resource, changed revision or insufficient human permissions. API keys cannot administer organizations or Workspaces.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Invalid parameters, unavailable resource, changed revision or insufficient human permissions. API keys cannot administer organizations or Workspaces.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "createWorkspace",
        "tags": [
          "Workspaces"
        ],
        "summary": "Create a Workspace",
        "description": "Create a shared Workspace and make its creator an administrator. Guests cannot create Workspaces. Personal Default Workspaces are provisioned separately.",
        "security": [
          {
            "PersonToken": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "id": {
                    "type": "string",
                    "pattern": "^[a-z0-9][a-z0-9._-]{0,63}$"
                  }
                },
                "required": [
                  "name"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The created Workspace resource.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Workspace"
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameters, unavailable resource, changed revision or insufficient human permissions. API keys cannot administer organizations or Workspaces.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid parameters, unavailable resource, changed revision or insufficient human permissions. API keys cannot administer organizations or Workspaces.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Invalid parameters, unavailable resource, changed revision or insufficient human permissions. API keys cannot administer organizations or Workspaces.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Invalid parameters, unavailable resource, changed revision or insufficient human permissions. API keys cannot administer organizations or Workspaces.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Invalid parameters, unavailable resource, changed revision or insufficient human permissions. API keys cannot administer organizations or Workspaces.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Invalid parameters, unavailable resource, changed revision or insufficient human permissions. API keys cannot administer organizations or Workspaces.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Invalid parameters, unavailable resource, changed revision or insufficient human permissions. API keys cannot administer organizations or Workspaces.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Invalid parameters, unavailable resource, changed revision or insufficient human permissions. API keys cannot administer organizations or Workspaces.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{id}": {
      "get": {
        "operationId": "getWorkspace",
        "tags": [
          "Workspaces"
        ],
        "summary": "Retrieve a Workspace",
        "description": "Read one authorized Workspace and effective membership. include=members adds its initial membership page.",
        "security": [
          {
            "PersonToken": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "minLength": 1
            },
            "required": true,
            "name": "id",
            "in": "path"
          },
          {
            "schema": {
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "members"
                ]
              },
              "maxItems": 1
            },
            "required": false,
            "name": "include",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Workspace resource.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Workspace"
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameters, unavailable resource, changed revision or insufficient human permissions. API keys cannot administer organizations or Workspaces.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid parameters, unavailable resource, changed revision or insufficient human permissions. API keys cannot administer organizations or Workspaces.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Invalid parameters, unavailable resource, changed revision or insufficient human permissions. API keys cannot administer organizations or Workspaces.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Invalid parameters, unavailable resource, changed revision or insufficient human permissions. API keys cannot administer organizations or Workspaces.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Invalid parameters, unavailable resource, changed revision or insufficient human permissions. API keys cannot administer organizations or Workspaces.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Invalid parameters, unavailable resource, changed revision or insufficient human permissions. API keys cannot administer organizations or Workspaces.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Invalid parameters, unavailable resource, changed revision or insufficient human permissions. API keys cannot administer organizations or Workspaces.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Invalid parameters, unavailable resource, changed revision or insufficient human permissions. API keys cannot administer organizations or Workspaces.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "updateWorkspace",
        "tags": [
          "Workspaces"
        ],
        "summary": "Update a Workspace",
        "description": "An administrator can change its name or synthesis cadence. null restores the platform cadence. Personal Default Workspaces cannot be renamed. Supply If-Match to protect against concurrent edits.",
        "security": [
          {
            "PersonToken": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "minLength": 1
            },
            "required": true,
            "name": "id",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": false,
            "name": "If-Match",
            "in": "header"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "synthesisCadence": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "enum": [
                      "hourly",
                      "daily",
                      "weekly",
                      "monthly",
                      "manual",
                      null
                    ]
                  },
                  "_etag": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated Workspace resource.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Workspace"
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameters, unavailable resource, changed revision or insufficient human permissions. API keys cannot administer organizations or Workspaces.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid parameters, unavailable resource, changed revision or insufficient human permissions. API keys cannot administer organizations or Workspaces.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Invalid parameters, unavailable resource, changed revision or insufficient human permissions. API keys cannot administer organizations or Workspaces.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Invalid parameters, unavailable resource, changed revision or insufficient human permissions. API keys cannot administer organizations or Workspaces.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Invalid parameters, unavailable resource, changed revision or insufficient human permissions. API keys cannot administer organizations or Workspaces.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Invalid parameters, unavailable resource, changed revision or insufficient human permissions. API keys cannot administer organizations or Workspaces.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Invalid parameters, unavailable resource, changed revision or insufficient human permissions. API keys cannot administer organizations or Workspaces.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Invalid parameters, unavailable resource, changed revision or insufficient human permissions. API keys cannot administer organizations or Workspaces.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteWorkspace",
        "summary": "Delete a Workspace's data",
        "description": "Deletes everything an ARCHIVED Workspace holds: its experiences, uploaded documents, extracted claims, engrams, registry items, Connectors and their keys, and memberships. The Workspace's id stays reserved and its access audit is kept. Each call works for a bounded time; repeat it while it answers 202. Requires a person's sign-in with the organization owner or admin role; an API key is refused. Not reversible.",
        "security": [
          {
            "PersonToken": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "example": "ws-research"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Every store reads zero for this Workspace. A repeat answers the same.",
            "content": {
              "application/json": {
                "example": {
                  "workspaceId": "ws-research",
                  "status": "deleted",
                  "pending": [],
                  "counts": {
                    "lake": 5744,
                    "documents": 12,
                    "cog.experience_nodes": 10942,
                    "experience_arrivals": 5744,
                    "workspace_members": 3
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/WorkspaceDeletion"
                }
              }
            }
          },
          "202": {
            "description": "Deleting; call again.",
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before calling again.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "example": {
                  "workspaceId": "ws-research",
                  "status": "deleting",
                  "pending": [
                    "lake"
                  ],
                  "counts": {
                    "lake": 5744,
                    "documents": 12,
                    "cog.experience_nodes": 10942,
                    "experience_arrivals": 5744,
                    "workspace_members": 3
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/WorkspaceDeletion"
                }
              }
            }
          },
          "401": {
            "description": "`unauthenticated`: missing, invalid or revoked credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "`forbidden`: an API key, or a person who is not an organization owner or admin.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`workspace_not_found`: no Workspace with this id in your organization.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`workspace_not_archived`: archive it first (`POST /v1/workspaces/{id}/archive`). `conflict`: a personal Default Workspace, which is deleted with its organization.",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "workspace_not_archived",
                    "message": "archive workspace \"ws-research\" before deleting its data",
                    "retryable": false
                  },
                  "requestId": "req_7f9c2b1e-6d0a-4b7e-9a51-2f0c8e7d4a10"
                },
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "`internal_error`: an unexpected failure; quote the `requestId`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "`service_unavailable` (retryable): the memory service did not answer; what was deleted is kept, so call again. `service_unconfigured`: this environment cannot delete Workspace data. `workos_unavailable` (retryable).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{id}/archive": {
      "post": {
        "operationId": "archiveWorkspace",
        "tags": [
          "Workspaces"
        ],
        "summary": "Archive a Workspace",
        "description": "An administrator can archive a shared Workspace before deleting its data. Personal Default Workspaces cannot be archived. Archived Workspaces refuse new writes.",
        "security": [
          {
            "PersonToken": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "minLength": 1
            },
            "required": true,
            "name": "id",
            "in": "path"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": false,
            "name": "If-Match",
            "in": "header"
          }
        ],
        "responses": {
          "204": {
            "description": "Archived. No response body."
          },
          "400": {
            "description": "Invalid parameters, unavailable resource, changed revision or insufficient human permissions. API keys cannot administer organizations or Workspaces.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid parameters, unavailable resource, changed revision or insufficient human permissions. API keys cannot administer organizations or Workspaces.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Invalid parameters, unavailable resource, changed revision or insufficient human permissions. API keys cannot administer organizations or Workspaces.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Invalid parameters, unavailable resource, changed revision or insufficient human permissions. API keys cannot administer organizations or Workspaces.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Invalid parameters, unavailable resource, changed revision or insufficient human permissions. API keys cannot administer organizations or Workspaces.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Invalid parameters, unavailable resource, changed revision or insufficient human permissions. API keys cannot administer organizations or Workspaces.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Invalid parameters, unavailable resource, changed revision or insufficient human permissions. API keys cannot administer organizations or Workspaces.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Invalid parameters, unavailable resource, changed revision or insufficient human permissions. API keys cannot administer organizations or Workspaces.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{id}/members": {
      "get": {
        "operationId": "listWorkspaceMembers",
        "tags": [
          "Workspaces"
        ],
        "summary": "List Workspace members",
        "description": "Read effective access, including inherited organization administration and direct Workspace memberships. Member id is the userId within this Workspace.",
        "security": [
          {
            "PersonToken": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "minLength": 1
            },
            "required": true,
            "name": "id",
            "in": "path"
          },
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            },
            "required": false,
            "name": "limit",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 4096
            },
            "required": false,
            "name": "page",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "One bounded resource page. Follow nextPageUrl unchanged; the authenticated page retains caller, active organization, filters and limit. Access is rechecked on every request. Administration lists use live keyset reads and may change between pages.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkspaceMemberList"
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameters, unavailable resource, changed revision or insufficient human permissions. API keys cannot administer organizations or Workspaces.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid parameters, unavailable resource, changed revision or insufficient human permissions. API keys cannot administer organizations or Workspaces.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Invalid parameters, unavailable resource, changed revision or insufficient human permissions. API keys cannot administer organizations or Workspaces.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Invalid parameters, unavailable resource, changed revision or insufficient human permissions. API keys cannot administer organizations or Workspaces.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Invalid parameters, unavailable resource, changed revision or insufficient human permissions. API keys cannot administer organizations or Workspaces.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Invalid parameters, unavailable resource, changed revision or insufficient human permissions. API keys cannot administer organizations or Workspaces.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Invalid parameters, unavailable resource, changed revision or insufficient human permissions. API keys cannot administer organizations or Workspaces.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Invalid parameters, unavailable resource, changed revision or insufficient human permissions. API keys cannot administer organizations or Workspaces.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{id}/members/{userId}": {
      "put": {
        "operationId": "setWorkspaceMember",
        "tags": [
          "Workspaces"
        ],
        "summary": "Set Workspace membership",
        "description": "An administrator grants member or admin access to an existing organization member. Organization administrators inherit access and cannot be changed here.",
        "security": [
          {
            "PersonToken": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "minLength": 1
            },
            "required": true,
            "name": "id",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1
            },
            "required": true,
            "name": "userId",
            "in": "path"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "workspaceRole": {
                    "type": "string",
                    "enum": [
                      "member",
                      "admin"
                    ],
                    "default": "member"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Membership set. No response body."
          },
          "400": {
            "description": "Invalid parameters, unavailable resource, changed revision or insufficient human permissions. API keys cannot administer organizations or Workspaces.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid parameters, unavailable resource, changed revision or insufficient human permissions. API keys cannot administer organizations or Workspaces.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Invalid parameters, unavailable resource, changed revision or insufficient human permissions. API keys cannot administer organizations or Workspaces.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Invalid parameters, unavailable resource, changed revision or insufficient human permissions. API keys cannot administer organizations or Workspaces.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Invalid parameters, unavailable resource, changed revision or insufficient human permissions. API keys cannot administer organizations or Workspaces.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Invalid parameters, unavailable resource, changed revision or insufficient human permissions. API keys cannot administer organizations or Workspaces.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Invalid parameters, unavailable resource, changed revision or insufficient human permissions. API keys cannot administer organizations or Workspaces.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Invalid parameters, unavailable resource, changed revision or insufficient human permissions. API keys cannot administer organizations or Workspaces.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "removeWorkspaceMember",
        "tags": [
          "Workspaces"
        ],
        "summary": "Remove Workspace membership",
        "description": "An administrator removes a direct membership. Inherited organization access and the owner of a Default Workspace cannot be removed here.",
        "security": [
          {
            "PersonToken": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "minLength": 1
            },
            "required": true,
            "name": "id",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1
            },
            "required": true,
            "name": "userId",
            "in": "path"
          }
        ],
        "responses": {
          "204": {
            "description": "Direct membership removed. No response body."
          },
          "400": {
            "description": "Invalid parameters, unavailable resource, changed revision or insufficient human permissions. API keys cannot administer organizations or Workspaces.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid parameters, unavailable resource, changed revision or insufficient human permissions. API keys cannot administer organizations or Workspaces.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Invalid parameters, unavailable resource, changed revision or insufficient human permissions. API keys cannot administer organizations or Workspaces.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Invalid parameters, unavailable resource, changed revision or insufficient human permissions. API keys cannot administer organizations or Workspaces.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Invalid parameters, unavailable resource, changed revision or insufficient human permissions. API keys cannot administer organizations or Workspaces.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Invalid parameters, unavailable resource, changed revision or insufficient human permissions. API keys cannot administer organizations or Workspaces.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Invalid parameters, unavailable resource, changed revision or insufficient human permissions. API keys cannot administer organizations or Workspaces.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Invalid parameters, unavailable resource, changed revision or insufficient human permissions. API keys cannot administer organizations or Workspaces.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/experiences/{id}": {
      "get": {
        "operationId": "getExperience",
        "summary": "Get an experience",
        "description": "Where one experience stands: `accepted` → `processed` → `consolidated`, or `failed`.",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "pattern": "^exp_[0-9a-f]{24}$",
              "example": "exp_9b2f6c1e4d7a0b3c5e8f1a2d"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "The experience's status.",
            "content": {
              "application/json": {
                "example": {
                  "id": "exp_9b2f6c1e4d7a0b3c5e8f1a2d",
                  "type": "doc",
                  "workspace": "ws-platform",
                  "status": "processed",
                  "acceptedAt": "2026-10-14T09:30:00.000Z",
                  "processedAt": "2026-10-14T09:30:41.000Z",
                  "experienceId": "handbook-deploys:doc:handbook_deploys.md-1a2b3c4d:p0@9f2c5b7e1d0a4c3b",
                  "claimCount": 3
                },
                "schema": {
                  "$ref": "#/components/schemas/Experience"
                }
              }
            }
          },
          "401": {
            "description": "`unauthenticated`: missing, invalid or revoked credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "`connector_inactive`: the key's Connector is disabled.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`experience_not_found`: no experience with this id that your credential can see.",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "experience_not_found",
                    "message": "no such experience",
                    "retryable": false
                  },
                  "requestId": "req_7f9c2b1e-6d0a-4b7e-9a51-2f0c8e7d4a10"
                },
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited` (retryable): wait the number of seconds in `Retry-After`. `at_capacity` (retryable): the service is temporarily full; wait the same way.",
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "rate limit exceeded",
                    "retryable": true
                  },
                  "requestId": "req_7f9c2b1e-6d0a-4b7e-9a51-2f0c8e7d4a10"
                },
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "`internal_error`: an unexpected failure; quote the `requestId`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "`workos_unavailable` (retryable).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{id}/dead-letters/redrive": {
      "post": {
        "operationId": "redriveDeadLetters",
        "summary": "Re-drive dead letters",
        "description": "Queue a Workspace's dead letters for processing again: experiences whose processing failed terminally or ran out of retries. Filter by failure code and by when they finished. Each starts again with its retries back. Only a Workspace admin may call this, and every call is recorded in the Workspace's access audit. Experiences stopped by an archived Workspace or a disabled Connector are not dead letters and are never re-driven.",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "The Workspace id."
            },
            "required": true,
            "description": "The Workspace id.",
            "name": "id",
            "in": "path"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "example": {
                "codes": [
                  "provider_http_429"
                ],
                "since": "2026-10-16T00:00:00Z"
              },
              "schema": {
                "$ref": "#/components/schemas/DeadLetterRedriveRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "How many were re-queued, and how many more match.",
            "content": {
              "application/json": {
                "example": {
                  "requeued": 12,
                  "remaining": 0
                },
                "schema": {
                  "$ref": "#/components/schemas/DeadLetterRedriveResponse"
                }
              }
            }
          },
          "400": {
            "description": "The filters are malformed.",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "invalid_request",
                    "message": "since must be before until",
                    "retryable": false
                  },
                  "requestId": "req_7f9c2b1e-6d0a-4b7e-9a51-2f0c8e7d4a10"
                },
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No valid credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The caller is not an admin of this Workspace.",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "forbidden",
                    "message": "only an admin of workspace \"ws\" can perform this action",
                    "retryable": false
                  },
                  "requestId": "req_7f9c2b1e-6d0a-4b7e-9a51-2f0c8e7d4a10"
                },
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such Workspace in your organization.",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "workspace_not_found",
                    "message": "unknown workspace \"ws\"",
                    "retryable": false
                  },
                  "requestId": "req_7f9c2b1e-6d0a-4b7e-9a51-2f0c8e7d4a10"
                },
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The Workspace is archived.",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "workspace_archived",
                    "message": "workspace \"ws\" is archived",
                    "retryable": false
                  },
                  "requestId": "req_7f9c2b1e-6d0a-4b7e-9a51-2f0c8e7d4a10"
                },
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "This environment does not process from the queue.",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "service_unconfigured",
                    "message": "dead letters are re-driven into the processing queue, which this environment does not run",
                    "retryable": false
                  },
                  "requestId": "req_7f9c2b1e-6d0a-4b7e-9a51-2f0c8e7d4a10"
                },
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/recall": {
      "post": {
        "operationId": "recall",
        "summary": "Recall",
        "description": "Recall from an authorized Workspace. Searches retained claims, including those not yet in an engram. Returns memory and an answer when mode=answer. Recall records activation unless record=false. A valid empty recall is 200 with noMatch=true. Neither stores the question or answer.",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "enum": [
                "context",
                "answer"
              ],
              "default": "context"
            },
            "required": false,
            "name": "mode",
            "in": "query",
            "description": "`context` (the default) skips the model and returns only the memory, for your own model to read. `answer` runs a model and puts a written answer first."
          },
          {
            "schema": {
              "type": "string",
              "enum": [
                "pool",
                "constraint"
              ]
            },
            "required": false,
            "name": "retrieval",
            "in": "query",
            "description": "Which claims are searched for. Omit this parameter to use the deployment's configured retrieval. `pool` searches every retained claim by meaning and by keyword. `constraint` keeps the claims your question's own phrases, terms, identifiers, times and quantities point to, ordered by how much each narrows, and returns `noMatch` when the question matches none of them."
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            },
            "required": false,
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Required unless record=false. Any string up to 256 characters, such as a new UUID per question. Retries with the same key record one activation, not two. Reusing a key with a different query returns `409 idempotency_conflict`.",
            "example": "3f6c2b1e-6d0a-4b7e-9a51-2f0c8e7d4a10"
          },
          {
            "schema": {
              "type": "string",
              "enum": [
                "content-v3",
                "content-v2"
              ],
              "default": "content-v2"
            },
            "required": false,
            "name": "X-Augenta-Content",
            "in": "header",
            "description": "The response format. Send `content-v3`: `claim` blocks, `claim_count` and `claims_truncated`, as documented below. Without it you get `content-v2`, which is deprecated and calls each claim a `note` (`note` blocks, `note_count`, `notes_truncated`); the default will become `content-v3`. Any other value returns `406 unsupported_content`.",
            "example": "content-v3"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": false,
            "name": "Accept",
            "in": "header",
            "description": "Send `text/event-stream` to receive an answer-mode Workspace recall as server-sent events (see the 200 response). Any other value, including `*/*`, returns JSON. Context mode always returns JSON.",
            "example": "text/event-stream"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "example": {
                "query": "How do we deploy the checkout service?"
              },
              "schema": {
                "$ref": "#/components/schemas/RecallRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The matched memory.  answer mode adds one `answer` block first.",
            "headers": {
              "X-Augenta-Content": {
                "description": "The response format this body uses: the version the request asked for, or `content-v2` when it named none.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Augenta-Model": {
                "description": "Answer mode only: the model that wrote the answer.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Augenta-Renderer": {
                "description": "Answer mode only: the version of the prompt the answer was written from.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "example": {
                  "workspace": "ws-platform",
                  "mode": "answer",
                  "reference_date": "2026-10-02",
                  "claim_count": 14,
                  "claims_truncated": false,
                  "noMatch": false,
                  "content": [
                    {
                      "type": "answer",
                      "text": "Checkout deploys through the Helm chart: merge to main, CI builds the image, and the release workflow rolls it to dev."
                    },
                    {
                      "type": "engram",
                      "text": "Checkout service deploys via the Helm chart from a main merge.",
                      "engram_id": "e042",
                      "memory_class": "procedural",
                      "born_t": "2026-09-14T10:22:31Z",
                      "contradiction": false,
                      "quality_verdict": "unscored"
                    },
                    {
                      "type": "claim",
                      "text": "Merging to main triggers the release workflow, which deploys checkout to dev.",
                      "timestamp": "2026-10-02T16:05:11Z",
                      "question": false,
                      "frame": {},
                      "metadata": {
                        "src": "claude-code"
                      }
                    },
                    {
                      "type": "lineage",
                      "text": "BORN (0->3 members)",
                      "t": "2026-09-14T10:22:31Z",
                      "kind": "born",
                      "members_before": 0,
                      "members_after": 3
                    }
                  ]
                },
                "schema": {
                  "$ref": "#/components/schemas/RecallResponse"
                }
              },
              "text/event-stream": {
                "example": "event: evidence\ndata: {\"workspace\":\"ws-platform\",\"mode\":\"answer\",\"claim_count\":14,\"claims_truncated\":false,\"noMatch\":false,\"content\":[…]}\n\nevent: status\ndata: {\"phase\":\"thinking\"}\n\n: keepalive\n\nevent: status\ndata: {\"phase\":\"answering\"}\n\nevent: delta\ndata: {\"text\":\"Checkout deploys through\"}\n\nevent: delta\ndata: {\"text\":\" the Helm chart.\"}\n\nevent: done\ndata: {\"workspace\":\"ws-platform\",\"mode\":\"answer\",\"content\":[{\"type\":\"answer\",\"text\":\"Checkout deploys through the Helm chart.\"},…]}\n\n",
                "schema": {
                  "type": "string",
                  "description": "Answer mode with `Accept: text/event-stream`. Events, in order: `evidence`: the recall body without the answer, sent as soon as retrieval finishes; `status`: `{\"phase\":\"thinking\"}` when the model starts reasoning, then `{\"phase\":\"answering\"}` at its first text; `delta`: `{\"text\":\"…\"}`, answer text in order; then exactly one of `done` (the same body the JSON response would have, answer block first) or `error` (the error envelope plus `status`, the HTTP status the same failure would have had as a response). A `: keepalive` comment arrives whenever 5 seconds pass with nothing else. Failures before the answer starts (authentication, validation, `idempotency_conflict`, `at_capacity`, an unavailable answerer) are ordinary HTTP errors, not events."
                }
              }
            }
          },
          "400": {
            "description": "`invalid_request`: the request is malformed: a missing `Idempotency-Key`, an empty or over-long `query`, a bad `mode` / `origin` / `budget_tokens` / `timezone`, a body that sends `scope` or `weight`, a body that sends unsupported state/snapshot fields, or (with a user token) a missing `workspace`.",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "invalid_request",
                    "message": "Idempotency-Key is required",
                    "retryable": false
                  },
                  "requestId": "req_7f9c2b1e-6d0a-4b7e-9a51-2f0c8e7d4a10"
                },
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "`unauthenticated`: missing, invalid or revoked credential.",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "unauthenticated",
                    "message": "invalid or revoked Augenta key",
                    "retryable": false
                  },
                  "requestId": "req_7f9c2b1e-6d0a-4b7e-9a51-2f0c8e7d4a10"
                },
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "insufficient_balance: add credits and explicitly retry with the same Idempotency-Key. Streaming errors retain status 402.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "`forbidden`: the credential cannot read this Workspace: the key belongs to a different Workspace, or the Workspace is unavailable. `connector_inactive`: the key's Connector is disabled.",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "connector_inactive",
                    "message": "active Connector required",
                    "retryable": false
                  },
                  "requestId": "req_7f9c2b1e-6d0a-4b7e-9a51-2f0c8e7d4a10"
                },
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "`workspace_not_found`: no Workspace with that id in your organization. An existing empty Workspace returns 200 with noMatch=true.",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "workspace_not_found",
                    "message": "Workspace does not exist",
                    "retryable": false
                  },
                  "requestId": "req_7f9c2b1e-6d0a-4b7e-9a51-2f0c8e7d4a10"
                },
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "406": {
            "description": "`unsupported_content`: `X-Augenta-Content` named a response version that isn't served. Send `content-v3`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`idempotency_conflict`: the `Idempotency-Key` was already used with a different query. `embedder_mismatch`: a server-side configuration problem. `workspace_archived`: the Workspace is archived.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "`unsupported_media_type`: the body was not sent as `application/json`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "`empty_query`: the query had nothing to search on. `evidence_over_budget`: `budget_tokens` is too small to hold even the matched claim.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited` (retryable): wait the number of seconds in `Retry-After`. `at_capacity` (retryable): Recall is at its embedding or answer concurrency limit; wait the same way.",
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "rate limit exceeded",
                    "retryable": true
                  },
                  "requestId": "req_7f9c2b1e-6d0a-4b7e-9a51-2f0c8e7d4a10"
                },
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "`store_misconfigured`: a server configuration problem. Contact support. `internal_error`: an unexpected failure; quote the `requestId`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "`answer_failed` (retryable), `recall_unavailable` (retryable), `cognition_failed` (retryable) or `recall_forward_rejected`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "`engram_vanished` (retryable), `workos_unavailable` (retryable), or `cognition_unavailable` (retryable): a required service is unavailable. `consent_required`: external model consent is missing. `answerer_unavailable`: this deployment cannot write answers; `mode=context` remains available when embedding is configured and consented.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "504": {
            "description": "`recall_timeout` (retryable): no answer within 15 seconds (context) or 60 seconds (answer).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/billing": {
      "get": {
        "tags": [
          "Billing"
        ],
        "security": [
          {
            "PersonToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "Organization billing result. Money uses exact USD decimal strings.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {}
                }
              }
            }
          },
          "400": {
            "description": "invalid_request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Sign in required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Owner/admin required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicting billing operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "service_unavailable: billing provider temporarily unavailable; retry with the same operation key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/billing/transactions": {
      "get": {
        "tags": [
          "Billing"
        ],
        "security": [
          {
            "PersonToken": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "maxLength": 256
            },
            "required": false,
            "name": "cursor",
            "in": "query"
          },
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            },
            "required": false,
            "name": "limit",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Organization billing result. Money uses exact USD decimal strings.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {}
                }
              }
            }
          },
          "400": {
            "description": "invalid_request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Sign in required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Owner/admin required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicting billing operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "service_unavailable: billing provider temporarily unavailable; retry with the same operation key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/billing/usage": {
      "get": {
        "security": [
          {
            "PersonToken": []
          }
        ],
        "tags": [
          "Billing"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "maxLength": 256
            },
            "required": false,
            "name": "cursor",
            "in": "query"
          },
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            },
            "required": false,
            "name": "limit",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Organization billing result. Money uses exact USD decimal strings.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {}
                }
              }
            }
          },
          "401": {
            "description": "Sign in required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Owner/admin required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "service_unavailable: billing provider temporarily unavailable; retry with the same operation key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/billing/purchases": {
      "post": {
        "tags": [
          "Billing"
        ],
        "security": [
          {
            "PersonToken": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            },
            "required": true,
            "name": "Idempotency-Key",
            "in": "header"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "amountCents": {
                    "type": "integer",
                    "minimum": 500,
                    "maximum": 99999500
                  },
                  "saveCard": {
                    "type": "boolean",
                    "default": false
                  }
                },
                "required": [
                  "amountCents"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Organization billing result. Money uses exact USD decimal strings.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {}
                }
              }
            }
          },
          "400": {
            "description": "invalid_request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Sign in required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Owner/admin required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicting billing operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "service_unavailable: billing provider temporarily unavailable; retry with the same operation key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/billing/purchases/{id}": {
      "get": {
        "tags": [
          "Billing"
        ],
        "security": [
          {
            "PersonToken": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Organization billing result. Money uses exact USD decimal strings.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {}
                }
              }
            }
          },
          "400": {
            "description": "invalid_request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Sign in required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Owner/admin required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicting billing operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "service_unavailable: billing provider temporarily unavailable; retry with the same operation key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/billing/payment-methods": {
      "get": {
        "tags": [
          "Billing"
        ],
        "security": [
          {
            "PersonToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "Organization billing result. Money uses exact USD decimal strings.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {}
                }
              }
            }
          },
          "400": {
            "description": "invalid_request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Sign in required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Owner/admin required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicting billing operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "service_unavailable: billing provider temporarily unavailable; retry with the same operation key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/billing/payment-methods/setup": {
      "post": {
        "tags": [
          "Billing"
        ],
        "security": [
          {
            "PersonToken": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            },
            "required": true,
            "name": "Idempotency-Key",
            "in": "header"
          }
        ],
        "responses": {
          "200": {
            "description": "Organization billing result. Money uses exact USD decimal strings.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {}
                }
              }
            }
          },
          "400": {
            "description": "invalid_request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Sign in required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Owner/admin required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicting billing operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "service_unavailable: billing provider temporarily unavailable; retry with the same operation key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/billing/payment-methods/{id}": {
      "delete": {
        "tags": [
          "Billing"
        ],
        "security": [
          {
            "PersonToken": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Organization billing result. Money uses exact USD decimal strings.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {}
                }
              }
            }
          },
          "400": {
            "description": "invalid_request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Sign in required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Owner/admin required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicting billing operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "service_unavailable: billing provider temporarily unavailable; retry with the same operation key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/billing/auto-top-up": {
      "put": {
        "tags": [
          "Billing"
        ],
        "security": [
          {
            "PersonToken": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "enabled": {
                    "type": "boolean"
                  },
                  "thresholdCents": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 99999999
                  },
                  "amountCents": {
                    "type": "integer",
                    "minimum": 500,
                    "maximum": 99999500
                  },
                  "paymentMethodIds": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 100
                    },
                    "maxItems": 3
                  }
                },
                "required": [
                  "enabled"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Organization billing result. Money uses exact USD decimal strings.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {}
                }
              }
            }
          },
          "400": {
            "description": "invalid_request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Sign in required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Owner/admin required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicting billing operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "service_unavailable: billing provider temporarily unavailable; retry with the same operation key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "webhooks": {}
}
