{"openapi":"3.1.0","info":{"title":"Fleepr API","version":"0.129.0","description":"The Fleepr API is the API the Fleepr app itself runs on. Everything the app does, from chats and tables to files, agents and flows, goes through it, so a script, an automation or an outside agent can do the same. AI tools such as Claude, Cursor and n8n can also reach it through Fleepr's MCP server, as the last part of this introduction shows.\n\n## Quickstart\n\n1. **Make an API key.** In Fleepr, the organization's owner or an admin opens Settings, API keys, and makes a key: a name, `read` or `read_write`, and an expiry if you want one. Copy it right away: it is shown once.\n2. **Find your organization's id.** Settings, General shows it as Organization ID, such as `org_01j9z3k8m2q4r6t8v0w2y4a6c8`.\n3. **Make your first call.** List the organization's tables:\n\n   ```bash\n   curl https://api.fleepr.com/v0/orgs/org_01j9z3k8m2q4r6t8v0w2y4a6c8/tables \\\n     -H \"Authorization: Bearer flk_...\"\n   ```\n\n   The answer is a page: the tables in `items`, `nextCursor` for the next page and `totalCount`.\n4. **Write something.** With a `read_write` key, add a record to one of them with `POST /v0/tables/{tableId}/records`, and send an `Idempotency-Key` so a retry never adds it twice.\n\nScripts and tools call `https://api.fleepr.com`. To try a call from this page, paste an API key into **Authentication** and press **Test Request**: it runs against your organization's real data, as the key's member.\n\n## Signing in\n\n- **From a script or a tool.** Send an organization API key as `Authorization: Bearer flk_...`. A key acts as the member who made it, limited by its scope: `read`, or `read_write`. A `read` key that tries to change anything gets 403. Some actions stay with people and answer 403 to every key, such as roles, hand-overs, changes to connections, kill switches, reading or changing AI limits, an Undo, Approve all, adding or removing approvers, deciding a request for access, pausing a chat's agents and health fixes; a few take a signed-in session only, such as your account, API keys and webhooks, and answer 401 to a key. Call the API from a server, never from a web page of your own: a key in a page's code is a published key.\n- **From your browser.** Use an API key: sessions only work on app.fleepr.com. This reference's Test Request, here or at https://fleepr.com/docs, sends the key you paste into **Authentication**; the API answers a browser on fleepr.com only when the request carries a key, and no other site at all.\n- **In the app.** The Fleepr app uses your session: a cookie the API sets when you sign in. This page never does: it takes an API key.\n- **A recent sign-in.** Making an API key, adding a webhook, changing your email and handing an organization over need a sign-in within the last 15 minutes; otherwise they answer 403 `recent_sign_in_required`. Ask for an emailed code with `POST /v0/auth/sign-in-code`, confirm it with `POST /v0/auth/sign-in-code/confirm`, then send the request again.\n\n## Requests and answers\n\n- Every path starts with `/v0`, except `GET /health`. Bodies are JSON: send `Content-Type: application/json` with every write, and `{}` when it takes no body.\n- Ids look like `chat_01j9z3k8m2q4r6t8v0w2y4a6c8`: a prefix for the kind of thing, then a unique code. The server makes every id.\n- Times are UTC, written like `2026-10-11T09:30:00.000Z`. Money is in millionths of a US dollar, in fields that end in `Micros`.\n- Every answer carries `X-Request-Id`, which support can trace, and `Fleepr-Contracts`, the API's version.\n\n## Lists\n\nMost lists take `limit` (1 to 200, 50 by default unless the list says otherwise) and `cursor`, and answer `{ items, nextCursor }`. To read the next page, send `nextCursor` back as `cursor`; it is `null` on the last page. A list that pages another way, such as a chat's messages, says so.\n\n## Changing data safely\n\n- **Idempotency-Key.** Creating something, and every action that must not happen twice, requires an `Idempotency-Key` header: 8 to 128 letters, digits, `-` or `_` (a UUID works). Once a request has succeeded, sending it again with the same key, within 24 hours (7 days for messages, comments, new chats and the choices of a table card), returns the first answer, with `Idempotent-Replayed: true`, and changes nothing (a replayed new API key answers without its secret, which is shown once). A request that failed keeps nothing, so sending it again runs it. A retry after a timeout is always safe.\n- **Revisions.** Most things you can change have a `revision`, a number that grows with every change. An update that takes `expectedRevision` sends the one it read. If someone changed it in between, the answer is 409 `revision_conflict` with the current revision: read it again, then retry.\n\n## Errors\n\nEvery error has the same body: `{ code, message, details, requestId }`. `code` is stable and made for code to read; `message` is plain English, safe to show to a person; `details` adds what the code needs. Quote `requestId` when you report a problem.\n\n| Status | Code | What to do |\n| --- | --- | --- |\n| 400 | `validation_failed` | Fix the request: `details.issues` lists each problem and where it is. |\n| 400 | `invalid_cursor` | Start the list again without `cursor`: the cursor does not belong to this list and these filters. |\n| 401 | `unauthenticated` | Sign in again, or check the API key: wrong, revoked, expired, its member no longer an owner or admin, or an operation that takes a signed-in session only. |\n| 403 | `forbidden` | The caller may see it but not do this; `details.action` names what. |\n| 403 | `recent_sign_in_required` | Sign in again with an emailed code (Signing in above), then retry within `details.withinMinutes`. |\n| 403 | `mention_not_allowed` | Remove the mentions `details.items` lists. |\n| 404 | `not_found` | It does not exist, or the caller may not see it. |\n| 409 | `revision_conflict` | Read it again and retry with `details.currentRevision`. |\n| 409 | `state_conflict` | It is not in a state that allows this; `details.allowed` says what is. |\n| 409 | `duplicate` | Use another value for `details.field`. |\n| 409 | `protected_object` | It is protected and cannot change this way; `details.reason` says why. |\n| 409 | `arguments_mismatch` | The agent's request changed since you read it: read the card again. |\n| 409 | `column_conversion_failed` | Some values would not convert; `details.samples` shows them. |\n| 409 | `idempotency_in_progress` | The same request is still running: wait for `Retry-After`, then send it again. |\n| 410 | `link_invalid` | The approval link was revoked, expired or never existed. |\n| 413 | `payload_too_large` | Send less: `details.maxBytes` is the limit. |\n| 415 | `unsupported_media_type` | Send `Content-Type: application/json`. |\n| 422 | `idempotency_key_reused` | Use a new `Idempotency-Key`: this one went with another request. |\n| 422 | `upload_not_ready` | Wait a few seconds, then send the same request with the same key. |\n| 429 | `rate_limited` | Wait the seconds `Retry-After` gives, then try again. |\n| 429 | `budget_exceeded` | The organization's AI budget for `details.scope` is spent. |\n| 500 | `internal` | Something failed on our side; try again, and quote `requestId` if it persists. |\n| 503 | `unavailable` | Try again later, with the same `Idempotency-Key`. |\n\n## Limits\n\n| What | Limit |\n| --- | --- |\n| Requests per API key | 300 a minute (then 429 `rate_limited`) |\n| Requests with a wrong key, per address | 30 in 10 minutes (then 429 instead of 401 for the rest of that window) |\n| Active API keys | 10 per member and 50 per organization (then 409 `state_conflict`); 20 made an hour per member |\n| A webhook's Send test and Send again | 10 an hour per webhook and 30 an hour per organization |\n| A request's body | 1 MiB |\n| Keys and array elements in a body, every level counted | 4,000; 8,000 for a view, 10,100 for an annotation, 50,000 for record writes, 200,000 for a doc (then 400 `validation_failed`) |\n| Issues listed in a `validation_failed` answer | 50, then one `too_many_issues` that says how many more |\n| Records per bulk call | 500 |\n| Records per table | 50,000 (then 400 `validation_failed`) |\n| A database statement of a request | 30 seconds, waiting for another write included (then 503 `unavailable`) |\n| Decisions per API key | 60 an hour (then 403 `forbidden`, and the key's deciding pauses until a person resumes it) |\n\n## Recipes\n\n- **Start a flow on a schedule.** From an automation tool, on a timer, call `POST /v0/flows/{flowId}/runs` with an `Idempotency-Key` made from the date, such as `weekly-report-2026-10-26`, so a retried trigger starts one run, not two. Follow the run with `GET /v0/flow-runs/{flowRunId}`.\n- **Sync a table every night.** Send up to 500 records at a time to `POST /v0/tables/{tableId}/records/bulk-upsert`, matched on a column such as a post's URL: records that match are updated, the others added, all in one go or not at all.\n- **Approve files with a key.** List what waits for the key's member with `GET /v0/orgs/{orgId}/approvals?decidableByMe=true`, then decide each with `POST /v0/approvals/{approvalId}/decisions`. A key decides only with `read_write` scope and an expiry within 90 days, only the kinds of decision its member ticked on it, while the organization lets outside agents decide, and never work it started itself or an approval that waits for a person in the app.\n\n## Live updates\n\nThe Streams section sends server-sent events: what changes in an organization, a chat or a file, as it happens. An API key opens the organization's and a chat's streams; a file's stream and the review page's take the app's session. A client that reconnects with `Last-Event-ID` gets the events it missed. One that was away too long gets `stream.reset`: it reads what it shows again, then follows the stream.\n\n## Webhooks\n\nWebhooks send the organization's events to an address of yours as they happen, such as a Zapier or Make hook or your own server, so you never poll. The owner or an admin adds one in Settings, Webhooks: a name, a public `https://` address on port 443 and the events to send. Its signing secret, `whsec_` and more, is shown once. The Webhooks section lists every event and its body.\n\n- **What arrives.** A `POST` with a JSON body: the event's id, type and time, who made the change, and the item after it, as the member who added the webhook may see it then.\n- **Answer fast.** Answer with any 2xx within 10 seconds, then do the work. Any other answer, a redirect or no answer fails the attempt, and Fleepr tries again 1 minute, 5 minutes, 30 minutes, 2 hours, 6 hours, 12 hours and 24 hours after the first. A webhook whose deliveries keep failing for 3 days and at least 10 attempts in a row is turned off, and its owner is told.\n- **Handle each event once.** `Fleepr-Event-Id`, the body's `id` (`evt_` and 32 hex characters), is the same on every attempt and every Send again: keep the ids you handled and skip a repeat. It orders nothing, and a retry can arrive after a newer event, so compare `occurredAt` before you overwrite newer data.\n- **Verify the signature.** Every delivery carries `Fleepr-Signature: t=1792575000,v1=5f3c...`: the hex is an HMAC-SHA256, keyed with the webhook's secret, of the timestamp, a period and the body's exact bytes. Compute it over the raw body before you parse it, compare in constant time, and refuse a timestamp more than 5 minutes from your clock, so a delivery captured once cannot be replayed.\n\n```js\nimport { createHmac, timingSafeEqual } from 'node:crypto';\n\n// secret: the webhook's secret. rawBody: the body exactly as it arrived, before any JSON parsing.\nfunction verifyFleeprSignature(secret, header, rawBody) {\n  const parts = Object.fromEntries(String(header ?? '').split(',').map((part) => part.split('=')));\n  const age = Math.abs(Date.now() / 1000 - Number(parts.t));\n  if (!(age <= 300)) return false;\n  const expected = createHmac('sha256', secret).update(parts.t + '.').update(rawBody).digest();\n  const given = Buffer.from(parts.v1 ?? '', 'hex');\n  return given.length === expected.length && timingSafeEqual(given, expected);\n}\n```\n\n```python\nimport hashlib, hmac, time\n\ndef verify_fleepr_signature(secret: str, header: str | None, raw_body: bytes) -> bool:\n    parts = dict(part.split(\"=\", 1) for part in (header or \"\").split(\",\") if \"=\" in part)\n    t = parts.get(\"t\", \"\")\n    if not t.isdigit() or abs(time.time() - int(t)) > 300:\n        return False\n    expected = hmac.new(secret.encode(), t.encode() + b\".\" + raw_body, hashlib.sha256).hexdigest()\n    return hmac.compare_digest(expected, parts.get(\"v1\", \"\"))\n```\n\nSettings, Webhooks lists each webhook's deliveries of the last 30 days, with **Send test**, which sends a `webhook.test`, and **Send again**, which sends an event once more as a new delivery with the same event id.\n\n## Fleepr from Claude and other AI tools (MCP)\n\nFleepr runs a remote [Model Context Protocol](https://modelcontextprotocol.io) server, so Claude, Cursor, n8n and any other MCP client can read and build in a workspace with an API key: ask Claude \"what is still waiting for my approval?\" or \"add a Channel column to Content Calendar, with a choice for each platform we post on\", and it calls Fleepr's tools.\n\n- **Address:** `https://mcp.fleepr.com/mcp`, over Streamable HTTP. It speaks the MCP revision 2026-07-28 and answers clients still on a 2025 revision. It offers tools only, and never opens a stream of its own.\n- **Signing in:** an organization API key in the `Authorization: Bearer flk_...` header of every request, the same keys this API takes. Never put the key in the address: the server refuses a URL that carries one.\n- **What it stores:** nothing. Every tool calls this API with your key, so it can never do more than the key may.\n\n### Connect a client\n\nMake a key in Settings, API keys (the owner and admins only): `read` to only read, `read_write` to let the client write too. Give each client a key of its own, so Logs tell them apart and one can be revoked alone.\n\n**Claude Code**, once, for every folder (`--scope user` keeps the key out of the repository):\n\n```bash\nclaude mcp add --scope user --transport http fleepr https://mcp.fleepr.com/mcp --header \"Authorization: Bearer flk_...\"\n```\n\n**Claude (claude.ai and Claude's apps):** Settings, Connectors, Add custom connector. Name `Fleepr`, URL `https://mcp.fleepr.com/mcp`, no sign-in as its authentication, and one request header, `Authorization`, with the value `Bearer flk_...`. Add it to a personal account: a connector added for a shared Claude organization sends the same key for everyone who turns it on.\n\n**Cursor:** in `~/.cursor/mcp.json`, or a project's `.cursor/mcp.json` kept out of version control:\n\n```json\n{\n  \"mcpServers\": {\n    \"fleepr\": {\n      \"url\": \"https://mcp.fleepr.com/mcp\",\n      \"headers\": { \"Authorization\": \"Bearer flk_...\" }\n    }\n  }\n}\n```\n\n**n8n:** an MCP Client Tool node under an AI Agent node, with the endpoint `https://mcp.fleepr.com/mcp`, the transport HTTP Streamable, and Header Auth as its authentication: a credential whose name is `Authorization` and whose value is `Bearer flk_...`.\n\nAny other client takes the same address and header. Revoking the key in Settings ends the access within a minute.\n\n### Keys and access\n\n- **The member's own access.** A tool acts as the member who made the key, exactly as this API does: it sees only what that member may see and changes only what they may change. A skill, an agent, a table or a flow they cannot see answers \"Not found\", and one they may see but not change answers that they may not; a key's member who is no longer an owner or an admin can no longer use it.\n- **The key's scope.** A `read` key calls the read tools only; every write tool answers \"This API key may only read\" and changes nothing. A write tool needs a `read_write` key.\n- **Never people-only actions.** No tool decides an approval or a card, shares an object with members, invites, makes a public link to a file, or changes roles, hand-overs, connections, kill switches or AI limits. The one tool that deletes is `record_delete`, and only with `confirm` naming the very records it deletes; `approval_link_send` emails clients a review link to files the member may share, and `approval_link_revoke` and `file_public_link_revoke` turn links off. An update may remove what it names inside the thing it changes: a flow's step, a select's option with its cells, a skill's agent.\n- **New things are private.** A doc, a table or an agent a tool creates is private to the member unless asked otherwise; a skill and a flow are seen by every member, as in the app.\n- **Logs.** Every write is the member's, listed in Logs \"with API key\" and the key's name.\n- **Read as data.** The tools read text that people, agents, clients and people outside the organization wrote. Every read tool says it is data, never instructions, and a client should ask its person before acting on what a message or a record seems to tell it.\n\n### Tools\n\nEach tool says whether it reads or writes through MCP's hints: `readOnlyHint` for the read tools; `destructiveHint` for a write that replaces or removes content (an update, a revoke, `record_delete`), so a client asks before it unless its person allowed it; and `idempotentHint` for one that does the same when sent twice. Answers are JSON with the ids the next call needs and a link to open the item in Fleepr; a list shows 25 items by default and at most 100, with `nextCursor` for the next page, and an answer is cut at 64 KiB with a note that says how to read the rest.\n\nRead tools, any key:\n\n| Tool | What it does | What it calls |\n| --- | --- | --- |\n| `workspace_get` | The organization, the member the key acts as, and what the key may do. | `GET /v0/orgs/{orgId}` |\n| `search` | Chats, tables, files and docs, flows, agents and skills, by name. | `GET /v0/orgs/{orgId}/objects` |\n| `waiting_list` | What waits for the member: approvals, sign-offs, agents' cards and questions. | `GET /v0/orgs/{orgId}/waiting`, `GET /v0/orgs/{orgId}/approvals`, `GET /v0/orgs/{orgId}/requests` |\n| `approval_list` | File and doc approvals and sign-offs by status, with who approved. | `GET /v0/orgs/{orgId}/approvals` |\n| `approval_get` | One approval or sign-off, with who approved and who still has to. | `GET /v0/approvals/{approvalId}` |\n| `chat_list` | Recent chats with their last message. | `GET /v0/orgs/{orgId}/chats` |\n| `chat_read` | A chat's messages with their authors, newest first. | `GET /v0/chats/{chatId}`, `GET /v0/chats/{chatId}/messages`, `GET /v0/orgs/{orgId}/directory` |\n| `agent_list` | The agents, to know whom to ask. | `GET /v0/orgs/{orgId}/agents` |\n| `turn_get` | Whether an agent's turn has finished, and its reply. | `GET /v0/turns/{turnId}`, `GET /v0/messages/{messageId}` |\n| `table_list` | Tables by name. | `GET /v0/orgs/{orgId}/tables` |\n| `table_get` | A table's columns, with a select's options, and its forms. | `GET /v0/tables/{tableId}`, `GET /v0/tables/{tableId}/views` |\n| `record_list` | A table's records, cells by column name, with a search, filters and a sort. | `GET /v0/tables/{tableId}`, `GET /v0/tables/{tableId}/records` |\n| `record_search` | Records across tables. | `GET /v0/orgs/{orgId}/record-search` |\n| `record_get` | One record, cells by column name. | `GET /v0/records/{recordId}`, `GET /v0/tables/{tableId}` |\n| `file_list` | Files and docs by name, kind, or what needs the member. | `GET /v0/orgs/{orgId}/files` |\n| `file_get` | A file's details, versions and approval; a doc's text as Markdown. | `GET /v0/files/{fileId}`, `GET /v0/files/{fileId}/doc` |\n| `form_list` | A table's forms and their links. | `GET /v0/tables/{tableId}/views`, `GET /v0/views/{viewId}/links` |\n| `flow_list` | Flows, how each starts, and its last run. | `GET /v0/orgs/{orgId}/flows` |\n| `flow_get` | A flow's start, its steps and its five latest runs. | `GET /v0/flows/{flowId}`, `GET /v0/flows/{flowId}/runs` |\n| `run_get` | A flow run and where each step stands. | `GET /v0/flow-runs/{flowRunId}` |\n| `approval_link_list` | The client approval links the member manages, never a link's address. | `GET /v0/orgs/{orgId}/approval-links` |\n| `form_link_list` | A form's links: who each is for, whether it works, its responses. | `GET /v0/views/{viewId}/links` |\n| `doc_search` | Passages of docs by their words, with their page and heading. | `GET /v0/orgs/{orgId}/doc-search` |\n| `chat_search` | Messages of chats by their words, newest first. | `GET /v0/orgs/{orgId}/message-search`, `GET /v0/orgs/{orgId}/directory` |\n| `chat_list_members` | Who a chat is shared with, and at what level. | `GET /v0/objects/{objectId}/access`, `GET /v0/orgs/{orgId}/directory` |\n| `log_list` | The organization's Logs, newest first, by author, kind, result or words. | `GET /v0/orgs/{orgId}/logs`, `GET /v0/orgs/{orgId}/directory` |\n| `log_get` | One Logs entry with what it changed. | `GET /v0/orgs/{orgId}/logs/{eventId}`, `GET /v0/orgs/{orgId}/directory` |\n| `memory_search` | What the organization taught Fleepr, by words or by subject. | `GET /v0/orgs/{orgId}/memories` |\n\nWrite tools, a `read_write` key:\n\n| Tool | What it does | What it calls |\n| --- | --- | --- |\n| `message_post` | Posts a message in a chat, optionally mentioning agents. | `POST /v0/chats/{chatId}/messages` |\n| `agent_ask` | Asks an agent, in a new private chat unless one is named, and waits up to 40 seconds for its reply. | `POST /v0/orgs/{orgId}/chats`, `POST /v0/chats/{chatId}/messages`, `GET /v0/turns/{turnId}`, `GET /v0/messages/{messageId}` |\n| `table_create` | Creates a table with its columns. | `POST /v0/orgs/{orgId}/tables` |\n| `record_create` | Adds a record, cells by column name, an option by its label. | `GET /v0/tables/{tableId}`, `POST /v0/tables/{tableId}/records` |\n| `record_update` | Changes a record's cells. | `GET /v0/records/{recordId}`, `GET /v0/tables/{tableId}`, `PATCH /v0/records/{recordId}` |\n| `doc_create` | Creates a doc, optionally with its text from Markdown. | `POST /v0/orgs/{orgId}/docs`, `GET /v0/files/{fileId}/doc`, `POST /v0/files/{fileId}/doc/edit`, `PUT /v0/files/{fileId}/doc`, `DELETE /v0/files/{fileId}/doc/edit/{leaseId}` |\n| `doc_write` | Adds to a doc, or replaces its text, as a new version. | `GET /v0/files/{fileId}/doc`, `POST /v0/files/{fileId}/doc/edit`, `PUT /v0/files/{fileId}/doc`, `DELETE /v0/files/{fileId}/doc/edit/{leaseId}` |\n| `flow_run_start` | Starts a run of a flow. | `POST /v0/flows/{flowId}/runs` |\n| `comment_post` | Comments on a file's current version. | `GET /v0/files/{fileId}`, `POST /v0/files/{fileId}/comments` |\n| `skill_create` | Creates a skill, the instructions agents load, optionally assigned to agents. | `POST /v0/orgs/{orgId}/skills` |\n| `skill_update` | Changes a skill's name, description or instructions, as a new version, and adds or removes its agents. | `GET /v0/skills/{skillId}`, `PATCH /v0/skills/{skillId}` |\n| `agent_create` | Creates an agent with its instructions, model and skills. | `POST /v0/orgs/{orgId}/agents` |\n| `agent_update` | Changes an agent's name, title, instructions, model or visibility, and adds or removes its skills. | `GET /v0/agents/{agentId}`, `PATCH /v0/agents/{agentId}` |\n| `column_create` | Adds a column of any type but the system ones to a table. | `POST /v0/tables/{tableId}/columns` |\n| `column_update` | Renames a column or changes its settings: a select's options, a number's format; never its type. | `GET /v0/tables/{tableId}`, `PATCH /v0/columns/{columnId}` |\n| `flow_create` | Creates a flow, paused unless asked, with its start and its steps. | `POST /v0/orgs/{orgId}/flows` |\n| `flow_update` | Changes a flow's name, start, state and steps: add, edit, remove or move a step, as a new version. | `GET /v0/flows/{flowId}`, `PUT /v0/flows/{flowId}` |\n| `form_create` | Creates a form on a table with its title, intro and questions, each with its settings. | `GET /v0/tables/{tableId}`, `POST /v0/tables/{tableId}/views` |\n| `form_update` | Changes a form's name, title, intro or questions; its links and records stay. | `GET /v0/views/{viewId}`, `GET /v0/tables/{tableId}`, `PATCH /v0/views/{viewId}` |\n| `approval_request` | Asks members to approve files, up to 10 in one call, each with its approvers. | `POST /v0/files/{fileId}/approval` |\n| `approval_link_send` | Emails clients outside the organization links to review and approve files: one email per client. | `POST /v0/orgs/{orgId}/approval-links` |\n| `approval_link_revoke` | Revokes a client approval link for good. | `POST /v0/approval-links/{linkId}/revoke` |\n| `file_rename` | Renames a file or a doc, keeping its extension. | `GET /v0/files/{fileId}`, `PATCH /v0/files/{fileId}` |\n| `file_public_link_revoke` | Turns off a public link to a file. | `POST /v0/public-file-links/{linkId}/revoke` |\n| `form_link_create` | Makes a form's public link, or personal links with values filled in: one email per person for several. | `POST /v0/views/{viewId}/links`, `POST /v0/views/{viewId}/links/bulk-create` |\n| `form_link_revoke` | Revokes one link of a form for good. | `GET /v0/views/{viewId}/links`, `POST /v0/form-links/{linkId}/revoke` |\n| `record_delete` | Deletes up to 10 records, only with `confirm` naming the same record ids. | `POST /v0/tables/{tableId}/records/bulk-delete` |\n\n### Limits and errors\n\n- One tool call takes at most 30 seconds, and a key runs at most 4 calls at once. `agent_ask` waits 40 seconds for the reply, then answers the turn's id: read the reply with `turn_get`, never ask again, which would start a second turn.\n- A request body is at most 1 MiB and one JSON-RPC message, never a batch. A request carrying an `Origin` header, from a web page, answers 403.\n- A request without a working key answers 401; an address that sends 30 of them in 10 minutes gets 429 for the rest of that window.\n- This API's own limits apply on top: 300 requests a minute per key, and the organization's AI limits for agents and flows.\n- A refused call answers in plain words, with this API's request id when it came from here, such as \"Not found, or this key's member may not see it (request req_...)\". Quote the request id when you report a problem."},"servers":[{"url":"https://api.fleepr.com"}],"tags":[{"name":"sign-in","x-displayName":"Sign-in and sessions","description":"Signing up and in with an email and password or with Google, signing out here or everywhere, resetting a password, and the emailed code that confirms a recent sign-in before a sensitive action. These are the app's own steps: they work with the browser's session cookie, and only signing out and the sign-in code need a sign-in."},{"name":"account","x-displayName":"Your account","description":"The signed-in person: their profile, the organizations they belong to and changing their sign-in email. A signed-in session only, except the link that confirms an email change: an API key acts in one organization, as its member."},{"name":"identity","x-displayName":"Organizations and members","description":"Creating an organization, and the people in it: its settings and logo, its directory of members and agents, roles, invites, removing and restoring a member, and handing the organization over to a new owner."},{"name":"api-keys","x-displayName":"API keys","description":"The keys scripts and tools use instead of a session. The owner and admins make and revoke them in Settings, API keys; a key is shown once, acts as the member who made it and is limited by its scope, and may be allowed to decide some approvals and cards, a deciding that pauses when it decides too much until a person resumes it. These operations take a signed-in session, never a key, except getting the calling key, which only a key calls."},{"name":"access","x-displayName":"Sharing and access","description":"Who can see and edit each thing in an organization: its visibility, the people and agents it is shared with and at what level, sharing by email, requests to get access (\"Ask to edit\") and handing a thing over to a new owner."},{"name":"objects","x-displayName":"Objects","description":"One way to find anything in an organization, whatever its kind: chats, databases, tables, files, flows, agents, skills and connections. Look one up by its id, or list and search what you may see."},{"name":"about","x-displayName":"What things are about","description":"Link a chat, a file or a flow to the records it is about, in any of your tables (\"About: Acme · Clients\"). A file first posted in a linked chat by someone who can edit it takes the chat's links, as does a file an agent creates there, and a run takes its flow's. People see only the links to records of tables they can view."},{"name":"chats","x-displayName":"Chats","description":"Group chats where people and agents work together. List and open chats, post messages with text, files and voice notes, and mention agents to start their replies, which can carry table cards and questions to answer. Each reply is a turn you can follow, open in detail and cancel. Also pins, exporting a chat, what a chat knows, and pausing a chat's agents."},{"name":"requests","x-displayName":"Agent requests","description":"The cards an agent posts when it needs a person to approve an action before it runs, such as a change in an outside service. Read a card, then approve it, decline it or take a decline back. The choices in a table card are answered in Chats."},{"name":"tables","x-displayName":"Tables","description":"Tables of records, with typed columns: text, numbers, dates, choices, people, files, links to other tables and more. Create and change tables and columns, a column's type included, read records with filters and sorts, search records across tables, write records one at a time or up to 500 at once, and export a view as CSV."},{"name":"views","x-displayName":"Forms","description":"A table's forms: saved views whose questions are columns of the table, each response one record. Build a form, choose its questions, prefill them, and publish it through a public link or personal links made for one person each, with values prefilled for them. Responses from people with a link need no account."},{"name":"media","x-displayName":"Files and media","description":"The organization's files and docs: uploading files, writing docs, their versions, download links, comments and annotations on a version, storage used, and approvals, from the people asked to approve a file or from a guest through an approval link, which you make, list and revoke here."},{"name":"review","x-displayName":"Guest review","description":"The public review page a guest opens from an approval link, without a Fleepr account. The link opens a review session; the recipient confirms their email with a code, unless the link needs none, then reads the files, comments and approves or asks for changes."},{"name":"formPage","x-displayName":"Form page","description":"The public page of a form, which people outside the organization open from a form link without an account, and members open inside Fleepr. Opening it gives a session for one response; the page uploads files to the form's file questions straight to storage, then sends the response, which adds one record to the form's table."},{"name":"agents","x-displayName":"Agents","description":"The organization's AI agents and what shapes them: their instructions, models and tools, the teams they work in and the skills they read, with each skill's versions. Export an agent as a template and import one, list the models, see what an agent knows and has learned, and pause one. Also the organization's AI limits (budgets, quotas, allowed models), what the agents have spent, and the switches that pause every agent at once."},{"name":"connectors","x-displayName":"Connectors","description":"Connections to outside services that agents use as tools, such as Google Drive, Meta Ads and MCP servers, with the tools each connection offers and the rules for using them: connect, sign in, test and resume a connection. Also outgoing webhooks, which send the organization's events to an address you choose."},{"name":"flows","x-displayName":"Flows","description":"Flows run a series of steps, done by agents and signed off by people. A flow starts by hand, on a schedule, when something happens (a new file or version, a record added or changed, an approval decided or completed), or once for each record of a table when its date comes due. Save flows and read their versions, list the events a flow can start on, turn flows on and off, start runs, follow each run step by step and cancel it."},{"name":"activity","x-displayName":"Logs and notifications","description":"What happened in an organization and what needs you: the organization's log of changes, with who made each, its CSV export, your notifications and what waits for your decision, and your personal preferences."},{"name":"health","x-displayName":"Health","description":"Problems Fleepr finds in an organization's data and automations each night, such as a field nobody fills in, two tables that hold the same things or a flow that keeps failing, with a score per area and its trend. Read the issues, mark them fixed, dismiss or reopen them, ask Fleepr for a fix and apply or withdraw it, set targets, and edit what Fleepr knows about each table."},{"name":"memory","x-displayName":"Memory","description":"What an organization taught Fleepr, one sentence at a time, about the whole organization, a record of any table, a table or an agent (\"Acme never wants yellow\"). Agents read the confirmed memories before they work; people add memories, confirm or reject suggestions, change what one is about, read and restore its versions, and archive, restore or forget them."},{"name":"system","x-displayName":"System","description":"Whether the service is up, for monitors and load balancers. It needs no sign-in."},{"name":"streams","x-displayName":"Streams","description":"Live updates as server-sent events: the changes in an organization, in an open chat or file, and on a public review page, as they happen. A client that reconnects gets the events it missed."}],"x-tagGroups":[{"name":"Account and organization","tags":["sign-in","account","identity","api-keys","access"]},{"name":"Workspace","tags":["objects","about","chats","requests","tables","views","media","review","formPage"]},{"name":"AI and automation","tags":["agents","connectors","flows"]},{"name":"Activity and live updates","tags":["activity","health","memory","system","streams"]}],"security":[{"session":[]}],"paths":{"/v0/auth/sign-up":{"post":{"operationId":"identity.signUp","tags":["sign-in"],"summary":"Create an account","description":"Starts an account with an email address only. A verification email follows, whose link opens a page where the person chooses their name and password (`POST /v0/auth/verify-email`). Answers `202 verification_sent` whether or not the address already has an account, so it never reveals accounts. At most one email a minute and three an hour go to one address; beyond that the answer is the same and nothing is sent. Public: no sign-in needed.","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignUpBody"}}}},"responses":{"202":{"description":"Accepted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignUpResult"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/auth/verify-email":{"post":{"operationId":"identity.verifyEmail","tags":["sign-in"],"summary":"Verify an email","description":"Finishes signing up. Confirms the email address with the token from the verification email and sets the person's name and password, then signs them in: the answer sets the session cookie. A link that belongs to another address than `email` answers `410 link_invalid` and sets nothing. If the address was verified but the password could not be set, nobody is signed in and the answer is `409 state_conflict`; the person then sets a password with \"Forgot password\". Public: no sign-in needed.","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerifyEmailBody"}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Me"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"state_conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"410":{"description":"link_invalid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/auth/sign-in":{"post":{"operationId":"identity.signIn","tags":["sign-in"],"summary":"Sign in","description":"Signs in with an email address and password and answers the signed-in user with their memberships and preferences; the answer sets the session cookie. Wrong credentials answer `401 unauthenticated`. Attempts are rate-limited per client address and per email (`429 rate_limited`). Public: no sign-in needed.","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignInBody"}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Me"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/auth/google/start":{"post":{"operationId":"identity.startGoogleSignIn","tags":["sign-in"],"summary":"Start an OAuth sign-in","description":"Starts signing in with Google. Answers the Google authorization URL for the browser to navigate to, and sets a short-lived cookie so that only this browser can finish the sign-in. `redirectTo` is the in-app path, starting with a single `/`, where the web app lands once the person is signed in. Public: no sign-in needed.","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartGoogleSignInBody"}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartGoogleSignInResult"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/auth/google/callback":{"get":{"operationId":"identity.googleCallback","tags":["sign-in"],"summary":"Complete an OAuth sign-in","description":"Where Google sends the browser back after the person signs in: browsers reach it by redirect, not by a direct call. It finishes the sign-in started with `POST /v0/auth/google/start`, sets the session cookie and redirects (`302`) to the web app at the path given then; any failure redirects to the web app's sign-in page with an error instead. Only the browser that started the sign-in can finish it. Public: no sign-in needed.","security":[],"parameters":[{"name":"code","in":"query","required":false,"description":"The authorization code Google sends back after a successful sign-in.","schema":{"type":"string","maxLength":2048}},{"name":"state","in":"query","required":false,"description":"The sign-in's own state, which the start put in this address and the provider sends back unchanged: the callback runs only when it matches the one the browser that started the sign-in holds.","schema":{"type":"string","maxLength":2048}},{"name":"error","in":"query","required":false,"description":"The error Google reports when the sign-in failed.","schema":{"type":"string","maxLength":256}},{"name":"error_code","in":"query","required":false,"description":"A code for the error, when one is reported.","schema":{"type":"string","maxLength":256}},{"name":"error_description","in":"query","required":false,"description":"A description of the error, when one is reported.","schema":{"type":"string","maxLength":2048}}],"responses":{"302":{"description":"A redirect to the address in Location.","headers":{"Location":{"required":true,"schema":{"type":"string"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/auth/sign-out":{"post":{"operationId":"identity.signOut","tags":["sign-in"],"summary":"Sign out","description":"Clears the session cookie, always, then ends this session at the identity provider when it can: an outage of the provider never leaves the cookie behind. Answers `204` whether or not a session was signed in. The user's other sessions stay signed in; `POST /v0/auth/sessions/revoke` ends them all. Session only: an API key cannot call it.","security":[{"session":[]}],"responses":{"204":{"description":"Done. The answer has no body."},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/auth/sessions/revoke":{"post":{"operationId":"identity.revokeSessions","tags":["sign-in"],"summary":"Revoke all sessions","description":"Ends every session of the signed-in user, this one included, for example after a lost device. This session's cookie is cleared, and every other session is refused from its next request on. With `revokeApiKeys`, every API key the user made is revoked too, in every organization; with `pauseWebhooks`, every webhook the user added or pointed at a new address is turned off. Session only: an API key cannot call it.","security":[{"session":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RevokeSessionsBody"}}}},"responses":{"204":{"description":"Done. The answer has no body."},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/auth/sign-in-code":{"post":{"operationId":"identity.sendSignInCode","tags":["sign-in"],"summary":"Email a sign-in code","description":"Emails the signed-in user a 6-digit code to their account's address. It works once for 10 minutes, and a new code replaces the previous one. Confirmed with `POST /v0/auth/sign-in-code/confirm`, it makes this session a recent sign-in, which creating an API key, adding a webhook, changing the email and transferring ownership need (`recent_sign_in_required`). Session only.","security":[{"session":[]}],"responses":{"202":{"description":"Accepted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendSignInCodeResult"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/auth/sign-in-code/confirm":{"post":{"operationId":"identity.confirmSignInCode","tags":["sign-in"],"summary":"Confirm a sign-in code","description":"Confirms the code `POST /v0/auth/sign-in-code` sent: this session counts as a recent sign-in for 15 minutes. A wrong, expired or spent code (5 wrong tries) answers `validation_failed` at `body.code`, whose issue code says which. Session only.","security":[{"session":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConfirmSignInCodeBody"}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConfirmSignInCodeResult"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/auth/password-reset":{"post":{"operationId":"identity.requestPasswordReset","tags":["sign-in"],"summary":"Request a password reset","description":"Emails a password reset link to the address. Answers `202` with no body whether or not the address has an account, so it never reveals accounts. At most one email a minute and three an hour go to one address; beyond that the answer is the same and nothing is sent. Public: no sign-in needed.","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestPasswordResetBody"}}}},"responses":{"202":{"description":"Done. The answer has no body."},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/auth/password-reset/confirm":{"post":{"operationId":"identity.confirmPasswordReset","tags":["sign-in"],"summary":"Reset a password","description":"Sets a new password with the token from the password reset email. The password needs 8 to 72 bytes, with a lowercase letter, an uppercase letter, a digit and an ASCII symbol. It ends every session of the account and signs nobody in: the person then signs in with the new password. With `revokeApiKeys`, every API key the account made is revoked too, in every organization; with `pauseWebhooks`, every webhook it added or pointed at a new address is turned off. A used, expired or unknown link answers `410 link_invalid`. Public: no sign-in needed.","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConfirmPasswordResetBody"}}}},"responses":{"204":{"description":"Done. The answer has no body."},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"410":{"description":"link_invalid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/me":{"get":{"operationId":"identity.getMe","tags":["account"],"summary":"Get the signed-in user","description":"Answers the signed-in user with their active memberships, one per organization, their preferences and the organization they opened last. The web app loads it first to build its shell. Session only: an API key cannot call it.","security":[{"session":[]}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Me"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"patch":{"operationId":"identity.updateMe","tags":["account"],"summary":"Update the signed-in user","description":"Changes the signed-in user's name or profile photo, or the organization the app opens first. Send only the fields that change; `avatarUploadId: null` removes the photo. A new photo is a completed upload with purpose `avatar` (`POST /v0/orgs/{orgId}/uploads`); one still uploading answers `422 upload_not_ready`. The name and photo show in every organization where the user is an active member. Session only: an API key cannot call it.","security":[{"session":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateMeBody"}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Me"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"422":{"description":"upload_not_ready","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/me/email-change":{"post":{"operationId":"identity.requestEmailChange","tags":["account"],"summary":"Start an email change","description":"Starts changing the signed-in user's sign-in address. A confirmation link goes to the new address and another to the current one; nothing changes until both are used (`POST /v0/auth/email-change/confirm`). Answers `202` with the pending address. An address another account uses answers `409 duplicate`. At most 5 requests an hour per user. Session only: an API key cannot call it.","security":[{"session":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestEmailChangeBody"}}}},"responses":{"202":{"description":"Accepted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestEmailChangeResult"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden, recent_sign_in_required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"duplicate","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/auth/email-change/confirm":{"post":{"operationId":"identity.confirmEmailChange","tags":["account"],"summary":"Confirm an email change","description":"Uses one of the two links of an email change, with the token from its email. The first link used answers `awaiting_other_link`; the second answers `changed` with the new sign-in address, and the old address gets a security notice. It signs nobody in and ends no session. A used, expired, replaced or unknown link answers `410 link_invalid`. Public, so a link opened on another device works.","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConfirmEmailChangeBody"}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConfirmEmailChangeResult"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"410":{"description":"link_invalid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/orgs":{"post":{"operationId":"identity.createOrganization","tags":["identity"],"summary":"Create an organization","description":"Creates an organization with a name, a time zone and an optional about text, and answers it as its owner sees it. The caller becomes its owner, and it starts with its system actor. Requires an `Idempotency-Key`. A user creates at most 10 organizations a day. While organizations are created by invitation only (during the pilot), a user who is not one of the people who create them gets `403 forbidden` (`Me.mayCreateOrganization` is `false` for them). Session only: an API key cannot call it.","security":[{"session":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"A key you choose for this request, such as a UUID. Once the request has succeeded, sending it again with the same key gets the first answer back, with nothing done twice.","schema":{"$ref":"#/components/schemas/IdempotencyKey"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateOrganizationBody"}}}},"responses":{"201":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganizationDetail"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"idempotency_in_progress","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"422":{"description":"idempotency_key_reused","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/orgs/{orgId}":{"get":{"operationId":"identity.getOrganization","tags":["identity"],"summary":"Get an organization","description":"Answers the organization with its plan and settings, counts of what the caller may see, and the caller's role, member id and allowed actions (`myActions`). Use `myActions` to decide which controls to show. Any active member may call it; anyone else gets `404 not_found`.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read","parameters":[{"name":"orgId","in":"path","required":true,"description":"The organization's id.","schema":{"$ref":"#/components/schemas/OrganizationId"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganizationDetail"},"example":{"id":"org_01jb2m7q9x4t6v8w0y2z4c6e8g","name":"Harbor & Pine Studio","about":"Brand, content and paid social for food and drink brands.","timeZone":"Europe/Madrid","ownerId":"mbr_01jb2m8b4d6f8h0k2m4n6q8s0t","plan":{"id":"pilot"},"settings":{"logRetentionDays":90,"outsideAgentsMayDecide":null,"shareHealthMetrics":null,"memorySuggestionMessages":3,"publicFileLinks":null},"effectiveSettings":{"logRetentionDays":90,"outsideAgentsMayDecide":true,"shareHealthMetrics":true,"memorySuggestionMessages":3,"publicFileLinks":true},"logRetentionGraceEndsAt":null,"agentsPaused":false,"agentsPausedBy":null,"agentsPausedAt":null,"createdAt":"2026-09-14T08:12:30.000Z","updatedAt":"2026-10-20T16:45:10.000Z","revision":7,"stats":{"activeMembers":12,"invitedMembers":2,"agents":5,"teams":3,"visibleChats":41,"visibleFiles":318},"myRole":"admin","myMemberId":"mbr_01jb2m8a3c5e7g9j1k3m5p7r9s","myActions":["edit_organization","invite_member","manage_members","create_chat","create_table","create_agent","create_skill","create_team","create_flow","manage_connections","view_logs","manage_ai_limits","view_usage","request_access","upload_file","create_api_key","manage_api_keys","manage_webhooks","manage_health","add_memory","create_target"]}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"patch":{"operationId":"identity.updateOrganization","tags":["identity"],"summary":"Update an organization","description":"Renames the organization or changes its about text, time zone, logos or settings, such as log retention and whether outside agents may decide. Send only the fields that change, with `expectedRevision`; a setting set to `null` returns to the plan's default. A new logo is a finished upload with purpose `organization_logo` (`POST /v0/orgs/{orgId}/uploads`), and `null` removes it; one still uploading answers `422 upload_not_ready`. Only the owner and admins. An API key cannot change the log retention or the outside-agents setting (`403 forbidden`). A stale revision answers `409 revision_conflict`.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read_write","parameters":[{"name":"orgId","in":"path","required":true,"description":"The organization's id.","schema":{"$ref":"#/components/schemas/OrganizationId"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateOrganizationBody"}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Organization"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"revision_conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"422":{"description":"upload_not_ready","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/logos/{token}":{"get":{"operationId":"identity.getOrganizationLogo","tags":["identity"],"summary":"Get an organization's logo","description":"Redirects (`302`) to the image of an organization's square or horizontal logo, the links an organization's `squareLogoUrl` and `horizontalLogoUrl` hold. Public, so an email can show it: no sign-in needed. A replaced or removed logo answers `404 not_found`, and past 300 such tokens from one address in 10 minutes every request answers `429 rate_limited`.","security":[],"parameters":[{"name":"token","in":"path","required":true,"description":"The logo's token, the last part of its link.","schema":{"$ref":"#/components/schemas/LogoToken"}}],"responses":{"302":{"description":"A redirect to the address in Location.","headers":{"Location":{"required":true,"schema":{"type":"string"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/orgs/{orgId}/ownership-transfer":{"post":{"operationId":"identity.transferOwnership","tags":["identity"],"summary":"Transfer organization ownership","description":"Makes another member the owner of the organization; the former owner becomes an admin and keeps their API keys. Only the owner, signed in: no API key may call it. The new owner must be an active member who is not a viewer; naming anyone else answers `409 state_conflict`. Send the organization's `expectedRevision`.","security":[{"session":[]}],"x-api-key-scope":"none","parameters":[{"name":"orgId","in":"path","required":true,"description":"The organization's id.","schema":{"$ref":"#/components/schemas/OrganizationId"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransferOwnershipBody"}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganizationDetail"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden, recent_sign_in_required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"revision_conflict, state_conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/orgs/{orgId}/directory":{"get":{"operationId":"identity.getDirectory","tags":["identity"],"summary":"Get the directory","description":"Answers every actor of the organization once: its members, agents and system actor, each with name, title, photo, status and, for members, role. Clients cache it to show names and photos everywhere, and patch it with the `actor.updated` events of the organization stream. Any active member may call it.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read","parameters":[{"name":"orgId","in":"path","required":true,"description":"The organization's id.","schema":{"$ref":"#/components/schemas/OrganizationId"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Directory"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/orgs/{orgId}/members":{"get":{"operationId":"identity.listMembers","tags":["identity"],"summary":"List members","description":"Lists the organization's members, invited and removed ones included, as Settings, Team shows them: active first, then invited, then removed, each by name. Filter by `status`, and search names and emails with `q`. Each page also carries the member counts of the whole organization, whatever the filters. Any active member may call it.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read","parameters":[{"name":"orgId","in":"path","required":true,"description":"The organization's id.","schema":{"$ref":"#/components/schemas/OrganizationId"}},{"name":"cursor","in":"query","required":false,"description":"Where to continue: the `nextCursor` of the page before. Left out, the list starts at its beginning.","schema":{"$ref":"#/components/schemas/Cursor"}},{"name":"limit","in":"query","required":false,"description":"How many items to return, 1 to 200; 50 when left out.","schema":{"type":"string","pattern":"^-?(0|[1-9][0-9]*)$"}},{"name":"status","in":"query","required":false,"description":"Only members with this status: `invited`, `active` or `deactivated`. Left out: every member.","schema":{"$ref":"#/components/schemas/MemberStatus"}},{"name":"q","in":"query","required":false,"description":"Search text matched against names and email addresses, up to 100 characters.","schema":{"type":"string","maxLength":100}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemberPage"},"example":{"items":[{"id":"mbr_01jb2m8b4d6f8h0k2m4n6q8s0t","organizationId":"org_01jb2m7q9x4t6v8w0y2z4c6e8g","userId":"usr_01jb2m6z8x0v2t4r6p8n0m2k4h","email":"elena.ward@example.com","name":"Elena Ward","avatarUrl":"https://files.example.com/avatars/elena-ward.png?signature=EXAMPLE","jobTitle":"Managing Director","role":"owner","status":"active","teamIds":["team_01jb2p3d5f7h9k1m3n5q7s9v1x"],"lastActiveAt":"2026-09-14T08:12:30.000Z","joinedAt":"2026-09-14T08:12:30.000Z","invite":null,"deactivatedAt":null,"revision":4,"viewer":{"canChangeRole":false,"canDeactivate":false,"canReactivate":false,"canResendInvite":false,"canRevokeInvite":false}},{"id":"mbr_01jb2n1c5e7g9j1k3m5p7r9s2v","organizationId":"org_01jb2m7q9x4t6v8w0y2z4c6e8g","userId":"usr_01jb2m6y7w9t1r3p5n7m9k1h3g","email":"jonas.becker@example.com","name":"Jonas Becker","avatarUrl":null,"jobTitle":"Senior Designer","role":"member","status":"active","teamIds":["team_01jb2p3d5f7h9k1m3n5q7s9v1x"],"lastActiveAt":"2026-09-16T10:02:00.000Z","joinedAt":"2026-09-16T10:02:00.000Z","invite":{"id":"inv_01jb9w2e4g6j8m0p2r4t6w8y0b","status":"accepted","lastSentAt":"2026-09-15T17:40:00.000Z","expiresAt":"2026-09-22T17:40:00.000Z","undelivered":null},"deactivatedAt":null,"revision":3,"viewer":{"canChangeRole":true,"canDeactivate":true,"canReactivate":false,"canResendInvite":false,"canRevokeInvite":false}}],"nextCursor":"bWJyXzAxamIybjFjNWU3ZzlqMWszbTVwN3I5czJ2","counts":{"active":12,"invited":2,"deactivated":1}}}}},"400":{"description":"validation_failed, invalid_cursor","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/orgs/{orgId}/invites":{"post":{"operationId":"identity.inviteMember","tags":["identity"],"summary":"Invite a member","description":"Invites a person by email with any role but owner, and emails them a link that works for 7 days. Answers the invite and its member, who stays `invited` until they accept; inviting a removed member's address again reuses that member, so their history stays theirs. Only the owner and admins; an API key may invite members and viewers, not admins. An address that is already a member answers `409 duplicate`. Requires an `Idempotency-Key`.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read_write","parameters":[{"name":"orgId","in":"path","required":true,"description":"The organization's id.","schema":{"$ref":"#/components/schemas/OrganizationId"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"A key you choose for this request, such as a UUID. Once the request has succeeded, sending it again with the same key gets the first answer back, with nothing done twice.","schema":{"$ref":"#/components/schemas/IdempotencyKey"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InviteMemberBody"}}}},"responses":{"201":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InviteMemberResult"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"idempotency_in_progress, duplicate","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"422":{"description":"idempotency_key_reused","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/invites/{inviteId}/resend":{"post":{"operationId":"identity.resendInvite","tags":["identity"],"summary":"Resend an invite","description":"Sends a pending invite's email again with a new link, which ends the old one, and the 7 days start again. It also clears a delivery problem reported for the previous email. Only the owner and admins; an API key cannot resend an admin's invite. An invite that is no longer pending answers `409 state_conflict`.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read_write","parameters":[{"name":"inviteId","in":"path","required":true,"description":"The invite's id.","schema":{"$ref":"#/components/schemas/InviteId"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Invite"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"state_conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/invites/{inviteId}/revoke":{"post":{"operationId":"identity.revokeInvite","tags":["identity"],"summary":"Cancel an invite","description":"Cancels a pending invite: its link stops working and the invited member is removed, so they leave the invited list. They come back only through a new invite. Only the owner and admins. An invite that is no longer pending answers `409 state_conflict`.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read_write","parameters":[{"name":"inviteId","in":"path","required":true,"description":"The invite's id.","schema":{"$ref":"#/components/schemas/InviteId"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Invite"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"state_conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/invites/preview":{"post":{"operationId":"identity.previewInvite","tags":["identity"],"summary":"Preview an invite","description":"Answers what the invite page shows before sign-in, from the token in the invite email: the organization's and the inviter's names, a masked hint of the invited address, the role, the invite's status and its expiry. An unknown token answers `410 link_invalid`. Public: no sign-in needed.","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreviewInviteBody"}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvitePreview"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"410":{"description":"link_invalid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/invites/accept":{"post":{"operationId":"identity.acceptInvite","tags":["identity"],"summary":"Accept an invite","description":"Joins the organization with the token from the invite email, with the role the invite grants, and answers the organization's id and the new member. The signed-in user's verified email must be the invited one, else `403 forbidden`. A cancelled, expired or unknown link answers `410 link_invalid`. Session only: an API key cannot call it.","security":[{"session":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AcceptInviteBody"}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AcceptInviteResult"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"410":{"description":"link_invalid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/members/{memberId}":{"patch":{"operationId":"identity.updateMember","tags":["identity"],"summary":"Update a member","description":"Changes a member's role or job title. The owner and admins change any member's, but the owner's role answers `409 protected_object`; a member may change their own job title. No API key may call it. Changing a removed member's role answers `409 state_conflict`: restore them first. An invited member's invite grants the new role. Making a member a viewer pauses the active flows, connections and webhooks they own (reason `owner_made_viewer`), and the runs in progress of every flow they own are cancelled. Their agents and other objects are unchanged. When they own flows or connections, the organization owner (not the admins) is notified. Making them a viewer, or taking the admin role away, revokes their API keys for good. Another role later does not resume anything.","security":[{"session":[]}],"x-api-key-scope":"none","parameters":[{"name":"memberId","in":"path","required":true,"description":"The member's id.","schema":{"$ref":"#/components/schemas/MemberId"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateMemberBody"}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Member"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"revision_conflict, state_conflict, protected_object","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/members/{memberId}/deactivate":{"post":{"operationId":"identity.deactivateMember","tags":["identity"],"summary":"Deactivate a member","description":"Removes a member, reversibly: their id stays, so their history stays attributed, and `POST /v0/members/{memberId}/reactivate` restores them. Their open streams in the organization close, their API keys are revoked for good and their pending access requests close. The flows and connections they own and their pending approvals pause (reason `owner_deactivated`), runs in progress are cancelled, and the organization owner (not the admins) is notified; the webhooks they own turn off, and the owner and admins are told; their agents keep working. Restoring them resumes nothing: the owner or an admin resumes an approval or turns a webhook back on, and a flow or a connection comes back only through its owner, once active again, or a new owner after a hand-over. Only the owner and admins, signed in: no API key may call it. The organization owner answers `409 protected_object`: transfer ownership first.","security":[{"session":[]}],"x-api-key-scope":"none","parameters":[{"name":"memberId","in":"path","required":true,"description":"The member's id.","schema":{"$ref":"#/components/schemas/MemberId"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeactivateMemberBody"}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Member"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"revision_conflict, state_conflict, protected_object","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/members/{memberId}/reactivate":{"post":{"operationId":"identity.reactivateMember","tags":["identity"],"summary":"Reactivate a member","description":"Restores a removed member with the same id, so they work in the organization again. It resumes nothing that paused when they were removed and brings back no API key. A member who never joined (their invite was cancelled before they accepted it) answers `409 state_conflict`: invite them again instead. Only the owner and admins, signed in: no API key may call it.","security":[{"session":[]}],"x-api-key-scope":"none","parameters":[{"name":"memberId","in":"path","required":true,"description":"The member's id.","schema":{"$ref":"#/components/schemas/MemberId"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReactivateMemberBody"}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Member"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"revision_conflict, state_conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/orgs/{orgId}/api-keys":{"get":{"operationId":"identity.listApiKeys","tags":["api-keys"],"summary":"List API keys","description":"Lists the organization's API keys as Settings, API keys shows them, newest first, never their secret. The owner and admins see every member's keys; anyone else sees their own. It lists the keys that work or have expired, and those revoked because their member was removed, made a viewer or is no longer an admin, but not keys revoked by hand. The caller may revoke every listed key that is not revoked. Session only: an API key cannot call it.","security":[{"session":[]}],"parameters":[{"name":"orgId","in":"path","required":true,"description":"The organization's id.","schema":{"$ref":"#/components/schemas/OrganizationId"}},{"name":"cursor","in":"query","required":false,"description":"Where to continue: the `nextCursor` of the page before. Left out, the list starts at its beginning.","schema":{"$ref":"#/components/schemas/Cursor"}},{"name":"limit","in":"query","required":false,"description":"How many items to return, 1 to 200; 50 when left out.","schema":{"type":"string","pattern":"^-?(0|[1-9][0-9]*)$"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyPage"}}}},"400":{"description":"validation_failed, invalid_cursor","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"post":{"operationId":"identity.createApiKey","tags":["api-keys"],"summary":"Create an API key","description":"Makes an API key that acts with the caller's permissions, capped by its scope: `read` or `read_write`. Only the owner and admins, signed in. The answer holds the key's `secret` this once: store it then, since the API keeps only a digest and a replay of the request answers `secret: null`. The expiry is optional, but a key that may decide anything must be `read_write` and expire within 90 days. Requires an `Idempotency-Key`; at most 20 keys an hour per member. A member holds at most 10 active keys and an organization 50: past either, `409 state_conflict` (revoke a key, or let one expire, to free a place).","security":[{"session":[]}],"parameters":[{"name":"orgId","in":"path","required":true,"description":"The organization's id.","schema":{"$ref":"#/components/schemas/OrganizationId"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"A key you choose for this request, such as a UUID. Once the request has succeeded, sending it again with the same key gets the first answer back, with nothing done twice.","schema":{"$ref":"#/components/schemas/IdempotencyKey"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateApiKeyBody"},"example":{"name":"Zapier: client approvals","scope":"read_write","expiresAt":"2027-01-19T09:30:00.000Z","decides":["file_approvals"]}}}},"responses":{"201":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateApiKeyResult"},"example":{"apiKey":{"id":"apikey_01jbag5h7k9m1p3r5t7w9y1b3d","organizationId":"org_01jb2m7q9x4t6v8w0y2z4c6e8g","name":"Zapier: client approvals","scope":"read_write","prefix":"flk_EXAMPLEk","memberId":"mbr_01jb2m8a3c5e7g9j1k3m5p7r9s","status":"active","createdAt":"2026-10-21T09:30:00.000Z","expiresAt":"2027-01-19T09:30:00.000Z","lastUsedAt":null,"revokedAt":null,"revokedBy":null,"revokedReason":null,"decides":["file_approvals"],"decidingPausedAt":null},"secret":"flk_EXAMPLEkey000000000000000000000000000000000"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden, recent_sign_in_required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"idempotency_in_progress, state_conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"422":{"description":"idempotency_key_reused","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/api-keys/{apiKeyId}/revoke":{"post":{"operationId":"identity.revokeApiKey","tags":["api-keys"],"summary":"Revoke an API key","description":"Revokes a key, which is refused from its next request on. Its own member, or the owner or an admin, may revoke it; anyone else gets `404 not_found`. A key already revoked answers as it is. Session only: an API key cannot call it.","security":[{"session":[]}],"parameters":[{"name":"apiKeyId","in":"path","required":true,"description":"The key's id.","schema":{"$ref":"#/components/schemas/ApiKeyId"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKey"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/api-keys/{apiKeyId}/resume-deciding":{"post":{"operationId":"identity.resumeApiKeyDeciding","tags":["api-keys"],"summary":"Resume API key decisions","description":"Turns a key's deciding back on after it paused. A key that tries more than 60 decisions in an hour is refused and has its deciding paused: it still reads and writes, but decides nothing until this call. Its own member, or the owner or an admin, may call it; anyone else gets `404 not_found`. A key whose deciding is not paused answers as it is. Session only: an API key cannot call it.","security":[{"session":[]}],"parameters":[{"name":"apiKeyId","in":"path","required":true,"description":"The key's id.","schema":{"$ref":"#/components/schemas/ApiKeyId"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKey"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/api-key":{"get":{"operationId":"identity.getCurrentApiKey","tags":["api-keys"],"summary":"Get the calling API key","description":"Answers the API key that sends the request, never its secret: the organization it works in, the member it acts as, its scope, what it may decide and when it expires. A script or a tool calls it first to learn which organization its key belongs to and what it may do there. Only a key calls it: a signed-in session holds no key and gets `404 not_found`.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read","responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKey"},"example":{"id":"apikey_01jbag5h7k9m1p3r5t7w9y1b3d","organizationId":"org_01jb2m7q9x4t6v8w0y2z4c6e8g","name":"Claude Code","scope":"read_write","prefix":"flk_EXAMPLEk","memberId":"mbr_01jb2m8a3c5e7g9j1k3m5p7r9s","status":"active","createdAt":"2026-10-21T09:30:00.000Z","expiresAt":null,"lastUsedAt":"2026-11-03T08:15:00.000Z","revokedAt":null,"revokedBy":null,"revokedReason":null,"decides":[],"decidingPausedAt":null}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/objects/{objectId}/access":{"get":{"operationId":"access.getAccess","tags":["access"],"summary":"Get an object's access","description":"Returns who can access an object and how, as the Share panel shows it: its visibility, the level members get when it is visible to the organization, its owner, each grant with where it comes from, and the caller's own access. Works on every kind of shared object: chats, tables, files, flows, agents, skills and connections. An object the caller cannot view answers `404 not_found`.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read","parameters":[{"name":"objectId","in":"path","required":true,"description":"The object's id, whatever its kind: a chat, table, file, flow, agent, skill or connection id.","schema":{"$ref":"#/components/schemas/AccessObjectId"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ObjectAccess"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"patch":{"operationId":"access.updateVisibility","tags":["access"],"summary":"Update an object's visibility","description":"Makes an object visible to the whole organization or private, with the access `revision` you read as `expectedRevision`. Only the object's owner and the organization's owner and admins may do it, never a viewer. A skill is always visible to the organization and answers `409 state_conflict`. Returns the object's full access.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read_write","parameters":[{"name":"objectId","in":"path","required":true,"description":"The object's id, whatever its kind: a chat, table, file, flow, agent, skill or connection id.","schema":{"$ref":"#/components/schemas/AccessObjectId"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateVisibilityBody"}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ObjectAccess"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"revision_conflict, state_conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/objects/{objectId}/members":{"post":{"operationId":"access.addMember","tags":["access"],"summary":"Grant access","description":"Shares an object with a person or an agent of the organization, at `view`, `edit` or `manage` (`view` when `level` is left out). Needs manage access to the object, and nobody grants more than they hold. It never lowers a grant someone already has: use Update an access level for that. An agent gets `view` or `edit`, never `manage`, and never a grant on a skill or a connection, which it uses through their agent list: `403 forbidden`. Returns the object's full access.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read_write","parameters":[{"name":"objectId","in":"path","required":true,"description":"The object's id, whatever its kind: a chat, table, file, flow, agent, skill or connection id.","schema":{"$ref":"#/components/schemas/AccessObjectId"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"A key you choose for this request, such as a UUID. Once the request has succeeded, sending it again with the same key gets the first answer back, with nothing done twice.","schema":{"$ref":"#/components/schemas/IdempotencyKey"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddObjectMemberBody"}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ObjectAccess"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"idempotency_in_progress","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"422":{"description":"idempotency_key_reused","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/objects/{objectId}/members/{actorId}":{"patch":{"operationId":"access.updateMember","tags":["access"],"summary":"Update an access level","description":"Changes the level of a grant made on this object, up or down. Needs manage access to the object. The owner's grant, and access that comes from elsewhere (the organization's visibility or an admin role), answer `409 protected_object`: change it at its source. An agent cannot get `manage` (`403 forbidden`). Returns the object's full access.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read_write","parameters":[{"name":"objectId","in":"path","required":true,"description":"The object's id, whatever its kind: a chat, table, file, flow, agent, skill or connection id.","schema":{"$ref":"#/components/schemas/AccessObjectId"}},{"name":"actorId","in":"path","required":true,"description":"The person or agent whose grant on the object to change or remove.","schema":{"$ref":"#/components/schemas/ActorId"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateObjectMemberBody"}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ObjectAccess"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"protected_object","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"delete":{"operationId":"access.removeMember","tags":["access"],"summary":"Remove access","description":"Removes a grant made on this object from a person or an agent. If they can no longer view the object, their open streams for it close at once. Needs manage access to the object. The owner's grant, and access that comes from elsewhere, answer `409 protected_object`. Returns the object's full access.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read_write","parameters":[{"name":"objectId","in":"path","required":true,"description":"The object's id, whatever its kind: a chat, table, file, flow, agent, skill or connection id.","schema":{"$ref":"#/components/schemas/AccessObjectId"}},{"name":"actorId","in":"path","required":true,"description":"The person or agent whose grant on the object to change or remove.","schema":{"$ref":"#/components/schemas/ActorId"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ObjectAccess"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"protected_object","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/objects/{objectId}/invites":{"post":{"operationId":"access.inviteByEmail","tags":["access"],"summary":"Share by email","description":"Shares an object with someone by email address, at `level` (`view` when left out). An active or invited member with that address gets a grant, as with Grant access, and no email is sent. A new address is invited to the organization as a member and granted the object; only the organization's owner and admins may invite (`403 forbidden` otherwise). A removed member's address is invited back by the owner and admins only, and they return with this grant alone: the grants they held before are dropped. Needs manage access to the object. Returns the object's full access.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read_write","parameters":[{"name":"objectId","in":"path","required":true,"description":"The object's id, whatever its kind: a chat, table, file, flow, agent, skill or connection id.","schema":{"$ref":"#/components/schemas/AccessObjectId"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"A key you choose for this request, such as a UUID. Once the request has succeeded, sending it again with the same key gets the first answer back, with nothing done twice.","schema":{"$ref":"#/components/schemas/IdempotencyKey"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InviteByEmailBody"}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ObjectAccess"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"idempotency_in_progress","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"422":{"description":"idempotency_key_reused","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/objects/{objectId}/access-requests":{"post":{"operationId":"access.requestAccess","tags":["access"],"summary":"Request access","description":"Asks for edit access to an object (\"Ask to edit\"), with an optional note of up to 500 characters. For a member who can view the object but not edit it, on any kind of object. The object's owner (unless they are a viewer) and the organization's owner and admins are notified and may decide it; approving grants `edit`. A viewer cannot ask (`403 forbidden`), a caller who already has edit gets `409 state_conflict`, and a second request while one is pending gets `409 duplicate`.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read_write","parameters":[{"name":"objectId","in":"path","required":true,"description":"The object's id, whatever its kind: a chat, table, file, flow, agent, skill or connection id.","schema":{"$ref":"#/components/schemas/AccessObjectId"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"A key you choose for this request, such as a UUID. Once the request has succeeded, sending it again with the same key gets the first answer back, with nothing done twice.","schema":{"$ref":"#/components/schemas/IdempotencyKey"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestAccessBody"}}}},"responses":{"201":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccessRequest"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"idempotency_in_progress, state_conflict, duplicate","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"422":{"description":"idempotency_key_reused","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/orgs/{orgId}/access-requests":{"get":{"operationId":"access.listAccessRequests","tags":["access"],"summary":"List access requests","description":"Lists the access requests the caller sees, newest first: their own, and those they may decide now. Only pending requests unless `status` lists others, comma-separated (`pending`, `approved`, `declined`, `closed`); `decidableByMe=true` keeps those the caller may decide. Each request says whether the caller may decide it (`viewer.canDecide`). An API key reads them as its member does but decides none, so `canDecide` is false for it.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read","parameters":[{"name":"orgId","in":"path","required":true,"description":"The organization's id.","schema":{"$ref":"#/components/schemas/OrganizationId"}},{"name":"status","in":"query","required":false,"description":"Only requests in these states, comma-separated: `pending`, `approved`, `declined`, `closed`. Left out: pending only.","schema":{"type":"string"}},{"name":"decidableByMe","in":"query","required":false,"description":"Set to `true` to keep only the requests the caller may approve or decline now.","schema":{"type":"string","pattern":"^(true|false)$"}},{"name":"cursor","in":"query","required":false,"description":"Where to continue: the `nextCursor` of the page before. Left out, the list starts at its beginning.","schema":{"$ref":"#/components/schemas/Cursor"}},{"name":"limit","in":"query","required":false,"description":"How many items to return, 1 to 200; 50 when left out.","schema":{"type":"string","pattern":"^-?(0|[1-9][0-9]*)$"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccessRequestPage"}}}},"400":{"description":"validation_failed, invalid_cursor","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/access-requests/{accessRequestId}":{"get":{"operationId":"access.getAccessRequest","tags":["access"],"summary":"Get an access request","description":"Returns one access request, such as the one a notification links to. Only its requester and those who may decide it now (the object's owner and the organization's owner and admins) see it; anyone else, a previous owner after a hand-over included, gets `404 not_found`. An API key reads it as its member does, and never decides it.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read","parameters":[{"name":"accessRequestId","in":"path","required":true,"description":"The access request's id.","schema":{"$ref":"#/components/schemas/AccessRequestId"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccessRequest"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/access-requests/{accessRequestId}/approve":{"post":{"operationId":"access.approveAccessRequest","tags":["access"],"summary":"Approve an access request","description":"Approves a pending access request: the requester gets a direct grant at `edit` on the object (a higher grant they hold stays) and is notified. Only the object's owner and the organization's owner and admins approve, never a viewer, and only people, never an API key (`403 forbidden`). A request already decided, or whose requester has since become a viewer, answers `409 state_conflict`.","security":[{"session":[]}],"x-api-key-scope":"none","parameters":[{"name":"accessRequestId","in":"path","required":true,"description":"The access request's id.","schema":{"$ref":"#/components/schemas/AccessRequestId"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccessRequest"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"state_conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/access-requests/{accessRequestId}/decline":{"post":{"operationId":"access.declineAccessRequest","tags":["access"],"summary":"Decline an access request","description":"Declines a pending access request: nothing changes on the object, and the requester is notified. Only the object's owner and the organization's owner and admins decline, never a viewer, and only people, never an API key (`403 forbidden`). A request already decided answers `409 state_conflict`.","security":[{"session":[]}],"x-api-key-scope":"none","parameters":[{"name":"accessRequestId","in":"path","required":true,"description":"The access request's id.","schema":{"$ref":"#/components/schemas/AccessRequestId"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccessRequest"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"state_conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/objects/{objectId}/owner":{"put":{"operationId":"access.transferOwnership","tags":["access"],"summary":"Transfer ownership","description":"Hands an object of any kind over to another member, with the access `revision` you read as `expectedRevision`. The object's owner (never a viewer) and the organization's owner and admins may do it at any time, even when the owner is no longer active; an API key cannot (`403 forbidden`). The new owner must be an active member who is not a viewer or the current owner (`409 state_conflict` otherwise). The previous owner keeps `edit` unless `removePreviousOwnerGrant` is true, which leaves them only what the organization or their role gives; other grants stay, and pending access requests move to the new owner. A flow is paused, or stays paused, until its new owner turns it on, and a connection paused because its owner left stays paused too. Both owners are notified, except whoever made the hand-over and a previous owner who can no longer view the object. Returns the object's full access.","security":[{"session":[]}],"x-api-key-scope":"none","parameters":[{"name":"objectId","in":"path","required":true,"description":"The object's id, whatever its kind: a chat, table, file, flow, agent, skill or connection id.","schema":{"$ref":"#/components/schemas/AccessObjectId"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransferObjectOwnershipBody"}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ObjectAccess"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"revision_conflict, state_conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/objects/{objectId}":{"get":{"operationId":"objects.getObject","tags":["objects"],"summary":"Get an object","description":"Resolves the id of any shareable object (a chat, table, file, flow, agent, skill or connection) to its type, name, owner, visibility and dates, with the caller's access. Use it to show links, mentions and notification targets without knowing the type first. An object the caller may not view answers `404 not_found`.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read","parameters":[{"name":"objectId","in":"path","required":true,"description":"The id of a chat, table, file, flow, agent, skill or connection.","schema":{"$ref":"#/components/schemas/AccessObjectId"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ObjectEntryDetail"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/orgs/{orgId}/objects":{"get":{"operationId":"objects.listObjects","tags":["objects"],"summary":"List objects","description":"Lists and searches the objects the caller may view in an organization (chats, tables, files, flows, agents, skills and connections), most recently updated first, for pickers and search. Filter by name with `q`, by `type`, or by `parentId` for the children of one object. Read-only: each object changes through its own endpoints.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read","parameters":[{"name":"orgId","in":"path","required":true,"description":"The organization's id.","schema":{"$ref":"#/components/schemas/OrganizationId"}},{"name":"cursor","in":"query","required":false,"description":"Where to continue: the `nextCursor` of the page before. Left out, the list starts at its beginning.","schema":{"$ref":"#/components/schemas/Cursor"}},{"name":"limit","in":"query","required":false,"description":"How many items to return, 1 to 200; 50 when left out.","schema":{"type":"string","pattern":"^-?(0|[1-9][0-9]*)$"}},{"name":"q","in":"query","required":false,"description":"Text to find in names, ignoring case; empty or left out, no filter.","schema":{"type":"string","maxLength":100}},{"name":"type","in":"query","required":false,"description":"Only objects of this kind, such as `table`.","schema":{"$ref":"#/components/schemas/ObjectType"}},{"name":"parentId","in":"query","required":false,"description":"Only the objects that belong to this one.","schema":{"$ref":"#/components/schemas/AccessObjectId"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ObjectEntryPage"}}}},"400":{"description":"validation_failed, invalid_cursor","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/objects/{objectId}/about":{"get":{"operationId":"about.getAbout","tags":["about"],"summary":"Get what an object is about","description":"Lists the records a chat, a file or a flow is about, as its Details panel shows them (\"About: Acme · Clients\"), oldest link first, with whether the caller may change them. Records of a table the caller cannot view are left out. Needs view access to the object.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read","parameters":[{"name":"objectId","in":"path","required":true,"description":"The object's id: a chat's, a file's (a doc is a file) or a flow's.","schema":{"$ref":"#/components/schemas/AboutObjectId"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ObjectAbout"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"post":{"operationId":"about.addRecord","tags":["about"],"summary":"Link a record","description":"Says that a chat, a file or a flow is about a record, in any table of the organization. Needs edit access to the object and view access to the record's table; a record the caller cannot view answers `404 not_found`. A record already linked changes nothing. An object is linked to at most 20 records (`400 validation_failed`). Returns the object's About.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read_write","parameters":[{"name":"objectId","in":"path","required":true,"description":"The object's id: a chat's, a file's (a doc is a file) or a flow's.","schema":{"$ref":"#/components/schemas/AboutObjectId"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"A key you choose for this request, such as a UUID. Once the request has succeeded, sending it again with the same key gets the first answer back, with nothing done twice.","schema":{"$ref":"#/components/schemas/IdempotencyKey"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddAboutRecordBody"}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ObjectAbout"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"idempotency_in_progress","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"422":{"description":"idempotency_key_reused","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/objects/{objectId}/about/{recordId}":{"delete":{"operationId":"about.removeRecord","tags":["about"],"summary":"Unlink a record","description":"Removes a record from what a chat, a file or a flow is about. Needs edit access to the object. A record that is not linked, or one of a table the caller cannot view, changes nothing. Returns the object's About.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read_write","parameters":[{"name":"objectId","in":"path","required":true,"description":"The object's id: a chat's, a file's (a doc is a file) or a flow's.","schema":{"$ref":"#/components/schemas/AboutObjectId"}},{"name":"recordId","in":"path","required":true,"description":"The record to unlink.","schema":{"$ref":"#/components/schemas/RecordId"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ObjectAbout"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/orgs/{orgId}/chats":{"get":{"operationId":"chats.listChats","tags":["chats"],"summary":"List chats","description":"Lists the chats the caller can see in the organization, newest activity first, as the app's sidebar shows them. Each row carries the last message (a short plain-text excerpt, or `null`), how many people and agents have access and when the caller pinned it (`pinnedAt`, or `null`), and the answer holds `totalCount`. A page holds 100 chats by default, at most 200.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read","parameters":[{"name":"orgId","in":"path","required":true,"description":"The organization's id.","schema":{"$ref":"#/components/schemas/OrganizationId"}},{"name":"cursor","in":"query","required":false,"description":"Where to continue: the `nextCursor` of the page before. Left out, the list starts at its beginning.","schema":{"$ref":"#/components/schemas/Cursor"}},{"name":"limit","in":"query","required":false,"description":"How many chats to return, 1 to 200; 100 when left out.","schema":{"type":"string","pattern":"^-?(0|[1-9][0-9]*)$"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListChatsResult"},"example":{"items":[{"id":"chat_01jb4n6p8r0t2v4x6z8a0c2e4g","name":"Spring launch","visibility":"organization","lastActivityAt":"2026-10-21T09:30:13.800Z","createdAt":"2026-10-14T08:15:00.000Z","ownerId":"mbr_01j9z4a2b3c4d5e6f7g8h9j0k1","lastMessage":{"messageId":"msg_01jbm3s5v7x9z1b3d5f7h9k1m3","authorId":"agt_01j9z5c7d8e9f0g1h2j3k4m5n6","excerpt":"Here are three captions for the spring launch: New season, new roast. Meet our Spring Blend. Bright, floral and a little bold: spring in a cup. Your mornings j…","createdAt":"2026-10-21T09:30:13.800Z"},"accessSummary":{"people":2,"agents":1,"invited":0,"sampleActorIds":["mbr_01j9z4a2b3c4d5e6f7g8h9j0k1","mbr_01j9z4m5n6p7q8r9s0t1v2w3x5","agt_01j9z5c7d8e9f0g1h2j3k4m5n6"]},"pinnedAt":"2026-10-21T08:00:00.000Z","unread":true,"unreadMentions":1},{"id":"chat_01jb4n7q9s1v3x5z7b9d1f3h5k","name":"Client: Northwind Coffee","visibility":"private","lastActivityAt":"2026-10-20T16:05:00.000Z","createdAt":"2026-09-30T10:00:00.000Z","ownerId":"mbr_01j9z4m5n6p7q8r9s0t1v2w3x5","lastMessage":{"messageId":"msg_01jbk8w2y4a6c8e0g2j4m6p8r0","authorId":"mbr_01j9z4m5n6p7q8r9s0t1v2w3x5","excerpt":"Northwind approved the October shoot list. Final edits are due Friday.","createdAt":"2026-10-20T16:05:00.000Z"},"accessSummary":{"people":2,"agents":1,"invited":1,"sampleActorIds":["mbr_01j9z4m5n6p7q8r9s0t1v2w3x5","mbr_01j9z4a2b3c4d5e6f7g8h9j0k1","agt_01j9z5p7q8r9s0t1v2w3x4y5z6"]},"pinnedAt":null,"unread":false,"unreadMentions":0}],"nextCursor":null,"totalCount":2}}}},"400":{"description":"validation_failed, invalid_cursor","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"post":{"operationId":"chats.createChat","tags":["chats"],"summary":"Create a chat","description":"Creates a chat in one step, as the app does on a new chat's first send: its visibility and, optionally, a name, a description, members, email invites and a first message. Without a name the chat is titled automatically. The first message works like any post: each agent it mentions gets a turn, returned in `turns`. An agent among `members` gets view or edit, never manage. A member's address in `inviteEmails` just gives them access; any other address gets an invite, which only the organization's owner and admins may send (`403 forbidden`). The `Idempotency-Key` is also the first message's `clientMessageId`.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read_write","parameters":[{"name":"orgId","in":"path","required":true,"description":"The organization's id.","schema":{"$ref":"#/components/schemas/OrganizationId"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"A key you choose for this request, such as a UUID. Once the request has succeeded, sending it again with the same key gets the first answer back, with nothing done twice.","schema":{"$ref":"#/components/schemas/IdempotencyKey"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateChatBody"},"example":{"name":"Holiday campaign","visibility":"private","members":[{"actorId":"mbr_01j9z4m5n6p7q8r9s0t1v2w3x5","level":"edit"},{"actorId":"agt_01j9z5p7q8r9s0t1v2w3x4y5z6","level":"view"}],"firstMessage":{"parts":[{"type":"mention","actorId":"agt_01j9z5p7q8r9s0t1v2w3x4y5z6"},{"type":"text","text":" sketch three moodboard directions for the holiday campaign: warm, minimal and playful."}]}}}}},"responses":{"201":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateChatResult"},"example":{"chat":{"id":"chat_01jbp4x6z8b0d2f4h6k8n0q2s4","name":"Holiday campaign","visibility":"private","lastActivityAt":"2026-10-22T14:00:00.000Z","createdAt":"2026-10-22T14:00:00.000Z","organizationId":"org_01j9z3k8m2q4r6t8v0w2y4a6c8","about":"","ownerId":"mbr_01j9z4a2b3c4d5e6f7g8h9j0k1","createdBy":"mbr_01j9z4a2b3c4d5e6f7g8h9j0k1","autoTitled":false,"messageCount":1,"agentIds":["agt_01j9z5p7q8r9s0t1v2w3x4y5z6"],"agentsPaused":false,"agentsPausedBy":null,"agentsPausedAt":null,"accessSummary":{"people":2,"agents":1,"invited":0,"sampleActorIds":["mbr_01j9z4a2b3c4d5e6f7g8h9j0k1","mbr_01j9z4m5n6p7q8r9s0t1v2w3x5","agt_01j9z5p7q8r9s0t1v2w3x4y5z6"]},"updatedAt":"2026-10-22T14:00:00.000Z","revision":1,"lastMessage":{"messageId":"msg_01jbp4x7a9c1e3g5j7m9q1s3v5","authorId":"mbr_01j9z4a2b3c4d5e6f7g8h9j0k1","excerpt":"@Designer sketch three moodboard directions for the holiday campaign: warm, minimal and playful.","createdAt":"2026-10-22T14:00:00.000Z"},"myAccess":{"level":"manage","actions":["view","edit","share","change_visibility","delete","export","pause_agents","transfer_ownership"]}},"message":{"id":"msg_01jbp4x7a9c1e3g5j7m9q1s3v5","thread":{"kind":"chat","chatId":"chat_01jbp4x6z8b0d2f4h6k8n0q2s4"},"fileVersionId":null,"seq":1,"author":{"kind":"actor","actorId":"mbr_01j9z4a2b3c4d5e6f7g8h9j0k1"},"parts":[{"type":"mention","actorId":"agt_01j9z5p7q8r9s0t1v2w3x4y5z6","label":"Designer"},{"type":"text","text":" sketch three moodboard directions for the holiday campaign: warm, minimal and playful."}],"mentionedActorIds":["agt_01j9z5p7q8r9s0t1v2w3x4y5z6"],"triggeredTurnIds":["turn_01jbp4x7b0d2f4h6k8n0q2s4v6"],"turnId":null,"chainId":"chain_01jbp4x7c1e3g5j7m9q1s3v5x7","onBehalfOf":null,"resolved":null,"clientMessageId":"0b7e4d2c-9a31-4f6e-8c5d-2e1f3a4b5c6d","createdAt":"2026-10-22T14:00:00.000Z","revision":1},"turns":[{"id":"turn_01jbp4x7b0d2f4h6k8n0q2s4v6","agentId":"agt_01j9z5p7q8r9s0t1v2w3x4y5z6","thread":{"kind":"chat","chatId":"chat_01jbp4x6z8b0d2f4h6k8n0q2s4"},"trigger":{"kind":"member_mention","messageId":"msg_01jbp4x7a9c1e3g5j7m9q1s3v5","flowRunId":null,"stepRunId":null},"chain":{"chainId":"chain_01jbp4x7c1e3g5j7m9q1s3v5x7","depth":1,"parentTurnId":null,"initiatorId":"mbr_01j9z4a2b3c4d5e6f7g8h9j0k1","agentPath":["agt_01j9z5p7q8r9s0t1v2w3x4y5z6"]},"status":"queued","endReason":null,"failure":null,"attempt":0,"pendingRequestId":null,"replyMessageIds":[],"modelAlias":null,"agentRevision":null,"queuedAt":"2026-10-22T14:00:00.000Z","startedAt":null,"awaitingApprovalSince":null,"cancelRequestedAt":null,"endedAt":null,"cancelledBy":null,"usage":null,"revision":1}],"included":{"files":[],"tableCards":[],"requests":[],"turns":[{"id":"turn_01jbp4x7b0d2f4h6k8n0q2s4v6","agentId":"agt_01j9z5p7q8r9s0t1v2w3x4y5z6","thread":{"kind":"chat","chatId":"chat_01jbp4x6z8b0d2f4h6k8n0q2s4"},"trigger":{"kind":"member_mention","messageId":"msg_01jbp4x7a9c1e3g5j7m9q1s3v5","flowRunId":null,"stepRunId":null},"chain":{"chainId":"chain_01jbp4x7c1e3g5j7m9q1s3v5x7","depth":1,"parentTurnId":null,"initiatorId":"mbr_01j9z4a2b3c4d5e6f7g8h9j0k1","agentPath":["agt_01j9z5p7q8r9s0t1v2w3x4y5z6"]},"status":"queued","endReason":null,"failure":null,"attempt":0,"pendingRequestId":null,"replyMessageIds":[],"modelAlias":null,"agentRevision":null,"queuedAt":"2026-10-22T14:00:00.000Z","startedAt":null,"awaitingApprovalSince":null,"cancelRequestedAt":null,"endedAt":null,"cancelledBy":null,"usage":null,"revision":1}],"annotations":[],"unavailable":[],"records":[]}}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden, mention_not_allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"idempotency_in_progress","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"422":{"description":"idempotency_key_reused, upload_not_ready","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/orgs/{orgId}/chats/pinned":{"get":{"operationId":"chats.listPins","tags":["chats"],"summary":"List pinned chats","description":"Lists the chats the caller pinned in the organization, newest activity first, each as `GET /v0/orgs/{orgId}/chats` shows it, with `pinnedAt`. Only chats the caller can still see are listed: a pin on a deleted chat, or on one the caller lost access to, is left out. Pins are the caller's own: nobody else sees them. A page holds 100 chats by default, at most 200.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read","parameters":[{"name":"orgId","in":"path","required":true,"description":"The organization's id.","schema":{"$ref":"#/components/schemas/OrganizationId"}},{"name":"cursor","in":"query","required":false,"description":"Where to continue: the `nextCursor` of the page before. Left out, the list starts at its beginning.","schema":{"$ref":"#/components/schemas/Cursor"}},{"name":"limit","in":"query","required":false,"description":"How many chats to return, 1 to 200; 100 when left out.","schema":{"type":"string","pattern":"^-?(0|[1-9][0-9]*)$"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListPinsResult"},"example":{"items":[{"id":"chat_01jb4n6p8r0t2v4x6z8a0c2e4g","name":"Spring launch","visibility":"organization","lastActivityAt":"2026-10-21T09:30:13.800Z","createdAt":"2026-10-14T08:15:00.000Z","ownerId":"mbr_01j9z4a2b3c4d5e6f7g8h9j0k1","lastMessage":{"messageId":"msg_01jbm3s5v7x9z1b3d5f7h9k1m3","authorId":"agt_01j9z5c7d8e9f0g1h2j3k4m5n6","excerpt":"Here are three captions for the spring launch: New season, new roast. Meet our Spring Blend. Bright, floral and a little bold: spring in a cup. Your mornings j…","createdAt":"2026-10-21T09:30:13.800Z"},"accessSummary":{"people":2,"agents":1,"invited":0,"sampleActorIds":["mbr_01j9z4a2b3c4d5e6f7g8h9j0k1","mbr_01j9z4m5n6p7q8r9s0t1v2w3x5","agt_01j9z5c7d8e9f0g1h2j3k4m5n6"]},"pinnedAt":"2026-10-21T08:00:00.000Z","unread":true,"unreadMentions":1}],"nextCursor":null}}}},"400":{"description":"validation_failed, invalid_cursor","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/chats/{chatId}/pin":{"put":{"operationId":"chats.pinChat","tags":["chats"],"summary":"Pin a chat","description":"Pins a chat the caller can see, for the caller alone: nobody else sees the pin. Pinning a pinned chat changes nothing and answers when it was first pinned. There is no limit on how many chats you pin.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read_write","parameters":[{"name":"chatId","in":"path","required":true,"description":"The chat's id.","schema":{"$ref":"#/components/schemas/ChatId"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatPin"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"delete":{"operationId":"chats.unpinChat","tags":["chats"],"summary":"Unpin a chat","description":"Unpins a chat the caller can see. Unpinning a chat that isn't pinned changes nothing.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read_write","parameters":[{"name":"chatId","in":"path","required":true,"description":"The chat's id.","schema":{"$ref":"#/components/schemas/ChatId"}}],"responses":{"204":{"description":"Done. The answer has no body."},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/chats/{chatId}/read":{"post":{"operationId":"chats.markRead","tags":["chats"],"summary":"Mark a chat read","description":"Marks a chat the caller can see read up to one of its messages: the chat list stops showing it as unread, and the caller's mentions in the chat up to that message are marked read, with their notifications. A mark never moves back: marking an older message changes nothing and answers the mark as it stands. Answers the mark and the caller's unread mentions left in the chat. For people in the app only: an API key gets `403 forbidden`.","security":[{"session":[]}],"x-api-key-scope":"none","parameters":[{"name":"chatId","in":"path","required":true,"description":"The chat's id.","schema":{"$ref":"#/components/schemas/ChatId"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarkChatReadBody"}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatReadMark"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/chats/{chatId}":{"get":{"operationId":"chats.getChat","tags":["chats"],"summary":"Get a chat","description":"Returns one chat as its header and Details panel show it: its name, description, visibility and owner, the agents in it, whether its agents are paused, how many people and agents have access, its last message and the caller's own access (`myAccess`).","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read","parameters":[{"name":"chatId","in":"path","required":true,"description":"The chat's id.","schema":{"$ref":"#/components/schemas/ChatId"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Chat"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"patch":{"operationId":"chats.updateChat","tags":["chats"],"summary":"Update a chat","description":"Renames a chat (1 to 120 characters) or changes its description (`about`, up to 2,000 characters). Send only the fields that change, with the `expectedRevision` you read; a stale one answers `409 revision_conflict`. A rename ends the automatic title: `autoTitled` becomes `false`. Needs edit access to the chat.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read_write","parameters":[{"name":"chatId","in":"path","required":true,"description":"The chat's id.","schema":{"$ref":"#/components/schemas/ChatId"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateChatBody"}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Chat"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"revision_conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"delete":{"operationId":"chats.deleteChat","tags":["chats"],"summary":"Delete a chat","description":"Deletes a chat, with the agent turns still open in it. Only the chat's owner and the organization's owner and admins may delete it. The chat disappears at once and is purged for good after 30 days.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read_write","parameters":[{"name":"chatId","in":"path","required":true,"description":"The chat's id.","schema":{"$ref":"#/components/schemas/ChatId"}}],"responses":{"204":{"description":"Done. The answer has no body."},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/chats/{chatId}/export":{"get":{"operationId":"chats.exportChat","tags":["chats"],"summary":"Export a chat","description":"Downloads a chat as a Markdown file (`format=markdown`): its messages in order, then the files they attach. Anyone who can view the chat may export it. The file shows only what the caller may see: a file or table they cannot view is listed as unavailable, never by name.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read","parameters":[{"name":"chatId","in":"path","required":true,"description":"The chat's id.","schema":{"$ref":"#/components/schemas/ChatId"}},{"name":"format","in":"query","required":true,"description":"The file's format: `markdown`, the only one.","schema":{"type":"string","enum":["markdown"]}}],"responses":{"200":{"description":"Success.","content":{"text/markdown":{"schema":{"type":"string"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/chats/{chatId}/pause-agents":{"post":{"operationId":"chats.pauseAgents","tags":["chats"],"summary":"Pause agents in a chat","description":"The chat's kill switch: stops every agent in the chat at once. Its queued, running and waiting turns are cancelled, their chains stop and a notice is posted. While the chat is paused, mentions start no turns and are reported as skipped. For the members with manage access on the chat (its owner and the organization's owner and admins); API keys cannot call it. Pausing a paused chat changes nothing.","security":[{"session":[]}],"x-api-key-scope":"none","parameters":[{"name":"chatId","in":"path","required":true,"description":"The chat's id.","schema":{"$ref":"#/components/schemas/ChatId"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PauseAgentsBody"}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Chat"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"revision_conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/chats/{chatId}/resume-agents":{"post":{"operationId":"chats.resumeAgents","tags":["chats"],"summary":"Resume agents in a chat","description":"Turns the chat's kill switch off and posts a notice, so mentions start agent turns again. Chains the pause stopped stay stopped: the next mention starts a new one. For the members with manage access on the chat; API keys cannot call it. Resuming a chat that is not paused changes nothing.","security":[{"session":[]}],"x-api-key-scope":"none","parameters":[{"name":"chatId","in":"path","required":true,"description":"The chat's id.","schema":{"$ref":"#/components/schemas/ChatId"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResumeAgentsBody"}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Chat"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"revision_conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/chats/{chatId}/messages":{"get":{"operationId":"chats.listMessages","tags":["chats"],"summary":"List messages","description":"Returns a page of a chat's messages in order, with what they reference in `included` (files, table cards, request cards, turns) and `streamCursor`, the resume point that opens the chat stream with no gap. Without `before`, `after` or `around` it returns the latest page; `before` and `after` take a page's cursors, `around` a message id, and a request sends at most one. A page holds 50 messages by default. Reading the latest page, or one around a message, marks the caller's unread mentions in the chat as read.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read","parameters":[{"name":"chatId","in":"path","required":true,"description":"The chat's id.","schema":{"$ref":"#/components/schemas/ChatId"}},{"name":"before","in":"query","required":false,"description":"A page's `olderCursor`, to read the messages before it.","schema":{"$ref":"#/components/schemas/Cursor"}},{"name":"after","in":"query","required":false,"description":"A page's `newerCursor`, to read the messages after it.","schema":{"$ref":"#/components/schemas/Cursor"}},{"name":"around","in":"query","required":false,"description":"A message id, to read the page around that message, as a link to it opens the chat.","schema":{"$ref":"#/components/schemas/MessageId"}},{"name":"limit","in":"query","required":false,"description":"How many messages to return, 1 to 200; 50 when left out.","schema":{"type":"string","pattern":"^-?(0|[1-9][0-9]*)$"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessagePage"},"example":{"items":[{"id":"msg_01jbm2r4t6v8x0z2b4d6f8h0k2","thread":{"kind":"chat","chatId":"chat_01jb4n6p8r0t2v4x6z8a0c2e4g"},"fileVersionId":null,"seq":14,"author":{"kind":"actor","actorId":"mbr_01j9z4a2b3c4d5e6f7g8h9j0k1"},"parts":[{"type":"mention","actorId":"agt_01j9z5c7d8e9f0g1h2j3k4m5n6","label":"Copywriter"},{"type":"text","text":" draft three Instagram captions for the spring launch. Keep each under 150 characters."}],"mentionedActorIds":["agt_01j9z5c7d8e9f0g1h2j3k4m5n6"],"triggeredTurnIds":["turn_01jbm2r5a7c9e1g3j5m7p9r1t3"],"turnId":null,"chainId":"chain_01jbm2r4w8y0a2c4e6g8j0m2p4","onBehalfOf":null,"resolved":null,"clientMessageId":"6f1c2a9e-4b1d-4c8a-9f2e-7d5b1a0c6e84","createdAt":"2026-10-21T09:30:00.000Z","revision":1},{"id":"msg_01jbm3s5v7x9z1b3d5f7h9k1m3","thread":{"kind":"chat","chatId":"chat_01jb4n6p8r0t2v4x6z8a0c2e4g"},"fileVersionId":null,"seq":15,"author":{"kind":"actor","actorId":"agt_01j9z5c7d8e9f0g1h2j3k4m5n6"},"parts":[{"type":"text","text":"Here are three captions for the spring launch:\n\n1. New season, new roast. Meet our Spring Blend.\n2. Bright, floral and a little bold: spring in a cup.\n3. Your mornings just got lighter. Spring Blend is here."}],"mentionedActorIds":[],"triggeredTurnIds":[],"turnId":"turn_01jbm2r5a7c9e1g3j5m7p9r1t3","chainId":"chain_01jbm2r4w8y0a2c4e6g8j0m2p4","onBehalfOf":"mbr_01j9z4a2b3c4d5e6f7g8h9j0k1","resolved":null,"clientMessageId":null,"createdAt":"2026-10-21T09:30:13.800Z","revision":1}],"included":{"files":[],"tableCards":[],"requests":[],"turns":[{"id":"turn_01jbm2r5a7c9e1g3j5m7p9r1t3","agentId":"agt_01j9z5c7d8e9f0g1h2j3k4m5n6","thread":{"kind":"chat","chatId":"chat_01jb4n6p8r0t2v4x6z8a0c2e4g"},"trigger":{"kind":"member_mention","messageId":"msg_01jbm2r4t6v8x0z2b4d6f8h0k2","flowRunId":null,"stepRunId":null},"chain":{"chainId":"chain_01jbm2r4w8y0a2c4e6g8j0m2p4","depth":1,"parentTurnId":null,"initiatorId":"mbr_01j9z4a2b3c4d5e6f7g8h9j0k1","agentPath":["agt_01j9z5c7d8e9f0g1h2j3k4m5n6"]},"status":"completed","endReason":"completed","failure":null,"attempt":1,"pendingRequestId":null,"replyMessageIds":["msg_01jbm3s5v7x9z1b3d5f7h9k1m3"],"modelAlias":"balanced","agentRevision":7,"queuedAt":"2026-10-21T09:30:00.000Z","startedAt":"2026-10-21T09:30:01.200Z","awaitingApprovalSince":null,"cancelRequestedAt":null,"endedAt":"2026-10-21T09:30:13.800Z","cancelledBy":null,"usage":{"modelAlias":"balanced","inputTokens":5120,"outputTokens":412,"reasoningTokens":0,"cachedInputTokens":3072,"totalTokens":5532,"modelCalls":2,"toolCalls":1,"durationMs":12600,"costMicros":8420},"revision":3}],"annotations":[],"unavailable":[],"records":[]},"olderCursor":"eyJzIjoxNCwiZiI6IjFjSnphU015ZjYyN3A2RFQifQ","newerCursor":null,"streamCursor":"48213"}}}},"400":{"description":"validation_failed, invalid_cursor","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"post":{"operationId":"chats.postMessage","tags":["chats"],"summary":"Post a message","description":"Posts a message in a chat: text, mentions, attachments and voice notes. Each agent it mentions gets a turn; an agent busy in the chat waits queued behind its earlier turns, so a busy agent never fails the post. The answer lists those turns, the agents the mentions added to the chat and the mentions that started no turn. A mention the author may not make fails the whole post with `403 mention_not_allowed`. A voice note still being transcribed answers `422 upload_not_ready`: send the same request again, with the same `Idempotency-Key`, a few seconds later. A failed post writes nothing.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read_write","parameters":[{"name":"chatId","in":"path","required":true,"description":"The chat's id.","schema":{"$ref":"#/components/schemas/ChatId"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"A key you choose for this request, such as a UUID. Once the request has succeeded, sending it again with the same key gets the first answer back, with nothing done twice.","schema":{"$ref":"#/components/schemas/IdempotencyKey"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostMessageBody"},"example":{"parts":[{"type":"mention","actorId":"agt_01j9z5c7d8e9f0g1h2j3k4m5n6"},{"type":"text","text":" draft three Instagram captions for the spring launch. Keep each under 150 characters."}]}}}},"responses":{"201":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostMessageResult"},"example":{"message":{"id":"msg_01jbm2r4t6v8x0z2b4d6f8h0k2","thread":{"kind":"chat","chatId":"chat_01jb4n6p8r0t2v4x6z8a0c2e4g"},"fileVersionId":null,"seq":14,"author":{"kind":"actor","actorId":"mbr_01j9z4a2b3c4d5e6f7g8h9j0k1"},"parts":[{"type":"mention","actorId":"agt_01j9z5c7d8e9f0g1h2j3k4m5n6","label":"Copywriter"},{"type":"text","text":" draft three Instagram captions for the spring launch. Keep each under 150 characters."}],"mentionedActorIds":["agt_01j9z5c7d8e9f0g1h2j3k4m5n6"],"triggeredTurnIds":["turn_01jbm2r5a7c9e1g3j5m7p9r1t3"],"turnId":null,"chainId":"chain_01jbm2r4w8y0a2c4e6g8j0m2p4","onBehalfOf":null,"resolved":null,"clientMessageId":"6f1c2a9e-4b1d-4c8a-9f2e-7d5b1a0c6e84","createdAt":"2026-10-21T09:30:00.000Z","revision":1},"turns":[{"id":"turn_01jbm2r5a7c9e1g3j5m7p9r1t3","agentId":"agt_01j9z5c7d8e9f0g1h2j3k4m5n6","thread":{"kind":"chat","chatId":"chat_01jb4n6p8r0t2v4x6z8a0c2e4g"},"trigger":{"kind":"member_mention","messageId":"msg_01jbm2r4t6v8x0z2b4d6f8h0k2","flowRunId":null,"stepRunId":null},"chain":{"chainId":"chain_01jbm2r4w8y0a2c4e6g8j0m2p4","depth":1,"parentTurnId":null,"initiatorId":"mbr_01j9z4a2b3c4d5e6f7g8h9j0k1","agentPath":["agt_01j9z5c7d8e9f0g1h2j3k4m5n6"]},"status":"queued","endReason":null,"failure":null,"attempt":0,"pendingRequestId":null,"replyMessageIds":[],"modelAlias":null,"agentRevision":null,"queuedAt":"2026-10-21T09:30:00.000Z","startedAt":null,"awaitingApprovalSince":null,"cancelRequestedAt":null,"endedAt":null,"cancelledBy":null,"usage":null,"revision":1}],"accessAdded":[],"skippedMentions":[],"included":{"files":[],"tableCards":[],"requests":[],"turns":[{"id":"turn_01jbm2r5a7c9e1g3j5m7p9r1t3","agentId":"agt_01j9z5c7d8e9f0g1h2j3k4m5n6","thread":{"kind":"chat","chatId":"chat_01jb4n6p8r0t2v4x6z8a0c2e4g"},"trigger":{"kind":"member_mention","messageId":"msg_01jbm2r4t6v8x0z2b4d6f8h0k2","flowRunId":null,"stepRunId":null},"chain":{"chainId":"chain_01jbm2r4w8y0a2c4e6g8j0m2p4","depth":1,"parentTurnId":null,"initiatorId":"mbr_01j9z4a2b3c4d5e6f7g8h9j0k1","agentPath":["agt_01j9z5c7d8e9f0g1h2j3k4m5n6"]},"status":"queued","endReason":null,"failure":null,"attempt":0,"pendingRequestId":null,"replyMessageIds":[],"modelAlias":null,"agentRevision":null,"queuedAt":"2026-10-21T09:30:00.000Z","startedAt":null,"awaitingApprovalSince":null,"cancelRequestedAt":null,"endedAt":null,"cancelledBy":null,"usage":null,"revision":1}],"annotations":[],"unavailable":[],"records":[]}}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden, mention_not_allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"idempotency_in_progress","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"422":{"description":"idempotency_key_reused, upload_not_ready","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/messages/{messageId}":{"get":{"operationId":"chats.getMessage","tags":["chats"],"summary":"Get a message","description":"Returns one message with what it references (`included`). Use it for a message opened from a link, or for an agent's reply that a finished turn lists in `replyMessageIds` but the chat stream has not delivered.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read","parameters":[{"name":"messageId","in":"path","required":true,"description":"The message's id.","schema":{"$ref":"#/components/schemas/MessageId"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetMessageResult"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/orgs/{orgId}/mention-suggestions":{"get":{"operationId":"chats.getMentionSuggestions","tags":["chats"],"summary":"List mention suggestions","description":"Returns who the caller can @mention, as the app's @ list shows it: members and agents, those already in the conversation first, then those a mention would add. Send `thread` for an existing chat or file, or `visibility` for a chat not created yet, never both; `kind=agent` lists agents only. `q` matches names, ignoring case and accents, and the start of email addresses. Each row says whether the mention is allowed and, if not, why. Returns 8 rows by default, at most 20.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read","parameters":[{"name":"orgId","in":"path","required":true,"description":"The organization's id.","schema":{"$ref":"#/components/schemas/OrganizationId"}},{"name":"q","in":"query","required":false,"description":"Text to match: names that contain it, ignoring case and accents, and email addresses that start with it.","schema":{"type":"string","maxLength":80}},{"name":"thread","in":"query","required":false,"description":"Where the mention is written: `chat:` and a chat id, or `file:` and a file id. Not with `visibility`.","schema":{"$ref":"#/components/schemas/ThreadKey"}},{"name":"visibility","in":"query","required":false,"description":"For a chat not created yet, the visibility it will have. Not with `thread`.","schema":{"$ref":"#/components/schemas/Visibility"}},{"name":"kind","in":"query","required":false,"description":"`member` or `agent` to list only that kind; left out, both.","schema":{"$ref":"#/components/schemas/MentionCandidateKind"}},{"name":"limit","in":"query","required":false,"description":"How many rows to return, 1 to 20; 8 when left out.","schema":{"type":"string","pattern":"^-?(0|[1-9][0-9]*)$"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetMentionSuggestionsResult"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/orgs/{orgId}/message-search":{"get":{"operationId":"chats.searchMessages","tags":["chats"],"summary":"Search messages","description":"Finds the messages that hold every word of `q`, in any order, newest first: in the chats shared with the caller (theirs, those they were added to and those the whole organization sees), or only in the chats `chatIds` names. A chat named that the caller may not view answers `404 not_found`; a flow run's own chat is never searched. A search that takes too long answers `503 unavailable`.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read","parameters":[{"name":"orgId","in":"path","required":true,"description":"The organization's id.","schema":{"$ref":"#/components/schemas/OrganizationId"}},{"name":"q","in":"query","required":true,"description":"The words to find, in any order: a word of two letters or digits as a whole word, a longer one as a whole word or the start of one; single letters are ignored, and so is every word after the eighth. Up to 200 characters.","schema":{"type":"string","minLength":2,"maxLength":200}},{"name":"chatIds","in":"query","required":false,"description":"Only these chats, comma-separated, 1 to 10, each one the caller may view; left out, the chats shared with the caller (theirs, those they were added to and those the organization sees).","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"description":"How many messages to return, 1 to 25; 10 when left out.","schema":{"type":"string","pattern":"^-?(0|[1-9][0-9]*)$"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchMessagesResult"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/messages/{messageId}/blocks/{blockId}/preview":{"get":{"operationId":"chats.getTableCardPreview","tags":["chats"],"summary":"Get a table card preview","description":"Returns what a table card in a message shows the caller: the table and its counts, the columns, up to 20 records with the files and linked records they show, the totals row and whether the caller may open the table. Read it again after `table.*`, `column.*` and `record.*` events on the card's table. When it answers `404 not_found`, show the card as unavailable.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read","parameters":[{"name":"messageId","in":"path","required":true,"description":"The message that holds the table card.","schema":{"$ref":"#/components/schemas/MessageId"}},{"name":"blockId","in":"path","required":true,"description":"The table card's `id`.","schema":{"$ref":"#/components/schemas/BlockId"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TableCardPreview"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/messages/{messageId}/blocks/{blockId}/answer":{"post":{"operationId":"chats.answerChoice","tags":["chats"],"summary":"Answer a choice","description":"Answers an agent's question in a table card's choice footer with one of its options (`optionKey`). The answer is posted as the caller's reply to the agent that asked, which starts a new turn for it; the result holds the updated message, the reply and those turns. Anyone who can view the chat may answer. A question already answered returns `409 state_conflict`.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read_write","parameters":[{"name":"messageId","in":"path","required":true,"description":"The message that holds the table card.","schema":{"$ref":"#/components/schemas/MessageId"}},{"name":"blockId","in":"path","required":true,"description":"The table card's `id`.","schema":{"$ref":"#/components/schemas/BlockId"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"A key you choose for this request, such as a UUID. Once the request has succeeded, sending it again with the same key gets the first answer back, with nothing done twice.","schema":{"$ref":"#/components/schemas/IdempotencyKey"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnswerChoiceBody"}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnswerChoiceResult"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"idempotency_in_progress, state_conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"422":{"description":"idempotency_key_reused","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"delete":{"operationId":"chats.undoChoice","tags":["chats"],"summary":"Undo a choice answer","description":"Takes back an answer to a choice question while the agent has not started on it: its turn may still wait queued. That turn ends and the question is open again. For whoever answered and the organization's owner and admins; API keys cannot call it. Once the agent has started, it returns `409 state_conflict`.","security":[{"session":[]}],"x-api-key-scope":"none","parameters":[{"name":"messageId","in":"path","required":true,"description":"The message that holds the table card.","schema":{"$ref":"#/components/schemas/MessageId"}},{"name":"blockId","in":"path","required":true,"description":"The table card's `id`.","schema":{"$ref":"#/components/schemas/BlockId"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UndoChoiceResult"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"state_conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/messages/{messageId}/questions/{questionId}/answer":{"post":{"operationId":"chats.answerQuestion","tags":["chats"],"summary":"Answer a question card","description":"Answers a question card: one choice per question, or a skip where the card allows it. The answer is stored on the card, and the agent that asked goes on with it; answering Link on Fleepr's own suggestion to link the chat to a record links the chat as you, when you may (see What things are about). Only the person the card names answers, or the organization's owner or an admin for them (`403 forbidden` for anyone else who can view the chat); a card of Fleepr's weekly item only the member whose Fleepr thread holds it, in the app: `403 forbidden` for the organization's owner or an admin, and for an API key, its member's own included. Each answer on it is then carried out as you (see The weekly item). A card that is no longer open (answered, superseded by a message in the chat, or closed because its agent stopped or it is no longer needed) returns `409 state_conflict`; a message that changed since you read it, `409 revision_conflict`.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read_write","parameters":[{"name":"messageId","in":"path","required":true,"description":"The message that holds the question card.","schema":{"$ref":"#/components/schemas/MessageId"}},{"name":"questionId","in":"path","required":true,"description":"The question card's `id`.","schema":{"$ref":"#/components/schemas/QuestionId"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"A key you choose for this request, such as a UUID. Once the request has succeeded, sending it again with the same key gets the first answer back, with nothing done twice.","schema":{"$ref":"#/components/schemas/IdempotencyKey"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnswerQuestionBody"}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnswerQuestionResult"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"idempotency_in_progress, revision_conflict, state_conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"422":{"description":"idempotency_key_reused","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/turns/{turnId}":{"get":{"operationId":"chats.getTurn","tags":["chats"],"summary":"Get a turn","description":"Returns one agent turn, the run behind an agent's reply, as a reply's Details show it: its status and usage, its chain, the tools it called, the request cards it raised, the skill versions it read, the memories it read and named as shaping it, as the caller may see them, and the size of each part of its input. Cost appears only for the organization's owner and admins. With `waitSeconds`, it first waits for a queued or running turn to settle, so a client waiting on a reply asks once instead of polling.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read","parameters":[{"name":"turnId","in":"path","required":true,"description":"The turn's id.","schema":{"$ref":"#/components/schemas/TurnId"}},{"name":"waitSeconds","in":"query","required":false,"description":"Waits up to this many seconds, 1 to 20, for a turn still queued or running to end or to wait on someone (a card, a question, its team), then answers it as it is then. Left out: at once.","schema":{"type":"string","pattern":"^-?(0|[1-9][0-9]*)$"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TurnDetail"},"example":{"turn":{"id":"turn_01jbm2r5a7c9e1g3j5m7p9r1t3","agentId":"agt_01j9z5c7d8e9f0g1h2j3k4m5n6","thread":{"kind":"chat","chatId":"chat_01jb4n6p8r0t2v4x6z8a0c2e4g"},"trigger":{"kind":"member_mention","messageId":"msg_01jbm2r4t6v8x0z2b4d6f8h0k2","flowRunId":null,"stepRunId":null},"chain":{"chainId":"chain_01jbm2r4w8y0a2c4e6g8j0m2p4","depth":1,"parentTurnId":null,"initiatorId":"mbr_01j9z4a2b3c4d5e6f7g8h9j0k1","agentPath":["agt_01j9z5c7d8e9f0g1h2j3k4m5n6"]},"status":"completed","endReason":"completed","failure":null,"attempt":1,"pendingRequestId":null,"replyMessageIds":["msg_01jbm3s5v7x9z1b3d5f7h9k1m3"],"modelAlias":"balanced","agentRevision":7,"queuedAt":"2026-10-21T09:30:00.000Z","startedAt":"2026-10-21T09:30:01.200Z","awaitingApprovalSince":null,"cancelRequestedAt":null,"endedAt":"2026-10-21T09:30:13.800Z","cancelledBy":null,"usage":{"modelAlias":"balanced","inputTokens":5120,"outputTokens":412,"reasoningTokens":0,"cachedInputTokens":3072,"totalTokens":5532,"modelCalls":2,"toolCalls":1,"durationMs":12600,"costMicros":8420},"revision":3},"chain":{"id":"chain_01jbm2r4w8y0a2c4e6g8j0m2p4","organizationId":"org_01j9z3k8m2q4r6t8v0w2y4a6c8","origin":{"kind":"message","messageId":"msg_01jbm2r4t6v8x0z2b4d6f8h0k2","thread":{"kind":"chat","chatId":"chat_01jb4n6p8r0t2v4x6z8a0c2e4g"}},"initiatorId":"mbr_01j9z4a2b3c4d5e6f7g8h9j0k1","agentPath":["agt_01j9z5c7d8e9f0g1h2j3k4m5n6"],"parentChainId":null,"rootChainId":"chain_01jbm2r4w8y0a2c4e6g8j0m2p4","lineageFlowIds":[],"status":"completed","stopReason":null,"limits":{"maxDepth":3,"maxTurns":10,"budgetMicros":2000000},"turnCount":1,"maxDepthReached":1,"costMicros":8420,"createdAt":"2026-10-21T09:30:00.000Z","endedAt":"2026-10-21T09:30:13.800Z","revision":2},"activities":[{"id":"tact_01jbm2tb3d5f7h9k1m3p5r7t9v","turnId":"turn_01jbm2r5a7c9e1g3j5m7p9r1t3","attempt":1,"index":1,"tool":{"name":"record_query","version":"1","displayName":"Reading records","source":"native","risk":"read"},"phase":"succeeded","requestId":null,"targets":[{"type":"table","id":"tbl_01j9z6a8c0e2g4j6m8p0r2t4v6"}],"summary":"Read 12 records","failureCode":null,"startedAt":"2026-10-21T09:30:04.100Z","endedAt":"2026-10-21T09:30:04.600Z"}],"requests":[],"skillVersionsRead":[{"skillId":"skill_01j9z7b9d1f3h5k7n9q1s3v5x7","skillVersionId":"skv_01j9z7c0e2g4j6m8p0r2t4w6y8","number":3}],"memories":{"applied":[],"read":[]},"health":[],"contextSizes":{"total":23020,"system":4210,"instructions":1180,"skills":240,"history":6420,"tools":9800}}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/turns/{turnId}/draft":{"get":{"operationId":"chats.getTurnDraft","tags":["chats"],"summary":"Get a turn's draft","description":"Returns what an agent has written so far in a running turn: the text, blocks, tool activity and stage of its current reply. Use it when a client missed part of a reply on the chat stream. A turn that is not running answers `404 not_found`.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read","parameters":[{"name":"turnId","in":"path","required":true,"description":"The turn's id.","schema":{"$ref":"#/components/schemas/TurnId"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TurnDraft"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/turns/{turnId}/cancel":{"post":{"operationId":"chats.cancelTurn","tags":["chats"],"summary":"Cancel a turn","description":"Stops an agent turn. A queued or paused turn (waiting for approval, or for the agents it asked) is cancelled at once; a running one gets `cancelRequestedAt` and ends shortly after, which the chat stream reports. Cancelling a turn that waits for its agents also cancels their open turns. For the person who started the chain and the members with manage access on the chat (its owner and the organization's owner and admins); an API key cancels as its member would. To stop a whole flow run, use `POST /v0/flow-runs/{flowRunId}/cancel`.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read_write","parameters":[{"name":"turnId","in":"path","required":true,"description":"The turn's id.","schema":{"$ref":"#/components/schemas/TurnId"}}],"responses":{"202":{"description":"Accepted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CancelTurnResult"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"state_conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/turns/{turnId}/tool-results":{"post":{"operationId":"chats.deliverToolResult","tags":["chats"],"summary":"Deliver a tool result","description":"Delivers the result of an agent's tool call that an outside MCP server finished later: the same agent gets a new turn in the same thread, for the same person, and replies in its own name. `turnId` is the turn that made the call (its `requestedFrom.turnId`). In a chat, upload each file for that chat (`POST /v0/orgs/{orgId}/uploads` with `thread`), complete it and name it in `fileIds`, posting nothing: the agent attaches it as if you had posted it. In a file's comments, post each file there first: the agent names it. For a member who may edit the MCP server's connection and view the thread, or their read and write API key. `404 not_found` for a turn you may not see, or a file neither attached in the thread nor, in a chat, your completed upload for it. `403 forbidden` for a read-only key, a file you may not share, or no call of that tool on a connection you may edit. `409 state_conflict` (`details.currentStatus`) when that call did not succeed or ended over 24 hours ago (`expired`), the turn took 3 results (`limit_reached`), it replies in no thread (`no_thread`), its agent is not active (`agent_inactive`), or agents are paused (`agents_paused`). A refused delivery writes nothing.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read_write","parameters":[{"name":"turnId","in":"path","required":true,"description":"The turn's id.","schema":{"$ref":"#/components/schemas/TurnId"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"A key you choose for this request, such as a UUID. Once the request has succeeded, sending it again with the same key gets the first answer back, with nothing done twice.","schema":{"$ref":"#/components/schemas/IdempotencyKey"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeliverToolResultBody"},"example":{"toolName":"create_avatar_video","text":"The video is ready: 42 seconds, 1080p, with the spring launch script.","fileIds":["file_01jbq2w4y6a8c0e2g4j6m8p0r2"]}}}},"responses":{"202":{"description":"Accepted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeliverToolResultResult"},"example":{"toolResult":{"id":"tres_01jbq3a5c7e9g1j3m5p7r9t1v3","sourceTurnId":"turn_01jbm2r5a7c9e1g3j5m7p9r1t3","turnId":"turn_01jbq3a5d8f0h2k4n6q8s0v2x4","chainId":"chain_01jbq3a5e9g1j3m5p7r9t1v3x5","toolName":"create_avatar_video","fileIds":["file_01jbq2w4y6a8c0e2g4j6m8p0r2"],"createdAt":"2026-10-21T09:41:12.000Z"}}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"idempotency_in_progress, state_conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"422":{"description":"idempotency_key_reused","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/chains/{chainId}":{"get":{"operationId":"chats.getChain","tags":["chats"],"summary":"Get a chain","description":"Returns an agent chain: the turns started by one person's message, the agents it mentioned and every agent they called in turn. It holds the chain status, why it stopped, its limits and its turns in queue order, so a client can show who called whom. For whoever can view the chat or file thread it started in; a flow run's chain answers `404 not_found`. Cost appears only for the organization's owner and admins.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read","parameters":[{"name":"chainId","in":"path","required":true,"description":"The chain's id.","schema":{"$ref":"#/components/schemas/ChainId"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChainDetail"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/chats/{chatId}/knowledge":{"get":{"operationId":"chats.knowledge","tags":["chats"],"summary":"Get what a chat's agents know","description":"Returns what the chat's agents read before every turn: the organization's memories, those of the records the chat is about, of their tables and the tables shared in it with the tables' profiles, each agent's own, the open Health issues, the targets about its records and the docs they point to; only memories every reader of the chat may see load. It also lists the caller's memories in the chat's scopes that do not load, with why, and counts the caller's memories that load in other chats and the suggestions waiting. Only memories the caller may see are listed or counted.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read","parameters":[{"name":"chatId","in":"path","required":true,"description":"The chat's id.","schema":{"$ref":"#/components/schemas/ChatId"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatKnowledge"},"example":{"chatId":"chat_01jb4d6f8h0k2m4p6r8t0v2x4z","loaded":{"org":[{"id":"mem_01jb8m0p2r4t6v8x0z2b4d6f8h","text":"Write dates as 12 March 2026.","subject":{"scope":"org"},"type":"rule","pinned":false}],"records":[{"tableId":"tbl_01jb3f5h7k9m1p3r5t7v9x1z3b","recordId":"rec_01jb5h7k9m1p3r5t7v9x1z3b5d","label":"Northwind Coffee","tableName":"Clients","memories":[{"id":"mem_01jb9p1r3t5v7x9z1b3d5f7h9k","text":"Northwind never wants yellow in its visuals.","subject":{"scope":"record","tableId":"tbl_01jb3f5h7k9m1p3r5t7v9x1z3b","recordId":"rec_01jb5h7k9m1p3r5t7v9x1z3b5d","label":"Northwind Coffee","tableName":"Clients"},"type":"rule","pinned":true}]}],"tables":[{"tableId":"tbl_01jb3f5h7k9m1p3r5t7v9x1z3b","name":"Clients","reasons":["record_table"],"profile":{"about":"The brands the agency works for.","aliases":["Brands"]},"memories":[]}],"agents":[{"agentId":"agt_01jb5k7m9p1r3t5v7x9z1b3d5f","name":"Quill","memories":[]}],"health":[],"targets":[{"targetId":"tgt_01jbat3v5x7z9b1d3f5h7k9m1p","line":"Approved deliverables for Northwind Coffee: 12 of 20 this month, behind"}],"docs":[]},"notLoaded":[],"elsewhere":{"otherRecords":4,"otherAgents":1},"suggestionsWaiting":2}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/orgs/{orgId}/requests":{"get":{"operationId":"requests.listRequests","tags":["requests"],"summary":"List requests","description":"Lists the request cards the caller can see, newest first: those in the chats, files and flow runs they may view, and those they may decide. Only pending cards by default; filter by `status`, `kind`, `chatId` or `flowRunId`, and keep only the cards the caller may decide with `decidableByMe=true`. A page may hold fewer cards than `limit` while more follow: keep reading until `nextCursor` is `null`.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read","parameters":[{"name":"orgId","in":"path","required":true,"description":"The organization's id.","schema":{"$ref":"#/components/schemas/OrganizationId"}},{"name":"status","in":"query","required":false,"description":"Only the cards with these statuses, comma-separated; left out, pending cards only.","schema":{"type":"string"}},{"name":"kind","in":"query","required":false,"description":"Only the cards of these kinds, comma-separated; left out, every kind.","schema":{"type":"string"}},{"name":"decidableByMe","in":"query","required":false,"description":"`true` keeps only the cards the caller may decide now.","schema":{"type":"string","pattern":"^(true|false)$"}},{"name":"chatId","in":"query","required":false,"description":"Only the cards raised in this chat.","schema":{"$ref":"#/components/schemas/ChatId"}},{"name":"flowRunId","in":"query","required":false,"description":"Only the cards raised in this flow run.","schema":{"$ref":"#/components/schemas/FlowRunId"}},{"name":"cursor","in":"query","required":false,"description":"Where to continue: the `nextCursor` of the page before. Left out, the list starts at its beginning.","schema":{"$ref":"#/components/schemas/Cursor"}},{"name":"limit","in":"query","required":false,"description":"How many items to return, 1 to 200; 50 when left out.","schema":{"type":"string","pattern":"^-?(0|[1-9][0-9]*)$"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/ActionRequest"},"description":"This page of the list."},"nextCursor":{"anyOf":[{"$ref":"#/components/schemas/Cursor"},{"type":"null"}],"description":"Send it back as `cursor` to read the next page; null on the last page."}},"required":["items","nextCursor"]},"example":{"items":[{"id":"req_01jbp4s6v8x0z2b4d6f8h0k2q4","number":418,"organizationId":"org_01jb2m4n6p8q0r2s4t6v8w0x2y","thread":{"kind":"chat","chatId":"chat_01jbq5t7w9y1a3c5e7g9j1m3r5"},"flowRunId":null,"messageId":"msg_01jbr6v8x0z2b4d6f8h0k2n4s6","turnId":"turn_01jbs7w9y1a3c5e7g9j1m3p5t7","chainId":"chain_01jbt8x0z2b4d6f8h0k2n4q6v8","agentId":"agt_01jb6n8q0s2v4x6z8b0d2f4h6k","onBehalfOf":"mbr_01jb4d6f8h0k2m4p6r8t0w2y4a","tool":{"name":"table_create","version":"1","displayName":"Creating a table","source":"native","risk":"reversible"},"argumentsHash":"7c3e9a1f5b8d2e6a4c0f9b3d7e1a5c8f2b6d0e4a9c3f7b1d5e8a2c6f0b4d9e3a","title":"Create table \"Influencer outreach\"","question":null,"approveLabel":"Allow","declineLabel":"Deny","reason":null,"preview":{"kind":"table_create","name":"Influencer outreach","about":"Creators we contact for the spring launch, with their audience and where each one stands.","visibility":"organization","columns":[{"name":"Creator","type":"text","options":null,"targetTableId":null,"targetTableName":null,"multiple":false},{"name":"Followers","type":"number","options":null,"targetTableId":null,"targetTableName":null,"multiple":false},{"name":"Status","type":"select","options":["To contact","Contacted","Agreed","Declined"],"targetTableId":null,"targetTableName":null,"multiple":false}],"sampleRows":[]},"targets":[],"kind":"create","subject":null,"fields":[],"answers":["deny","allow_once","allow"],"deciders":{"initiator":true,"ownerOf":null,"admins":true,"members":[]},"deciderIds":["mbr_01jb4d6f8h0k2m4p6r8t0w2y4a","mbr_01jb3a5c7e9g1j3k5m7p9r1t3v"],"moreDeciders":0,"grantsEditTo":["agt_01jb6n8q0s2v4x6z8b0d2f4h6k"],"refreshedAt":null,"status":"pending","decision":null,"execution":null,"closure":null,"viewer":{"canDecide":true,"canApprove":true,"canUndo":false,"cannotDecideReason":null},"createdAt":"2026-10-22T14:05:00.000Z","expiresAt":"2026-10-23T14:05:00.000Z","updatedAt":"2026-10-22T14:05:00.000Z","revision":1}],"nextCursor":null}}}},"400":{"description":"validation_failed, invalid_cursor","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/requests/{requestId}":{"get":{"operationId":"requests.getRequest","tags":["requests"],"summary":"Get a request","description":"Returns one request card, an agent's ask for approval before it acts, as links and notifications open it. Its `viewer` says whether the caller may decide it, allow it or undo a decline. A decider who cannot view the chat the card was raised in gets it without the agent's reason and question and, on a card that shows the agent's arguments, without them: they may only deny it (`canApprove` `false`).","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read","parameters":[{"name":"requestId","in":"path","required":true,"description":"The request's id.","schema":{"$ref":"#/components/schemas/ActionRequestId"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ActionRequest"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/requests/{requestId}/approve":{"post":{"operationId":"requests.approve","tags":["requests"],"summary":"Approve a request","description":"Allows the action an agent asked for, with `answer` `allow` or `allow_once` (when the card offers it). Send the `argumentsHash` and `expectedRevision` the card was shown with: changed arguments answer `409 arguments_mismatch`, and an expired card `409 state_conflict`. The card comes back `approved`, and the agent runs the action afterwards. A retry with the same `Idempotency-Key` gets the same answer, and any other approval of a decided card `409 state_conflict`, so the action runs once. Only the card's deciders may approve. An API key approves only the kinds of card ticked on it, as its member's own right, never an `edit_access` card and never `allow` where Allow gives an agent access; otherwise it gets `403 forbidden` with the reason in `details`. A decider who cannot view the chat may only deny a card whose preview carries the agent's arguments: `403 forbidden`, reason `arguments_hidden`.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read_write","parameters":[{"name":"requestId","in":"path","required":true,"description":"The request's id.","schema":{"$ref":"#/components/schemas/ActionRequestId"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"A key you choose for this request, such as a UUID. Once the request has succeeded, sending it again with the same key gets the first answer back, with nothing done twice.","schema":{"$ref":"#/components/schemas/IdempotencyKey"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApproveRequestBody"},"example":{"argumentsHash":"7c3e9a1f5b8d2e6a4c0f9b3d7e1a5c8f2b6d0e4a9c3f7b1d5e8a2c6f0b4d9e3a","answer":"allow","expectedRevision":1}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ActionRequest"},"example":{"id":"req_01jbp4s6v8x0z2b4d6f8h0k2q4","number":418,"organizationId":"org_01jb2m4n6p8q0r2s4t6v8w0x2y","thread":{"kind":"chat","chatId":"chat_01jbq5t7w9y1a3c5e7g9j1m3r5"},"flowRunId":null,"messageId":"msg_01jbr6v8x0z2b4d6f8h0k2n4s6","turnId":"turn_01jbs7w9y1a3c5e7g9j1m3p5t7","chainId":"chain_01jbt8x0z2b4d6f8h0k2n4q6v8","agentId":"agt_01jb6n8q0s2v4x6z8b0d2f4h6k","onBehalfOf":"mbr_01jb4d6f8h0k2m4p6r8t0w2y4a","tool":{"name":"table_create","version":"1","displayName":"Creating a table","source":"native","risk":"reversible"},"argumentsHash":"7c3e9a1f5b8d2e6a4c0f9b3d7e1a5c8f2b6d0e4a9c3f7b1d5e8a2c6f0b4d9e3a","title":"Create table \"Influencer outreach\"","question":null,"approveLabel":"Allow","declineLabel":"Deny","reason":null,"preview":{"kind":"table_create","name":"Influencer outreach","about":"Creators we contact for the spring launch, with their audience and where each one stands.","visibility":"organization","columns":[{"name":"Creator","type":"text","options":null,"targetTableId":null,"targetTableName":null,"multiple":false},{"name":"Followers","type":"number","options":null,"targetTableId":null,"targetTableName":null,"multiple":false},{"name":"Status","type":"select","options":["To contact","Contacted","Agreed","Declined"],"targetTableId":null,"targetTableName":null,"multiple":false}],"sampleRows":[]},"targets":[],"kind":"create","subject":null,"fields":[],"answers":["deny","allow_once","allow"],"deciders":{"initiator":true,"ownerOf":null,"admins":true,"members":[]},"deciderIds":["mbr_01jb4d6f8h0k2m4p6r8t0w2y4a","mbr_01jb3a5c7e9g1j3k5m7p9r1t3v"],"moreDeciders":0,"grantsEditTo":["agt_01jb6n8q0s2v4x6z8b0d2f4h6k"],"refreshedAt":null,"status":"approved","decision":{"outcome":"approved","answer":"allow","decidedBy":"mbr_01jb4d6f8h0k2m4p6r8t0w2y4a","decidedAt":"2026-10-22T14:07:30.000Z","reason":null,"via":"app","apiKey":null,"undoUntil":null},"execution":null,"closure":null,"viewer":{"canDecide":false,"canApprove":false,"canUndo":false,"cannotDecideReason":null},"createdAt":"2026-10-22T14:05:00.000Z","expiresAt":"2026-10-23T14:05:00.000Z","updatedAt":"2026-10-22T14:07:30.000Z","revision":2}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"idempotency_in_progress, arguments_mismatch, revision_conflict, state_conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"422":{"description":"idempotency_key_reused","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/requests/{requestId}/decline":{"post":{"operationId":"requests.decline","tags":["requests"],"summary":"Decline a request","description":"Denies the action an agent asked for, with an optional `reason` for the agent (up to 500 characters). The decline can be undone until `decision.undoUntil`, 10 seconds by default, while the agent still waits; the agent is told only once that window closes. Only the card's deciders may decline. An API key declines only the kinds of card ticked on it, as its member's own right, never an `edit_access` card, and must send the card's `argumentsHash`.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read_write","parameters":[{"name":"requestId","in":"path","required":true,"description":"The request's id.","schema":{"$ref":"#/components/schemas/ActionRequestId"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"A key you choose for this request, such as a UUID. Once the request has succeeded, sending it again with the same key gets the first answer back, with nothing done twice.","schema":{"$ref":"#/components/schemas/IdempotencyKey"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeclineRequestBody"}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ActionRequest"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"idempotency_in_progress, arguments_mismatch, revision_conflict, state_conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"422":{"description":"idempotency_key_reused","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/requests/{requestId}/undo-decline":{"post":{"operationId":"requests.undoDecline","tags":["requests"],"summary":"Undo a decline","description":"Takes back a decline before `decision.undoUntil`, while the agent's turn still waits on the card, so the card is pending again and can still be approved or declined. Any of the card's deciders may undo it; API keys cannot call it.","security":[{"session":[]}],"x-api-key-scope":"none","parameters":[{"name":"requestId","in":"path","required":true,"description":"The request's id.","schema":{"$ref":"#/components/schemas/ActionRequestId"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UndoDeclineRequestBody"}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ActionRequest"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"revision_conflict, state_conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/chats/{chatId}/tool-grants":{"get":{"operationId":"requests.listToolGrants","tags":["requests"],"summary":"List a chat's allowed tools","description":"Returns the tools a member allowed in this chat: every agent of the chat runs each of them here again without asking, whatever its arguments, while the grant stands. A tool whose version changed asks again. Any reader of the chat may list them; each grant's `viewer.canRevoke` says whether the caller may revoke it.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read","parameters":[{"name":"chatId","in":"path","required":true,"description":"The chat's id.","schema":{"$ref":"#/components/schemas/ChatId"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolGrantList"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/chats/{chatId}/tool-grants/{grantId}":{"delete":{"operationId":"requests.revokeToolGrant","tags":["requests"],"summary":"Revoke an allowed tool","description":"Takes back a tool allowed in this chat: the chat's agents ask a card for it again. Only the member who allowed it and the organization's owner and admins may revoke it (`403 forbidden` otherwise); API keys cannot call it. Revoking a grant that is gone answers `404 not_found`.","security":[{"session":[]}],"x-api-key-scope":"none","parameters":[{"name":"chatId","in":"path","required":true,"description":"The chat's id.","schema":{"$ref":"#/components/schemas/ChatId"}},{"name":"grantId","in":"path","required":true,"description":"The grant's id.","schema":{"$ref":"#/components/schemas/ToolGrantId"}}],"responses":{"204":{"description":"Done. The answer has no body."},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/orgs/{orgId}/tables":{"get":{"operationId":"tables.listTables","tags":["tables"],"summary":"List tables","description":"Lists the tables the caller can view in an organization, with `totalCount` across every page. Search names with `q` (case and accents are ignored), keep the caller's own tables or other members' with `owner` (`me` or `others`), and order them with `sort`: `name_asc` (the default), `name_desc`, `newest` or `oldest`. Send `facets=true` to get counts for each `owner` option on the first page. Each table comes with a preview of its first 3 columns and 3 records.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read","parameters":[{"name":"orgId","in":"path","required":true,"description":"The organization's id.","schema":{"$ref":"#/components/schemas/OrganizationId"}},{"name":"q","in":"query","required":false,"description":"Text to find in table names, ignoring case and accents, up to 200 characters.","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"owner","in":"query","required":false,"description":"`me`: only the tables the caller owns; `others`: only those other members own. Left out: every table the caller can view.","schema":{"$ref":"#/components/schemas/TableListOwner"}},{"name":"sort","in":"query","required":false,"description":"The order: `name_asc` (the default) or `name_desc` by name, ignoring case and accents, or `newest` or `oldest` by creation time.","schema":{"$ref":"#/components/schemas/TableListSort"}},{"name":"facets","in":"query","required":false,"description":"Set to `true` to get `facets`, the counts for each `owner` option; ignored with a `cursor`.","schema":{"type":"string","pattern":"^(true|false)$"}},{"name":"cursor","in":"query","required":false,"description":"Where to continue: the `nextCursor` of the page before. Left out, the list starts at its beginning.","schema":{"$ref":"#/components/schemas/Cursor"}},{"name":"limit","in":"query","required":false,"description":"How many items to return, 1 to 200; 50 when left out.","schema":{"type":"string","pattern":"^-?(0|[1-9][0-9]*)$"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TableSummaryPage"},"example":{"items":[{"id":"tbl_01jbq5a2c4e6g8j0m2p4r6t8vx","organizationId":"org_01jbq4m8x2c6v9t3r7k5n1p0hd","name":"Influencer outreach","about":"Creators we pitch for the Northwind Coffee spring launch: reach, status and the next follow-up.","recordCount":48,"columnCount":6,"visibility":"organization","ownerId":"mbr_01jbq4n2d8f5h3k7m9p1r4t6vw","createdBy":"mbr_01jbq4n2d8f5h3k7m9p1r4t6vw","createdAt":"2026-10-05T08:15:00.000Z","updatedAt":"2026-10-21T09:30:00.000Z","revision":61,"updatedBy":"mbr_01jbq4p6g2j8m4q0s6w2y8c4ea","preview":{"columns":[{"tableId":"tbl_01jbq5a2c4e6g8j0m2p4r6t8vx","readOnly":false,"id":"col_01jbq5b3d5f7h9k1m3p5r7t9wy","name":"Name","position":"a0","revision":1,"type":"text"},{"tableId":"tbl_01jbq5a2c4e6g8j0m2p4r6t8vx","readOnly":false,"id":"col_01jbq5b4e6g8j0m2q4s6v8x0za","name":"Profile","position":"a1","revision":1,"type":"url"},{"tableId":"tbl_01jbq5a2c4e6g8j0m2p4r6t8vx","readOnly":false,"id":"col_01jbq5b5f7h9k1n3q5s7v9x1zb","name":"Status","position":"a2","revision":3,"type":"select","options":[{"id":"opt_01jbq5c1d3f5h7k9m1p3r5t7vx","label":"Contacted","tone":"neutral"},{"id":"opt_01jbq5c2e4g6j8m0q2s4w6y8az","label":"Negotiating","tone":"warn"},{"id":"opt_01jbq5c3f5h7k9n1q3s5v7x9zb","label":"Signed","tone":"live"}]}],"records":[{"id":"rec_01jbq6d1e3g5j7m9p1r3t5w7y9","tableId":"tbl_01jbq5a2c4e6g8j0m2p4r6t8vx","position":"a0","values":{"col_01jbq5b3d5f7h9k1m3p5r7t9wy":"Lena Brooks","col_01jbq5b4e6g8j0m2q4s6v8x0za":"https://creators.example.com/lena-brooks","col_01jbq5b5f7h9k1n3q5s7v9x1zb":"opt_01jbq5c2e4g6j8m0q2s4w6y8az","col_01jbq5b6g8j0m2p4r6t8w0y2ac":184000,"col_01jbq5b7h9k1n3q5s7v9x1z3bd":["rec_01jbq2w8y0a2c4e6g8j0m2p4r6"],"col_01jbq5b8j0m2p4r6t8w0y2a4ce":"2026-10-24"},"label":"Lena Brooks","createdAt":"2026-10-06T10:12:00.000Z","createdBy":"agt_01jbq4r3t9w5y1a7c3e9g5j1kb","updatedAt":"2026-10-20T15:47:00.000Z","updatedBy":"mbr_01jbq4p6g2j8m4q0s6w2y8c4ea","revision":4,"submission":null},{"id":"rec_01jbq6d2f4h6k8n0q2s4v6x8z0","tableId":"tbl_01jbq5a2c4e6g8j0m2p4r6t8vx","position":"a1","values":{"col_01jbq5b3d5f7h9k1m3p5r7t9wy":"Sam Okafor","col_01jbq5b4e6g8j0m2q4s6v8x0za":"https://creators.example.com/sam-okafor","col_01jbq5b5f7h9k1n3q5s7v9x1zb":"opt_01jbq5c2e4g6j8m0q2s4w6y8az","col_01jbq5b6g8j0m2p4r6t8w0y2ac":92500,"col_01jbq5b7h9k1n3q5s7v9x1z3bd":["rec_01jbq2w8y0a2c4e6g8j0m2p4r6"],"col_01jbq5b8j0m2p4r6t8w0y2a4ce":"2026-10-27"},"label":"Sam Okafor","createdAt":"2026-10-06T10:12:00.000Z","createdBy":"agt_01jbq4r3t9w5y1a7c3e9g5j1kb","updatedAt":"2026-10-21T08:05:00.000Z","updatedBy":"mbr_01jbq4p6g2j8m4q0s6w2y8c4ea","revision":3,"submission":null},{"id":"rec_01jbq6d3g5j7m9p1r3t5w7y9b1","tableId":"tbl_01jbq5a2c4e6g8j0m2p4r6t8vx","position":"a2","values":{"col_01jbq5b3d5f7h9k1m3p5r7t9wy":"Priya Nair","col_01jbq5b4e6g8j0m2q4s6v8x0za":"https://creators.example.com/priya-nair","col_01jbq5b5f7h9k1n3q5s7v9x1zb":"opt_01jbq5c1d3f5h7k9m1p3r5t7vx","col_01jbq5b6g8j0m2p4r6t8w0y2ac":61200,"col_01jbq5b7h9k1n3q5s7v9x1z3bd":[],"col_01jbq5b8j0m2p4r6t8w0y2a4ce":null},"label":"Priya Nair","createdAt":"2026-10-07T13:40:00.000Z","createdBy":"mbr_01jbq4p6g2j8m4q0s6w2y8c4ea","updatedAt":"2026-10-07T13:40:00.000Z","updatedBy":"mbr_01jbq4p6g2j8m4q0s6w2y8c4ea","revision":1,"submission":null}],"included":{"linkedRecords":[],"files":[]}},"myAccess":{"level":"manage","actions":["view","edit","edit_columns","share","change_visibility","delete","export","transfer_ownership","respond"]}}],"nextCursor":null,"totalCount":1,"facets":{"all":9,"owner":{"me":1,"others":8}}}}}},"400":{"description":"validation_failed, invalid_cursor","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"post":{"operationId":"tables.createTable","tags":["tables"],"summary":"Create a table","description":"Creates a table owned by the caller, with one text column whose text labels each record, and the `columns` given after it. Every field is optional: without a `name` the table is untitled. The table is visible to the whole organization unless `visibility` is `private`: members can view it, and only its owner, admins and the members given edit access can change it. Any member except viewers can create tables. An organization keeps at most 1,000 tables (`409 state_conflict`, `currentStatus` `full`), and a person creates, shares or hands over tables at most 60 times in 10 minutes (`429 rate_limited`).","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read_write","parameters":[{"name":"orgId","in":"path","required":true,"description":"The organization's id.","schema":{"$ref":"#/components/schemas/OrganizationId"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"A key you choose for this request, such as a UUID. Once the request has succeeded, sending it again with the same key gets the first answer back, with nothing done twice.","schema":{"$ref":"#/components/schemas/IdempotencyKey"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTableBody"}}}},"responses":{"201":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Table"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"idempotency_in_progress, state_conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"422":{"description":"idempotency_key_reused","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/tables/{tableId}":{"get":{"operationId":"tables.getTable","tags":["tables"],"summary":"Get a table","description":"Returns a table with its columns in order, the tables its link columns point at, the tables that link to it (only those the caller can view), a summary of who has access, and the caller's own access in `myAccess`, which says what they may do. A table the caller cannot view answers `404 not_found`.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read","parameters":[{"name":"tableId","in":"path","required":true,"description":"The table's id.","schema":{"$ref":"#/components/schemas/TableId"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Table"},"example":{"id":"tbl_01jbq5a2c4e6g8j0m2p4r6t8vx","organizationId":"org_01jbq4m8x2c6v9t3r7k5n1p0hd","name":"Influencer outreach","about":"Creators we pitch for the Northwind Coffee spring launch: reach, status and the next follow-up.","recordCount":48,"columnCount":6,"visibility":"organization","ownerId":"mbr_01jbq4n2d8f5h3k7m9p1r4t6vw","createdBy":"mbr_01jbq4n2d8f5h3k7m9p1r4t6vw","createdAt":"2026-10-05T08:15:00.000Z","updatedAt":"2026-10-21T09:30:00.000Z","revision":61,"updatedBy":"mbr_01jbq4p6g2j8m4q0s6w2y8c4ea","sizeBytes":22528,"primaryColumnId":"col_01jbq5b3d5f7h9k1m3p5r7t9wy","columns":[{"tableId":"tbl_01jbq5a2c4e6g8j0m2p4r6t8vx","readOnly":false,"id":"col_01jbq5b3d5f7h9k1m3p5r7t9wy","name":"Name","position":"a0","revision":1,"type":"text"},{"tableId":"tbl_01jbq5a2c4e6g8j0m2p4r6t8vx","readOnly":false,"id":"col_01jbq5b4e6g8j0m2q4s6v8x0za","name":"Profile","position":"a1","revision":1,"type":"url"},{"tableId":"tbl_01jbq5a2c4e6g8j0m2p4r6t8vx","readOnly":false,"id":"col_01jbq5b5f7h9k1n3q5s7v9x1zb","name":"Status","position":"a2","revision":3,"type":"select","options":[{"id":"opt_01jbq5c1d3f5h7k9m1p3r5t7vx","label":"Contacted","tone":"neutral"},{"id":"opt_01jbq5c2e4g6j8m0q2s4w6y8az","label":"Negotiating","tone":"warn"},{"id":"opt_01jbq5c3f5h7k9n1q3s5v7x9zb","label":"Signed","tone":"live"}]},{"tableId":"tbl_01jbq5a2c4e6g8j0m2p4r6t8vx","readOnly":false,"id":"col_01jbq5b6g8j0m2p4r6t8w0y2ac","name":"Followers","position":"a3","revision":2,"type":"number","decimals":0,"format":"plain","currency":null},{"tableId":"tbl_01jbq5a2c4e6g8j0m2p4r6t8vx","readOnly":false,"id":"col_01jbq5b7h9k1n3q5s7v9x1z3bd","name":"Campaign","position":"a4","revision":1,"type":"linked_record","targetTableId":"tbl_01jbq3z7x5v3t1r9p7m5k3h1fd","multiple":false},{"tableId":"tbl_01jbq5a2c4e6g8j0m2p4r6t8vx","readOnly":false,"id":"col_01jbq5b8j0m2p4r6t8w0y2a4ce","name":"Next follow-up","position":"a5","revision":1,"type":"date","includeTime":false}],"linksOut":[{"columnId":"col_01jbq5b7h9k1n3q5s7v9x1z3bd","tableId":"tbl_01jbq3z7x5v3t1r9p7m5k3h1fd","tableName":"Campaigns"}],"linksIn":[],"sourceChatId":null,"accessSummary":{"people":2,"agents":1,"invited":0,"sampleActorIds":["mbr_01jbq4n2d8f5h3k7m9p1r4t6vw","mbr_01jbq4p6g2j8m4q0s6w2y8c4ea","agt_01jbq4r3t9w5y1a7c3e9g5j1kb"]},"myAccess":{"level":"manage","actions":["view","edit","edit_columns","share","change_visibility","delete","export","transfer_ownership","respond"]}}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"patch":{"operationId":"tables.updateTable","tags":["tables"],"summary":"Update a table","description":"Renames a table or changes its description (up to 2,000 characters). Send only the fields that change, with the `expectedRevision` you read; if the table changed since, the answer is `409 revision_conflict`. Adding or deleting records also changes the revision: on a conflict, read the table again and retry. Needs edit access to the table.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read_write","parameters":[{"name":"tableId","in":"path","required":true,"description":"The table's id.","schema":{"$ref":"#/components/schemas/TableId"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateTableBody"}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Table"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"revision_conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"delete":{"operationId":"tables.deleteTable","tags":["tables"],"summary":"Delete a table","description":"Deletes a table. Only the table's owner and the organization's owner and admins may delete it, never a viewer, even one who owns it.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read_write","parameters":[{"name":"tableId","in":"path","required":true,"description":"The table's id.","schema":{"$ref":"#/components/schemas/TableId"}}],"responses":{"204":{"description":"Done. The answer has no body."},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/tables/{tableId}/columns":{"post":{"operationId":"tables.addColumn","tags":["tables"],"summary":"Create a column","description":"Adds a column to a table: a name, a type and that type's settings (settings left out take their defaults). It goes after the last column unless a `position` is sent. Any type may be added, the read-only system columns (created and last edited time and person) included. Needs edit access to the table.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read_write","parameters":[{"name":"tableId","in":"path","required":true,"description":"The table's id.","schema":{"$ref":"#/components/schemas/TableId"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"A key you choose for this request, such as a UUID. Once the request has succeeded, sending it again with the same key gets the first answer back, with nothing done twice.","schema":{"$ref":"#/components/schemas/IdempotencyKey"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ColumnInput"}}}},"responses":{"201":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Column"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"idempotency_in_progress","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"422":{"description":"idempotency_key_reused","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/columns/{columnId}":{"patch":{"operationId":"tables.updateColumn","tags":["tables"],"summary":"Update a column","description":"Renames or moves a column, or changes its settings within its type: select options, number format, whether a date includes a time, and a link column's target table and whether it holds several records. To change the type, use `POST /v0/columns/{columnId}/change-type`. Select options are sent as the full list: options left out are removed. Needs edit access to the table.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read_write","parameters":[{"name":"columnId","in":"path","required":true,"description":"The column's id.","schema":{"$ref":"#/components/schemas/ColumnId"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateColumnBody"}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Column"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"revision_conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"delete":{"operationId":"tables.deleteColumn","tags":["tables"],"summary":"Delete a column","description":"Deletes a column and every cell in it. Needs edit access to the table. The primary column, whose text labels the records, cannot be deleted: `409 protected_object`.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read_write","parameters":[{"name":"columnId","in":"path","required":true,"description":"The column's id.","schema":{"$ref":"#/components/schemas/ColumnId"}}],"responses":{"204":{"description":"Done. The answer has no body."},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"protected_object","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/columns/{columnId}/change-type":{"post":{"operationId":"tables.changeColumnType","tags":["tables"],"summary":"Change a column type","description":"Changes a column to another type and converts its values. Send `dryRun: true` first: the answer reports how many values convert, would be cleared or would fail, with up to 10 samples, and nothing is written. With `onIncompatible: 'reject'` a value that does not convert fails the change with `409 column_conversion_failed`; with `'clear'` it is emptied. Needs edit access to the table. The primary column keeps its type: `409 protected_object`.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read_write","parameters":[{"name":"columnId","in":"path","required":true,"description":"The column's id.","schema":{"$ref":"#/components/schemas/ColumnId"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChangeColumnTypeBody"}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChangeColumnTypeResult"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"revision_conflict, column_conversion_failed, protected_object","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/tables/{tableId}/records":{"get":{"operationId":"tables.listRecords","tags":["tables"],"summary":"List records","description":"Lists a table's records, 100 per page unless `limit` says otherwise (up to 200). `view` is a base64url-encoded JSON object with a `search`, up to 20 `filter` conditions joined by \"and\", and one `sort`; without it, records come in table order. The answer adds `totalCount` (every record), `matchCount` (the records the view matches), `appliedView` (the view that ran, without incomplete or invalid conditions) and `included`: the labels of linked records and the files in attachment cells. Needs view access to the table.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read","parameters":[{"name":"tableId","in":"path","required":true,"description":"The table's id.","schema":{"$ref":"#/components/schemas/TableId"}},{"name":"view","in":"query","required":false,"description":"The search, filter and sort to apply, as base64url-encoded JSON. Left out: every record, in table order.","schema":{"type":"string","pattern":"^[A-Za-z0-9_-]*$"}},{"name":"cursor","in":"query","required":false,"description":"Where to continue: the `nextCursor` of the page before. Left out, the list starts at its beginning.","schema":{"$ref":"#/components/schemas/Cursor"}},{"name":"limit","in":"query","required":false,"description":"How many records to return, 1 to 200; 100 when left out.","schema":{"type":"string","pattern":"^-?(0|[1-9][0-9]*)$"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecordPage"},"example":{"items":[{"id":"rec_01jbq6d1e3g5j7m9p1r3t5w7y9","tableId":"tbl_01jbq5a2c4e6g8j0m2p4r6t8vx","position":"a0","values":{"col_01jbq5b3d5f7h9k1m3p5r7t9wy":"Lena Brooks","col_01jbq5b4e6g8j0m2q4s6v8x0za":"https://creators.example.com/lena-brooks","col_01jbq5b5f7h9k1n3q5s7v9x1zb":"opt_01jbq5c2e4g6j8m0q2s4w6y8az","col_01jbq5b6g8j0m2p4r6t8w0y2ac":184000,"col_01jbq5b7h9k1n3q5s7v9x1z3bd":["rec_01jbq2w8y0a2c4e6g8j0m2p4r6"],"col_01jbq5b8j0m2p4r6t8w0y2a4ce":"2026-10-24"},"label":"Lena Brooks","createdAt":"2026-10-06T10:12:00.000Z","createdBy":"agt_01jbq4r3t9w5y1a7c3e9g5j1kb","updatedAt":"2026-10-20T15:47:00.000Z","updatedBy":"mbr_01jbq4p6g2j8m4q0s6w2y8c4ea","revision":4,"submission":null},{"id":"rec_01jbq6d2f4h6k8n0q2s4v6x8z0","tableId":"tbl_01jbq5a2c4e6g8j0m2p4r6t8vx","position":"a1","values":{"col_01jbq5b3d5f7h9k1m3p5r7t9wy":"Sam Okafor","col_01jbq5b4e6g8j0m2q4s6v8x0za":"https://creators.example.com/sam-okafor","col_01jbq5b5f7h9k1n3q5s7v9x1zb":"opt_01jbq5c2e4g6j8m0q2s4w6y8az","col_01jbq5b6g8j0m2p4r6t8w0y2ac":92500,"col_01jbq5b7h9k1n3q5s7v9x1z3bd":["rec_01jbq2w8y0a2c4e6g8j0m2p4r6"],"col_01jbq5b8j0m2p4r6t8w0y2a4ce":"2026-10-27"},"label":"Sam Okafor","createdAt":"2026-10-06T10:12:00.000Z","createdBy":"agt_01jbq4r3t9w5y1a7c3e9g5j1kb","updatedAt":"2026-10-21T08:05:00.000Z","updatedBy":"mbr_01jbq4p6g2j8m4q0s6w2y8c4ea","revision":3,"submission":null}],"nextCursor":"eyJrIjoiMjAyNi0xMC0yNyIsImlkIjoicmVjXzAxamJxNmQyIn0","totalCount":48,"matchCount":9,"appliedView":{"search":null,"filter":[{"columnId":"col_01jbq5b5f7h9k1n3q5s7v9x1zb","operator":"is","value":"opt_01jbq5c2e4g6j8m0q2s4w6y8az"}],"sort":{"columnId":"col_01jbq5b8j0m2p4r6t8w0y2a4ce","direction":"asc"}},"included":{"linkedRecords":[{"id":"rec_01jbq2w8y0a2c4e6g8j0m2p4r6","tableId":"tbl_01jbq3z7x5v3t1r9p7m5k3h1fd","label":"Northwind Coffee spring launch"}],"files":[]}}}}},"400":{"description":"validation_failed, invalid_cursor","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"post":{"operationId":"tables.createRecord","tags":["tables"],"summary":"Create a record","description":"Adds one record to a table, after the last one or after `afterRecordId`. `values` fills cells by column id; the other cells start empty. A cell of a read-only column, such as a system column, answers `400 validation_failed`. A table holds at most 50,000 records: a full one answers `400 validation_failed` at `body`. Returns the record with the labels of the records its link cells point at and the files its attachment cells hold. Needs edit access to the table. To add many records at once, use Create records.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read_write","parameters":[{"name":"tableId","in":"path","required":true,"description":"The table's id.","schema":{"$ref":"#/components/schemas/TableId"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"A key you choose for this request, such as a UUID. Once the request has succeeded, sending it again with the same key gets the first answer back, with nothing done twice.","schema":{"$ref":"#/components/schemas/IdempotencyKey"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateRecordBody"},"example":{"values":{"col_01jbq5b3d5f7h9k1m3p5r7t9wy":"Jonas Weber","col_01jbq5b4e6g8j0m2q4s6v8x0za":"https://creators.example.com/jonas-weber","col_01jbq5b5f7h9k1n3q5s7v9x1zb":"opt_01jbq5c1d3f5h7k9m1p3r5t7vx","col_01jbq5b6g8j0m2p4r6t8w0y2ac":47800,"col_01jbq5b7h9k1n3q5s7v9x1z3bd":["rec_01jbq2w8y0a2c4e6g8j0m2p4r6"]}}}}},"responses":{"201":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecordResult"},"example":{"record":{"id":"rec_01jbr2k4m6p8r0t2v4x6z8b0d2","tableId":"tbl_01jbq5a2c4e6g8j0m2p4r6t8vx","position":"b7","values":{"col_01jbq5b3d5f7h9k1m3p5r7t9wy":"Jonas Weber","col_01jbq5b4e6g8j0m2q4s6v8x0za":"https://creators.example.com/jonas-weber","col_01jbq5b5f7h9k1n3q5s7v9x1zb":"opt_01jbq5c1d3f5h7k9m1p3r5t7vx","col_01jbq5b6g8j0m2p4r6t8w0y2ac":47800,"col_01jbq5b7h9k1n3q5s7v9x1z3bd":["rec_01jbq2w8y0a2c4e6g8j0m2p4r6"],"col_01jbq5b8j0m2p4r6t8w0y2a4ce":null},"label":"Jonas Weber","createdAt":"2026-10-21T09:30:00.000Z","createdBy":"mbr_01jbq4p6g2j8m4q0s6w2y8c4ea","updatedAt":"2026-10-21T09:30:00.000Z","updatedBy":"mbr_01jbq4p6g2j8m4q0s6w2y8c4ea","revision":1,"submission":null},"included":{"linkedRecords":[{"id":"rec_01jbq2w8y0a2c4e6g8j0m2p4r6","tableId":"tbl_01jbq3z7x5v3t1r9p7m5k3h1fd","label":"Northwind Coffee spring launch"}],"files":[]}}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"idempotency_in_progress","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"422":{"description":"idempotency_key_reused","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/records/{recordId}":{"get":{"operationId":"tables.getRecord","tags":["tables"],"summary":"Get a record","description":"Returns one record with the labels of the records its link cells point at and the files its attachment cells hold; a linked record or a file the caller cannot view is left out. Needs view access to the record's table.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read","parameters":[{"name":"recordId","in":"path","required":true,"description":"The record's id.","schema":{"$ref":"#/components/schemas/RecordId"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecordResult"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"patch":{"operationId":"tables.updateRecord","tags":["tables"],"summary":"Update a record","description":"Changes some of a record's cells: send only the cells that change, by column id, and the others keep their value. The last write wins for each cell, so `expectedRevision` is optional; send it to get `409 revision_conflict` when the record changed since you read it. A cell of a read-only column answers `400 validation_failed`. Needs edit access to the table.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read_write","parameters":[{"name":"recordId","in":"path","required":true,"description":"The record's id.","schema":{"$ref":"#/components/schemas/RecordId"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateRecordBody"}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecordResult"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"revision_conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"delete":{"operationId":"tables.deleteRecord","tags":["tables"],"summary":"Delete a record","description":"Deletes a record and removes every link to it from other records. Needs edit access to the table. To delete many records at once, use Delete records.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read_write","parameters":[{"name":"recordId","in":"path","required":true,"description":"The record's id.","schema":{"$ref":"#/components/schemas/RecordId"}}],"responses":{"204":{"description":"Done. The answer has no body."},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/tables/{tableId}/records/bulk-create":{"post":{"operationId":"tables.createRecords","tags":["tables"],"summary":"Create records","description":"Adds up to 500 records to a table in one call, each with its own cells, after the last record and in the order sent. All or nothing: a record whose cells do not fit answers `400 validation_failed` with its issues under `body.records.<index>.values`, and nothing is written. A table holds at most 50,000 records: a call that would pass it answers `400 validation_failed` at `body.records`, saying how much room is left. The body must stay within 1 MiB (`413 payload_too_large`), and a call still running after 60 seconds, or one whose database statement runs 30 (waiting for another write on the table included), is rolled back with `503 unavailable`: send fewer records. Needs edit access to the table. Returns one result per record, in order, with its new id.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read_write","parameters":[{"name":"tableId","in":"path","required":true,"description":"The table's id.","schema":{"$ref":"#/components/schemas/TableId"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"A key you choose for this request, such as a UUID. Once the request has succeeded, sending it again with the same key gets the first answer back, with nothing done twice.","schema":{"$ref":"#/components/schemas/IdempotencyKey"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateRecordsBody"},"example":{"records":[{"values":{"col_01jbq5b3d5f7h9k1m3p5r7t9wy":"Mei Tanaka","col_01jbq5b4e6g8j0m2q4s6v8x0za":"https://creators.example.com/mei-tanaka","col_01jbq5b5f7h9k1n3q5s7v9x1zb":"opt_01jbq5c1d3f5h7k9m1p3r5t7vx","col_01jbq5b6g8j0m2p4r6t8w0y2ac":128300}},{"values":{"col_01jbq5b3d5f7h9k1m3p5r7t9wy":"Diego Alvarez","col_01jbq5b4e6g8j0m2q4s6v8x0za":"https://creators.example.com/diego-alvarez","col_01jbq5b5f7h9k1n3q5s7v9x1zb":"opt_01jbq5c1d3f5h7k9m1p3r5t7vx","col_01jbq5b6g8j0m2p4r6t8w0y2ac":76900}}]}}}},"responses":{"201":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkRecordsResult"},"example":{"results":[{"index":0,"outcome":"created","recordId":"rec_01jbr2k5n7q9s1v3x5z7b9d1f3"},{"index":1,"outcome":"created","recordId":"rec_01jbr2k6p8r0t2w4y6a8c0e2g4"}]}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"idempotency_in_progress","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"413":{"description":"payload_too_large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"422":{"description":"idempotency_key_reused","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/tables/{tableId}/records/bulk-upsert":{"post":{"operationId":"tables.upsertRecords","tags":["tables"],"summary":"Create or update records","description":"Creates or updates up to 500 records in one call, matched on one column. `matchColumnId` names a text, URL, email or number column that is not read-only, and every record sent holds a value there. The record of the table whose cell holds the same value, compared exactly as stored, gets the cells sent (the others keep theirs); a value no record holds adds a new record at the end. A value two records hold, or one sent twice, answers `409 state_conflict` (`ambiguous_match` or `repeated_match`) with the input's `index`, and nothing is written. Limits and access as in Create records; only the records it adds count toward the table's 50,000. Returns one result per record, `created` or `updated`, with its id.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read_write","parameters":[{"name":"tableId","in":"path","required":true,"description":"The table's id.","schema":{"$ref":"#/components/schemas/TableId"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"A key you choose for this request, such as a UUID. Once the request has succeeded, sending it again with the same key gets the first answer back, with nothing done twice.","schema":{"$ref":"#/components/schemas/IdempotencyKey"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpsertRecordsBody"},"example":{"matchColumnId":"col_01jbq5b4e6g8j0m2q4s6v8x0za","records":[{"values":{"col_01jbq5b4e6g8j0m2q4s6v8x0za":"https://creators.example.com/lena-brooks","col_01jbq5b5f7h9k1n3q5s7v9x1zb":"opt_01jbq5c3f5h7k9n1q3s5v7x9zb","col_01jbq5b6g8j0m2p4r6t8w0y2ac":191000}},{"values":{"col_01jbq5b4e6g8j0m2q4s6v8x0za":"https://creators.example.com/ava-lindqvist","col_01jbq5b3d5f7h9k1m3p5r7t9wy":"Ava Lindqvist","col_01jbq5b5f7h9k1n3q5s7v9x1zb":"opt_01jbq5c1d3f5h7k9m1p3r5t7vx","col_01jbq5b6g8j0m2p4r6t8w0y2ac":35600}}]}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkRecordsResult"},"example":{"results":[{"index":0,"outcome":"updated","recordId":"rec_01jbq6d1e3g5j7m9p1r3t5w7y9"},{"index":1,"outcome":"created","recordId":"rec_01jbr3m2p4r6t8v0x2z4b6d8f0"}]}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"idempotency_in_progress, state_conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"413":{"description":"payload_too_large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"422":{"description":"idempotency_key_reused","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/tables/{tableId}/records/bulk-delete":{"post":{"operationId":"tables.deleteRecords","tags":["tables"],"summary":"Delete records","description":"Deletes up to 500 records of a table in one call, with every link to them. Name each record once; an id that is not a record of the table, or is already gone, answers `404 not_found` and nothing is deleted. All or nothing, with the same body and time limits as Create records. Needs edit access to the table. Returns `deletedCount`.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read_write","parameters":[{"name":"tableId","in":"path","required":true,"description":"The table's id.","schema":{"$ref":"#/components/schemas/TableId"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"A key you choose for this request, such as a UUID. Once the request has succeeded, sending it again with the same key gets the first answer back, with nothing done twice.","schema":{"$ref":"#/components/schemas/IdempotencyKey"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteRecordsBody"}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteRecordsResult"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"idempotency_in_progress","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"413":{"description":"payload_too_large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"422":{"description":"idempotency_key_reused","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/tables/{tableId}/record-labels":{"get":{"operationId":"tables.listRecordLabels","tags":["tables"],"summary":"List record labels","description":"Lists the labels of a table's records (the text of its primary column), in table order, for picking records to link. Narrow it with `q`, up to 200 characters. Returns 20 labels per page unless `limit` says otherwise. Needs view access to the table.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read","parameters":[{"name":"tableId","in":"path","required":true,"description":"The table's id.","schema":{"$ref":"#/components/schemas/TableId"}},{"name":"q","in":"query","required":false,"description":"Text to find in the records' labels, ignoring case and accents, up to 200 characters.","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"cursor","in":"query","required":false,"description":"Where to continue: the `nextCursor` of the page before. Left out, the list starts at its beginning.","schema":{"$ref":"#/components/schemas/Cursor"}},{"name":"limit","in":"query","required":false,"description":"How many labels to return, 1 to 200; 20 when left out.","schema":{"type":"string","pattern":"^-?(0|[1-9][0-9]*)$"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LinkedRecordLabelPage"}}}},"400":{"description":"validation_failed, invalid_cursor","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/tables/{tableId}/export.csv":{"get":{"operationId":"tables.exportCsv","tags":["tables"],"summary":"Export a view as CSV","description":"Downloads the records a view shows as a CSV file named after the table, in the view's order, under a header row of column names. Pass the same `view` as List records; without it, every record in table order. Cells export as the text people see (option labels, names, record labels, file names), several values joined by commas, and a cell a spreadsheet would run as a formula, or a part of one after a `;`, starts with an apostrophe. At most the first 50,000 records: `Fleepr-Export-Truncated` says whether the file was cut and `Fleepr-Export-Match-Count` how many records the view shows. Needs view access to the table.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read","parameters":[{"name":"tableId","in":"path","required":true,"description":"The table's id.","schema":{"$ref":"#/components/schemas/TableId"}},{"name":"view","in":"query","required":false,"description":"The search, filter and sort to export, as base64url-encoded JSON, the same as List records takes. Left out: every record, in table order.","schema":{"type":"string","pattern":"^[A-Za-z0-9_-]*$"}}],"responses":{"200":{"description":"Success.","headers":{"Content-Disposition":{"description":"attachment, with the file name \"<table name>.csv\": the browser saves the file.","required":true,"schema":{"type":"string"}},"Fleepr-Export-Truncated":{"description":"true when the file holds only the first 50000 of the records the view shows, else false.","required":true,"schema":{"type":"string"}},"Fleepr-Export-Match-Count":{"description":"How many records the view shows: the `matchCount` the record list answers for it.","required":true,"schema":{"type":"string"}}},"content":{"text/csv":{"schema":{"type":"string"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/orgs/{orgId}/record-search":{"get":{"operationId":"tables.searchRecords","tags":["tables"],"summary":"Search records","description":"Finds records across the tables the caller may view by the names they go by, ignoring case and accents: the whole name first, then a code or another identifying column, then a name people taught, then some words of a name and near spellings; with `thread`, records the chat is linked to, and records linked to those, rank first. A table the caller may not view is never searched. `tableId` or `thread` the caller may not view answers `404 not_found`. Read-only; 8 rows by default, at most 20, no paging.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read","parameters":[{"name":"orgId","in":"path","required":true,"description":"The organization's id.","schema":{"$ref":"#/components/schemas/OrganizationId"}},{"name":"q","in":"query","required":true,"description":"What to find, 1 to 80 characters: names, codes and other names records go by, ignoring case and accents. The last word also matches the start of a word.","schema":{"type":"string","minLength":1,"maxLength":80}},{"name":"thread","in":"query","required":false,"description":"A chat (`chat:` and its id) whose linked records, and the records linked to them, rank first. Only a chat: a file (`file:`) is refused.","schema":{"$ref":"#/components/schemas/ThreadKey"}},{"name":"tableId","in":"query","required":false,"description":"Only records of this table.","schema":{"$ref":"#/components/schemas/TableId"}},{"name":"limit","in":"query","required":false,"description":"How many rows to return, 1 to 20; 8 when left out.","schema":{"type":"string","pattern":"^-?(0|[1-9][0-9]*)$"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchRecordsResult"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/records/{recordId}/names":{"get":{"operationId":"tables.listRecordNames","tags":["tables"],"summary":"List a record's learned names","description":"The names Fleepr learned for a record from people's clear answers, newest first: agents, link cards and the record search find the record by them. Each is a word of the record's own name; where it was said is never kept. `viewer.canRemove` tells whether the caller may remove them. Needs view access to the record's table.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read","parameters":[{"name":"recordId","in":"path","required":true,"description":"The record's id.","schema":{"$ref":"#/components/schemas/RecordId"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecordNames"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/records/{recordId}/names/{nameId}":{"delete":{"operationId":"tables.removeRecordName","tags":["tables"],"summary":"Remove a learned name","description":"Fleepr stops finding the record by that name and never learns it again for this record. Answers the record's learned names after the removal; a name already removed, or not one of the record's, changes nothing and answers them as they are. Needs edit access to the record's table; an agent never removes one.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read_write","parameters":[{"name":"recordId","in":"path","required":true,"description":"The record's id.","schema":{"$ref":"#/components/schemas/RecordId"}},{"name":"nameId","in":"path","required":true,"description":"The learned name's id.","schema":{"$ref":"#/components/schemas/RecordNameId"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"A key you choose for this request, such as a UUID. Once the request has succeeded, sending it again with the same key gets the first answer back, with nothing done twice.","schema":{"$ref":"#/components/schemas/IdempotencyKey"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecordNames"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"idempotency_in_progress","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"422":{"description":"idempotency_key_reused","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/tables/{tableId}/views":{"get":{"operationId":"views.listViews","tags":["views"],"summary":"List a table's views","description":"Lists a table's saved views in menu order: its forms, at most 50. Needs view access to the table; the table's `myAccess.actions` say what the caller may do with them (`respond`, `edit`, `share`).","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read","parameters":[{"name":"tableId","in":"path","required":true,"description":"The table's id.","schema":{"$ref":"#/components/schemas/TableId"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ViewList"},"example":{"items":[{"id":"view_01jcd3b5d7f9h1k3n5q7s9v1xz","tableId":"tbl_01jcd2a4c6e8g0j2m4p6r8t0vx","kind":"form","name":"Creator brief","position":"a0","settings":{"title":"Creator brief","description":"Record your take for the spring campaign. Read the script on screen while you record.","fields":[{"columnId":"col_01jcd5d7f9h1k3n5q7s9v1x3zb","label":"Your name","help":null,"required":true,"access":"editable","display":"short","files":null},{"columnId":"col_01jcd5e8g0j2m4p6r8t0w2y4ac","label":"Script","help":null,"required":false,"access":"read_only","display":"paragraph","files":null},{"columnId":"col_01jcd5f9h1k3n5q7s9v1x3z5bd","label":"Your video","help":"One take, up to 3 minutes.","required":true,"access":"editable","display":null,"files":{"kinds":["videos"],"maxFiles":1,"maxBytesPerFile":1073741824,"upload":true,"capture":[{"kind":"video","maxSeconds":180,"camera":"front","teleprompter":{"textColumnId":"col_01jcd5e8g0j2m4p6r8t0w2y4ac","wordsPerMinute":130,"size":"l","colors":"light_on_dark"}}]}},{"columnId":"col_01jcd5g0j2m4p6r8t0w2y4a6ce","label":"Deadline","help":null,"required":false,"access":"read_only","display":null,"files":null}],"submitLabel":"Send","thankYou":"Thanks, your response was sent.","allowAnother":false,"askRespondent":"off","accepting":true,"closesAt":null,"maxResponses":null,"dailyResponseCap":500,"notifyMemberIds":["mbr_01jbq4n2d8f5h3k7m9p1r4t6vw"]},"links":{"public":false,"personal":1},"createdBy":"mbr_01jbq4n2d8f5h3k7m9p1r4t6vw","createdAt":"2026-11-02T09:00:00.000Z","updatedBy":"mbr_01jbq4n2d8f5h3k7m9p1r4t6vw","updatedAt":"2026-11-02T09:20:00.000Z","revision":3}]}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"post":{"operationId":"views.createView","tags":["views"],"summary":"Create a view","description":"Creates a form on a table. Needs edit access to the table. A table holds at most 50 views (`409 state_conflict`, `currentStatus` `full`). Its questions must be columns of the table, never system columns.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read_write","parameters":[{"name":"tableId","in":"path","required":true,"description":"The table's id.","schema":{"$ref":"#/components/schemas/TableId"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"A key you choose for this request, such as a UUID. Once the request has succeeded, sending it again with the same key gets the first answer back, with nothing done twice.","schema":{"$ref":"#/components/schemas/IdempotencyKey"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateViewBody"},"example":{"kind":"form","name":"Creator brief","settings":{"title":"Creator brief","description":"Record your take for the spring campaign. Read the script on screen while you record.","fields":[{"columnId":"col_01jcd5d7f9h1k3n5q7s9v1x3zb","label":"Your name","help":null,"required":true,"access":"editable","display":"short","files":null},{"columnId":"col_01jcd5e8g0j2m4p6r8t0w2y4ac","label":"Script","help":null,"required":false,"access":"read_only","display":"paragraph","files":null},{"columnId":"col_01jcd5f9h1k3n5q7s9v1x3z5bd","label":"Your video","help":"One take, up to 3 minutes.","required":true,"access":"editable","display":null,"files":{"kinds":["videos"],"maxFiles":1,"maxBytesPerFile":1073741824,"upload":true,"capture":[{"kind":"video","maxSeconds":180,"camera":"front","teleprompter":{"textColumnId":"col_01jcd5e8g0j2m4p6r8t0w2y4ac","wordsPerMinute":130,"size":"l","colors":"light_on_dark"}}]}},{"columnId":"col_01jcd5g0j2m4p6r8t0w2y4a6ce","label":"Deadline","help":null,"required":false,"access":"read_only","display":null,"files":null}],"submitLabel":"Send","thankYou":"Thanks, your response was sent.","allowAnother":false,"askRespondent":"off","accepting":true,"closesAt":null,"maxResponses":null,"dailyResponseCap":500,"notifyMemberIds":["mbr_01jbq4n2d8f5h3k7m9p1r4t6vw"]}}}}},"responses":{"201":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/View"},"example":{"id":"view_01jcd3b5d7f9h1k3n5q7s9v1xz","tableId":"tbl_01jcd2a4c6e8g0j2m4p6r8t0vx","kind":"form","name":"Creator brief","position":"a0","settings":{"title":"Creator brief","description":"Record your take for the spring campaign. Read the script on screen while you record.","fields":[{"columnId":"col_01jcd5d7f9h1k3n5q7s9v1x3zb","label":"Your name","help":null,"required":true,"access":"editable","display":"short","files":null},{"columnId":"col_01jcd5e8g0j2m4p6r8t0w2y4ac","label":"Script","help":null,"required":false,"access":"read_only","display":"paragraph","files":null},{"columnId":"col_01jcd5f9h1k3n5q7s9v1x3z5bd","label":"Your video","help":"One take, up to 3 minutes.","required":true,"access":"editable","display":null,"files":{"kinds":["videos"],"maxFiles":1,"maxBytesPerFile":1073741824,"upload":true,"capture":[{"kind":"video","maxSeconds":180,"camera":"front","teleprompter":{"textColumnId":"col_01jcd5e8g0j2m4p6r8t0w2y4ac","wordsPerMinute":130,"size":"l","colors":"light_on_dark"}}]}},{"columnId":"col_01jcd5g0j2m4p6r8t0w2y4a6ce","label":"Deadline","help":null,"required":false,"access":"read_only","display":null,"files":null}],"submitLabel":"Send","thankYou":"Thanks, your response was sent.","allowAnother":false,"askRespondent":"off","accepting":true,"closesAt":null,"maxResponses":null,"dailyResponseCap":500,"notifyMemberIds":["mbr_01jbq4n2d8f5h3k7m9p1r4t6vw"]},"links":{"public":false,"personal":1},"createdBy":"mbr_01jbq4n2d8f5h3k7m9p1r4t6vw","createdAt":"2026-11-02T09:00:00.000Z","updatedBy":"mbr_01jbq4n2d8f5h3k7m9p1r4t6vw","updatedAt":"2026-11-02T09:20:00.000Z","revision":3}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"idempotency_in_progress, state_conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"422":{"description":"idempotency_key_reused","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/views/{viewId}":{"get":{"operationId":"views.getView","tags":["views"],"summary":"Get a view","description":"Reads one view of a table with its settings. Needs view access to the table.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read","parameters":[{"name":"viewId","in":"path","required":true,"description":"The view's id.","schema":{"$ref":"#/components/schemas/ViewId"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/View"},"example":{"id":"view_01jcd3b5d7f9h1k3n5q7s9v1xz","tableId":"tbl_01jcd2a4c6e8g0j2m4p6r8t0vx","kind":"form","name":"Creator brief","position":"a0","settings":{"title":"Creator brief","description":"Record your take for the spring campaign. Read the script on screen while you record.","fields":[{"columnId":"col_01jcd5d7f9h1k3n5q7s9v1x3zb","label":"Your name","help":null,"required":true,"access":"editable","display":"short","files":null},{"columnId":"col_01jcd5e8g0j2m4p6r8t0w2y4ac","label":"Script","help":null,"required":false,"access":"read_only","display":"paragraph","files":null},{"columnId":"col_01jcd5f9h1k3n5q7s9v1x3z5bd","label":"Your video","help":"One take, up to 3 minutes.","required":true,"access":"editable","display":null,"files":{"kinds":["videos"],"maxFiles":1,"maxBytesPerFile":1073741824,"upload":true,"capture":[{"kind":"video","maxSeconds":180,"camera":"front","teleprompter":{"textColumnId":"col_01jcd5e8g0j2m4p6r8t0w2y4ac","wordsPerMinute":130,"size":"l","colors":"light_on_dark"}}]}},{"columnId":"col_01jcd5g0j2m4p6r8t0w2y4a6ce","label":"Deadline","help":null,"required":false,"access":"read_only","display":null,"files":null}],"submitLabel":"Send","thankYou":"Thanks, your response was sent.","allowAnother":false,"askRespondent":"off","accepting":true,"closesAt":null,"maxResponses":null,"dailyResponseCap":500,"notifyMemberIds":["mbr_01jbq4n2d8f5h3k7m9p1r4t6vw"]},"links":{"public":false,"personal":1},"createdBy":"mbr_01jbq4n2d8f5h3k7m9p1r4t6vw","createdAt":"2026-11-02T09:00:00.000Z","updatedBy":"mbr_01jbq4n2d8f5h3k7m9p1r4t6vw","updatedAt":"2026-11-02T09:20:00.000Z","revision":3}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"patch":{"operationId":"views.updateView","tags":["views"],"summary":"Update a view","description":"Renames, moves or changes a view: send only what changes, settings whole, with the `expectedRevision` you read; if the view changed since, the answer is `409 revision_conflict`. Needs edit access to the table.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read_write","parameters":[{"name":"viewId","in":"path","required":true,"description":"The view's id.","schema":{"$ref":"#/components/schemas/ViewId"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateViewBody"},"example":{"name":"Creator brief (spring)","expectedRevision":3}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/View"},"example":{"id":"view_01jcd3b5d7f9h1k3n5q7s9v1xz","tableId":"tbl_01jcd2a4c6e8g0j2m4p6r8t0vx","kind":"form","name":"Creator brief (spring)","position":"a0","settings":{"title":"Creator brief","description":"Record your take for the spring campaign. Read the script on screen while you record.","fields":[{"columnId":"col_01jcd5d7f9h1k3n5q7s9v1x3zb","label":"Your name","help":null,"required":true,"access":"editable","display":"short","files":null},{"columnId":"col_01jcd5e8g0j2m4p6r8t0w2y4ac","label":"Script","help":null,"required":false,"access":"read_only","display":"paragraph","files":null},{"columnId":"col_01jcd5f9h1k3n5q7s9v1x3z5bd","label":"Your video","help":"One take, up to 3 minutes.","required":true,"access":"editable","display":null,"files":{"kinds":["videos"],"maxFiles":1,"maxBytesPerFile":1073741824,"upload":true,"capture":[{"kind":"video","maxSeconds":180,"camera":"front","teleprompter":{"textColumnId":"col_01jcd5e8g0j2m4p6r8t0w2y4ac","wordsPerMinute":130,"size":"l","colors":"light_on_dark"}}]}},{"columnId":"col_01jcd5g0j2m4p6r8t0w2y4a6ce","label":"Deadline","help":null,"required":false,"access":"read_only","display":null,"files":null}],"submitLabel":"Send","thankYou":"Thanks, your response was sent.","allowAnother":false,"askRespondent":"off","accepting":true,"closesAt":null,"maxResponses":null,"dailyResponseCap":500,"notifyMemberIds":["mbr_01jbq4n2d8f5h3k7m9p1r4t6vw"]},"links":{"public":false,"personal":1},"createdBy":"mbr_01jbq4n2d8f5h3k7m9p1r4t6vw","createdAt":"2026-11-02T09:00:00.000Z","updatedBy":"mbr_01jbq4n2d8f5h3k7m9p1r4t6vw","updatedAt":"2026-11-02T09:20:00.000Z","revision":4}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"revision_conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"delete":{"operationId":"views.deleteView","tags":["views"],"summary":"Delete a view","description":"Deletes a view. A form takes its links with it; the records it made stay. Needs edit access to the table.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read_write","parameters":[{"name":"viewId","in":"path","required":true,"description":"The view's id.","schema":{"$ref":"#/components/schemas/ViewId"}}],"responses":{"204":{"description":"Done. The answer has no body."},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/views/{viewId}/links":{"get":{"operationId":"views.listFormLinks","tags":["views"],"summary":"List a form's links","description":"Lists a form's links, the public one first and then personal links, newest first, each with its address and whether it works. Needs share access to the table (its owner, admins and members who may manage it). A personal link an agent made under a card shows its address only to its issuer, the member who approved the card, and never through an API key: the others read `url` null and may still revoke it.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read","parameters":[{"name":"viewId","in":"path","required":true,"description":"The view's id.","schema":{"$ref":"#/components/schemas/ViewId"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormLinkList"},"example":{"items":[{"id":"flink_01jcd4c6e8g0j2m4p6r8t0w2ya","viewId":"view_01jcd3b5d7f9h1k3n5q7s9v1xz","tableId":"tbl_01jcd2a4c6e8g0j2m4p6r8t0vx","kind":"personal","url":"https://app.example.com/form#EXAMPLE-form-link-secret-0000000000000000000","issuedBy":"mbr_01jbq4n2d8f5h3k7m9p1r4t6vw","agentId":null,"recipient":{"name":"Carla Ruiz","email":"carla@example.com"},"prefill":{"col_01jcd5g0j2m4p6r8t0w2y4a6ce":"2026-11-15"},"expiresAt":null,"maxResponses":1,"responseCount":0,"openedAt":null,"lastResponseAt":null,"createdAt":"2026-11-02T09:30:00.000Z","revokedAt":null,"state":"live","emailedAt":null,"undelivered":null}]}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"post":{"operationId":"views.createFormLink","tags":["views"],"summary":"Create a form link","description":"Turns on the public link, or makes a personal link for one person with values prefilled for them. Needs share access to the table. A form has one public link (`409 state_conflict`, `currentStatus` `exists`) and at most 1,000 working personal links (`currentStatus` `full`). Prefilled linked records must be ones the caller may view. The link works while its form takes responses and the caller may still share the table. With `delivery` `email` Fleepr also emails it to its recipient, as the last step: a server with no email provider answers `503 unavailable` before anything is written, and one that could not send it answers 503 with nothing written. Its email counts against the link email limits, shared with guest approval links (25 an hour per API key, 100 per sending person, 5 per recipient address in the organization): over one, `429 rate_limited` with `retryAfterSeconds`. An end already past is refused (`400 validation_failed` at `body.expiresAt`): Fleepr never emails a link that would not open. A replay never sends it again.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read_write","parameters":[{"name":"viewId","in":"path","required":true,"description":"The view's id.","schema":{"$ref":"#/components/schemas/ViewId"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"A key you choose for this request, such as a UUID. Once the request has succeeded, sending it again with the same key gets the first answer back, with nothing done twice.","schema":{"$ref":"#/components/schemas/IdempotencyKey"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateFormLinkBody"},"example":{"kind":"personal","recipient":{"name":"Carla Ruiz","email":"carla@example.com"},"prefill":{"col_01jcd5g0j2m4p6r8t0w2y4a6ce":"2026-11-15"},"delivery":"email"}}}},"responses":{"201":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormLink"},"example":{"id":"flink_01jcd4c6e8g0j2m4p6r8t0w2ya","viewId":"view_01jcd3b5d7f9h1k3n5q7s9v1xz","tableId":"tbl_01jcd2a4c6e8g0j2m4p6r8t0vx","kind":"personal","url":"https://app.example.com/form#EXAMPLE-form-link-secret-0000000000000000000","issuedBy":"mbr_01jbq4n2d8f5h3k7m9p1r4t6vw","agentId":null,"recipient":{"name":"Carla Ruiz","email":"carla@example.com"},"prefill":{"col_01jcd5g0j2m4p6r8t0w2y4a6ce":"2026-11-15"},"expiresAt":null,"maxResponses":1,"responseCount":0,"openedAt":null,"lastResponseAt":null,"createdAt":"2026-11-02T09:30:00.000Z","revokedAt":null,"state":"live","emailedAt":"2026-11-02T09:30:00.000Z","undelivered":null}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"idempotency_in_progress, state_conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"422":{"description":"idempotency_key_reused","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/views/{viewId}/links/bulk-create":{"post":{"operationId":"views.createFormLinks","tags":["views"],"summary":"Create form links for one person","description":"Makes 2 to 10 personal links of one form for one person, each with values of its own prefilled (one link per record or prefill: the same values twice answer `400 validation_failed` at `body.links.<n>`), all or none, in their order. Needs share access to the table, and room for every link among the form's 1,000 working personal links (`409 state_conflict`, `currentStatus` `full`). With `delivery` `email` Fleepr sends one email that lists every link, each named by its record or prefill, and it counts once against the link email limits (429 `rate_limited` over one); otherwise as `createFormLink`. A replay never sends it again.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read_write","parameters":[{"name":"viewId","in":"path","required":true,"description":"The view's id.","schema":{"$ref":"#/components/schemas/ViewId"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"A key you choose for this request, such as a UUID. Once the request has succeeded, sending it again with the same key gets the first answer back, with nothing done twice.","schema":{"$ref":"#/components/schemas/IdempotencyKey"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateFormLinksBody"},"example":{"recipient":{"name":"Carla Ruiz","email":"carla@example.com"},"delivery":"email","links":[{"prefill":{"col_01jcd5g0j2m4p6r8t0w2y4a6ce":"2026-11-15"}},{"prefill":{"col_01jcd5g0j2m4p6r8t0w2y4a6ce":"2026-11-22"}}]}}}},"responses":{"201":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormLinkList"},"example":{"items":[{"id":"flink_01jcd4c6e8g0j2m4p6r8t0w2ya","viewId":"view_01jcd3b5d7f9h1k3n5q7s9v1xz","tableId":"tbl_01jcd2a4c6e8g0j2m4p6r8t0vx","kind":"personal","url":"https://app.example.com/form#EXAMPLE-form-link-secret-0000000000000000000","issuedBy":"mbr_01jbq4n2d8f5h3k7m9p1r4t6vw","agentId":null,"recipient":{"name":"Carla Ruiz","email":"carla@example.com"},"prefill":{"col_01jcd5g0j2m4p6r8t0w2y4a6ce":"2026-11-15"},"expiresAt":null,"maxResponses":1,"responseCount":0,"openedAt":null,"lastResponseAt":null,"createdAt":"2026-11-02T09:30:00.000Z","revokedAt":null,"state":"live","emailedAt":"2026-11-02T09:30:00.000Z","undelivered":null},{"id":"flink_01jcd4c6e8g0j2m4p6r8t0w2yb","viewId":"view_01jcd3b5d7f9h1k3n5q7s9v1xz","tableId":"tbl_01jcd2a4c6e8g0j2m4p6r8t0vx","kind":"personal","url":"https://app.example.com/form#EXAMPLE-form-link-secret-0000000000000000001","issuedBy":"mbr_01jbq4n2d8f5h3k7m9p1r4t6vw","agentId":null,"recipient":{"name":"Carla Ruiz","email":"carla@example.com"},"prefill":{"col_01jcd5g0j2m4p6r8t0w2y4a6ce":"2026-11-22"},"expiresAt":null,"maxResponses":1,"responseCount":0,"openedAt":null,"lastResponseAt":null,"createdAt":"2026-11-02T09:30:00.000Z","revokedAt":null,"state":"live","emailedAt":"2026-11-02T09:30:00.000Z","undelivered":null}]}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"idempotency_in_progress, state_conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"422":{"description":"idempotency_key_reused","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/form-links/{linkId}":{"get":{"operationId":"views.getFormLink","tags":["views"],"summary":"Get a form link","description":"Reads one link of a form, with its address and whether it works, as the list of its links shows it: a personal link an agent made under a card shows its address only to its issuer, the member who approved the card, and never through an API key. Needs share access to the table.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read","parameters":[{"name":"linkId","in":"path","required":true,"description":"The link's id.","schema":{"$ref":"#/components/schemas/FormLinkId"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormLink"},"example":{"id":"flink_01jcd4c6e8g0j2m4p6r8t0w2ya","viewId":"view_01jcd3b5d7f9h1k3n5q7s9v1xz","tableId":"tbl_01jcd2a4c6e8g0j2m4p6r8t0vx","kind":"personal","url":"https://app.example.com/form#EXAMPLE-form-link-secret-0000000000000000000","issuedBy":"mbr_01jbq4n2d8f5h3k7m9p1r4t6vw","agentId":null,"recipient":{"name":"Carla Ruiz","email":"carla@example.com"},"prefill":{"col_01jcd5g0j2m4p6r8t0w2y4a6ce":"2026-11-15"},"expiresAt":null,"maxResponses":1,"responseCount":0,"openedAt":null,"lastResponseAt":null,"createdAt":"2026-11-02T09:30:00.000Z","revokedAt":null,"state":"live","emailedAt":null,"undelivered":null}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"patch":{"operationId":"views.updateFormLink","tags":["views"],"summary":"Update a form link","description":"Changes a personal link's end date or how many responses it takes. A revoked link, or the public link, answers `409 state_conflict`. Needs share access to the table.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read_write","parameters":[{"name":"linkId","in":"path","required":true,"description":"The link's id.","schema":{"$ref":"#/components/schemas/FormLinkId"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateFormLinkBody"},"example":{"maxResponses":null}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormLink"},"example":{"id":"flink_01jcd4c6e8g0j2m4p6r8t0w2ya","viewId":"view_01jcd3b5d7f9h1k3n5q7s9v1xz","tableId":"tbl_01jcd2a4c6e8g0j2m4p6r8t0vx","kind":"personal","url":"https://app.example.com/form#EXAMPLE-form-link-secret-0000000000000000000","issuedBy":"mbr_01jbq4n2d8f5h3k7m9p1r4t6vw","agentId":null,"recipient":{"name":"Carla Ruiz","email":"carla@example.com"},"prefill":{"col_01jcd5g0j2m4p6r8t0w2y4a6ce":"2026-11-15"},"expiresAt":null,"maxResponses":null,"responseCount":0,"openedAt":null,"lastResponseAt":null,"createdAt":"2026-11-02T09:30:00.000Z","revokedAt":null,"state":"live","emailedAt":null,"undelivered":null}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"state_conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/form-links/{linkId}/revoke":{"post":{"operationId":"views.revokeFormLink","tags":["views"],"summary":"Revoke a form link","description":"Stops a link for good: revoking the public link turns it off, and turning it on again makes a new address. A link already revoked answers as it is. Needs share access to the table.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read_write","parameters":[{"name":"linkId","in":"path","required":true,"description":"The link's id.","schema":{"$ref":"#/components/schemas/FormLinkId"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormLink"},"example":{"id":"flink_01jcd4c6e8g0j2m4p6r8t0w2ya","viewId":"view_01jcd3b5d7f9h1k3n5q7s9v1xz","tableId":"tbl_01jcd2a4c6e8g0j2m4p6r8t0vx","kind":"personal","url":"https://app.example.com/form#EXAMPLE-form-link-secret-0000000000000000000","issuedBy":"mbr_01jbq4n2d8f5h3k7m9p1r4t6vw","agentId":null,"recipient":{"name":"Carla Ruiz","email":"carla@example.com"},"prefill":{"col_01jcd5g0j2m4p6r8t0w2y4a6ce":"2026-11-15"},"expiresAt":null,"maxResponses":1,"responseCount":0,"openedAt":null,"lastResponseAt":null,"createdAt":"2026-11-02T09:30:00.000Z","revokedAt":"2026-11-03T10:00:00.000Z","state":"revoked","emailedAt":null,"undelivered":null}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/views/{viewId}/test-response":{"post":{"operationId":"views.testFormResponse","tags":["views"],"summary":"Test a form response","description":"Checks answers exactly as a response would be checked, then writes nothing and starts no flow: the builder's Test submit. A response that would be refused answers `400 validation_failed` with the issues under `body.values`; one that would be taken answers the cells it would write. Files are not checked. Needs edit access to the table, and share too with `linkId`, since it applies that link's prefilled values; a revoked link answers `404 not_found`.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read_write","parameters":[{"name":"viewId","in":"path","required":true,"description":"The view's id.","schema":{"$ref":"#/components/schemas/ViewId"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestFormResponseBody"},"example":{"values":{"col_01jcd5d7f9h1k3n5q7s9v1x3zb":"Carla Ruiz"}}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestFormResponseResult"},"example":{"values":{"col_01jcd5d7f9h1k3n5q7s9v1x3zb":"Carla Ruiz"}}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/orgs/{orgId}/uploads":{"post":{"operationId":"media.createUpload","tags":["media"],"summary":"Start an upload","description":"Starts uploading a file and returns the URLs to send its bytes to: one `PUT` for a file up to 100 MiB, or several parts for a larger one. When every byte is sent, complete the upload with `POST /v0/uploads/{uploadId}/complete`. Any member may upload, viewers included, and an attachment sent with `library` goes straight into the media library. A voice note must be audio, up to 10 minutes long, and a photo (`avatar`, `agent_avatar`) a PNG, JPEG, GIF or WebP image, and an `organization_logo` a PNG or JPEG of at most 1 MiB that only the owner and admins may upload (anyone else gets `403 forbidden`); another type fails with `unsupported_media_type`, and a file over the size limit with `payload_too_large`, with the limit in `maxBytes`. A `file_version` for a doc fails with `state_conflict`: a doc changes in its editor. Sending the same request again with the same `Idempotency-Key` returns the upload as it is now, with fresh URLs while it is still pending.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read_write","parameters":[{"name":"orgId","in":"path","required":true,"description":"The organization's id.","schema":{"$ref":"#/components/schemas/OrganizationId"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"A key you choose for this request, such as a UUID. Once the request has succeeded, sending it again with the same key gets the first answer back, with nothing done twice.","schema":{"$ref":"#/components/schemas/IdempotencyKey"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateUploadBody"},"example":{"purpose":"attachment","name":"spring-launch-hero.png","mimeType":"image/png","sizeBytes":2481152,"library":{"visibility":"organization"}}}}},"responses":{"201":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Upload"},"example":{"id":"upl_01jbq4w7x9y1z3a5b7c9d1e3f5","organizationId":"org_01jaf2m4n6p8r0s2t4v6w8x0y2","purpose":"attachment","name":"spring-launch-hero.png","mimeType":"image/png","sizeBytes":2481152,"checksumSha256":null,"status":"pending","transfer":{"method":"put","url":"https://files.example.com/uploads/spring-launch-hero.png?signature=EXAMPLE","headers":{"content-type":"image/png"}},"expiresAt":"2026-10-20T16:03:00.000Z","createdAt":"2026-10-20T15:03:00.000Z"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"idempotency_in_progress, state_conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"413":{"description":"payload_too_large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"422":{"description":"idempotency_key_reused","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/uploads/{uploadId}/complete":{"post":{"operationId":"media.completeUpload","tags":["media"],"summary":"Complete an upload","description":"Finishes an upload once every byte is sent (the body is `{}`) and returns the upload and the file it became. Only the member who started it may complete it. An attachment becomes a private file of the uploader's, deleted after 24 hours unless a message or a table cell uses it; one sent with `library` joins the media library at once. A voice note never becomes a file (`file` is `null`): only its transcript is kept, and until that is ready, a message using it fails with `upload_not_ready`, so retry the post. Missing bytes or an expired upload fail with `state_conflict`; completing it twice returns it again.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read_write","parameters":[{"name":"uploadId","in":"path","required":true,"description":"The upload's id.","schema":{"$ref":"#/components/schemas/UploadId"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompleteUploadBody"},"example":{}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompleteUploadResult"},"example":{"upload":{"id":"upl_01jbq4w7x9y1z3a5b7c9d1e3f5","organizationId":"org_01jaf2m4n6p8r0s2t4v6w8x0y2","purpose":"attachment","name":"spring-launch-hero.png","mimeType":"image/png","sizeBytes":2481152,"checksumSha256":null,"status":"uploaded","transfer":null,"expiresAt":"2026-10-20T16:03:00.000Z","createdAt":"2026-10-20T15:03:00.000Z"},"file":{"id":"file_01jbq4x8k2m4n6p8q0r2s4t6v8","organizationId":"org_01jaf2m4n6p8r0s2t4v6w8x0y2","name":"spring-launch-hero.png","kind":"image","mimeType":"image/png","sizeBytes":2481152,"currentVersionId":"fver_01jbq4x8k3a5b7c9d1e3f5g7h9","currentVersionNumber":1,"meta":{"width":null,"height":null,"durationMs":null,"pageCount":null},"processing":"pending","thumbnailUrl":null,"urlsExpireAt":null,"origin":"library","sourceChat":null,"visibility":"organization","createdBy":"mbr_01jaf2q7c3d5e7g9h1k3m5n7p9","createdAt":"2026-10-20T15:04:00.000Z","annotationCount":0,"commentCount":0,"approval":null,"revision":1}}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"state_conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"413":{"description":"payload_too_large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/uploads/{uploadId}":{"delete":{"operationId":"media.discardUpload","tags":["media"],"summary":"Discard an upload","description":"Cancels an upload the caller started, for example when someone removes an attachment before sending: it stops an unfinished upload, or deletes the unattached file or the voice note audio a completed one became. An upload already in use fails with `state_conflict`, and so does one uploaded into the media library: delete that file with `DELETE /v0/files/{fileId}` instead.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read_write","parameters":[{"name":"uploadId","in":"path","required":true,"description":"The upload's id.","schema":{"$ref":"#/components/schemas/UploadId"}}],"responses":{"204":{"description":"Done. The answer has no body."},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"state_conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/orgs/{orgId}/docs":{"post":{"operationId":"media.createDoc","tags":["media"],"summary":"Create a doc","description":"Creates an empty doc, a file of kind `doc` written in Fleepr's editor, in Files: with its name and who may see it, owned by the caller. A doc has versions, comments, approvals and Share like any file, but no bytes to download and no previews. Members, admins and the owner may create one; viewers get `forbidden`. Sending the same request again with the same `Idempotency-Key` returns the same doc.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read_write","parameters":[{"name":"orgId","in":"path","required":true,"description":"The organization's id.","schema":{"$ref":"#/components/schemas/OrganizationId"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"A key you choose for this request, such as a UUID. Once the request has succeeded, sending it again with the same key gets the first answer back, with nothing done twice.","schema":{"$ref":"#/components/schemas/IdempotencyKey"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateDocBody"},"example":{"name":"Acme Q4 campaign brief","visibility":"organization"}}}},"responses":{"201":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FileDetail"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"idempotency_in_progress","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"422":{"description":"idempotency_key_reused","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/files/{fileId}/doc":{"get":{"operationId":"media.getDoc","tags":["media"],"summary":"Get a doc","description":"Returns a doc's content (the editor's JSON), its revision, its pages and words, and who is editing it now, if anyone. Needs view access to the doc; a file that is not a doc fails with `not_found`.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read","parameters":[{"name":"fileId","in":"path","required":true,"description":"The file's id.","schema":{"$ref":"#/components/schemas/FileId"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Doc"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"put":{"operationId":"media.saveDoc","tags":["media"],"summary":"Save a doc","description":"Saves a doc's whole content and renews the caller's edit lease. One editor at a time: the caller must hold the lease named by `leaseId` (`POST /v0/files/{fileId}/doc/edit`), else `state_conflict`. The server makes the Markdown copy agents read and counts the pages and words from the JSON. Send the revision you last read as `expectedRevision`; a stale one fails with `revision_conflict`. Every agent the doc mentions must be one of the organization's, else `validation_failed`; each mention is saved under its agent's current name, whatever label it was sent with. A version an agent's edit made is never written over: the save starts a new version from it. Needs edit access to the doc.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read_write","parameters":[{"name":"fileId","in":"path","required":true,"description":"The file's id.","schema":{"$ref":"#/components/schemas/FileId"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SaveDocBody"}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocSaved"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"revision_conflict, state_conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/files/{fileId}/doc/edit":{"post":{"operationId":"media.claimDocEdit","tags":["media"],"summary":"Start or keep editing a doc","description":"Takes the doc's edit lease for 60 seconds under `leaseId`, or renews the caller's own lease of that id: one editor at a time, and everyone else reads it. While another lease that has not ended is held, by someone else or by the same person in another tab, it fails with `state_conflict` (`currentStatus: editing`). Needs edit access to the doc.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read_write","parameters":[{"name":"fileId","in":"path","required":true,"description":"The file's id.","schema":{"$ref":"#/components/schemas/FileId"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClaimDocEditBody"}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocEditLease"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"state_conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/files/{fileId}/doc/edit/{leaseId}":{"delete":{"operationId":"media.releaseDocEdit","tags":["media"],"summary":"Stop editing a doc","description":"Gives the doc's edit lease of `leaseId` back, so someone else may edit it at once. A caller who holds no lease of that id changes nothing. Needs view access to the doc.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read_write","parameters":[{"name":"fileId","in":"path","required":true,"description":"The file's id.","schema":{"$ref":"#/components/schemas/FileId"}},{"name":"leaseId","in":"path","required":true,"description":"The lease to give back, as `POST /v0/files/{fileId}/doc/edit` took it.","schema":{"$ref":"#/components/schemas/DocLeaseId"}}],"responses":{"204":{"description":"Done. The answer has no body."},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/files/{fileId}/doc/restore":{"post":{"operationId":"media.restoreDocVersion","tags":["media"],"summary":"Restore a version of a doc","description":"Goes back to an earlier version of a doc: a new current version holds that version's content (`restoredFrom` names it), and every version stays in the history. Undoing an agent's edit restores the version before it. Refused with `state_conflict` while someone else's open editor holds the doc's edit lease, and once the doc holds 500 versions (`currentStatus` `full`). A person restores at most 30 times in 10 minutes, 10 of them on one doc (`429 rate_limited`). Needs edit access to the doc.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read_write","parameters":[{"name":"fileId","in":"path","required":true,"description":"The file's id.","schema":{"$ref":"#/components/schemas/FileId"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"A key you choose for this request, such as a UUID. Once the request has succeeded, sending it again with the same key gets the first answer back, with nothing done twice.","schema":{"$ref":"#/components/schemas/IdempotencyKey"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestoreDocVersionBody"}}}},"responses":{"201":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Doc"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"idempotency_in_progress, revision_conflict, state_conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"422":{"description":"idempotency_key_reused","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/orgs/{orgId}/files":{"get":{"operationId":"media.listFiles","tags":["media"],"summary":"List files","description":"Lists the files in the media library that the caller may view, newest first, 48 per page by default, with `totalCount` counting every match. Filter by type (`kinds`, `kindsNot`), by owner (`owner`) or to the files whose approval waits for the caller (`needsMe`); search with `q` (the name, who added the file and its source chat), ignoring case and accents; and change the order with `sort`. Send `facets=true` to get the filter counts with the first page. A cursor works only with the filters, search and order it was made with. Voice notes are not files and never appear.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read","parameters":[{"name":"orgId","in":"path","required":true,"description":"The organization's id.","schema":{"$ref":"#/components/schemas/OrganizationId"}},{"name":"kind","in":"query","required":false,"description":"Only files of one type: `image`, `video` or `document` (PDFs and documents). Not with `kinds`.","schema":{"$ref":"#/components/schemas/LibraryKind"}},{"name":"kinds","in":"query","required":false,"description":"Only files of any of these types, comma-separated: `image`, `video` or `document` (PDFs and documents).","schema":{"type":"string"}},{"name":"kindsNot","in":"query","required":false,"description":"Leaves out files of these types, comma-separated; audio and other files always stay.","schema":{"type":"string"}},{"name":"q","in":"query","required":false,"description":"Searches the name, who added the file and its source chat, ignoring case and accents: \"lopez\" finds \"López\".","schema":{"type":"string","maxLength":200}},{"name":"owner","in":"query","required":false,"description":"`me`: the files the caller owns; `others`: those someone else owns that the caller may view. Left out, both.","schema":{"$ref":"#/components/schemas/LibraryOwner"}},{"name":"needsMe","in":"query","required":false,"description":"`true` keeps only the files whose approval the caller may decide now.","schema":{"type":"string","pattern":"^(true|false)$"}},{"name":"sort","in":"query","required":false,"description":"`newest` first (the default) or `oldest` first by when the file was added, or by name: `name_asc` (A to Z) or `name_desc` (Z to A).","schema":{"$ref":"#/components/schemas/LibrarySort"}},{"name":"facets","in":"query","required":false,"description":"`true` adds the filter counts, `facets`, to the first page; ignored with a `cursor`.","schema":{"type":"string","pattern":"^(true|false)$"}},{"name":"cursor","in":"query","required":false,"description":"Where to continue: the `nextCursor` of the page before. Left out, the list starts at its beginning.","schema":{"$ref":"#/components/schemas/Cursor"}},{"name":"limit","in":"query","required":false,"description":"How many files to return, 1 to 200; 48 when left out.","schema":{"type":"string","pattern":"^-?(0|[1-9][0-9]*)$"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListFilesResult"},"example":{"items":[{"id":"file_01jbq4x8k2m4n6p8q0r2s4t6v8","organizationId":"org_01jaf2m4n6p8r0s2t4v6w8x0y2","name":"spring-launch-hero.png","kind":"image","mimeType":"image/png","sizeBytes":2604032,"currentVersionId":"fver_01jbr2d4e6f8g0h2j4k6m8n0p2","currentVersionNumber":2,"meta":{"width":1080,"height":1350,"durationMs":null,"pageCount":null},"processing":"ready","thumbnailUrl":"https://files.example.com/previews/spring-launch-hero-thumb.webp?signature=EXAMPLE","urlsExpireAt":"2026-10-21T10:30:00.000Z","origin":"library","sourceChat":null,"visibility":"organization","createdBy":"mbr_01jaf2q7c3d5e7g9h1k3m5n7p9","createdAt":"2026-10-20T15:04:00.000Z","annotationCount":2,"commentCount":3,"approval":{"approvalId":"apr_01jbr6t9v1w3x5y7z9a1b3c5d7","round":2,"status":"pending","pausedReason":null,"approvedCount":1,"approverCount":2,"viewer":{"isApprover":true,"myDecision":null,"canDecide":true,"canUndo":false}},"revision":13},{"id":"file_01jbm2c4d6e8f0g2h4j6k8m0n2","organizationId":"org_01jaf2m4n6p8r0s2t4v6w8x0y2","name":"northwind-teaser-15s.mp4","kind":"video","mimeType":"video/mp4","sizeBytes":18874368,"currentVersionId":"fver_01jbm2c4d7p9q1r3s5t7v9w1x3","currentVersionNumber":1,"meta":{"width":1080,"height":1920,"durationMs":15000,"pageCount":null},"processing":"ready","thumbnailUrl":"https://files.example.com/previews/northwind-teaser-thumb.webp?signature=EXAMPLE","urlsExpireAt":"2026-10-21T10:30:00.000Z","origin":"chat","sourceChat":{"id":"chat_01jaz5b7c9d1e3f5g7h9j1k3m5","name":"Client: Northwind Coffee","visibility":"organization"},"visibility":"organization","createdBy":"mbr_01jaf2q7c3d5e7g9h1k3m5n7p9","createdAt":"2026-10-19T11:20:00.000Z","annotationCount":0,"commentCount":1,"approval":null,"revision":4}],"nextCursor":null,"totalCount":2}}}},"400":{"description":"validation_failed, invalid_cursor","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/orgs/{orgId}/storage":{"get":{"operationId":"media.getStorageUsage","tags":["media"],"summary":"Get storage usage","description":"Reports how much file storage the organization uses, measured on each request: the library's files, versions and bytes, in total and by file kind, the uploads held outside the library, and the bytes added this calendar month. It counts what is stored, not downloads. Only the organization's owner and admins may call it; other members get `forbidden`.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read","parameters":[{"name":"orgId","in":"path","required":true,"description":"The organization's id.","schema":{"$ref":"#/components/schemas/OrganizationId"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StorageUsage"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/files/{fileId}":{"get":{"operationId":"media.getFile","tags":["media"],"summary":"Get a file","description":"Returns a file with its current version, all its versions (newest first), a summary of who can access it and the caller's own access level. Needs view access to the file.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read","parameters":[{"name":"fileId","in":"path","required":true,"description":"The file's id.","schema":{"$ref":"#/components/schemas/FileId"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FileDetail"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"patch":{"operationId":"media.updateFile","tags":["media"],"summary":"Rename a file","description":"Renames a file or a doc. The name is the file's own, not a version's: downloads and new versions keep it. The last rename wins: there is no `expectedRevision`, since comments, notes and processing also change the revision while the file is open. Needs edit access to the file; whoever may only view it gets `forbidden`, and a file the caller may not view answers `not_found`.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read_write","parameters":[{"name":"fileId","in":"path","required":true,"description":"The file's id.","schema":{"$ref":"#/components/schemas/FileId"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateFileBody"}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FileDetail"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"delete":{"operationId":"media.deleteFile","tags":["media"],"summary":"Delete a file","description":"Deletes a file and its versions. The file also leaves every table attachments cell that holds it, as deleting a record removes the links to it; messages show it as unavailable, and its approval is cancelled. The file's owner and the organization's owner and admins may delete it. Through an API key, a file whose comment thread has an agent still at work fails with `forbidden`.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read_write","parameters":[{"name":"fileId","in":"path","required":true,"description":"The file's id.","schema":{"$ref":"#/components/schemas/FileId"}}],"responses":{"204":{"description":"Done. The answer has no body."},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/files/{fileId}/versions":{"post":{"operationId":"media.addVersion","tags":["media"],"summary":"Add a version","description":"Adds a new version to a file from a completed upload with purpose `file_version` that the caller made for this file, with an optional `note` on what changed. Needs edit access to the file. When the file has an approval, the new version starts its next round, returned in `approval`. An upload still in progress fails with `upload_not_ready`, and one already used with `state_conflict`, as does a doc, which changes in its editor.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read_write","parameters":[{"name":"fileId","in":"path","required":true,"description":"The file's id.","schema":{"$ref":"#/components/schemas/FileId"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"A key you choose for this request, such as a UUID. Once the request has succeeded, sending it again with the same key gets the first answer back, with nothing done twice.","schema":{"$ref":"#/components/schemas/IdempotencyKey"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddVersionBody"}}}},"responses":{"201":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddVersionResult"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"idempotency_in_progress, state_conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"422":{"description":"idempotency_key_reused, upload_not_ready","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/files/{fileId}/versions/{versionId}":{"get":{"operationId":"media.getVersion","tags":["media"],"summary":"Get a version","description":"Returns one version of a file, the current one or an earlier one, with its pages, poster and playback links, signed until `urlsExpireAt`. Use it to show an earlier version; its annotations come from `GET /v0/files/{fileId}/versions/{versionId}/annotations`. Needs view access to the file; a version of another file fails with `not_found`.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read","parameters":[{"name":"fileId","in":"path","required":true,"description":"The file's id.","schema":{"$ref":"#/components/schemas/FileId"}},{"name":"versionId","in":"path","required":true,"description":"The id of one of the file's versions.","schema":{"$ref":"#/components/schemas/FileVersionId"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FileVersion"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/files/{fileId}/versions/{versionId}/download":{"post":{"operationId":"media.getDownloadUrl","tags":["media"],"summary":"Get a download link","description":"Returns a signed link that downloads one version of a file under the file's name. The link works for 5 minutes (`expiresAt`); a download that started in time may outlast it. Needs view access to the file. A doc has no bytes to download and fails with `state_conflict`. It changes nothing, so a `read` API key may call it.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read","parameters":[{"name":"fileId","in":"path","required":true,"description":"The file's id.","schema":{"$ref":"#/components/schemas/FileId"}},{"name":"versionId","in":"path","required":true,"description":"The id of one of the file's versions.","schema":{"$ref":"#/components/schemas/FileVersionId"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FileDownloadUrl"},"example":{"url":"https://files.example.com/downloads/spring-launch-hero.png?signature=EXAMPLE","expiresAt":"2026-10-21T09:35:00.000Z"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"state_conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/files/{fileId}/versions/{versionId}/annotations":{"get":{"operationId":"media.listAnnotations","tags":["media"],"summary":"List annotations","description":"Returns every annotation drawn on a version of a file, in number order (Note 1, Note 2 and so on), in one answer: a version holds at most 1,000 annotations, so the list has no pages. Needs view access to the file.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read","parameters":[{"name":"fileId","in":"path","required":true,"description":"The file's id.","schema":{"$ref":"#/components/schemas/FileId"}},{"name":"versionId","in":"path","required":true,"description":"The id of one of the file's versions.","schema":{"$ref":"#/components/schemas/FileVersionId"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListAnnotationsResult"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"post":{"operationId":"media.createAnnotation","tags":["media"],"summary":"Create an annotation","description":"Draws an annotation on one page of a version: a `pin`, `freehand`, `rect`, `ellipse` or `line` shape, with coordinates from 0 to 1 of the page, and on a video the moment in `timeMs` (`null` for any other file). Needs view access to the file. To tie it to a comment, add an annotation part to `POST /v0/files/{fileId}/comments`. A version holds at most 1,000 annotations, and one author at most 250 of them.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read_write","parameters":[{"name":"fileId","in":"path","required":true,"description":"The file's id.","schema":{"$ref":"#/components/schemas/FileId"}},{"name":"versionId","in":"path","required":true,"description":"The id of one of the file's versions.","schema":{"$ref":"#/components/schemas/FileVersionId"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"A key you choose for this request, such as a UUID. Once the request has succeeded, sending it again with the same key gets the first answer back, with nothing done twice.","schema":{"$ref":"#/components/schemas/IdempotencyKey"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateFileAnnotationBody"}}}},"responses":{"201":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Annotation"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"idempotency_in_progress","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"422":{"description":"idempotency_key_reused","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"delete":{"operationId":"media.clearAnnotations","tags":["media"],"summary":"Clear your annotations","description":"Deletes every annotation the caller drew on a version, or only those on one `page`, and returns how many were deleted. With `whose=guests`, the owner of the file and the organization owner and admins delete the guests' annotations instead (anyone else gets `forbidden`). A member's or an agent's annotations always stay.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read_write","parameters":[{"name":"fileId","in":"path","required":true,"description":"The file's id.","schema":{"$ref":"#/components/schemas/FileId"}},{"name":"versionId","in":"path","required":true,"description":"The id of one of the file's versions.","schema":{"$ref":"#/components/schemas/FileVersionId"}},{"name":"page","in":"query","required":false,"description":"Only clear this page, counting from 0; left out, every page of the version.","schema":{"type":"string","pattern":"^-?(0|[1-9][0-9]*)$"}},{"name":"whose","in":"query","required":false,"description":"Whose annotations to clear: `mine` (the default), or `guests`, the guests' drawings, for the file's owner and admins only.","schema":{"$ref":"#/components/schemas/ClearAnnotationsWhose"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClearAnnotationsResult"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/annotations/{annotationId}":{"delete":{"operationId":"media.deleteAnnotation","tags":["media"],"summary":"Delete an annotation","description":"Deletes an annotation the caller drew, as Undo does. The owner of the file and the organization owner and admins may also delete an annotation a guest drew through a review link, on any version. Deleting anyone else's fails with `forbidden`. A comment that referred to it shows it as unavailable.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read_write","parameters":[{"name":"annotationId","in":"path","required":true,"description":"The annotation's id.","schema":{"$ref":"#/components/schemas/AnnotationId"}}],"responses":{"204":{"description":"Done. The answer has no body."},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/files/{fileId}/comments":{"get":{"operationId":"media.listComments","tags":["media"],"summary":"List comments","description":"Returns a page of a file's comment thread, oldest first; without a cursor, the latest page. `versionId` keeps one version's comments. Page with `before` or `after`, or open the page around one comment with `around` (for a deep link), using at most one of them; 50 per page by default, up to 200. Needs view access to the file.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read","parameters":[{"name":"fileId","in":"path","required":true,"description":"The file's id.","schema":{"$ref":"#/components/schemas/FileId"}},{"name":"versionId","in":"query","required":false,"description":"Only this version's comments; left out, those of every version.","schema":{"$ref":"#/components/schemas/FileVersionId"}},{"name":"before","in":"query","required":false,"description":"The page of older comments: a page's `olderCursor`.","schema":{"$ref":"#/components/schemas/Cursor"}},{"name":"after","in":"query","required":false,"description":"The page of newer comments: a page's `newerCursor`.","schema":{"$ref":"#/components/schemas/Cursor"}},{"name":"around","in":"query","required":false,"description":"The page around this comment, for a link to it.","schema":{"$ref":"#/components/schemas/MessageId"}},{"name":"limit","in":"query","required":false,"description":"How many comments to return, 1 to 200; 50 when left out.","schema":{"type":"string","pattern":"^-?(0|[1-9][0-9]*)$"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessagePage"}}}},"400":{"description":"validation_failed, invalid_cursor","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"post":{"operationId":"media.postComment","tags":["media"],"summary":"Create a comment","description":"Posts a comment on a version of a file, in the file's one comment thread. It can hold text, mentions, annotation references, attachments and voice notes. A mentioned agent replies in the thread; a busy one waits its turn, so posting never fails because of it. Needs view access to the file. A voice note whose transcript is not ready yet fails with `upload_not_ready`: send the same request again.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read_write","parameters":[{"name":"fileId","in":"path","required":true,"description":"The file's id.","schema":{"$ref":"#/components/schemas/FileId"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"A key you choose for this request, such as a UUID. Once the request has succeeded, sending it again with the same key gets the first answer back, with nothing done twice.","schema":{"$ref":"#/components/schemas/IdempotencyKey"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostFileCommentBody"}}}},"responses":{"201":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostMessageResult"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden, mention_not_allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"idempotency_in_progress","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"422":{"description":"idempotency_key_reused, upload_not_ready","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/files/{fileId}/comments/{messageId}":{"delete":{"operationId":"media.removeGuestComment","tags":["media"],"summary":"Remove a guest's comment","description":"Takes a comment a guest wrote through a review link off the review page, where the link holders no longer see it. The team still sees it in the file's comments, marked `hiddenFromReview`. The file's owner and the organization owner and admins may, as for a guest's annotation; anyone else fails with `forbidden`. A comment that is not a guest's, or was removed already, fails with `not_found`.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read_write","parameters":[{"name":"fileId","in":"path","required":true,"description":"The file's id.","schema":{"$ref":"#/components/schemas/FileId"}},{"name":"messageId","in":"path","required":true,"description":"The comment's id.","schema":{"$ref":"#/components/schemas/MessageId"}}],"responses":{"204":{"description":"Done. The answer has no body."},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/files/{fileId}/comments/{messageId}/resolution":{"put":{"operationId":"media.resolveComment","tags":["media"],"summary":"Resolve a comment","description":"Marks a comment of the file's thread resolved, or open again with `resolved: false`, and returns it with its `resolved` field and a higher `revision`. A comment of an earlier version that is still open carries into the review of the newer one; a resolved one stays in its own version's history. Asking for the state it already has changes nothing. Needs view access to the file; a system line is never resolved (`not_found`).","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read_write","parameters":[{"name":"fileId","in":"path","required":true,"description":"The file's id.","schema":{"$ref":"#/components/schemas/FileId"}},{"name":"messageId","in":"path","required":true,"description":"The comment's id.","schema":{"$ref":"#/components/schemas/MessageId"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResolveCommentBody"}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Message"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/files/{fileId}/approval":{"get":{"operationId":"media.getFileApproval","tags":["media"],"summary":"Get a file's approval","description":"Returns the approval of a file, with its current round, its approvers and their decisions, and what the caller may do, or `null` when nobody requested one. Needs view access to the file.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read","parameters":[{"name":"fileId","in":"path","required":true,"description":"The file's id.","schema":{"$ref":"#/components/schemas/FileId"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/Approval"},{"type":"null"}]}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"post":{"operationId":"media.requestApproval","tags":["media"],"summary":"Request an approval","description":"Asks up to 20 members to approve the current version of a file; the caller owns the approval. A doc is frozen as it is now: that version is the one under review, and editing goes on in a new current version; `docPageIds` narrows the approval to some of its pages. Needs edit access to the file, and each approver must be an active member who may view it. A file that already has an approval, or a doc too long to freeze or holding 500 versions, fails with `state_conflict`: add approvers to the approval instead. A doc is frozen at most 10 times in 10 minutes per person (`429 rate_limited`). To ask a guest without an account, create an approval link with `POST /v0/orgs/{orgId}/approval-links`. The `outsideAgentsMayDecide` field is deprecated and ignored.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read_write","parameters":[{"name":"fileId","in":"path","required":true,"description":"The file's id.","schema":{"$ref":"#/components/schemas/FileId"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"A key you choose for this request, such as a UUID. Once the request has succeeded, sending it again with the same key gets the first answer back, with nothing done twice.","schema":{"$ref":"#/components/schemas/IdempotencyKey"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestApprovalBody"}}}},"responses":{"201":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Approval"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"idempotency_in_progress, state_conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"422":{"description":"idempotency_key_reused","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/approvals/{approvalId}":{"get":{"operationId":"media.getApproval","tags":["media"],"summary":"Get an approval","description":"Returns an approval by its id: a file's approval or a flow step's sign-off, for example one a notification or a link points to. Needs view access to its file or flow.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read","parameters":[{"name":"approvalId","in":"path","required":true,"description":"The approval's id.","schema":{"$ref":"#/components/schemas/ApprovalId"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Approval"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/orgs/{orgId}/approvals":{"get":{"operationId":"media.listApprovals","tags":["media"],"summary":"List approvals","description":"Lists the approvals the caller may view, of files and of flow sign-offs, newest first. Filter by `status`, by `subject` or by one flow run (`flowRunId`). With `decidableByMe=true` it keeps only those the caller may decide now: their queue of approvals to give.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read","parameters":[{"name":"orgId","in":"path","required":true,"description":"The organization's id.","schema":{"$ref":"#/components/schemas/OrganizationId"}},{"name":"status","in":"query","required":false,"description":"Only approvals with this status; left out, every status.","schema":{"$ref":"#/components/schemas/ApprovalStatus"}},{"name":"decidableByMe","in":"query","required":false,"description":"`true` keeps only the approvals the caller may decide now: their queue.","schema":{"type":"string","pattern":"^(true|false)$"}},{"name":"subject","in":"query","required":false,"description":"`file` for the approvals of files, `flow_step` for the sign-offs of flow runs; left out, both.","schema":{"$ref":"#/components/schemas/ApprovalSubjectKind"}},{"name":"flowRunId","in":"query","required":false,"description":"Only this flow run's sign-offs.","schema":{"$ref":"#/components/schemas/FlowRunId"}},{"name":"cursor","in":"query","required":false,"description":"Where to continue: the `nextCursor` of the page before. Left out, the list starts at its beginning.","schema":{"$ref":"#/components/schemas/Cursor"}},{"name":"limit","in":"query","required":false,"description":"How many items to return, 1 to 200; 50 when left out.","schema":{"type":"string","pattern":"^-?(0|[1-9][0-9]*)$"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApprovalPage"}}}},"400":{"description":"validation_failed, invalid_cursor","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/files/{fileId}/approval/rounds":{"post":{"operationId":"media.startDocRound","tags":["media"],"summary":"Send a doc's changes for review","description":"Starts a new round of a doc's approval on the doc as it is now: that content is frozen as a new version under review, every decision starts again and the approvers stay. A file that is no doc, an approval that is cancelled or paused, a doc with no approval, or one too long to freeze or holding 500 versions fails with `state_conflict`. A person sends a doc for review at most 10 times in 10 minutes (`429 rate_limited`). Needs edit access to the doc.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read_write","parameters":[{"name":"fileId","in":"path","required":true,"description":"The file's id.","schema":{"$ref":"#/components/schemas/FileId"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"A key you choose for this request, such as a UUID. Once the request has succeeded, sending it again with the same key gets the first answer back, with nothing done twice.","schema":{"$ref":"#/components/schemas/IdempotencyKey"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartDocRoundBody"}}}},"responses":{"201":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Approval"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"idempotency_in_progress, state_conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"422":{"description":"idempotency_key_reused","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/approvals/{approvalId}/approvers":{"post":{"operationId":"media.addApprovers","tags":["media"],"summary":"Add approvers","description":"Adds members as approvers of an approval's current round, up to 20 approvers in all; anyone already an approver is left out. Only the approval's creator or owner may, while it is open: a paused or cancelled approval fails with `state_conflict`. Send the `expectedRevision` you read. Only a signed-in person may call it, never an API key.","security":[{"session":[]}],"x-api-key-scope":"none","parameters":[{"name":"approvalId","in":"path","required":true,"description":"The approval's id.","schema":{"$ref":"#/components/schemas/ApprovalId"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"A key you choose for this request, such as a UUID. Once the request has succeeded, sending it again with the same key gets the first answer back, with nothing done twice.","schema":{"$ref":"#/components/schemas/IdempotencyKey"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddApproversBody"}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Approval"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"idempotency_in_progress, revision_conflict, state_conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"422":{"description":"idempotency_key_reused","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/approvals/{approvalId}/approvers/{approverKey}":{"delete":{"operationId":"media.removeApprover","tags":["media"],"summary":"Remove an approver","description":"Removes an approver from an approval, with their decision in the current round. Only the approval's creator or owner may, while it is open. The last approver cannot be removed (`state_conflict`), and a removal that leaves only approvers who approved completes the approval. Only a signed-in person may call it, never an API key.","security":[{"session":[]}],"x-api-key-scope":"none","parameters":[{"name":"approvalId","in":"path","required":true,"description":"The approval's id.","schema":{"$ref":"#/components/schemas/ApprovalId"}},{"name":"approverKey","in":"path","required":true,"description":"The approver's `key`: a member's id, or a guest's contact id.","schema":{"$ref":"#/components/schemas/ApproverKey"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Approval"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"state_conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/approvals/{approvalId}/decisions":{"post":{"operationId":"media.decide","tags":["media"],"summary":"Approve, or send a sign-off back","description":"Records the caller's decision in the given `round` of an approval. An approver decides once per round; a second decision or a stale round fails with `state_conflict`. A file is approved, optionally with a `comment` posted in the file's thread; its reviewers ask for changes by commenting, and its round stays open until approved. A flow sign-off is approved, or sent back (`changes_requested`) with a `reason`, which sends the run back or fails it, as the flow step defines. Through an API key, it decides only where the key's member is the approver, for a kind of approval ticked on the key, where the approval and the organization let outside agents decide, never on work the key itself set in motion (an approval it requested, a version it uploaded or a run it started), and within the key's cap of 60 decisions an hour; otherwise it fails with `forbidden` and the reason.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read_write","parameters":[{"name":"approvalId","in":"path","required":true,"description":"The approval's id.","schema":{"$ref":"#/components/schemas/ApprovalId"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"A key you choose for this request, such as a UUID. Once the request has succeeded, sending it again with the same key gets the first answer back, with nothing done twice.","schema":{"$ref":"#/components/schemas/IdempotencyKey"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DecideApprovalBody"},"example":{"round":2,"decision":"approved","comment":{"parts":[{"type":"text","text":"Looks great, approved."}]}}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DecideApprovalResult"},"example":{"approval":{"id":"apr_01jbr6t9v1w3x5y7z9a1b3c5d7","organizationId":"org_01jaf2m4n6p8r0s2t4v6w8x0y2","subject":{"kind":"file","fileId":"file_01jbq4x8k2m4n6p8q0r2s4t6v8","versionId":"fver_01jbr2d4e6f8g0h2j4k6m8n0p2"},"ownerId":"mbr_01jaf2q7c3d5e7g9h1k3m5n7p9","createdBy":"mbr_01jaf2q7c3d5e7g9h1k3m5n7p9","round":2,"status":"approved","pausedReason":null,"outsideAgentsMayDecide":true,"approvers":[{"key":"mbr_01jaf2s9t1v3w5x7y9z1a3b5c7","who":{"kind":"member","memberId":"mbr_01jaf2s9t1v3w5x7y9z1a3b5c7"},"order":0,"decision":"approved","decidedAt":"2026-10-21T08:55:00.000Z","reasonMessageId":null,"via":"app","apiKey":null,"addedBy":"mbr_01jaf2q7c3d5e7g9h1k3m5n7p9","addedAt":"2026-10-20T15:10:00.000Z"},{"key":"mbr_01jaf2r8s0t2v4w6x8y0z2a4b6","who":{"kind":"member","memberId":"mbr_01jaf2r8s0t2v4w6x8y0z2a4b6"},"order":1,"decision":"approved","decidedAt":"2026-10-21T09:42:00.000Z","reasonMessageId":null,"via":"app","apiKey":null,"addedBy":"mbr_01jaf2q7c3d5e7g9h1k3m5n7p9","addedAt":"2026-10-20T15:10:00.000Z"}],"viewerIds":["mbr_01jaf2q7c3d5e7g9h1k3m5n7p9"],"approvedCount":2,"approverCount":2,"viewer":{"isApprover":true,"myDecision":"approved","canDecide":false,"canUndo":true,"canAddApprovers":false},"createdAt":"2026-10-20T15:10:00.000Z","updatedAt":"2026-10-21T09:42:00.000Z","revision":6},"comment":{"id":"msg_01jbs8a2b4c6d8e0f2g4h6j8k0","thread":{"kind":"file","fileId":"file_01jbq4x8k2m4n6p8q0r2s4t6v8"},"fileVersionId":"fver_01jbr2d4e6f8g0h2j4k6m8n0p2","seq":7,"author":{"kind":"actor","actorId":"mbr_01jaf2r8s0t2v4w6x8y0z2a4b6"},"parts":[{"type":"text","text":"Looks great, approved."}],"mentionedActorIds":[],"triggeredTurnIds":[],"turnId":null,"chainId":null,"onBehalfOf":null,"resolved":null,"clientMessageId":"b7e2c9d4a1f6e8b3c5d7a9f1e3b5c7d9","createdAt":"2026-10-21T09:42:00.000Z","revision":1},"notice":{"id":"msg_01jbs8a3m5n7p9q1r3s5t7v9w1","thread":{"kind":"file","fileId":"file_01jbq4x8k2m4n6p8q0r2s4t6v8"},"fileVersionId":"fver_01jbr2d4e6f8g0h2j4k6m8n0p2","seq":8,"author":{"kind":"actor","actorId":"sys_01j8x2c4d6e8f0g2h4j6k8m0p2"},"parts":[{"type":"notice","notice":{"code":"approval_decided","approvalId":"apr_01jbr6t9v1w3x5y7z9a1b3c5d7","round":2,"decision":"approved","by":{"kind":"member","memberId":"mbr_01jaf2r8s0t2v4w6x8y0z2a4b6"},"apiKey":null}}],"mentionedActorIds":[],"triggeredTurnIds":[],"turnId":null,"chainId":null,"onBehalfOf":null,"resolved":null,"clientMessageId":null,"createdAt":"2026-10-21T09:42:00.000Z","revision":1}}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden, mention_not_allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"idempotency_in_progress, state_conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"422":{"description":"idempotency_key_reused, upload_not_ready","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/approvals/{approvalId}/decisions/mine":{"delete":{"operationId":"media.undoDecision","tags":["media"],"summary":"Undo a decision","description":"Withdraws the caller's decision in the current round of an approval. A comment given with a change request stays in the thread. A flow sign-off cannot be undone (`state_conflict`). Only a signed-in person may call it, never an API key.","security":[{"session":[]}],"x-api-key-scope":"none","parameters":[{"name":"approvalId","in":"path","required":true,"description":"The approval's id.","schema":{"$ref":"#/components/schemas/ApprovalId"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UndoDecisionResult"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"state_conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/orgs/{orgId}/approvals/decisions":{"post":{"operationId":"media.approveMany","tags":["media"],"summary":"Approve in bulk","description":"Approves up to 50 approvals at once, each in its given `round`, as a gallery's \"Approve all\" does. It is all or nothing: one refused item refuses the request and nothing is written. An item the caller already approved in that round is left as it is; one where they requested changes fails with `state_conflict`, and so does a flow sign-off. Only a signed-in person may call it, never an API key.","security":[{"session":[]}],"x-api-key-scope":"none","parameters":[{"name":"orgId","in":"path","required":true,"description":"The organization's id.","schema":{"$ref":"#/components/schemas/OrganizationId"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"A key you choose for this request, such as a UUID. Once the request has succeeded, sending it again with the same key gets the first answer back, with nothing done twice.","schema":{"$ref":"#/components/schemas/IdempotencyKey"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApproveManyBody"}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApproveManyResult"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"idempotency_in_progress, state_conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"422":{"description":"idempotency_key_reused","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/approvals/{approvalId}/resume":{"post":{"operationId":"media.resumeApproval","tags":["media"],"summary":"Resume an approval","description":"Resumes an approval that was paused because its owner was deactivated, and makes the caller its new owner. The organization owner gets a notification that links to each approval that pauses. Only the organization's owner and admins may resume one, as signed-in people, never through an API key. Send the `expectedRevision` you read; an approval that is not paused fails with `state_conflict`.","security":[{"session":[]}],"x-api-key-scope":"none","parameters":[{"name":"approvalId","in":"path","required":true,"description":"The approval's id.","schema":{"$ref":"#/components/schemas/ApprovalId"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResumeApprovalBody"}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Approval"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"revision_conflict, state_conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/orgs/{orgId}/approval-links":{"post":{"operationId":"media.createApprovalLink","tags":["media"],"summary":"Create an approval link","description":"Creates a review link for one guest, named by email, for up to 50 files, so they can review and approve them without an account. Needs share access to every file. The recipient becomes an approver of each file, whose approval the link creates when it has none: a doc is then frozen for review, all its pages or `docPageIds`. Adding the recipient to an approval that exists is its creator's or owner's, as `addApprovers` is: anyone else fails with `forbidden`, unless the recipient is an approver already. A paused or cancelled approval fails with `state_conflict`, and a member's email with `duplicate` (share with members directly). By default the server emails the link to the recipient (`delivery` set to `none` only returns it, to copy), and the recipient confirms their email with a one-time code before deciding (`requireCode`). The link lasts 7 days unless `expiresInDays` says otherwise, at most 30. This is the only response that holds the link's URL.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read_write","parameters":[{"name":"orgId","in":"path","required":true,"description":"The organization's id.","schema":{"$ref":"#/components/schemas/OrganizationId"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"A key you choose for this request, such as a UUID. Once the request has succeeded, sending it again with the same key gets the first answer back, with nothing done twice.","schema":{"$ref":"#/components/schemas/IdempotencyKey"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateApprovalLinkBody"}}}},"responses":{"201":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateApprovalLinkResult"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"idempotency_in_progress, state_conflict, duplicate","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"422":{"description":"idempotency_key_reused","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"get":{"operationId":"media.listApprovalLinks","tags":["media"],"summary":"List approval links","description":"Lists the approval links the caller manages, newest first: the ones they issued and those whose files they may all share, each with its status and how often it was opened. Filter by one file (`fileId`) or by `status`.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read","parameters":[{"name":"orgId","in":"path","required":true,"description":"The organization's id.","schema":{"$ref":"#/components/schemas/OrganizationId"}},{"name":"fileId","in":"query","required":false,"description":"Only the links that include this file.","schema":{"$ref":"#/components/schemas/FileId"}},{"name":"status","in":"query","required":false,"description":"Only the links with this status: `active`, `revoked` or `expired`.","schema":{"$ref":"#/components/schemas/ApprovalLinkStatus"}},{"name":"cursor","in":"query","required":false,"description":"Where to continue: the `nextCursor` of the page before. Left out, the list starts at its beginning.","schema":{"$ref":"#/components/schemas/Cursor"}},{"name":"limit","in":"query","required":false,"description":"How many items to return, 1 to 200; 50 when left out.","schema":{"type":"string","pattern":"^-?(0|[1-9][0-9]*)$"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListApprovalLinksResult"}}}},"400":{"description":"validation_failed, invalid_cursor","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/approval-links/{linkId}/revoke":{"post":{"operationId":"media.revokeApprovalLink","tags":["media"],"summary":"Revoke an approval link","description":"Revokes a guest's approval link at once: every request through it then fails with `link_invalid`. The link's issuer, or a member who may share its files, may revoke it. The recipient stays an approver of the files until removed. Revoking a revoked link returns it as it is.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read_write","parameters":[{"name":"linkId","in":"path","required":true,"description":"The approval link's id.","schema":{"$ref":"#/components/schemas/ApprovalLinkId"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApprovalLink"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/files/{fileId}/public-links":{"post":{"operationId":"media.createPublicFileLink","tags":["media"],"summary":"Make a public file link","description":"Makes a link to one version of a file that any server downloads with no sign-in, so an outside service can fetch it. It works for 24 hours unless `hours` says otherwise, at most 168, and can be turned off sooner. Needs share access to the file. A doc has no file to download and fails with `state_conflict`, and so does an organization whose admins turned public links off. The answer is the only one that holds the link's address.","security":[{"session":[]}],"x-api-key-scope":"none","parameters":[{"name":"fileId","in":"path","required":true,"description":"The file's id.","schema":{"$ref":"#/components/schemas/FileId"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePublicFileLinkBody"}}}},"responses":{"201":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePublicFileLinkResult"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"state_conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"get":{"operationId":"media.listPublicFileLinks","tags":["media"],"summary":"List a file's public links","description":"Lists a file's public links, newest first, at most 100: who made each, for which version, until when, and how often it was opened, never its address. For whoever may share the file, the owner and admins; anyone else who may view it gets only the links they made.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read","parameters":[{"name":"fileId","in":"path","required":true,"description":"The file's id.","schema":{"$ref":"#/components/schemas/FileId"}},{"name":"status","in":"query","required":false,"description":"Only the links with this status: `active`, `revoked` or `expired`.","schema":{"$ref":"#/components/schemas/PublicFileLinkStatus"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListPublicFileLinksResult"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/public-file-links/{linkId}/revoke":{"post":{"operationId":"media.revokePublicFileLink","tags":["media"],"summary":"Turn off a public link","description":"Turns a public link off at once: opening it then fails with `not_found`. Its maker, whoever may share its file, and the owner and admins may turn it off. Turning off a link that is off already returns it as it is.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read_write","parameters":[{"name":"linkId","in":"path","required":true,"description":"The public link's id.","schema":{"$ref":"#/components/schemas/PublicFileLinkId"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicFileLink"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/public/files/{token}/{filename}":{"get":{"operationId":"media.getPublicFile","tags":["media"],"summary":"Download a public file","description":"Redirects (`302`) to a signed link of the file a public link shares, which downloads it under the file's name for 10 minutes. Public: no sign-in needed. A link that is unknown, turned off or past its time, or whose file was deleted, fails with `not_found`; past 60 such answers to one address in 10 minutes, or 600 requests in all, every request answers `429 rate_limited`.","security":[],"parameters":[{"name":"token","in":"path","required":true,"description":"The link's token, from its address.","schema":{"$ref":"#/components/schemas/PublicFileToken"}},{"name":"filename","in":"path","required":true,"description":"The file's name as the link was made; any name opens the same file.","schema":{"type":"string","minLength":1,"maxLength":1024}}],"responses":{"302":{"description":"A redirect to the address in Location.","headers":{"Location":{"required":true,"schema":{"type":"string"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/orgs/{orgId}/doc-search":{"get":{"operationId":"media.searchDocs","tags":["media"],"summary":"Search docs","description":"Finds the passages of docs written in Fleepr that hold every word of `q`, best match first, each with its doc, its page and the heading above it: in the current version of the docs shared with the caller, or only in the doc `fileId` names. A doc the caller may not view answers `404 not_found`. A search that takes too long answers `503 unavailable`.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read","parameters":[{"name":"orgId","in":"path","required":true,"description":"The organization's id.","schema":{"$ref":"#/components/schemas/OrganizationId"}},{"name":"q","in":"query","required":true,"description":"The words to find, in any order: a word of two letters or digits as a whole word, a longer one as a whole word or the start of one; single letters are ignored. Up to 200 characters.","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"fileId","in":"query","required":false,"description":"Only this doc, one the caller may view; left out, the docs shared with the caller.","schema":{"$ref":"#/components/schemas/FileId"}},{"name":"limit","in":"query","required":false,"description":"How many passages to return, 1 to 10; 5 when left out.","schema":{"type":"string","pattern":"^-?(0|[1-9][0-9]*)$"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchDocsResult"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/public/review/session":{"post":{"operationId":"review.openSession","tags":["review"],"summary":"Open a review session","description":"Exchanges an approval link's token, read from the link's URL fragment, for a review session, and sets the review cookie that the other guest review operations need. Public: the guest needs no account. Call it on every open of the review page: with a valid review cookie for the same link it returns that session, with its role and guest, so a verified recipient confirms their email once per browser. A new session has role `other`, which sees the files only when the link allows others to comment. A revoked, expired or unknown link, or one whose issuer may no longer share its files, fails with `link_invalid`.","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenReviewSessionBody"}}}},"responses":{"201":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewSession"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"410":{"description":"link_invalid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"patch":{"operationId":"review.identify","tags":["review"],"summary":"Set the guest name","description":"Sets the guest's name, needed before their first comment, annotation or decision. The verified recipient sets their own name; anyone else holding the link becomes a guest with that name, which needs the `comment` permission, and one link names at most 50 such guests: the next answers `state_conflict`, `currentStatus` `full`. On a link that requires no code, whoever names themselves becomes the recipient instead: the session becomes role `recipient` and the review cookie is replaced, so reopen the review stream. That name stays with the session and its decisions, and never renames the recipient.","security":[{"review":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IdentifyReviewGuestBody"}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewSession"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"state_conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"410":{"description":"link_invalid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/public/review/session/code":{"post":{"operationId":"review.sendCode","tags":["review"],"summary":"Send a verification code","description":"Emails a 6-digit one-time code to the link's recipient, never to an address the caller gives, to confirm their email with `POST /v0/public/review/session/verify`. A code lasts 10 minutes and replaces any earlier one; resends are rate limited. Needs the review cookie. A session already verified, or a link that requires no code, fails with `state_conflict`.","security":[{"review":[]}],"responses":{"202":{"description":"Accepted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewCodeSent"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"state_conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"410":{"description":"link_invalid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/public/review/session/verify":{"post":{"operationId":"review.verify","tags":["review"],"summary":"Verify a code","description":"Confirms the recipient's email with the code from `POST /v0/public/review/session/code`. The session becomes role `recipient` and the review cookie is replaced, so reopen the review stream. A wrong, expired or spent code fails with `validation_failed` at `code`, and 5 wrong tries spend a code. A session already verified is returned unchanged. On a link that requires no code there is no code to check, so it fails with `validation_failed`.","security":[{"review":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerifyReviewCodeBody"}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewSession"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"410":{"description":"link_invalid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/public/review/files/{fileId}":{"get":{"operationId":"review.getFile","tags":["review"],"summary":"Get a file","description":"Returns one of the link's files with its current version's pages, poster and playback links, signed for 15 minutes, and what guests added through the file's approval links: the annotations on that version and the newest 500 comments, never the team's internal thread. Needs the session's `view` permission.","security":[{"review":[]}],"parameters":[{"name":"fileId","in":"path","required":true,"description":"The id of one of the link's files.","schema":{"$ref":"#/components/schemas/FileId"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicFileDetail"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"410":{"description":"link_invalid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/public/review/files/{fileId}/comments":{"post":{"operationId":"review.postComment","tags":["review"],"summary":"Create a comment","description":"Posts a plain-text comment of up to 5,000 characters as the guest, on a version of the file, optionally pointing to an annotation a guest drew on that version (`annotationId`). It takes no mentions or attachments. The team sees it in the file's thread. Needs the session's `comment` permission and a guest name, set with `PATCH /v0/public/review/session`.","security":[{"review":[]}],"parameters":[{"name":"fileId","in":"path","required":true,"description":"The id of one of the link's files.","schema":{"$ref":"#/components/schemas/FileId"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"A key you choose for this request, such as a UUID. Once the request has succeeded, sending it again with the same key gets the first answer back, with nothing done twice.","schema":{"$ref":"#/components/schemas/IdempotencyKey"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostReviewCommentBody"}}}},"responses":{"201":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicComment"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"idempotency_in_progress","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"410":{"description":"link_invalid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"422":{"description":"idempotency_key_reused","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/public/review/files/{fileId}/annotations":{"post":{"operationId":"review.createAnnotation","tags":["review"],"summary":"Create an annotation","description":"Draws an annotation as the guest on one page of a version (`versionId`), with the same shapes and limits as a team member's. Needs the session's `annotate` permission and a guest name, set with `PATCH /v0/public/review/session`.","security":[{"review":[]}],"parameters":[{"name":"fileId","in":"path","required":true,"description":"The id of one of the link's files.","schema":{"$ref":"#/components/schemas/FileId"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"A key you choose for this request, such as a UUID. Once the request has succeeded, sending it again with the same key gets the first answer back, with nothing done twice.","schema":{"$ref":"#/components/schemas/IdempotencyKey"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateReviewAnnotationBody"}}}},"responses":{"201":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicAnnotation"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"idempotency_in_progress","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"410":{"description":"link_invalid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"422":{"description":"idempotency_key_reused","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/public/review/annotations/{annotationId}":{"delete":{"operationId":"review.deleteAnnotation","tags":["review"],"summary":"Delete an annotation","description":"Deletes an annotation this guest drew, as Undo does, never anyone else's: another guest's fails with `forbidden`, and the team's with `not_found`.","security":[{"review":[]}],"parameters":[{"name":"annotationId","in":"path","required":true,"description":"The annotation's id.","schema":{"$ref":"#/components/schemas/AnnotationId"}}],"responses":{"204":{"description":"Done. The answer has no body."},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"410":{"description":"link_invalid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/public/review/files/{fileId}/decision":{"post":{"operationId":"review.decide","tags":["review"],"summary":"Approve a file","description":"Records the recipient's approval in the file's current `round`. To ask for changes, comment instead: the round stays open until approved. Only the link's recipient may decide, as an approver of the round, once they have a name, and only once per round: a second decision, a stale round, or a paused or cancelled approval fails with `state_conflict`.","security":[{"review":[]}],"parameters":[{"name":"fileId","in":"path","required":true,"description":"The id of one of the link's files.","schema":{"$ref":"#/components/schemas/FileId"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"A key you choose for this request, such as a UUID. Once the request has succeeded, sending it again with the same key gets the first answer back, with nothing done twice.","schema":{"$ref":"#/components/schemas/IdempotencyKey"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewDecisionBody"}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewDecisionResult"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"idempotency_in_progress, state_conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"410":{"description":"link_invalid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"422":{"description":"idempotency_key_reused","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/public/review/files/{fileId}/comments/{messageId}/resolution":{"put":{"operationId":"review.resolveComment","tags":["review"],"summary":"Resolve a comment","description":"Marks a comment the page shows resolved, or open again with `resolved: false`. A comment of an earlier version that is still open carries into the review of the newer one. Needs the session's `comment` permission and a guest name, set with `PATCH /v0/public/review/session`.","security":[{"review":[]}],"parameters":[{"name":"fileId","in":"path","required":true,"description":"The id of one of the link's files.","schema":{"$ref":"#/components/schemas/FileId"}},{"name":"messageId","in":"path","required":true,"description":"The comment's id.","schema":{"$ref":"#/components/schemas/MessageId"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"A key you choose for this request, such as a UUID. Once the request has succeeded, sending it again with the same key gets the first answer back, with nothing done twice.","schema":{"$ref":"#/components/schemas/IdempotencyKey"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResolveReviewCommentBody"}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicComment"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"idempotency_in_progress","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"410":{"description":"link_invalid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"422":{"description":"idempotency_key_reused","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/public/review/files/{fileId}/versions/{versionId}/download":{"post":{"operationId":"review.getDownloadUrl","tags":["review"],"summary":"Get a download link","description":"Returns a signed link that downloads the version the page shows (`PublicFile.versionId`) under its name, valid for 5 minutes; any other version fails with `not_found`. Only the link's recipient may call it, when the link allows downloads (the session's `download` permission).","security":[{"review":[]}],"parameters":[{"name":"fileId","in":"path","required":true,"description":"The id of one of the link's files.","schema":{"$ref":"#/components/schemas/FileId"}},{"name":"versionId","in":"path","required":true,"description":"The id of one of the file's versions.","schema":{"$ref":"#/components/schemas/FileVersionId"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FileDownloadUrl"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"410":{"description":"link_invalid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/public/forms/open":{"post":{"operationId":"formPage.open","tags":["formPage"],"summary":"Open a form","description":"Opens a form for one response: send a form link's secret, read from the part of its address after the `#`, or a form's id, for a member who responds inside Fleepr (it needs their session cookie, `401 unauthenticated` without one, and view access to the form's table, `404 not_found` otherwise). Answers the form as its page shows it and a session for this response, which the other form page requests send back; it lasts a day. A member signed in to the organization who opens a link responds as themselves. Values in `address` prefill the questions the respondent answers. A link that no longer works, or a form that takes no responses, fails with `410 link_invalid`.","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenFormBody"},"example":{"token":"Q2FybGEncyBsaW5rIHNlY3JldCwgbWFkZS11cA-EXAMPLE","address":{"Platform":"TikTok"}}}}},"responses":{"201":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenFormResult"},"example":{"form":{"organization":{"name":"Brightline Studio","squareLogoUrl":null,"horizontalLogoUrl":null},"title":"Creator brief","description":"Record your take for the spring campaign.","submitLabel":"Send","askRespondent":"off","respondingAs":null,"fields":[{"columnId":"col_01jcd5d7f9h1k3n5q7s9v1x3zb","type":"text","label":"Your name","help":null,"required":true,"access":"editable","display":"short","options":[],"number":null,"includeTime":null,"value":"Carla Ruiz","labels":[],"files":null}]},"session":"eyJ2IjoxLCJsIjoiZmxpbmtfMDFqY2Q0YzZlOGcwajJtNHA2cjh0MHcyeWEifQ.EXAMPLE-signature","expiresAt":"2026-11-04T10:00:00.000Z"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"410":{"description":"link_invalid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/public/forms/uploads":{"post":{"operationId":"formPage.createUpload","tags":["formPage"],"summary":"Start a form upload","description":"Starts the upload of a file for a file question of the form: answers where to send its bytes (one `PUT`, or parts), straight to storage. The question decides what it takes: its kinds of file (`415 unsupported_media_type`), its largest file and the 2 GB a response takes in all (`413 payload_too_large`), and how many files (`409 state_conflict`, `currentStatus` `full`, counting this session's uploads not discarded). A form takes 20 GB of files a day. Once the response is sent, the session takes no more files (`409 state_conflict`, `currentStatus` `sent`).","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateFormUploadBody"},"example":{"session":"eyJ2IjoxLCJsIjoiZmxpbmtfMDFqY2Q0YzZlOGcwajJtNHA2cjh0MHcyeWEifQ.EXAMPLE-signature","columnId":"col_01jcd5f9h1k3n5q7s9v1x3z5bd","name":"take-1.mp4","mimeType":"video/mp4","sizeBytes":48000000}}}},"responses":{"201":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicFormUpload"},"example":{"id":"upl_01jcd6h1k3n5q7s9v1x3z5b7df","name":"take-1.mp4","mimeType":"video/mp4","sizeBytes":48000000,"transfer":{"method":"put","url":"https://storage.example.com/uploads/EXAMPLE?signature=EXAMPLE","headers":{"content-type":"video/mp4"}},"expiresAt":"2026-11-03T11:00:00.000Z"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"state_conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"410":{"description":"link_invalid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"413":{"description":"payload_too_large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/public/forms/uploads/{uploadId}/complete":{"post":{"operationId":"formPage.completeUpload","tags":["formPage"],"summary":"Complete a form upload","description":"Completes an upload once its bytes reached storage: the file is checked against its question's kinds again, by the type storage kept and, when the question names its kinds, by its first bytes (an image, a video or audio, a PDF: another kind of file answers `415 unsupported_media_type` and its bytes are removed), and its id becomes an answer the response may send. Only the session that started it completes it (`404 not_found` otherwise); completing it again answers it again, and once the response is sent no other upload completes (`409 state_conflict`, `currentStatus` `sent`).","security":[],"parameters":[{"name":"uploadId","in":"path","required":true,"description":"The upload's id.","schema":{"$ref":"#/components/schemas/UploadId"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormSessionBody"},"example":{"session":"eyJ2IjoxLCJsIjoiZmxpbmtfMDFqY2Q0YzZlOGcwajJtNHA2cjh0MHcyeWEifQ.EXAMPLE-signature"}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicFormFile"},"example":{"uploadId":"upl_01jcd6h1k3n5q7s9v1x3z5b7df","name":"take-1.mp4","mimeType":"video/mp4","sizeBytes":48000000,"kind":"video"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"state_conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"410":{"description":"link_invalid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"413":{"description":"payload_too_large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/public/forms/uploads/{uploadId}/discard":{"post":{"operationId":"formPage.discardUpload","tags":["formPage"],"summary":"Discard a form upload","description":"Removes a file the respondent deleted before sending. Only the session that started it discards it (`404 not_found` otherwise); a file a sent response holds stays (`409 state_conflict`, `currentStatus` `used`).","security":[],"parameters":[{"name":"uploadId","in":"path","required":true,"description":"The upload's id.","schema":{"$ref":"#/components/schemas/UploadId"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormSessionBody"},"example":{"session":"eyJ2IjoxLCJsIjoiZmxpbmtfMDFqY2Q0YzZlOGcwajJtNHA2cjh0MHcyeWEifQ.EXAMPLE-signature"}}}},"responses":{"204":{"description":"Done. The answer has no body."},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"state_conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"410":{"description":"link_invalid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/public/forms/submit":{"post":{"operationId":"formPage.submit","tags":["formPage"],"summary":"Send a form response","description":"Sends the response: one record in the form's table, made from the answers, the link's prefilled values and the files this session uploaded. Answers that do not fit fail with `400 validation_failed`, each under `body.values.<column id>`. A session sends one response: sending it again answers the same. Someone outside responds 20 times an hour at most, and a form takes its own number of responses a day.","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmitFormBody"},"example":{"session":"eyJ2IjoxLCJsIjoiZmxpbmtfMDFqY2Q0YzZlOGcwajJtNHA2cjh0MHcyeWEifQ.EXAMPLE-signature","values":{"col_01jcd5d7f9h1k3n5q7s9v1x3zb":"Carla Ruiz","col_01jcd5f9h1k3n5q7s9v1x3z5bd":["upl_01jcd6h1k3n5q7s9v1x3z5b7df"]},"respondent":null,"website":""}}}},"responses":{"201":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmitFormResult"},"example":{"thankYou":"Thanks, your response was sent.","allowAnother":false}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"410":{"description":"link_invalid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/orgs/{orgId}/agents":{"get":{"operationId":"agents.listAgents","tags":["agents"],"summary":"List agents","description":"Lists the organization's agents that the caller can see, as Settings, Agents shows them. Filter by `status` (`active`, `paused` or `archived`), by `teamId` or by a name search in `q`. The answer is a page with `totalCount`, the number of agents the filters match across all pages.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read","parameters":[{"name":"orgId","in":"path","required":true,"description":"The organization's id.","schema":{"$ref":"#/components/schemas/OrganizationId"}},{"name":"status","in":"query","required":false,"description":"Only agents with this status; left out, active and paused agents, without archived ones.","schema":{"$ref":"#/components/schemas/AgentStatus"}},{"name":"teamId","in":"query","required":false,"description":"Only agents in this team.","schema":{"$ref":"#/components/schemas/TeamId"}},{"name":"q","in":"query","required":false,"description":"Only agents whose name contains this text, ignoring case.","schema":{"type":"string","minLength":1,"maxLength":80}},{"name":"cursor","in":"query","required":false,"description":"Where to continue: the `nextCursor` of the page before. Left out, the list starts at its beginning.","schema":{"$ref":"#/components/schemas/Cursor"}},{"name":"limit","in":"query","required":false,"description":"How many items to return, 1 to 200; 50 when left out.","schema":{"type":"string","pattern":"^-?(0|[1-9][0-9]*)$"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentSummaryPage"},"example":{"items":[{"id":"agt_01jb5k7m9p1r3t5v7x9z1b3d5f","organizationId":"org_01jb2m4n6p8q0r2s4t6v8w0x2y","name":"Quill","title":"Copywriter","avatarUrl":"https://files.example.com/avatars/quill.png?signature=EXAMPLE","teamIds":["team_01jb7c9e1g3j5m7p9s1v3x5z7b"],"status":"active","skills":[{"id":"skill_01jb8e0g2j4m6p8s0v2x4z6b8d","name":"Brand voice: Northwind Coffee"}],"connections":[{"id":"conn_01jba2c4e6g8j0m2p4r6t8w0y2","connectorKey":"google_drive","name":"Agency Drive","status":"connected"}],"visibility":"organization","revision":4,"myAccess":{"level":"manage","actions":["view","edit","share","change_visibility","delete","export","pause_agents","transfer_ownership"]}},{"id":"agt_01jb6n8q0s2v4x6z8b0d2f4h6k","organizationId":"org_01jb2m4n6p8q0r2s4t6v8w0x2y","name":"Scout","title":"Researcher","avatarUrl":null,"teamIds":["team_01jb7c9e1g3j5m7p9s1v3x5z7b"],"status":"paused","skills":[{"id":"skill_01jb9g1j3m5p7s9v1x3z5b7d9f","name":"Competitor research"}],"connections":[],"visibility":"organization","revision":7,"myAccess":{"level":"manage","actions":["view","edit","share","change_visibility","delete","export","pause_agents","transfer_ownership"]}}],"nextCursor":null,"totalCount":2}}}},"400":{"description":"validation_failed, invalid_cursor","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"post":{"operationId":"agents.createAgent","tags":["agents"],"summary":"Create an agent","description":"Creates an agent in the organization. Only the organization's owner and admins. Names are unique in the organization, ignoring case, because people @mention agents by name: a taken name answers `duplicate`. The model must be an `available` one the organization allows. A photo whose upload has not finished answers `upload_not_ready`; retry once it completes.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read_write","parameters":[{"name":"orgId","in":"path","required":true,"description":"The organization's id.","schema":{"$ref":"#/components/schemas/OrganizationId"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"A key you choose for this request, such as a UUID. Once the request has succeeded, sending it again with the same key gets the first answer back, with nothing done twice.","schema":{"$ref":"#/components/schemas/IdempotencyKey"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentInput"},"example":{"name":"Echo","title":"Community manager","teamIds":["team_01jb7c9e1g3j5m7p9s1v3x5z7b"],"modelAlias":"reasoning","instructions":"You draft replies to comments and direct messages on our clients' Instagram and Facebook pages. Match the client's brand voice skill, never promise discounts or dates, and pass complaints and order questions to the account team.","skillIds":["skill_01jb8e0g2j4m6p8s0v2x4z6b8d"],"connectionIds":["conn_01jba2c4e6g8j0m2p4r6t8w0y2"],"visibility":"organization"}}}},"responses":{"201":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Agent"},"example":{"id":"agt_01jbv9z1b3d5f7h9k1n3q5s7w9","organizationId":"org_01jb2m4n6p8q0r2s4t6v8w0x2y","name":"Echo","title":"Community manager","avatarUrl":null,"teamIds":["team_01jb7c9e1g3j5m7p9s1v3x5z7b"],"status":"active","skills":[{"id":"skill_01jb8e0g2j4m6p8s0v2x4z6b8d","name":"Brand voice: Northwind Coffee"}],"connections":[{"id":"conn_01jba2c4e6g8j0m2p4r6t8w0y2","connectorKey":"google_drive","name":"Agency Drive","status":"connected"}],"visibility":"organization","revision":1,"ownerId":"mbr_01jb3a5c7e9g1j3k5m7p9r1t3v","modelAlias":"reasoning","instructions":"You draft replies to comments and direct messages on our clients' Instagram and Facebook pages. Match the client's brand voice skill, never promise discounts or dates, and pass complaints and order questions to the account team.","autonomy":"ask_before_writes","webTools":false,"pausedAt":null,"pausedReason":null,"pausedBy":null,"createdBy":"mbr_01jb3a5c7e9g1j3k5m7p9r1t3v","createdAt":"2026-10-22T09:30:00.000Z","updatedAt":"2026-10-22T09:30:00.000Z","myAccess":{"level":"manage","actions":["view","edit","share","change_visibility","delete","export","pause_agents","transfer_ownership"]}}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"idempotency_in_progress, duplicate","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"422":{"description":"idempotency_key_reused, upload_not_ready","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/agents/{agentId}":{"get":{"operationId":"agents.getAgent","tags":["agents"],"summary":"Get an agent","description":"Returns one agent with all its settings: name, title, photo, model, instructions, skills, connections, teams and pause details. `myAccess` says what the caller may do with it.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read","parameters":[{"name":"agentId","in":"path","required":true,"description":"The agent's id.","schema":{"$ref":"#/components/schemas/AgentId"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Agent"},"example":{"id":"agt_01jb5k7m9p1r3t5v7x9z1b3d5f","organizationId":"org_01jb2m4n6p8q0r2s4t6v8w0x2y","name":"Quill","title":"Copywriter","avatarUrl":"https://files.example.com/avatars/quill.png?signature=EXAMPLE","teamIds":["team_01jb7c9e1g3j5m7p9s1v3x5z7b"],"status":"active","skills":[{"id":"skill_01jb8e0g2j4m6p8s0v2x4z6b8d","name":"Brand voice: Northwind Coffee"}],"connections":[{"id":"conn_01jba2c4e6g8j0m2p4r6t8w0y2","connectorKey":"google_drive","name":"Agency Drive","status":"connected"}],"visibility":"organization","revision":4,"ownerId":"mbr_01jb3a5c7e9g1j3k5m7p9r1t3v","modelAlias":"reasoning","instructions":"You write social captions and ad copy for the agency's clients. Follow the client's brand voice skill, keep captions under 150 characters, and offer two options when you are asked for one.","autonomy":"ask_before_writes","webTools":false,"pausedAt":null,"pausedReason":null,"pausedBy":null,"createdBy":"mbr_01jb3a5c7e9g1j3k5m7p9r1t3v","createdAt":"2026-09-08T10:12:00.000Z","updatedAt":"2026-10-20T16:45:00.000Z","myAccess":{"level":"manage","actions":["view","edit","share","change_visibility","delete","export","pause_agents","transfer_ownership"]}}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"patch":{"operationId":"agents.updateAgent","tags":["agents"],"summary":"Update an agent","description":"Changes an agent's settings: send only the fields that change, with `expectedRevision`. Needs edit on the agent: its owner, admins and members granted edit. Changing `visibility` is for its owner and the organization's owner and admins only. `skillIds` and `connectionIds` replace the lists, and each connection added or removed needs edit on it too. An instructions change applies to later turns only. A deleted agent answers `state_conflict` and a taken name `duplicate`.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read_write","parameters":[{"name":"agentId","in":"path","required":true,"description":"The agent's id.","schema":{"$ref":"#/components/schemas/AgentId"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAgentBody"}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Agent"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"duplicate, revision_conflict, state_conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"422":{"description":"upload_not_ready","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"delete":{"operationId":"agents.deleteAgent","tags":["agents"],"summary":"Delete an agent","description":"Deletes an agent. It is archived rather than erased: it starts no new turns, and its messages and history still show who wrote them. It leaves its skills and connections, its name is free again, and the active flows whose steps use it pause. Only the agent's owner and the organization's owner and admins.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read_write","parameters":[{"name":"agentId","in":"path","required":true,"description":"The agent's id.","schema":{"$ref":"#/components/schemas/AgentId"}}],"responses":{"204":{"description":"Done. The answer has no body."},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/agents/{agentId}/pause":{"post":{"operationId":"agents.pauseAgent","tags":["agents"],"summary":"Pause an agent","description":"Pauses an agent: it starts no new turns until it is resumed, and a mention of it starts nothing. Turns already running finish. Needs manage on the agent: its owner, admins and members granted manage. Only an active agent can be paused (`state_conflict` otherwise).","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read_write","parameters":[{"name":"agentId","in":"path","required":true,"description":"The agent's id.","schema":{"$ref":"#/components/schemas/AgentId"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PauseAgentBody"}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Agent"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"revision_conflict, state_conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/agents/{agentId}/resume":{"post":{"operationId":"agents.resumeAgent","tags":["agents"],"summary":"Resume an agent","description":"Resumes an agent paused with `POST /v0/agents/{agentId}/pause`, so mentions start its turns again. Needs manage on the agent: its owner, admins and members granted manage. Only a paused agent can be resumed (`state_conflict` otherwise).","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read_write","parameters":[{"name":"agentId","in":"path","required":true,"description":"The agent's id.","schema":{"$ref":"#/components/schemas/AgentId"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResumeAgentBody"}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Agent"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"revision_conflict, state_conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/agents/{agentId}/template":{"get":{"operationId":"agents.exportAgent","tags":["agents"],"summary":"Export an agent","description":"Exports an agent and its skills, with their full text, as one JSON template that `POST /v0/orgs/{orgId}/agents/import` loads into any organization. The template holds no ids and no secrets. Needs edit on the agent, since the template reveals its instructions and skills.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read","parameters":[{"name":"agentId","in":"path","required":true,"description":"The agent's id.","schema":{"$ref":"#/components/schemas/AgentId"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentTemplate"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/orgs/{orgId}/agents/import":{"post":{"operationId":"agents.importAgent","tags":["agents"],"summary":"Import an agent","description":"Creates an agent and its skills from a template made by `GET /v0/agents/{agentId}/template`. When the organization already has a skill of the same name, `skillConflict` decides: `reuse` assigns the existing skill, `copy` adds a renamed copy. A model that is unknown, deprecated or not allowed is replaced by an allowed default. The answer holds the new agent, its skills and the connectors the template requires. Only the owner and admins; a taken agent name answers `duplicate`.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read_write","parameters":[{"name":"orgId","in":"path","required":true,"description":"The organization's id.","schema":{"$ref":"#/components/schemas/OrganizationId"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"A key you choose for this request, such as a UUID. Once the request has succeeded, sending it again with the same key gets the first answer back, with nothing done twice.","schema":{"$ref":"#/components/schemas/IdempotencyKey"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportAgentBody"}}}},"responses":{"201":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportAgentResult"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"idempotency_in_progress, duplicate","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"422":{"description":"idempotency_key_reused","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/models":{"get":{"operationId":"agents.listModels","tags":["agents"],"summary":"List models","description":"Lists the AI models agents can run, as the agent form's model picker shows them: each with its alias, label, context size, capabilities and whether it is the default or deprecated. With `orgId`, `allowed` says whether that organization lets its agents use the model; without it, every model is allowed. An API key always answers for its own organization.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read","parameters":[{"name":"orgId","in":"query","required":false,"description":"The organization whose allowed models set each model's `allowed`; a key answers for its own.","schema":{"$ref":"#/components/schemas/OrganizationId"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListModelsResult"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/orgs/{orgId}/teams":{"get":{"operationId":"agents.listTeams","tags":["agents"],"summary":"List teams","description":"Lists the organization's teams with `totalCount`. A team is a group of people and agents, shown on their cards and used to filter the agent list. Every member sees every team, and a team grants no access.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read","parameters":[{"name":"orgId","in":"path","required":true,"description":"The organization's id.","schema":{"$ref":"#/components/schemas/OrganizationId"}},{"name":"cursor","in":"query","required":false,"description":"Where to continue: the `nextCursor` of the page before. Left out, the list starts at its beginning.","schema":{"$ref":"#/components/schemas/Cursor"}},{"name":"limit","in":"query","required":false,"description":"How many items to return, 1 to 200; 50 when left out.","schema":{"type":"string","pattern":"^-?(0|[1-9][0-9]*)$"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamPage"}}}},"400":{"description":"validation_failed, invalid_cursor","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"post":{"operationId":"agents.createTeam","tags":["agents"],"summary":"Create a team","description":"Creates a team of people and agents, with an optional description (`about`) and members (`actorIds`). Team names are unique in the organization, ignoring case: a taken name answers `duplicate`. Only the organization's owner and admins.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read_write","parameters":[{"name":"orgId","in":"path","required":true,"description":"The organization's id.","schema":{"$ref":"#/components/schemas/OrganizationId"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"A key you choose for this request, such as a UUID. Once the request has succeeded, sending it again with the same key gets the first answer back, with nothing done twice.","schema":{"$ref":"#/components/schemas/IdempotencyKey"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTeamBody"}}}},"responses":{"201":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Team"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"idempotency_in_progress, duplicate","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"422":{"description":"idempotency_key_reused","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/teams/{teamId}":{"patch":{"operationId":"agents.updateTeam","tags":["agents"],"summary":"Update a team","description":"Renames a team, changes its description or replaces its members, with `expectedRevision`; `actorIds` is the full new list. Removed members and deleted agents stay in the team, hidden: `actorIds` cannot name them and does not remove them. Only the organization's owner and admins.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read_write","parameters":[{"name":"teamId","in":"path","required":true,"description":"The team's id.","schema":{"$ref":"#/components/schemas/TeamId"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateTeamBody"}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Team"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"duplicate, revision_conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"delete":{"operationId":"agents.deleteTeam","tags":["agents"],"summary":"Delete a team","description":"Deletes a team. Nobody loses access, since a team grants none; its people and agents just no longer show it. Only the organization's owner and admins.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read_write","parameters":[{"name":"teamId","in":"path","required":true,"description":"The team's id.","schema":{"$ref":"#/components/schemas/TeamId"}}],"responses":{"204":{"description":"Done. The answer has no body."},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/orgs/{orgId}/skills":{"get":{"operationId":"agents.listSkills","tags":["agents"],"summary":"List skills","description":"Lists the organization's skills, without their bodies. Every member sees every skill, and each skill's `agentIds` lists only the agents the reader may view. Filter by `agentId` for the skills assigned to one agent the reader may view, or search with `q`. The answer is a page with `totalCount`, the number of skills the filters match across all pages.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read","parameters":[{"name":"orgId","in":"path","required":true,"description":"The organization's id.","schema":{"$ref":"#/components/schemas/OrganizationId"}},{"name":"agentId","in":"query","required":false,"description":"Only the skills assigned to this agent, which must be one of the agents the reader may view: any other lists no skill.","schema":{"$ref":"#/components/schemas/AgentId"}},{"name":"q","in":"query","required":false,"description":"Only skills whose name or description contains this text, ignoring case.","schema":{"type":"string","minLength":1,"maxLength":80}},{"name":"cursor","in":"query","required":false,"description":"Where to continue: the `nextCursor` of the page before. Left out, the list starts at its beginning.","schema":{"$ref":"#/components/schemas/Cursor"}},{"name":"limit","in":"query","required":false,"description":"How many items to return, 1 to 200; 50 when left out.","schema":{"type":"string","pattern":"^-?(0|[1-9][0-9]*)$"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SkillSummaryPage"}}}},"400":{"description":"validation_failed, invalid_cursor","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"post":{"operationId":"agents.createSkill","tags":["agents"],"summary":"Create a skill","description":"Creates a skill: a `SKILL.md` document of instructions that agents load when they need it. It starts at version 1 and every member of the organization sees it. Any member but a viewer may create one. `agentIds` assigns it to agents, which needs edit on each of them. Limits: a name of 64 characters, a description of 300 and a body of 100,000.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read_write","parameters":[{"name":"orgId","in":"path","required":true,"description":"The organization's id.","schema":{"$ref":"#/components/schemas/OrganizationId"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"A key you choose for this request, such as a UUID. Once the request has succeeded, sending it again with the same key gets the first answer back, with nothing done twice.","schema":{"$ref":"#/components/schemas/IdempotencyKey"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSkillBody"}}}},"responses":{"201":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Skill"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"idempotency_in_progress","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"422":{"description":"idempotency_key_reused","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/skills/{skillId}":{"get":{"operationId":"agents.getSkill","tags":["agents"],"summary":"Get a skill","description":"Returns one skill with its current `SKILL.md` body, the agents it is assigned to (only the agents the reader may view) and its current version number. `myAccess` says what the caller may do with it.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read","parameters":[{"name":"skillId","in":"path","required":true,"description":"The skill's id.","schema":{"$ref":"#/components/schemas/SkillId"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Skill"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"patch":{"operationId":"agents.updateSkill","tags":["agents"],"summary":"Update a skill","description":"Changes a skill's name, description, body or agents, with `expectedRevision`. Needs edit on the skill: its owner, admins and members granted edit. A change to the name, description or body saves a new version, and turns already running keep the version they started with. `agentIds` replaces the skill's agents that the caller may view (agents they may not view stay assigned), and each agent added or removed needs edit on it.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read_write","parameters":[{"name":"skillId","in":"path","required":true,"description":"The skill's id.","schema":{"$ref":"#/components/schemas/SkillId"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateSkillBody"}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Skill"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"revision_conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"delete":{"operationId":"agents.deleteSkill","tags":["agents"],"summary":"Delete a skill","description":"Deletes a skill, so agents no longer load it. Turns keep their record of the versions they read, but those versions answer `not_found` from then on. Only the skill's owner and the organization's owner and admins.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read_write","parameters":[{"name":"skillId","in":"path","required":true,"description":"The skill's id.","schema":{"$ref":"#/components/schemas/SkillId"}}],"responses":{"204":{"description":"Done. The answer has no body."},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/skills/{skillId}/versions":{"get":{"operationId":"agents.listSkillVersions","tags":["agents"],"summary":"List skill versions","description":"Lists a skill's saved versions, newest first, without their bodies. Every save that changes the name, description or body adds one. Read a version in full with `GET /v0/skill-versions/{skillVersionId}`.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read","parameters":[{"name":"skillId","in":"path","required":true,"description":"The skill's id.","schema":{"$ref":"#/components/schemas/SkillId"}},{"name":"cursor","in":"query","required":false,"description":"Where to continue: the `nextCursor` of the page before. Left out, the list starts at its beginning.","schema":{"$ref":"#/components/schemas/Cursor"}},{"name":"limit","in":"query","required":false,"description":"How many items to return, 1 to 200; 50 when left out.","schema":{"type":"string","pattern":"^-?(0|[1-9][0-9]*)$"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SkillVersionSummaryPage"}}}},"400":{"description":"validation_failed, invalid_cursor","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/skill-versions/{skillVersionId}":{"get":{"operationId":"agents.getSkillVersion","tags":["agents"],"summary":"Get a skill version","description":"Returns one saved version of a skill with its full body. A version never changes, so this shows exactly what agents read, such as the version a turn recorded. A deleted skill's versions answer `not_found`.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read","parameters":[{"name":"skillVersionId","in":"path","required":true,"description":"The skill version's id.","schema":{"$ref":"#/components/schemas/SkillVersionId"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SkillVersion"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/orgs/{orgId}/ai-limits":{"get":{"operationId":"agents.getAiLimits","tags":["agents"],"summary":"Get AI limits","description":"Returns the AI limits in effect for the organization and its own overrides of the plan's defaults: daily, monthly and per-chain budgets, how deep agent chains may go and how many turns they may run, how long request cards wait, turn quotas and the models agents may use. Only the organization's owner and admins.","security":[{"session":[]}],"x-api-key-scope":"none","parameters":[{"name":"orgId","in":"path","required":true,"description":"The organization's id.","schema":{"$ref":"#/components/schemas/OrganizationId"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiLimits"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"put":{"operationId":"agents.updateAiLimits","tags":["agents"],"summary":"Update AI limits","description":"Replaces all of the organization's AI limit overrides at once: the daily, monthly and per-chain budgets, the spending warning threshold, how deep a chain of agents may go and how many turns it may run, how long request cards wait, how long a decline can be undone and the turn quotas. Send every limit, `null` to follow the plan's default. `modelAllowlist` replaces the models agents may use when sent, and keeps them when left out. The answer is `validation_failed` when the limits contradict each other (a daily budget above the monthly one, a chat or member quota above the organization's) or name a model Fleepr does not offer. Chains already running keep the limits they started with. Only the owner and admins.","security":[{"session":[]}],"x-api-key-scope":"none","parameters":[{"name":"orgId","in":"path","required":true,"description":"The organization's id.","schema":{"$ref":"#/components/schemas/OrganizationId"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAiLimitsBody"}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiLimits"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"revision_conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/orgs/{orgId}/pause-agents":{"post":{"operationId":"agents.pauseAllAgents","tags":["agents"],"summary":"Pause all agents","description":"The organization's kill switch for agents and flows. It ends every open turn at once, whether queued, waiting for a card or running, stops their chains and the flow runs in progress, and starts nothing new until resumed: mentions start no turns and flows start no runs. Pausing a paused organization changes nothing. Only the owner and admins.","security":[{"session":[]}],"x-api-key-scope":"none","parameters":[{"name":"orgId","in":"path","required":true,"description":"The organization's id.","schema":{"$ref":"#/components/schemas/OrganizationId"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Organization"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/orgs/{orgId}/resume-agents":{"post":{"operationId":"agents.resumeAllAgents","tags":["agents"],"summary":"Resume all agents","description":"Turns the kill switch off: agents take turns and flows run again. What the switch stopped stays stopped. Resuming an organization that is not paused changes nothing. Only the owner and admins.","security":[{"session":[]}],"x-api-key-scope":"none","parameters":[{"name":"orgId","in":"path","required":true,"description":"The organization's id.","schema":{"$ref":"#/components/schemas/OrganizationId"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Organization"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/orgs/{orgId}/usage":{"get":{"operationId":"agents.getUsage","tags":["agents"],"summary":"Get AI usage","description":"Reports AI turns, tokens and cost between two dates, both included, grouped by day, agent, chain or member (`groupBy`). It adds totals and how today's and this month's spending stand against the budgets. Costs are in millionths of a US dollar. Only the organization's owner and admins.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read","parameters":[{"name":"orgId","in":"path","required":true,"description":"The organization's id.","schema":{"$ref":"#/components/schemas/OrganizationId"}},{"name":"from","in":"query","required":true,"description":"The first day of the report, included.","schema":{"$ref":"#/components/schemas/IsoDate"}},{"name":"to","in":"query","required":true,"description":"The last day of the report, included; on or after `from`.","schema":{"$ref":"#/components/schemas/IsoDate"}},{"name":"groupBy","in":"query","required":true,"description":"How to group the rows: by `day`, `agent`, `chain` (one message or flow run and the turns it led to) or `member` (who the turns acted for).","schema":{"$ref":"#/components/schemas/UsageGroupBy"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageReport"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/agents/{agentId}/context":{"get":{"operationId":"agents.context","tags":["agents"],"summary":"Get what shapes an agent","description":"Returns what the agent reads before every answer, part by part with its size: its instructions, its skills, its memories by layer, the tables' profiles, the open Health issues, the docs, and from its last turn the tools and Fleepr's own text. The knowledge is what a chat about no record loads, exactly as the agent would read it there, with only what the caller may see.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read","parameters":[{"name":"agentId","in":"path","required":true,"description":"The agent's id.","schema":{"$ref":"#/components/schemas/AgentId"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentContext"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/agents/{agentId}/learning":{"get":{"operationId":"agents.learning","tags":["agents"],"summary":"Get what an agent is learning","description":"Returns what the agent is learning: the share of the approvals of its work approved the first time (shown from 5 decided, beside the period before), its send-backs this month and how many became memories, its most read memory, the suggested memories the caller decides about it, and its recent answers with the memories that shaped them. Only what the caller may see is listed or counted.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read","parameters":[{"name":"agentId","in":"path","required":true,"description":"The agent's id.","schema":{"$ref":"#/components/schemas/AgentId"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentLearning"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/agents/{agentId}/failures":{"get":{"operationId":"agents.failures","tags":["agents"],"summary":"Get an agent's failed tool calls","description":"Returns the agent's tool calls that failed, timed out or a person declined in the last `days` days (at most 90), counted by tool and code, and the latest 20. A cancelled call is left out, and so is a call in a thread the caller may not open. Never a call's arguments or output.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read","parameters":[{"name":"agentId","in":"path","required":true,"description":"The agent's id.","schema":{"$ref":"#/components/schemas/AgentId"}},{"name":"days","in":"query","required":false,"description":"How many days back to read: 30 when left out.","schema":{"type":"string","pattern":"^-?(0|[1-9][0-9]*)$"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentFailures"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/orgs/{orgId}/connectors":{"get":{"operationId":"connectors.listConnectors","tags":["connectors"],"summary":"List connectors","description":"Lists every connector Fleepr offers (Google Drive, Meta Ads and MCP servers), each once, with the organization's connections to it that the caller can see. Settings, Connectors shows them as its cards.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read","parameters":[{"name":"orgId","in":"path","required":true,"description":"The organization's id.","schema":{"$ref":"#/components/schemas/OrganizationId"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListConnectorsResult"},"example":{"items":[{"connector":{"key":"google_drive","name":"Google Drive","category":"files","description":"Agents read the folders and files the agency shares with a Google service account. Paste its JSON key once.","authKind":"credential","allowsMultipleConnections":false},"connections":[{"id":"conn_01jb3a1b3d5f7h9k1m3p5r7t9w","organizationId":"org_01jb2m7q9x4t6v8w0y2z4c6e8g","connectorKey":"google_drive","name":"Google Drive","status":"connected","pausedReason":null,"pausedAt":null,"health":{"lastCheckedAt":"2026-10-21T09:00:00.000Z","lastSuccessAt":"2026-10-21T09:00:00.000Z","consecutiveFailures":0,"lastError":null},"externalAccount":{"id":"drive-agents@harbor-pine.iam.example.com","label":"drive-agents@harbor-pine.iam.example.com"},"mcp":null,"agentIds":["agt_01jb2q6a8c0e2g4j6m8p0r2t4w"],"ownerId":"mbr_01jb2m8b4d6f8h0k2m4n6q8s0t","createdBy":"mbr_01jb2m8b4d6f8h0k2m4n6q8s0t","visibility":"organization","connectedBy":"mbr_01jb2m8b4d6f8h0k2m4n6q8s0t","connectedAt":"2026-09-15T10:20:00.000Z","createdAt":"2026-09-15T10:18:00.000Z","updatedAt":"2026-10-02T14:31:00.000Z","revision":5,"myAccess":{"level":"manage","actions":["view","edit","share","change_visibility","delete","transfer_ownership"]}}]},{"connector":{"key":"meta_ads","name":"Meta Ads","category":"advertising","description":"Agents read and manage the ad accounts assigned to a system user of the agency's Meta app. Paste its token once.","authKind":"credential","allowsMultipleConnections":false},"connections":[]},{"connector":{"key":"mcp","name":"MCP server","category":"custom","description":"Connect a remote MCP server by URL. Its tools ask before running unless an admin marks them read-only.","authKind":"config","allowsMultipleConnections":true},"connections":[{"id":"conn_01jb7c2d4f6h8k0m2p4r6t8w0y","organizationId":"org_01jb2m7q9x4t6v8w0y2z4c6e8g","connectorKey":"mcp","name":"Brand asset library","status":"connected","pausedReason":null,"pausedAt":null,"health":{"lastCheckedAt":"2026-10-21T08:00:00.000Z","lastSuccessAt":"2026-10-21T08:00:00.000Z","consecutiveFailures":0,"lastError":null},"externalAccount":null,"mcp":{"url":"https://mcp.example.com/brand-assets","transport":"streamable_http","headerNames":["Authorization"],"hasSecret":true},"agentIds":["agt_01jb2q6a8c0e2g4j6m8p0r2t4w"],"ownerId":"mbr_01jb2m8a3c5e7g9j1k3m5p7r9s","createdBy":"mbr_01jb2m8a3c5e7g9j1k3m5p7r9s","visibility":"organization","connectedBy":"mbr_01jb2m8a3c5e7g9j1k3m5p7r9s","connectedAt":"2026-10-08T13:42:00.000Z","createdAt":"2026-10-08T13:40:00.000Z","updatedAt":"2026-10-14T09:15:00.000Z","revision":3,"myAccess":{"level":"manage","actions":["view","edit","share","change_visibility","delete","transfer_ownership"]}}]}]}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/orgs/{orgId}/connections":{"post":{"operationId":"connectors.connect","tags":["connectors"],"summary":"Create a connection","description":"Connects the organization to an outside service so its agents can use that service's tools. Google Drive and Meta Ads take a pasted credential, which Fleepr checks right after. An MCP server is added by its address: Fleepr checks it and lists its tools, which agents can use once the owner or an admin has reviewed and saved them. Only the organization's owner and admins. The credential is never returned. Google Drive and Meta Ads allow one connection each, and names are unique: `duplicate` otherwise.","security":[{"session":[]}],"x-api-key-scope":"none","parameters":[{"name":"orgId","in":"path","required":true,"description":"The organization's id.","schema":{"$ref":"#/components/schemas/OrganizationId"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"A key you choose for this request, such as a UUID. Once the request has succeeded, sending it again with the same key gets the first answer back, with nothing done twice.","schema":{"$ref":"#/components/schemas/IdempotencyKey"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectBody"}}}},"responses":{"201":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectResult"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"idempotency_in_progress, duplicate","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"422":{"description":"idempotency_key_reused","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/connections/{connectionId}":{"get":{"operationId":"connectors.getConnection","tags":["connectors"],"summary":"Get a connection","description":"Returns one connection with its status, health (its last check and last error), settings and the agents that use it. `myAccess` says what the caller may do with it. Credentials and header values are never returned: an MCP server shows only its header names.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read","parameters":[{"name":"connectionId","in":"path","required":true,"description":"The connection's id.","schema":{"$ref":"#/components/schemas/ConnectionId"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Connection"},"example":{"id":"conn_01jb7c2d4f6h8k0m2p4r6t8w0y","organizationId":"org_01jb2m7q9x4t6v8w0y2z4c6e8g","connectorKey":"mcp","name":"Brand asset library","status":"connected","pausedReason":null,"pausedAt":null,"health":{"lastCheckedAt":"2026-10-21T08:00:00.000Z","lastSuccessAt":"2026-10-21T08:00:00.000Z","consecutiveFailures":0,"lastError":null},"externalAccount":null,"mcp":{"url":"https://mcp.example.com/brand-assets","transport":"streamable_http","headerNames":["Authorization"],"hasSecret":true},"agentIds":["agt_01jb2q6a8c0e2g4j6m8p0r2t4w"],"ownerId":"mbr_01jb2m8a3c5e7g9j1k3m5p7r9s","createdBy":"mbr_01jb2m8a3c5e7g9j1k3m5p7r9s","visibility":"organization","connectedBy":"mbr_01jb2m8a3c5e7g9j1k3m5p7r9s","connectedAt":"2026-10-08T13:42:00.000Z","createdAt":"2026-10-08T13:40:00.000Z","updatedAt":"2026-10-14T09:15:00.000Z","revision":3,"myAccess":{"level":"manage","actions":["view","edit","share","change_visibility","delete","transfer_ownership"]}}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"patch":{"operationId":"connectors.updateConnection","tags":["connectors"],"summary":"Update a connection","description":"Renames a connection, changes an MCP server's address, transport or headers, or replaces a pasted credential, with `expectedRevision`. Needs edit on the connection, and a new server address needs its owner or an admin: every stored header must then be set again or removed in the same change. Headers merge by name: a value sets one, `null` removes it. A new credential replaces the stored one and Fleepr checks it, which also brings back a disconnected connection.","security":[{"session":[]}],"x-api-key-scope":"none","parameters":[{"name":"connectionId","in":"path","required":true,"description":"The connection's id.","schema":{"$ref":"#/components/schemas/ConnectionId"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateConnectionBody"}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Connection"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"revision_conflict, duplicate","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"delete":{"operationId":"connectors.deleteConnection","tags":["connectors"],"summary":"Delete a connection","description":"Deletes a connection with its stored credential, header values and tool policies, and its agents lose its tools. Only the connection's owner and the organization's owner and admins.","security":[{"session":[]}],"x-api-key-scope":"none","parameters":[{"name":"connectionId","in":"path","required":true,"description":"The connection's id.","schema":{"$ref":"#/components/schemas/ConnectionId"}}],"responses":{"204":{"description":"Done. The answer has no body."},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/connections/{connectionId}/test":{"post":{"operationId":"connectors.testConnection","tags":["connectors"],"summary":"Test a connection","description":"Asks Fleepr to check the connection now. The answer is the connection as it stands; once the check is done, its `health.lastCheckedAt` moves. An event on the organization stream (`connection.connected` or `connection.health_changed`) and a Logs entry follow only when the result changes, so read the connection again to see an unchanged one. Needs edit on the connection. A paused or disconnected connection answers `state_conflict`.","security":[{"session":[]}],"x-api-key-scope":"none","parameters":[{"name":"connectionId","in":"path","required":true,"description":"The connection's id.","schema":{"$ref":"#/components/schemas/ConnectionId"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Connection"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"state_conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/connections/{connectionId}/resume":{"post":{"operationId":"connectors.resumeConnection","tags":["connectors"],"summary":"Resume a connection","description":"Resumes a connection that paused because its owner was removed or made a viewer. Only its owner may, once they can act again, or a new owner after a hand-over: anyone else, admins included, gets `forbidden`, and the answer is `state_conflict` while the owner still cannot act. It returns as its last check left it, and Fleepr checks it again at once.","security":[{"session":[]}],"x-api-key-scope":"none","parameters":[{"name":"connectionId","in":"path","required":true,"description":"The connection's id.","schema":{"$ref":"#/components/schemas/ConnectionId"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResumeConnectionBody"}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Connection"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"revision_conflict, state_conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/connections/{connectionId}/disconnect":{"post":{"operationId":"connectors.disconnect","tags":["connectors"],"summary":"Disconnect a connection","description":"Stops using a connection: its tools disappear for every agent, and its stored credential or header values are deleted. The connection and its history stay until it is deleted; a new credential or new MCP settings with `PATCH /v0/connections/{connectionId}` bring it back. Needs edit on the connection. An already disconnected one answers `state_conflict`.","security":[{"session":[]}],"x-api-key-scope":"none","parameters":[{"name":"connectionId","in":"path","required":true,"description":"The connection's id.","schema":{"$ref":"#/components/schemas/ConnectionId"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DisconnectBody"}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Connection"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"revision_conflict, state_conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/connections/{connectionId}/agents":{"put":{"operationId":"connectors.setAgents","tags":["connectors"],"summary":"Set a connection's agents","description":"Replaces the full list of agents that may use the connection's tools, with `expectedRevision`; an empty list means none. Needs edit on the connection and on every agent added or removed. An agent uses the connection only when the person it works for can see the connection too.","security":[{"session":[]}],"x-api-key-scope":"none","parameters":[{"name":"connectionId","in":"path","required":true,"description":"The connection's id.","schema":{"$ref":"#/components/schemas/ConnectionId"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetAgentsBody"}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Connection"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"revision_conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/connections/{connectionId}/tools":{"get":{"operationId":"connectors.listTools","tags":["connectors"],"summary":"List a connection's tools","description":"Lists the tools of an MCP server, each with its risk and whether it runs without asking (`readOnly`). Every MCP tool has risk `consequential`, since what a remote tool does is not known. While a new or changed tool list waits for review, this shows that list. Google Drive and Meta Ads list none: their built-in tools take no policies.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read","parameters":[{"name":"connectionId","in":"path","required":true,"description":"The connection's id.","schema":{"$ref":"#/components/schemas/ConnectionId"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectionToolList"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/connections/{connectionId}/tool-policies":{"put":{"operationId":"connectors.setToolPolicies","tags":["connectors"],"summary":"Set tool policies","description":"Replaces which of an MCP server's tools run without asking; a tool left out goes back to asking with a confirm card first. Saving also approves a new or changed tool list that waits for review. The answer has the tools and the connection's new `revision` for the next write. Only the connection's owner and the organization's owner and admins.","security":[{"session":[]}],"x-api-key-scope":"none","parameters":[{"name":"connectionId","in":"path","required":true,"description":"The connection's id.","schema":{"$ref":"#/components/schemas/ConnectionId"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetToolPoliciesBody"}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetToolPoliciesResult"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"revision_conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/connections/{connectionId}/sign-in":{"post":{"operationId":"connectors.startSignIn","tags":["connectors"],"summary":"Start an MCP server sign-in","description":"Starts signing in to an MCP server that accepts only OAuth tokens, once a check found that it wants a sign-in: answers the address of its sign-in page, which the browser opens. After the sign-in, Fleepr gets the tokens, renews them itself and lists the tools again. Only the connection's owner and the organization's owner and admins; a server that needs no sign-in, or a paused or disconnected one, answers `state_conflict`. No API key may call it, so an outside agent never chooses the account Fleepr signs in as.","security":[{"session":[]}],"x-api-key-scope":"none","parameters":[{"name":"connectionId","in":"path","required":true,"description":"The connection's id.","schema":{"$ref":"#/components/schemas/ConnectionId"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartSignInBody"}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartSignInResult"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"revision_conflict, state_conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/connectors/sign-in/callback":{"get":{"operationId":"connectors.signInCallback","tags":["connectors"],"summary":"Complete an MCP server sign-in","description":"Where an MCP server sends the browser back after a sign-in started with `POST /v0/connections/{id}/sign-in`: browsers reach it by redirect, not by a direct call. It hands the code to Fleepr, which gets the tokens, and redirects (`302`) to the web app's `/connect/done`, whose `result` says how it went. Only the browser and the member that started the sign-in can finish it, once, within 10 minutes. Public: it checks the session itself.","security":[],"parameters":[{"name":"code","in":"query","required":false,"description":"The authorization code the server sends back after a sign-in.","schema":{"type":"string","maxLength":2048}},{"name":"state","in":"query","required":false,"description":"The sign-in's own state, which must match the one the browser that started it holds.","schema":{"type":"string","maxLength":2048}},{"name":"iss","in":"query","required":false,"description":"The authorization server that answered (RFC 9207), compared with the one recorded.","schema":{"type":"string","maxLength":2048}},{"name":"error","in":"query","required":false,"description":"The error the server reports when the sign-in failed.","schema":{"type":"string","maxLength":256}},{"name":"error_description","in":"query","required":false,"description":"A description of the error; never shown or kept.","schema":{"type":"string","maxLength":2048}}],"responses":{"302":{"description":"A redirect to the address in Location.","headers":{"Location":{"required":true,"schema":{"type":"string"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/connectors/sign-in/client-metadata.json":{"get":{"operationId":"connectors.clientMetadataDocument","tags":["connectors"],"summary":"Fleepr's OAuth client metadata","description":"The document whose address is Fleepr's client id when it signs in to an MCP server: its name and where a sign-in may send the browser back. Authorization servers fetch it. Public.","security":[],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientMetadataDocument"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/orgs/{orgId}/webhooks":{"get":{"operationId":"connectors.listWebhooks","tags":["connectors"],"summary":"List webhooks","description":"Lists the organization's outgoing webhooks, newest first, at most 20. Each shows its address, events, whether it is on and why Fleepr turned it off if it did, and the start of its signing secret, never the secret itself. Only the organization's owner and admins; anyone else gets `forbidden`.","security":[{"session":[]}],"parameters":[{"name":"orgId","in":"path","required":true,"description":"The organization's id.","schema":{"$ref":"#/components/schemas/OrganizationId"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookList"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"post":{"operationId":"connectors.createWebhook","tags":["connectors"],"summary":"Create a webhook","description":"Adds a webhook: Fleepr sends each chosen event to its address as it happens, signed with the webhook's secret, with the item as the member who added it may see it. The address must be public HTTPS on port 443 (`validation_failed` at `url` otherwise). The secret is in this answer only; a replay with the same Idempotency-Key answers `secret: null`. An organization has at most 20 webhooks (`state_conflict`). Only the owner and admins.","security":[{"session":[]}],"parameters":[{"name":"orgId","in":"path","required":true,"description":"The organization's id.","schema":{"$ref":"#/components/schemas/OrganizationId"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"A key you choose for this request, such as a UUID. Once the request has succeeded, sending it again with the same key gets the first answer back, with nothing done twice.","schema":{"$ref":"#/components/schemas/IdempotencyKey"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWebhookBody"}}}},"responses":{"201":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWebhookResult"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden, recent_sign_in_required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"idempotency_in_progress, state_conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"422":{"description":"idempotency_key_reused","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/webhooks/{webhookId}":{"get":{"operationId":"connectors.getWebhook","tags":["connectors"],"summary":"Get a webhook","description":"Returns one webhook as Settings, Webhooks shows it, never its secret. Only the organization's owner and admins; anyone else gets `not_found`.","security":[{"session":[]}],"parameters":[{"name":"webhookId","in":"path","required":true,"description":"The webhook's id.","schema":{"$ref":"#/components/schemas/WebhookId"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Webhook"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"patch":{"operationId":"connectors.updateWebhook","tags":["connectors"],"summary":"Update a webhook","description":"Renames a webhook, changes its address or events, or turns it off or on, with `expectedRevision`. A delivery still waiting when it is turned off is skipped. Turning it on clears why Fleepr turned it off, and answers `state_conflict` while its owner, the member who added it, is removed or a viewer. Only the organization's owner and admins.","security":[{"session":[]}],"parameters":[{"name":"webhookId","in":"path","required":true,"description":"The webhook's id.","schema":{"$ref":"#/components/schemas/WebhookId"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateWebhookBody"}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Webhook"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"revision_conflict, state_conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"delete":{"operationId":"connectors.deleteWebhook","tags":["connectors"],"summary":"Delete a webhook","description":"Deletes a webhook with its deliveries and its signing secret, so nothing more is sent to it, though an attempt already on its way may still arrive. Only the organization's owner and admins.","security":[{"session":[]}],"parameters":[{"name":"webhookId","in":"path","required":true,"description":"The webhook's id.","schema":{"$ref":"#/components/schemas/WebhookId"}}],"responses":{"204":{"description":"Done. The answer has no body."},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/webhooks/{webhookId}/test":{"post":{"operationId":"connectors.testWebhook","tags":["connectors"],"summary":"Test a webhook","description":"Sends a signed test ping (`webhook.test`) to the webhook's address in one attempt, to check that the receiver works. The answer is the new delivery, not yet sent; its outcome shows in the delivery list. A webhook that is off answers `state_conflict`. Tests and resends together are limited to 10 an hour per webhook and 30 an hour per organization (`rate_limited`). Only the owner and admins.","security":[{"session":[]}],"parameters":[{"name":"webhookId","in":"path","required":true,"description":"The webhook's id.","schema":{"$ref":"#/components/schemas/WebhookId"}}],"responses":{"202":{"description":"Accepted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookDelivery"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"state_conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/webhooks/{webhookId}/deliveries":{"get":{"operationId":"connectors.listWebhookDeliveries","tags":["connectors"],"summary":"List webhook deliveries","description":"Lists a webhook's deliveries of the last 30 days, newest first, a page at a time. Each shows its event, status, attempts, the receiver's HTTP status and why it failed or was skipped, never the body sent. Only the organization's owner and admins.","security":[{"session":[]}],"parameters":[{"name":"webhookId","in":"path","required":true,"description":"The webhook's id.","schema":{"$ref":"#/components/schemas/WebhookId"}},{"name":"cursor","in":"query","required":false,"description":"Where to continue: the `nextCursor` of the page before. Left out, the list starts at its beginning.","schema":{"$ref":"#/components/schemas/Cursor"}},{"name":"limit","in":"query","required":false,"description":"How many items to return, 1 to 200; 50 when left out.","schema":{"type":"string","pattern":"^-?(0|[1-9][0-9]*)$"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookDeliveryPage"}}}},"400":{"description":"validation_failed, invalid_cursor","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/webhook-deliveries/{deliveryId}/redeliver":{"post":{"operationId":"connectors.redeliverWebhookDelivery","tags":["connectors"],"summary":"Resend a webhook delivery","description":"Sends an event's delivery again as a new delivery, with the same event id, so the receiver can drop what it already processed, and the item as the webhook's owner may see it now. It is retried like any delivery. A test delivery, or a webhook that is off, answers `state_conflict`. It shares the limit of Test a webhook: 10 an hour per webhook and 30 per organization. Only the owner and admins.","security":[{"session":[]}],"parameters":[{"name":"deliveryId","in":"path","required":true,"description":"The id of the delivery to send again.","schema":{"$ref":"#/components/schemas/WebhookDeliveryId"}}],"responses":{"202":{"description":"Accepted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookDelivery"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"state_conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/orgs/{orgId}/flows":{"get":{"operationId":"flows.listFlows","tags":["flows"],"summary":"List flows","description":"Lists the flows the caller can view, each with its start, its full steps, its owner and its last run. The answer counts every flow across all pages: `totalCount`, of which `activeCount` are on and `pausedCount` paused. Whoever can view a flow also sees its runs; changing or running one needs edit access.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read","parameters":[{"name":"orgId","in":"path","required":true,"description":"The organization's id.","schema":{"$ref":"#/components/schemas/OrganizationId"}},{"name":"cursor","in":"query","required":false,"description":"Where to continue: the `nextCursor` of the page before. Left out, the list starts at its beginning.","schema":{"$ref":"#/components/schemas/Cursor"}},{"name":"limit","in":"query","required":false,"description":"How many items to return, 1 to 200; 50 when left out.","schema":{"type":"string","pattern":"^-?(0|[1-9][0-9]*)$"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlowPage"},"example":{"items":[{"id":"flow_01jbb3d5f7h9k1n3q5s7v9x1z3","organizationId":"org_01jb2m4n6p8q0r2s4t6v8w0x2y","name":"Weekly report: Northwind Coffee","active":true,"pausedReason":null,"ownerId":"mbr_01jb3a5c7e9g1j3k5m7p9r1t3v","start":{"kind":"schedule","repeat":"weekly","dayOfWeek":"mon","dayOfMonth":null,"time":"09:00"},"steps":[{"id":"step_01jbd5g7j9m1p3s5v7x9z1c3e5","assignee":{"kind":"agent","agentId":"agt_01jb5k7m9p1r3t5v7x9z1b3d5f"},"does":"Pull last week's results for Northwind Coffee from the Campaigns table and draft a one-page report: what ran, what moved and what we recommend next.","passes":"The report draft, ready for review.","returnTo":null,"outsideAgentsMayDecide":false},{"id":"step_01jbe6h8k0n2q4t6w8y0a2c4f6","assignee":{"kind":"member","memberId":"mbr_01jb4d6f8h0k2m4p6r8t0w2y4a"},"does":"Read the report and approve it, or send it back with what to change.","passes":null,"returnTo":0,"outsideAgentsMayDecide":false}],"maxSendBacks":3,"currentVersion":{"id":"flv_01jbc4f6h8k0n2q4s6v8x0z2b4","number":2},"chatId":null,"nextRunAt":"2026-10-26T08:00:00.000Z","lastRun":{"id":"run_01jbew5x7z9b1d3f5h7k9n1q3s","number":12,"status":"completed","currentStepIndex":null,"startedAt":"2026-10-19T07:00:00.000Z","endedAt":"2026-10-19T11:42:00.000Z","costMicros":36900,"failure":null},"visibility":"organization","createdBy":"mbr_01jb3a5c7e9g1j3k5m7p9r1t3v","createdAt":"2026-09-14T10:20:00.000Z","updatedAt":"2026-10-19T07:00:00.000Z","revision":8,"myAccess":{"level":"manage","actions":["view","edit","share","change_visibility","delete","transfer_ownership"]}}],"nextCursor":null,"totalCount":1,"activeCount":1,"pausedCount":0}}}},"400":{"description":"validation_failed, invalid_cursor","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"post":{"operationId":"flows.createFlow","tags":["flows"],"summary":"Create a flow","description":"Creates a flow owned by the caller: a name, a start (by hand, on a schedule or when an event happens) and 1 to 30 steps, each done by an agent or signed off by a person. A step's `returnTo` must name an earlier step. The flow is visible to the whole organization, and it starts paused unless the body sends `active: true`, so a half-written flow never runs. Any member except viewers can create flows. With `active: true`, a start on a record's date that cannot run, or that clashes with another flow on the same date, answers `409 state_conflict`, as Activate a flow does.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read_write","parameters":[{"name":"orgId","in":"path","required":true,"description":"The organization's id.","schema":{"$ref":"#/components/schemas/OrganizationId"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"A key you choose for this request, such as a UUID. Once the request has succeeded, sending it again with the same key gets the first answer back, with nothing done twice.","schema":{"$ref":"#/components/schemas/IdempotencyKey"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlowInput"}}}},"responses":{"201":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Flow"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"idempotency_in_progress, state_conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"422":{"description":"idempotency_key_reused","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/flows/{flowId}":{"get":{"operationId":"flows.getFlow","tags":["flows"],"summary":"Get a flow","description":"Returns a flow with its start, its steps, its current version, its last run and the caller's own access in `myAccess`, which says what they may do with it. A flow the caller cannot view answers `404 not_found`.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read","parameters":[{"name":"flowId","in":"path","required":true,"description":"The flow's id.","schema":{"$ref":"#/components/schemas/FlowId"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Flow"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"put":{"operationId":"flows.saveFlow","tags":["flows"],"summary":"Update a flow","description":"Replaces a flow's name, start and steps with the ones sent, with the `expectedRevision` you read; optional fields left out keep their values. Changing the start or the steps saves a new version, and runs in progress keep the version they started with. `active: true` turns the flow on under the rules of Activate a flow, and `active: false` pauses it. Needs edit access to the flow: its owner, the organization's owner and admins, and the members granted edit.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read_write","parameters":[{"name":"flowId","in":"path","required":true,"description":"The flow's id.","schema":{"$ref":"#/components/schemas/FlowId"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SaveFlowBody"}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Flow"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"revision_conflict, state_conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"patch":{"operationId":"flows.renameFlow","tags":["flows"],"summary":"Rename a flow","description":"Renames a flow. Only the name changes: no new version is saved, and the flow's start, steps, state and runs stay as they are. The last rename wins: there is no `expectedRevision`, since runs and the schedule also change the revision while the flow is open. Needs edit access to the flow: its owner, the organization's owner and admins, and the members granted edit; whoever may only view it gets `forbidden`, and a flow the caller may not view answers `not_found`.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read_write","parameters":[{"name":"flowId","in":"path","required":true,"description":"The flow's id.","schema":{"$ref":"#/components/schemas/FlowId"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RenameFlowBody"}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Flow"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"delete":{"operationId":"flows.deleteFlow","tags":["flows"],"summary":"Delete a flow","description":"Deletes a flow and cancels its runs in progress. Only the flow's owner and the organization's owner and admins may delete it, never a viewer, even one who owns it.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read_write","parameters":[{"name":"flowId","in":"path","required":true,"description":"The flow's id.","schema":{"$ref":"#/components/schemas/FlowId"}}],"responses":{"204":{"description":"Done. The answer has no body."},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/flows/{flowId}/pause":{"post":{"operationId":"flows.pauseFlow","tags":["flows"],"summary":"Pause a flow","description":"Pauses an active flow: its schedule or its events stop starting runs, while runs in progress go on. Its `pausedReason` becomes `manual`, and it can still be run by hand with Start a run, to try it before turning it on again. A flow that is already paused comes back as it is, its reason kept. Send the `expectedRevision` you read. Needs edit access to the flow: its owner, the organization's owner and admins, and the members granted edit.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read_write","parameters":[{"name":"flowId","in":"path","required":true,"description":"The flow's id.","schema":{"$ref":"#/components/schemas/FlowId"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PauseFlowBody"}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Flow"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"revision_conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/flows/{flowId}/activate":{"post":{"operationId":"flows.activateFlow","tags":["flows"],"summary":"Activate a flow","description":"Turns a paused flow on, so its schedule or its events start runs again. Send the `expectedRevision` you read. Needs edit access to the flow: its owner, the organization's owner and admins, and the members granted edit. A flow that is already on or cannot run (its owner was removed or made a viewer, or its definition is invalid), or that has a record-date start while 50 such flows of the organization are on, answers `409 state_conflict`. A flow paused because its owner was removed or made a viewer, or because it was handed over (`pausedReason` `owner_deactivated`, `owner_made_viewer` or `handed_over`), is turned on only by its owner; anyone else gets `403 forbidden`, so no run uses an owner's access before they turn it on.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read_write","parameters":[{"name":"flowId","in":"path","required":true,"description":"The flow's id.","schema":{"$ref":"#/components/schemas/FlowId"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ActivateFlowBody"}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Flow"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"revision_conflict, state_conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/orgs/{orgId}/flow-trigger-events":{"get":{"operationId":"flows.listTriggerEvents","tags":["flows"],"summary":"List trigger events","description":"Lists the events that can start a flow, such as a new record, a new file or a decision on a file's approval, each with the kind of object it watches and the fields its conditions can test. Use it to build the start of a flow that runs on an event. Any member of the organization can read it.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read","parameters":[{"name":"orgId","in":"path","required":true,"description":"The organization's id.","schema":{"$ref":"#/components/schemas/OrganizationId"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlowTriggerEventList"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/flows/{flowId}/versions":{"get":{"operationId":"flows.listFlowVersions","tags":["flows"],"summary":"List flow versions","description":"Lists a flow's saved versions, newest first. A save adds a version only when it changes the start or the steps; a new name or other settings do not. Needs view access to the flow.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read","parameters":[{"name":"flowId","in":"path","required":true,"description":"The flow's id.","schema":{"$ref":"#/components/schemas/FlowId"}},{"name":"cursor","in":"query","required":false,"description":"Where to continue: the `nextCursor` of the page before. Left out, the list starts at its beginning.","schema":{"$ref":"#/components/schemas/Cursor"}},{"name":"limit","in":"query","required":false,"description":"How many items to return, 1 to 200; 50 when left out.","schema":{"type":"string","pattern":"^-?(0|[1-9][0-9]*)$"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlowVersionPage"}}}},"400":{"description":"validation_failed, invalid_cursor","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/flow-versions/{flowVersionId}":{"get":{"operationId":"flows.getFlowVersion","tags":["flows"],"summary":"Get a flow version","description":"Returns one saved version of a flow: its number, its start and steps as saved, who saved it and when. Each run keeps the version it started with (`flowVersion` on the run), so use this to show the steps of a run. Needs view access to the flow.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read","parameters":[{"name":"flowVersionId","in":"path","required":true,"description":"The flow version's id.","schema":{"$ref":"#/components/schemas/FlowVersionId"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlowVersion"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/flows/{flowId}/runs":{"post":{"operationId":"flows.startRun","tags":["flows"],"summary":"Start a run","description":"Starts a run of the flow's current version now, whatever its start, with an optional `input` of up to 2,000 characters for the first step. A flow paused by hand can still be run, to try it before turning it on. The run acts with the flow owner's access alone, whoever starts it; started with an API key, that access is also limited by the key. Needs edit access to the flow: its owner, the organization's owner and admins, and the members granted edit. Answers `409 state_conflict` when the flow cannot run or all agents are paused, `429 budget_exceeded` once the AI budget is spent, and `403 forbidden` to anyone but the owner while the flow is paused with `owner_deactivated`, `owner_made_viewer` or `handed_over`.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read_write","parameters":[{"name":"flowId","in":"path","required":true,"description":"The flow's id.","schema":{"$ref":"#/components/schemas/FlowId"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"A key you choose for this request, such as a UUID. Once the request has succeeded, sending it again with the same key gets the first answer back, with nothing done twice.","schema":{"$ref":"#/components/schemas/IdempotencyKey"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartRunBody"},"example":{"input":"Call out the spring launch reels: the client asked about them on Friday."}}}},"responses":{"201":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlowRun"},"example":{"id":"run_01jbf7j9m1p3s5v7x9z1b3d5g7","number":13,"status":"queued","currentStepIndex":null,"startedAt":"2026-10-22T10:15:00.000Z","endedAt":null,"costMicros":0,"flowId":"flow_01jbb3d5f7h9k1n3q5s7v9x1z3","flowVersion":{"id":"flv_01jbc4f6h8k0n2q4s6v8x0z2b4","number":2},"trigger":{"kind":"manual","startedBy":"mbr_01jb3a5c7e9g1j3k5m7p9r1t3v","input":"Call out the spring launch reels: the client asked about them on Friday."},"chainId":"chain_01jbg8k0n2q4s6v8x0z2b4d6h8","initiatorId":"mbr_01jb3a5c7e9g1j3k5m7p9r1t3v","parentChainId":null,"sendBackCount":0,"maxSendBacks":3,"chatId":"chat_01jbn3r5t7w9y1a3c5e7g9j1p3","failure":null,"cancelledBy":null,"steps":[]}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"idempotency_in_progress, state_conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"422":{"description":"idempotency_key_reused","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited, budget_exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"get":{"operationId":"flows.listRuns","tags":["flows"],"summary":"List runs","description":"Lists a flow's runs, newest first; `status` keeps the runs with one status (`queued`, `running`, `waiting`, `completed`, `failed` or `cancelled`). Each run has its number, status, current step, start and end times, why it failed, and its AI cost, which only the organization's owner and admins see. Needs view access to the flow.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read","parameters":[{"name":"flowId","in":"path","required":true,"description":"The flow's id.","schema":{"$ref":"#/components/schemas/FlowId"}},{"name":"status","in":"query","required":false,"description":"Only the runs with this status.","schema":{"$ref":"#/components/schemas/FlowRunStatus"}},{"name":"cursor","in":"query","required":false,"description":"Where to continue: the `nextCursor` of the page before. Left out, the list starts at its beginning.","schema":{"$ref":"#/components/schemas/Cursor"}},{"name":"limit","in":"query","required":false,"description":"How many items to return, 1 to 200; 50 when left out.","schema":{"type":"string","pattern":"^-?(0|[1-9][0-9]*)$"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlowRunSummaryPage"}}}},"400":{"description":"validation_failed, invalid_cursor","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/flow-runs/{flowRunId}":{"get":{"operationId":"flows.getRun","tags":["flows"],"summary":"Get a run","description":"Returns a run with its step runs: each one's status and attempt, a send-back's reason, and the agent turn or sign-off behind it, plus why the run failed. It never holds what an agent step wrote, which stays in the run's own chat for the people who may read it. Needs view access to the flow.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read","parameters":[{"name":"flowRunId","in":"path","required":true,"description":"The run's id.","schema":{"$ref":"#/components/schemas/FlowRunId"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlowRun"},"example":{"id":"run_01jbf7j9m1p3s5v7x9z1b3d5g7","number":13,"status":"waiting","currentStepIndex":1,"startedAt":"2026-10-22T10:15:00.000Z","endedAt":null,"costMicros":38400,"flowId":"flow_01jbb3d5f7h9k1n3q5s7v9x1z3","flowVersion":{"id":"flv_01jbc4f6h8k0n2q4s6v8x0z2b4","number":2},"trigger":{"kind":"manual","startedBy":"mbr_01jb3a5c7e9g1j3k5m7p9r1t3v","input":"Call out the spring launch reels: the client asked about them on Friday."},"chainId":"chain_01jbg8k0n2q4s6v8x0z2b4d6h8","initiatorId":"mbr_01jb3a5c7e9g1j3k5m7p9r1t3v","parentChainId":null,"sendBackCount":0,"maxSendBacks":3,"chatId":"chat_01jbn3r5t7w9y1a3c5e7g9j1p3","failure":null,"cancelledBy":null,"steps":[{"id":"srun_01jbh9m1p3s5v7x9z1b3d5f7j9","stepId":"step_01jbd5g7j9m1p3s5v7x9z1c3e5","index":0,"attempt":1,"status":"completed","turnId":"turn_01jbk1p3r5t7w9y1a3c5e7g9m1","approvalId":null,"note":null,"startedAt":"2026-10-22T10:15:02.000Z","endedAt":"2026-10-22T10:17:48.000Z"},{"id":"srun_01jbj0n2q4s6v8x0z2b4d6f8k0","stepId":"step_01jbe6h8k0n2q4t6w8y0a2c4f6","index":1,"attempt":1,"status":"waiting","turnId":null,"approvalId":"apr_01jbm2q4s6v8x0z2b4d6f8h0n2","note":null,"startedAt":"2026-10-22T10:17:48.000Z","endedAt":null}]}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/flow-runs/{flowRunId}/cancel":{"post":{"operationId":"flows.cancelRun","tags":["flows"],"summary":"Cancel a run","description":"Cancels a run that has not ended: its running agent turns stop, and its open steps and sign-offs are cancelled. Needs edit access to the flow: its owner, the organization's owner and admins, and the members granted edit. A run that has already ended answers `409 state_conflict`.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read_write","parameters":[{"name":"flowRunId","in":"path","required":true,"description":"The run's id.","schema":{"$ref":"#/components/schemas/FlowRunId"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlowRun"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"state_conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/me/preferences":{"patch":{"operationId":"activity.updatePreferences","tags":["activity"],"summary":"Update preferences","description":"Changes some of the signed-in person's preferences: theme, language, the language agents reply in, the email summary, the email notification switches and the sidebar's look. Send only the keys that change; the others keep their value, and `null` is refused. The last write wins: there is no revision. Returns every preference. Preferences belong to the person, not the organization, and `GET /v0/me` returns them. API keys cannot call it.","security":[{"session":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreferencesPatch"}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Preferences"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/orgs/{orgId}/logs":{"get":{"operationId":"activity.listLogs","tags":["activity"],"summary":"List log entries","description":"Lists the organization's log, newest first: one entry per change, with who made it, for whom and through which API key. It reads the last `windowDays` days, 30 by default and never further back than the organization's log retention. Narrow it with `q` (free text), `filter` (up to 10 conditions) and `byKind` (the kind of author: person, agent, system or guest). The answer counts the entries that match and all entries of the window. The owner and admins read every entry; other members only those about what they may see.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read","parameters":[{"name":"orgId","in":"path","required":true,"description":"The organization's id.","schema":{"$ref":"#/components/schemas/OrganizationId"}},{"name":"windowDays","in":"query","required":false,"description":"How many days back to read: 30 when left out, and never past the organization's log retention.","schema":{"type":"string","pattern":"^-?(0|[1-9][0-9]*)$"}},{"name":"q","in":"query","required":false,"description":"Free-text search of the entries.","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"filter","in":"query","required":false,"description":"Up to 10 conditions that must all hold, each `{ field, operator, value }`, sent as a JSON array encoded in base64url.","schema":{"type":"string","pattern":"^[A-Za-z0-9_-]*$"}},{"name":"byKind","in":"query","required":false,"description":"Only entries by these kinds of author, comma-separated: `person`, `agent`, `system`, `guest`. Left out: every kind.","schema":{"type":"string"}},{"name":"cursor","in":"query","required":false,"description":"Where to continue: the `nextCursor` of the page before. Left out, the list starts at its beginning.","schema":{"$ref":"#/components/schemas/Cursor"}},{"name":"limit","in":"query","required":false,"description":"How many items to return, 1 to 200; 50 when left out.","schema":{"type":"string","pattern":"^-?(0|[1-9][0-9]*)$"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LogPage"},"example":{"items":[{"id":"48213","occurredAt":"2026-10-21T09:30:00.000Z","eventType":"table.created","label":"Table created: Influencer outreach","detail":null,"category":"table","by":{"kind":"actor","actorId":"agt_01jb2q6a8c0e2g4j6m8p0r2t4w"},"onBehalfOf":"mbr_01jb2m8a3c5e7g9j1k3m5p7r9s","chainId":"chain_01jbaf3k5m7p9r1t3w5y7a9c1e","flowRunId":null,"result":"ok","object":{"ref":{"type":"table","id":"tbl_01jbaf3m6p8r0t2w4y6a8c0e2g"},"name":"Influencer outreach"},"apiKey":null,"turnId":null},{"id":"48209","occurredAt":"2026-10-21T09:28:17.000Z","eventType":"turn.ended","label":"Agent replied","detail":"1,234 tokens (1,200 in, 34 out)","category":"chat","by":{"kind":"actor","actorId":"agt_01jb2q6a8c0e2g4j6m8p0r2t4w"},"onBehalfOf":"mbr_01jb2m8a3c5e7g9j1k3m5p7r9s","chainId":"chain_01jbaf3k5m7p9r1t3w5y7a9c1e","flowRunId":null,"result":"ok","object":null,"apiKey":null,"turnId":"turn_01jbaf3k8n0q2s4v6x8z0b2d4f"},{"id":"48207","occurredAt":"2026-10-21T09:12:44.000Z","eventType":"chat.created","label":"Chat created: Client: Northwind Coffee","detail":null,"category":"chat","by":{"kind":"actor","actorId":"mbr_01jb2m8b4d6f8h0k2m4n6q8s0t"},"onBehalfOf":null,"chainId":null,"flowRunId":null,"result":"ok","object":{"ref":{"type":"chat","id":"chat_01jbae7r9t1w3y5a7c9e1g3j5m"},"name":"Client: Northwind Coffee"},"apiKey":{"id":"apikey_01jb8r3t5w7y9a1c3e5g7j9m1p","name":"Zapier: new clients"},"turnId":null}],"nextCursor":"NDgyMDc","totalCount":1834,"matchCount":1834,"windowDays":30,"retentionDays":90}}}},"400":{"description":"validation_failed, invalid_cursor","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/orgs/{orgId}/logs/{eventId}":{"get":{"operationId":"activity.getLogEntry","tags":["activity"],"summary":"Get a log entry","description":"Returns one log entry, as the log list shows it to the caller, with what it changed: line by line, each a label and the value before and after. For an approval: the decision, the round, how many approvers approved, how it was decided (in the app, through a guest link or with an API key), the approvers added or removed, and the comment that explains a change request, by its id. For a member or an invite: the email, the role and the job title. The list is empty for an entry with nothing more to show, and null once the entry's event is no longer kept (a deleted chat's history is purged after 30 days). Answers `404 not_found` for an entry the caller may not read, one older than the organization's log retention, and an id it has no entry for.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read","parameters":[{"name":"orgId","in":"path","required":true,"description":"The organization's id.","schema":{"$ref":"#/components/schemas/OrganizationId"}},{"name":"eventId","in":"path","required":true,"description":"The entry's id, as the log list gives it (the event's id).","schema":{"$ref":"#/components/schemas/EventId"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LogEntryDetail"},"example":{"id":"48230","occurredAt":"2026-10-21T10:02:11.000Z","eventType":"approval.decided","label":"Approval decided: bf-hero-reel.mp4","detail":null,"category":"media","by":{"kind":"actor","actorId":"mbr_01jb2m8a3c5e7g9j1k3m5p7r9s"},"onBehalfOf":null,"chainId":null,"flowRunId":null,"result":"ok","object":{"ref":{"type":"approval","id":"apr_01jba4b6d8f0h2k4m6p8r0t2w4"},"name":"bf-hero-reel.mp4"},"apiKey":null,"turnId":null,"changes":[{"label":"Decision","from":null,"to":{"kind":"text","text":"Changes requested"}},{"label":"Decided","from":null,"to":{"kind":"text","text":"In the app"}},{"label":"Change request","from":null,"to":{"kind":"comment","fileId":"file_01jb9z8c0e2g4j6m8p0r2t4w6y","messageId":"msg_01jbaf4a6c8e0g2j4m6p8r0t2w"}},{"label":"Round","from":null,"to":{"kind":"text","text":"2"}},{"label":"Approvals","from":null,"to":{"kind":"text","text":"1 of 2 approved"}}]}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/orgs/{orgId}/logs/export.csv":{"get":{"operationId":"activity.exportLogsCsv","tags":["activity"],"summary":"Export logs as CSV","description":"Downloads, as a CSV file, the log entries that `GET /v0/orgs/{orgId}/logs` lists for the same window, search, filter and `byKind`: every page of them, newest first. The file holds at most the newest 50,000 entries; two response headers say whether it was cut short and how many entries matched. A cell that starts with `=`, `+`, `-` or `@`, and every part of a cell after a `;` that does, gets a leading apostrophe, so spreadsheet apps show it as text whatever their list separator.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read","parameters":[{"name":"orgId","in":"path","required":true,"description":"The organization's id.","schema":{"$ref":"#/components/schemas/OrganizationId"}},{"name":"windowDays","in":"query","required":false,"description":"How many days back to read: 30 when left out, and never past the organization's log retention.","schema":{"type":"string","pattern":"^-?(0|[1-9][0-9]*)$"}},{"name":"q","in":"query","required":false,"description":"Free-text search of the entries.","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"filter","in":"query","required":false,"description":"Up to 10 conditions that must all hold, each `{ field, operator, value }`, sent as a JSON array encoded in base64url.","schema":{"type":"string","pattern":"^[A-Za-z0-9_-]*$"}},{"name":"byKind","in":"query","required":false,"description":"Only entries by these kinds of author, comma-separated: `person`, `agent`, `system`, `guest`. Left out: every kind.","schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","headers":{"Content-Disposition":{"description":"attachment; filename=\"logs.csv\": the browser saves the file.","required":true,"schema":{"type":"string"}},"Fleepr-Export-Truncated":{"description":"true when the file holds only the newest 50000 of the entries that match, else false.","required":true,"schema":{"type":"string"}},"Fleepr-Export-Match-Count":{"description":"How many entries match the window, search, filter and author kinds: the `matchCount` the log list answers.","required":true,"schema":{"type":"string"}}},"content":{"text/csv":{"schema":{"type":"string"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/orgs/{orgId}/notifications":{"get":{"operationId":"activity.listNotifications","tags":["activity"],"summary":"List notifications","description":"Lists the caller's own notifications in the organization, newest first. Keep only the unread ones with `unreadOnly=true`, or some kinds with `kind` (`mention` for mentions). Every page also carries `unreadCount`, all the caller's unread notifications whatever the filters, and `badgeCount`, the same without those about something waiting for a decision, which the Approvals page counts instead. Through an API key, those appear only for the kinds of decision the key may take, never for access requests or Health fixes, and both counts leave the others out.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read","parameters":[{"name":"orgId","in":"path","required":true,"description":"The organization's id.","schema":{"$ref":"#/components/schemas/OrganizationId"}},{"name":"unreadOnly","in":"query","required":false,"description":"`true` keeps only the unread notifications; left out, read ones are listed too.","schema":{"type":"string","pattern":"^(true|false)$"}},{"name":"kind","in":"query","required":false,"description":"Only notifications of these kinds, comma-separated. Left out: every kind.","schema":{"type":"string"}},{"name":"cursor","in":"query","required":false,"description":"Where to continue: the `nextCursor` of the page before. Left out, the list starts at its beginning.","schema":{"$ref":"#/components/schemas/Cursor"}},{"name":"limit","in":"query","required":false,"description":"How many items to return, 1 to 200; 50 when left out.","schema":{"type":"string","pattern":"^-?(0|[1-9][0-9]*)$"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotificationPage"}}}},"400":{"description":"validation_failed, invalid_cursor","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/orgs/{orgId}/notifications/read":{"post":{"operationId":"activity.markNotificationsRead","tags":["activity"],"summary":"Mark notifications as read","description":"Marks some of the caller's notifications as read (`ids`, 1 to 200) or all of them (`all: true`); send exactly one of the two. Marking twice changes nothing, so it takes no `Idempotency-Key`. Returns the new `unreadCount` and `badgeCount`, and the organization stream tells the caller's other open apps. Nobody marks another person's notifications.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read_write","parameters":[{"name":"orgId","in":"path","required":true,"description":"The organization's id.","schema":{"$ref":"#/components/schemas/OrganizationId"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarkNotificationsReadBody"}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarkNotificationsReadResult"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/orgs/{orgId}/waiting":{"get":{"operationId":"activity.listWaiting","tags":["activity"],"summary":"List pending decisions","description":"Returns everything waiting for the caller's decision, as the Approvals page shows it: flow sign-offs, file approvals, agents' request cards, \"Ask to edit\" requests, the question cards agents of flow runs ask, Health fixes and Fleepr's weekly item. Each kind holds up to 50 items, merged in urgency order, each item saying why the caller decides it; items they decide only as an admin are grouped apart. The answer adds the counts per kind and which kinds hold more. It takes no filters and no paging. An API key gets only what it may decide by its member's own right, never Fleepr's weekly item (a person's), and a key that may decide nothing answers `403 forbidden`.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read","parameters":[{"name":"orgId","in":"path","required":true,"description":"The organization's id.","schema":{"$ref":"#/components/schemas/OrganizationId"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WaitingOnMe"},"example":{"items":[{"kind":"file","approval":{"id":"apr_01jba4b6d8f0h2k4m6p8r0t2w4","organizationId":"org_01jb2m7q9x4t6v8w0y2z4c6e8g","subject":{"kind":"file","fileId":"file_01jb9z8c0e2g4j6m8p0r2t4w6y","versionId":"fver_01jba3x5z7b9d1f3h5k7m9p1r3"},"ownerId":"mbr_01jb2m8b4d6f8h0k2m4n6q8s0t","createdBy":"mbr_01jb2m8b4d6f8h0k2m4n6q8s0t","round":2,"status":"pending","pausedReason":null,"outsideAgentsMayDecide":true,"approvers":[{"key":"mbr_01jb2m8a3c5e7g9j1k3m5p7r9s","who":{"kind":"member","memberId":"mbr_01jb2m8a3c5e7g9j1k3m5p7r9s"},"order":0,"decision":null,"decidedAt":null,"reasonMessageId":null,"via":null,"apiKey":null,"addedBy":"mbr_01jb2m8b4d6f8h0k2m4n6q8s0t","addedAt":"2026-10-17T10:05:00.000Z"},{"key":"gst_01jb9z9a1c3e5g7j9m1p3r5t7w","who":{"kind":"guest","guestContactId":"gst_01jb9z9a1c3e5g7j9m1p3r5t7w","name":"Priya Shah"},"order":1,"decision":null,"decidedAt":null,"reasonMessageId":null,"via":null,"apiKey":null,"addedBy":"mbr_01jb2m8b4d6f8h0k2m4n6q8s0t","addedAt":"2026-10-17T10:06:00.000Z"}],"viewerIds":["mbr_01jb2m8b4d6f8h0k2m4n6q8s0t"],"approvedCount":0,"approverCount":2,"viewer":{"isApprover":true,"myDecision":null,"canDecide":true,"canUndo":false,"canAddApprovers":false},"createdAt":"2026-10-17T10:05:00.000Z","updatedAt":"2026-10-20T11:00:00.000Z","revision":6},"openComments":{"count":2,"by":{"kind":"guest","guestContactId":"gst_01jb9z9a1c3e5g7j9m1p3r5t7w","name":"Priya Shah"},"at":"2026-10-19T15:20:00.000Z","excerpt":"Love the direction. Can the logo be larger, and can the headline use the spring tagline?"},"decidesAs":["approver"],"group":"yours","counted":true,"countsFrom":null,"waitingSince":"2026-10-20T11:00:00.000Z","expiresAt":null},{"kind":"access","accessRequest":{"id":"areq_01jbad2n4q6s8v0x2z4b6d8f0h","organizationId":"org_01jb2m7q9x4t6v8w0y2z4c6e8g","object":{"type":"table","id":"tbl_01jbac8d0f2h4k6m8p0r2t4w6y"},"requesterId":"mbr_01jb2n4f6h8k0m2p4r6t8w0y2a","level":"edit","message":"I'd like to log this week's influencer replies.","status":"pending","decidedBy":null,"decidedAt":null,"createdAt":"2026-10-20T16:10:00.000Z","revision":1,"viewer":{"canDecide":true}},"decidesAs":["admin"],"group":"admin","counted":false,"countsFrom":null,"waitingSince":"2026-10-20T16:10:00.000Z","expiresAt":null}],"counts":{"all":1,"flow":0,"file":1,"agent":0,"access":0,"question":0,"health_fix":0,"fleepr_weekly":0},"adminCount":1,"truncated":{"flow":false,"file":false,"agent":false,"access":false,"question":false,"health_fix":false,"fleepr_weekly":false}}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/orgs/{orgId}/health":{"get":{"operationId":"health.getSummary","tags":["health"],"summary":"Get the Health summary","description":"Returns the organization's Health at a glance: a score from 0 to 100 for each area (data, automations, performance and memory) with its trend over the last 30 days, how many issues are open and when the nightly check last ran. A score is `null` while no check has measured anything in its area. The open counts include only the issues the caller may see. Every member may read it.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read","parameters":[{"name":"orgId","in":"path","required":true,"description":"The organization's id.","schema":{"$ref":"#/components/schemas/OrganizationId"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthSummary"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/orgs/{orgId}/health/issues":{"get":{"operationId":"health.listIssues","tags":["health"],"summary":"List Health issues","description":"Lists the problems the Health checks found. Open issues (the default, `status=open`, waiting ones included) come by severity, then newest first; `status=resolved` lists fixed and dismissed ones, the latest decided first. Narrow it to one `area`. Each issue carries the numbers behind it and what the caller may do with it. Only issues about what the caller may view are listed and counted.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read","parameters":[{"name":"orgId","in":"path","required":true,"description":"The organization's id.","schema":{"$ref":"#/components/schemas/OrganizationId"}},{"name":"status","in":"query","required":false,"description":"`open` (the default) for open issues, waiting ones included; `resolved` for fixed and dismissed ones.","schema":{"$ref":"#/components/schemas/HealthIssueFilter"}},{"name":"area","in":"query","required":false,"description":"Only the issues of this area. Left out: every area.","schema":{"$ref":"#/components/schemas/HealthArea"}},{"name":"cursor","in":"query","required":false,"description":"Where to continue: the `nextCursor` of the page before. Left out, the list starts at its beginning.","schema":{"$ref":"#/components/schemas/Cursor"}},{"name":"limit","in":"query","required":false,"description":"How many items to return, 1 to 200; 50 when left out.","schema":{"type":"string","pattern":"^-?(0|[1-9][0-9]*)$"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthIssuePage"}}}},"400":{"description":"validation_failed, invalid_cursor","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/health/issues/{issueId}":{"get":{"operationId":"health.getIssue","tags":["health"],"summary":"Get a Health issue","description":"Returns one issue: what it is about, the numbers behind it, the fix the check proposes, its history and what the caller may do with it. An issue about something the caller may not view answers `404 not_found`.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read","parameters":[{"name":"issueId","in":"path","required":true,"description":"The issue's id.","schema":{"$ref":"#/components/schemas/HealthIssueId"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthIssue"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/health/issues/{issueId}/resolve":{"post":{"operationId":"health.resolveIssue","tags":["health"],"summary":"Resolve a Health issue","description":"Marks an open issue fixed, or dismisses it with a reason. The owner and admins may do both; the owner of a flow may also mark that flow's issues fixed. Dismissing an issue whose fix waits in Approvals declines the fix; marking it fixed takes it out of Approvals with nothing carried out. An API key may not mark fixed an issue whose fix Fleepr carries out, nor decline a waiting fix: a person decides those. A fixed issue comes back if the next check finds the problem again. A dismissed one stays dismissed, except one dismissed as `not_now`, which may come back after 30 days. An issue that is already fixed or dismissed answers `409 state_conflict`.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read_write","parameters":[{"name":"issueId","in":"path","required":true,"description":"The issue's id.","schema":{"$ref":"#/components/schemas/HealthIssueId"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"A key you choose for this request, such as a UUID. Once the request has succeeded, sending it again with the same key gets the first answer back, with nothing done twice.","schema":{"$ref":"#/components/schemas/IdempotencyKey"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResolveHealthIssueBody"}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthIssue"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"idempotency_in_progress, revision_conflict, state_conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"422":{"description":"idempotency_key_reused","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/health/issues/{issueId}/reopen":{"post":{"operationId":"health.reopenIssue","tags":["health"],"summary":"Reopen a Health issue","description":"Puts a fixed or dismissed issue back to open, and adds a line to its history: the way to undo a fix or a dismissal. The owner and admins reopen any issue; a flow's owner reopens a fixed issue of their flow. An issue that is already open answers `409 state_conflict`.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read_write","parameters":[{"name":"issueId","in":"path","required":true,"description":"The issue's id.","schema":{"$ref":"#/components/schemas/HealthIssueId"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"A key you choose for this request, such as a UUID. Once the request has succeeded, sending it again with the same key gets the first answer back, with nothing done twice.","schema":{"$ref":"#/components/schemas/IdempotencyKey"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReopenHealthIssueBody"}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthIssue"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"idempotency_in_progress, revision_conflict, state_conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"422":{"description":"idempotency_key_reused","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/health/issues/{issueId}/request-fix":{"post":{"operationId":"health.requestFix","tags":["health"],"summary":"Send a Health fix to Approvals","description":"Puts the fix of an open issue in Approvals, where the owner and admins decide it: the issue is `waiting`, and what waits for them lists it as kind `health_fix`. Only a fix Fleepr carries out (`fix.asksFirst`: merge options, turn into a link) goes there; any other answers `409 state_conflict`, as does an issue that is not open. The owner and admins send it, in the app: no API key may, since a person decides a change to how data is organized.","security":[{"session":[]}],"x-api-key-scope":"none","parameters":[{"name":"issueId","in":"path","required":true,"description":"The issue's id.","schema":{"$ref":"#/components/schemas/HealthIssueId"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"A key you choose for this request, such as a UUID. Once the request has succeeded, sending it again with the same key gets the first answer back, with nothing done twice.","schema":{"$ref":"#/components/schemas/IdempotencyKey"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthFixStepBody"}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthIssue"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"idempotency_in_progress, revision_conflict, state_conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"422":{"description":"idempotency_key_reused","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/health/issues/{issueId}/apply-fix":{"post":{"operationId":"health.applyFix","tags":["health"],"summary":"Approve a Health fix","description":"Approves a waiting fix, and Fleepr carries it out as the caller, in one step: it merges the options into the most used one, or turns the text field into a link (after copying its words into a new text field, so no cell is lost). The issue is then `fixed`. The owner and admins approve, in the app (never an API key), the one who sent it included, and need the table's right to change its fields (`403 forbidden` otherwise). A fix already done, or whose field is gone, leaves the issue fixed with no change. An issue that is not waiting, or whose fix can no longer be carried out safely (its target table is gone, or the field is one whose type cannot change), answers `409 state_conflict`. A fix that takes longer than a minute answers `503 unavailable` and changes nothing.","security":[{"session":[]}],"x-api-key-scope":"none","parameters":[{"name":"issueId","in":"path","required":true,"description":"The issue's id.","schema":{"$ref":"#/components/schemas/HealthIssueId"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"A key you choose for this request, such as a UUID. Once the request has succeeded, sending it again with the same key gets the first answer back, with nothing done twice.","schema":{"$ref":"#/components/schemas/IdempotencyKey"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthFixStepBody"}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthIssue"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"idempotency_in_progress, revision_conflict, state_conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"422":{"description":"idempotency_key_reused","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/health/issues/{issueId}/withdraw-fix":{"post":{"operationId":"health.withdrawFix","tags":["health"],"summary":"Withdraw a Health fix","description":"Takes a waiting fix back out of Approvals: the issue is open again. The owner and admins withdraw it, in the app (never an API key). To decline a fix, resolve the issue as dismissed, with a reason. An issue that is not waiting answers `409 state_conflict`.","security":[{"session":[]}],"x-api-key-scope":"none","parameters":[{"name":"issueId","in":"path","required":true,"description":"The issue's id.","schema":{"$ref":"#/components/schemas/HealthIssueId"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"A key you choose for this request, such as a UUID. Once the request has succeeded, sending it again with the same key gets the first answer back, with nothing done twice.","schema":{"$ref":"#/components/schemas/IdempotencyKey"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthFixStepBody"}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthIssue"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"idempotency_in_progress, revision_conflict, state_conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"422":{"description":"idempotency_key_reused","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/orgs/{orgId}/health/tables":{"get":{"operationId":"health.listTableProfiles","tags":["health"],"summary":"List table profiles","description":"Lists what Fleepr knows about each table the caller may view, by table name: its role (the things the organization works with, what happens to them, or a short list of options), what it is for, other words people use for it, and a few numbers. Fleepr suggests a role each night until a person edits the profile.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read","parameters":[{"name":"orgId","in":"path","required":true,"description":"The organization's id.","schema":{"$ref":"#/components/schemas/OrganizationId"}},{"name":"cursor","in":"query","required":false,"description":"Where to continue: the `nextCursor` of the page before. Left out, the list starts at its beginning.","schema":{"$ref":"#/components/schemas/Cursor"}},{"name":"limit","in":"query","required":false,"description":"How many items to return, 1 to 200; 50 when left out.","schema":{"type":"string","pattern":"^-?(0|[1-9][0-9]*)$"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TableProfilePage"}}}},"400":{"description":"validation_failed, invalid_cursor","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/health/tables/{tableId}":{"patch":{"operationId":"health.updateTableProfile","tags":["health"],"summary":"Update a table profile","description":"Changes a table's profile: its role, its description (the table's own, as its Details edit it), other words people use for it and the columns its records are named by, or confirms what Fleepr suggested (`confirm`). Send only what changes. Each field sent or confirmed is confirmed, and from then on the nightly check never changes it. The owner and admins may edit profiles; a description also asks edit on the table (`403 forbidden`). A naming with a column the table lacks, of a type its role does not take, repeated, or the name column among the identifiers answers `400 validation_failed` at that field. A table the caller may not view answers `404 not_found`.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read_write","parameters":[{"name":"tableId","in":"path","required":true,"description":"The table's id.","schema":{"$ref":"#/components/schemas/TableId"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateTableProfileBody"}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TableProfile"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"revision_conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/orgs/{orgId}/health/targets":{"get":{"operationId":"health.listTargets","tags":["health"],"summary":"List targets","description":"Lists the organization's targets by name, each with its running period, the last 5 that ended, its open issue and how many a day it still needs. A target is shown to the members who may view every chat, flow and record's table its conditions name; its value counts every item in the organization. Every member may read.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read","parameters":[{"name":"orgId","in":"path","required":true,"description":"The organization's id.","schema":{"$ref":"#/components/schemas/OrganizationId"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthTargetList"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"post":{"operationId":"health.createTarget","tags":["health"],"summary":"Add a target","description":"Adds a target: what it measures (a preset, or a source with conditions and a calculation), its goal, its period and which way is better, owned by the caller or the member named. It is measured at once, with up to 12 periods before the running one. Any member but a viewer may add one about what they may view: a condition naming a chat, flow or record the caller may not view answers `403 forbidden`, an owner who is not an active member `400 validation_failed`, and an organization holding 50 targets `409 state_conflict`. Only the owner and admins name someone else as owner (anyone else: `400 validation_failed`), and keep no quota of their own; any other member keeps at most 10 live targets of theirs (past it: `409 state_conflict`).","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read_write","parameters":[{"name":"orgId","in":"path","required":true,"description":"The organization's id.","schema":{"$ref":"#/components/schemas/OrganizationId"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"A key you choose for this request, such as a UUID. Once the request has succeeded, sending it again with the same key gets the first answer back, with nothing done twice.","schema":{"$ref":"#/components/schemas/IdempotencyKey"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateHealthTargetBody"}}}},"responses":{"201":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthTarget"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"idempotency_in_progress, state_conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"422":{"description":"idempotency_key_reused","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/health/targets/{targetId}":{"get":{"operationId":"health.getTarget","tags":["health"],"summary":"Get a target","description":"Returns a target with its periods (the running one, then the latest that ended) and its versions, the latest first. A target the caller may not see, or a deleted one, answers `404 not_found`.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read","parameters":[{"name":"targetId","in":"path","required":true,"description":"The target's id.","schema":{"$ref":"#/components/schemas/HealthTargetId"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthTargetDetail"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"patch":{"operationId":"health.updateTarget","tags":["health"],"summary":"Edit a target","description":"Changes a target: send only what changes, with the `expectedRevision` you read. Each edit is a new version in its history, and the running period is measured again at once; periods that ended keep their results. The target's owner and the organization's owner and admins may edit it; only the owner and admins name someone else as its owner (anyone else: `400 validation_failed`).","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read_write","parameters":[{"name":"targetId","in":"path","required":true,"description":"The target's id.","schema":{"$ref":"#/components/schemas/HealthTargetId"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"A key you choose for this request, such as a UUID. Once the request has succeeded, sending it again with the same key gets the first answer back, with nothing done twice.","schema":{"$ref":"#/components/schemas/IdempotencyKey"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateHealthTargetBody"}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthTarget"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"idempotency_in_progress, revision_conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"422":{"description":"idempotency_key_reused","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"delete":{"operationId":"health.deleteTarget","tags":["health"],"summary":"Delete a target","description":"Deletes a target: it leaves every list and its open issues are cleared; its periods and history stay for Logs. The target's owner and the organization's owner and admins may delete it.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read_write","parameters":[{"name":"targetId","in":"path","required":true,"description":"The target's id.","schema":{"$ref":"#/components/schemas/HealthTargetId"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"A key you choose for this request, such as a UUID. Once the request has succeeded, sending it again with the same key gets the first answer back, with nothing done twice.","schema":{"$ref":"#/components/schemas/IdempotencyKey"}}],"responses":{"204":{"description":"Done. The answer has no body."},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"idempotency_in_progress","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"422":{"description":"idempotency_key_reused","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/orgs/{orgId}/health/target-suggestions":{"get":{"operationId":"health.listTargetSuggestions","tags":["health"],"summary":"List target suggestions","description":"Lists the targets Fleepr suggests from the last 4 weeks of data, once an organization has them: one per preset it does not track yet, with the 4 weekly values behind it. The weekly Fleepr item shows them, and so does Add target. A suggestion expires after 30 days. Only the owner and admins read them (anyone else reads none): the weekly values are org-wide, with no small cell withheld.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read","parameters":[{"name":"orgId","in":"path","required":true,"description":"The organization's id.","schema":{"$ref":"#/components/schemas/OrganizationId"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthTargetSuggestionList"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/health/target-suggestions/{suggestionId}/decide":{"post":{"operationId":"health.decideTargetSuggestion","tags":["health"],"summary":"Accept or dismiss a target suggestion","description":"Accepting creates the target, owned by the caller, with the suggested goal or one of theirs; dismissing keeps the same suggestion away for 90 days. A suggestion already decided or expired answers `409 state_conflict`. Only the owner and admins decide one (`403 forbidden` for anyone else).","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read_write","parameters":[{"name":"suggestionId","in":"path","required":true,"description":"The suggestion's id.","schema":{"$ref":"#/components/schemas/HealthTargetSuggestionId"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"A key you choose for this request, such as a UUID. Once the request has succeeded, sending it again with the same key gets the first answer back, with nothing done twice.","schema":{"$ref":"#/components/schemas/IdempotencyKey"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DecideHealthTargetSuggestionBody"}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DecidedHealthTargetSuggestion"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"idempotency_in_progress, state_conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"422":{"description":"idempotency_key_reused","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/orgs/{orgId}/memories":{"get":{"operationId":"memory.list","tags":["memory"],"summary":"List memories","description":"Lists what the organization taught Fleepr, newest first: the memories whose subject the caller may view, a suggestion or a rejected one only to its deciders and the person it came from. Filter by `status` (every status but `forgotten` by default) or `state` (one of the Memory page's lists), `scope`, `subjectId` (a record, a table with its records, or an agent) and `q`; `sort` orders it by the newest change or the most read. One request reads at most 1,000 memories: a page can hold fewer than `limit`, even none, while `nextCursor` says more may follow.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read","parameters":[{"name":"orgId","in":"path","required":true,"description":"The organization's id.","schema":{"$ref":"#/components/schemas/OrganizationId"}},{"name":"status","in":"query","required":false,"description":"Only memories in this status. Left out: every status but `forgotten`. Not with `state`.","schema":{"$ref":"#/components/schemas/MemoryStatus"}},{"name":"state","in":"query","required":false,"description":"Only the memories of one of the Memory page's lists: `current` (suggested and confirmed), `needs_you` (the suggestions the caller decides), `unused` (confirmed ones Health found unused, the longest unused first), `set_aside` (archived and rejected). Not with `status`.","schema":{"$ref":"#/components/schemas/MemoryListState"}},{"name":"sort","in":"query","required":false,"description":"`changed` (left out, the same): the newest change first; `read`: the most read in 30 days first. The `unused` list is the longest unused first whatever the sort.","schema":{"$ref":"#/components/schemas/MemoryListSort"}},{"name":"scope","in":"query","required":false,"description":"Only memories of this scope.","schema":{"$ref":"#/components/schemas/MemoryScope"}},{"name":"subjectId","in":"query","required":false,"description":"Only memories about this record, table or agent, by its id; a table also brings its records.","schema":{"type":"string","minLength":1,"maxLength":64}},{"name":"q","in":"query","required":false,"description":"Text to find in the words, ignoring case and accents; empty or left out, no filter.","schema":{"type":"string","maxLength":100}},{"name":"cursor","in":"query","required":false,"description":"Where to continue: the `nextCursor` of the page before. Left out, the list starts at its beginning.","schema":{"$ref":"#/components/schemas/Cursor"}},{"name":"limit","in":"query","required":false,"description":"How many items to return, 1 to 200; 50 when left out.","schema":{"type":"string","pattern":"^-?(0|[1-9][0-9]*)$"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemoryPage"}}}},"400":{"description":"validation_failed, invalid_cursor","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"post":{"operationId":"memory.create","tags":["memory"],"summary":"Add a memory","description":"Adds a memory: something agents read before they work. Whoever decides its scope (the organization's owner and admins; for a record or a table, the table's owner; for an agent, its owner) adds it confirmed, and the answer lists the confirmed memories it may repeat, to offer replacing them. Anyone else who may see the subject adds it as a suggestion, which waits for a decider. A subject the caller may not view, or a `docId` that is no doc they may view, answers `404 not_found`. Open suggestions are capped: 50 per person, 20 per subject and 1,000 per organization; a suggestion past one answers `409 state_conflict` (`currentStatus` `full`). A person adds at most 120 memories in 10 minutes (`429 rate_limited`).","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read_write","parameters":[{"name":"orgId","in":"path","required":true,"description":"The organization's id.","schema":{"$ref":"#/components/schemas/OrganizationId"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"A key you choose for this request, such as a UUID. Once the request has succeeded, sending it again with the same key gets the first answer back, with nothing done twice.","schema":{"$ref":"#/components/schemas/IdempotencyKey"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateMemoryBody"}}}},"responses":{"201":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemoryResult"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"idempotency_in_progress, state_conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"422":{"description":"idempotency_key_reused","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/orgs/{orgId}/memories/counts":{"get":{"operationId":"memory.counts","tags":["memory"],"summary":"Count memories","description":"Counts the memories the caller sees in each of the Memory page's lists: the current ones, by scope, the suggestions they decide, the unused ones and the archived and rejected ones.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read","parameters":[{"name":"orgId","in":"path","required":true,"description":"The organization's id.","schema":{"$ref":"#/components/schemas/OrganizationId"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemoryCounts"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/memories/{memoryId}":{"get":{"operationId":"memory.get","tags":["memory"],"summary":"Get a memory","description":"Returns one memory with its evidence and what the caller may do with it.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read","parameters":[{"name":"memoryId","in":"path","required":true,"description":"The memory's id.","schema":{"$ref":"#/components/schemas/MemoryId"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemoryDetail"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"patch":{"operationId":"memory.update","tags":["memory"],"summary":"Edit a memory","description":"Changes a memory’s words, type, end date, pin or doc. New words, type or end date add a version (List a memory’s versions). A suggestion stays a suggestion. A rejected or forgotten memory answers `409 state_conflict`; a `validUntil` for a memory that stays a rule answers `400 validation_failed`. Needs the right to decide its scope.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read_write","parameters":[{"name":"memoryId","in":"path","required":true,"description":"The memory's id.","schema":{"$ref":"#/components/schemas/MemoryId"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateMemoryBody"}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemoryDetail"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"revision_conflict, state_conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/memories/{memoryId}/turns":{"get":{"operationId":"memory.turns","tags":["memory"],"summary":"List a memory's recent turns","description":"Lists the agent turns of the last 30 days that read a memory, newest first, at most 10: each with its agent, where it ran, and whether the agent named the memory as shaping its answer. Only turns in threads the caller may view; others are left out, uncounted. One request reads the newest 200 turns in threads the caller may view and checks at most 40 threads; `more` is true when it stopped there too.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read","parameters":[{"name":"memoryId","in":"path","required":true,"description":"The memory's id.","schema":{"$ref":"#/components/schemas/MemoryId"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemoryTurnReads"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/memories/{memoryId}/decide":{"post":{"operationId":"memory.decide","tags":["memory"],"summary":"Decide on a memory","description":"Confirms or rejects a suggestion, keeps, archives, restores or forgets a memory, or makes a confirmed memory replace another. A decision its status does not allow answers `409 state_conflict`. Needs the right to decide its scope. A supersede also needs the replaced memory confirmed, decided by the caller and at `supersedesRevision`, and answers its refusals with that memory’s details. Restoring a memory another replaced also needs the caller to see and decide the memory that replaced it, whose link it undoes: otherwise `403 forbidden` (action `decide_memory`), nothing written. Confirming and restoring answer the confirmed memories it may repeat, to offer replacing them. Rejecting as already covered may name the memory that covers it (`coveredById`), which takes the suggestion’s evidence. Fleepr reads every rejection before it suggests anything again: never something like a suggestion not true, only something narrower than one too broad, and, for one already covered, more evidence for the memory that covers it. A suggested new version (`revises`), confirmed, becomes the newest version of the memory it revises, which must stay confirmed.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read_write","parameters":[{"name":"memoryId","in":"path","required":true,"description":"The memory's id.","schema":{"$ref":"#/components/schemas/MemoryId"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"A key you choose for this request, such as a UUID. Once the request has succeeded, sending it again with the same key gets the first answer back, with nothing done twice.","schema":{"$ref":"#/components/schemas/IdempotencyKey"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DecideMemoryBody"}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemoryResult"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"idempotency_in_progress, revision_conflict, state_conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"422":{"description":"idempotency_key_reused","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/memories/{memoryId}/versions":{"get":{"operationId":"memory.history","tags":["memory"],"summary":"List a memory’s versions","description":"Lists the versions of a memory’s words the caller may read, newest first. A suggestion’s wording is read only by its deciders and whom it came from: a reader who sees the memory only since Confirm reads the version current at confirmation and those written after it.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read","parameters":[{"name":"memoryId","in":"path","required":true,"description":"The memory's id.","schema":{"$ref":"#/components/schemas/MemoryId"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemoryHistory"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/memories/{memoryId}/versions/{number}/restore":{"post":{"operationId":"memory.restoreVersion","tags":["memory"],"summary":"Restore a memory’s version","description":"Brings back the words of an earlier version, as a new version (the history keeps every one). A rejected or forgotten memory answers `409 state_conflict`. Needs the right to decide its scope.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read_write","parameters":[{"name":"memoryId","in":"path","required":true,"description":"The memory's id.","schema":{"$ref":"#/components/schemas/MemoryId"}},{"name":"number","in":"path","required":true,"description":"The number of the version to bring back.","schema":{"type":"string","pattern":"^[1-9][0-9]{0,5}$"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"A key you choose for this request, such as a UUID. Once the request has succeeded, sending it again with the same key gets the first answer back, with nothing done twice.","schema":{"$ref":"#/components/schemas/IdempotencyKey"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestoreMemoryVersionBody"}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemoryDetail"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"idempotency_in_progress, revision_conflict, state_conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"422":{"description":"idempotency_key_reused","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/memories/{memoryId}/subject":{"post":{"operationId":"memory.changeSubject","tags":["memory"],"summary":"Change a suggestion’s subject","description":"Moves a suggestion to another subject: the organization, a record, a table or an agent. Only a suggestion moves (any other status answers `409 state_conflict`), and only by a person who decides it now and also decides it under the new subject (`403 forbidden`, action `change_memory_subject`, reason `not_decider`); a new subject the caller may not view answers `404 not_found`. Its words, evidence, versions and who it is for stay; the same subject changes nothing. When someone who would read it there may not open where its evidence was said (or, for an agent’s suggestion, what its turn read), it does not move: `403 forbidden`, reason `audience_wider`. Past 20 open suggestions of the new subject it answers `409 state_conflict` (`currentStatus` `full`); when one with the same words waits there, `409 state_conflict` (`currentStatus` `duplicate`, with its `memoryId`).","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read_write","parameters":[{"name":"memoryId","in":"path","required":true,"description":"The memory's id.","schema":{"$ref":"#/components/schemas/MemoryId"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"A key you choose for this request, such as a UUID. Once the request has succeeded, sending it again with the same key gets the first answer back, with nothing done twice.","schema":{"$ref":"#/components/schemas/IdempotencyKey"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChangeMemorySubjectBody"}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemoryDetail"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"idempotency_in_progress, revision_conflict, state_conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"415":{"description":"unsupported_media_type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"422":{"description":"idempotency_key_reused","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/health":{"get":{"operationId":"system.health","tags":["system"],"summary":"Check health","description":"Answers whether the process is up, which process replied (`service`) and which build it runs. The API adds `checks`, the state of the services it depends on (`database`, `storage`, `realtime`); `status` stays `ok` while the process serves, whatever the checks say. Public: no sign-in needed. Its path is `/health`, outside the `/v0` prefix.","security":[],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"ok","description":"Always `ok` while the service answers, whatever its checks say: a failing check never fails it."},"service":{"type":"string","enum":["api","worker"],"description":"Which service answered."},"version":{"type":"string","description":"The build it runs, such as a commit or a release tag."},"checks":{"description":"What the service depends on, as it last found them, at most a few seconds ago.","type":"object","properties":{"database":{"type":"string","enum":["ok","failed","not_configured"],"description":"The database. `ok`: reachable; `failed`: failing or too slow to answer; `not_configured`: not set up."},"storage":{"type":"string","enum":["ok","failed","not_configured"],"description":"File storage. `ok`: reachable; `failed`: failing or too slow to answer; `not_configured`: not set up."},"realtime":{"type":"string","enum":["ok","failed","not_configured"],"description":"Live updates. `ok`: reachable; `failed`: failing or too slow to answer; `not_configured`: not set up."}},"required":["database","storage","realtime"]}},"required":["status","service","version"]}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/orgs/{orgId}/stream":{"get":{"operationId":"streams.org","tags":["streams"],"summary":"Open the organization stream","description":"Streams every change in the organization that the caller may see: chats, tables, files, agents, flows and their runs, members and invites, request cards, access requests and the caller's own notifications. Message content travels on the chat and file streams instead. The app keeps it open while it runs; on a fresh load, open it first, then fetch the lists. Opens with a session or an API key of the organization: a `read` key is enough, and it receives what its member sees, capped by the key.\n\nThe answer is a stream of server-sent events (`text/event-stream`). Each event that changes data has an id: a client that reconnects with `Last-Event-ID` (or `lastEventId` in the query) gets every event it missed within 7 days and 1000 events; further back, it gets `stream.reset` and reads its data again. Other events are live progress, such as an agent reply as it is written, and control messages.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read","parameters":[{"name":"orgId","in":"path","required":true,"description":"The organization's id.","schema":{"$ref":"#/components/schemas/OrganizationId"}},{"name":"Last-Event-ID","in":"header","required":false,"description":"The id of the last event you received, to get every event since then.","schema":{"$ref":"#/components/schemas/EventId"}},{"name":"lastEventId","in":"query","required":false,"description":"The resume point on a first connect that cannot send the Last-Event-ID header.","schema":{"$ref":"#/components/schemas/EventId"}}],"responses":{"200":{"description":"A text/event-stream; each frame carries one event envelope as JSON.","content":{"text/event-stream":{"schema":{"$ref":"#/components/schemas/OrgStreamEvent"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/chats/{chatId}/stream":{"get":{"operationId":"streams.chat","tags":["streams"],"summary":"Open a chat stream","description":"Streams one chat: new messages, agent turns as they queue, run, wait and end, request cards and the chat's own changes, plus each agent's reply as it is written (text, tool activity, blocks). Open it while the chat is on screen, from the `streamCursor` of `GET /v0/chats/{chatId}/messages`, so nothing falls between the page and the stream. Opens with a session or an API key whose member may view the chat: a `read` key is enough.\n\nThe answer is a stream of server-sent events (`text/event-stream`). Each event that changes data has an id: a client that reconnects with `Last-Event-ID` (or `lastEventId` in the query) gets every event it missed within 7 days and 1000 events; further back, it gets `stream.reset` and reads its data again. Other events are live progress, such as an agent reply as it is written, and control messages.","security":[{"session":[]},{"apiKey":[]}],"x-api-key-scope":"read","parameters":[{"name":"chatId","in":"path","required":true,"description":"The chat's id.","schema":{"$ref":"#/components/schemas/ChatId"}},{"name":"Last-Event-ID","in":"header","required":false,"description":"The id of the last event you received, to get every event since then.","schema":{"$ref":"#/components/schemas/EventId"}},{"name":"lastEventId","in":"query","required":false,"description":"The resume point on a first connect that cannot send the Last-Event-ID header.","schema":{"$ref":"#/components/schemas/EventId"}}],"responses":{"200":{"description":"A text/event-stream; each frame carries one event envelope as JSON.","content":{"text/event-stream":{"schema":{"$ref":"#/components/schemas/ChatStreamEvent"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/files/{fileId}/stream":{"get":{"operationId":"streams.file","tags":["streams"],"summary":"Open a file stream","description":"Streams one file's review: its comments, annotations, approval, new versions and other changes, agent turns in its comments and each agent's reply as it is written. Open it while the file is on screen. Opens with a session only: API keys cannot open it.\n\nThe answer is a stream of server-sent events (`text/event-stream`). Each event that changes data has an id: a client that reconnects with `Last-Event-ID` (or `lastEventId` in the query) gets every event it missed within 7 days and 1000 events; further back, it gets `stream.reset` and reads its data again. Other events are live progress, such as an agent reply as it is written, and control messages.","security":[{"session":[]}],"parameters":[{"name":"fileId","in":"path","required":true,"description":"The file's id.","schema":{"$ref":"#/components/schemas/FileId"}},{"name":"Last-Event-ID","in":"header","required":false,"description":"The id of the last event you received, to get every event since then.","schema":{"$ref":"#/components/schemas/EventId"}},{"name":"lastEventId","in":"query","required":false,"description":"The resume point on a first connect that cannot send the Last-Event-ID header.","schema":{"$ref":"#/components/schemas/EventId"}}],"responses":{"200":{"description":"A text/event-stream; each frame carries one event envelope as JSON.","content":{"text/event-stream":{"schema":{"$ref":"#/components/schemas/FileStreamEvent"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/v0/public/review/stream":{"get":{"operationId":"streams.review","tags":["streams"],"summary":"Open the review stream","description":"Streams the public review page a guest opens from an approval link: changes to the link's files, the comments and annotations made through approval links (never the team's internal comments) and approval decisions. It takes the review session from `POST /v0/public/review/session`, not a Fleepr session or an API key. Reopen it after `POST /v0/public/review/session/verify`, or after `PATCH /v0/public/review/session` on a link that needs no code: both change what the session may see. A revoked, expired or unknown link answers `410 link_invalid`, and closes an open stream. Its event ids, `stream.ready` head and a reset head are cursors of the session's own: resume with the last one received. They name no order between themselves; another session's cursor starts over with `cursor_unknown`, and a replay never reaches back before the link was made (`cursor_expired`).\n\nThe answer is a stream of server-sent events (`text/event-stream`). Each event that changes data has an id: a client that reconnects with `Last-Event-ID` (or `lastEventId` in the query) gets every event it missed within 7 days and 1000 events; further back, it gets `stream.reset` and reads its data again. Other events are live progress, such as an agent reply as it is written, and control messages.","security":[{"review":[]}],"parameters":[{"name":"Last-Event-ID","in":"header","required":false,"description":"The id of the last event you received, to get every event since then.","schema":{"$ref":"#/components/schemas/EventId"}},{"name":"lastEventId","in":"query","required":false,"description":"The resume point on a first connect that cannot send the Last-Event-ID header.","schema":{"$ref":"#/components/schemas/EventId"}}],"responses":{"200":{"description":"A text/event-stream; each frame carries one event envelope as JSON.","content":{"text/event-stream":{"schema":{"$ref":"#/components/schemas/ReviewStreamEvent"}}}},"400":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"410":{"description":"link_invalid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"500":{"description":"internal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}}},"webhooks":{"file.created":{"post":{"operationId":"webhooks.file.created","summary":"File added","description":"A file was added to the organization: uploaded, or brought in by an agent from a connected service or a web address. `payload.file` is the file's summary.\n\nThe item is shown as the member who added the webhook may see it when it is sent: one they can no longer see is not sent, and links to preview images are null.","security":[],"parameters":[{"name":"Fleepr-Signature","in":"header","required":true,"description":"`t=<unix seconds>,v1=<hex>`: an HMAC-SHA256, keyed with the webhook's secret, of the timestamp, a period and the raw body. Verify it before you parse the body, as Webhooks in the introduction shows.","schema":{"type":"string"}},{"name":"Fleepr-Event-Id","in":"header","required":true,"description":"The event's id, also the body's `id` (for a test, the delivery's own id): the same on every attempt and every Send again, so use it to skip an event you already handled.","schema":{"type":"string"}},{"name":"Fleepr-Delivery-Id","in":"header","required":true,"description":"This delivery's id, as Settings lists it. A Send again is a new delivery, with a new id.","schema":{"type":"string"}},{"name":"Fleepr-Webhook-Id","in":"header","required":true,"description":"The webhook that sent it, also the body's `webhookId`.","schema":{"type":"string"}},{"name":"User-Agent","in":"header","required":true,"description":"`Fleepr-Webhooks/1`, so your logs show who called.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event's id, also sent as `Fleepr-Event-Id`: the same on every attempt and every Send again, so use it to skip an event you already handled. It counts nothing and orders nothing: order events by `occurredAt`.","$ref":"#/components/schemas/WebhookEventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"file.created","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"type":"object","properties":{"file":{"description":"The new file.","$ref":"#/components/schemas/FileSummary"}},"required":["file"],"description":"What the event carries; for a change, the object as it is after it."},"webhookId":{"description":"The webhook that sent it, also sent as `Fleepr-Webhook-Id`.","$ref":"#/components/schemas/WebhookId"}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload","webhookId"]}}}},"responses":{"2XX":{"description":"Received. Answer within 10 seconds, then do the work: Fleepr never reads the body."},"default":{"description":"Any other answer, a redirect, or no answer within 10 seconds fails the attempt. Fleepr tries again 1 minute, 5 minutes, 30 minutes, 2 hours, 6 hours, 12 hours and 24 hours after the first, then gives up. A webhook whose deliveries keep failing for 3 days and at least 10 attempts in a row is turned off, and its owner is told."}}}},"file.version_added":{"post":{"operationId":"webhooks.file.version_added","summary":"New file version","description":"A new version of a file was added: an upload, an edit of a doc an agent made, or a version restored. A doc sent for approval adds none: that is a change of its approval. `payload.file` is the file after the change and `payload.version` the new version.\n\nThe item is shown as the member who added the webhook may see it when it is sent: one they can no longer see is not sent, and links to preview images are null.","security":[],"parameters":[{"name":"Fleepr-Signature","in":"header","required":true,"description":"`t=<unix seconds>,v1=<hex>`: an HMAC-SHA256, keyed with the webhook's secret, of the timestamp, a period and the raw body. Verify it before you parse the body, as Webhooks in the introduction shows.","schema":{"type":"string"}},{"name":"Fleepr-Event-Id","in":"header","required":true,"description":"The event's id, also the body's `id` (for a test, the delivery's own id): the same on every attempt and every Send again, so use it to skip an event you already handled.","schema":{"type":"string"}},{"name":"Fleepr-Delivery-Id","in":"header","required":true,"description":"This delivery's id, as Settings lists it. A Send again is a new delivery, with a new id.","schema":{"type":"string"}},{"name":"Fleepr-Webhook-Id","in":"header","required":true,"description":"The webhook that sent it, also the body's `webhookId`.","schema":{"type":"string"}},{"name":"User-Agent","in":"header","required":true,"description":"`Fleepr-Webhooks/1`, so your logs show who called.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event's id, also sent as `Fleepr-Event-Id`: the same on every attempt and every Send again, so use it to skip an event you already handled. It counts nothing and orders nothing: order events by `occurredAt`.","$ref":"#/components/schemas/WebhookEventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"file.version_added","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"type":"object","properties":{"file":{"description":"The file as it is now, showing the new version.","$ref":"#/components/schemas/FileSummary"},"version":{"description":"The new version.","$ref":"#/components/schemas/FileVersion"}},"required":["file","version"],"description":"What the event carries; for a change, the object as it is after it."},"webhookId":{"description":"The webhook that sent it, also sent as `Fleepr-Webhook-Id`.","$ref":"#/components/schemas/WebhookId"}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload","webhookId"]}}}},"responses":{"2XX":{"description":"Received. Answer within 10 seconds, then do the work: Fleepr never reads the body."},"default":{"description":"Any other answer, a redirect, or no answer within 10 seconds fails the attempt. Fleepr tries again 1 minute, 5 minutes, 30 minutes, 2 hours, 6 hours, 12 hours and 24 hours after the first, then gives up. A webhook whose deliveries keep failing for 3 days and at least 10 attempts in a row is turned off, and its owner is told."}}}},"record.created":{"post":{"operationId":"webhooks.record.created","summary":"Record added","description":"A record was added to a table, one at a time or in a bulk call, which sends one event per record. `payload.record` is the record, and `payload.included` the linked records' labels and the files it shows.\n\nThe item is shown as the member who added the webhook may see it when it is sent: one they can no longer see is not sent, and links to preview images are null.","security":[],"parameters":[{"name":"Fleepr-Signature","in":"header","required":true,"description":"`t=<unix seconds>,v1=<hex>`: an HMAC-SHA256, keyed with the webhook's secret, of the timestamp, a period and the raw body. Verify it before you parse the body, as Webhooks in the introduction shows.","schema":{"type":"string"}},{"name":"Fleepr-Event-Id","in":"header","required":true,"description":"The event's id, also the body's `id` (for a test, the delivery's own id): the same on every attempt and every Send again, so use it to skip an event you already handled.","schema":{"type":"string"}},{"name":"Fleepr-Delivery-Id","in":"header","required":true,"description":"This delivery's id, as Settings lists it. A Send again is a new delivery, with a new id.","schema":{"type":"string"}},{"name":"Fleepr-Webhook-Id","in":"header","required":true,"description":"The webhook that sent it, also the body's `webhookId`.","schema":{"type":"string"}},{"name":"User-Agent","in":"header","required":true,"description":"`Fleepr-Webhooks/1`, so your logs show who called.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event's id, also sent as `Fleepr-Event-Id`: the same on every attempt and every Send again, so use it to skip an event you already handled. It counts nothing and orders nothing: order events by `occurredAt`.","$ref":"#/components/schemas/WebhookEventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"record.created","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"description":"What the event carries; for a change, the object as it is after it.","$ref":"#/components/schemas/RecordResult"},"webhookId":{"description":"The webhook that sent it, also sent as `Fleepr-Webhook-Id`.","$ref":"#/components/schemas/WebhookId"}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload","webhookId"]}}}},"responses":{"2XX":{"description":"Received. Answer within 10 seconds, then do the work: Fleepr never reads the body."},"default":{"description":"Any other answer, a redirect, or no answer within 10 seconds fails the attempt. Fleepr tries again 1 minute, 5 minutes, 30 minutes, 2 hours, 6 hours, 12 hours and 24 hours after the first, then gives up. A webhook whose deliveries keep failing for 3 days and at least 10 attempts in a row is turned off, and its owner is told."}}}},"record.updated":{"post":{"operationId":"webhooks.record.updated","summary":"Record changed","description":"A record changed: one at a time or in a bulk call, which sends one event per record. `payload.record` is the record after the change, and `payload.included` the linked records' labels and the files it shows.\n\nThe item is shown as the member who added the webhook may see it when it is sent: one they can no longer see is not sent, and links to preview images are null.","security":[],"parameters":[{"name":"Fleepr-Signature","in":"header","required":true,"description":"`t=<unix seconds>,v1=<hex>`: an HMAC-SHA256, keyed with the webhook's secret, of the timestamp, a period and the raw body. Verify it before you parse the body, as Webhooks in the introduction shows.","schema":{"type":"string"}},{"name":"Fleepr-Event-Id","in":"header","required":true,"description":"The event's id, also the body's `id` (for a test, the delivery's own id): the same on every attempt and every Send again, so use it to skip an event you already handled.","schema":{"type":"string"}},{"name":"Fleepr-Delivery-Id","in":"header","required":true,"description":"This delivery's id, as Settings lists it. A Send again is a new delivery, with a new id.","schema":{"type":"string"}},{"name":"Fleepr-Webhook-Id","in":"header","required":true,"description":"The webhook that sent it, also the body's `webhookId`.","schema":{"type":"string"}},{"name":"User-Agent","in":"header","required":true,"description":"`Fleepr-Webhooks/1`, so your logs show who called.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event's id, also sent as `Fleepr-Event-Id`: the same on every attempt and every Send again, so use it to skip an event you already handled. It counts nothing and orders nothing: order events by `occurredAt`.","$ref":"#/components/schemas/WebhookEventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"record.updated","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"description":"What the event carries; for a change, the object as it is after it.","$ref":"#/components/schemas/RecordResult"},"webhookId":{"description":"The webhook that sent it, also sent as `Fleepr-Webhook-Id`.","$ref":"#/components/schemas/WebhookId"}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload","webhookId"]}}}},"responses":{"2XX":{"description":"Received. Answer within 10 seconds, then do the work: Fleepr never reads the body."},"default":{"description":"Any other answer, a redirect, or no answer within 10 seconds fails the attempt. Fleepr tries again 1 minute, 5 minutes, 30 minutes, 2 hours, 6 hours, 12 hours and 24 hours after the first, then gives up. A webhook whose deliveries keep failing for 3 days and at least 10 attempts in a row is turned off, and its owner is told."}}}},"approval.decided":{"post":{"operationId":"webhooks.approval.decided","summary":"Approval decided","description":"Someone approved or asked for changes, on a file or on a flow step's sign-off: a member in Fleepr, or a guest through an approval link. `payload.approval` is the approval after the decision, with every approver.\n\nThe item is shown as the member who added the webhook may see it when it is sent: one they can no longer see is not sent, and links to preview images are null.","security":[],"parameters":[{"name":"Fleepr-Signature","in":"header","required":true,"description":"`t=<unix seconds>,v1=<hex>`: an HMAC-SHA256, keyed with the webhook's secret, of the timestamp, a period and the raw body. Verify it before you parse the body, as Webhooks in the introduction shows.","schema":{"type":"string"}},{"name":"Fleepr-Event-Id","in":"header","required":true,"description":"The event's id, also the body's `id` (for a test, the delivery's own id): the same on every attempt and every Send again, so use it to skip an event you already handled.","schema":{"type":"string"}},{"name":"Fleepr-Delivery-Id","in":"header","required":true,"description":"This delivery's id, as Settings lists it. A Send again is a new delivery, with a new id.","schema":{"type":"string"}},{"name":"Fleepr-Webhook-Id","in":"header","required":true,"description":"The webhook that sent it, also the body's `webhookId`.","schema":{"type":"string"}},{"name":"User-Agent","in":"header","required":true,"description":"`Fleepr-Webhooks/1`, so your logs show who called.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event's id, also sent as `Fleepr-Event-Id`: the same on every attempt and every Send again, so use it to skip an event you already handled. It counts nothing and orders nothing: order events by `occurredAt`.","$ref":"#/components/schemas/WebhookEventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"approval.decided","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"type":"object","properties":{"approval":{"description":"The whole approval as it is after the change.","$ref":"#/components/schemas/Approval"}},"required":["approval"],"description":"What the event carries; for a change, the object as it is after it."},"webhookId":{"description":"The webhook that sent it, also sent as `Fleepr-Webhook-Id`.","$ref":"#/components/schemas/WebhookId"}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload","webhookId"]}}}},"responses":{"2XX":{"description":"Received. Answer within 10 seconds, then do the work: Fleepr never reads the body."},"default":{"description":"Any other answer, a redirect, or no answer within 10 seconds fails the attempt. Fleepr tries again 1 minute, 5 minutes, 30 minutes, 2 hours, 6 hours, 12 hours and 24 hours after the first, then gives up. A webhook whose deliveries keep failing for 3 days and at least 10 attempts in a row is turned off, and its owner is told."}}}},"approval.completed":{"post":{"operationId":"webhooks.approval.completed","summary":"Approval completed","description":"Every approver of the current round approved: the file, or the step of the flow, is approved. It follows the `approval.decided` of the last decision, or the removal of an approver that leaves every other one approved. `payload.approval` is the approval.\n\nThe item is shown as the member who added the webhook may see it when it is sent: one they can no longer see is not sent, and links to preview images are null.","security":[],"parameters":[{"name":"Fleepr-Signature","in":"header","required":true,"description":"`t=<unix seconds>,v1=<hex>`: an HMAC-SHA256, keyed with the webhook's secret, of the timestamp, a period and the raw body. Verify it before you parse the body, as Webhooks in the introduction shows.","schema":{"type":"string"}},{"name":"Fleepr-Event-Id","in":"header","required":true,"description":"The event's id, also the body's `id` (for a test, the delivery's own id): the same on every attempt and every Send again, so use it to skip an event you already handled.","schema":{"type":"string"}},{"name":"Fleepr-Delivery-Id","in":"header","required":true,"description":"This delivery's id, as Settings lists it. A Send again is a new delivery, with a new id.","schema":{"type":"string"}},{"name":"Fleepr-Webhook-Id","in":"header","required":true,"description":"The webhook that sent it, also the body's `webhookId`.","schema":{"type":"string"}},{"name":"User-Agent","in":"header","required":true,"description":"`Fleepr-Webhooks/1`, so your logs show who called.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event's id, also sent as `Fleepr-Event-Id`: the same on every attempt and every Send again, so use it to skip an event you already handled. It counts nothing and orders nothing: order events by `occurredAt`.","$ref":"#/components/schemas/WebhookEventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"approval.completed","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"type":"object","properties":{"approval":{"description":"The whole approval as it is after the change.","$ref":"#/components/schemas/Approval"}},"required":["approval"],"description":"What the event carries; for a change, the object as it is after it."},"webhookId":{"description":"The webhook that sent it, also sent as `Fleepr-Webhook-Id`.","$ref":"#/components/schemas/WebhookId"}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload","webhookId"]}}}},"responses":{"2XX":{"description":"Received. Answer within 10 seconds, then do the work: Fleepr never reads the body."},"default":{"description":"Any other answer, a redirect, or no answer within 10 seconds fails the attempt. Fleepr tries again 1 minute, 5 minutes, 30 minutes, 2 hours, 6 hours, 12 hours and 24 hours after the first, then gives up. A webhook whose deliveries keep failing for 3 days and at least 10 attempts in a row is turned off, and its owner is told."}}}},"webhook.test":{"post":{"operationId":"webhooks.webhook.test","summary":"Test delivery","description":"Sent when someone presses Send test in Settings, Webhooks, to check that your address answers and verifies the signature. It carries no event: only the webhook's id and name. A test is sent once, never retried.","security":[],"parameters":[{"name":"Fleepr-Signature","in":"header","required":true,"description":"`t=<unix seconds>,v1=<hex>`: an HMAC-SHA256, keyed with the webhook's secret, of the timestamp, a period and the raw body. Verify it before you parse the body, as Webhooks in the introduction shows.","schema":{"type":"string"}},{"name":"Fleepr-Event-Id","in":"header","required":true,"description":"The event's id, also the body's `id` (for a test, the delivery's own id): the same on every attempt and every Send again, so use it to skip an event you already handled.","schema":{"type":"string"}},{"name":"Fleepr-Delivery-Id","in":"header","required":true,"description":"This delivery's id, as Settings lists it. A Send again is a new delivery, with a new id.","schema":{"type":"string"}},{"name":"Fleepr-Webhook-Id","in":"header","required":true,"description":"The webhook that sent it, also the body's `webhookId`.","schema":{"type":"string"}},{"name":"User-Agent","in":"header","required":true,"description":"`Fleepr-Webhooks/1`, so your logs show who called.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookTestBody"}}}},"responses":{"2XX":{"description":"Received: Settings shows the test as delivered."},"default":{"description":"Any other answer, a redirect, or no answer within 10 seconds: Settings shows the test as failed."}}}}},"components":{"schemas":{"AboutChangedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"about.changed","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"description":"What the event carries; for a change, the object as it is after it.","$ref":"#/components/schemas/AboutChangedPayload"}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"AboutChangedPayload":{"type":"object","properties":{"object":{"description":"The object whose records changed: read its About again.","$ref":"#/components/schemas/AboutObjectRef"}},"required":["object"]},"AboutObjectId":{"anyOf":[{"$ref":"#/components/schemas/ChatId"},{"$ref":"#/components/schemas/FileId"},{"$ref":"#/components/schemas/FlowId"}]},"AboutObjectRef":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"chat","description":"What kind of object it is."},"id":{"description":"The object's id.","$ref":"#/components/schemas/ChatId"}},"required":["type","id"]},{"type":"object","properties":{"type":{"type":"string","const":"file","description":"What kind of object it is."},"id":{"description":"The object's id.","$ref":"#/components/schemas/FileId"}},"required":["type","id"]},{"type":"object","properties":{"type":{"type":"string","const":"flow","description":"What kind of object it is."},"id":{"description":"The object's id.","$ref":"#/components/schemas/FlowId"}},"required":["type","id"]}]},"AboutRecord":{"type":"object","properties":{"recordId":{"description":"The record the object is about.","$ref":"#/components/schemas/RecordId"},"tableId":{"description":"The table that holds it.","$ref":"#/components/schemas/TableId"},"label":{"type":"string","description":"The text of its table's primary column, as its link pill shows it; empty when it has none."},"tableName":{"type":"string","minLength":1,"maxLength":120,"description":"The name of the table that holds it, such as \"Clients\", up to 120 characters as every table name."},"linkedBy":{"description":"Who linked it: the person who chose it, or who answered Fleepr's suggestion to link it; on a copy, who linked it on the source.","$ref":"#/components/schemas/ActorId"},"linkedAt":{"description":"When the link was made; on a copy, when it was copied.","$ref":"#/components/schemas/IsoDateTime"},"inheritedFrom":{"anyOf":[{"$ref":"#/components/schemas/AboutObjectRef"},{"type":"null"}],"description":"Where the link came from when the object took it on creation: the chat a file was created in, or the flow a run's chat belongs to; null for a link made on the object itself, and when the caller cannot view where it came from (or it is a run's own chat)."}},"required":["recordId","tableId","label","tableName","linkedBy","linkedAt","inheritedFrom"]},"AboutViewer":{"type":"object","properties":{"canChange":{"type":"boolean","description":"Whether the caller may link and unlink records here: they may edit the object."}},"required":["canChange"]},"AcceptInviteBody":{"type":"object","properties":{"token":{"type":"string","minLength":1,"maxLength":512,"description":"The token from the invite email's link."}},"required":["token"],"additionalProperties":false},"AcceptInviteResult":{"type":"object","properties":{"organizationId":{"description":"The organization the user joined.","$ref":"#/components/schemas/OrganizationId"},"member":{"description":"The user's member in that organization, now `active`.","$ref":"#/components/schemas/Member"}},"required":["organizationId","member"]},"AccessChangedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"access.changed","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"description":"What the event carries; for a change, the object as it is after it.","$ref":"#/components/schemas/AccessChangedPayload"}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"AccessChangedPayload":{"type":"object","properties":{"object":{"description":"The object whose access changed.","$ref":"#/components/schemas/AccessObjectRef"},"visibility":{"description":"The object's visibility after the change.","$ref":"#/components/schemas/Visibility"},"accessSummary":{"description":"How many people, agents and invited people can access the object after the change.","$ref":"#/components/schemas/AccessSummary"},"restoredGrant":{"description":"Set only when the change is a removed member's kept grant giving them access again, as they are restored or invited again through Team; absent for every other change.","$ref":"#/components/schemas/RestoredGrant"},"grantedMember":{"description":"Set only when the change is a direct grant that gives an active member access, or more access, through Share; absent for every other change.","$ref":"#/components/schemas/GrantedMember"}},"required":["object","visibility","accessSummary"]},"AccessLevel":{"type":"string","enum":["view","edit","manage"]},"AccessObjectId":{"anyOf":[{"$ref":"#/components/schemas/ChatId"},{"$ref":"#/components/schemas/DatabaseId"},{"$ref":"#/components/schemas/TableId"},{"$ref":"#/components/schemas/FileId"},{"$ref":"#/components/schemas/FlowId"},{"$ref":"#/components/schemas/AgentId"},{"$ref":"#/components/schemas/SkillId"},{"$ref":"#/components/schemas/ConnectionId"}]},"AccessObjectRef":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"chat","description":"What kind of object it is."},"id":{"description":"The object's id.","$ref":"#/components/schemas/ChatId"}},"required":["type","id"]},{"type":"object","properties":{"type":{"type":"string","const":"database","description":"What kind of object it is."},"id":{"description":"The object's id.","$ref":"#/components/schemas/DatabaseId"}},"required":["type","id"]},{"type":"object","properties":{"type":{"type":"string","const":"table","description":"What kind of object it is."},"id":{"description":"The object's id.","$ref":"#/components/schemas/TableId"}},"required":["type","id"]},{"type":"object","properties":{"type":{"type":"string","const":"file","description":"What kind of object it is."},"id":{"description":"The object's id.","$ref":"#/components/schemas/FileId"}},"required":["type","id"]},{"type":"object","properties":{"type":{"type":"string","const":"flow","description":"What kind of object it is."},"id":{"description":"The object's id.","$ref":"#/components/schemas/FlowId"}},"required":["type","id"]},{"type":"object","properties":{"type":{"type":"string","const":"agent","description":"What kind of object it is."},"id":{"description":"The object's id.","$ref":"#/components/schemas/AgentId"}},"required":["type","id"]},{"type":"object","properties":{"type":{"type":"string","const":"skill","description":"What kind of object it is."},"id":{"description":"The object's id.","$ref":"#/components/schemas/SkillId"}},"required":["type","id"]},{"type":"object","properties":{"type":{"type":"string","const":"connection","description":"What kind of object it is."},"id":{"description":"The object's id.","$ref":"#/components/schemas/ConnectionId"}},"required":["type","id"]}]},"AccessOwnerChangedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"access.owner_changed","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"description":"What the event carries; for a change, the object as it is after it.","$ref":"#/components/schemas/AccessOwnerChangedPayload"}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"AccessOwnerChangedPayload":{"type":"object","properties":{"entry":{"description":"The object handed over, with its new owner.","$ref":"#/components/schemas/ObjectEntry"},"previousOwnerId":{"description":"The member who owned the object before.","$ref":"#/components/schemas/MemberId"},"previousOwnerGrantRemoved":{"description":"Whether the hand-over removed the previous owner's edit grant, as its request asked, so they keep only what the organization or their role gives. Absent on events stored before this field existed, where it says nothing either way.","type":"boolean"}},"required":["entry","previousOwnerId"]},"AccessRequest":{"type":"object","properties":{"id":{"description":"The access request's id.","$ref":"#/components/schemas/AccessRequestId"},"organizationId":{"description":"The organization the object belongs to.","$ref":"#/components/schemas/OrganizationId"},"object":{"description":"The object the requester wants to edit.","$ref":"#/components/schemas/AccessObjectRef"},"requesterId":{"description":"The member who asked.","$ref":"#/components/schemas/MemberId"},"level":{"description":"The level asked for, and what approving grants: `edit`.","$ref":"#/components/schemas/RequestableAccessLevel"},"message":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"description":"The requester's note to the owner; null when they wrote none."},"status":{"description":"`pending` until decided; `approved` or `declined` by the owner or an admin; `closed` when it no longer applies, because the requester became the owner or was removed from the organization.","$ref":"#/components/schemas/AccessRequestStatus"},"decidedBy":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"The member who approved or declined the request; null while pending and when closed."},"decidedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}],"description":"When the request was approved, declined or closed; null while pending."},"createdAt":{"description":"When the member asked.","$ref":"#/components/schemas/IsoDateTime"},"revision":{"description":"Grows by one with every change to the request.","$ref":"#/components/schemas/Revision"},"viewer":{"description":"What the caller may do with the request.","$ref":"#/components/schemas/AccessRequestViewer"}},"required":["id","organizationId","object","requesterId","level","message","status","decidedBy","decidedAt","createdAt","revision","viewer"]},"AccessRequestCreatedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"access_request.created","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"description":"What the event carries; for a change, the object as it is after it.","$ref":"#/components/schemas/AccessRequestEventPayload"}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"AccessRequestDecidedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"access_request.decided","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"description":"What the event carries; for a change, the object as it is after it.","$ref":"#/components/schemas/AccessRequestEventPayload"}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"AccessRequestEventPayload":{"type":"object","properties":{"accessRequest":{"description":"The access request after the change.","$ref":"#/components/schemas/AccessRequest"}},"required":["accessRequest"]},"AccessRequestId":{"type":"string","pattern":"^areq_[0-9a-hjkmnp-tv-z]{26}$"},"AccessRequestPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/AccessRequest"},"description":"This page of the list."},"nextCursor":{"anyOf":[{"$ref":"#/components/schemas/Cursor"},{"type":"null"}],"description":"Send it back as `cursor` to read the next page; null on the last page."}},"required":["items","nextCursor"]},"AccessRequestStatus":{"type":"string","enum":["pending","approved","declined","closed"]},"AccessRequestViewer":{"type":"object","properties":{"canDecide":{"type":"boolean","description":"Whether the caller may approve or decline the request now: never its requester, and never through an API key."}},"required":["canDecide"]},"AccessRevokedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"access.revoked","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"description":"What the event carries; for a change, the object as it is after it.","$ref":"#/components/schemas/AccessRevokedPayload"}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"AccessRevokedPayload":{"type":"object","properties":{"object":{"description":"The object the member can no longer view.","$ref":"#/components/schemas/AccessObjectRef"},"memberId":{"description":"The member who lost access, and the only one who receives this event.","$ref":"#/components/schemas/MemberId"}},"required":["object","memberId"]},"AccessSource":{"type":"string","enum":["direct","parent","organization","role"]},"AccessSummary":{"type":"object","properties":{"people":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many members of the organization can view the object now."},"agents":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many agents have a grant on the object."},"invited":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many invited people have a grant on the object; they count as people once they join."},"sampleActorIds":{"maxItems":5,"type":"array","items":{"$ref":"#/components/schemas/ActorId"},"description":"Up to 5 of the people and agents with access, the owner first, to show as faces."}},"required":["people","agents","invited","sampleActorIds"]},"ActionPreview":{"oneOf":[{"$ref":"#/components/schemas/TableCreatePreview"},{"$ref":"#/components/schemas/ColumnAddPreview"},{"$ref":"#/components/schemas/RecordsCreatePreview"},{"$ref":"#/components/schemas/RecordsUpdatePreview"},{"$ref":"#/components/schemas/RecordsDeletePreview"},{"$ref":"#/components/schemas/ObjectDeletePreview"},{"$ref":"#/components/schemas/FileUploadPreview"},{"$ref":"#/components/schemas/DocCreatePreview"},{"$ref":"#/components/schemas/ApprovalRequestPreview"},{"$ref":"#/components/schemas/CommentPostPreview"},{"$ref":"#/components/schemas/MessagePostPreview"},{"$ref":"#/components/schemas/FlowRunPreview"},{"$ref":"#/components/schemas/FilesUploadPreview"},{"$ref":"#/components/schemas/FormLinkCreatePreview"},{"$ref":"#/components/schemas/ApprovalLinkSendPreview"},{"$ref":"#/components/schemas/FileVersionUploadPreview"},{"$ref":"#/components/schemas/FormLinkRevokePreview"},{"$ref":"#/components/schemas/ApprovalLinkRevokePreview"},{"$ref":"#/components/schemas/GenericPreview"},{"$ref":"#/components/schemas/FormLinksCreatePreview"},{"$ref":"#/components/schemas/ApprovalLinksSendPreview"},{"$ref":"#/components/schemas/ApprovalRequestsPreview"},{"$ref":"#/components/schemas/EmailSendPreview"},{"$ref":"#/components/schemas/AgentCreatePreview"},{"$ref":"#/components/schemas/AgentUpdatePreview"},{"$ref":"#/components/schemas/SkillCreatePreview"},{"$ref":"#/components/schemas/SkillUpdatePreview"},{"$ref":"#/components/schemas/ColumnUpdatePreview"},{"$ref":"#/components/schemas/FlowCreatePreview"},{"$ref":"#/components/schemas/FlowUpdatePreview"},{"$ref":"#/components/schemas/FormCreatePreview"},{"$ref":"#/components/schemas/FormUpdatePreview"}]},"ActionRequest":{"type":"object","properties":{"id":{"description":"The request's id.","$ref":"#/components/schemas/ActionRequestId"},"number":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"The request's number in its organization, shown as \"Action #A-2293\"."},"organizationId":{"description":"The organization the request belongs to.","$ref":"#/components/schemas/OrganizationId"},"thread":{"anyOf":[{"$ref":"#/components/schemas/ThreadRef"},{"type":"null"}],"description":"The chat or file comments the card was raised in, or null; link a card that has a `flowRunId` to its run."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the card was raised in, or null."},"messageId":{"anyOf":[{"$ref":"#/components/schemas/MessageId"},{"type":"null"}],"description":"The agent message that carries the card, or null."},"turnId":{"description":"The agent's turn that waits on the card.","$ref":"#/components/schemas/TurnId"},"chainId":{"description":"The agent chain the turn belongs to.","$ref":"#/components/schemas/ChainId"},"agentId":{"description":"The agent that asks.","$ref":"#/components/schemas/AgentId"},"onBehalfOf":{"description":"The member the agent acts for: who wrote the message, or for a flow run the flow's owner.","$ref":"#/components/schemas/MemberId"},"tool":{"description":"The tool call the card is about.","$ref":"#/components/schemas/ActionRequestTool"},"argumentsHash":{"description":"A SHA-256 hash of the exact tool call; send it back to decide, so a call that changed is refused.","$ref":"#/components/schemas/Sha256Hex"},"title":{"type":"string","minLength":1,"maxLength":200,"description":"The card's title, such as Create table \"Q3 launches\"; neutral for a reader who cannot view its subject."},"question":{"anyOf":[{"type":"string","minLength":1,"maxLength":300},{"type":"null"}],"description":"The card's question; null when it has none, or for a reader who cannot view the card's chat or its subject."},"approveLabel":{"type":"string","minLength":1,"maxLength":40,"description":"The approve button's label, such as \"Allow\"; `edit_access`, `create` and `delete` cards always show Allow."},"declineLabel":{"type":"string","minLength":1,"maxLength":40,"description":"The decline button's label, such as \"Deny\"; `edit_access`, `create` and `delete` cards always show Deny."},"reason":{"anyOf":[{"type":"string","minLength":1,"maxLength":1000},{"type":"null"}],"description":"The agent's explanation; null when it gave none, or for a reader who cannot view the card's chat or its subject."},"preview":{"description":"What the call would do, in words people read; the raw arguments never leave the server.","$ref":"#/components/schemas/ActionPreview"},"targets":{"maxItems":32,"type":"array","items":{"$ref":"#/components/schemas/ObjectRef"},"description":"Every object the call touches, each checked again when it runs; some readers get only those they may view."},"kind":{"description":"What the card asks: `edit_access` (edit on one object for agents that lack it), `create`, `delete`, `bulk_change` (more than 10 rows) or `confirm` (an action outside edit access, such as a connector tool).","$ref":"#/components/schemas/RequestKind"},"subject":{"anyOf":[{"$ref":"#/components/schemas/AccessObjectRef"},{"type":"null"}],"description":"The one existing object the card is about; null exactly on a `create` card."},"fields":{"maxItems":50,"type":"array","items":{"$ref":"#/components/schemas/RequestField"},"description":"What the call changes, such as columns or an object's name; empty for a reader who cannot view the subject."},"answers":{"minItems":2,"maxItems":3,"type":"array","items":{"$ref":"#/components/schemas/RequestAnswer"},"description":"The buttons the card offers, in order: `deny`, then `allow_once` when Allow grants access or is remembered (`remembers`), then `allow`."},"calls":{"default":[],"description":"Every call a batch card covers: one card for up to 10 calls of the same tool in one step, its Allow running them all in order; the first is the card's own call. Empty on a card for one call.","maxItems":10,"type":"array","items":{"$ref":"#/components/schemas/ActionRequestCall"}},"remembers":{"default":false,"description":"`true` when the card's `allow` also lets every agent of this chat run the same tool here again without asking, until a member revokes it; `allow_once` then runs this call only. Never on deletes or on links and emails for people outside the organization.","type":"boolean"},"deciders":{"description":"Who may decide, as rules applied each time the card is read.","$ref":"#/components/schemas/RequestDeciders"},"deciderIds":{"maxItems":50,"type":"array","items":{"$ref":"#/components/schemas/MemberId"},"description":"The members who can decide the card now, up to 50: the member the agent acts for while they decide it, the object's owner, named members, then the organization's owner and admins."},"moreDeciders":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many more deciders there are than `deciderIds` lists."},"grantsEditTo":{"maxItems":5,"type":"array","items":{"$ref":"#/components/schemas/AgentId"},"description":"The agents Allow gives edit access, on the subject or on what the card creates; Allow once gives none."},"refreshedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}],"description":"When the card was rebuilt because what it shows changed before it ran; null otherwise."},"status":{"description":"`pending` waits for a decision; after an approval it is `approved`, `executing`, then `executed` or `failed`; `declined`, `expired`, `cancelled` and `invalidated` mean the action did not happen. A card is `pending` again after an Undo of its decline, or when what it shows changed after its approval but before it ran.","$ref":"#/components/schemas/ActionRequestStatus"},"decision":{"anyOf":[{"$ref":"#/components/schemas/ActionRequestDecision"},{"type":"null"}],"description":"Who decided, when and how; null until decided."},"execution":{"anyOf":[{"$ref":"#/components/schemas/ActionRequestExecution"},{"type":"null"}],"description":"The run of the approved action; null until it starts."},"closure":{"anyOf":[{"$ref":"#/components/schemas/ActionRequestClosure"},{"type":"null"}],"description":"Why and when the card closed; set exactly when `status` is `expired`, `cancelled` or `invalidated`."},"viewer":{"description":"What the caller may do with the card.","$ref":"#/components/schemas/ActionRequestViewer"},"createdAt":{"description":"When the agent asked.","$ref":"#/components/schemas/IsoDateTime"},"expiresAt":{"description":"When a pending card expires: by default 24 hours after it was created or last refreshed.","$ref":"#/components/schemas/IsoDateTime"},"updatedAt":{"description":"When the card last changed.","$ref":"#/components/schemas/IsoDateTime"},"revision":{"description":"The card's revision; send it as `expectedRevision` to approve, decline or undo a decline.","$ref":"#/components/schemas/Revision"}},"required":["id","number","organizationId","thread","flowRunId","messageId","turnId","chainId","agentId","onBehalfOf","tool","argumentsHash","title","question","approveLabel","declineLabel","reason","preview","targets","kind","subject","fields","answers","calls","remembers","deciders","deciderIds","moreDeciders","grantsEditTo","refreshedAt","status","decision","execution","closure","viewer","createdAt","expiresAt","updatedAt","revision"]},"ActionRequestCall":{"type":"object","properties":{"argumentsHash":{"description":"A SHA-256 hash of this call's exact arguments.","$ref":"#/components/schemas/Sha256Hex"},"subject":{"anyOf":[{"$ref":"#/components/schemas/AccessObjectRef"},{"type":"null"}],"description":"The one existing object this call is about; null when it creates one."},"title":{"type":"string","minLength":1,"maxLength":200,"description":"What this call does, as the card lists it."},"preview":{"description":"What this call would do, in words people read.","$ref":"#/components/schemas/ActionPreview"}},"required":["argumentsHash","subject","title","preview"]},"ActionRequestChange":{"type":"string","enum":["refreshed","approved","declined","reopened","executing","executed","failed","expired","cancelled","invalidated","finalized"]},"ActionRequestClosure":{"type":"object","properties":{"reason":{"description":"Why it closed: `expired`, `turn_cancelled`, `chain_stopped`, `tool_changed`, `target_deleted`, `authorization_lost` (the agent, the member it acts for or the decider may no longer do it), or `targets_changed` (the rows a filter chose changed too much).","$ref":"#/components/schemas/ClosureReason"},"at":{"description":"When it closed.","$ref":"#/components/schemas/IsoDateTime"}},"required":["reason","at"]},"ActionRequestDecision":{"oneOf":[{"type":"object","properties":{"outcome":{"type":"string","const":"approved","description":"The card was approved."},"answer":{"description":"`allow` runs the action and gives `grantsEditTo` edit access; `allow_once` runs only this action.","$ref":"#/components/schemas/ApproveAnswer"},"decidedBy":{"description":"The member who decided; agents and guests never decide.","$ref":"#/components/schemas/MemberId"},"decidedAt":{"description":"When it was decided.","$ref":"#/components/schemas/IsoDateTime"},"reason":{"anyOf":[{"type":"string","minLength":1,"maxLength":500},{"type":"null"}],"description":"The decider's own words, or null when they gave none or the caller may not read them."},"via":{"default":"app","description":"Where it was decided: `app`, `api_key` through one of the decider's API keys, or `chat_grant` when the decider had allowed this tool in this chat before, so it ran without asking again.","$ref":"#/components/schemas/RequestDecisionVia"},"apiKey":{"default":null,"description":"The API key it was decided with; null unless `via` is `api_key`.","anyOf":[{"$ref":"#/components/schemas/ApiKeyRef"},{"type":"null"}]},"undoUntil":{"type":"null","description":"Always null: an approval cannot be undone."}},"required":["outcome","answer","decidedBy","decidedAt","reason","via","apiKey","undoUntil"]},{"type":"object","properties":{"outcome":{"type":"string","const":"declined","description":"The card was declined."},"decidedBy":{"description":"The member who decided; agents and guests never decide.","$ref":"#/components/schemas/MemberId"},"decidedAt":{"description":"When it was decided.","$ref":"#/components/schemas/IsoDateTime"},"reason":{"anyOf":[{"type":"string","minLength":1,"maxLength":500},{"type":"null"}],"description":"The decider's own words, or null when they gave none or the caller may not read them."},"via":{"default":"app","description":"Where it was decided: `app`, `api_key` through one of the decider's API keys, or `chat_grant` when the decider had allowed this tool in this chat before, so it ran without asking again.","$ref":"#/components/schemas/RequestDecisionVia"},"apiKey":{"default":null,"description":"The API key it was decided with; null unless `via` is `api_key`.","anyOf":[{"$ref":"#/components/schemas/ApiKeyRef"},{"type":"null"}]},"undoUntil":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}],"description":"Until when the decline can be undone; null when there is no Undo window."}},"required":["outcome","decidedBy","decidedAt","reason","via","apiKey","undoUntil"]}]},"ActionRequestExecution":{"type":"object","properties":{"startedAt":{"description":"When the action started running.","$ref":"#/components/schemas/IsoDateTime"},"endedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}],"description":"When it finished; null while it runs."},"result":{"anyOf":[{"type":"object","properties":{"summary":{"type":"string","minLength":1,"maxLength":280,"description":"A short account of what it did."},"objects":{"type":"array","items":{"$ref":"#/components/schemas/ObjectRef"},"description":"The objects it created or changed; open the first to show the result."},"items":{"description":"On a list card (`form_links_create`, `approval_links_send`, `approval_requests`): how each item of its preview ran, one per item, in order; on a batch card, how each of its `calls` ran. Absent on every other card, and on a card that ran before cards kept their items.","maxItems":10,"type":"array","items":{"$ref":"#/components/schemas/ActionRequestResultItem"}}},"required":["summary","objects"]},{"type":"null"}],"description":"What it did, once it has run; null otherwise."},"failure":{"anyOf":[{"type":"object","properties":{"code":{"type":"string","description":"A short code for the failure, such as `timeout` or `conflict`."},"message":{"type":"string","minLength":1,"maxLength":512,"description":"What went wrong, in words that are safe to show."}},"required":["code","message"]},{"type":"null"}],"description":"Why it failed; null unless it failed."}},"required":["startedAt","endedAt","result","failure"]},"ActionRequestId":{"type":"string","pattern":"^req_[0-9a-hjkmnp-tv-z]{26}$"},"ActionRequestResultItem":{"type":"object","properties":{"status":{"description":"`done`, `failed` (nothing of it was made or sent), `unknown` (its email may have gone out, but its link does not work) or `not_tried`.","$ref":"#/components/schemas/ActionRequestResultItemStatus"},"object":{"anyOf":[{"$ref":"#/components/schemas/ObjectRef"},{"type":"null"}],"description":"What the item made, a `form_link`, an `approval_link` or an `approval`, when `done`; null otherwise."},"code":{"anyOf":[{"$ref":"#/components/schemas/ToolFailureCode"},{"type":"null"}],"description":"Why it failed, on `failed` and `unknown`; null otherwise."}},"required":["status","object","code"]},"ActionRequestResultItemStatus":{"type":"string","enum":["done","failed","unknown","not_tried"]},"ActionRequestStatus":{"type":"string","enum":["pending","approved","executing","executed","failed","declined","expired","cancelled","invalidated"]},"ActionRequestTool":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":160,"description":"The tool's name."},"version":{"type":"string","minLength":1,"maxLength":160,"description":"The tool's version; the card holds only for this version."},"displayName":{"type":"string","minLength":1,"maxLength":80,"description":"The tool's name as people read it."},"source":{"description":"Where the tool comes from: `native` (Fleepr itself), `connector`, or `mcp` (a remote MCP server).","$ref":"#/components/schemas/ToolSource"},"risk":{"description":"How much the call can change: `reversible`, `consequential`, or `destructive`, shown as a danger.","$ref":"#/components/schemas/RequestToolRisk"},"actsAs":{"description":"Whose outside account the call acts as: for a remote MCP server signed in with OAuth, the sign-in every agent on the connection uses (\"Bea Ruiz's sign-in\"). Absent for any other tool.","type":"string","minLength":1,"maxLength":200}},"required":["name","version","displayName","source","risk"]},"ActionRequestViewer":{"type":"object","properties":{"canDecide":{"type":"boolean","description":"`true` when the caller may approve or decline the card now."},"canApprove":{"default":false,"description":"`true` when the caller may answer Allow or Allow once now. `false` with `canDecide` `true` means Deny only: the caller cannot view where the card was asked, so they cannot read the arguments Allow would send.","type":"boolean"},"canUndo":{"type":"boolean","description":"`true` when the caller may still undo a decline."},"cannotDecideReason":{"anyOf":[{"$ref":"#/components/schemas/CannotDecideReason"},{"type":"null"}],"description":"`not_allowed` when the caller may not decide this pending card; null when they can, or when the card is no longer pending. `agent` and `not_in_thread` are not sent."}},"required":["canDecide","canApprove","canUndo","cannotDecideReason"]},"ActivateFlowBody":{"type":"object","properties":{"expectedRevision":{"description":"The `revision` you read. If the object changed since, the answer is `409 revision_conflict` and nothing changes.","$ref":"#/components/schemas/Revision"}},"required":["expectedRevision"],"additionalProperties":false},"ActorEventPayload":{"type":"object","properties":{"actor":{"description":"The actor's directory entry after the change.","$ref":"#/components/schemas/ActorSummary"}},"required":["actor"]},"ActorId":{"type":"string","pattern":"^(mbr|agt|sys)_[0-9a-hjkmnp-tv-z]{26}$"},"ActorKind":{"type":"string","enum":["member","agent","system"]},"ActorStatus":{"type":"string","enum":["active","invited","deactivated","paused","archived"]},"ActorSummary":{"type":"object","properties":{"id":{"description":"The actor's id: it starts with `mbr_` for a member, `agt_` for an agent and `sys_` for the system.","$ref":"#/components/schemas/ActorId"},"kind":{"description":"Whether the actor is a `member` (a person), an `agent` or the organization's `system` actor.","$ref":"#/components/schemas/ActorKind"},"name":{"type":"string","description":"The name to show for the actor."},"title":{"description":"A member's job title or an agent's role, such as \"Copywriter\"; null when none is set.","type":["string","null"]},"avatarUrl":{"anyOf":[{"$ref":"#/components/schemas/Url"},{"type":"null"}],"description":"A link to the actor's photo; null when there is none, and the app shows initials instead."},"status":{"description":"Members are `invited`, `active` or `deactivated` (removed); agents are `active`, `paused` or `archived`; the system actor is always `active`. Removed and archived actors still show in history.","$ref":"#/components/schemas/ActorStatus"},"role":{"anyOf":[{"$ref":"#/components/schemas/OrgRole"},{"type":"null"}],"description":"The member's role in the organization; null for agents and the system actor."}},"required":["id","kind","name","title","avatarUrl","status","role"]},"ActorUpdatedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"actor.updated","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"description":"What the event carries; for a change, the object as it is after it.","$ref":"#/components/schemas/ActorEventPayload"}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"AddAboutRecordBody":{"type":"object","properties":{"recordId":{"description":"The record the object is about, in any table the caller may view.","$ref":"#/components/schemas/RecordId"}},"required":["recordId"],"additionalProperties":false},"AddApproversBody":{"type":"object","properties":{"approvers":{"minItems":1,"maxItems":20,"type":"array","items":{"$ref":"#/components/schemas/ApproverInput"},"description":"The members to add, each once; anyone already an approver is left out, up to 20 approvers in all."},"expectedRevision":{"description":"The `revision` you read. If the object changed since, the answer is `409 revision_conflict` and nothing changes.","$ref":"#/components/schemas/Revision"}},"required":["approvers","expectedRevision"],"additionalProperties":false},"AddObjectMemberBody":{"type":"object","properties":{"actorId":{"description":"The member or agent of the organization to share the object with.","$ref":"#/components/schemas/ActorId"},"level":{"description":"The level to grant: `view` (the default), `edit` or `manage`; an agent gets `view` or `edit` only.","$ref":"#/components/schemas/AccessLevel"}},"required":["actorId"],"additionalProperties":false},"AddVersionBody":{"type":"object","properties":{"uploadId":{"description":"A completed upload with purpose `file_version` that the caller made for this file.","$ref":"#/components/schemas/UploadId"},"note":{"description":"What changed in this version, up to 500 characters.","type":"string","maxLength":500}},"required":["uploadId"],"additionalProperties":false},"AddVersionResult":{"type":"object","properties":{"file":{"description":"The file as it is now, showing the new version.","$ref":"#/components/schemas/FileSummary"},"version":{"description":"The new version, its previews still being made.","$ref":"#/components/schemas/FileVersion"},"approval":{"anyOf":[{"$ref":"#/components/schemas/Approval"},{"type":"null"}],"description":"The file's approval in the round the new version started; null when the file has none."}},"required":["file","version","approval"]},"Agent":{"type":"object","properties":{"id":{"description":"The agent's id.","$ref":"#/components/schemas/AgentId"},"organizationId":{"description":"The organization the agent belongs to.","$ref":"#/components/schemas/OrganizationId"},"name":{"type":"string","minLength":1,"maxLength":60,"description":"The name people @mention the agent by, unique among the organization's agents that are not deleted, ignoring case."},"title":{"anyOf":[{"type":"string","minLength":1,"maxLength":80},{"type":"null"}],"description":"The role the agent plays, such as \"Copywriter\"; null when it has none."},"avatarUrl":{"anyOf":[{"$ref":"#/components/schemas/Url"},{"type":"null"}],"description":"The address of the agent's photo; null shows a generated thumbnail."},"teamIds":{"type":"array","items":{"$ref":"#/components/schemas/TeamId"},"description":"The teams the agent belongs to, shown on its card; empty when it is in none."},"status":{"description":"`active`, `paused` (it starts no new turns until resumed) or `archived` (deleted).","$ref":"#/components/schemas/AgentStatus"},"skills":{"type":"array","items":{"$ref":"#/components/schemas/AgentSkillRef"},"description":"The skills assigned to the agent, which it loads when it needs them."},"connections":{"type":"array","items":{"$ref":"#/components/schemas/AgentConnectionRef"},"description":"The connections whose tools the agent may use, among those the caller can see."},"visibility":{"description":"`organization` lets every member see and mention the agent; `private` limits it to its owner, the organization's owner and admins, and the people it is shared with.","$ref":"#/components/schemas/Visibility"},"revision":{"description":"Grows by one on every change to the agent; send it back as `expectedRevision` when you update it.","$ref":"#/components/schemas/Revision"},"ownerId":{"description":"The member who owns the agent.","$ref":"#/components/schemas/MemberId"},"modelAlias":{"description":"The model the agent runs on, as an alias that `GET /v0/models` lists.","$ref":"#/components/schemas/ModelAlias"},"instructions":{"type":"string","maxLength":20000,"description":"The agent's instructions, in Markdown; a change applies to later turns only."},"autonomy":{"description":"How much the agent does on its own: `ask_before_writes` changes what it may edit without asking, but asks with a request card for edit access, to create or delete, to change more than 10 rows and for actions such as a connector's tools.","$ref":"#/components/schemas/AgentAutonomy"},"webTools":{"type":"boolean","description":"Whether the agent has the web tools; off by default."},"pausedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}],"description":"When a member paused the agent; null for an active agent."},"pausedReason":{"anyOf":[{"$ref":"#/components/schemas/AgentPausedReason"},{"type":"null"}],"description":"Why the agent is paused: `manual`, a member paused it; null exactly when `pausedAt` is null."},"pausedBy":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"The member who paused the agent; null exactly when `pausedAt` is null."},"createdBy":{"description":"Who created the agent.","$ref":"#/components/schemas/ActorId"},"createdAt":{"description":"When the agent was created.","$ref":"#/components/schemas/IsoDateTime"},"updatedAt":{"description":"When the agent was last changed.","$ref":"#/components/schemas/IsoDateTime"},"myAccess":{"description":"What the caller may do with the agent: their access level and actions.","$ref":"#/components/schemas/MyAccess"}},"required":["id","organizationId","name","title","avatarUrl","teamIds","status","skills","connections","visibility","revision","ownerId","modelAlias","instructions","autonomy","webTools","pausedAt","pausedReason","pausedBy","createdBy","createdAt","updatedAt","myAccess"]},"AgentAddedNotice":{"type":"object","properties":{"code":{"type":"string","const":"agent_added","description":"An agent joined the thread through a mention."},"agentId":{"description":"The agent that joined.","$ref":"#/components/schemas/AgentId"},"addedBy":{"description":"The member who added it: the mention's author, or for an agent's mention, the member its chain acts for.","$ref":"#/components/schemas/ActorId"},"level":{"description":"The access level the agent was given.","$ref":"#/components/schemas/AccessLevel"}},"required":["code","agentId","addedBy","level"]},"AgentArchivedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"agent.archived","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"description":"What the event carries; for a change, the object as it is after it.","$ref":"#/components/schemas/AgentArchivedPayload"}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"AgentArchivedPayload":{"type":"object","properties":{"agentId":{"description":"The deleted agent's id.","$ref":"#/components/schemas/AgentId"}},"required":["agentId"]},"AgentAutonomy":{"type":"string","enum":["ask_before_writes"]},"AgentConnectionRef":{"type":"object","properties":{"id":{"description":"The connection's id.","$ref":"#/components/schemas/ConnectionId"},"connectorKey":{"description":"The connector the connection belongs to.","$ref":"#/components/schemas/ConnectorKey"},"name":{"type":"string","description":"The connection's name."},"status":{"description":"The connection's status; only a `connected` connection offers its tools to the agent.","$ref":"#/components/schemas/ConnectionStatus"}},"required":["id","connectorKey","name","status"]},"AgentContext":{"type":"object","properties":{"agentId":{"description":"The agent.","$ref":"#/components/schemas/AgentId"},"parts":{"type":"array","items":{"$ref":"#/components/schemas/AgentContextPart"},"description":"Each part with its size, in the order the agent reads them."},"totalBytes":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Every part together, before the first word of the request (about 4 bytes a token)."},"blocks":{"type":"array","items":{"$ref":"#/components/schemas/AgentContextBlock"},"description":"The blocks of its knowledge, exactly as it reads them, in the order it reads them."},"lastTurnSizes":{"anyOf":[{"$ref":"#/components/schemas/AgentLastTurnSizes"},{"type":"null"}],"description":"Sizes from its last turn; null when no turn of it recorded them yet."}},"required":["agentId","parts","totalBytes","blocks","lastTurnSizes"]},"AgentContextBlock":{"type":"object","properties":{"kind":{"description":"Memories, a doc a memory points to, or the Health issues.","$ref":"#/components/schemas/AgentContextBlockKind"},"layer":{"type":"string","enum":["org","records","agent","tables","doc","health"],"description":"The layer it belongs to: a layer of memories, a doc, or Health."},"text":{"type":"string","description":"The block's lines, exactly as the agent reads them."},"memoryIds":{"type":"array","items":{"$ref":"#/components/schemas/MemoryId"},"description":"The memories it holds, in order; empty for a doc and Health."}},"required":["kind","layer","text","memoryIds"]},"AgentContextBlockKind":{"type":"string","enum":["memories","memory_doc","health"]},"AgentContextPart":{"type":"object","properties":{"kind":{"description":"Which part.","$ref":"#/components/schemas/AgentContextPartKind"},"bytes":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Its size in bytes (about 4 bytes a token)."},"share":{"type":"number","minimum":0,"maximum":1,"description":"Its share of every part together, from 0 to 1."},"fromLastTurn":{"type":"boolean","description":"Whether its size is the agent's last turn's (the tools and Fleepr's text), not sized here."}},"required":["kind","bytes","share","fromLastTurn"]},"AgentContextPartKind":{"type":"string","enum":["instructions","skills","memory_org","memory_records","memory_agent","memory_tables","profiles","health","docs","tools","system"]},"AgentCreatedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"agent.created","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"description":"What the event carries; for a change, the object as it is after it.","$ref":"#/components/schemas/AgentEventPayload"}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"AgentCreatePreview":{"type":"object","properties":{"kind":{"type":"string","const":"agent_create","description":"Create an agent."},"name":{"type":"string","minLength":1,"maxLength":60,"description":"The new agent's name."},"title":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}],"description":"The new agent's title, or null."},"modelAlias":{"type":"string","minLength":1,"maxLength":64,"description":"The model alias it runs on."},"instructions":{"type":"string","maxLength":20000,"description":"The new agent's instructions, whole, in Markdown."},"visibility":{"description":"Who will see the new agent: `organization` (every member) or `private` (its owner and its grants).","$ref":"#/components/schemas/Visibility"},"skills":{"maxItems":100,"type":"array","items":{"$ref":"#/components/schemas/PreviewSkillRef"},"description":"The skills it is given."},"connections":{"maxItems":100,"type":"array","items":{"$ref":"#/components/schemas/PreviewConnectionRef"},"description":"The connections whose tools it may use."},"teams":{"maxItems":100,"type":"array","items":{"$ref":"#/components/schemas/PreviewTeamRef"},"description":"The teams it joins."}},"required":["kind","name","title","modelAlias","instructions","visibility","skills","connections","teams"]},"AgentEventPayload":{"type":"object","properties":{"agent":{"description":"The agent after the change.","$ref":"#/components/schemas/AgentWithoutAccess"}},"required":["agent"]},"AgentFailureCodeCount":{"type":"object","properties":{"code":{"description":"The code.","$ref":"#/components/schemas/ToolFailureCode"},"count":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many calls failed with it."}},"required":["code","count"]},"AgentFailureExample":{"type":"object","properties":{"activityId":{"description":"The call's id.","$ref":"#/components/schemas/ToolActivityId"},"turnId":{"description":"Its turn.","$ref":"#/components/schemas/TurnId"},"toolName":{"type":"string","minLength":1,"maxLength":160,"description":"The tool's name, such as `record_query`."},"displayName":{"type":"string","minLength":1,"maxLength":160,"description":"Its activity line's name, such as \"Reading records\"."},"kind":{"description":"How it went wrong.","$ref":"#/components/schemas/AgentFailureKind"},"failureCode":{"anyOf":[{"$ref":"#/components/schemas/ToolFailureCode"},{"type":"null"}],"description":"Null for a declined call."},"summary":{"description":"Its activity line; null unless the caller may open its thread.","type":["string","null"]},"endedAt":{"description":"When it ended.","$ref":"#/components/schemas/IsoDateTime"},"where":{"anyOf":[{"$ref":"#/components/schemas/AgentFailureThread"},{"type":"null"}],"description":"Its thread; null unless the caller may open it."}},"required":["activityId","turnId","toolName","displayName","kind","failureCode","summary","endedAt","where"]},"AgentFailureKind":{"type":"string","enum":["failed","timed_out","declined"]},"AgentFailures":{"type":"object","properties":{"agentId":{"description":"The agent.","$ref":"#/components/schemas/AgentId"},"days":{"type":"integer","minimum":1,"maximum":90,"description":"The days read."},"since":{"description":"Where the window starts.","$ref":"#/components/schemas/IsoDateTime"},"totals":{"type":"object","properties":{"failed":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Calls that failed, timeouts aside."},"timedOut":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Calls that timed out."},"declined":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Calls a person declined."}},"required":["failed","timedOut","declined"],"description":"Every tool together."},"tools":{"type":"array","items":{"$ref":"#/components/schemas/AgentToolFailures"},"description":"The most failed and timed out first."},"examples":{"type":"array","items":{"$ref":"#/components/schemas/AgentFailureExample"},"description":"The latest, newest first."}},"required":["agentId","days","since","totals","tools","examples"]},"AgentFailureThread":{"type":"object","properties":{"thread":{"description":"The chat or file.","$ref":"#/components/schemas/ThreadRef"},"threadName":{"type":"string","description":"The chat's or file's name."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The run whose own chat it was; null otherwise."},"messageId":{"anyOf":[{"$ref":"#/components/schemas/MessageId"},{"type":"null"}],"description":"Its turn's last reply, if any."}},"required":["thread","threadName","flowRunId","messageId"]},"AgentId":{"type":"string","pattern":"^agt_[0-9a-hjkmnp-tv-z]{26}$"},"AgentInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":60,"pattern":"\\S","description":"The name people @mention the agent by, up to 60 characters, unique among the agents that are not deleted, ignoring case."},"title":{"description":"The role the agent plays, such as \"Copywriter\", up to 80 characters; null removes it.","anyOf":[{"type":"string","minLength":1,"maxLength":80,"pattern":"\\S"},{"type":"null"}]},"avatarUploadId":{"description":"Your own finished, unused upload with purpose `agent_avatar` for the agent's photo; null removes the photo.","anyOf":[{"$ref":"#/components/schemas/UploadId"},{"type":"null"}]},"teamIds":{"description":"The teams the agent belongs to, each once; replaces the current list.","type":"array","items":{"$ref":"#/components/schemas/TeamId"}},"modelAlias":{"description":"A model alias from `GET /v0/models` that is `available` and that the organization allows, or the one the agent already uses; left out on create, the default.","$ref":"#/components/schemas/ModelAlias"},"instructions":{"description":"The agent's instructions, in Markdown, up to 20,000 characters.","type":"string","maxLength":20000},"skillIds":{"description":"The skills assigned to the agent, each once; replaces the current list.","type":"array","items":{"$ref":"#/components/schemas/SkillId"}},"connectionIds":{"description":"The connections whose tools the agent may use; replaces those the caller can see, and each one added or removed needs edit on it.","type":"array","items":{"$ref":"#/components/schemas/ConnectionId"}},"webTools":{"description":"Whether the agent has the web tools; default off.","type":"boolean"},"visibility":{"description":"Who sees the agent: `organization`, the default, or `private` for its owner, admins and the people it is shared with. Only the agent's owner and the organization's owner and admins change it.","$ref":"#/components/schemas/Visibility"}},"required":["name"],"additionalProperties":false},"AgentLastTurnSizes":{"type":"object","properties":{"system":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Fleepr's own fixed text in the system role."},"tools":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"The tools it was offered."}},"required":["system","tools"]},"AgentLearning":{"type":"object","properties":{"agentId":{"description":"The agent.","$ref":"#/components/schemas/AgentId"},"firstTimeApproval":{"anyOf":[{"$ref":"#/components/schemas/FirstTimeApproval"},{"type":"null"}],"description":"Of the approvals of its work decided in the last 30 days (files it asked to be approved, and flow sign-offs of its steps) that the caller may view, the share approved the first time; null when fewer than 5 were decided."},"sendBacksThisMonth":{"description":"Its work sent back this month.","$ref":"#/components/schemas/AgentSendBacks"},"mostRead":{"anyOf":[{"$ref":"#/components/schemas/AgentMostRead"},{"type":"null"}],"description":"Its most read memory; null when it read none."},"waiting":{"type":"array","items":{"$ref":"#/components/schemas/Memory"},"description":"Suggested memories the caller decides about this agent or from its work (about it, suggested by it, or from a send-back of its work), newest first, at most 20."},"recentAnswers":{"type":"array","items":{"$ref":"#/components/schemas/AgentRecentAnswer"},"description":"Its latest answers in threads the caller may view, newest first, at most 10."}},"required":["agentId","firstTimeApproval","sendBacksThisMonth","mostRead","waiting","recentAnswers"]},"AgentMostRead":{"type":"object","properties":{"memory":{"description":"The memory.","$ref":"#/components/schemas/KnowledgeMemory"},"reads":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many of its turns in threads the caller may view read it in the last 30 days."}},"required":["memory","reads"]},"AgentPausedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"agent.paused","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"type":"object","properties":{"agent":{"description":"The agent after the change.","$ref":"#/components/schemas/AgentWithoutAccess"}},"required":["agent"],"description":"What the event carries; for a change, the object as it is after it."}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"AgentPausedReason":{"type":"string","enum":["manual"]},"AgentRecentAnswer":{"type":"object","properties":{"turnId":{"description":"The turn that wrote it.","$ref":"#/components/schemas/TurnId"},"thread":{"description":"Where it was posted.","$ref":"#/components/schemas/ThreadRef"},"threadName":{"type":"string","description":"The chat's or the file's name."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run whose own chat it was posted in, which opens from the run's page; null otherwise."},"messageId":{"anyOf":[{"$ref":"#/components/schemas/MessageId"},{"type":"null"}],"description":"Its reply message; null when it posted none."},"endedAt":{"description":"When the turn ended.","$ref":"#/components/schemas/IsoDateTime"},"applied":{"type":"array","items":{"$ref":"#/components/schemas/TurnMemoryUse"},"description":"The memories it named as shaping it, as the caller sees them."},"sentBack":{"type":"boolean","description":"Whether a person sent the work of this turn back."}},"required":["turnId","thread","threadName","flowRunId","messageId","endedAt","applied","sentBack"]},"AgentReplyLanguage":{"type":"string","enum":["app","message"]},"AgentResumedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"agent.resumed","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"type":"object","properties":{"agent":{"description":"The agent after the change.","$ref":"#/components/schemas/AgentWithoutAccess"}},"required":["agent"],"description":"What the event carries; for a change, the object as it is after it."}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"AgentSendBacks":{"type":"object","properties":{"count":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Send-backs of the agent's work that the caller may view, this calendar month in the organization's time zone."},"becameMemories":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many of them became memories the caller sees."}},"required":["count","becameMemories"]},"AgentSkillRef":{"type":"object","properties":{"id":{"description":"The skill's id.","$ref":"#/components/schemas/SkillId"},"name":{"type":"string","description":"The skill's name."}},"required":["id","name"]},"AgentsPausedNotice":{"type":"object","properties":{"code":{"type":"string","const":"agents_paused","description":"The chat's agents were paused."},"by":{"description":"The member who paused them.","$ref":"#/components/schemas/MemberId"}},"required":["code","by"]},"AgentsResumedNotice":{"type":"object","properties":{"code":{"type":"string","const":"agents_resumed","description":"The chat's agents were resumed."},"by":{"description":"The member who resumed them.","$ref":"#/components/schemas/MemberId"}},"required":["code","by"]},"AgentStatus":{"type":"string","enum":["active","paused","archived"]},"AgentSummary":{"type":"object","properties":{"id":{"description":"The agent's id.","$ref":"#/components/schemas/AgentId"},"organizationId":{"description":"The organization the agent belongs to.","$ref":"#/components/schemas/OrganizationId"},"name":{"type":"string","minLength":1,"maxLength":60,"description":"The name people @mention the agent by, unique among the organization's agents that are not deleted, ignoring case."},"title":{"anyOf":[{"type":"string","minLength":1,"maxLength":80},{"type":"null"}],"description":"The role the agent plays, such as \"Copywriter\"; null when it has none."},"avatarUrl":{"anyOf":[{"$ref":"#/components/schemas/Url"},{"type":"null"}],"description":"The address of the agent's photo; null shows a generated thumbnail."},"teamIds":{"type":"array","items":{"$ref":"#/components/schemas/TeamId"},"description":"The teams the agent belongs to, shown on its card; empty when it is in none."},"status":{"description":"`active`, `paused` (it starts no new turns until resumed) or `archived` (deleted).","$ref":"#/components/schemas/AgentStatus"},"skills":{"type":"array","items":{"$ref":"#/components/schemas/AgentSkillRef"},"description":"The skills assigned to the agent, which it loads when it needs them."},"connections":{"type":"array","items":{"$ref":"#/components/schemas/AgentConnectionRef"},"description":"The connections whose tools the agent may use, among those the caller can see."},"visibility":{"description":"`organization` lets every member see and mention the agent; `private` limits it to its owner, the organization's owner and admins, and the people it is shared with.","$ref":"#/components/schemas/Visibility"},"revision":{"description":"Grows by one on every change to the agent; send it back as `expectedRevision` when you update it.","$ref":"#/components/schemas/Revision"},"myAccess":{"description":"What the caller may do with the agent: their access level and actions.","$ref":"#/components/schemas/MyAccess"}},"required":["id","organizationId","name","title","avatarUrl","teamIds","status","skills","connections","visibility","revision","myAccess"]},"AgentSummaryPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/AgentSummary"},"description":"This page of the list."},"nextCursor":{"anyOf":[{"$ref":"#/components/schemas/Cursor"},{"type":"null"}],"description":"Send it back as `cursor` to read the next page; null on the last page."},"totalCount":{"description":"How many items match across every page, among those you may see.","$ref":"#/components/schemas/TotalCount"}},"required":["items","nextCursor","totalCount"]},"AgentTemplate":{"type":"object","properties":{"formatVersion":{"type":"number","const":1,"description":"The template's format, `1`; it changes only when the format breaks, and unknown keys are ignored."},"agent":{"description":"The agent's portable settings.","$ref":"#/components/schemas/AgentTemplateAgent"},"skills":{"type":"array","items":{"$ref":"#/components/schemas/AgentTemplateSkill"},"description":"The agent's skills with their full text; names are unique within a template, ignoring case."},"connectorRequirements":{"type":"array","items":{"$ref":"#/components/schemas/AgentTemplateConnectorRequirement"},"description":"The connectors the agent needs, each once; the importing organization connects them itself."},"exportedAt":{"description":"When the template was exported.","$ref":"#/components/schemas/IsoDateTime"}},"required":["formatVersion","agent","skills","connectorRequirements","exportedAt"]},"AgentTemplateAgent":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":60,"pattern":"\\S","description":"The agent's name; an import answers `duplicate` when the organization already has an agent of that name."},"title":{"anyOf":[{"type":"string","minLength":1,"maxLength":80},{"type":"null"}],"description":"The role the agent plays, such as \"Copywriter\"; null when it has none."},"modelAlias":{"description":"The model the agent runs on; an import replaces one that is unknown, deprecated or not allowed with the organization's default.","$ref":"#/components/schemas/ModelAlias"},"instructions":{"type":"string","maxLength":20000,"description":"The agent's instructions, in Markdown."},"autonomy":{"description":"How much the agent does on its own.","$ref":"#/components/schemas/AgentAutonomy"}},"required":["name","title","modelAlias","instructions","autonomy"]},"AgentTemplateConnectorRequirement":{"type":"object","properties":{"connectorKey":{"description":"A connector the agent needs.","$ref":"#/components/schemas/ConnectorKey"},"reason":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}],"description":"Why the agent needs the connector; null when the template does not say."}},"required":["connectorKey","reason"]},"AgentTemplateSkill":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":64,"pattern":"\\S","description":"The skill's name; on import, `skillConflict` decides what happens when the organization already uses it."},"description":{"type":"string","minLength":1,"maxLength":300,"pattern":"\\S","description":"What agents see of the skill before they load its body."},"body":{"type":"string","minLength":1,"maxLength":100000,"description":"The skill's full `SKILL.md`, front matter included."}},"required":["name","description","body"]},"AgentToolFailures":{"type":"object","properties":{"toolName":{"type":"string","minLength":1,"maxLength":160,"description":"The tool's name, such as `record_query`."},"displayName":{"type":"string","minLength":1,"maxLength":160,"description":"Its activity line's name, such as \"Reading records\"."},"failed":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Calls that failed, timeouts aside."},"timedOut":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Calls that timed out."},"declined":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Calls a person declined."},"codes":{"type":"array","items":{"$ref":"#/components/schemas/AgentFailureCodeCount"},"description":"Failed calls by code, most first."}},"required":["toolName","displayName","failed","timedOut","declined","codes"]},"AgentUpdatedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"agent.updated","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"description":"What the event carries; for a change, the object as it is after it.","$ref":"#/components/schemas/AgentEventPayload"}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"AgentUpdatePreview":{"type":"object","properties":{"kind":{"type":"string","const":"agent_update","description":"Change an agent."},"agentId":{"description":"The agent it changes.","$ref":"#/components/schemas/AgentId"},"agentName":{"type":"string","description":"The agent's name now."},"name":{"anyOf":[{"$ref":"#/components/schemas/PreviewTextChange"},{"type":"null"}],"description":"The new name; null when it stays."},"title":{"anyOf":[{"$ref":"#/components/schemas/PreviewTextChange"},{"type":"null"}],"description":"The new title; null when it stays."},"modelAlias":{"anyOf":[{"$ref":"#/components/schemas/PreviewTextChange"},{"type":"null"}],"description":"The new model alias; null when it stays."},"instructions":{"anyOf":[{"$ref":"#/components/schemas/PreviewTextChange"},{"type":"null"}],"description":"The new instructions, whole; null when they stay."},"skills":{"anyOf":[{"$ref":"#/components/schemas/PreviewSkillRefsChange"},{"type":"null"}],"description":"The skills it gains and loses; null when they stay."},"connections":{"anyOf":[{"$ref":"#/components/schemas/PreviewConnectionRefsChange"},{"type":"null"}],"description":"The connections it gains and loses; null when they stay."},"teams":{"anyOf":[{"$ref":"#/components/schemas/PreviewTeamRefsChange"},{"type":"null"}],"description":"The teams it joins and leaves; null when they stay."}},"required":["kind","agentId","agentName","name","title","modelAlias","instructions","skills","connections","teams"]},"AgentWithoutAccess":{"type":"object","properties":{"id":{"description":"The agent's id.","$ref":"#/components/schemas/AgentId"},"organizationId":{"description":"The organization the agent belongs to.","$ref":"#/components/schemas/OrganizationId"},"name":{"type":"string","minLength":1,"maxLength":60,"description":"The name people @mention the agent by, unique among the organization's agents that are not deleted, ignoring case."},"title":{"anyOf":[{"type":"string","minLength":1,"maxLength":80},{"type":"null"}],"description":"The role the agent plays, such as \"Copywriter\"; null when it has none."},"avatarUrl":{"anyOf":[{"$ref":"#/components/schemas/Url"},{"type":"null"}],"description":"The address of the agent's photo; null shows a generated thumbnail."},"teamIds":{"type":"array","items":{"$ref":"#/components/schemas/TeamId"},"description":"The teams the agent belongs to, shown on its card; empty when it is in none."},"status":{"description":"`active`, `paused` (it starts no new turns until resumed) or `archived` (deleted).","$ref":"#/components/schemas/AgentStatus"},"skills":{"type":"array","items":{"$ref":"#/components/schemas/AgentSkillRef"},"description":"The skills assigned to the agent, which it loads when it needs them."},"connections":{"type":"array","items":{"$ref":"#/components/schemas/AgentConnectionRef"},"description":"The connections whose tools the agent may use, among those the caller can see."},"visibility":{"description":"`organization` lets every member see and mention the agent; `private` limits it to its owner, the organization's owner and admins, and the people it is shared with.","$ref":"#/components/schemas/Visibility"},"revision":{"description":"Grows by one on every change to the agent; send it back as `expectedRevision` when you update it.","$ref":"#/components/schemas/Revision"},"ownerId":{"description":"The member who owns the agent.","$ref":"#/components/schemas/MemberId"},"modelAlias":{"description":"The model the agent runs on, as an alias that `GET /v0/models` lists.","$ref":"#/components/schemas/ModelAlias"},"instructions":{"type":"string","maxLength":20000,"description":"The agent's instructions, in Markdown; a change applies to later turns only."},"autonomy":{"description":"How much the agent does on its own: `ask_before_writes` changes what it may edit without asking, but asks with a request card for edit access, to create or delete, to change more than 10 rows and for actions such as a connector's tools.","$ref":"#/components/schemas/AgentAutonomy"},"webTools":{"type":"boolean","description":"Whether the agent has the web tools; off by default."},"pausedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}],"description":"When a member paused the agent; null for an active agent."},"pausedReason":{"anyOf":[{"$ref":"#/components/schemas/AgentPausedReason"},{"type":"null"}],"description":"Why the agent is paused: `manual`, a member paused it; null exactly when `pausedAt` is null."},"pausedBy":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"The member who paused the agent; null exactly when `pausedAt` is null."},"createdBy":{"description":"Who created the agent.","$ref":"#/components/schemas/ActorId"},"createdAt":{"description":"When the agent was created.","$ref":"#/components/schemas/IsoDateTime"},"updatedAt":{"description":"When the agent was last changed.","$ref":"#/components/schemas/IsoDateTime"}},"required":["id","organizationId","name","title","avatarUrl","teamIds","status","skills","connections","visibility","revision","ownerId","modelAlias","instructions","autonomy","webTools","pausedAt","pausedReason","pausedBy","createdBy","createdAt","updatedAt"]},"AggregateFn":{"type":"string","enum":["sum","avg","min","max","count"]},"AiLimits":{"type":"object","properties":{"dailyBudgetMicros":{"anyOf":[{"$ref":"#/components/schemas/Micros"},{"type":"null"}],"description":"The most the organization's AI may spend in a day, in millionths of a US dollar; null means no limit."},"monthlyBudgetMicros":{"anyOf":[{"$ref":"#/components/schemas/Micros"},{"type":"null"}],"description":"The most the organization's AI may spend in a calendar month, in millionths of a US dollar; null means no limit."},"softWarningPercent":{"type":"integer","minimum":1,"maximum":100,"description":"The share of a budget, in percent, at which the owner and admins are warned."},"chainMaxDepth":{"type":"integer","minimum":1,"maximum":5,"description":"How deep a chain of agents may go, from 1 to 5: 1 lets no agent hand off to another, 3 allows two hops."},"chainMaxTurns":{"type":"integer","minimum":1,"maximum":50,"description":"The most agent turns one chain may run, across every agent it reaches."},"chainBudgetMicros":{"anyOf":[{"$ref":"#/components/schemas/Micros"},{"type":"null"}],"description":"The most one chain of agents may spend, in millionths of a US dollar; null means no limit."},"approvalTtlSeconds":{"type":"integer","minimum":300,"maximum":2592000,"description":"How long a request card waits for a decision before it expires, in seconds: 5 minutes to 30 days."},"declineUndoSeconds":{"type":"integer","minimum":0,"maximum":300,"description":"How many seconds a person has to undo declining a request card, up to 300."},"maxActiveTurnsPerChat":{"type":"integer","minimum":1,"maximum":50,"description":"How many agent turns may run at once in one chat; more wait as `queued`."},"maxActiveTurnsPerMember":{"type":"integer","minimum":1,"maximum":50,"description":"How many agent turns may run at once for the chains one member started; more wait as `queued`."},"maxActiveTurnsPerOrganization":{"type":"integer","minimum":1,"maximum":500,"description":"How many agent turns may run at once in the organization; more wait as `queued`."},"modelAllowlist":{"default":null,"description":"The model aliases the organization's agents may use, and so every alias that runs the same model; null allows every model.","anyOf":[{"$ref":"#/components/schemas/ModelAllowlist"},{"type":"null"}]},"overrides":{"description":"The organization's own value of each limit; the limits above are in effect, its own or the plan's.","$ref":"#/components/schemas/AiLimitsOverrides"},"revision":{"description":"Grows by one on every change to the limits; send it back as `expectedRevision` when you update them.","$ref":"#/components/schemas/Revision"}},"required":["dailyBudgetMicros","monthlyBudgetMicros","softWarningPercent","chainMaxDepth","chainMaxTurns","chainBudgetMicros","approvalTtlSeconds","declineUndoSeconds","maxActiveTurnsPerChat","maxActiveTurnsPerMember","maxActiveTurnsPerOrganization","modelAllowlist","overrides","revision"]},"AiLimitsEventPayload":{"type":"object","properties":{"aiLimits":{"description":"The organization's AI limits after the change.","$ref":"#/components/schemas/AiLimits"}},"required":["aiLimits"]},"AiLimitsOverrides":{"type":"object","properties":{"dailyBudgetMicros":{"anyOf":[{"$ref":"#/components/schemas/NoLimitOverride"},{"type":"null"}],"description":"The organization's own daily budget: `{ \"value\": null }` switches it off, and null follows the plan's default."},"monthlyBudgetMicros":{"anyOf":[{"$ref":"#/components/schemas/NoLimitOverride"},{"type":"null"}],"description":"The organization's own monthly budget: `{ \"value\": null }` switches it off, and null follows the plan's default."},"softWarningPercent":{"anyOf":[{"type":"integer","minimum":1,"maximum":100,"description":"The share of a budget, in percent, at which the owner and admins are warned."},{"type":"null"}],"description":"The organization's own warning threshold, in percent; null follows the plan's default."},"chainMaxDepth":{"anyOf":[{"type":"integer","minimum":1,"maximum":5,"description":"How deep a chain of agents may go, from 1 to 5: 1 lets no agent hand off to another, 3 allows two hops."},{"type":"null"}],"description":"The organization's own chain depth, from 1 to 5; null follows the plan's default."},"chainMaxTurns":{"anyOf":[{"type":"integer","minimum":1,"maximum":50,"description":"The most agent turns one chain may run, across every agent it reaches."},{"type":"null"}],"description":"The organization's own limit of turns per chain, from 1 to 50; null follows the plan's default."},"chainBudgetMicros":{"anyOf":[{"$ref":"#/components/schemas/NoLimitOverride"},{"type":"null"}],"description":"The organization's own budget per chain: `{ \"value\": null }` switches it off, and null follows the plan's default."},"approvalTtlSeconds":{"anyOf":[{"type":"integer","minimum":300,"maximum":2592000,"description":"How long a request card waits for a decision before it expires, in seconds: 5 minutes to 30 days."},{"type":"null"}],"description":"The organization's own request card lifetime, in seconds; null follows the plan's default."},"declineUndoSeconds":{"anyOf":[{"type":"integer","minimum":0,"maximum":300,"description":"How many seconds a person has to undo declining a request card, up to 300."},{"type":"null"}],"description":"The organization's own undo window after a decline, in seconds; null follows the plan's default."},"maxActiveTurnsPerChat":{"anyOf":[{"type":"integer","minimum":1,"maximum":50,"description":"How many agent turns may run at once in one chat; more wait as `queued`."},{"type":"null"}],"description":"The organization's own limit of turns running at once per chat; null follows the plan's default."},"maxActiveTurnsPerMember":{"anyOf":[{"type":"integer","minimum":1,"maximum":50,"description":"How many agent turns may run at once for the chains one member started; more wait as `queued`."},{"type":"null"}],"description":"The organization's own limit of turns running at once per member; null follows the plan's default."},"maxActiveTurnsPerOrganization":{"anyOf":[{"type":"integer","minimum":1,"maximum":500,"description":"How many agent turns may run at once in the organization; more wait as `queued`."},{"type":"null"}],"description":"The organization's own limit of turns running at once in all; null follows the plan's default."}},"required":["dailyBudgetMicros","monthlyBudgetMicros","softWarningPercent","chainMaxDepth","chainMaxTurns","chainBudgetMicros","approvalTtlSeconds","declineUndoSeconds","maxActiveTurnsPerChat","maxActiveTurnsPerMember","maxActiveTurnsPerOrganization"]},"AiLimitsUpdatedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"ai_limits.updated","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"description":"What the event carries; for a change, the object as it is after it.","$ref":"#/components/schemas/AiLimitsEventPayload"}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"Annotation":{"type":"object","properties":{"id":{"description":"The annotation's id.","$ref":"#/components/schemas/AnnotationId"},"fileId":{"description":"The file it is drawn on.","$ref":"#/components/schemas/FileId"},"versionId":{"description":"The version of the file it is drawn on.","$ref":"#/components/schemas/FileVersionId"},"number":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"Its number on the version, counting from 1, as in \"Note 2\"."},"page":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"The page it is drawn on, counting from 0; always 0 for an image, a video or an audio file."},"shape":{"description":"What was drawn, with coordinates from 0 to 1 of the page.","$ref":"#/components/schemas/Shape"},"timeMs":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}],"description":"The moment of a video it belongs to, in milliseconds; null for any other file."},"author":{"description":"Who drew it: a member, an agent, or a guest reviewing through an approval link.","$ref":"#/components/schemas/AuthorRef"},"messageId":{"anyOf":[{"$ref":"#/components/schemas/MessageId"},{"type":"null"}],"description":"The first comment that refers to the annotation; null until a comment does."},"createdAt":{"description":"When it was drawn.","$ref":"#/components/schemas/IsoDateTime"}},"required":["id","fileId","versionId","number","page","shape","timeMs","author","messageId","createdAt"]},"AnnotationCreatedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"annotation.created","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"type":"object","properties":{"annotation":{"description":"The new annotation.","$ref":"#/components/schemas/Annotation"}},"required":["annotation"],"description":"What the event carries; for a change, the object as it is after it."}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"AnnotationDeletedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"annotation.deleted","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"type":"object","properties":{"annotationId":{"description":"The deleted annotation's id.","$ref":"#/components/schemas/AnnotationId"},"fileId":{"description":"The file it was drawn on.","$ref":"#/components/schemas/FileId"},"versionId":{"description":"The version it was drawn on.","$ref":"#/components/schemas/FileVersionId"}},"required":["annotationId","fileId","versionId"],"description":"What the event carries; for a change, the object as it is after it."}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"AnnotationId":{"type":"string","pattern":"^ann_[0-9a-hjkmnp-tv-z]{26}$"},"AnnotationPart":{"type":"object","properties":{"type":{"type":"string","const":"annotation","description":"A pointer to a note on the file, such as a mark at 0:04 of a video; in a file's comments only."},"annotationId":{"description":"The annotation; it comes in `included.annotations`.","$ref":"#/components/schemas/AnnotationId"}},"required":["type","annotationId"]},"AnswerChoiceBody":{"type":"object","properties":{"optionKey":{"type":"string","minLength":1,"maxLength":40,"description":"The `key` of the option chosen."}},"required":["optionKey"],"additionalProperties":false},"AnswerChoiceResult":{"type":"object","properties":{"message":{"description":"The message with the table card, its choice now answered.","$ref":"#/components/schemas/Message"},"reply":{"description":"The answer, posted as the caller's reply to the agent that asked.","$ref":"#/components/schemas/Message"},"turns":{"type":"array","items":{"$ref":"#/components/schemas/Turn"},"description":"The turn the reply started for that agent; empty when the caller may not mention it."}},"required":["message","reply","turns"]},"AnswerQuestionAnswers":{"type":"object","properties":{"kind":{"type":"string","const":"answers","description":"Send these answers."},"choices":{"minItems":1,"maxItems":4,"type":"array","items":{"$ref":"#/components/schemas/QuestionChoice"},"description":"One answer per question, in the card's order: the options chosen (their `id`s) and, under Other, your own words. A single-select question takes exactly one of them."},"expectedRevision":{"description":"The `revision` you read. If the object changed since, the answer is `409 revision_conflict` and nothing changes.","$ref":"#/components/schemas/Revision"}},"required":["kind","choices","expectedRevision"],"additionalProperties":false},"AnswerQuestionBody":{"oneOf":[{"$ref":"#/components/schemas/AnswerQuestionAnswers"},{"$ref":"#/components/schemas/AnswerQuestionSkip"}]},"AnswerQuestionResult":{"type":"object","properties":{"message":{"description":"The message with the question card, now answered.","$ref":"#/components/schemas/Message"}},"required":["message"]},"AnswerQuestionSkip":{"type":"object","properties":{"kind":{"type":"string","const":"skip","description":"Skip: the asker uses its recommended option on every question. Only where the card allows it."},"expectedRevision":{"description":"The `revision` you read. If the object changed since, the answer is `409 revision_conflict` and nothing changes.","$ref":"#/components/schemas/Revision"}},"required":["kind","expectedRevision"],"additionalProperties":false},"ApiKey":{"type":"object","properties":{"id":{"description":"The key's id, which names it in the log; never the key itself.","$ref":"#/components/schemas/ApiKeyId"},"organizationId":{"description":"The organization the key works in.","$ref":"#/components/schemas/OrganizationId"},"name":{"type":"string","description":"The name its member gave the key, such as \"Zapier reports\"."},"scope":{"description":"`read`: reads what its member may read and writes nothing; `read_write`: also writes as its member could.","$ref":"#/components/schemas/ApiKeyScope"},"prefix":{"type":"string","description":"The key's first 12 characters, `flk_` and 8 more, to tell keys apart; never enough to use it."},"memberId":{"description":"The member who made the key and whose permissions it acts with.","$ref":"#/components/schemas/MemberId"},"status":{"description":"`active`: it works; `expired`: past its `expiresAt`; `revoked`: revoked, see `revokedReason`.","$ref":"#/components/schemas/ApiKeyStatus"},"createdAt":{"description":"When the key was made.","$ref":"#/components/schemas/IsoDateTime"},"expiresAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}],"description":"When the key stops working; null when it does not expire."},"lastUsedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}],"description":"When the key last authenticated a request, to the minute; null while it was never used."},"revokedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}],"description":"When the key was revoked; null unless it was."},"revokedBy":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"The member who revoked the key, or whose action revoked it; null unless it was revoked."},"revokedReason":{"anyOf":[{"$ref":"#/components/schemas/ApiKeyRevokedReason"},{"type":"null"}],"description":"`manual`: revoked by hand; `member_deactivated`, `member_made_viewer` or `member_role_changed`: its member was removed, made a viewer or is no longer the owner or an admin. Null unless it was revoked."},"decides":{"default":[],"description":"The kinds of decision the key may take for its member, fixed when it was made; empty for none.","maxItems":5,"type":"array","items":{"$ref":"#/components/schemas/ApiKeyDecisionKind"}},"decidingPausedAt":{"default":null,"description":"When the key went past 60 decisions in an hour and its deciding paused; it still reads and writes. Null while it may decide.","anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]}},"required":["id","organizationId","name","scope","prefix","memberId","status","createdAt","expiresAt","lastUsedAt","revokedAt","revokedBy","revokedReason","decides","decidingPausedAt"]},"ApiKeyDecisionKind":{"type":"string","enum":["file_approvals","flow_sign_offs","cards_inside","cards_outside","cards_deletes"]},"ApiKeyId":{"type":"string","pattern":"^apikey_[0-9a-hjkmnp-tv-z]{26}$"},"ApiKeyPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/ApiKey"},"description":"This page of the list."},"nextCursor":{"anyOf":[{"$ref":"#/components/schemas/Cursor"},{"type":"null"}],"description":"Send it back as `cursor` to read the next page; null on the last page."}},"required":["items","nextCursor"]},"ApiKeyRef":{"type":"object","properties":{"id":{"description":"The key's id.","$ref":"#/components/schemas/ApiKeyId"},"name":{"type":"string","description":"The key's name."}},"required":["id","name"]},"ApiKeyRevokedReason":{"type":"string","enum":["manual","member_deactivated","member_made_viewer","member_role_changed"]},"ApiKeyScope":{"type":"string","enum":["read","read_write"]},"ApiKeyStatus":{"type":"string","enum":["active","expired","revoked"]},"AppLanguage":{"type":"string","enum":["en","es","fr","de","pt"]},"AppRoute":{"type":"string","maxLength":2048,"pattern":"^\\/(?![/\\\\])\\S*$"},"Approval":{"type":"object","properties":{"id":{"description":"The approval's id.","$ref":"#/components/schemas/ApprovalId"},"organizationId":{"description":"The organization the approval belongs to.","$ref":"#/components/schemas/OrganizationId"},"subject":{"description":"What is under review: a version of a file, or a sign-off step of a flow run.","$ref":"#/components/schemas/ApprovalSubject"},"ownerId":{"description":"The member who owns the approval; for one an agent requested, the member the agent works for.","$ref":"#/components/schemas/MemberId"},"createdBy":{"description":"Who requested the approval.","$ref":"#/components/schemas/ActorId"},"round":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"The current round, counting from 1; each new version of the file starts the next one and clears the decisions."},"status":{"description":"`pending` while decisions are missing, `approved` once every approver approved, `changes_requested` when an approver sent a flow sign-off back (never on a file, whose reviewers comment instead), or `cancelled` when its file was deleted or its flow run ended.","$ref":"#/components/schemas/ApprovalStatus"},"pausedReason":{"anyOf":[{"$ref":"#/components/schemas/ApprovalPausedReason"},{"type":"null"}],"description":"Why the approval is paused: `owner_deactivated` when its owner was deactivated; null when it is not paused."},"outsideAgentsMayDecide":{"default":false,"description":"Whether an approver may decide through one of their API keys. The server sets it: true when a member asked or a flow run did, false when an agent asked or a guest link made it.","type":"boolean"},"docEdited":{"default":false,"description":"A doc's approval: whether a page it covers changed since the version under review was frozen (the doc's saves and restores work it out again; a new round clears it). An approval belongs to the version it reviews, so an `approved` doc edited since takes a new request: read it as a doc with no approval of what it holds now. False for any other file and every flow sign-off.","type":"boolean"},"approvers":{"minItems":1,"maxItems":20,"type":"array","items":{"$ref":"#/components/schemas/Approver"},"description":"The approvers of the current round, 1 to 20, in their order."},"viewerIds":{"type":"array","items":{"$ref":"#/components/schemas/ActorId"},"description":"The members and agents who may view what is under review and are not approvers."},"approvedCount":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many approvers approved in the current round."},"approverCount":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"How many approvers the current round has."},"viewer":{"description":"What the caller may do in the approval, worked out for them.","$ref":"#/components/schemas/ApprovalViewer"},"createdAt":{"description":"When the approval was requested.","$ref":"#/components/schemas/IsoDateTime"},"updatedAt":{"description":"When the approval last changed.","$ref":"#/components/schemas/IsoDateTime"},"revision":{"description":"Grows by one with every change; when two copies differ, keep the one with the higher revision.","$ref":"#/components/schemas/Revision"}},"required":["id","organizationId","subject","ownerId","createdBy","round","status","pausedReason","outsideAgentsMayDecide","docEdited","approvers","viewerIds","approvedCount","approverCount","viewer","createdAt","updatedAt","revision"]},"ApprovalApproversChangedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"approval.approvers_changed","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"type":"object","properties":{"approval":{"description":"The whole approval as it is after the change.","$ref":"#/components/schemas/Approval"}},"required":["approval"],"description":"What the event carries; for a change, the object as it is after it."}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"ApprovalCancelledEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"approval.cancelled","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"type":"object","properties":{"approval":{"description":"The whole approval as it is after the change.","$ref":"#/components/schemas/Approval"}},"required":["approval"],"description":"What the event carries; for a change, the object as it is after it."}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"ApprovalCompletedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"approval.completed","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"type":"object","properties":{"approval":{"description":"The whole approval as it is after the change.","$ref":"#/components/schemas/Approval"}},"required":["approval"],"description":"What the event carries; for a change, the object as it is after it."}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"ApprovalDecidedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"approval.decided","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"type":"object","properties":{"approval":{"description":"The whole approval as it is after the change.","$ref":"#/components/schemas/Approval"}},"required":["approval"],"description":"What the event carries; for a change, the object as it is after it."}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"ApprovalDecidedNotice":{"type":"object","properties":{"code":{"type":"string","const":"approval_decided","description":"An approver decided on the file's approval."},"approvalId":{"description":"The file's approval.","$ref":"#/components/schemas/ApprovalId"},"round":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"The approval round, counting from 1."},"decision":{"description":"`approved`; `changes_requested` only on a line written before files stopped taking change requests.","$ref":"#/components/schemas/Decision"},"by":{"description":"Who decided: a member, or a guest through an approval link.","$ref":"#/components/schemas/ApproverRef"},"apiKey":{"default":null,"description":"The member's API key the decision was taken with; null for a decision in the app or a link.","anyOf":[{"$ref":"#/components/schemas/ApiKeyRef"},{"type":"null"}]}},"required":["code","approvalId","round","decision","by","apiKey"]},"ApprovalDecisionUndoneEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"approval.decision_undone","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"type":"object","properties":{"approval":{"description":"The whole approval as it is after the change.","$ref":"#/components/schemas/Approval"}},"required":["approval"],"description":"What the event carries; for a change, the object as it is after it."}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"ApprovalDecisionUndoneNotice":{"type":"object","properties":{"code":{"type":"string","const":"approval_decision_undone","description":"A decision on the file's approval was undone."},"approvalId":{"description":"The file's approval.","$ref":"#/components/schemas/ApprovalId"},"round":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"The approval round, counting from 1."},"by":{"description":"The approver who undid their decision.","$ref":"#/components/schemas/ApproverRef"}},"required":["code","approvalId","round","by"]},"ApprovalId":{"type":"string","pattern":"^apr_[0-9a-hjkmnp-tv-z]{26}$"},"ApprovalLink":{"type":"object","properties":{"id":{"description":"The link's id.","$ref":"#/components/schemas/ApprovalLinkId"},"organizationId":{"description":"The organization the link belongs to.","$ref":"#/components/schemas/OrganizationId"},"issuerId":{"description":"The member who made the link, or who allowed the card an agent sent it under; it stops working when they can no longer share every file of it.","$ref":"#/components/schemas/MemberId"},"agentId":{"default":null,"description":"The agent that emailed the link under a card its issuer allowed; null for a link a member made.","anyOf":[{"$ref":"#/components/schemas/AgentId"},{"type":"null"}]},"fileIds":{"minItems":1,"maxItems":50,"type":"array","items":{"$ref":"#/components/schemas/FileId"},"description":"The files the guest reviews through the link, 1 to 50."},"recipient":{"description":"The guest the link is for, always with an email; the link made them an approver of each of its files.","$ref":"#/components/schemas/GuestContact"},"requiresCode":{"type":"boolean","description":"Whether the recipient confirms their email with a one-time code before deciding; if not, whoever opens the link gives a name and reviews as the recipient."},"recipientVerifiedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}],"description":"When the recipient first confirmed their email on this link with a code; null until then."},"allowOthersToComment":{"type":"boolean","description":"Whether anyone else holding the link may view the files, comment and annotate; if not, they see nothing."},"allowDownload":{"type":"boolean","description":"Whether the recipient may download the files, once verified or, on a link that requires no code, once named; nobody else ever may."},"expiresAt":{"description":"When the link stops working.","$ref":"#/components/schemas/IsoDateTime"},"status":{"description":"`active`, `revoked` by a member, or `expired` once past `expiresAt`.","$ref":"#/components/schemas/ApprovalLinkStatus"},"revokedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}],"description":"When the link was revoked; null unless it is `revoked`."},"revokedBy":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"The member who revoked the link; null unless it is `revoked`."},"lastOpenedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}],"description":"When someone last started a review session through the link; null when nobody has."},"openCount":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many review sessions were started through the link."},"undelivered":{"default":null,"description":"Set when an email to the recipient, the link or a code, bounced or was marked as spam; null while none was reported.","anyOf":[{"$ref":"#/components/schemas/EmailUndelivered"},{"type":"null"}]},"createdAt":{"description":"When the link was made.","$ref":"#/components/schemas/IsoDateTime"},"revision":{"description":"Grows by one with every change; when two copies differ, keep the one with the higher revision.","$ref":"#/components/schemas/Revision"}},"required":["id","organizationId","issuerId","agentId","fileIds","recipient","requiresCode","recipientVerifiedAt","allowOthersToComment","allowDownload","expiresAt","status","revokedAt","revokedBy","lastOpenedAt","openCount","undelivered","createdAt","revision"]},"ApprovalLinkDelivery":{"type":"string","enum":["email","none"]},"ApprovalLinkId":{"type":"string","pattern":"^alink_[0-9a-hjkmnp-tv-z]{26}$"},"ApprovalLinkRecipientInput":{"type":"object","properties":{"email":{"description":"The guest's email; a member's email fails with `duplicate`.","$ref":"#/components/schemas/Email"},"name":{"description":"The guest's name, up to 80 characters; it replaces any name kept for that email.","type":"string","minLength":1,"maxLength":80}},"required":["email"],"additionalProperties":false},"ApprovalLinkRevokePreview":{"type":"object","properties":{"kind":{"type":"string","const":"approval_link_revoke","description":"Revoke one guest approval link for good."},"fileId":{"description":"The file it acts on.","$ref":"#/components/schemas/FileId"},"fileName":{"type":"string","description":"The file's name."},"linkId":{"description":"The link Allow revokes.","$ref":"#/components/schemas/ApprovalLinkId"},"recipient":{"type":"object","properties":{"email":{"description":"The guest's email address.","$ref":"#/components/schemas/Email"},"name":{"anyOf":[{"type":"string","minLength":1,"maxLength":80},{"type":"null"}],"description":"The name the organization keeps for the guest, up to 80 characters; null when it keeps none."}},"required":["email","name"],"description":"Who the link is for."},"status":{"type":"string","enum":["active"],"description":"Where the link stands: always `active` (a revoked or expired link gets no card)."},"expiresAt":{"description":"When the link stops working on its own.","$ref":"#/components/schemas/IsoDateTime"},"openCount":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many review sessions were started through the link."},"recipientVerified":{"type":"boolean","description":"Whether the guest confirmed their email address on this link with a one-time code."}},"required":["kind","fileId","fileName","linkId","recipient","status","expiresAt","openCount","recipientVerified"]},"ApprovalLinkSendPreview":{"type":"object","properties":{"kind":{"type":"string","const":"approval_link_send","description":"Email a guest an approval link for a file."},"fileId":{"description":"The file it acts on.","$ref":"#/components/schemas/FileId"},"fileName":{"type":"string","description":"The file's name."},"recipient":{"type":"object","properties":{"email":{"description":"The guest's email address: Fleepr emails the link there.","$ref":"#/components/schemas/Email"},"name":{"anyOf":[{"type":"string","minLength":1,"maxLength":80},{"type":"null"}],"description":"The name the email greets the guest by, up to 80 characters: the name the organization keeps for a known guest (a name the agent gives never renames one), else the name the agent gave; null when neither."}},"required":["email","name"],"description":"Who the link is for."},"requiresCode":{"type":"boolean","description":"Whether the guest confirms their email address with a one-time code before they review."},"allowDownload":{"type":"boolean","description":"Whether the guest may download the file."},"allowOthersToComment":{"type":"boolean","description":"Whether others who hold the link may view the file and comment."},"expiresInDays":{"type":"integer","minimum":1,"maximum":30,"description":"How many days the link works once it is sent."},"joinsApproval":{"type":"boolean","description":"True when the guest joins the file's open approval as an approver; false when the link starts an approval."},"knownContact":{"type":"boolean","description":"Whether the organization already knows this guest by their email address."},"pages":{"description":"For a doc: the numbers of the pages the approval covers, in order; absent for the whole doc or another file.","minItems":1,"maxItems":500,"type":"array","items":{"type":"integer","minimum":1,"maximum":1000}}},"required":["kind","fileId","fileName","recipient","requiresCode","allowDownload","allowOthersToComment","expiresInDays","joinsApproval","knownContact"]},"ApprovalLinksSendPreview":{"type":"object","properties":{"kind":{"type":"string","const":"approval_links_send","description":"Email several guest approval links."},"files":{"minItems":1,"maxItems":10,"type":"array","items":{"$ref":"#/components/schemas/ApprovalLinksSendPreviewFile"},"description":"The links' files, each once, in the order of each file's first link."},"links":{"minItems":2,"maxItems":10,"type":"array","items":{"$ref":"#/components/schemas/ApprovalLinksSendPreviewLink"},"description":"The links to email, 2 to 10, in the order the agent named them."},"expiresInDays":{"type":"integer","minimum":1,"maximum":30,"description":"How many days each link works once it is sent."}},"required":["kind","files","links","expiresInDays"]},"ApprovalLinksSendPreviewFile":{"type":"object","properties":{"fileId":{"description":"The file it acts on.","$ref":"#/components/schemas/FileId"},"fileName":{"type":"string","description":"The file's name."},"approval":{"type":"string","enum":["joins","starts"],"description":"`joins`: the file has an open approval, and each guest joins it as an approver; `starts`: it has none, so the file's first link that goes out starts one and every later link joins it."},"pages":{"description":"For a doc: the numbers of the pages the approval covers, in order; absent for the whole doc or another file.","minItems":1,"maxItems":500,"type":"array","items":{"type":"integer","minimum":1,"maximum":1000}}},"required":["fileId","fileName","approval"]},"ApprovalLinksSendPreviewLink":{"type":"object","properties":{"fileId":{"description":"The file the link is for: one of `files`.","$ref":"#/components/schemas/FileId"},"recipient":{"type":"object","properties":{"email":{"description":"The guest's email address: Fleepr emails the link there.","$ref":"#/components/schemas/Email"},"name":{"anyOf":[{"type":"string","minLength":1,"maxLength":80},{"type":"null"}],"description":"The name the email greets the guest by, up to 80 characters: the name the organization keeps for a known guest (a name the agent gives never renames one), else the name the agent gave; null when neither."}},"required":["email","name"],"description":"Who the link is for."},"knownContact":{"type":"boolean","description":"Whether the organization already knows this guest by their email address."},"requiresCode":{"type":"boolean","description":"Whether the guest confirms their email address with a one-time code before they review."},"allowDownload":{"type":"boolean","description":"Whether the guest may download the file."},"allowOthersToComment":{"type":"boolean","description":"Whether others who hold the link may view the file and comment."}},"required":["fileId","recipient","knownContact","requiresCode","allowDownload","allowOthersToComment"]},"ApprovalLinkStatus":{"type":"string","enum":["active","revoked","expired"]},"ApprovalPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Approval"},"description":"This page of the list."},"nextCursor":{"anyOf":[{"$ref":"#/components/schemas/Cursor"},{"type":"null"}],"description":"Send it back as `cursor` to read the next page; null on the last page."}},"required":["items","nextCursor"]},"ApprovalPausedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"approval.paused","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"type":"object","properties":{"approval":{"description":"The whole approval as it is after the change.","$ref":"#/components/schemas/Approval"}},"required":["approval"],"description":"What the event carries; for a change, the object as it is after it."}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"ApprovalPausedReason":{"type":"string","enum":["owner_deactivated"]},"ApprovalRate":{"type":"object","properties":{"share":{"type":"number","minimum":0,"maximum":1,"description":"The share approved in round 1 with no send-back, from 0 to 1."},"approvedFirstTime":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many were approved the first time."},"decided":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many were decided."}},"required":["share","approvedFirstTime","decided"]},"ApprovalRequestedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"approval.requested","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"type":"object","properties":{"approval":{"description":"The whole approval as it is after the change.","$ref":"#/components/schemas/Approval"}},"required":["approval"],"description":"What the event carries; for a change, the object as it is after it."}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"ApprovalRequestPreview":{"type":"object","properties":{"kind":{"type":"string","const":"approval_request","description":"Ask members to approve a file."},"fileId":{"description":"The file it acts on.","$ref":"#/components/schemas/FileId"},"fileName":{"type":"string","description":"The file's name."},"approverIds":{"minItems":1,"type":"array","items":{"$ref":"#/components/schemas/MemberId"},"description":"The members asked to approve the file, at least one."},"pages":{"description":"For a doc: the numbers of the pages the approval covers, in order; absent for the whole doc or another file.","minItems":1,"maxItems":500,"type":"array","items":{"type":"integer","minimum":1,"maximum":1000}}},"required":["kind","fileId","fileName","approverIds"]},"ApprovalRequestsPreview":{"type":"object","properties":{"kind":{"type":"string","const":"approval_requests","description":"Ask members to approve several files."},"requests":{"minItems":2,"maxItems":10,"type":"array","items":{"$ref":"#/components/schemas/ApprovalRequestsPreviewRequest"},"description":"The files, 2 to 10, each once, in the order the agent named them."}},"required":["kind","requests"]},"ApprovalRequestsPreviewRequest":{"type":"object","properties":{"fileId":{"description":"The file it acts on.","$ref":"#/components/schemas/FileId"},"fileName":{"type":"string","description":"The file's name."},"approverIds":{"minItems":1,"maxItems":20,"type":"array","items":{"$ref":"#/components/schemas/MemberId"},"description":"The members asked to approve the file, 1 to 20."},"grantsEdit":{"type":"boolean","description":"True when the agents cannot edit this file yet: Allow gives them edit on it (`grantsEditTo`), and Allow once waives that for this run alone."},"pages":{"description":"For a doc: the numbers of the pages the approval covers, in order; absent for the whole doc or another file.","minItems":1,"maxItems":500,"type":"array","items":{"type":"integer","minimum":1,"maximum":1000}}},"required":["fileId","fileName","approverIds","grantsEdit"]},"ApprovalResumedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"approval.resumed","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"type":"object","properties":{"approval":{"description":"The whole approval as it is after the change.","$ref":"#/components/schemas/Approval"}},"required":["approval"],"description":"What the event carries; for a change, the object as it is after it."}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"ApprovalRoundStartedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"approval.round_started","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"type":"object","properties":{"approval":{"description":"The whole approval as it is after the change.","$ref":"#/components/schemas/Approval"}},"required":["approval"],"description":"What the event carries; for a change, the object as it is after it."}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"ApprovalStatus":{"type":"string","enum":["pending","approved","changes_requested","cancelled"]},"ApprovalSubject":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"file","description":"`file`: a version of a file."},"fileId":{"description":"The file under review.","$ref":"#/components/schemas/FileId"},"versionId":{"description":"The version under review in the current round.","$ref":"#/components/schemas/FileVersionId"},"docPageIds":{"default":null,"description":"A doc's pages under review: the ids of the version's pages the approval covers; null for every page, and for any other file.","anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/DocPageId"}},{"type":"null"}]}},"required":["kind","fileId","versionId","docPageIds"]},{"type":"object","properties":{"kind":{"type":"string","const":"flow_step","description":"`flow_step`: a sign-off step of a flow run."},"flowRunId":{"description":"The flow run that waits for the sign-off.","$ref":"#/components/schemas/FlowRunId"},"stepRunId":{"description":"The step of that run that waits for the sign-off.","$ref":"#/components/schemas/StepRunId"}},"required":["kind","flowRunId","stepRunId"]}]},"ApprovalSubjectKind":{"type":"string","enum":["file","flow_step"]},"ApprovalSummary":{"type":"object","properties":{"approvalId":{"description":"The approval's id.","$ref":"#/components/schemas/ApprovalId"},"round":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"The current round, counting from 1; each new version of the file starts the next one and clears the decisions."},"status":{"description":"`pending` while decisions are missing, `approved` once every approver approved, `changes_requested` when an approver sent a flow sign-off back (never on a file, whose reviewers comment instead), or `cancelled` when its file was deleted or its flow run ended.","$ref":"#/components/schemas/ApprovalStatus"},"pausedReason":{"anyOf":[{"$ref":"#/components/schemas/ApprovalPausedReason"},{"type":"null"}],"description":"Why the approval is paused: `owner_deactivated` when its owner was deactivated; null when it is not paused."},"approvedCount":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many approvers approved in the current round."},"approverCount":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"How many approvers the current round has."},"docEdited":{"default":false,"description":"A doc's approval: whether a page it covers changed since the version under review was frozen (the doc's saves and restores work it out again; a new round clears it). An approval belongs to the version it reviews, so an `approved` doc edited since takes a new request: read it as a doc with no approval of what it holds now. False for any other file and every flow sign-off.","type":"boolean"},"viewer":{"description":"What the caller may do in the approval, worked out for them.","$ref":"#/components/schemas/ApprovalSummaryViewer"}},"required":["approvalId","round","status","pausedReason","approvedCount","approverCount","docEdited","viewer"]},"ApprovalSummaryViewer":{"type":"object","properties":{"isApprover":{"type":"boolean","description":"Whether the caller is an approver in the current round."},"myDecision":{"anyOf":[{"$ref":"#/components/schemas/Decision"},{"type":"null"}],"description":"The caller's decision in the current round: `approved`, or on a flow sign-off `changes_requested`; null when they have not decided."},"canDecide":{"type":"boolean","description":"Whether the caller may decide now: approve, or send a sign-off back."},"canUndo":{"type":"boolean","description":"Whether the caller may withdraw their decision: they decided in this round and the approval is neither paused nor cancelled; never on a flow sign-off or through an API key."}},"required":["isApprover","myDecision","canDecide","canUndo"]},"ApprovalViewer":{"type":"object","properties":{"isApprover":{"type":"boolean","description":"Whether the caller is an approver in the current round."},"myDecision":{"anyOf":[{"$ref":"#/components/schemas/Decision"},{"type":"null"}],"description":"The caller's decision in the current round: `approved`, or on a flow sign-off `changes_requested`; null when they have not decided."},"canDecide":{"type":"boolean","description":"Whether the caller may decide now: approve, or send a sign-off back."},"canUndo":{"type":"boolean","description":"Whether the caller may withdraw their decision: they decided in this round and the approval is neither paused nor cancelled; never on a flow sign-off or through an API key."},"canAddApprovers":{"type":"boolean","description":"Whether the caller may add and remove approvers: the approval's creator or owner, while it is open."}},"required":["isApprover","myDecision","canDecide","canUndo","canAddApprovers"]},"ApproveAnswer":{"type":"string","enum":["allow","allow_once"]},"ApproveManyBody":{"type":"object","properties":{"items":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"object","properties":{"approvalId":{"description":"The approval to approve.","$ref":"#/components/schemas/ApprovalId"},"round":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"The round you approve, the approval's current `round`."}},"required":["approvalId","round"],"additionalProperties":false},"description":"The approvals to approve, 1 to 50, each once."}},"required":["items"],"additionalProperties":false},"ApproveManyResult":{"type":"object","properties":{"approvals":{"type":"array","items":{"$ref":"#/components/schemas/Approval"},"description":"The approvals after the decisions."}},"required":["approvals"]},"Approver":{"type":"object","properties":{"key":{"description":"The approver's key, the member's id or the guest's contact id; use it to remove the approver.","$ref":"#/components/schemas/ApproverKey"},"who":{"description":"Who the approver is: a member, or a guest deciding through an approval link.","$ref":"#/components/schemas/ApproverRef"},"order":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Their place in the list of approvers, counting from 0."},"decision":{"anyOf":[{"$ref":"#/components/schemas/Decision"},{"type":"null"}],"description":"Their decision in the current round: `approved`, or on a flow sign-off `changes_requested`; null while it is pending."},"decidedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}],"description":"When they decided in the current round; null while pending."},"reasonMessageId":{"anyOf":[{"$ref":"#/components/schemas/MessageId"},{"type":"null"}],"description":"Always null: a file approval takes no change request, and a sign-off keeps its reason as a note."},"via":{"anyOf":[{"$ref":"#/components/schemas/DecisionVia"},{"type":"null"}],"description":"Where they decided: `app`, `link` (a guest through their approval link) or `api_key` (through one of their API keys); null while pending."},"apiKey":{"default":null,"description":"The API key the decision was taken with, by id and name; null unless `via` is `api_key`.","anyOf":[{"$ref":"#/components/schemas/ApiKeyRef"},{"type":"null"}]},"addedBy":{"description":"Who made them an approver.","$ref":"#/components/schemas/ActorId"},"addedAt":{"description":"When they became an approver.","$ref":"#/components/schemas/IsoDateTime"}},"required":["key","who","order","decision","decidedAt","reasonMessageId","via","apiKey","addedBy","addedAt"]},"ApproveRequestBody":{"type":"object","properties":{"argumentsHash":{"description":"The card's `argumentsHash` as you read it; a call that changed since answers `409 arguments_mismatch`.","$ref":"#/components/schemas/Sha256Hex"},"answer":{"description":"`allow`, or `allow_once` to run this action without giving access; it must be one of the card's `answers`.","$ref":"#/components/schemas/ApproveAnswer"},"expectedRevision":{"description":"The `revision` you read. If the object changed since, the answer is `409 revision_conflict` and nothing changes.","$ref":"#/components/schemas/Revision"}},"required":["argumentsHash","answer","expectedRevision"],"additionalProperties":false},"ApproverInput":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"member","description":"`member`, the only kind to add here; a guest becomes an approver through an approval link."},"memberId":{"description":"The member to ask, an active member who may view the file.","$ref":"#/components/schemas/MemberId"}},"required":["kind","memberId"],"additionalProperties":false}]},"ApproverKey":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"$ref":"#/components/schemas/GuestContactId"}]},"ApproverRef":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"member","description":"`member`: a member of the organization."},"memberId":{"description":"The member's id.","$ref":"#/components/schemas/MemberId"}},"required":["kind","memberId"]},{"type":"object","properties":{"kind":{"type":"string","const":"guest","description":"`guest`: a guest who decides through an approval link."},"guestContactId":{"description":"The guest's contact id.","$ref":"#/components/schemas/GuestContactId"},"name":{"description":"The guest's name, from the link's issuer or the guest; null when neither gave one.","type":["string","null"]}},"required":["kind","guestContactId","name"]}]},"ApproversAddedNotice":{"type":"object","properties":{"code":{"type":"string","const":"approvers_added","description":"More approvers were asked to approve the file."},"approvalId":{"description":"The file's approval.","$ref":"#/components/schemas/ApprovalId"},"approvers":{"minItems":1,"type":"array","items":{"$ref":"#/components/schemas/ApproverRef"},"description":"The approvers added."},"by":{"description":"The member or agent who added them.","$ref":"#/components/schemas/ActorId"}},"required":["code","approvalId","approvers","by"]},"AttachmentPart":{"type":"object","properties":{"type":{"type":"string","const":"attachment","description":"A file from the media library."},"fileId":{"description":"The attached file; its name, size and preview come in `included.files`.","$ref":"#/components/schemas/FileId"},"fileVersionId":{"description":"The version of the file that was current when the message was sent.","$ref":"#/components/schemas/FileVersionId"}},"required":["type","fileId","fileVersionId"]},"AttachmentsColumn":{"type":"object","properties":{"id":{"description":"The column's id: the key of its cell in each record's `values`.","$ref":"#/components/schemas/ColumnId"},"tableId":{"description":"The table the column belongs to.","$ref":"#/components/schemas/TableId"},"name":{"type":"string","minLength":1,"maxLength":80,"description":"The column's name, shown in its header."},"position":{"description":"The column's place in the table: columns sort by this key, compared as text.","$ref":"#/components/schemas/FractionalIndex"},"readOnly":{"type":"boolean","description":"Whether only the server writes the column's cells; a record write that sets one answers `400 validation_failed`."},"revision":{"description":"Grows by one with every change to the column; send it as `expectedRevision` to change the column.","$ref":"#/components/schemas/Revision"},"type":{"type":"string","const":"attachments","description":"The column's type, which decides what its cells hold."}},"required":["id","tableId","name","position","readOnly","revision","type"]},"AudioCapture":{"type":"object","properties":{"kind":{"type":"string","const":"audio","description":"Record audio."},"maxSeconds":{"type":"integer","minimum":10,"maximum":1800,"description":"The longest take, in seconds: 10 to 1,800."},"teleprompter":{"anyOf":[{"$ref":"#/components/schemas/Teleprompter"},{"type":"null"}],"description":"The teleprompter, or null for none."}},"required":["kind","maxSeconds","teleprompter"]},"AuthorRef":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"actor","description":"A member, an agent or the system."},"actorId":{"description":"The actor's id: look it up in the organization's directory.","$ref":"#/components/schemas/ActorId"}},"required":["kind","actorId"]},{"type":"object","properties":{"kind":{"type":"string","const":"guest","description":"A guest reviewing through an approval link."},"guestContactId":{"description":"The guest's contact id.","$ref":"#/components/schemas/GuestContactId"},"name":{"type":"string","description":"The guest's name."},"verified":{"description":"On a guest's comment: whether the link's recipient wrote it after confirming their email with the one-time code (false for anyone who only gave a name). Absent elsewhere.","type":"boolean"}},"required":["kind","guestContactId","name"]}]},"BadgeCount":{"type":"integer","minimum":0,"maximum":9007199254740991},"Block":{"oneOf":[{"$ref":"#/components/schemas/TableCardBlock"},{"$ref":"#/components/schemas/MediaGalleryBlock"}]},"BlockAddedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"provisional","description":"A provisional event: live progress, such as an agent reply being written. Never stored or replayed."},"turnId":{"description":"The agent turn the progress belongs to.","$ref":"#/components/schemas/TurnId"},"attempt":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"The attempt of the turn, from 1; it grows each time the turn starts again."},"index":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"A counter per turn attempt, from 1, to drop repeats and notice gaps."},"emittedAt":{"description":"When the server sent it.","$ref":"#/components/schemas/IsoDateTime"},"type":{"type":"string","const":"block.added","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"type":"object","properties":{"messageId":{"description":"The id the reply being written will have.","$ref":"#/components/schemas/MessageId"},"position":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Where the block sits, as a character position in the reply's text."},"block":{"description":"The table card or media gallery.","$ref":"#/components/schemas/Block"}},"required":["messageId","position","block"],"description":"What the event carries; for a change, the object as it is after it."}},"required":["v","kind","turnId","attempt","index","emittedAt","type","payload"]},"BlockId":{"type":"string","pattern":"^blk_[0-9a-hjkmnp-tv-z]{26}$"},"BlockPart":{"type":"object","properties":{"type":{"type":"string","const":"block","description":"A table card or a media gallery an agent placed in its reply."},"block":{"description":"The block: a live view of table rows, or a gallery of files.","$ref":"#/components/schemas/Block"}},"required":["type","block"]},"BudgetPeriod":{"type":"string","enum":["day","month","chain"]},"BudgetState":{"type":"string","enum":["ok","warning","exceeded"]},"BulkRecordResult":{"type":"object","properties":{"index":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"The record's place in the request's `records`, counting from 0."},"outcome":{"type":"string","enum":["created","updated"],"description":"`created`: a new record was added; `updated`: an existing record took the cells sent."},"recordId":{"description":"The id of the record created or updated.","$ref":"#/components/schemas/RecordId"}},"required":["index","outcome","recordId"]},"BulkRecordsResult":{"type":"object","properties":{"results":{"maxItems":500,"type":"array","items":{"$ref":"#/components/schemas/BulkRecordResult"},"description":"One result per record sent, in the order of the request."}},"required":["results"]},"CancelTurnResult":{"type":"object","properties":{"turn":{"description":"The turn: `cancelled`, or still running with `cancelRequestedAt` set until it ends.","$ref":"#/components/schemas/Turn"}},"required":["turn"]},"CannotDecideReason":{"type":"string","enum":["not_allowed","not_in_thread","agent"]},"CaptureCamera":{"type":"string","enum":["front","back"]},"CaptureMethod":{"oneOf":[{"$ref":"#/components/schemas/PhotoCapture"},{"$ref":"#/components/schemas/VideoCapture"},{"$ref":"#/components/schemas/AudioCapture"}]},"CardAggregate":{"type":"object","properties":{"columnId":{"description":"The column totaled.","$ref":"#/components/schemas/ColumnId"},"fn":{"description":"How the column is totaled: `sum`, `avg`, `min`, `max` or `count`.","$ref":"#/components/schemas/AggregateFn"}},"required":["columnId","fn"]},"CardAggregateValue":{"type":"object","properties":{"columnId":{"description":"The column totaled.","$ref":"#/components/schemas/ColumnId"},"fn":{"description":"How the column is totaled: `sum`, `avg`, `min`, `max` or `count`.","$ref":"#/components/schemas/AggregateFn"},"value":{"description":"The result; null when no row has a value.","type":["number","null"]}},"required":["columnId","fn","value"]},"CardFooter":{"oneOf":[{"$ref":"#/components/schemas/RequestFooter"},{"$ref":"#/components/schemas/ChoiceFooter"}]},"CellValue":{"anyOf":[{"type":"string","maxLength":10000},{"type":"number"},{"type":"boolean"},{"type":"array","items":{"anyOf":[{"$ref":"#/components/schemas/SelectOptionId"},{"$ref":"#/components/schemas/RecordId"},{"$ref":"#/components/schemas/FileId"},{"$ref":"#/components/schemas/PersonActorId"}]}},{"type":"null"}]},"Chain":{"type":"object","properties":{"id":{"description":"The chain's id.","$ref":"#/components/schemas/ChainId"},"organizationId":{"description":"The organization the chain belongs to.","$ref":"#/components/schemas/OrganizationId"},"origin":{"description":"What started the chain: a person's message, a flow run, a flow moving a record's date, or a tool result delivered later.","$ref":"#/components/schemas/ChainOrigin"},"initiatorId":{"description":"The member the chain acts for: whose message started it, for a flow run or a flow's date move the flow's owner, or for a delivered tool result the initiator of the chain whose turn made the call.","$ref":"#/components/schemas/MemberId"},"agentPath":{"type":"array","items":{"$ref":"#/components/schemas/AgentId"},"description":"Every agent that took part, in the order they joined."},"parentChainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"For a flow run started from inside another chain, that chain; null for a root chain, such as every chain a message starts."},"rootChainId":{"description":"The first chain of its line, this chain's own id for a root chain; turn and budget limits count there.","$ref":"#/components/schemas/ChainId"},"lineageFlowIds":{"type":"array","items":{"$ref":"#/components/schemas/FlowId"},"description":"The flows in the chain's line, root first; a flow listed here is not started again. Empty for a chain a message started."},"status":{"description":"`active` until it ends; `completed` once none of its turns is open, or for a flow run's chain once the run ended; `stopped` instead when a limit, a kill switch or lost access stopped it, as `stopReason` says.","$ref":"#/components/schemas/ChainStatus"},"stopReason":{"anyOf":[{"$ref":"#/components/schemas/ChainStopReason"},{"type":"null"}],"description":"Why it stopped: `max_depth`, `max_turns`, `budget`, `loop` (an agent mentioned one of the agents that called it, directly or further up), `agents_paused` or `access_revoked`; null unless stopped."},"limits":{"description":"The limits all its turns share, copied from the organization's AI limits when it started; a chain started inside another takes its root chain's.","$ref":"#/components/schemas/ChainLimits"},"turnCount":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many turns the chain has started."},"maxDepthReached":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"The deepest turn depth the chain has reached."},"costMicros":{"anyOf":[{"$ref":"#/components/schemas/Micros"},{"type":"null"}],"description":"What its turns cost, in millionths of a US dollar; null for anyone but the organization's owner and admins."},"createdAt":{"description":"When the chain started.","$ref":"#/components/schemas/IsoDateTime"},"endedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}],"description":"When it completed or stopped; null while active."},"revision":{"description":"Grows by one on every change to the chain.","$ref":"#/components/schemas/Revision"}},"required":["id","organizationId","origin","initiatorId","agentPath","parentChainId","rootChainId","lineageFlowIds","status","stopReason","limits","turnCount","maxDepthReached","costMicros","createdAt","endedAt","revision"]},"ChainDetail":{"type":"object","properties":{"chain":{"description":"The chain.","$ref":"#/components/schemas/Chain"},"turns":{"type":"array","items":{"$ref":"#/components/schemas/Turn"},"description":"Its turns in the order they were queued; each turn's `chain.parentTurnId` tells who called whom."}},"required":["chain","turns"]},"ChainId":{"type":"string","pattern":"^chain_[0-9a-hjkmnp-tv-z]{26}$"},"ChainLimits":{"type":"object","properties":{"maxDepth":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"How deep its turns may go: 1 lets no agent call another, 3 allows two hops. A deeper mention stops the chain."},"maxTurns":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"How many turns the chain may start, across all its agents; one more stops it."},"budgetMicros":{"anyOf":[{"$ref":"#/components/schemas/Micros"},{"type":"null"}],"description":"The most the chain may spend, in millionths of a US dollar; null for no limit."}},"required":["maxDepth","maxTurns","budgetMicros"]},"ChainOrigin":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"message","description":"A person's message started the chain."},"messageId":{"description":"The message.","$ref":"#/components/schemas/MessageId"},"thread":{"description":"Where the message was posted.","$ref":"#/components/schemas/ThreadRef"}},"required":["kind","messageId","thread"]},{"type":"object","properties":{"kind":{"type":"string","const":"flow_run","description":"A flow run started the chain."},"flowRunId":{"description":"The flow run.","$ref":"#/components/schemas/FlowRunId"}},"required":["kind","flowRunId"]},{"type":"object","properties":{"kind":{"type":"string","const":"flow","description":"A flow started the chain to move a record's date on when no run of it started."},"flowId":{"description":"The flow.","$ref":"#/components/schemas/FlowId"}},"required":["kind","flowId"]},{"type":"object","properties":{"kind":{"type":"string","const":"tool_result","description":"The result of an agent's earlier tool call, delivered later by the outside server, started it."},"toolResultId":{"description":"The tool result.","$ref":"#/components/schemas/ToolResultId"}},"required":["kind","toolResultId"]}]},"ChainStatus":{"type":"string","enum":["active","completed","stopped"]},"ChainStoppedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"chain.stopped","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"type":"object","properties":{"chain":{"description":"The stopped chain, with its `stopReason`.","$ref":"#/components/schemas/Chain"}},"required":["chain"],"description":"What the event carries; for a change, the object as it is after it."}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"ChainStoppedNotice":{"type":"object","properties":{"code":{"type":"string","const":"chain_stopped","description":"A chain of agent turns stopped before it finished."},"chainId":{"description":"The chain that stopped.","$ref":"#/components/schemas/ChainId"},"reason":{"description":"Why it stopped, such as `max_turns` or `agents_paused`.","$ref":"#/components/schemas/ChainStopReason"},"agentId":{"anyOf":[{"$ref":"#/components/schemas/AgentId"},{"type":"null"}],"description":"The agent whose turn hit the limit; null when no single agent did, as when agents are paused."}},"required":["code","chainId","reason","agentId"]},"ChainStopReason":{"type":"string","enum":["max_depth","max_turns","budget","loop","agents_paused","access_revoked"]},"ChangeColumnTypeBody":{"type":"object","properties":{"settings":{"description":"The new type and its settings; settings left out take their defaults, except that a select column keeps its options when it becomes a multi-select, and the other way round.","$ref":"#/components/schemas/ColumnSettingsInput"},"onIncompatible":{"description":"What happens to values that do not convert: `reject` fails the change with `409 column_conversion_failed`; `clear` empties them.","$ref":"#/components/schemas/OnIncompatible"},"dryRun":{"type":"boolean","description":"Set to `true` to get the report without changing anything."},"expectedRevision":{"description":"The `revision` you read. If the object changed since, the answer is `409 revision_conflict` and nothing changes.","$ref":"#/components/schemas/Revision"}},"required":["settings","onIncompatible","dryRun","expectedRevision"],"additionalProperties":false},"ChangeColumnTypeResult":{"type":"object","properties":{"column":{"anyOf":[{"$ref":"#/components/schemas/Column"},{"type":"null"}],"description":"The column after the change; null on a dry run."},"report":{"description":"What the change does to the values: how many convert, are emptied or fail, with samples.","$ref":"#/components/schemas/ColumnChangeReport"}},"required":["column","report"]},"ChangeMemorySubjectBody":{"type":"object","properties":{"subject":{"description":"What it is about now: `{ scope: \"org\" }`, a record, an agent or a table, by its id.","$ref":"#/components/schemas/MemorySubjectInput"},"expectedRevision":{"description":"The `revision` you read. If the object changed since, the answer is `409 revision_conflict` and nothing changes.","$ref":"#/components/schemas/Revision"}},"required":["subject","expectedRevision"],"additionalProperties":false},"Chat":{"type":"object","properties":{"id":{"description":"The chat's id.","$ref":"#/components/schemas/ChatId"},"name":{"type":"string","minLength":1,"maxLength":120,"description":"The chat's name, as the chat list and the chat's header show it."},"visibility":{"description":"`organization`: every member of the organization can open it; `private`: only the people and agents given access, and the organization's owner and admins.","$ref":"#/components/schemas/Visibility"},"lastActivityAt":{"description":"When the chat last got a message, or was created; the chat list is sorted by it, newest first.","$ref":"#/components/schemas/IsoDateTime"},"createdAt":{"description":"When the chat was created.","$ref":"#/components/schemas/IsoDateTime"},"organizationId":{"description":"The organization the chat belongs to.","$ref":"#/components/schemas/OrganizationId"},"about":{"type":"string","maxLength":2000,"description":"The chat's description, up to 2,000 characters; empty when nobody wrote one."},"ownerId":{"description":"The member who owns the chat; always a person, never an agent.","$ref":"#/components/schemas/MemberId"},"createdBy":{"description":"The member or agent who created the chat.","$ref":"#/components/schemas/ActorId"},"autoTitled":{"type":"boolean","description":"Whether the chat still has the title it got automatically from its first message; a rename sets `false`."},"messageCount":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many messages the chat holds, system lines included; `chat.activity` events carry the new count."},"agentIds":{"type":"array","items":{"$ref":"#/components/schemas/AgentId"},"description":"The agents with their own access to the chat; an agent that replies without joining is not listed."},"agentsPaused":{"type":"boolean","description":"Whether the agents in this chat are paused; while `true`, mentions start no agent turns."},"agentsPausedBy":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"The member who paused the agents; null while they are not paused."},"agentsPausedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}],"description":"When the agents were paused; null while they are not paused."},"accessSummary":{"description":"How many people and agents have access to the chat, as its header shows it.","$ref":"#/components/schemas/AccessSummary"},"updatedAt":{"description":"When the chat's own fields last changed; a new message does not change it.","$ref":"#/components/schemas/IsoDateTime"},"revision":{"description":"Grows by one on every change to the chat but a new message; send it back as `expectedRevision` when you update it.","$ref":"#/components/schemas/Revision"},"lastMessage":{"anyOf":[{"$ref":"#/components/schemas/ChatLastMessage"},{"type":"null"}],"description":"The chat's newest message by a person or an agent, for the chat list's second line; null while it has none. System lines are never shown here."},"myAccess":{"description":"What the caller may do with the chat: their access level and actions, such as `share`, `delete` or `pause_agents`.","$ref":"#/components/schemas/MyAccess"}},"required":["id","name","visibility","lastActivityAt","createdAt","organizationId","about","ownerId","createdBy","autoTitled","messageCount","agentIds","agentsPaused","agentsPausedBy","agentsPausedAt","accessSummary","updatedAt","revision","lastMessage","myAccess"]},"ChatActivityEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"chat.activity","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"type":"object","properties":{"chatId":{"description":"The chat that got a message.","$ref":"#/components/schemas/ChatId"},"lastActivityAt":{"description":"The chat's new last activity; keep the later of this and the value you hold.","$ref":"#/components/schemas/IsoDateTime"},"messageId":{"description":"The new message.","$ref":"#/components/schemas/MessageId"},"messageCount":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"How many messages the chat now holds; keep the higher of this and the value you hold."},"lastMessage":{"description":"The new message as the chat list's second line shows it: put it on the row when it is newer than the row's own. Null for a system line, which the list never shows: keep the row's own. Absent on older events: then read the list again when `messageId` is not the row's last message.","anyOf":[{"$ref":"#/components/schemas/ChatLastMessage"},{"type":"null"}]}},"required":["chatId","lastActivityAt","messageId","messageCount"],"description":"What the event carries; for a change, the object as it is after it."}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"ChatCreatedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"chat.created","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"type":"object","properties":{"chat":{"description":"The new chat, as the chat list shows it.","$ref":"#/components/schemas/ChatSummary"}},"required":["chat"],"description":"What the event carries; for a change, the object as it is after it."}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"ChatDeletedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"chat.deleted","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"type":"object","properties":{"chatId":{"description":"The deleted chat.","$ref":"#/components/schemas/ChatId"}},"required":["chatId"],"description":"What the event carries; for a change, the object as it is after it."}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"ChatId":{"type":"string","pattern":"^chat_[0-9a-hjkmnp-tv-z]{26}$"},"ChatKnowledge":{"type":"object","properties":{"chatId":{"description":"The chat.","$ref":"#/components/schemas/ChatId"},"loaded":{"description":"What loads before every turn.","$ref":"#/components/schemas/KnowledgeLoaded"},"notLoaded":{"type":"array","items":{"$ref":"#/components/schemas/KnowledgeNotLoaded"},"description":"The viewer's memories in this chat's scopes that do not load, each with why."},"elsewhere":{"description":"The viewer's memories that load in other chats only.","$ref":"#/components/schemas/KnowledgeElsewhere"},"suggestionsWaiting":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"The suggested memories about this chat's scopes that the viewer decides: what Memory's Needs you lists for them."}},"required":["chatId","loaded","notLoaded","elsewhere","suggestionsWaiting"]},"ChatLastMessage":{"type":"object","properties":{"messageId":{"description":"The message's id. `chat.activity` carries the new last message; when one without it names another message, read the list again.","$ref":"#/components/schemas/MessageId"},"authorId":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"$ref":"#/components/schemas/AgentId"}],"description":"The member or agent who wrote it; look the name up in the organization's directory."},"excerpt":{"anyOf":[{"type":"string","minLength":1,"maxLength":160},{"type":"null"}],"description":"Its words as one line of plain text, Markdown removed and each mention as `@` and a name, cut to 160 characters ending in `…`; null when it has no words, such as only attachments or a voice note."},"createdAt":{"description":"When it was posted.","$ref":"#/components/schemas/IsoDateTime"}},"required":["messageId","authorId","excerpt","createdAt"]},"ChatListRow":{"type":"object","properties":{"id":{"description":"The chat's id.","$ref":"#/components/schemas/ChatId"},"name":{"type":"string","minLength":1,"maxLength":120,"description":"The chat's name, as the chat list and the chat's header show it."},"visibility":{"description":"`organization`: every member of the organization can open it; `private`: only the people and agents given access, and the organization's owner and admins.","$ref":"#/components/schemas/Visibility"},"lastActivityAt":{"description":"When the chat last got a message, or was created; the chat list is sorted by it, newest first.","$ref":"#/components/schemas/IsoDateTime"},"createdAt":{"description":"When the chat was created.","$ref":"#/components/schemas/IsoDateTime"},"ownerId":{"description":"The member who owns the chat; always a person, never an agent.","$ref":"#/components/schemas/MemberId"},"lastMessage":{"anyOf":[{"$ref":"#/components/schemas/ChatLastMessage"},{"type":"null"}],"description":"The chat's newest message by a person or an agent, for the chat list's second line; null while it has none. System lines are never shown here."},"accessSummary":{"description":"How many people and agents have access to the chat, as its header shows it.","$ref":"#/components/schemas/AccessSummary"},"pinnedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}],"description":"When you pinned the chat, or null when you have not. Pins are your own: nobody else sees them."},"unread":{"type":"boolean","description":"Whether someone else wrote in the chat since you last read it: the chat list's unread dot. Your own: nobody else sees it."},"unreadMentions":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many messages in the chat mention you that you have not seen yet: the chat list's `@` badge. Opening the chat or marking it read clears them, with their notifications."}},"required":["id","name","visibility","lastActivityAt","createdAt","ownerId","lastMessage","accessSummary","pinnedAt","unread","unreadMentions"]},"ChatMemberInput":{"type":"object","properties":{"actorId":{"description":"A member or an agent to give access to the new chat.","$ref":"#/components/schemas/ActorId"},"level":{"description":"Their access level; an agent gets `view` or `edit`, never `manage`. Left out, `view`.","$ref":"#/components/schemas/AccessLevel"}},"required":["actorId"],"additionalProperties":false},"ChatMessagePartsInput":{"minItems":1,"maxItems":64,"type":"array","items":{"$ref":"#/components/schemas/MessagePartInput"},"$ref":"#/components/schemas/MessagePartsInput"},"ChatPin":{"type":"object","properties":{"chatId":{"description":"The pinned chat.","$ref":"#/components/schemas/ChatId"},"pinnedAt":{"description":"When you pinned it: the first time, a second pin changes nothing.","$ref":"#/components/schemas/IsoDateTime"}},"required":["chatId","pinnedAt"]},"ChatPinnedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"chat.pinned","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"type":"object","properties":{"chatId":{"description":"The chat pinned.","$ref":"#/components/schemas/ChatId"},"pinnedAt":{"description":"When it was pinned.","$ref":"#/components/schemas/IsoDateTime"}},"required":["chatId","pinnedAt"],"description":"What the event carries; for a change, the object as it is after it."}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"ChatReadEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"chat.read","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"type":"object","properties":{"chatId":{"description":"The chat read.","$ref":"#/components/schemas/ChatId"},"lastReadAt":{"description":"When the newest message the member has seen was posted.","$ref":"#/components/schemas/IsoDateTime"},"lastReadMessageId":{"anyOf":[{"$ref":"#/components/schemas/MessageId"},{"type":"null"}],"description":"That message; null for a chat without one."},"unreadMentions":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"The member's unread mentions left in the chat."}},"required":["chatId","lastReadAt","lastReadMessageId","unreadMentions"],"description":"What the event carries; for a change, the object as it is after it."}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"ChatReadMark":{"type":"object","properties":{"chatId":{"description":"The chat.","$ref":"#/components/schemas/ChatId"},"lastReadAt":{"description":"When the newest message you have seen in the chat was posted. A mark never moves back.","$ref":"#/components/schemas/IsoDateTime"},"lastReadMessageId":{"anyOf":[{"$ref":"#/components/schemas/MessageId"},{"type":"null"}],"description":"That message; null when the chat had none when you read it."},"unreadMentions":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many messages in the chat mention you that you have not seen yet: the chat list's `@` badge. Opening the chat or marking it read clears them, with their notifications."}},"required":["chatId","lastReadAt","lastReadMessageId","unreadMentions"]},"ChatStreamEvent":{"oneOf":[{"$ref":"#/components/schemas/StreamReadyEvent"},{"$ref":"#/components/schemas/StreamReplayedEvent"},{"$ref":"#/components/schemas/StreamResetEvent"},{"$ref":"#/components/schemas/StreamClosedEvent"},{"$ref":"#/components/schemas/MessageCreatedEvent"},{"$ref":"#/components/schemas/MessageUpdatedEvent"},{"$ref":"#/components/schemas/TurnQueuedEvent"},{"$ref":"#/components/schemas/TurnStartedEvent"},{"$ref":"#/components/schemas/TurnAwaitingApprovalEvent"},{"$ref":"#/components/schemas/TurnAwaitingTeamEvent"},{"$ref":"#/components/schemas/TurnAwaitingAnswerEvent"},{"$ref":"#/components/schemas/TurnAwaitingTimeEvent"},{"$ref":"#/components/schemas/TurnRequeuedEvent"},{"$ref":"#/components/schemas/TurnCancelRequestedEvent"},{"$ref":"#/components/schemas/TurnEndedEvent"},{"$ref":"#/components/schemas/ChainStoppedEvent"},{"$ref":"#/components/schemas/RequestCreatedEvent"},{"$ref":"#/components/schemas/RequestUpdatedEvent"},{"$ref":"#/components/schemas/AccessChangedEvent"},{"$ref":"#/components/schemas/ChatThreadUpdatedEvent"},{"$ref":"#/components/schemas/ChatDeletedEvent"},{"$ref":"#/components/schemas/TurnSnapshotEvent"},{"$ref":"#/components/schemas/TurnStageEvent"},{"$ref":"#/components/schemas/TextDeltaEvent"},{"$ref":"#/components/schemas/ToolActivityEvent"},{"$ref":"#/components/schemas/BlockAddedEvent"}]},"ChatSummary":{"type":"object","properties":{"id":{"description":"The chat's id.","$ref":"#/components/schemas/ChatId"},"name":{"type":"string","minLength":1,"maxLength":120,"description":"The chat's name, as the chat list and the chat's header show it."},"visibility":{"description":"`organization`: every member of the organization can open it; `private`: only the people and agents given access, and the organization's owner and admins.","$ref":"#/components/schemas/Visibility"},"lastActivityAt":{"description":"When the chat last got a message, or was created; the chat list is sorted by it, newest first.","$ref":"#/components/schemas/IsoDateTime"},"createdAt":{"description":"When the chat was created.","$ref":"#/components/schemas/IsoDateTime"}},"required":["id","name","visibility","lastActivityAt","createdAt"]},"ChatThreadUpdatedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"chat.updated","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"type":"object","properties":{"chat":{"description":"The whole chat after the change, without the caller's access: read the chat again for that.","$ref":"#/components/schemas/ChatWithoutAccess"}},"required":["chat"],"description":"What the event carries; for a change, the object as it is after it."}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"ChatUnpinnedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"chat.unpinned","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"type":"object","properties":{"chatId":{"description":"The chat unpinned.","$ref":"#/components/schemas/ChatId"}},"required":["chatId"],"description":"What the event carries; for a change, the object as it is after it."}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"ChatUpdatedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"chat.updated","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"type":"object","properties":{"chat":{"description":"The chat after the change, as the chat list shows it.","$ref":"#/components/schemas/ChatSummary"}},"required":["chat"],"description":"What the event carries; for a change, the object as it is after it."}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"ChatWithoutAccess":{"type":"object","properties":{"id":{"description":"The chat's id.","$ref":"#/components/schemas/ChatId"},"name":{"type":"string","minLength":1,"maxLength":120,"description":"The chat's name, as the chat list and the chat's header show it."},"visibility":{"description":"`organization`: every member of the organization can open it; `private`: only the people and agents given access, and the organization's owner and admins.","$ref":"#/components/schemas/Visibility"},"lastActivityAt":{"description":"When the chat last got a message, or was created; the chat list is sorted by it, newest first.","$ref":"#/components/schemas/IsoDateTime"},"createdAt":{"description":"When the chat was created.","$ref":"#/components/schemas/IsoDateTime"},"organizationId":{"description":"The organization the chat belongs to.","$ref":"#/components/schemas/OrganizationId"},"about":{"type":"string","maxLength":2000,"description":"The chat's description, up to 2,000 characters; empty when nobody wrote one."},"ownerId":{"description":"The member who owns the chat; always a person, never an agent.","$ref":"#/components/schemas/MemberId"},"createdBy":{"description":"The member or agent who created the chat.","$ref":"#/components/schemas/ActorId"},"autoTitled":{"type":"boolean","description":"Whether the chat still has the title it got automatically from its first message; a rename sets `false`."},"messageCount":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many messages the chat holds, system lines included; `chat.activity` events carry the new count."},"agentIds":{"type":"array","items":{"$ref":"#/components/schemas/AgentId"},"description":"The agents with their own access to the chat; an agent that replies without joining is not listed."},"agentsPaused":{"type":"boolean","description":"Whether the agents in this chat are paused; while `true`, mentions start no agent turns."},"agentsPausedBy":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"The member who paused the agents; null while they are not paused."},"agentsPausedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}],"description":"When the agents were paused; null while they are not paused."},"accessSummary":{"description":"How many people and agents have access to the chat, as its header shows it.","$ref":"#/components/schemas/AccessSummary"},"updatedAt":{"description":"When the chat's own fields last changed; a new message does not change it.","$ref":"#/components/schemas/IsoDateTime"},"revision":{"description":"Grows by one on every change to the chat but a new message; send it back as `expectedRevision` when you update it.","$ref":"#/components/schemas/Revision"}},"required":["id","name","visibility","lastActivityAt","createdAt","organizationId","about","ownerId","createdBy","autoTitled","messageCount","agentIds","agentsPaused","agentsPausedBy","agentsPausedAt","accessSummary","updatedAt","revision"]},"CheckboxColumn":{"type":"object","properties":{"id":{"description":"The column's id: the key of its cell in each record's `values`.","$ref":"#/components/schemas/ColumnId"},"tableId":{"description":"The table the column belongs to.","$ref":"#/components/schemas/TableId"},"name":{"type":"string","minLength":1,"maxLength":80,"description":"The column's name, shown in its header."},"position":{"description":"The column's place in the table: columns sort by this key, compared as text.","$ref":"#/components/schemas/FractionalIndex"},"readOnly":{"type":"boolean","description":"Whether only the server writes the column's cells; a record write that sets one answers `400 validation_failed`."},"revision":{"description":"Grows by one with every change to the column; send it as `expectedRevision` to change the column.","$ref":"#/components/schemas/Revision"},"type":{"type":"string","const":"checkbox","description":"The column's type, which decides what its cells hold."}},"required":["id","tableId","name","position","readOnly","revision","type"]},"ChoiceAnswer":{"type":"object","properties":{"optionKey":{"type":"string","minLength":1,"maxLength":40,"description":"The key of the option chosen."},"answeredBy":{"description":"The member who answered.","$ref":"#/components/schemas/MemberId"},"answeredAt":{"description":"When it was answered.","$ref":"#/components/schemas/IsoDateTime"},"replyMessageId":{"description":"The reply the answer posted to the agent that asked.","$ref":"#/components/schemas/MessageId"}},"required":["optionKey","answeredBy","answeredAt","replyMessageId"]},"ChoiceFooter":{"type":"object","properties":{"kind":{"type":"string","const":"choice","description":"A question that only steers the agent: the answer is posted to it as a reply."},"prompt":{"type":"string","minLength":1,"maxLength":300,"description":"The question the agent asks."},"options":{"minItems":2,"maxItems":4,"type":"array","items":{"$ref":"#/components/schemas/ChoiceOption"},"description":"The answers to choose from, 2 to 4."},"answer":{"anyOf":[{"$ref":"#/components/schemas/ChoiceAnswer"},{"type":"null"}],"description":"The answer given; null while the question is open."}},"required":["kind","prompt","options","answer"]},"ChoiceOption":{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":40,"description":"The option's key; send it as `optionKey` to answer."},"label":{"type":"string","minLength":1,"maxLength":40,"description":"The words on the option's button."},"emphasis":{"type":"string","enum":["primary","secondary"],"description":"How the button looks: `primary` is highlighted, `secondary` is plain."}},"required":["key","label","emphasis"]},"ClaimDocEditBody":{"type":"object","properties":{"leaseId":{"description":"The id this open editor names its lease by: a new one to start editing, the same one to keep it.","$ref":"#/components/schemas/DocLeaseId"}},"required":["leaseId"],"additionalProperties":false},"ClearAnnotationsResult":{"type":"object","properties":{"deletedCount":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many annotations were deleted."}},"required":["deletedCount"]},"ClearAnnotationsWhose":{"type":"string","enum":["mine","guests"]},"ClientMetadataDocument":{"type":"object","properties":{"client_id":{"description":"This document's own address, Fleepr's client id.","$ref":"#/components/schemas/Url"},"client_name":{"type":"string","minLength":1,"description":"The name a sign-in page shows: Fleepr."},"client_uri":{"description":"Fleepr's home page.","$ref":"#/components/schemas/Url"},"redirect_uris":{"minItems":1,"type":"array","items":{"$ref":"#/components/schemas/Url"},"description":"Where a sign-in may send the browser back."},"grant_types":{"type":"array","items":{"type":"string"},"description":"`authorization_code` and `refresh_token`."},"response_types":{"type":"array","items":{"type":"string"},"description":"`code`."},"token_endpoint_auth_method":{"type":"string","const":"none","description":"A public client: no client secret."}},"required":["client_id","client_name","client_uri","redirect_uris","grant_types","response_types","token_endpoint_auth_method"]},"ClosureReason":{"type":"string","enum":["expired","turn_cancelled","chain_stopped","tool_changed","target_deleted","authorization_lost","targets_changed"]},"Column":{"oneOf":[{"$ref":"#/components/schemas/TextColumn"},{"$ref":"#/components/schemas/NumberColumn"},{"$ref":"#/components/schemas/DateColumn"},{"$ref":"#/components/schemas/SelectColumn"},{"$ref":"#/components/schemas/MultiSelectColumn"},{"$ref":"#/components/schemas/PersonColumn"},{"$ref":"#/components/schemas/CheckboxColumn"},{"$ref":"#/components/schemas/LinkedRecordColumn"},{"$ref":"#/components/schemas/AttachmentsColumn"},{"$ref":"#/components/schemas/UrlColumn"},{"$ref":"#/components/schemas/EmailColumn"},{"$ref":"#/components/schemas/SystemColumn"}]},"ColumnAddPreview":{"type":"object","properties":{"kind":{"type":"string","const":"column_add","description":"Add a column to a table."},"tableId":{"description":"The table it acts on.","$ref":"#/components/schemas/TableId"},"tableName":{"type":"string","description":"The table's name."},"column":{"description":"The column to add, with its options and the table it links to.","$ref":"#/components/schemas/PreviewNewColumn"}},"required":["kind","tableId","tableName","column"]},"ColumnChangeReport":{"type":"object","properties":{"converted":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many filled cells convert to the new type."},"cleared":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many filled cells lose their value because the new type is a link or attachments column, which starts empty, or a system column, which the server fills."},"failed":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many filled cells do not convert: with `onIncompatible: 'reject'` they stop the change, with `'clear'` they are emptied."},"samples":{"maxItems":10,"type":"array","items":{"$ref":"#/components/schemas/ColumnChangeSample"},"description":"Up to 10 of the values that do not convert, each with the reason."}},"required":["converted","cleared","failed","samples"]},"ColumnChangeSample":{"type":"object","properties":{"recordId":{"description":"The record whose value does not convert.","$ref":"#/components/schemas/RecordId"},"value":{"type":"string","description":"The value as the cell shows it."},"message":{"type":"string","description":"Why the value does not convert to the new type."}},"required":["recordId","value","message"]},"ColumnCreatedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"column.created","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"description":"What the event carries; for a change, the object as it is after it.","$ref":"#/components/schemas/ColumnPayload"}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"ColumnDeletedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"column.deleted","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"description":"What the event carries; for a change, the object as it is after it.","$ref":"#/components/schemas/ColumnPayload"}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"ColumnId":{"type":"string","pattern":"^col_[0-9a-hjkmnp-tv-z]{26}$"},"ColumnInput":{"oneOf":[{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80,"description":"The column's name, shown in its header; up to 80 characters."},"position":{"description":"Where the column goes: a key that sorts, as text, between its neighbors' `position`. Left out, it goes last.","$ref":"#/components/schemas/FractionalIndex"},"type":{"type":"string","const":"text","description":"The column's type, which decides what its cells hold."}},"required":["name","type"],"additionalProperties":false},{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80,"description":"The column's name, shown in its header; up to 80 characters."},"position":{"description":"Where the column goes: a key that sorts, as text, between its neighbors' `position`. Left out, it goes last.","$ref":"#/components/schemas/FractionalIndex"},"type":{"type":"string","const":"number","description":"The column's type, which decides what its cells hold."},"decimals":{"description":"How many decimal places the cells show, 0 to 6. Left out: unchanged, or 0 for a new column or type.","type":"integer","minimum":0,"maximum":6},"format":{"description":"How the cells show their number: `plain` (12,000), `currency` (€12,000) or `percent` (12%). Left out: unchanged, or `plain` for a new column or type.","$ref":"#/components/schemas/NumberFormat"},"currency":{"description":"The ISO 4217 code of the currency the cells show when `format` is `currency`, such as `EUR`. Left out: unchanged, or null for a new column or type.","anyOf":[{"$ref":"#/components/schemas/CurrencyCode"},{"type":"null"}]}},"required":["name","type"],"additionalProperties":false},{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80,"description":"The column's name, shown in its header; up to 80 characters."},"position":{"description":"Where the column goes: a key that sorts, as text, between its neighbors' `position`. Left out, it goes last.","$ref":"#/components/schemas/FractionalIndex"},"type":{"type":"string","const":"date","description":"The column's type, which decides what its cells hold."},"includeTime":{"description":"Whether the cells hold a date and time, rather than a date alone. Left out: unchanged, or false for a new column or type.","type":"boolean"}},"required":["name","type"],"additionalProperties":false},{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80,"description":"The column's name, shown in its header; up to 80 characters."},"position":{"description":"Where the column goes: a key that sorts, as text, between its neighbors' `position`. Left out, it goes last.","$ref":"#/components/schemas/FractionalIndex"},"type":{"type":"string","const":"select","description":"The column's type, which decides what its cells hold."},"options":{"description":"The full list of options, up to 100, in menu order: options listed by id are kept or renamed, options without an id are added, and current options left out are removed. Left out: unchanged, none for a new column, and on a type change from a select or multi-select column, its options. A type change also adds the options its converted values need.","maxItems":100,"type":"array","items":{"$ref":"#/components/schemas/SelectOptionInput"}}},"required":["name","type"],"additionalProperties":false},{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80,"description":"The column's name, shown in its header; up to 80 characters."},"position":{"description":"Where the column goes: a key that sorts, as text, between its neighbors' `position`. Left out, it goes last.","$ref":"#/components/schemas/FractionalIndex"},"type":{"type":"string","const":"multi_select","description":"The column's type, which decides what its cells hold."},"options":{"description":"The full list of options, up to 100, in menu order: options listed by id are kept or renamed, options without an id are added, and current options left out are removed. Left out: unchanged, none for a new column, and on a type change from a select or multi-select column, its options. A type change also adds the options its converted values need.","maxItems":100,"type":"array","items":{"$ref":"#/components/schemas/SelectOptionInput"}}},"required":["name","type"],"additionalProperties":false},{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80,"description":"The column's name, shown in its header; up to 80 characters."},"position":{"description":"Where the column goes: a key that sorts, as text, between its neighbors' `position`. Left out, it goes last.","$ref":"#/components/schemas/FractionalIndex"},"type":{"type":"string","const":"person","description":"The column's type, which decides what its cells hold."}},"required":["name","type"],"additionalProperties":false},{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80,"description":"The column's name, shown in its header; up to 80 characters."},"position":{"description":"Where the column goes: a key that sorts, as text, between its neighbors' `position`. Left out, it goes last.","$ref":"#/components/schemas/FractionalIndex"},"type":{"type":"string","const":"checkbox","description":"The column's type, which decides what its cells hold."}},"required":["name","type"],"additionalProperties":false},{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80,"description":"The column's name, shown in its header; up to 80 characters."},"position":{"description":"Where the column goes: a key that sorts, as text, between its neighbors' `position`. Left out, it goes last.","$ref":"#/components/schemas/FractionalIndex"},"type":{"type":"string","const":"linked_record","description":"The column's type, which decides what its cells hold."},"targetTableId":{"description":"The table whose records the cells link to, sent every time, even when only `multiple` changes.","$ref":"#/components/schemas/TableId"},"multiple":{"description":"Whether a cell may link several records. Left out: unchanged, or false for a new column or type.","type":"boolean"}},"required":["name","type","targetTableId"],"additionalProperties":false},{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80,"description":"The column's name, shown in its header; up to 80 characters."},"position":{"description":"Where the column goes: a key that sorts, as text, between its neighbors' `position`. Left out, it goes last.","$ref":"#/components/schemas/FractionalIndex"},"type":{"type":"string","const":"attachments","description":"The column's type, which decides what its cells hold."}},"required":["name","type"],"additionalProperties":false},{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80,"description":"The column's name, shown in its header; up to 80 characters."},"position":{"description":"Where the column goes: a key that sorts, as text, between its neighbors' `position`. Left out, it goes last.","$ref":"#/components/schemas/FractionalIndex"},"type":{"type":"string","const":"url","description":"The column's type, which decides what its cells hold."}},"required":["name","type"],"additionalProperties":false},{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80,"description":"The column's name, shown in its header; up to 80 characters."},"position":{"description":"Where the column goes: a key that sorts, as text, between its neighbors' `position`. Left out, it goes last.","$ref":"#/components/schemas/FractionalIndex"},"type":{"type":"string","const":"email","description":"The column's type, which decides what its cells hold."}},"required":["name","type"],"additionalProperties":false},{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80,"description":"The column's name, shown in its header; up to 80 characters."},"position":{"description":"Where the column goes: a key that sorts, as text, between its neighbors' `position`. Left out, it goes last.","$ref":"#/components/schemas/FractionalIndex"},"type":{"description":"A system column, which the server fills: `created_at` and `updated_at`, when the record was created and last edited; `created_by` and `updated_by`, who did it.","$ref":"#/components/schemas/SystemColumnType"}},"required":["name","type"],"additionalProperties":false}]},"ColumnPayload":{"type":"object","properties":{"table":{"description":"The whole table after the change, with its columns, links and counts.","$ref":"#/components/schemas/TableWithoutAccess"},"columnId":{"description":"The column that was added, changed or deleted.","$ref":"#/components/schemas/ColumnId"}},"required":["table","columnId"]},"ColumnSettingsInput":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"text","description":"The column's type, which decides what its cells hold."}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"number","description":"The column's type, which decides what its cells hold."},"decimals":{"description":"How many decimal places the cells show, 0 to 6. Left out: unchanged, or 0 for a new column or type.","type":"integer","minimum":0,"maximum":6},"format":{"description":"How the cells show their number: `plain` (12,000), `currency` (€12,000) or `percent` (12%). Left out: unchanged, or `plain` for a new column or type.","$ref":"#/components/schemas/NumberFormat"},"currency":{"description":"The ISO 4217 code of the currency the cells show when `format` is `currency`, such as `EUR`. Left out: unchanged, or null for a new column or type.","anyOf":[{"$ref":"#/components/schemas/CurrencyCode"},{"type":"null"}]}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"date","description":"The column's type, which decides what its cells hold."},"includeTime":{"description":"Whether the cells hold a date and time, rather than a date alone. Left out: unchanged, or false for a new column or type.","type":"boolean"}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"select","description":"The column's type, which decides what its cells hold."},"options":{"description":"The full list of options, up to 100, in menu order: options listed by id are kept or renamed, options without an id are added, and current options left out are removed. Left out: unchanged, none for a new column, and on a type change from a select or multi-select column, its options. A type change also adds the options its converted values need.","maxItems":100,"type":"array","items":{"$ref":"#/components/schemas/SelectOptionInput"}}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"multi_select","description":"The column's type, which decides what its cells hold."},"options":{"description":"The full list of options, up to 100, in menu order: options listed by id are kept or renamed, options without an id are added, and current options left out are removed. Left out: unchanged, none for a new column, and on a type change from a select or multi-select column, its options. A type change also adds the options its converted values need.","maxItems":100,"type":"array","items":{"$ref":"#/components/schemas/SelectOptionInput"}}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"person","description":"The column's type, which decides what its cells hold."}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"checkbox","description":"The column's type, which decides what its cells hold."}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"linked_record","description":"The column's type, which decides what its cells hold."},"targetTableId":{"description":"The table whose records the cells link to, sent every time, even when only `multiple` changes.","$ref":"#/components/schemas/TableId"},"multiple":{"description":"Whether a cell may link several records. Left out: unchanged, or false for a new column or type.","type":"boolean"}},"required":["type","targetTableId"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"attachments","description":"The column's type, which decides what its cells hold."}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"url","description":"The column's type, which decides what its cells hold."}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"email","description":"The column's type, which decides what its cells hold."}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"description":"A system column, which the server fills: `created_at` and `updated_at`, when the record was created and last edited; `created_by` and `updated_by`, who did it.","$ref":"#/components/schemas/SystemColumnType"}},"required":["type"],"additionalProperties":false}]},"ColumnType":{"type":"string","enum":["text","number","date","select","multi_select","person","checkbox","linked_record","attachments","url","email","created_at","created_by","updated_at","updated_by"]},"ColumnTypeChangedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"column.type_changed","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"description":"What the event carries; for a change, the object as it is after it.","$ref":"#/components/schemas/ColumnPayload"}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"ColumnUpdatedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"column.updated","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"description":"What the event carries; for a change, the object as it is after it.","$ref":"#/components/schemas/ColumnPayload"}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"ColumnUpdatePreview":{"type":"object","properties":{"kind":{"type":"string","const":"column_update","description":"Change a column of a table."},"tableId":{"description":"The table it acts on.","$ref":"#/components/schemas/TableId"},"tableName":{"type":"string","description":"The table's name."},"columnId":{"description":"The column it changes.","$ref":"#/components/schemas/ColumnId"},"columnName":{"type":"string","description":"The column's name now."},"columnType":{"description":"The column's type, which the change keeps.","$ref":"#/components/schemas/ColumnType"},"changes":{"minItems":1,"maxItems":10,"type":"array","items":{"$ref":"#/components/schemas/PreviewSettingChange"},"description":"Every setting it changes, in order."}},"required":["kind","tableId","tableName","columnId","columnName","columnType","changes"]},"CommentPostPreview":{"type":"object","properties":{"kind":{"type":"string","const":"comment_post","description":"Comment on a file."},"fileId":{"description":"The file it acts on.","$ref":"#/components/schemas/FileId"},"fileName":{"type":"string","description":"The file's name."},"text":{"type":"string","description":"The comment to post."}},"required":["kind","fileId","fileName","text"]},"CommentResolution":{"type":"object","properties":{"at":{"description":"When it was resolved.","$ref":"#/components/schemas/IsoDateTime"},"by":{"description":"Who resolved it: a member, or a guest reviewing through an approval link.","$ref":"#/components/schemas/AuthorRef"}},"required":["at","by"]},"CompleteUploadBody":{"type":"object","properties":{},"additionalProperties":false},"CompleteUploadResult":{"type":"object","properties":{"upload":{"description":"The upload, now `uploaded`; its `checksumSha256` stays null until the server has computed it.","$ref":"#/components/schemas/Upload"},"file":{"anyOf":[{"$ref":"#/components/schemas/FileSummary"},{"type":"null"}],"description":"The file an `attachment` became, its previews still being made; null for any other purpose, or once the caller may no longer view it."}},"required":["upload","file"]},"ConfirmEmailChangeBody":{"type":"object","properties":{"token":{"type":"string","minLength":1,"maxLength":512,"description":"The token from one of the email change's links."}},"required":["token"],"additionalProperties":false},"ConfirmEmailChangeResult":{"oneOf":[{"type":"object","properties":{"status":{"type":"string","const":"awaiting_other_link","description":"This link worked; the link sent to the other address is still to be used, so nothing changed yet."}},"required":["status"]},{"type":"object","properties":{"status":{"type":"string","const":"changed","description":"Both links are used and the sign-in address has changed."},"email":{"description":"The address the user signs in with from now on.","$ref":"#/components/schemas/Email"}},"required":["status","email"]}]},"ConfirmPasswordResetBody":{"type":"object","properties":{"token":{"type":"string","minLength":1,"maxLength":512,"description":"The token from the password reset email's link."},"password":{"description":"The new password, which replaces the current one.","$ref":"#/components/schemas/NewPassword"},"revokeApiKeys":{"description":"Also revoke every API key the account made, in every organization, so they stop working at once. Leave it out (or false) to keep them.","type":"boolean"},"pauseWebhooks":{"description":"Also turn off every webhook the account added or last pointed at a new address, in every organization. Leave it out (or false) to keep them.","type":"boolean"}},"required":["token","password"],"additionalProperties":false},"ConfirmSignInCodeBody":{"type":"object","properties":{"code":{"type":"string","pattern":"^[0-9]{6}$","description":"The 6 digits the email gave."}},"required":["code"],"additionalProperties":false},"ConfirmSignInCodeResult":{"type":"object","properties":{"recentUntil":{"description":"Until when this session counts as a recent sign-in.","$ref":"#/components/schemas/IsoDateTime"}},"required":["recentUntil"]},"ConnectBody":{"oneOf":[{"type":"object","properties":{"connectorKey":{"description":"`google_drive` or `meta_ads`: connectors that take a pasted credential.","$ref":"#/components/schemas/CredentialConnectorKey"},"name":{"description":"The connection's name, up to 80 characters; left out, the connector's name.","$ref":"#/components/schemas/ConnectionName"},"credential":{"description":"The credential, never returned: a Google service account's JSON key file, or a Meta system user token. Up to 16 KB.","$ref":"#/components/schemas/ConnectorCredential"}},"required":["connectorKey","credential"],"additionalProperties":false},{"type":"object","properties":{"connectorKey":{"type":"string","const":"mcp","description":"`mcp`: a remote MCP server."},"name":{"description":"The server's name, unique in the organization, up to 80 characters.","$ref":"#/components/schemas/ConnectionName"},"mcp":{"description":"The server's address, transport and headers.","$ref":"#/components/schemas/McpConnectInput"}},"required":["connectorKey","name","mcp"],"additionalProperties":false}]},"Connection":{"type":"object","properties":{"id":{"description":"The connection's id.","$ref":"#/components/schemas/ConnectionId"},"organizationId":{"description":"The organization the connection belongs to.","$ref":"#/components/schemas/OrganizationId"},"connectorKey":{"description":"The connector it connects: `google_drive`, `meta_ads`, or `mcp` for a remote MCP server.","$ref":"#/components/schemas/ConnectorKey"},"name":{"description":"The connection's name, unique in the organization, up to 80 characters.","$ref":"#/components/schemas/ConnectionName"},"status":{"description":"`pending_auth`: waiting for its first check; `connected`: working; `error`: the last check failed; `paused`: its owner can no longer act; `disconnected`: stopped. Only `connected` offers tools to agents.","$ref":"#/components/schemas/ConnectionStatus"},"pausedReason":{"anyOf":[{"$ref":"#/components/schemas/ConnectionPausedReason"},{"type":"null"}],"description":"Why it paused: its owner was removed (`owner_deactivated`) or made a viewer (`owner_made_viewer`); null unless paused."},"pausedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}],"description":"When it paused; null unless its status is `paused`."},"health":{"description":"Its last check, its last success and its last failure.","$ref":"#/components/schemas/ConnectionHealth"},"externalAccount":{"anyOf":[{"$ref":"#/components/schemas/ExternalAccount"},{"type":"null"}],"description":"The account on the service's side, such as the Google service account to share Drive folders with; null before it is known and for MCP servers."},"mcp":{"anyOf":[{"$ref":"#/components/schemas/McpConnectionConfig"},{"type":"null"}],"description":"An MCP server's address, transport and header names; null for any other connector."},"agentIds":{"type":"array","items":{"$ref":"#/components/schemas/AgentId"},"description":"The agents that may use the connection's tools, each only while it works for a member who can see the connection too; only the agents the caller may view are listed, and a save keeps the others."},"ownerId":{"description":"The member who owns the connection; it runs with their access and pauses when they cannot act.","$ref":"#/components/schemas/MemberId"},"createdBy":{"description":"Who created the connection: a member, or an agent through a request card.","$ref":"#/components/schemas/ActorId"},"visibility":{"description":"`organization`: every member may see and use it; `private`: only its owner, the people it is shared with, and the organization's owner and admins. Only its owner and the organization's owner and admins change it.","$ref":"#/components/schemas/Visibility"},"connectedBy":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"The member whose credential or server settings last made the connection work; null until it works."},"connectedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}],"description":"When the connection started working with `connectedBy`'s credential or settings, so it moves when those of another member first work; null until it works."},"credentialSetBy":{"description":"Who stored the credential the connection uses: who pasted it, or for an MCP server who set its most recent header value; null when none is stored.","anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}]},"credentialSetAt":{"description":"When `credentialSetBy` stored it; null when none is stored.","anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"credentialWarning":{"default":null,"description":"Set while someone whose credential or header value the connection still uses was removed or made a viewer: the connection keeps working, and a new one replaces theirs. Null when there is none.","anyOf":[{"$ref":"#/components/schemas/ConnectionCredentialWarning"},{"type":"null"}]},"createdAt":{"description":"When the connection was created.","$ref":"#/components/schemas/IsoDateTime"},"updatedAt":{"description":"When the connection last changed.","$ref":"#/components/schemas/IsoDateTime"},"revision":{"description":"Grows by one on every change to the connection; send it back as `expectedRevision` when you change it.","$ref":"#/components/schemas/Revision"},"myAccess":{"description":"The caller's access level to the connection and the actions it allows.","$ref":"#/components/schemas/MyAccess"}},"required":["id","organizationId","connectorKey","name","status","pausedReason","pausedAt","health","externalAccount","mcp","agentIds","ownerId","createdBy","visibility","connectedBy","connectedAt","credentialWarning","createdAt","updatedAt","revision","myAccess"]},"ConnectionConnectedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"connection.connected","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"type":"object","properties":{"connection":{"description":"The connection after the change, without the caller's access, which a client reads again when needed.","$ref":"#/components/schemas/ConnectionWithoutAccess"}},"required":["connection"],"description":"What the event carries; for a change, the object as it is after it."}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"ConnectionCreatedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"connection.created","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"description":"What the event carries; for a change, the object as it is after it.","$ref":"#/components/schemas/ConnectionPayload"}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"ConnectionCredentialWarning":{"type":"object","properties":{"reason":{"description":"Why: the member who set it was removed (`setter_deactivated`) or made a viewer (`setter_made_viewer`).","$ref":"#/components/schemas/ConnectionCredentialWarningReason"},"memberId":{"description":"The member who set the stored credential, or an MCP server header value, and can no longer act.","$ref":"#/components/schemas/MemberId"},"at":{"description":"When the warning was raised.","$ref":"#/components/schemas/IsoDateTime"}},"required":["reason","memberId","at"]},"ConnectionCredentialWarningReason":{"type":"string","enum":["setter_deactivated","setter_made_viewer"]},"ConnectionDeletedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"connection.deleted","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"description":"What the event carries; for a change, the object as it is after it.","$ref":"#/components/schemas/ConnectionDeletedPayload"}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"ConnectionDeletedPayload":{"type":"object","properties":{"connectionId":{"description":"The id of the deleted connection.","$ref":"#/components/schemas/ConnectionId"}},"required":["connectionId"]},"ConnectionDisconnectedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"connection.disconnected","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"type":"object","properties":{"connection":{"description":"The connection after the change, without the caller's access, which a client reads again when needed.","$ref":"#/components/schemas/ConnectionWithoutAccess"}},"required":["connection"],"description":"What the event carries; for a change, the object as it is after it."}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"ConnectionError":{"type":"object","properties":{"code":{"description":"Why it failed, such as `unauthorized` (the credential was refused), `unreachable`, or `invalid_config` (the stored credential or settings cannot be used, or an MCP server's tools wait for review).","$ref":"#/components/schemas/ConnectionErrorCode"},"message":{"type":"string","description":"What went wrong, in English, safe to show; it never holds a secret."},"at":{"description":"When this failure started; the same failure repeating keeps this time.","$ref":"#/components/schemas/IsoDateTime"}},"required":["code","message","at"]},"ConnectionErrorCode":{"type":"string","enum":["token_expired","refresh_failed","unauthorized","rate_limited","unreachable","egress_blocked","invalid_config","unknown"]},"ConnectionHealth":{"type":"object","properties":{"lastCheckedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}],"description":"When Fleepr last checked the connection; null before the first check."},"lastSuccessAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}],"description":"When a check last succeeded; null when none has yet."},"consecutiveFailures":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many checks failed in a row since the last success; 0 after a success."},"lastError":{"anyOf":[{"$ref":"#/components/schemas/ConnectionError"},{"type":"null"}],"description":"The last failure and why, shown with the red status; null when no check failed since the last success."}},"required":["lastCheckedAt","lastSuccessAt","consecutiveFailures","lastError"]},"ConnectionHealthChangedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"connection.health_changed","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"description":"What the event carries; for a change, the object as it is after it.","$ref":"#/components/schemas/ConnectionPayload"}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"ConnectionId":{"type":"string","pattern":"^conn_[0-9a-hjkmnp-tv-z]{26}$"},"ConnectionName":{"type":"string","minLength":1,"maxLength":80},"ConnectionPausedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"connection.paused","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"type":"object","properties":{"connection":{"description":"The connection after the change, without the caller's access, which a client reads again when needed.","$ref":"#/components/schemas/ConnectionWithoutAccess"}},"required":["connection"],"description":"What the event carries; for a change, the object as it is after it."}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"ConnectionPausedReason":{"type":"string","enum":["owner_deactivated","owner_made_viewer","address_setter_lost_access"]},"ConnectionPayload":{"type":"object","properties":{"connection":{"description":"The connection after the change, without the caller's access, which a client reads again when needed.","$ref":"#/components/schemas/ConnectionWithoutAccess"}},"required":["connection"]},"ConnectionResumedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"connection.resumed","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"type":"object","properties":{"connection":{"description":"The connection after the change, without the caller's access, which a client reads again when needed.","$ref":"#/components/schemas/ConnectionWithoutAccess"}},"required":["connection"],"description":"What the event carries; for a change, the object as it is after it."}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"ConnectionStatus":{"type":"string","enum":["pending_auth","connected","error","paused","disconnected"]},"ConnectionTool":{"type":"object","properties":{"name":{"description":"The tool's name, as the server reports it.","$ref":"#/components/schemas/ConnectionToolName"},"description":{"type":"string","description":"What the tool does, as the server describes it."},"risk":{"description":"How much harm a call can do; every MCP tool is `consequential`, since what it does is not known.","$ref":"#/components/schemas/ToolRisk"},"readOnly":{"type":"boolean","description":"Whether the tool runs without asking; `false`, the default, asks with a confirm card first. The server's own hints never set it."},"parameters":{"maxItems":200,"type":"array","items":{"$ref":"#/components/schemas/ConnectionToolParameter"},"description":"Its inputs as its normalized input schema says them, every word an agent reads; empty for a tool that takes none, and for a connector's own tools."}},"required":["name","description","risk","readOnly","parameters"]},"ConnectionToolList":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/ConnectionTool"},"description":"The connection's tools, one row per tool name."}},"required":["items"]},"ConnectionToolName":{"type":"string","minLength":1,"maxLength":128},"ConnectionToolParameter":{"type":"object","properties":{"path":{"type":"string","minLength":1,"maxLength":1024,"description":"Where the input is: its property name, nested ones joined with `.`, an array's items as `[]`."},"type":{"type":"string","minLength":1,"maxLength":200,"description":"Its JSON type (`string`, `number`, `integer`, `boolean`, `array`, `object`, `null`, `any`), or a union."},"required":{"type":"boolean","description":"Whether the tool requires it."},"description":{"type":"string","maxLength":200,"description":"The server's description of it as an agent reads it (cut to 120 characters); empty for none."},"values":{"maxItems":100,"type":"array","items":{"type":"string","maxLength":128},"description":"The values it lists (an enum); empty for any."},"change":{"anyOf":[{"type":"string","enum":["added","changed","removed"]},{"type":"null"}],"description":"On a changed list, against the pinned tool of the same name: an input added, one whose type, requirement, description or values changed, or one that went; null when it is the same, or nothing is pinned."}},"required":["path","type","required","description","values","change"]},"ConnectionUpdatedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"connection.updated","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"description":"What the event carries; for a change, the object as it is after it.","$ref":"#/components/schemas/ConnectionPayload"}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"ConnectionWithoutAccess":{"type":"object","properties":{"id":{"description":"The connection's id.","$ref":"#/components/schemas/ConnectionId"},"organizationId":{"description":"The organization the connection belongs to.","$ref":"#/components/schemas/OrganizationId"},"connectorKey":{"description":"The connector it connects: `google_drive`, `meta_ads`, or `mcp` for a remote MCP server.","$ref":"#/components/schemas/ConnectorKey"},"name":{"description":"The connection's name, unique in the organization, up to 80 characters.","$ref":"#/components/schemas/ConnectionName"},"status":{"description":"`pending_auth`: waiting for its first check; `connected`: working; `error`: the last check failed; `paused`: its owner can no longer act; `disconnected`: stopped. Only `connected` offers tools to agents.","$ref":"#/components/schemas/ConnectionStatus"},"pausedReason":{"anyOf":[{"$ref":"#/components/schemas/ConnectionPausedReason"},{"type":"null"}],"description":"Why it paused: its owner was removed (`owner_deactivated`) or made a viewer (`owner_made_viewer`); null unless paused."},"pausedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}],"description":"When it paused; null unless its status is `paused`."},"health":{"description":"Its last check, its last success and its last failure.","$ref":"#/components/schemas/ConnectionHealth"},"externalAccount":{"anyOf":[{"$ref":"#/components/schemas/ExternalAccount"},{"type":"null"}],"description":"The account on the service's side, such as the Google service account to share Drive folders with; null before it is known and for MCP servers."},"mcp":{"anyOf":[{"$ref":"#/components/schemas/McpConnectionConfig"},{"type":"null"}],"description":"An MCP server's address, transport and header names; null for any other connector."},"agentIds":{"type":"array","items":{"$ref":"#/components/schemas/AgentId"},"description":"The agents that may use the connection's tools, each only while it works for a member who can see the connection too; only the agents the caller may view are listed, and a save keeps the others."},"ownerId":{"description":"The member who owns the connection; it runs with their access and pauses when they cannot act.","$ref":"#/components/schemas/MemberId"},"createdBy":{"description":"Who created the connection: a member, or an agent through a request card.","$ref":"#/components/schemas/ActorId"},"visibility":{"description":"`organization`: every member may see and use it; `private`: only its owner, the people it is shared with, and the organization's owner and admins. Only its owner and the organization's owner and admins change it.","$ref":"#/components/schemas/Visibility"},"connectedBy":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"The member whose credential or server settings last made the connection work; null until it works."},"connectedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}],"description":"When the connection started working with `connectedBy`'s credential or settings, so it moves when those of another member first work; null until it works."},"credentialSetBy":{"description":"Who stored the credential the connection uses: who pasted it, or for an MCP server who set its most recent header value; null when none is stored.","anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}]},"credentialSetAt":{"description":"When `credentialSetBy` stored it; null when none is stored.","anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"credentialWarning":{"default":null,"description":"Set while someone whose credential or header value the connection still uses was removed or made a viewer: the connection keeps working, and a new one replaces theirs. Null when there is none.","anyOf":[{"$ref":"#/components/schemas/ConnectionCredentialWarning"},{"type":"null"}]},"createdAt":{"description":"When the connection was created.","$ref":"#/components/schemas/IsoDateTime"},"updatedAt":{"description":"When the connection last changed.","$ref":"#/components/schemas/IsoDateTime"},"revision":{"description":"Grows by one on every change to the connection; send it back as `expectedRevision` when you change it.","$ref":"#/components/schemas/Revision"}},"required":["id","organizationId","connectorKey","name","status","pausedReason","pausedAt","health","externalAccount","mcp","agentIds","ownerId","createdBy","visibility","connectedBy","connectedAt","credentialWarning","createdAt","updatedAt","revision"]},"ConnectorAuthKind":{"type":"string","enum":["credential","config"]},"ConnectorCategory":{"type":"string","enum":["advertising","crm","files","messaging","payments","custom"]},"ConnectorCredential":{"type":"string","minLength":1,"maxLength":16384},"ConnectorDefinition":{"type":"object","properties":{"key":{"description":"Which service the connector talks to: `google_drive`, `meta_ads`, or `mcp` for a remote MCP server.","$ref":"#/components/schemas/ConnectorKey"},"name":{"type":"string","minLength":1,"description":"The connector's name, such as Google Drive."},"category":{"description":"The kind of service, such as `files` or `advertising`.","$ref":"#/components/schemas/ConnectorCategory"},"description":{"type":"string","description":"What connecting it lets agents do."},"authKind":{"description":"How to connect it: `credential`, paste the organization's credential once; `config`, give an MCP server's address, transport and headers.","$ref":"#/components/schemas/ConnectorAuthKind"},"allowsMultipleConnections":{"type":"boolean","description":"Whether the organization may add several connections to it, as for MCP servers; otherwise one."}},"required":["key","name","category","description","authKind","allowsMultipleConnections"]},"ConnectorKey":{"type":"string","enum":["google_drive","meta_ads","mcp"]},"ConnectorListItem":{"type":"object","properties":{"connector":{"description":"The connector: what it is and how to connect it.","$ref":"#/components/schemas/ConnectorDefinition"},"connections":{"type":"array","items":{"$ref":"#/components/schemas/Connection"},"description":"The organization's connections to it that the caller can see; empty when there are none."}},"required":["connector","connections"]},"ConnectResult":{"type":"object","properties":{"connection":{"description":"The new connection; one with a pasted credential is `pending_auth` until its first check.","$ref":"#/components/schemas/Connection"}},"required":["connection"]},"CreateApiKeyBody":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100,"description":"A name that says where the key is used, such as \"Zapier reports\", up to 100 characters."},"scope":{"description":"`read` to read only, or `read_write` to also write with the caller's permissions; a key that decides needs `read_write`.","$ref":"#/components/schemas/ApiKeyScope"},"expiresAt":{"description":"When the key stops working, in the future; left out or null, it does not expire. Required, within 90 days, for a key that decides.","anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"decides":{"description":"What the key may decide for the caller, each once, fixed for good: `file_approvals`, `flow_sign_offs`, and agents' request cards that act inside Fleepr (`cards_inside`), outside it (`cards_outside`) or delete (`cards_deletes`). Left out or empty, it decides nothing.","maxItems":5,"type":"array","items":{"$ref":"#/components/schemas/ApiKeyDecisionKind"}}},"required":["name","scope"],"additionalProperties":false},"CreateApiKeyResult":{"type":"object","properties":{"apiKey":{"description":"The new key, as the list of keys shows it.","$ref":"#/components/schemas/ApiKey"},"secret":{"anyOf":[{"type":"string","pattern":"^flk_[A-Za-z0-9_-]{43}$"},{"type":"null"}],"description":"The whole key, to send as `Authorization: Bearer <key>`, shown this once: store it now. Null on a replay of the request."}},"required":["apiKey","secret"]},"CreateApprovalLinkBody":{"type":"object","properties":{"fileIds":{"minItems":1,"maxItems":50,"type":"array","items":{"$ref":"#/components/schemas/FileId"},"description":"The files the guest reviews, 1 to 50, each once; the caller needs share access to each."},"recipient":{"description":"The guest the link is for: their email, and their name if you know it.","$ref":"#/components/schemas/ApprovalLinkRecipientInput"},"requireCode":{"description":"Whether the recipient confirms their email with a one-time code before deciding; `true` when left out. With `false`, whoever opens the link reviews as the recipient.","type":"boolean"},"allowOthersToComment":{"description":"Whether anyone else holding the link may view, comment and annotate; `false` when left out.","type":"boolean"},"allowDownload":{"description":"Whether the recipient may download the files, once verified or, on a link that requires no code, once named; `false` when left out.","type":"boolean"},"expiresInDays":{"description":"How many days the link lasts, 1 to 30; 7 when left out.","type":"integer","minimum":1,"maximum":30},"delivery":{"description":"`email`, the default: the server emails the link to the recipient. `none`: it only returns the link, for you to send.","$ref":"#/components/schemas/ApprovalLinkDelivery"},"docPageIds":{"description":"A doc's pages to approve, by id, from `GET /v0/files/{fileId}/doc`; left out for the whole doc. Only with one file, a doc, and only used when the link creates the doc's approval: an approval that exists keeps its pages.","minItems":1,"maxItems":500,"type":"array","items":{"$ref":"#/components/schemas/DocPageId"}}},"required":["fileIds","recipient"],"additionalProperties":false},"CreateApprovalLinkResult":{"type":"object","properties":{"link":{"description":"The new link.","$ref":"#/components/schemas/ApprovalLink"},"url":{"description":"The review page's address for the guest, its secret after the `#`; no other answer holds the secret, not even a replay of this request, so keep it safe.","$ref":"#/components/schemas/Url"}},"required":["link","url"]},"CreateChatBody":{"type":"object","properties":{"name":{"description":"The chat's name, 1 to 120 characters. Left out, the chat is titled from its first message's words, or `New chat` without any.","type":"string","minLength":1,"maxLength":120},"about":{"description":"The chat's description, up to 2,000 characters.","type":"string","maxLength":2000},"visibility":{"description":"Who can open the chat: `organization` for every member of the organization, `private` for only the people and agents given access and the organization's owner and admins.","$ref":"#/components/schemas/Visibility"},"members":{"description":"People and agents to give access from the start. In a private chat, every person the first message mentions must have access to it, such as through `members`.","type":"array","items":{"$ref":"#/components/schemas/ChatMemberInput"}},"inviteEmails":{"description":"Up to 100 email addresses to share the chat with: a member's address gives them view access, any other gets an invite, which only the organization's owner and admins may send.","type":"array","items":{"$ref":"#/components/schemas/Email"}},"firstMessage":{"description":"The chat's first message, posted as the caller's; each agent it mentions gets a turn.","type":"object","properties":{"parts":{"description":"The message's parts in order: text, mentions, attachments and voice notes. Up to 64 parts, 20 mentions, 10 attachments and 5 voice notes, with some text, an attachment or a voice note.","$ref":"#/components/schemas/ChatMessagePartsInput"}},"required":["parts"],"additionalProperties":false}},"required":["visibility"],"additionalProperties":false},"CreateChatResult":{"type":"object","properties":{"chat":{"description":"The new chat.","$ref":"#/components/schemas/Chat"},"message":{"anyOf":[{"$ref":"#/components/schemas/Message"},{"type":"null"}],"description":"The first message; null when none was sent."},"turns":{"type":"array","items":{"$ref":"#/components/schemas/Turn"},"description":"One queued turn for each agent the first message mentions; one that cannot take a turn now, such as a paused agent, gets none."},"included":{"description":"What the first message references: its files, request cards and turns.","$ref":"#/components/schemas/MessageIncluded"}},"required":["chat","message","turns","included"]},"CreateDocBody":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":255,"description":"The doc's name, up to 255 characters, such as `Untitled` for a doc not named yet."},"visibility":{"description":"Who may see the doc: everyone in the organization (`organization`), or only its creator and the organization's owner and admins (`private`).","$ref":"#/components/schemas/Visibility"}},"required":["name","visibility"],"additionalProperties":false},"CreateFileAnnotationBody":{"type":"object","properties":{"page":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"The page to draw on, counting from 0; always 0 for an image, a video or an audio file."},"shape":{"description":"What to draw: a pin, a freehand stroke, a box, an oval or a line.","$ref":"#/components/schemas/Shape"},"timeMs":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}],"description":"The moment of a video to tie the annotation to, in milliseconds, required on a video; send null for any other file."}},"required":["page","shape","timeMs"],"additionalProperties":false},"CreateFormLinkBody":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"public","description":"Turn the public link on."}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"personal","description":"A link for one person."},"recipient":{"description":"Who the link is for.","$ref":"#/components/schemas/FormLinkRecipient"},"prefill":{"description":"Values prefilled for this person, by column id: each a question of the form, never a file question. They win over what the respondent sends. Left out: none.","$ref":"#/components/schemas/RecordValues"},"expiresAt":{"description":"When the link stops working. Left out or null: never.","anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"maxResponses":{"description":"How many responses the link takes. Left out: one; null: no limit (\"Allow more responses\").","anyOf":[{"type":"integer","minimum":1,"maximum":1000000},{"type":"null"}]},"delivery":{"description":"`email`: Fleepr emails the link to `recipient.email`, which it then needs, naming the organization and you, with your account address as its Reply-To. `copy`: nothing is sent, you copy the link. Left out: `copy`.","$ref":"#/components/schemas/FormLinkDelivery"}},"required":["kind","recipient"],"additionalProperties":false}]},"CreateFormLinksBody":{"type":"object","properties":{"recipient":{"description":"Who every link is for.","$ref":"#/components/schemas/FormLinkRecipient"},"delivery":{"description":"`email`: Fleepr emails every link to `recipient.email` in one email that lists them, each named by its record or prefill. `copy`: nothing is sent. Left out: `copy`.","$ref":"#/components/schemas/FormLinkDelivery"},"links":{"minItems":2,"maxItems":10,"type":"array","items":{"type":"object","properties":{"prefill":{"description":"Values prefilled for this link, by column id, as `createFormLink` takes them: another record or prefill for each link. Left out: none.","$ref":"#/components/schemas/RecordValues"},"expiresAt":{"description":"When the link stops working. Left out or null: never.","anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"maxResponses":{"description":"How many responses the link takes. Left out: one; null: no limit.","anyOf":[{"type":"integer","minimum":1,"maximum":1000000},{"type":"null"}]}},"additionalProperties":false},"description":"The links, 2 to 10, each for another record or prefill."}},"required":["recipient","links"],"additionalProperties":false},"CreateFormUploadBody":{"type":"object","properties":{"session":{"description":"The session that opening the form answered.","$ref":"#/components/schemas/FormSession"},"columnId":{"description":"The file question the file is for.","$ref":"#/components/schemas/ColumnId"},"name":{"type":"string","minLength":1,"maxLength":255,"description":"The file's name, up to 255 characters."},"mimeType":{"type":"string","minLength":1,"maxLength":255,"description":"The file's media type, such as `video/mp4`."},"sizeBytes":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"The exact size of the file in bytes."},"challenge":{"description":"A busy link's check: the token Turnstile gave after a `rate_limited` answer asked for it.","$ref":"#/components/schemas/FormChallengeToken"}},"required":["session","columnId","name","mimeType","sizeBytes"],"additionalProperties":false},"CreateHealthTargetBody":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80,"description":"What people will call it."},"ownerId":{"description":"Who owns it; left out: the caller.","$ref":"#/components/schemas/MemberId"},"preset":{"default":null,"description":"The preset it starts from, if any (its measure and direction are sent too).","anyOf":[{"$ref":"#/components/schemas/HealthTargetPreset"},{"type":"null"}]},"measure":{"description":"What it measures.","$ref":"#/components/schemas/HealthTargetMeasure"},"period":{"description":"How long each period is.","$ref":"#/components/schemas/HealthTargetPeriod"},"goal":{"type":"number","exclusiveMinimum":0,"maximum":1000000000,"description":"The number to hit each period: a rate as a share from 0 to 1."},"direction":{"description":"Which way is better.","$ref":"#/components/schemas/HealthTargetDirection"}},"required":["name","measure","period","goal","direction"],"additionalProperties":false},"CreateMemoryBody":{"type":"object","properties":{"subject":{"description":"What it is about: `{ scope: \"org\" }`, a record, an agent or a table, by its id.","$ref":"#/components/schemas/MemorySubjectInput"},"text":{"description":"The memory's words: one sentence on one line, up to 200 characters.","$ref":"#/components/schemas/MemoryTextInput"},"type":{"default":"rule","description":"`rule` (the default) or `fact`.","$ref":"#/components/schemas/MemoryType"},"validUntil":{"default":null,"description":"The day a fact stops being true; a rule has none.","anyOf":[{"$ref":"#/components/schemas/IsoDate"},{"type":"null"}]},"docId":{"default":null,"description":"A doc in Files the memory points to, which the caller may view; null for none.","anyOf":[{"$ref":"#/components/schemas/FileId"},{"type":"null"}]}},"required":["subject","text"],"additionalProperties":false},"CreateOrganizationBody":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80,"pattern":"\\S","description":"The organization's name, 1 to 80 characters and not only spaces."},"timeZone":{"type":"string","maxLength":64,"pattern":"^[A-Za-z][A-Za-z0-9_+-]*(?:\\/[A-Za-z0-9_+-]+)*$","description":"An IANA time zone, such as `Europe/Madrid`; the web app sends the browser's own.","$ref":"#/components/schemas/TimeZone"},"about":{"description":"A short text about the organization, up to 500 characters; empty when left out.","type":"string","maxLength":500}},"required":["name","timeZone"],"additionalProperties":false},"CreatePublicFileLinkBody":{"type":"object","properties":{"versionId":{"description":"The version to share, one of the file's; the current version when left out.","$ref":"#/components/schemas/FileVersionId"},"hours":{"description":"How many hours the link works, 1 to 168; 24 when left out.","type":"integer","minimum":1,"maximum":168}},"additionalProperties":false},"CreatePublicFileLinkResult":{"type":"object","properties":{"link":{"description":"The new link.","$ref":"#/components/schemas/PublicFileLink"},"url":{"description":"The address any server downloads the version from, with no sign-in, until the link ends. No other answer holds it, so keep it safe: whoever has it downloads the file.","$ref":"#/components/schemas/Url"}},"required":["link","url"]},"CreateRecordBody":{"type":"object","properties":{"values":{"description":"The cells to fill, by column id, each as its column takes it; the others start empty.","$ref":"#/components/schemas/RecordValues"},"afterRecordId":{"description":"The record to place the new one after; left out, it goes after the last record.","$ref":"#/components/schemas/RecordId"}},"additionalProperties":false},"CreateRecordsBody":{"type":"object","properties":{"records":{"minItems":1,"maxItems":500,"type":"array","items":{"$ref":"#/components/schemas/CreateRecordsItem"},"description":"The records to add, 1 to 500, appended after the last record in this order."}},"required":["records"],"additionalProperties":false},"CreateRecordsItem":{"type":"object","properties":{"values":{"description":"The record's cells, by column id, each as its column takes it; the others start empty.","$ref":"#/components/schemas/RecordValues"}},"additionalProperties":false},"CreateReviewAnnotationBody":{"type":"object","properties":{"versionId":{"description":"The version of the file to draw on.","$ref":"#/components/schemas/FileVersionId"},"page":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"The page to draw on, counting from 0; always 0 for an image, a video or an audio file."},"shape":{"description":"What to draw: a pin, a freehand stroke, a box, an oval or a line.","$ref":"#/components/schemas/Shape"},"timeMs":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}],"description":"The moment of a video to tie the annotation to, in milliseconds, required on a video; send null for any other file."}},"required":["versionId","page","shape","timeMs"],"additionalProperties":false},"CreateSkillBody":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":64,"pattern":"\\S","description":"The skill's name, up to 64 characters; it is written into the front matter of its `SKILL.md`."},"description":{"type":"string","minLength":1,"maxLength":300,"pattern":"\\S","description":"What agents see of the skill before they load its body, up to 300 characters; written into the front matter."},"body":{"type":"string","minLength":1,"maxLength":100000,"pattern":"\\S","description":"The skill's `SKILL.md`, up to 100,000 characters with its front matter."},"agentIds":{"description":"The agents to assign the skill to, each once; each needs the caller to have edit on it.","type":"array","items":{"$ref":"#/components/schemas/AgentId"}}},"required":["name","description","body"],"additionalProperties":false},"CreateTableBody":{"type":"object","properties":{"name":{"description":"The table's name, up to 120 characters; left out, the table is untitled.","type":"string","minLength":1,"maxLength":120},"about":{"description":"The table's description, up to 2,000 characters.","type":"string","maxLength":2000},"visibility":{"description":"`organization` (the default): every member can view the table; `private`: only its owner, those it is shared with, and the organization's owner and admins.","$ref":"#/components/schemas/Visibility"},"columns":{"description":"The columns the table comes with after its text column, in order, up to 30, each as `tables.addColumn` takes it. They are made with the table, in one write: a column refused (`400 validation_failed` at `body.columns.<n>`) leaves no table. Left out: none.","maxItems":30,"type":"array","items":{"$ref":"#/components/schemas/ColumnInput"}}},"additionalProperties":false},"CreateTeamBody":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":60,"pattern":"\\S","description":"The team's name, up to 60 characters, unique in the organization, ignoring case."},"about":{"description":"What the team does, up to 500 characters; null removes it.","anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"actorIds":{"description":"The people and agents in the team, each once.","type":"array","items":{"$ref":"#/components/schemas/ActorId"}}},"required":["name"],"additionalProperties":false},"CreateUploadBody":{"type":"object","properties":{"purpose":{"description":"What the upload is for: `attachment` (a file for a message, a table cell or the media library), `voice_note` (the audio of a voice message, kept only as its transcript), `file_version` (a new version of a file), `avatar` (a profile photo), `agent_avatar` (an agent's photo) or `organization_logo` (one of the organization's logos).","$ref":"#/components/schemas/UploadPurpose"},"name":{"type":"string","minLength":1,"maxLength":255,"description":"The file's name, up to 255 characters."},"mimeType":{"type":"string","minLength":1,"maxLength":255,"description":"The media type of the bytes, such as `image/png` or `audio/webm;codecs=opus`. A malformed type fails with `unsupported_media_type`."},"sizeBytes":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"The exact size of the file in bytes; the upload links take exactly this many."},"thread":{"description":"For an `attachment` or a `voice_note`: the chat or file comments it is for; leave it out before the chat exists.","$ref":"#/components/schemas/ThreadRef"},"fileId":{"description":"For a `file_version` only: the file the new version is for.","$ref":"#/components/schemas/FileId"},"library":{"description":"For an `attachment` without a `thread` only: puts the file straight into the media library, with who may see it.","$ref":"#/components/schemas/LibraryUploadInput"}},"required":["purpose","name","mimeType","sizeBytes"],"additionalProperties":false},"CreateViewBody":{"type":"object","properties":{"kind":{"description":"The kind of view: `form`.","$ref":"#/components/schemas/ViewKind"},"name":{"type":"string","minLength":1,"maxLength":80,"description":"The view's name, up to 80 characters."},"position":{"description":"Where the view goes in the menu: a key between its neighbors' `position`. Left out, it goes last.","$ref":"#/components/schemas/FractionalIndex"},"settings":{"description":"The form's settings. Left out, the form asks every column of the table that is not a system column, in table order, titled with its name.","$ref":"#/components/schemas/FormSettings"}},"required":["kind","name"],"additionalProperties":false},"CreateWebhookBody":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100,"description":"A name that says where events go, up to 100 characters."},"url":{"type":"string","maxLength":2048,"format":"uri","description":"The address to post deliveries to: `https` on port 443 with a public host, up to 2048 characters.","$ref":"#/components/schemas/Url"},"events":{"minItems":1,"type":"array","items":{"$ref":"#/components/schemas/WebhookEventType"},"description":"The events to send, at least one, each once."},"active":{"description":"Whether it starts sending at once; `true` when left out.","type":"boolean"}},"required":["name","url","events"],"additionalProperties":false},"CreateWebhookResult":{"type":"object","properties":{"webhook":{"description":"The new webhook.","$ref":"#/components/schemas/Webhook"},"secret":{"anyOf":[{"type":"string","pattern":"^whsec_[A-Za-z0-9_-]{43}$"},{"type":"null"}],"description":"The signing secret, `whsec_` and 43 more characters, shown this once: store it to check signatures. Null on a replay of the request."}},"required":["webhook","secret"]},"CredentialConnectorKey":{"type":"string","enum":["google_drive","meta_ads"]},"CurrencyCode":{"type":"string","pattern":"^[A-Z]{3}$"},"Cursor":{"type":"string","minLength":1,"maxLength":512,"pattern":"^[A-Za-z0-9_-]+$"},"DatabaseId":{"type":"string","pattern":"^dbs_[0-9a-hjkmnp-tv-z]{26}$"},"DateColumn":{"type":"object","properties":{"id":{"description":"The column's id: the key of its cell in each record's `values`.","$ref":"#/components/schemas/ColumnId"},"tableId":{"description":"The table the column belongs to.","$ref":"#/components/schemas/TableId"},"name":{"type":"string","minLength":1,"maxLength":80,"description":"The column's name, shown in its header."},"position":{"description":"The column's place in the table: columns sort by this key, compared as text.","$ref":"#/components/schemas/FractionalIndex"},"readOnly":{"type":"boolean","description":"Whether only the server writes the column's cells; a record write that sets one answers `400 validation_failed`."},"revision":{"description":"Grows by one with every change to the column; send it as `expectedRevision` to change the column.","$ref":"#/components/schemas/Revision"},"type":{"type":"string","const":"date","description":"The column's type, which decides what its cells hold."},"includeTime":{"type":"boolean","description":"Whether the cells hold a date and time, rather than a date alone (`YYYY-MM-DD`)."}},"required":["id","tableId","name","position","readOnly","revision","type","includeTime"]},"DeactivateMemberBody":{"type":"object","properties":{"expectedRevision":{"description":"The `revision` you read. If the object changed since, the answer is `409 revision_conflict` and nothing changes.","$ref":"#/components/schemas/Revision"}},"required":["expectedRevision"],"additionalProperties":false},"DecideApprovalBody":{"type":"object","properties":{"round":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"The round you decide on, the approval's current `round`; another one fails with `state_conflict`."},"decision":{"description":"`approved`; or, on a flow sign-off only, `changes_requested` to send the work back. A file takes no change request (`validation_failed` at `decision`): comment on it instead.","$ref":"#/components/schemas/Decision"},"comment":{"description":"On a file only: a comment posted in the file's thread with the approval.","type":"object","properties":{"parts":{"description":"The comment's content: text, mentions, references to annotations of the version, attachments and voice notes.","$ref":"#/components/schemas/MessagePartsInput"}},"required":["parts"],"additionalProperties":false},"reason":{"description":"On a flow sign-off only: why the work goes back, up to 2,000 characters; required to send it back.","type":"string","minLength":1,"maxLength":2000}},"required":["round","decision"],"additionalProperties":false},"DecideApprovalResult":{"type":"object","properties":{"approval":{"description":"The approval after the decision.","$ref":"#/components/schemas/Approval"},"comment":{"anyOf":[{"$ref":"#/components/schemas/Message"},{"type":"null"}],"description":"The comment posted with the approval; null when none was sent."},"notice":{"anyOf":[{"$ref":"#/components/schemas/Message"},{"type":"null"}],"description":"The line the decision wrote in the file's thread, a system message; null for a flow sign-off, which has no thread."}},"required":["approval","comment","notice"]},"DecidedHealthTargetSuggestion":{"type":"object","properties":{"suggestion":{"description":"The suggestion as it is now.","$ref":"#/components/schemas/HealthTargetSuggestion"},"target":{"anyOf":[{"$ref":"#/components/schemas/HealthTarget"},{"type":"null"}],"description":"The target it became; null when dismissed."}},"required":["suggestion","target"]},"DecideHealthTargetSuggestionBody":{"type":"object","properties":{"action":{"type":"string","enum":["accept","dismiss"],"description":"`accept` creates the target; `dismiss` sets it aside."},"goal":{"description":"Accepting: a goal of the caller instead of the suggested one.","type":"number","exclusiveMinimum":0,"maximum":1000000000}},"required":["action"],"additionalProperties":false},"DecideMemoryBody":{"oneOf":[{"type":"object","properties":{"action":{"type":"string","const":"confirm","description":"A suggestion becomes a confirmed memory; a suggested new version (`revises`) becomes the newest version of the memory it revises instead."},"fromMessageId":{"description":"The chat message whose memory card the caller decided from: the agent that wrote it then says in the chat, in one line and with no model call, that it will remember it or won't (naming the memory's words only when every reader of the chat sees it). A message that does not carry this memory’s card, or one the caller may not view, posts nothing; the decision stands either way.","$ref":"#/components/schemas/MessageId"},"expectedRevision":{"description":"The `revision` you read. If the object changed since, the answer is `409 revision_conflict` and nothing changes.","$ref":"#/components/schemas/Revision"}},"required":["action","expectedRevision"],"additionalProperties":false},{"type":"object","properties":{"action":{"type":"string","const":"reject","description":"A suggestion is not right: never suggested again."},"reason":{"type":"string","enum":["not_true","only_once","too_broad","already_covered","other"],"description":"Why it is not right."},"note":{"default":null,"description":"The words of another reason (`reason` `other`).","anyOf":[{"type":"string","minLength":1,"maxLength":500},{"type":"null"}]},"coveredById":{"description":"For `already_covered` only: the confirmed memory that already says it, which the caller decides too and which takes this suggestion’s evidence (its sources); Fleepr then adds what it would suggest again to that memory instead. One the caller may not see answers `404 not_found`; one they may not decide, `403 forbidden`; one that is not confirmed, `409 state_conflict`.","$ref":"#/components/schemas/MemoryId"},"fromMessageId":{"description":"The chat message whose memory card the caller decided from: the agent that wrote it then says in the chat, in one line and with no model call, that it will remember it or won't (naming the memory's words only when every reader of the chat sees it). A message that does not carry this memory’s card, or one the caller may not view, posts nothing; the decision stands either way.","$ref":"#/components/schemas/MessageId"},"expectedRevision":{"description":"The `revision` you read. If the object changed since, the answer is `409 revision_conflict` and nothing changes.","$ref":"#/components/schemas/Revision"}},"required":["action","reason","expectedRevision"],"additionalProperties":false},{"type":"object","properties":{"action":{"type":"string","const":"keep","description":"A confirmed memory stays: its unused clock starts again."},"expectedRevision":{"description":"The `revision` you read. If the object changed since, the answer is `409 revision_conflict` and nothing changes.","$ref":"#/components/schemas/Revision"}},"required":["action","expectedRevision"],"additionalProperties":false},{"type":"object","properties":{"action":{"type":"string","const":"archive","description":"A confirmed memory is no longer loaded; still searchable."},"expectedRevision":{"description":"The `revision` you read. If the object changed since, the answer is `409 revision_conflict` and nothing changes.","$ref":"#/components/schemas/Revision"}},"required":["action","expectedRevision"],"additionalProperties":false},{"type":"object","properties":{"action":{"type":"string","const":"restore","description":"An archived memory is confirmed again; a replaced one is no longer replaced."},"expectedRevision":{"description":"The `revision` you read. If the object changed since, the answer is `409 revision_conflict` and nothing changes.","$ref":"#/components/schemas/Revision"}},"required":["action","expectedRevision"],"additionalProperties":false},{"type":"object","properties":{"action":{"type":"string","const":"forget","description":"Erases its words and evidence for good."},"expectedRevision":{"description":"The `revision` you read. If the object changed since, the answer is `409 revision_conflict` and nothing changes.","$ref":"#/components/schemas/Revision"}},"required":["action","expectedRevision"],"additionalProperties":false},{"type":"object","properties":{"action":{"type":"string","const":"supersede","description":"A confirmed memory replaces another confirmed one, which is archived."},"supersedesId":{"description":"The memory it replaces.","$ref":"#/components/schemas/MemoryId"},"supersedesRevision":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"The revision of the memory it replaces, as the caller read it (its conflict); else 409."},"expectedRevision":{"description":"The `revision` you read. If the object changed since, the answer is `409 revision_conflict` and nothing changes.","$ref":"#/components/schemas/Revision"}},"required":["action","supersedesId","supersedesRevision","expectedRevision"],"additionalProperties":false}]},"DecidingRight":{"type":"string","enum":["approver","step_person","initiator","owner","named","answerer","admin","health"]},"Decision":{"type":"string","enum":["approved","changes_requested"]},"DecisionVia":{"type":"string","enum":["app","link","api_key"]},"DeclineRequestBody":{"type":"object","properties":{"reason":{"description":"Words for the agent, up to 500 characters, which it is told once the Undo window closes.","type":"string","minLength":1,"maxLength":500},"argumentsHash":{"description":"The card's `argumentsHash` as you read it, required with an API key; a changed call answers `409 arguments_mismatch`.","$ref":"#/components/schemas/Sha256Hex"},"expectedRevision":{"description":"The `revision` you read. If the object changed since, the answer is `409 revision_conflict` and nothing changes.","$ref":"#/components/schemas/Revision"}},"required":["expectedRevision"],"additionalProperties":false},"DeleteRecordsBody":{"type":"object","properties":{"recordIds":{"minItems":1,"maxItems":500,"type":"array","items":{"$ref":"#/components/schemas/RecordId"},"description":"The records to delete, 1 to 500, each named once; any id that is not a record of this table answers `404 not_found` and deletes nothing."}},"required":["recordIds"],"additionalProperties":false},"DeleteRecordsResult":{"type":"object","properties":{"deletedCount":{"type":"integer","minimum":1,"maximum":500,"description":"How many records were deleted."}},"required":["deletedCount"]},"DeliverToolResultBody":{"type":"object","properties":{"toolName":{"type":"string","minLength":1,"maxLength":160,"description":"The name of the tool that was called, as the MCP server lists it in `tools/list`, such as `create_avatar_video`."},"text":{"type":"string","minLength":1,"maxLength":8000,"description":"The result in words, at most 8000 characters: what the agent reads."},"fileIds":{"description":"Up to 10 files the result delivers, each one the caller may share. In a chat: one the caller uploaded for that chat and completed (an attachment upload naming the chat; post nothing), which Fleepr attaches to the agent's reply as if the caller had posted it, or one a message there attaches already, which the reply does not attach again. In a file's comments: one a comment there attaches (post it there first), which the agent names.","maxItems":10,"type":"array","items":{"$ref":"#/components/schemas/FileId"}}},"required":["toolName","text"],"additionalProperties":false},"DeliverToolResultResult":{"type":"object","properties":{"toolResult":{"description":"The tool result, with the turn and chain it started.","$ref":"#/components/schemas/ToolResult"}},"required":["toolResult"]},"Directory":{"type":"object","properties":{"actors":{"type":"array","items":{"$ref":"#/components/schemas/ActorSummary"},"description":"Every actor of the organization once: its members, its agents and its system actor."}},"required":["actors"]},"DisconnectBody":{"type":"object","properties":{"expectedRevision":{"description":"The `revision` you read. If the object changed since, the answer is `409 revision_conflict` and nothing changes.","$ref":"#/components/schemas/Revision"}},"required":["expectedRevision"],"additionalProperties":false},"Doc":{"type":"object","properties":{"fileId":{"description":"The doc's file id.","$ref":"#/components/schemas/FileId"},"versionId":{"description":"The version the content belongs to: the current one.","$ref":"#/components/schemas/FileVersionId"},"content":{"description":"The doc's content, the editor's JSON.","$ref":"#/components/schemas/DocContent"},"revision":{"description":"The content's revision: send it as `expectedRevision` with the next save, which raises it.","$ref":"#/components/schemas/Revision"},"pageCount":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"How many pages: its page breaks and one."},"wordCount":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many words its text has."},"updatedAt":{"description":"When the content was last saved, or the doc made.","$ref":"#/components/schemas/IsoDateTime"},"updatedBy":{"description":"Who last saved it, or made the doc.","$ref":"#/components/schemas/ActorId"},"editor":{"anyOf":[{"$ref":"#/components/schemas/DocEditLease"},{"type":"null"}],"description":"Who is editing it now; null when nobody is, and anyone who may edit it may start."},"review":{"anyOf":[{"$ref":"#/components/schemas/DocReview"},{"type":"null"}],"description":"The version under review, page by page, while the doc has an approval that is not cancelled; null otherwise."}},"required":["fileId","versionId","content","revision","pageCount","wordCount","updatedAt","updatedBy","editor","review"]},"DocBlock":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"paragraph","description":"The node or mark: `paragraph`, a paragraph."},"content":{"description":"Its text, line breaks and agents.","type":"array","items":{"$ref":"#/components/schemas/DocInline"}}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"heading","description":"The node or mark: `heading`, a heading."},"attrs":{"type":"object","properties":{"level":{"anyOf":[{"type":"number","const":1},{"type":"number","const":2}],"description":"The heading level: 1 for a section title, 2 for a smaller heading."}},"required":["level"],"description":"The heading's level."},"content":{"description":"Its text, line breaks and agents.","type":"array","items":{"$ref":"#/components/schemas/DocInline"}}},"required":["type","attrs"]},{"type":"object","properties":{"type":{"type":"string","const":"bulletList","description":"The node or mark: `bulletList`, a bulleted list."},"content":{"minItems":1,"type":"array","items":{"$ref":"#/components/schemas/DocListItem"},"description":"Its items, in order."}},"required":["type","content"]},{"type":"object","properties":{"type":{"type":"string","const":"orderedList","description":"The node or mark: `orderedList`, a numbered list."},"attrs":{"description":"The list's first number.","type":"object","properties":{"start":{"description":"The number of its first item.","type":"integer","minimum":0,"maximum":100000}}},"content":{"minItems":1,"type":"array","items":{"$ref":"#/components/schemas/DocListItem"},"description":"Its items, in order."}},"required":["type","content"]},{"type":"object","properties":{"type":{"type":"string","const":"blockquote","description":"The node or mark: `blockquote`, a quote."},"content":{"minItems":1,"type":"array","items":{"$ref":"#/components/schemas/DocBlock"},"description":"The blocks it quotes."}},"required":["type","content"]},{"type":"object","properties":{"type":{"type":"string","const":"horizontalRule","description":"The node or mark: `horizontalRule`, a divider."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"pageBreak","description":"The node or mark: `pageBreak`, the end of one page and the start of the next."},"attrs":{"description":"The page it starts.","type":"object","properties":{"id":{"description":"The id of the page it starts; the editor gives every new break one.","$ref":"#/components/schemas/DocPageId"}}}},"required":["type"]}]},"DocContent":{"type":"object","properties":{"type":{"type":"string","const":"doc","description":"Always `doc`: the root of the content."},"content":{"minItems":1,"type":"array","items":{"$ref":"#/components/schemas/DocBlock"},"description":"The doc's blocks, in order; page breaks end its pages, at most 1000 pages."}},"required":["type","content"]},"DocCreatePreview":{"type":"object","properties":{"kind":{"type":"string","const":"doc_create","description":"Create a doc in Files."},"name":{"type":"string","minLength":1,"maxLength":255,"description":"The new doc's name."},"visibility":{"description":"Who will view the new doc: `organization` (every member) or `private` (its owner, the people it is shared with, and admins).","$ref":"#/components/schemas/Visibility"},"pageCount":{"type":"integer","minimum":1,"maximum":1000,"description":"How many pages the new doc has."},"wordCount":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many words the new doc has."},"pages":{"minItems":1,"maxItems":1000,"type":"array","items":{"type":"string"},"description":"Every page's Markdown, in order, as the doc will hold it: a client shows the first and folds the rest behind Show all. The name and the pages hold at most 256 KiB in all."}},"required":["kind","name","visibility","pageCount","wordCount","pages"]},"DocEditLease":{"type":"object","properties":{"memberId":{"description":"The member editing the doc.","$ref":"#/components/schemas/MemberId"},"until":{"description":"When the lease ends unless the editor renews it.","$ref":"#/components/schemas/IsoDateTime"}},"required":["memberId","until"]},"DocInline":{"oneOf":[{"$ref":"#/components/schemas/DocText"},{"type":"object","properties":{"type":{"type":"string","const":"hardBreak","description":"The node or mark: `hardBreak`, a line break."}},"required":["type"]},{"$ref":"#/components/schemas/DocMention"}]},"DocLeaseId":{"type":"string","pattern":"^[A-Za-z0-9_-]{16,64}$","description":"The id of an open editor's lease: 16 to 64 letters, digits, - or _."},"DocListItem":{"type":"object","properties":{"type":{"type":"string","const":"listItem","description":"The node or mark: `listItem`, an item of a list."},"content":{"minItems":1,"type":"array","items":{"$ref":"#/components/schemas/DocBlock"},"description":"Its blocks: a paragraph first, then nested lists."}},"required":["type","content"]},"DocMark":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"bold","description":"The node or mark: `bold`, bold text."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"italic","description":"The node or mark: `italic`, italic text."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"underline","description":"The node or mark: `underline`, underlined text."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"link","description":"The node or mark: `link`, a link."},"attrs":{"type":"object","properties":{"href":{"type":"string","maxLength":2048,"pattern":"^(https?:\\/\\/|mailto:)\\S+$","description":"Where the link goes: https, http or mailto."}},"required":["href"],"description":"The link's address."}},"required":["type","attrs"]}]},"DocMention":{"type":"object","properties":{"type":{"type":"string","const":"mention","description":"The node or mark: `mention`, an agent named in the text."},"attrs":{"type":"object","properties":{"id":{"description":"The agent's id.","$ref":"#/components/schemas/AgentId"},"label":{"type":"string","minLength":1,"maxLength":120,"description":"The agent's name when it was named."}},"required":["id","label"],"description":"Which agent, and its name."}},"required":["type","attrs"]},"DocPageId":{"type":"string","pattern":"^[A-Za-z0-9_-]{4,64}$","description":"A page of a doc: `first`, or the id of the page break that starts it."},"DocReview":{"type":"object","properties":{"approvalId":{"description":"The doc's approval.","$ref":"#/components/schemas/ApprovalId"},"round":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"The approval's current round."},"versionId":{"description":"The version under review: frozen when the round started.","$ref":"#/components/schemas/FileVersionId"},"versionNumber":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"Its number."},"pages":{"type":"array","items":{"$ref":"#/components/schemas/DocReviewPage"},"description":"Its pages, in order, each marked in or out of scope."}},"required":["approvalId","round","versionId","versionNumber","pages"]},"DocReviewPage":{"type":"object","properties":{"id":{"description":"The page: `first`, or the id of the page break that starts it.","$ref":"#/components/schemas/DocPageId"},"number":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"Its number in the version under review."},"heading":{"description":"The text of its first heading; null when it has none.","type":["string","null"]},"hash":{"type":"string","pattern":"^[0-9a-f]{16}$","description":"A hash of its content: a page edited since differs from it."},"inScope":{"type":"boolean","description":"Whether the approval covers it: every page, or one of those chosen."}},"required":["id","number","heading","hash","inScope"]},"DocSaved":{"type":"object","properties":{"revision":{"description":"The content's new revision, for the next save.","$ref":"#/components/schemas/Revision"},"pageCount":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"How many pages it has now."},"wordCount":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many words it has now."},"updatedAt":{"description":"When it was saved.","$ref":"#/components/schemas/IsoDateTime"},"editor":{"description":"The caller's lease, renewed by the save.","$ref":"#/components/schemas/DocEditLease"}},"required":["revision","pageCount","wordCount","updatedAt","editor"]},"DocSearchHit":{"type":"object","properties":{"fileId":{"description":"The doc's id.","$ref":"#/components/schemas/FileId"},"fileName":{"type":"string","description":"The doc's name."},"versionNumber":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"The number of its current version, which the passage is of."},"page":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"The page the passage is on, from 1."},"heading":{"description":"The heading above the passage; null for none.","type":["string","null"]},"text":{"type":"string","description":"The passage's text."}},"required":["fileId","fileName","versionNumber","page","heading","text"]},"DocText":{"type":"object","properties":{"type":{"type":"string","const":"text","description":"The node or mark: `text`, a run of text."},"text":{"type":"string","minLength":1,"description":"The text."},"marks":{"description":"Bold, italic, underline and a link.","maxItems":4,"type":"array","items":{"$ref":"#/components/schemas/DocMark"}}},"required":["type","text"]},"DocUpdatedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"doc.updated","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"type":"object","properties":{"fileId":{"description":"The doc's file id.","$ref":"#/components/schemas/FileId"},"revision":{"description":"The content's revision now.","$ref":"#/components/schemas/Revision"},"pageCount":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"How many pages it has now."},"wordCount":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many words it has now."},"editor":{"anyOf":[{"$ref":"#/components/schemas/DocEditLease"},{"type":"null"}],"description":"Who is editing it now; null when nobody is."}},"required":["fileId","revision","pageCount","wordCount","editor"],"description":"What the event carries; for a change, the object as it is after it."}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"DraftBlock":{"type":"object","properties":{"position":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Where the block sits, as a character position in the reply's text."},"block":{"description":"The table card or media gallery.","$ref":"#/components/schemas/Block"}},"required":["position","block"]},"EditAccessNeededNotice":{"type":"object","properties":{"code":{"type":"string","const":"edit_access_needed","description":"An agent stopped: it needed edit access that the member it works for lacks too."},"agentId":{"description":"The agent that stopped.","$ref":"#/components/schemas/AgentId"},"memberId":{"description":"The member the agent works for; only they are offered Ask to edit.","$ref":"#/components/schemas/MemberId"},"object":{"description":"The object it needed to edit. Read its name with `GET /v0/objects/{objectId}`; a reader who may not view it gets `404 not_found`.","$ref":"#/components/schemas/AccessObjectRef"}},"required":["code","agentId","memberId","object"]},"Email":{"type":"string","maxLength":254,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"EmailColumn":{"type":"object","properties":{"id":{"description":"The column's id: the key of its cell in each record's `values`.","$ref":"#/components/schemas/ColumnId"},"tableId":{"description":"The table the column belongs to.","$ref":"#/components/schemas/TableId"},"name":{"type":"string","minLength":1,"maxLength":80,"description":"The column's name, shown in its header."},"position":{"description":"The column's place in the table: columns sort by this key, compared as text.","$ref":"#/components/schemas/FractionalIndex"},"readOnly":{"type":"boolean","description":"Whether only the server writes the column's cells; a record write that sets one answers `400 validation_failed`."},"revision":{"description":"Grows by one with every change to the column; send it as `expectedRevision` to change the column.","$ref":"#/components/schemas/Revision"},"type":{"type":"string","const":"email","description":"The column's type, which decides what its cells hold."}},"required":["id","tableId","name","position","readOnly","revision","type"]},"EmailDigest":{"type":"string","enum":["off","daily","weekly"]},"EmailNotifications":{"type":"object","properties":{"mention":{"type":"boolean","description":"Whether mentions of the person also go to them by email."},"approval":{"type":"boolean","description":"Whether files and flow steps waiting for their approval, and decisions on theirs, also go by email."},"agent":{"type":"boolean","description":"Whether agents' requests waiting for their OK, and AI budget warnings, also go by email."},"flow":{"type":"boolean","description":"Whether flow problems, such as a failed run, also go by email."},"invite":{"type":"boolean","description":"Whether being added to something, given access or asked for access also goes by email."},"change":{"default":true,"description":"Whether changes someone else saved to the person's flows, agents, skills and connections also go by email; on unless they turned it off.","type":"boolean"}},"required":["mention","approval","agent","flow","invite","change"]},"EmailNotificationsPatch":{"type":"object","properties":{"mention":{"description":"Whether mentions also go by email.","type":"boolean"},"approval":{"description":"Whether approvals waiting and decided also go by email.","type":"boolean"},"agent":{"description":"Whether agents' requests and AI budget warnings also go by email.","type":"boolean"},"flow":{"description":"Whether flow problems also go by email.","type":"boolean"},"invite":{"description":"Whether invites and access matters also go by email.","type":"boolean"},"change":{"description":"Whether changes others saved to the person's work also go by email.","type":"boolean"}},"additionalProperties":false},"EmailProblem":{"type":"string","enum":["bounced","complained","not_sent"]},"EmailSendPreview":{"type":"object","properties":{"kind":{"type":"string","const":"email_send","description":"Email a person outside the organization."},"recipient":{"type":"object","properties":{"email":{"description":"The person's email address: Fleepr emails the message there.","$ref":"#/components/schemas/Email"},"name":{"anyOf":[{"type":"string","minLength":1,"maxLength":80},{"type":"null"}],"description":"The name the email greets them by, up to 80 characters: the name the organization keeps for a known person, else the name the agent gave; null when neither."}},"required":["email","name"],"description":"Who the email is for."},"knownContact":{"type":"boolean","description":"Whether the organization already knows this person by their email address."},"subject":{"type":"string","minLength":1,"maxLength":200,"description":"The email's subject, as sent."},"body":{"type":"string","minLength":1,"maxLength":4000,"description":"The email's message, as sent."},"replies":{"type":"string","enum":["decider"],"description":"`decider`: a reply goes to the email address of the member who allows the card."}},"required":["kind","recipient","knownContact","subject","body","replies"]},"EmailUndelivered":{"type":"object","properties":{"problem":{"description":"Why the email was not delivered.","$ref":"#/components/schemas/EmailProblem"},"at":{"description":"When the problem was reported.","$ref":"#/components/schemas/IsoDateTime"}},"required":["problem","at"]},"EmailUndeliveredNotice":{"type":"object","properties":{"code":{"type":"string","const":"email_undelivered","description":"An email an agent sent was not delivered."},"agentId":{"description":"The agent that sent it.","$ref":"#/components/schemas/AgentId"},"memberId":{"description":"The member who allowed the card it was sent under.","$ref":"#/components/schemas/MemberId"},"item":{"description":"What the email carried.","$ref":"#/components/schemas/UndeliveredEmailItem"},"recipient":{"description":"The recipient's address, as the card showed it.","$ref":"#/components/schemas/Email"},"reason":{"description":"Why it was not delivered.","$ref":"#/components/schemas/EmailUndeliveredReason"}},"required":["code","agentId","memberId","item","recipient","reason"]},"EmailUndeliveredReason":{"type":"string","enum":["no_address","inbox_full","refused","spam"]},"ErrorBody":{"oneOf":[{"type":"object","properties":{"code":{"type":"string","const":"validation_failed","description":"What went wrong, stable and made for code to read."},"message":{"type":"string","description":"What went wrong in plain English, safe to show to a person."},"details":{"type":"object","properties":{"issues":{"type":"array","items":{"$ref":"#/components/schemas/ValidationIssue"},"description":"Every problem found in the request, each with where it is."}},"required":["issues"],"description":"More about the error, shaped by `code`; null when the code carries nothing more."},"requestId":{"type":"string","description":"The id of the request, as the `X-Request-Id` header carries it: give it to support to trace it."}},"required":["code","message","details","requestId"]},{"type":"object","properties":{"code":{"type":"string","const":"invalid_cursor","description":"What went wrong, stable and made for code to read."},"message":{"type":"string","description":"What went wrong in plain English, safe to show to a person."},"details":{"type":"null","description":"More about the error, shaped by `code`; null when the code carries nothing more."},"requestId":{"type":"string","description":"The id of the request, as the `X-Request-Id` header carries it: give it to support to trace it."}},"required":["code","message","details","requestId"]},{"type":"object","properties":{"code":{"type":"string","const":"unauthenticated","description":"What went wrong, stable and made for code to read."},"message":{"type":"string","description":"What went wrong in plain English, safe to show to a person."},"details":{"type":"null","description":"More about the error, shaped by `code`; null when the code carries nothing more."},"requestId":{"type":"string","description":"The id of the request, as the `X-Request-Id` header carries it: give it to support to trace it."}},"required":["code","message","details","requestId"]},{"type":"object","properties":{"code":{"type":"string","const":"forbidden","description":"What went wrong, stable and made for code to read."},"message":{"type":"string","description":"What went wrong in plain English, safe to show to a person."},"details":{"type":"object","properties":{"action":{"type":"string","description":"What the caller may not do."},"deniedBy":{"anyOf":[{"$ref":"#/components/schemas/ActorId"},{"type":"null"}],"description":"In a chain of agents, the first agent that may not do it; null when the caller itself may not."},"reason":{"description":"Why the caller may not take this decision: most reasons are an API key's, and `arguments_hidden` refuses anyone an Allow on arguments they cannot read; absent on any other refusal.","$ref":"#/components/schemas/ForbiddenReason"}},"required":["action","deniedBy"],"description":"More about the error, shaped by `code`; null when the code carries nothing more."},"requestId":{"type":"string","description":"The id of the request, as the `X-Request-Id` header carries it: give it to support to trace it."}},"required":["code","message","details","requestId"]},{"type":"object","properties":{"code":{"type":"string","const":"mention_not_allowed","description":"What went wrong, stable and made for code to read."},"message":{"type":"string","description":"What went wrong in plain English, safe to show to a person."},"details":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"actorId":{"description":"The agent or member that may not be mentioned.","$ref":"#/components/schemas/ActorId"},"reason":{"type":"string","description":"Why not."}},"required":["actorId","reason"]},"description":"Each mention refused, with why."}},"required":["items"],"description":"More about the error, shaped by `code`; null when the code carries nothing more."},"requestId":{"type":"string","description":"The id of the request, as the `X-Request-Id` header carries it: give it to support to trace it."}},"required":["code","message","details","requestId"]},{"type":"object","properties":{"code":{"type":"string","const":"not_found","description":"What went wrong, stable and made for code to read."},"message":{"type":"string","description":"What went wrong in plain English, safe to show to a person."},"details":{"type":"null","description":"More about the error, shaped by `code`; null when the code carries nothing more."},"requestId":{"type":"string","description":"The id of the request, as the `X-Request-Id` header carries it: give it to support to trace it."}},"required":["code","message","details","requestId"]},{"type":"object","properties":{"code":{"type":"string","const":"revision_conflict","description":"What went wrong, stable and made for code to read."},"message":{"type":"string","description":"What went wrong in plain English, safe to show to a person."},"details":{"type":"object","properties":{"currentRevision":{"description":"The revision the object has now: read it again, then retry.","$ref":"#/components/schemas/Revision"}},"required":["currentRevision"],"description":"More about the error, shaped by `code`; null when the code carries nothing more."},"requestId":{"type":"string","description":"The id of the request, as the `X-Request-Id` header carries it: give it to support to trace it."}},"required":["code","message","details","requestId"]},{"type":"object","properties":{"code":{"type":"string","const":"state_conflict","description":"What went wrong, stable and made for code to read."},"message":{"type":"string","description":"What went wrong in plain English, safe to show to a person."},"details":{"type":"object","properties":{"currentStatus":{"type":"string","description":"The state the object is in now."},"allowed":{"type":"array","items":{"type":"string"},"description":"The states that would allow it, if any."},"index":{"description":"In a bulk call, the position in the request of the item refused.","type":"integer","minimum":0,"maximum":9007199254740991},"memoryId":{"description":"For a memory refused as `duplicate`: the memory that already says it there.","$ref":"#/components/schemas/MemoryId"}},"required":["currentStatus","allowed"],"description":"More about the error, shaped by `code`; null when the code carries nothing more."},"requestId":{"type":"string","description":"The id of the request, as the `X-Request-Id` header carries it: give it to support to trace it."}},"required":["code","message","details","requestId"]},{"type":"object","properties":{"code":{"type":"string","const":"arguments_mismatch","description":"What went wrong, stable and made for code to read."},"message":{"type":"string","description":"What went wrong in plain English, safe to show to a person."},"details":{"type":"null","description":"More about the error, shaped by `code`; null when the code carries nothing more."},"requestId":{"type":"string","description":"The id of the request, as the `X-Request-Id` header carries it: give it to support to trace it."}},"required":["code","message","details","requestId"]},{"type":"object","properties":{"code":{"type":"string","const":"protected_object","description":"What went wrong, stable and made for code to read."},"message":{"type":"string","description":"What went wrong in plain English, safe to show to a person."},"details":{"type":"object","properties":{"reason":{"type":"string","enum":["locked_column","owner"],"description":"What protects it: a column the table keeps (`locked_column`, its primary column), or access that cannot change here (`owner`): an owner's role or access, which only a hand-over changes, or access that comes from the organization or a role."}},"required":["reason"],"description":"More about the error, shaped by `code`; null when the code carries nothing more."},"requestId":{"type":"string","description":"The id of the request, as the `X-Request-Id` header carries it: give it to support to trace it."}},"required":["code","message","details","requestId"]},{"type":"object","properties":{"code":{"type":"string","const":"duplicate","description":"What went wrong, stable and made for code to read."},"message":{"type":"string","description":"What went wrong in plain English, safe to show to a person."},"details":{"type":"object","properties":{"field":{"type":"string","description":"The field whose value is already taken."}},"required":["field"],"description":"More about the error, shaped by `code`; null when the code carries nothing more."},"requestId":{"type":"string","description":"The id of the request, as the `X-Request-Id` header carries it: give it to support to trace it."}},"required":["code","message","details","requestId"]},{"type":"object","properties":{"code":{"type":"string","const":"column_conversion_failed","description":"What went wrong, stable and made for code to read."},"message":{"type":"string","description":"What went wrong in plain English, safe to show to a person."},"details":{"type":"object","properties":{"failed":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many values would not convert."},"samples":{"maxItems":10,"type":"array","items":{"type":"object","properties":{"recordId":{"description":"The record the value is in.","$ref":"#/components/schemas/RecordId"},"value":{"type":"string","description":"The value, as text."},"message":{"type":"string","description":"Why it does not convert."}},"required":["recordId","value","message"]},"description":"Up to 10 of those values."}},"required":["failed","samples"],"description":"More about the error, shaped by `code`; null when the code carries nothing more."},"requestId":{"type":"string","description":"The id of the request, as the `X-Request-Id` header carries it: give it to support to trace it."}},"required":["code","message","details","requestId"]},{"type":"object","properties":{"code":{"type":"string","const":"idempotency_in_progress","description":"What went wrong, stable and made for code to read."},"message":{"type":"string","description":"What went wrong in plain English, safe to show to a person."},"details":{"type":"null","description":"More about the error, shaped by `code`; null when the code carries nothing more."},"requestId":{"type":"string","description":"The id of the request, as the `X-Request-Id` header carries it: give it to support to trace it."}},"required":["code","message","details","requestId"]},{"type":"object","properties":{"code":{"type":"string","const":"link_invalid","description":"What went wrong, stable and made for code to read."},"message":{"type":"string","description":"What went wrong in plain English, safe to show to a person."},"details":{"type":"null","description":"More about the error, shaped by `code`; null when the code carries nothing more."},"requestId":{"type":"string","description":"The id of the request, as the `X-Request-Id` header carries it: give it to support to trace it."}},"required":["code","message","details","requestId"]},{"type":"object","properties":{"code":{"type":"string","const":"payload_too_large","description":"What went wrong, stable and made for code to read."},"message":{"type":"string","description":"What went wrong in plain English, safe to show to a person."},"details":{"type":"object","properties":{"maxBytes":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"The largest size allowed, in bytes."}},"required":["maxBytes"],"description":"More about the error, shaped by `code`; null when the code carries nothing more."},"requestId":{"type":"string","description":"The id of the request, as the `X-Request-Id` header carries it: give it to support to trace it."}},"required":["code","message","details","requestId"]},{"type":"object","properties":{"code":{"type":"string","const":"unsupported_media_type","description":"What went wrong, stable and made for code to read."},"message":{"type":"string","description":"What went wrong in plain English, safe to show to a person."},"details":{"type":"null","description":"More about the error, shaped by `code`; null when the code carries nothing more."},"requestId":{"type":"string","description":"The id of the request, as the `X-Request-Id` header carries it: give it to support to trace it."}},"required":["code","message","details","requestId"]},{"type":"object","properties":{"code":{"type":"string","const":"idempotency_key_reused","description":"What went wrong, stable and made for code to read."},"message":{"type":"string","description":"What went wrong in plain English, safe to show to a person."},"details":{"type":"null","description":"More about the error, shaped by `code`; null when the code carries nothing more."},"requestId":{"type":"string","description":"The id of the request, as the `X-Request-Id` header carries it: give it to support to trace it."}},"required":["code","message","details","requestId"]},{"type":"object","properties":{"code":{"type":"string","const":"upload_not_ready","description":"What went wrong, stable and made for code to read."},"message":{"type":"string","description":"What went wrong in plain English, safe to show to a person."},"details":{"type":"object","properties":{"fileIds":{"type":"array","items":{"$ref":"#/components/schemas/FileId"},"description":"Attached files whose upload is not ready yet."},"uploadIds":{"type":"array","items":{"$ref":"#/components/schemas/UploadId"},"description":"Uploads used directly, such as a voice note still being transcribed, that are not ready yet."}},"required":["fileIds","uploadIds"],"description":"More about the error, shaped by `code`; null when the code carries nothing more."},"requestId":{"type":"string","description":"The id of the request, as the `X-Request-Id` header carries it: give it to support to trace it."}},"required":["code","message","details","requestId"]},{"type":"object","properties":{"code":{"type":"string","const":"rate_limited","description":"What went wrong, stable and made for code to read."},"message":{"type":"string","description":"What went wrong in plain English, safe to show to a person."},"details":{"type":"object","properties":{"retryAfterSeconds":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many seconds to wait before trying again."},"challenge":{"description":"A busy form link only: show this check, then send the same request again with its token as `challenge`.","type":"object","properties":{"provider":{"type":"string","const":"turnstile","description":"The check to show: Cloudflare Turnstile."},"siteKey":{"type":"string","minLength":1,"maxLength":200,"description":"The public site key the check is shown with."}},"required":["provider","siteKey"]}},"required":["retryAfterSeconds"],"description":"More about the error, shaped by `code`; null when the code carries nothing more."},"requestId":{"type":"string","description":"The id of the request, as the `X-Request-Id` header carries it: give it to support to trace it."}},"required":["code","message","details","requestId"]},{"type":"object","properties":{"code":{"type":"string","const":"budget_exceeded","description":"What went wrong, stable and made for code to read."},"message":{"type":"string","description":"What went wrong in plain English, safe to show to a person."},"details":{"type":"object","properties":{"scope":{"type":"string","enum":["day","month","chain"],"description":"Which AI budget is spent: the day, the month or the chain of agents."},"limitMicros":{"description":"That budget, in millionths of a US dollar.","$ref":"#/components/schemas/Micros"}},"required":["scope","limitMicros"],"description":"More about the error, shaped by `code`; null when the code carries nothing more."},"requestId":{"type":"string","description":"The id of the request, as the `X-Request-Id` header carries it: give it to support to trace it."}},"required":["code","message","details","requestId"]},{"type":"object","properties":{"code":{"type":"string","const":"recent_sign_in_required","description":"What went wrong, stable and made for code to read."},"message":{"type":"string","description":"What went wrong in plain English, safe to show to a person."},"details":{"type":"object","properties":{"action":{"type":"string","description":"What needs a recent sign-in."},"withinMinutes":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"How recent the sign-in must be, in minutes."}},"required":["action","withinMinutes"],"description":"More about the error, shaped by `code`; null when the code carries nothing more."},"requestId":{"type":"string","description":"The id of the request, as the `X-Request-Id` header carries it: give it to support to trace it."}},"required":["code","message","details","requestId"]},{"type":"object","properties":{"code":{"type":"string","const":"internal","description":"What went wrong, stable and made for code to read."},"message":{"type":"string","description":"What went wrong in plain English, safe to show to a person."},"details":{"anyOf":[{"type":"object","properties":{"issues":{"type":"array","items":{"$ref":"#/components/schemas/ValidationIssue"},"description":"Outside production only: what failed to check."}},"required":["issues"]},{"type":"null"}],"description":"More about the error, shaped by `code`; null when the code carries nothing more."},"requestId":{"type":"string","description":"The id of the request, as the `X-Request-Id` header carries it: give it to support to trace it."}},"required":["code","message","details","requestId"]},{"type":"object","properties":{"code":{"type":"string","const":"unavailable","description":"What went wrong, stable and made for code to read."},"message":{"type":"string","description":"What went wrong in plain English, safe to show to a person."},"details":{"type":"object","properties":{"retryAfterSeconds":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many seconds to wait before trying again."}},"required":["retryAfterSeconds"],"description":"More about the error, shaped by `code`; null when the code carries nothing more."},"requestId":{"type":"string","description":"The id of the request, as the `X-Request-Id` header carries it: give it to support to trace it."}},"required":["code","message","details","requestId"]}]},"EventId":{"type":"string","pattern":"^(0|[1-9][0-9]{0,18})$"},"EventType":{"type":"string","pattern":"^[a-z][a-z_]*\\.[a-z][a-z_]*$"},"ExternalAccount":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"The account's id on the service's side."},"label":{"type":"string","description":"The account's name to show, such as the address of a Google service account."}},"required":["id","label"]},"FileCreatedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"file.created","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"type":"object","properties":{"file":{"description":"The new file.","$ref":"#/components/schemas/FileSummary"}},"required":["file"],"description":"What the event carries; for a change, the object as it is after it."}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"FileDeletedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"file.deleted","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"type":"object","properties":{"fileId":{"description":"The deleted file's id.","$ref":"#/components/schemas/FileId"}},"required":["fileId"],"description":"What the event carries; for a change, the object as it is after it."}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"FileDetail":{"type":"object","properties":{"id":{"description":"The file's id.","$ref":"#/components/schemas/FileId"},"organizationId":{"description":"The organization the file belongs to.","$ref":"#/components/schemas/OrganizationId"},"name":{"type":"string","minLength":1,"maxLength":255,"description":"The file's name, as the library shows it and downloads save it."},"kind":{"description":"The type of file: `image`, `video`, `pdf`, `document` (an uploaded document such as a slide deck, a spreadsheet or a text file), `doc` (a doc written in Fleepr's editor), `audio` or `other`.","$ref":"#/components/schemas/FileKind"},"mimeType":{"type":"string","minLength":1,"description":"The media type of the file's current version, such as `image/png`."},"sizeBytes":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"The size of the file's current version in bytes."},"currentVersionId":{"description":"The version the file shows now, its newest.","$ref":"#/components/schemas/FileVersionId"},"currentVersionNumber":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"The number of the current version, counting from 1."},"meta":{"description":"The current version's dimensions, length and page count, where they apply.","$ref":"#/components/schemas/FileMeta"},"processing":{"description":"Whether the previews are made: `pending` while they are, then `ready`, or `failed` when they could not be; the file still downloads.","$ref":"#/components/schemas/ProcessingStatus"},"thumbnailUrl":{"anyOf":[{"$ref":"#/components/schemas/Url"},{"type":"null"}],"description":"A signed link to a small preview image, valid until `urlsExpireAt`; null when there is none."},"urlsExpireAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}],"description":"When the signed preview links stop working, so fetch the file again before then; null without links."},"origin":{"description":"Where the file came from: a chat or comment (`chat`), an agent, a connector, a table cell (`table`), or made in Files (`library`): uploaded there, or a doc made there.","$ref":"#/components/schemas/FileOrigin"},"sourceChat":{"anyOf":[{"$ref":"#/components/schemas/FileSourceChat"},{"type":"null"}],"description":"The chat the file was first shared in; null when there is none or the caller may not view it."},"visibility":{"description":"Who may see the file: everyone in the organization (`organization`), or only its owner, the people it is shared with and the organization's owner and admins (`private`).","$ref":"#/components/schemas/Visibility"},"createdBy":{"description":"The member who added the file; for a file an agent or a connector made, the member it worked for.","$ref":"#/components/schemas/ActorId"},"createdAt":{"description":"When the file was added.","$ref":"#/components/schemas/IsoDateTime"},"annotationCount":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many annotations are drawn on the current version."},"commentCount":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many comments the file's thread holds across every version, not counting system notices."},"approval":{"anyOf":[{"$ref":"#/components/schemas/ApprovalSummary"},{"type":"null"}],"description":"The file's approval and what the caller may do in it; null when nobody requested one."},"revision":{"description":"Grows by one with every change; when two copies differ, keep the one with the higher revision.","$ref":"#/components/schemas/Revision"},"ownerId":{"description":"The member who owns the file; a file an agent made belongs to the member it worked for.","$ref":"#/components/schemas/MemberId"},"currentVersion":{"description":"The current version, with its pages and signed preview links.","$ref":"#/components/schemas/FileVersion"},"versions":{"type":"array","items":{"$ref":"#/components/schemas/FileVersionSummary"},"description":"Every version of the file, newest first."},"accessSummary":{"description":"How many people and agents have access to the file.","$ref":"#/components/schemas/AccessSummary"},"myAccess":{"description":"The caller's own access level to the file and the actions it allows.","$ref":"#/components/schemas/MyAccess"}},"required":["id","organizationId","name","kind","mimeType","sizeBytes","currentVersionId","currentVersionNumber","meta","processing","thumbnailUrl","urlsExpireAt","origin","sourceChat","visibility","createdBy","createdAt","annotationCount","commentCount","approval","revision","ownerId","currentVersion","versions","accessSummary","myAccess"]},"FileDownloadUrl":{"type":"object","properties":{"url":{"description":"A signed link that downloads the version under the file's name, for 5 minutes.","$ref":"#/components/schemas/Url"},"expiresAt":{"description":"When the link stops working; a download that started before then may finish.","$ref":"#/components/schemas/IsoDateTime"}},"required":["url","expiresAt"]},"FileId":{"type":"string","pattern":"^file_[0-9a-hjkmnp-tv-z]{26}$"},"FileKind":{"type":"string","enum":["image","video","pdf","document","doc","audio","other"]},"FileMeta":{"type":"object","properties":{"width":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}],"description":"The width in pixels of an image or video; null when it does not apply or is not known yet."},"height":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}],"description":"The height in pixels of an image or video; null when it does not apply or is not known yet."},"durationMs":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}],"description":"The length of a video or audio file in milliseconds; null when it does not apply or is not known yet."},"pageCount":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}],"description":"How many pages a PDF or document has; null when it does not apply or is not known yet."}},"required":["width","height","durationMs","pageCount"]},"FileOrigin":{"type":"string","enum":["chat","agent","connector","table","library","form"]},"FileSourceChat":{"type":"object","properties":{"id":{"description":"The chat's id.","$ref":"#/components/schemas/ChatId"},"name":{"type":"string","description":"The chat's name."},"visibility":{"description":"Whether the chat is open to the whole organization (`organization`) or only to the people in it and the organization's owner and admins (`private`).","$ref":"#/components/schemas/Visibility"}},"required":["id","name","visibility"]},"FileStreamEvent":{"oneOf":[{"$ref":"#/components/schemas/StreamReadyEvent"},{"$ref":"#/components/schemas/StreamReplayedEvent"},{"$ref":"#/components/schemas/StreamResetEvent"},{"$ref":"#/components/schemas/StreamClosedEvent"},{"$ref":"#/components/schemas/MessageCreatedEvent"},{"$ref":"#/components/schemas/MessageUpdatedEvent"},{"$ref":"#/components/schemas/TurnQueuedEvent"},{"$ref":"#/components/schemas/TurnStartedEvent"},{"$ref":"#/components/schemas/TurnAwaitingApprovalEvent"},{"$ref":"#/components/schemas/TurnAwaitingTeamEvent"},{"$ref":"#/components/schemas/TurnAwaitingAnswerEvent"},{"$ref":"#/components/schemas/TurnAwaitingTimeEvent"},{"$ref":"#/components/schemas/TurnRequeuedEvent"},{"$ref":"#/components/schemas/TurnCancelRequestedEvent"},{"$ref":"#/components/schemas/TurnEndedEvent"},{"$ref":"#/components/schemas/ChainStoppedEvent"},{"$ref":"#/components/schemas/RequestCreatedEvent"},{"$ref":"#/components/schemas/RequestUpdatedEvent"},{"$ref":"#/components/schemas/AccessChangedEvent"},{"$ref":"#/components/schemas/FileUpdatedEvent"},{"$ref":"#/components/schemas/FileVersionAddedEvent"},{"$ref":"#/components/schemas/FileDeletedEvent"},{"$ref":"#/components/schemas/DocUpdatedEvent"},{"$ref":"#/components/schemas/AnnotationCreatedEvent"},{"$ref":"#/components/schemas/AnnotationDeletedEvent"},{"$ref":"#/components/schemas/ApprovalRequestedEvent"},{"$ref":"#/components/schemas/ApprovalDecidedEvent"},{"$ref":"#/components/schemas/ApprovalDecisionUndoneEvent"},{"$ref":"#/components/schemas/ApprovalApproversChangedEvent"},{"$ref":"#/components/schemas/ApprovalRoundStartedEvent"},{"$ref":"#/components/schemas/ApprovalCompletedEvent"},{"$ref":"#/components/schemas/ApprovalCancelledEvent"},{"$ref":"#/components/schemas/ApprovalPausedEvent"},{"$ref":"#/components/schemas/ApprovalResumedEvent"},{"$ref":"#/components/schemas/TurnSnapshotEvent"},{"$ref":"#/components/schemas/TurnStageEvent"},{"$ref":"#/components/schemas/TextDeltaEvent"},{"$ref":"#/components/schemas/ToolActivityEvent"},{"$ref":"#/components/schemas/BlockAddedEvent"}]},"FileSummary":{"type":"object","properties":{"id":{"description":"The file's id.","$ref":"#/components/schemas/FileId"},"organizationId":{"description":"The organization the file belongs to.","$ref":"#/components/schemas/OrganizationId"},"name":{"type":"string","minLength":1,"maxLength":255,"description":"The file's name, as the library shows it and downloads save it."},"kind":{"description":"The type of file: `image`, `video`, `pdf`, `document` (an uploaded document such as a slide deck, a spreadsheet or a text file), `doc` (a doc written in Fleepr's editor), `audio` or `other`.","$ref":"#/components/schemas/FileKind"},"mimeType":{"type":"string","minLength":1,"description":"The media type of the file's current version, such as `image/png`."},"sizeBytes":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"The size of the file's current version in bytes."},"currentVersionId":{"description":"The version the file shows now, its newest.","$ref":"#/components/schemas/FileVersionId"},"currentVersionNumber":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"The number of the current version, counting from 1."},"meta":{"description":"The current version's dimensions, length and page count, where they apply.","$ref":"#/components/schemas/FileMeta"},"processing":{"description":"Whether the previews are made: `pending` while they are, then `ready`, or `failed` when they could not be; the file still downloads.","$ref":"#/components/schemas/ProcessingStatus"},"thumbnailUrl":{"anyOf":[{"$ref":"#/components/schemas/Url"},{"type":"null"}],"description":"A signed link to a small preview image, valid until `urlsExpireAt`; null when there is none."},"urlsExpireAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}],"description":"When the signed preview links stop working, so fetch the file again before then; null without links."},"origin":{"description":"Where the file came from: a chat or comment (`chat`), an agent, a connector, a table cell (`table`), or made in Files (`library`): uploaded there, or a doc made there.","$ref":"#/components/schemas/FileOrigin"},"sourceChat":{"anyOf":[{"$ref":"#/components/schemas/FileSourceChat"},{"type":"null"}],"description":"The chat the file was first shared in; null when there is none or the caller may not view it."},"visibility":{"description":"Who may see the file: everyone in the organization (`organization`), or only its owner, the people it is shared with and the organization's owner and admins (`private`).","$ref":"#/components/schemas/Visibility"},"createdBy":{"description":"The member who added the file; for a file an agent or a connector made, the member it worked for.","$ref":"#/components/schemas/ActorId"},"createdAt":{"description":"When the file was added.","$ref":"#/components/schemas/IsoDateTime"},"annotationCount":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many annotations are drawn on the current version."},"commentCount":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many comments the file's thread holds across every version, not counting system notices."},"approval":{"anyOf":[{"$ref":"#/components/schemas/ApprovalSummary"},{"type":"null"}],"description":"The file's approval and what the caller may do in it; null when nobody requested one."},"revision":{"description":"Grows by one with every change; when two copies differ, keep the one with the higher revision.","$ref":"#/components/schemas/Revision"}},"required":["id","organizationId","name","kind","mimeType","sizeBytes","currentVersionId","currentVersionNumber","meta","processing","thumbnailUrl","urlsExpireAt","origin","sourceChat","visibility","createdBy","createdAt","annotationCount","commentCount","approval","revision"]},"FilesUploadPreview":{"type":"object","properties":{"kind":{"type":"string","const":"files_upload","description":"Bring several outside files into the media library."},"files":{"minItems":2,"maxItems":10,"type":"array","items":{"$ref":"#/components/schemas/FilesUploadPreviewFile"},"description":"The files to bring in, 2 to 10, in the order the agent named them."}},"required":["kind","files"]},"FilesUploadPreviewFile":{"type":"object","properties":{"fileName":{"type":"string","description":"The file's name."},"mimeType":{"type":"string","description":"The file's media type, such as `image/png`."},"sizeBytes":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}],"description":"The file's size in bytes; null when the source does not say."},"sourceHost":{"type":"string","description":"The host the file comes from, such as `drive.google.com`."},"address":{"type":"string","minLength":1,"maxLength":120,"description":"The whole address the server will ask, `https://` left out, path and query in: the card shows all of it."}},"required":["fileName","mimeType","sizeBytes","sourceHost","address"]},"FileUpdatedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"file.updated","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"type":"object","properties":{"file":{"description":"The file as it is after the change.","$ref":"#/components/schemas/FileSummary"}},"required":["file"],"description":"What the event carries; for a change, the object as it is after it."}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"FileUploadPreview":{"type":"object","properties":{"kind":{"type":"string","const":"file_upload","description":"Bring an outside file into the media library."},"fileName":{"type":"string","description":"The file's name."},"mimeType":{"type":"string","description":"The file's media type, such as `image/png`."},"sizeBytes":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}],"description":"The file's size in bytes; null when the source does not say."},"sourceHost":{"type":"string","description":"The host the file comes from, such as `drive.google.com`."}},"required":["kind","fileName","mimeType","sizeBytes","sourceHost"]},"FileVersion":{"type":"object","properties":{"id":{"description":"The version's id.","$ref":"#/components/schemas/FileVersionId"},"fileId":{"description":"The file the version belongs to.","$ref":"#/components/schemas/FileId"},"number":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"The version number, counting from 1 for the first upload."},"mimeType":{"type":"string","minLength":1,"description":"The media type of this version, such as `video/mp4`."},"sizeBytes":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"The size of this version in bytes."},"meta":{"description":"This version's dimensions, length and page count, where they apply.","$ref":"#/components/schemas/FileMeta"},"processing":{"description":"Whether the previews are made: `pending` while they are, then `ready`, or `failed` when they could not be; the file still downloads.","$ref":"#/components/schemas/ProcessingStatus"},"pages":{"type":"array","items":{"$ref":"#/components/schemas/FileVersionPage"},"description":"The pages to show, each with a signed link: one for an image, and one per page of a PDF, up to its first 50; empty for any other file, or when there are none."},"posterUrl":{"anyOf":[{"$ref":"#/components/schemas/Url"},{"type":"null"}],"description":"A signed link to a video's still image; null for other files or when there is none."},"playbackUrl":{"anyOf":[{"$ref":"#/components/schemas/Url"},{"type":"null"}],"description":"A signed link that plays a video or audio file in a browser; null for other files, and until the version is `ready`."},"urlsExpireAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}],"description":"When this version's signed links stop working, so fetch it again before then; null without links."},"note":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"description":"What changed in this version, in its uploader's words; null when no note was given."},"createdBy":{"description":"The member who added this version; for one an agent or a connector made, the member it worked for.","$ref":"#/components/schemas/ActorId"},"editedBy":{"default":null,"description":"The agent that made this version: its edit of a doc, or a version it added from a link, for the member in `createdBy`; null when no agent made it.","anyOf":[{"$ref":"#/components/schemas/AgentId"},{"type":"null"}]},"restoredFrom":{"default":null,"description":"The number of the earlier version this doc version restored; null when it restored none.","anyOf":[{"type":"integer","minimum":1,"maximum":9007199254740991},{"type":"null"}]},"createdAt":{"description":"When this version was added.","$ref":"#/components/schemas/IsoDateTime"}},"required":["id","fileId","number","mimeType","sizeBytes","meta","processing","pages","posterUrl","playbackUrl","urlsExpireAt","note","createdBy","editedBy","restoredFrom","createdAt"]},"FileVersionAddedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"file.version_added","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"type":"object","properties":{"file":{"description":"The file as it is now, showing the new version.","$ref":"#/components/schemas/FileSummary"},"version":{"description":"The new version.","$ref":"#/components/schemas/FileVersion"}},"required":["file","version"],"description":"What the event carries; for a change, the object as it is after it."}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"FileVersionAddedNotice":{"type":"object","properties":{"code":{"type":"string","const":"file_version_added","description":"A new version of the file was added."},"fileId":{"description":"The file.","$ref":"#/components/schemas/FileId"},"fileVersionId":{"description":"The new version.","$ref":"#/components/schemas/FileVersionId"},"number":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"The new version's number, counting from 1."},"by":{"description":"The member or agent who added it.","$ref":"#/components/schemas/ActorId"}},"required":["code","fileId","fileVersionId","number","by"]},"FileVersionId":{"type":"string","pattern":"^fver_[0-9a-hjkmnp-tv-z]{26}$"},"FileVersionPage":{"type":"object","properties":{"index":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"The page number, counting from 0."},"width":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"The width of the page image in pixels."},"height":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"The height of the page image in pixels."},"url":{"anyOf":[{"$ref":"#/components/schemas/Url"},{"type":"null"}],"description":"A signed link to the page image, valid until the version's `urlsExpireAt`; null until it is made."}},"required":["index","width","height","url"]},"FileVersionSummary":{"type":"object","properties":{"id":{"description":"The version's id.","$ref":"#/components/schemas/FileVersionId"},"number":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"The version number, counting from 1."},"createdBy":{"description":"The member who added this version; for one an agent or a connector made, the member it worked for.","$ref":"#/components/schemas/ActorId"},"editedBy":{"default":null,"description":"The agent that made this version: its edit of a doc, or a version it added from a link, for the member in `createdBy`; null when no agent made it.","anyOf":[{"$ref":"#/components/schemas/AgentId"},{"type":"null"}]},"restoredFrom":{"default":null,"description":"The number of the earlier version this doc version restored; null when it restored none.","anyOf":[{"type":"integer","minimum":1,"maximum":9007199254740991},{"type":"null"}]},"createdAt":{"description":"When this version was added.","$ref":"#/components/schemas/IsoDateTime"}},"required":["id","number","createdBy","editedBy","restoredFrom","createdAt"]},"FileVersionUploadPreview":{"type":"object","properties":{"kind":{"type":"string","const":"file_version_upload","description":"Add a version to a file from an outside address."},"fileId":{"description":"The file it acts on.","$ref":"#/components/schemas/FileId"},"fileName":{"type":"string","description":"The file's name."},"currentVersionNumber":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"The number of the file's current version: the new one is the next."},"currentMimeType":{"type":"string","description":"The current version's media type, such as `video/mp4`."},"mimeType":{"type":"string","description":"The new version's media type: what the address must answer with."},"kindChange":{"anyOf":[{"type":"object","properties":{"from":{"description":"The kind of file it is now.","$ref":"#/components/schemas/FileKind"},"to":{"description":"The kind of file the new version makes it.","$ref":"#/components/schemas/FileKind"}},"required":["from","to"]},{"type":"null"}],"description":"When the new type makes another kind of file (an image becoming a video): both kinds; else null."},"sourceHost":{"type":"string","description":"The host the new version comes from, such as `cdn.example.com`."},"address":{"type":"string","minLength":1,"maxLength":120,"description":"The whole address the server will ask, `https://` left out, path and query in: the card shows all of it."},"note":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"description":"What changed in the new version, in the agent’s words; null when it gave none."},"approval":{"anyOf":[{"type":"object","properties":{"status":{"description":"The approval's status now.","$ref":"#/components/schemas/ApprovalStatus"},"round":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"The approval's current round."}},"required":["status","round"]},{"type":"null"}],"description":"The file's approval as it is now, which the new version moves to its next round with every decision reset (none for a cancelled one); null when the file has none."}},"required":["kind","fileId","fileName","currentVersionNumber","currentMimeType","mimeType","kindChange","sourceHost","address","note","approval"]},"FilterCondition":{"type":"object","properties":{"columnId":{"description":"The column the condition tests.","$ref":"#/components/schemas/ColumnId"},"operator":{"description":"How the cell is compared. Each column type takes its own operators; a condition whose operator does not fit its column is dropped.","$ref":"#/components/schemas/FilterOperator"},"value":{"anyOf":[{"type":"string","maxLength":200},{"type":"number"},{"type":"boolean"},{"type":"null"}],"description":"What to compare with: text up to 200 characters, a number, or a date as `YYYY-MM-DD`, as the operator takes. Null for `is_empty`, `is_not_empty`, `is_checked` and `is_not_checked`; null on another operator leaves the condition out."}},"required":["columnId","operator","value"]},"FilterOperator":{"type":"string","enum":["contains","not_contains","is","is_not","is_empty","is_not_empty","eq","neq","gt","lt","gte","lte","before","after","is_checked","is_not_checked"]},"FirstTimeApproval":{"type":"object","properties":{"current":{"description":"The last 30 days.","$ref":"#/components/schemas/ApprovalRate"},"previous":{"anyOf":[{"$ref":"#/components/schemas/ApprovalRate"},{"type":"null"}],"description":"The 30 days before; null when fewer than 5 were decided then."}},"required":["current","previous"]},"Flow":{"type":"object","properties":{"id":{"description":"The flow's id.","$ref":"#/components/schemas/FlowId"},"organizationId":{"description":"The organization the flow belongs to.","$ref":"#/components/schemas/OrganizationId"},"name":{"type":"string","minLength":1,"maxLength":100,"description":"The flow's name, 1 to 100 characters."},"active":{"type":"boolean","description":"`true` when the flow is on and its schedule, events or dates start runs; a new flow starts paused unless it is created with `active: true`."},"pausedReason":{"anyOf":[{"$ref":"#/components/schemas/FlowPausedReason"},{"type":"null"}],"description":"Why the flow is paused, null when it is on: `manual` (by hand, or never turned on), `owner_deactivated`, `owner_made_viewer`, `invalid_definition` (it can no longer run) or `handed_over` (waiting for its new owner)."},"ownerId":{"description":"The member who owns the flow; every run acts with their access alone.","$ref":"#/components/schemas/MemberId"},"start":{"description":"How runs start: by hand, on a schedule, when an event happens, or when a record's date comes due.","$ref":"#/components/schemas/FlowStart"},"steps":{"minItems":1,"maxItems":30,"type":"array","items":{"$ref":"#/components/schemas/FlowStep"},"description":"The steps in order, 1 to 30, each done by an agent or signed off by a person."},"maxSendBacks":{"type":"integer","minimum":0,"maximum":10,"description":"How many times a run may send work back to an earlier step, from 0 to 10."},"currentVersion":{"description":"The current version of the start and steps, which new runs use.","$ref":"#/components/schemas/FlowVersionRef"},"chatId":{"anyOf":[{"$ref":"#/components/schemas/ChatId"},{"type":"null"}],"description":"A chat the flow was given, or null; runs never post there, since each run works in its own chat. Null for a chat the caller may not view."},"nextRunAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}],"description":"When the schedule starts the next run; null unless the flow is on and starts on a schedule."},"lastRun":{"anyOf":[{"$ref":"#/components/schemas/FlowRunSummary"},{"type":"null"}],"description":"The most recent run; null when the flow has never run."},"visibility":{"description":"Who may view the flow: `organization` for every member, `private` for its owner, those given access, and the organization's owner and admins.","$ref":"#/components/schemas/Visibility"},"createdBy":{"description":"Who created the flow.","$ref":"#/components/schemas/ActorId"},"createdAt":{"description":"When the flow was created.","$ref":"#/components/schemas/IsoDateTime"},"updatedAt":{"description":"When the flow last changed.","$ref":"#/components/schemas/IsoDateTime"},"revision":{"description":"The flow's revision, one more on every change; send it as `expectedRevision` to change the flow.","$ref":"#/components/schemas/Revision"},"myAccess":{"description":"What the caller may do with the flow: their access level and its actions.","$ref":"#/components/schemas/MyAccess"}},"required":["id","organizationId","name","active","pausedReason","ownerId","start","steps","maxSendBacks","currentVersion","chatId","nextRunAt","lastRun","visibility","createdBy","createdAt","updatedAt","revision","myAccess"]},"FlowActivatedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"flow.activated","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"description":"What the event carries; for a change, the object as it is after it.","$ref":"#/components/schemas/FlowPayload"}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"FlowCadenceInterval":{"type":"object","properties":{"optionId":{"description":"An option of the cadence column.","$ref":"#/components/schemas/SelectOptionId"},"every":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"How many units one cycle lasts, from 1: at most 366 days, 52 weeks or 24 months."},"unit":{"description":"`days`, `weeks` or `months`; a month keeps the date's day number, cut back in shorter months, and a month's last day stays on month ends.","$ref":"#/components/schemas/FlowCadenceUnit"}},"required":["optionId","every","unit"]},"FlowCadenceUnit":{"type":"string","enum":["days","weeks","months"]},"FlowConditionOperator":{"type":"string","enum":["is","is_not","contains"]},"FlowCreatedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"flow.created","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"description":"What the event carries; for a change, the object as it is after it.","$ref":"#/components/schemas/FlowPayload"}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"FlowCreatePreview":{"type":"object","properties":{"kind":{"type":"string","const":"flow_create","description":"Create a flow, paused."},"name":{"type":"string","minLength":1,"maxLength":100,"description":"The new flow's name."},"start":{"description":"How it starts once a person turns it on.","$ref":"#/components/schemas/FlowStart"},"startWords":{"type":"string","maxLength":500,"description":"The start in words, with its names."},"steps":{"minItems":1,"maxItems":30,"type":"array","items":{"$ref":"#/components/schemas/PreviewFlowStep"},"description":"Every step, in order, whole."},"maxSendBacks":{"type":"integer","minimum":0,"maximum":10,"description":"How many times a run may send back."}},"required":["kind","name","start","startWords","steps","maxSendBacks"]},"FlowDateOffset":{"type":"object","properties":{"direction":{"description":"Whether the run starts `before` or `after` the date.","$ref":"#/components/schemas/FlowDateOffsetDirection"},"amount":{"type":"integer","minimum":1,"maximum":999,"description":"How many units, 1 to 999, and at most 366 days in all."},"unit":{"description":"`minutes`, `hours`, `days` or `weeks`: days and weeks count calendar days on the organization's clock, minutes and hours exact time.","$ref":"#/components/schemas/FlowDateOffsetUnit"}},"required":["direction","amount","unit"]},"FlowDateOffsetDirection":{"type":"string","enum":["before","after"]},"FlowDateOffsetUnit":{"type":"string","enum":["minutes","hours","days","weeks"]},"FlowDayOfMonth":{"anyOf":[{"type":"integer","minimum":1,"maximum":28},{"type":"string","const":"last"}]},"FlowDeletedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"flow.deleted","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"description":"What the event carries; for a change, the object as it is after it.","$ref":"#/components/schemas/FlowDeletedPayload"}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"FlowDeletedPayload":{"type":"object","properties":{"flowId":{"description":"The id of the deleted flow.","$ref":"#/components/schemas/FlowId"}},"required":["flowId"]},"FlowId":{"type":"string","pattern":"^flow_[0-9a-hjkmnp-tv-z]{26}$"},"FlowInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100,"description":"The flow's name, 1 to 100 characters."},"active":{"description":"`true` turns the flow on and `false` pauses it; left out, a new flow is paused and a saved one keeps its state.","type":"boolean"},"start":{"description":"How runs start: by hand, on a schedule, when an event happens, or when a record's date comes due.","$ref":"#/components/schemas/FlowStartInput"},"steps":{"minItems":1,"maxItems":30,"type":"array","items":{"$ref":"#/components/schemas/FlowStepInput"},"description":"The steps in order, 1 to 30; send an existing step's `id` to keep it."},"maxSendBacks":{"description":"How many times a run may send work back, from 0 to 10; left out, 3 on create and unchanged on save.","type":"integer","minimum":0,"maximum":10},"chatId":{"description":"A chat to give the flow, one the caller can see; `null` clears it, and left out, none on create and unchanged on save.","anyOf":[{"$ref":"#/components/schemas/ChatId"},{"type":"null"}]}},"required":["name","start","steps"],"additionalProperties":false},"FlowPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Flow"},"description":"This page of the list."},"nextCursor":{"anyOf":[{"$ref":"#/components/schemas/Cursor"},{"type":"null"}],"description":"Send it back as `cursor` to read the next page; null on the last page."},"totalCount":{"description":"How many items match across every page, among those you may see.","$ref":"#/components/schemas/TotalCount"},"activeCount":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many of the flows the caller can view are on, across every page."},"pausedCount":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many of the flows the caller can view are paused, across every page."}},"required":["items","nextCursor","totalCount","activeCount","pausedCount"]},"FlowPausedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"flow.paused","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"description":"What the event carries; for a change, the object as it is after it.","$ref":"#/components/schemas/FlowPayload"}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"FlowPausedReason":{"type":"string","enum":["manual","owner_deactivated","owner_made_viewer","invalid_definition","handed_over"]},"FlowPayload":{"type":"object","properties":{"flow":{"description":"The flow as it is after the change.","$ref":"#/components/schemas/FlowWithoutAccess"}},"required":["flow"]},"FlowRecordCadence":{"type":"object","properties":{"columnId":{"description":"A select column of the same table, whose option gives each record's interval.","$ref":"#/components/schemas/ColumnId"},"intervals":{"minItems":1,"maxItems":100,"type":"array","items":{"$ref":"#/components/schemas/FlowCadenceInterval"},"description":"The interval each option means, 1 to 100, each option once; a record whose cell is empty, or holds an option left out, is not moved."}},"required":["columnId","intervals"]},"FlowRecordDate":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"column","description":"A date column of the table."},"columnId":{"description":"The date column's id.","$ref":"#/components/schemas/ColumnId"}},"required":["type","columnId"]},{"type":"object","properties":{"type":{"type":"string","const":"created_at","description":"When the record was created."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"updated_at","description":"When the record was last edited."}},"required":["type"]}]},"FlowRun":{"type":"object","properties":{"id":{"description":"The run's id.","$ref":"#/components/schemas/FlowRunId"},"number":{"description":"The run's number within its flow, as in \"Run #42\": 1 for the first run, then one more per run, never reused.","type":"integer","minimum":1,"maximum":9007199254740991},"status":{"description":"`queued` has not started a step yet, `running` is working, `waiting` waits on a sign-off or a request card; `completed`, `failed` and `cancelled` have ended.","$ref":"#/components/schemas/FlowRunStatus"},"currentStepIndex":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}],"description":"The position, from 0, of the step being run or waited on; null when no step is current."},"startedAt":{"description":"When the run started.","$ref":"#/components/schemas/IsoDateTime"},"endedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}],"description":"When the run ended; null until it is `completed`, `failed` or `cancelled`."},"costMicros":{"default":null,"description":"What the run has spent on AI so far, in millionths of a US dollar; null in events and for anyone but the organization's owner and admins.","anyOf":[{"$ref":"#/components/schemas/Micros"},{"type":"null"}]},"flowId":{"description":"The flow the run belongs to.","$ref":"#/components/schemas/FlowId"},"flowVersion":{"description":"The flow version the run started with, which it keeps whatever later saves change.","$ref":"#/components/schemas/FlowVersionRef"},"trigger":{"description":"What started the run: play, the schedule, an event or a record's date.","$ref":"#/components/schemas/FlowRunTrigger"},"chainId":{"description":"The agent chain whose turns do the run's agent steps.","$ref":"#/components/schemas/ChainId"},"initiatorId":{"description":"The flow's owner when the run started: the run acts with this member's access alone.","$ref":"#/components/schemas/MemberId"},"parentChainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"For a run started by an event that an agent chain wrote, that chain; null otherwise."},"sendBackCount":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many times work has been sent back in this run so far."},"maxSendBacks":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"The most send-backs the run allows, copied from the flow when it started; one more fails the run."},"chatId":{"anyOf":[{"$ref":"#/components/schemas/ChatId"},{"type":"null"}],"description":"The run's own chat, where its agent steps work and only its readers look; null without agent steps."},"failure":{"anyOf":[{"$ref":"#/components/schemas/FlowRunFailure"},{"type":"null"}],"description":"Why the run failed; null unless `status` is `failed`."},"cancelledBy":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"The member who cancelled the run, deleted its flow or paused all agents; null when no member did, such as when its owner was removed."},"steps":{"type":"array","items":{"$ref":"#/components/schemas/StepRun"},"description":"Every step run so far, in the order they started."}},"required":["id","status","currentStepIndex","startedAt","endedAt","costMicros","flowId","flowVersion","trigger","chainId","initiatorId","parentChainId","sendBackCount","maxSendBacks","chatId","failure","cancelledBy","steps"]},"FlowRunEndedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"flow_run.ended","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"description":"What the event carries; for a change, the object as it is after it.","$ref":"#/components/schemas/FlowRunPayload"}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"FlowRunFailure":{"type":"object","properties":{"message":{"type":"string","minLength":1,"description":"Why the run failed, in plain words that are safe to show anyone who may view the flow."}},"required":["message"]},"FlowRunId":{"type":"string","pattern":"^run_[0-9a-hjkmnp-tv-z]{26}$"},"FlowRunPayload":{"type":"object","properties":{"run":{"description":"The whole run as it is after the change.","$ref":"#/components/schemas/FlowRun"}},"required":["run"]},"FlowRunPreview":{"type":"object","properties":{"kind":{"type":"string","const":"flow_run","description":"Run a flow now."},"flowId":{"description":"The flow to run.","$ref":"#/components/schemas/FlowId"},"flowName":{"type":"string","description":"The flow's name."},"ownerId":{"description":"The flow's owner: the run acts with their access alone, whoever decides the card.","$ref":"#/components/schemas/MemberId"},"stepCount":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"How many steps the flow's current version has."}},"required":["kind","flowId","flowName","ownerId","stepCount"]},"FlowRunSentBackEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"flow_run.sent_back","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"description":"What the event carries; for a change, the object as it is after it.","$ref":"#/components/schemas/FlowRunPayload"}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"FlowRunStartedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"flow_run.started","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"description":"What the event carries; for a change, the object as it is after it.","$ref":"#/components/schemas/FlowRunPayload"}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"FlowRunStatus":{"type":"string","enum":["queued","running","waiting","completed","failed","cancelled"]},"FlowRunStepCompletedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"flow_run.step_completed","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"description":"What the event carries; for a change, the object as it is after it.","$ref":"#/components/schemas/FlowRunPayload"}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"FlowRunStepStartedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"flow_run.step_started","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"description":"What the event carries; for a change, the object as it is after it.","$ref":"#/components/schemas/FlowRunPayload"}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"FlowRunSummary":{"type":"object","properties":{"id":{"description":"The run's id.","$ref":"#/components/schemas/FlowRunId"},"number":{"description":"The run's number within its flow, as in \"Run #42\": 1 for the first run, then one more per run, never reused.","type":"integer","minimum":1,"maximum":9007199254740991},"status":{"description":"`queued` has not started a step yet, `running` is working, `waiting` waits on a sign-off or a request card; `completed`, `failed` and `cancelled` have ended.","$ref":"#/components/schemas/FlowRunStatus"},"currentStepIndex":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}],"description":"The position, from 0, of the step being run or waited on; null when no step is current."},"startedAt":{"description":"When the run started.","$ref":"#/components/schemas/IsoDateTime"},"endedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}],"description":"When the run ended; null until it is `completed`, `failed` or `cancelled`."},"costMicros":{"default":null,"description":"What the run has spent on AI so far, in millionths of a US dollar; null in events and for anyone but the organization's owner and admins.","anyOf":[{"$ref":"#/components/schemas/Micros"},{"type":"null"}]},"failure":{"description":"Why the run failed; null unless `status` is `failed`.","anyOf":[{"$ref":"#/components/schemas/FlowRunFailure"},{"type":"null"}]}},"required":["id","status","currentStepIndex","startedAt","endedAt","costMicros"]},"FlowRunSummaryPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/FlowRunSummary"},"description":"This page of the list."},"nextCursor":{"anyOf":[{"$ref":"#/components/schemas/Cursor"},{"type":"null"}],"description":"Send it back as `cursor` to read the next page; null on the last page."}},"required":["items","nextCursor"]},"FlowRunTrigger":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"manual","description":"Started by hand: someone pressed play, or approved an agent's request to run the flow."},"startedBy":{"description":"The member who pressed play or approved the agent's request; the run still acts with the flow owner's access.","$ref":"#/components/schemas/MemberId"},"input":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"description":"The text given to the first step when the run was started, or null."}},"required":["kind","startedBy","input"]},{"type":"object","properties":{"kind":{"type":"string","const":"schedule","description":"Started by the flow's schedule."},"scheduledFor":{"description":"The scheduled time the run is for.","$ref":"#/components/schemas/IsoDateTime"}},"required":["kind","scheduledFor"]},{"type":"object","properties":{"kind":{"type":"string","const":"event","description":"Started by an event that matched the flow's start."},"eventId":{"description":"The id of the event that matched the flow's start.","$ref":"#/components/schemas/EventId"},"eventType":{"description":"The type of that event, such as `record.created`.","$ref":"#/components/schemas/FlowTriggerEventType"},"object":{"description":"What the event is about, by id only; the run's first agent step is told it.","$ref":"#/components/schemas/FlowRunTriggerObject"}},"required":["kind","eventId","eventType","object"]},{"type":"object","properties":{"kind":{"type":"string","const":"record_date","description":"Started because a record's date came due."},"object":{"type":"object","properties":{"type":{"type":"string","const":"record","description":"A record."},"id":{"description":"The record's id.","$ref":"#/components/schemas/RecordId"},"tableId":{"description":"The table the record is in.","$ref":"#/components/schemas/TableId"}},"required":["type","id","tableId"],"description":"The record that came due, by id only; the run's first agent step is told it."},"date":{"description":"Which of the record's dates came due: a date column by id, or its created or updated time.","$ref":"#/components/schemas/FlowRecordDate"}},"required":["kind","object","date"]}]},"FlowRunTriggerObject":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"record","description":"A record."},"id":{"description":"The record's id.","$ref":"#/components/schemas/RecordId"},"tableId":{"description":"The table the record is in.","$ref":"#/components/schemas/TableId"}},"required":["type","id","tableId"]},{"type":"object","properties":{"type":{"type":"string","const":"file","description":"A file."},"id":{"description":"The file's id.","$ref":"#/components/schemas/FileId"}},"required":["type","id"]},{"type":"object","properties":{"type":{"type":"string","const":"approval","description":"An approval on a file."},"id":{"description":"The approval's id.","$ref":"#/components/schemas/ApprovalId"},"fileId":{"description":"The file the approval is on.","$ref":"#/components/schemas/FileId"}},"required":["type","id","fileId"]}]},"FlowRunWaitingEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"flow_run.waiting","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"description":"What the event carries; for a change, the object as it is after it.","$ref":"#/components/schemas/FlowRunPayload"}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"FlowScheduleRepeat":{"type":"string","enum":["daily","weekdays","weekly","monthly"]},"FlowStart":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"manual","description":"Runs only when someone starts it by hand."}},"required":["kind"]},{"type":"object","properties":{"kind":{"type":"string","const":"schedule","description":"Runs on a schedule."},"repeat":{"description":"How often it runs: `daily`, `weekdays` (Monday to Friday), `weekly` or `monthly`.","$ref":"#/components/schemas/FlowScheduleRepeat"},"dayOfWeek":{"anyOf":[{"$ref":"#/components/schemas/FlowWeekday"},{"type":"null"}],"description":"The day a `weekly` schedule runs; null for other repeats."},"dayOfMonth":{"anyOf":[{"$ref":"#/components/schemas/FlowDayOfMonth"},{"type":"null"}],"description":"The day a `monthly` schedule runs, 1 to 28 or `last`; null for other repeats."},"time":{"description":"The time it runs, as `HH:mm` in the organization's time zone.","$ref":"#/components/schemas/TimeOfDay"}},"required":["kind","repeat","dayOfWeek","dayOfMonth","time"]},{"type":"object","properties":{"kind":{"type":"string","const":"event","description":"Runs when an event happens."},"event":{"description":"The event that starts a run, one of List trigger events.","$ref":"#/components/schemas/FlowTriggerEventType"},"object":{"anyOf":[{"$ref":"#/components/schemas/FlowTriggerObjectRef"},{"type":"null"}],"description":"Only events about this table or file; null for events about any."},"conditions":{"maxItems":10,"type":"array","items":{"$ref":"#/components/schemas/FlowTriggerCondition"},"description":"Conditions on the event's fields, up to 10, that must all hold; empty for none."}},"required":["kind","event","object","conditions"]},{"type":"object","properties":{"kind":{"type":"string","const":"record_date","description":"Runs once for each record of a table when its date comes due."},"tableId":{"description":"The table whose records it watches.","$ref":"#/components/schemas/TableId"},"date":{"description":"The date each record comes due on: a date column of the table, or the record's created or updated time.","$ref":"#/components/schemas/FlowRecordDate"},"offset":{"anyOf":[{"$ref":"#/components/schemas/FlowDateOffset"},{"type":"null"}],"description":"How long before or after the date the run starts; null for on the date itself."},"time":{"anyOf":[{"$ref":"#/components/schemas/TimeOfDay"},{"type":"null"}],"description":"When a date without time comes due, as `HH:mm` in the organization's time zone; null for a date that holds its own time."},"cadence":{"anyOf":[{"$ref":"#/components/schemas/FlowRecordCadence"},{"type":"null"}],"description":"With a select column, each record's date moves on to its next cycle once its run starts; null for one run per date, moving nothing."},"conditions":{"maxItems":10,"type":"array","items":{"$ref":"#/components/schemas/FlowTriggerCondition"},"description":"Conditions on the record's fields as they are when its run would start, up to 10, that must all hold: `record.label` or `record.values.<column id>`; empty for none."}},"required":["kind","tableId","date","offset","time","cadence","conditions"]}]},"FlowStartInput":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"manual","description":"Runs only when someone starts it by hand."}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"schedule","description":"Runs on a schedule."},"repeat":{"description":"How often it runs: `daily`, `weekdays` (Monday to Friday), `weekly` or `monthly`.","$ref":"#/components/schemas/FlowScheduleRepeat"},"dayOfWeek":{"anyOf":[{"$ref":"#/components/schemas/FlowWeekday"},{"type":"null"}],"description":"The day a `weekly` schedule runs; null for other repeats."},"dayOfMonth":{"anyOf":[{"$ref":"#/components/schemas/FlowDayOfMonth"},{"type":"null"}],"description":"The day a `monthly` schedule runs, 1 to 28 or `last`; null for other repeats."},"time":{"description":"The time it runs, as `HH:mm` in the organization's time zone.","$ref":"#/components/schemas/TimeOfDay"}},"required":["kind","repeat","dayOfWeek","dayOfMonth","time"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"event","description":"Runs when an event happens."},"event":{"description":"The event that starts a run, one of List trigger events.","$ref":"#/components/schemas/FlowTriggerEventType"},"object":{"anyOf":[{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"table","description":"A table."},"id":{"description":"The table's id.","$ref":"#/components/schemas/TableId"}},"required":["type","id"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"file","description":"A file."},"id":{"description":"The file's id.","$ref":"#/components/schemas/FileId"}},"required":["type","id"],"additionalProperties":false}]},{"type":"null"}],"description":"Only events about this table or file; null for events about any."},"conditions":{"maxItems":10,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","minLength":1,"maxLength":200,"description":"The field to test: a `path` from the event's `fields`, such as `approval.status`."},"operator":{"description":"How to test it: `is`, `is_not` or `contains`, comparing as text and ignoring case.","$ref":"#/components/schemas/FlowConditionOperator"},"value":{"type":"string","minLength":1,"maxLength":200,"description":"The value to compare with; a field that holds ids also matches by its label, such as \"Approved\"."}},"required":["field","operator","value"],"additionalProperties":false},"description":"Conditions on the event's fields, up to 10, that must all hold; empty for none."}},"required":["kind","event","object","conditions"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"record_date","description":"Runs once for each record of a table when its date comes due."},"tableId":{"description":"The table whose records it watches.","$ref":"#/components/schemas/TableId"},"date":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"column","description":"A date column of the table."},"columnId":{"description":"The date column's id.","$ref":"#/components/schemas/ColumnId"}},"required":["type","columnId"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"created_at","description":"When the record was created."}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"updated_at","description":"When the record was last edited."}},"required":["type"],"additionalProperties":false}],"description":"The date each record comes due on: a date column of the table, or the record's created or updated time."},"offset":{"anyOf":[{"type":"object","properties":{"direction":{"description":"Whether the run starts `before` or `after` the date.","$ref":"#/components/schemas/FlowDateOffsetDirection"},"amount":{"type":"integer","minimum":1,"maximum":999,"description":"How many units, 1 to 999, and at most 366 days in all."},"unit":{"description":"`minutes`, `hours`, `days` or `weeks`: days and weeks count calendar days on the organization's clock, minutes and hours exact time.","$ref":"#/components/schemas/FlowDateOffsetUnit"}},"required":["direction","amount","unit"],"additionalProperties":false},{"type":"null"}],"description":"How long before or after the date the run starts; null for on the date itself."},"time":{"anyOf":[{"$ref":"#/components/schemas/TimeOfDay"},{"type":"null"}],"description":"When a date without time comes due, as `HH:mm` in the organization's time zone; null for a date that holds its own time."},"cadence":{"anyOf":[{"type":"object","properties":{"columnId":{"description":"A select column of the same table, whose option gives each record's interval.","$ref":"#/components/schemas/ColumnId"},"intervals":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"object","properties":{"optionId":{"description":"An option of the cadence column.","$ref":"#/components/schemas/SelectOptionId"},"every":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"How many units one cycle lasts, from 1: at most 366 days, 52 weeks or 24 months."},"unit":{"description":"`days`, `weeks` or `months`; a month keeps the date's day number, cut back in shorter months, and a month's last day stays on month ends.","$ref":"#/components/schemas/FlowCadenceUnit"}},"required":["optionId","every","unit"],"additionalProperties":false},"description":"The interval each option means, 1 to 100, each option once; a record whose cell is empty, or holds an option left out, is not moved."}},"required":["columnId","intervals"],"additionalProperties":false},{"type":"null"}],"description":"With a select column, each record's date moves on to its next cycle once its run starts; null for one run per date, moving nothing."},"conditions":{"maxItems":10,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","minLength":1,"maxLength":200,"description":"The field to test: a `path` from the event's `fields`, such as `approval.status`."},"operator":{"description":"How to test it: `is`, `is_not` or `contains`, comparing as text and ignoring case.","$ref":"#/components/schemas/FlowConditionOperator"},"value":{"type":"string","minLength":1,"maxLength":200,"description":"The value to compare with; a field that holds ids also matches by its label, such as \"Approved\"."}},"required":["field","operator","value"],"additionalProperties":false},"description":"Conditions on the record's fields as they are when its run would start, up to 10, that must all hold: `record.label` or `record.values.<column id>`; empty for none."}},"required":["kind","tableId","date","offset","time","cadence","conditions"],"additionalProperties":false}]},"FlowStep":{"type":"object","properties":{"id":{"description":"The step's id, kept across versions.","$ref":"#/components/schemas/FlowStepId"},"assignee":{"description":"Who does the step: an agent, or a person who signs it off.","$ref":"#/components/schemas/FlowStepAssignee"},"does":{"type":"string","minLength":1,"maxLength":2000,"description":"What the step does, as its agent or person reads it; up to 2,000 characters."},"passes":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"description":"What the step hands on to the next one, up to 1,000 characters; null when not said."},"returnTo":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}],"description":"When this step's person asks for changes, the earlier step the work returns to, from 0; null when it cannot."},"outsideAgentsMayDecide":{"default":false,"deprecated":true,"description":"Deprecated and ignored; it no longer changes who may decide a sign-off.","type":"boolean"}},"required":["id","assignee","does","passes","returnTo","outsideAgentsMayDecide"]},"FlowStepAssignee":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"agent","description":"Done by an agent."},"agentId":{"description":"The agent that does the step.","$ref":"#/components/schemas/AgentId"}},"required":["kind","agentId"]},{"type":"object","properties":{"kind":{"type":"string","const":"member","description":"Signed off by a person."},"memberId":{"description":"The member who signs the step off.","$ref":"#/components/schemas/MemberId"}},"required":["kind","memberId"]}]},"FlowStepId":{"type":"string","pattern":"^step_[0-9a-hjkmnp-tv-z]{26}$"},"FlowStepInput":{"type":"object","properties":{"id":{"description":"The id of an existing step to keep; leave it out for a new step.","$ref":"#/components/schemas/FlowStepId"},"assignee":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"agent","description":"Done by an agent."},"agentId":{"description":"The agent that does the step.","$ref":"#/components/schemas/AgentId"}},"required":["kind","agentId"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"member","description":"Signed off by a person."},"memberId":{"description":"The member who signs the step off.","$ref":"#/components/schemas/MemberId"}},"required":["kind","memberId"],"additionalProperties":false}],"description":"Who does the step: an agent, or a person who signs it off."},"does":{"type":"string","minLength":1,"maxLength":2000,"description":"What the step does, as its agent or person reads it; up to 2,000 characters."},"passes":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"description":"What the step hands on to the next one, up to 1,000 characters; null when not said."},"returnTo":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}],"description":"When this step's person asks for changes, the earlier step the work returns to, from 0; null when it cannot."},"outsideAgentsMayDecide":{"deprecated":true,"description":"Deprecated and ignored; `true` is still refused on an agent step.","type":"boolean"}},"required":["assignee","does","passes","returnTo"],"additionalProperties":false},"FlowTriggerCondition":{"type":"object","properties":{"field":{"type":"string","minLength":1,"maxLength":200,"description":"The field to test: a `path` from the event's `fields`, such as `approval.status`."},"operator":{"description":"How to test it: `is`, `is_not` or `contains`, comparing as text and ignoring case.","$ref":"#/components/schemas/FlowConditionOperator"},"value":{"type":"string","minLength":1,"maxLength":200,"description":"The value to compare with; a field that holds ids also matches by its label, such as \"Approved\"."}},"required":["field","operator","value"]},"FlowTriggerEventDef":{"type":"object","properties":{"type":{"description":"The event's type, as a start's `event` names it.","$ref":"#/components/schemas/FlowTriggerEventType"},"label":{"type":"string","description":"The event's name as the flow form shows it."},"objectType":{"anyOf":[{"$ref":"#/components/schemas/FlowTriggerObjectType"},{"type":"null"}],"description":"The kind of object a start may narrow the event to, `table` or `file`; null when it takes none."},"fields":{"type":"array","items":{"$ref":"#/components/schemas/FlowTriggerField"},"description":"The fields of the event that conditions can test."}},"required":["type","label","objectType","fields"]},"FlowTriggerEventList":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/FlowTriggerEventDef"},"description":"Every event that can start a flow."}},"required":["items"]},"FlowTriggerEventType":{"type":"string","enum":["file.created","file.version_added","record.created","record.updated","approval.decided","approval.completed"]},"FlowTriggerField":{"type":"object","properties":{"path":{"type":"string","minLength":1,"description":"What a condition's `field` holds to test this field, such as `approval.status`."},"label":{"type":"string","description":"The field's name as the flow form shows it."},"valueType":{"description":"What the field holds: `string`, `number`, `boolean`, or `id` for ids, also matched by their label.","$ref":"#/components/schemas/FlowTriggerFieldValueType"}},"required":["path","label","valueType"]},"FlowTriggerFieldValueType":{"type":"string","enum":["string","number","boolean","id"]},"FlowTriggerObjectRef":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"table","description":"A table."},"id":{"description":"The table's id.","$ref":"#/components/schemas/TableId"}},"required":["type","id"]},{"type":"object","properties":{"type":{"type":"string","const":"file","description":"A file."},"id":{"description":"The file's id.","$ref":"#/components/schemas/FileId"}},"required":["type","id"]}]},"FlowTriggerObjectType":{"type":"string","enum":["table","file"]},"FlowUpdatedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"flow.updated","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"description":"What the event carries; for a change, the object as it is after it.","$ref":"#/components/schemas/FlowPayload"}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"FlowUpdatePreview":{"type":"object","properties":{"kind":{"type":"string","const":"flow_update","description":"Change a flow."},"flowId":{"description":"The flow it changes.","$ref":"#/components/schemas/FlowId"},"flowName":{"type":"string","description":"The flow's name now."},"name":{"anyOf":[{"$ref":"#/components/schemas/PreviewTextChange"},{"type":"null"}],"description":"The new name; null when it stays."},"start":{"anyOf":[{"$ref":"#/components/schemas/PreviewFlowStartChange"},{"type":"null"}],"description":"The new start; null when it stays."},"maxSendBacks":{"anyOf":[{"type":"object","properties":{"before":{"type":"integer","minimum":0,"maximum":10,"description":"The send-backs before."},"after":{"type":"integer","minimum":0,"maximum":10,"description":"The send-backs after."}},"required":["before","after"]},{"type":"null"}],"description":"How many send-backs a run takes, before and after; null when it stays."},"steps":{"minItems":1,"maxItems":60,"type":"array","items":{"$ref":"#/components/schemas/PreviewFlowStepChange"},"description":"Every step of the result in order, and every step removed, each whole."}},"required":["kind","flowId","flowName","name","start","maxSendBacks","steps"]},"FlowVersion":{"type":"object","properties":{"id":{"description":"The version's id.","$ref":"#/components/schemas/FlowVersionId"},"flowId":{"description":"The flow it is a version of.","$ref":"#/components/schemas/FlowId"},"number":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"The version number: 1 for the first, then one more for each save that changes the start or the steps."},"start":{"description":"How runs of this version start, as saved.","$ref":"#/components/schemas/FlowStart"},"steps":{"minItems":1,"maxItems":30,"type":"array","items":{"$ref":"#/components/schemas/FlowStep"},"description":"The steps of this version, in order, as saved."},"savedBy":{"description":"The member who saved this version.","$ref":"#/components/schemas/MemberId"},"createdAt":{"description":"When the version was saved.","$ref":"#/components/schemas/IsoDateTime"}},"required":["id","flowId","number","start","steps","savedBy","createdAt"]},"FlowVersionCreatedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"flow.version_created","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"description":"What the event carries; for a change, the object as it is after it.","$ref":"#/components/schemas/FlowPayload"}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"FlowVersionId":{"type":"string","pattern":"^flv_[0-9a-hjkmnp-tv-z]{26}$"},"FlowVersionPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/FlowVersionSummary"},"description":"This page of the list."},"nextCursor":{"anyOf":[{"$ref":"#/components/schemas/Cursor"},{"type":"null"}],"description":"Send it back as `cursor` to read the next page; null on the last page."}},"required":["items","nextCursor"]},"FlowVersionRef":{"type":"object","properties":{"id":{"description":"The version's id; Get a flow version reads the whole version.","$ref":"#/components/schemas/FlowVersionId"},"number":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"The version number: 1 for the first, then one more for each save that changes the start or the steps."}},"required":["id","number"]},"FlowVersionSummary":{"type":"object","properties":{"id":{"description":"The version's id.","$ref":"#/components/schemas/FlowVersionId"},"number":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"The version number: 1 for the first, then one more for each save that changes the start or the steps."},"savedBy":{"description":"The member who saved this version.","$ref":"#/components/schemas/MemberId"},"createdAt":{"description":"When the version was saved.","$ref":"#/components/schemas/IsoDateTime"}},"required":["id","number","savedBy","createdAt"]},"FlowWeekday":{"type":"string","enum":["mon","tue","wed","thu","fri","sat","sun"]},"FlowWithoutAccess":{"type":"object","properties":{"id":{"description":"The flow's id.","$ref":"#/components/schemas/FlowId"},"organizationId":{"description":"The organization the flow belongs to.","$ref":"#/components/schemas/OrganizationId"},"name":{"type":"string","minLength":1,"maxLength":100,"description":"The flow's name, 1 to 100 characters."},"active":{"type":"boolean","description":"`true` when the flow is on and its schedule, events or dates start runs; a new flow starts paused unless it is created with `active: true`."},"pausedReason":{"anyOf":[{"$ref":"#/components/schemas/FlowPausedReason"},{"type":"null"}],"description":"Why the flow is paused, null when it is on: `manual` (by hand, or never turned on), `owner_deactivated`, `owner_made_viewer`, `invalid_definition` (it can no longer run) or `handed_over` (waiting for its new owner)."},"ownerId":{"description":"The member who owns the flow; every run acts with their access alone.","$ref":"#/components/schemas/MemberId"},"start":{"description":"How runs start: by hand, on a schedule, when an event happens, or when a record's date comes due.","$ref":"#/components/schemas/FlowStart"},"steps":{"minItems":1,"maxItems":30,"type":"array","items":{"$ref":"#/components/schemas/FlowStep"},"description":"The steps in order, 1 to 30, each done by an agent or signed off by a person."},"maxSendBacks":{"type":"integer","minimum":0,"maximum":10,"description":"How many times a run may send work back to an earlier step, from 0 to 10."},"currentVersion":{"description":"The current version of the start and steps, which new runs use.","$ref":"#/components/schemas/FlowVersionRef"},"chatId":{"anyOf":[{"$ref":"#/components/schemas/ChatId"},{"type":"null"}],"description":"A chat the flow was given, or null; runs never post there, since each run works in its own chat. Null for a chat the caller may not view."},"nextRunAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}],"description":"When the schedule starts the next run; null unless the flow is on and starts on a schedule."},"lastRun":{"anyOf":[{"$ref":"#/components/schemas/FlowRunSummary"},{"type":"null"}],"description":"The most recent run; null when the flow has never run."},"visibility":{"description":"Who may view the flow: `organization` for every member, `private` for its owner, those given access, and the organization's owner and admins.","$ref":"#/components/schemas/Visibility"},"createdBy":{"description":"Who created the flow.","$ref":"#/components/schemas/ActorId"},"createdAt":{"description":"When the flow was created.","$ref":"#/components/schemas/IsoDateTime"},"updatedAt":{"description":"When the flow last changed.","$ref":"#/components/schemas/IsoDateTime"},"revision":{"description":"The flow's revision, one more on every change; send it as `expectedRevision` to change the flow.","$ref":"#/components/schemas/Revision"}},"required":["id","organizationId","name","active","pausedReason","ownerId","start","steps","maxSendBacks","currentVersion","chatId","nextRunAt","lastRun","visibility","createdBy","createdAt","updatedAt","revision"]},"ForbiddenReason":{"type":"string","enum":["credential_scope","outside_agents_off","asker_requires_person","own_work","gives_access","admin_only","paused","decision_cap","expired","inactive","stale","arguments_hidden","not_decider","audience_wider"]},"FormAskRespondent":{"type":"string","enum":["off","optional","required"]},"FormChallengeToken":{"type":"string","minLength":1,"maxLength":2048,"description":"The token the check gave, only when a busy link asked for one; checked once."},"FormCreatePreview":{"type":"object","properties":{"kind":{"type":"string","const":"form_create","description":"Create a form on a table."},"tableId":{"description":"The table it acts on.","$ref":"#/components/schemas/TableId"},"tableName":{"type":"string","description":"The table's name."},"name":{"type":"string","minLength":1,"maxLength":80,"description":"The form's name, in the table's views menu."},"title":{"type":"string","minLength":1,"maxLength":120,"description":"The form's title, as the respondent reads it."},"description":{"type":"string","maxLength":2000,"description":"The intro under the title; empty for none."},"questions":{"maxItems":100,"type":"array","items":{"$ref":"#/components/schemas/PreviewFormQuestion"},"description":"Every question in form order, each whole."}},"required":["kind","tableId","tableName","name","title","description","questions"]},"FormField":{"type":"object","properties":{"columnId":{"description":"The column the question fills.","$ref":"#/components/schemas/ColumnId"},"label":{"anyOf":[{"type":"string","minLength":1,"maxLength":120},{"type":"null"}],"description":"The question's words, up to 120 characters; null shows the column's name."},"help":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"description":"A line under the question, up to 500 characters; null for none."},"required":{"type":"boolean","description":"Whether an editable question needs an answer (a required checkbox must be ticked)."},"access":{"description":"`editable`, `read_only` (shows the prefilled value) or `hidden` (only a prefilled value fills it).","$ref":"#/components/schemas/FormFieldAccess"},"display":{"anyOf":[{"$ref":"#/components/schemas/FormTextDisplay"},{"type":"null"}],"description":"A text question as one line (`short`) or a growing box (`paragraph`); null on other types."},"files":{"anyOf":[{"$ref":"#/components/schemas/FormFileSettings"},{"type":"null"}],"description":"An attachments question's file settings; null on other types."}},"required":["columnId","label","help","required","access","display","files"]},"FormFieldAccess":{"type":"string","enum":["editable","read_only","hidden"]},"FormFileKind":{"type":"string","enum":["images","videos","audio","documents"]},"FormFileSettings":{"type":"object","properties":{"kinds":{"maxItems":4,"type":"array","items":{"$ref":"#/components/schemas/FormFileKind"},"description":"The kinds of file it takes: `images`, `videos`, `audio`, `documents`; empty takes any."},"maxFiles":{"type":"integer","minimum":1,"maximum":50,"description":"The most files it takes: 1 to 50."},"maxBytesPerFile":{"type":"integer","minimum":1,"maximum":5368709120,"description":"The largest file it takes, in bytes, up to 5 GiB; the deployment's own upload limit applies too."},"upload":{"type":"boolean","description":"Whether the respondent may choose files from their device."},"capture":{"maxItems":3,"type":"array","items":{"$ref":"#/components/schemas/CaptureMethod"},"description":"The captures it offers, each kind at most once: a photo, a video, audio."}},"required":["kinds","maxFiles","maxBytesPerFile","upload","capture"]},"FormLink":{"type":"object","properties":{"id":{"description":"The link's id.","$ref":"#/components/schemas/FormLinkId"},"viewId":{"description":"The form the link opens.","$ref":"#/components/schemas/ViewId"},"tableId":{"description":"The form's table.","$ref":"#/components/schemas/TableId"},"kind":{"description":"`public` or `personal`.","$ref":"#/components/schemas/FormLinkKind"},"url":{"anyOf":[{"$ref":"#/components/schemas/Url"},{"type":"null"}],"description":"The address to send: the form page, with the secret after the `#`. Null when the server can no longer show it (its signing secret changed since): the link still works; revoke it and make another to send it again. Null too on a personal link an agent made under a card (`agentId` set), for everyone but its issuer, the member who approved the card, in the app (through an API key, for them too): the others who may share the table see the link and may revoke it."},"issuedBy":{"description":"The member who made the link, or who approved the card an agent made it under; it works while they may share the table.","$ref":"#/components/schemas/MemberId"},"agentId":{"default":null,"description":"The agent that made the link under a card its issuer approved; null for a link a member made.","anyOf":[{"$ref":"#/components/schemas/AgentId"},{"type":"null"}]},"recipient":{"anyOf":[{"$ref":"#/components/schemas/FormLinkRecipient"},{"type":"null"}],"description":"A personal link's recipient; null on a public link."},"prefill":{"description":"A personal link's prefilled values, by column id: they win over what the respondent sends. Empty on a public link.","$ref":"#/components/schemas/RecordValues"},"expiresAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}],"description":"When the link stops working; null for never."},"maxResponses":{"anyOf":[{"type":"integer","minimum":1,"maximum":1000000},{"type":"null"}],"description":"How many responses the link takes; null for no limit."},"responseCount":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many responses came through the link."},"openedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}],"description":"When the link was first opened; null if never."},"lastResponseAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}],"description":"When its last response came; null if none."},"createdAt":{"description":"When the link was made.","$ref":"#/components/schemas/IsoDateTime"},"revokedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}],"description":"When the link was revoked; null if it was not."},"state":{"description":"Whether the link works now, and why not.","$ref":"#/components/schemas/FormLinkState"},"emailedAt":{"default":null,"description":"When Fleepr emailed the link to its recipient; null when it never did (it was made to copy).","anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"undelivered":{"default":null,"description":"Set when the link's email bounced or was marked as spam, as the email provider reported it; null while none was reported. Its issuer is notified (`email_undelivered`).","anyOf":[{"$ref":"#/components/schemas/EmailUndelivered"},{"type":"null"}]}},"required":["id","viewId","tableId","kind","url","issuedBy","agentId","recipient","prefill","expiresAt","maxResponses","responseCount","openedAt","lastResponseAt","createdAt","revokedAt","state","emailedAt","undelivered"]},"FormLinkCounts":{"type":"object","properties":{"public":{"type":"boolean","description":"Whether the public link is on."},"personal":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many personal links still work."}},"required":["public","personal"]},"FormLinkCreatedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"form_link.created","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"description":"What the event carries; for a change, the object as it is after it.","$ref":"#/components/schemas/FormLinkPayload"}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"FormLinkCreatePreview":{"type":"object","properties":{"kind":{"type":"string","const":"form_link_create","description":"Make a link to a form."},"tableId":{"description":"The table it acts on.","$ref":"#/components/schemas/TableId"},"tableName":{"type":"string","description":"The table's name."},"viewId":{"description":"The form the link opens.","$ref":"#/components/schemas/ViewId"},"formName":{"type":"string","description":"The form's name, as the table's views list it."},"formTitle":{"type":"string","description":"The form's title, as the respondent reads it."},"linkKind":{"description":"`public`, the form's one public link, or `personal`, a link for one person.","$ref":"#/components/schemas/FormLinkKind"},"turnsOn":{"type":"boolean","description":"On a public link: true when the form has no live public link and Allow turns one on, false when Allow shares the one it has. False on a personal link."},"recipient":{"anyOf":[{"$ref":"#/components/schemas/FormLinkRecipient"},{"type":"null"}],"description":"A personal link's recipient, the name it greets and their email address; null on a public link."},"delivery":{"anyOf":[{"$ref":"#/components/schemas/FormLinkDelivery"},{"type":"null"}],"description":"How a personal link reaches its recipient: `copy` (its address shown only to the member who approves the card) or `email` (Fleepr emails it to `recipient.email`); null on a public link."},"newAddress":{"description":"On a personal link Fleepr emails: true when the organization knows nobody by `recipient.email` (no member, guest contact or earlier form link has it), so the card marks the address as new. Absent on any other link, and on a card asked before the field existed.","type":"boolean"},"prefill":{"maxItems":100,"type":"array","items":{"$ref":"#/components/schemas/PreviewPrefillValue"},"description":"Every value a personal link fills in for its recipient, in the form's order; empty on a public link."},"expiresAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}],"description":"When a personal link stops working; null for never, and on a public link."},"maxResponses":{"anyOf":[{"type":"integer","minimum":1,"maximum":1000000},{"type":"null"}],"description":"How many responses a personal link takes; null for no limit, and on a public link."}},"required":["kind","tableId","tableName","viewId","formName","formTitle","linkKind","turnsOn","recipient","delivery","prefill","expiresAt","maxResponses"]},"FormLinkDelivery":{"type":"string","enum":["copy","email"]},"FormLinkId":{"type":"string","pattern":"^flink_[0-9a-hjkmnp-tv-z]{26}$"},"FormLinkKind":{"type":"string","enum":["public","personal"]},"FormLinkList":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/FormLink"},"description":"The form's links, the public one first."}},"required":["items"]},"FormLinkPayload":{"type":"object","properties":{"link":{"description":"The link, by id, with its form, table and kind.","$ref":"#/components/schemas/FormLinkRef"},"viewName":{"type":"string","description":"The form's name."}},"required":["link","viewName"]},"FormLinkRecipient":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80,"description":"The recipient's name, up to 80 characters."},"email":{"anyOf":[{"$ref":"#/components/schemas/Email"},{"type":"null"}],"description":"The recipient's email address, or null."}},"required":["name","email"]},"FormLinkRef":{"type":"object","properties":{"id":{"description":"The link's id.","$ref":"#/components/schemas/FormLinkId"},"viewId":{"description":"The form the link opens.","$ref":"#/components/schemas/ViewId"},"tableId":{"description":"The form's table.","$ref":"#/components/schemas/TableId"},"kind":{"description":"`public` or `personal`.","$ref":"#/components/schemas/FormLinkKind"}},"required":["id","viewId","tableId","kind"]},"FormLinkRevokedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"form_link.revoked","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"description":"What the event carries; for a change, the object as it is after it.","$ref":"#/components/schemas/FormLinkPayload"}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"FormLinkRevokePreview":{"type":"object","properties":{"kind":{"type":"string","const":"form_link_revoke","description":"Revoke one form link for good."},"tableId":{"description":"The table it acts on.","$ref":"#/components/schemas/TableId"},"tableName":{"type":"string","description":"The table's name."},"viewId":{"description":"The form the link opens.","$ref":"#/components/schemas/ViewId"},"formName":{"type":"string","description":"The form's name, as the table's views list it."},"linkId":{"description":"The link Allow revokes.","$ref":"#/components/schemas/FormLinkId"},"linkKind":{"description":"`public`, the form's one public link, or `personal`.","$ref":"#/components/schemas/FormLinkKind"},"recipient":{"anyOf":[{"$ref":"#/components/schemas/FormLinkRecipient"},{"type":"null"}],"description":"A personal link's recipient, their name and email address; null on the public link."},"state":{"type":"string","enum":["live","expired","used_up","issuer_left"],"description":"Whether the link works now, and why not (never `revoked`: a revoked link gets no card)."},"createdAt":{"description":"When the link was made.","$ref":"#/components/schemas/IsoDateTime"},"responseCount":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many responses came through the link."}},"required":["kind","tableId","tableName","viewId","formName","linkId","linkKind","recipient","state","createdAt","responseCount"]},"FormLinksCreatePreview":{"type":"object","properties":{"kind":{"type":"string","const":"form_links_create","description":"Make several personal links to a form."},"tableId":{"description":"The table it acts on.","$ref":"#/components/schemas/TableId"},"tableName":{"type":"string","description":"The table's name."},"viewId":{"description":"The form the links open.","$ref":"#/components/schemas/ViewId"},"formName":{"type":"string","description":"The form's name, as the table's views list it."},"formTitle":{"type":"string","description":"The form's title, as the respondent reads it."},"links":{"minItems":2,"maxItems":10,"type":"array","items":{"$ref":"#/components/schemas/FormLinksCreatePreviewLink"},"description":"The personal links to make, 2 to 10, in the order the agent named them."}},"required":["kind","tableId","tableName","viewId","formName","formTitle","links"]},"FormLinksCreatePreviewLink":{"type":"object","properties":{"recipient":{"description":"Who the link is for: the name it greets, and their email or null.","$ref":"#/components/schemas/FormLinkRecipient"},"delivery":{"description":"`copy` (its address shown only to the member who approves the card) or `email` (Fleepr emails it to `recipient.email`).","$ref":"#/components/schemas/FormLinkDelivery"},"newAddress":{"description":"On a link Fleepr emails: true when the organization knows nobody by `recipient.email`, so the card marks the address as new. Absent on a link to copy.","type":"boolean"},"prefill":{"maxItems":100,"type":"array","items":{"$ref":"#/components/schemas/PreviewPrefillValue"},"description":"Every value the link fills in for its recipient, in the form's order."},"expiresAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}],"description":"When the link stops working; null for never."},"maxResponses":{"anyOf":[{"type":"integer","minimum":1,"maximum":1000000},{"type":"null"}],"description":"How many responses the link takes; null for no limit."}},"required":["recipient","delivery","prefill","expiresAt","maxResponses"]},"FormLinkState":{"type":"string","enum":["live","expired","used_up","revoked","issuer_left"]},"FormLinkToken":{"type":"string","minLength":1,"maxLength":512},"FormLinkUndeliveredEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"form_link.undelivered","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"description":"What the event carries; for a change, the object as it is after it.","$ref":"#/components/schemas/FormLinkUndeliveredPayload"}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"FormLinkUndeliveredPayload":{"type":"object","properties":{"link":{"description":"The link, by id, with its form, table and kind.","$ref":"#/components/schemas/FormLinkRef"},"viewName":{"type":"string","description":"The form's name."},"undelivered":{"description":"Why its email did not arrive, and when it was reported.","$ref":"#/components/schemas/EmailUndelivered"}},"required":["link","viewName","undelivered"]},"FormQuestionType":{"type":"string","enum":["text","number","date","select","multi_select","person","checkbox","linked_record","attachments","url","email"]},"FormRespondent":{"type":"object","properties":{"name":{"anyOf":[{"type":"string","minLength":1,"maxLength":80},{"type":"null"}],"description":"The respondent's name, up to 80 characters, or null when they gave none."},"email":{"anyOf":[{"$ref":"#/components/schemas/Email"},{"type":"null"}],"description":"The respondent's email address, or null when they gave none."}},"required":["name","email"]},"FormRespondentInput":{"type":"object","properties":{"name":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}],"description":"The respondent's name, up to 80 characters, or null."},"email":{"anyOf":[{"$ref":"#/components/schemas/Email"},{"type":"null"}],"description":"The respondent's email address, or null."}},"required":["name","email"],"additionalProperties":false},"FormSession":{"type":"string","minLength":1,"maxLength":1024},"FormSessionBody":{"type":"object","properties":{"session":{"description":"The session that opening the form answered.","$ref":"#/components/schemas/FormSession"}},"required":["session"],"additionalProperties":false},"FormSettings":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":120,"description":"The form's title, up to 120 characters."},"description":{"type":"string","maxLength":2000,"description":"Plain text under the title, up to 2,000 characters; links in it are made clickable. Empty for none."},"fields":{"maxItems":100,"type":"array","items":{"$ref":"#/components/schemas/FormField"},"description":"The questions in form order, up to 100, each column at most once."},"submitLabel":{"type":"string","minLength":1,"maxLength":40,"description":"The send button's words, up to 40 characters, such as \"Send\"."},"thankYou":{"type":"string","maxLength":1000,"description":"What the respondent reads after sending, up to 1,000 characters."},"allowAnother":{"type":"boolean","description":"Whether the thank-you screen offers \"Submit another response\"."},"askRespondent":{"description":"Whether the form asks the respondent's name and email: `off`, `optional` or `required`. A personal link fills them from its recipient.","$ref":"#/components/schemas/FormAskRespondent"},"accepting":{"type":"boolean","description":"Whether the form takes responses now (\"Accepting responses\")."},"closesAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}],"description":"When the form stops taking responses; null for never."},"maxResponses":{"anyOf":[{"type":"integer","minimum":1,"maximum":1000000},{"type":"null"}],"description":"How many responses the form takes in all; null for no limit."},"dailyResponseCap":{"type":"integer","minimum":1,"maximum":10000,"description":"The most responses the form takes in a day, 1 to 10,000 (500 unless set)."},"notifyMemberIds":{"maxItems":20,"type":"array","items":{"$ref":"#/components/schemas/MemberId"},"description":"The members told of new responses (\"Notify me of new responses\"), up to 20."}},"required":["title","description","fields","submitLabel","thankYou","allowAnother","askRespondent","accepting","closesAt","maxResponses","dailyResponseCap","notifyMemberIds"]},"FormTextDisplay":{"type":"string","enum":["short","paragraph"]},"FormUpdatePreview":{"type":"object","properties":{"kind":{"type":"string","const":"form_update","description":"Change a form."},"tableId":{"description":"The table it acts on.","$ref":"#/components/schemas/TableId"},"tableName":{"type":"string","description":"The table's name."},"viewId":{"description":"The form it changes.","$ref":"#/components/schemas/ViewId"},"formName":{"type":"string","description":"The form's name now."},"name":{"anyOf":[{"$ref":"#/components/schemas/PreviewTextChange"},{"type":"null"}],"description":"The new name; null when it stays."},"title":{"anyOf":[{"$ref":"#/components/schemas/PreviewTextChange"},{"type":"null"}],"description":"The new title; null when it stays."},"description":{"anyOf":[{"$ref":"#/components/schemas/PreviewTextChange"},{"type":"null"}],"description":"The new intro; null when it stays."},"questions":{"maxItems":200,"type":"array","items":{"$ref":"#/components/schemas/PreviewFormQuestionChange"},"description":"Every question of the result in order, then every question removed, each whole."}},"required":["kind","tableId","tableName","viewId","formName","name","title","description","questions"]},"FormView":{"type":"object","properties":{"id":{"description":"The view's id.","$ref":"#/components/schemas/ViewId"},"tableId":{"description":"The table the view belongs to.","$ref":"#/components/schemas/TableId"},"name":{"type":"string","minLength":1,"maxLength":80,"description":"The view's name, up to 80 characters."},"position":{"description":"The view's place in the table's view menu: views sort by this key, compared as text.","$ref":"#/components/schemas/FractionalIndex"},"createdBy":{"description":"Who created the view.","$ref":"#/components/schemas/ActorId"},"createdAt":{"description":"When the view was created.","$ref":"#/components/schemas/IsoDateTime"},"updatedBy":{"description":"Who changed the view last.","$ref":"#/components/schemas/ActorId"},"updatedAt":{"description":"When the view changed last.","$ref":"#/components/schemas/IsoDateTime"},"revision":{"description":"Grows by one with every change to the view; send it as `expectedRevision` to change it.","$ref":"#/components/schemas/Revision"},"kind":{"type":"string","const":"form","description":"A form."},"settings":{"description":"The form's words, questions and limits.","$ref":"#/components/schemas/FormSettings"},"links":{"description":"How many of its links work, so everyone who may view the table sees whether it is published.","$ref":"#/components/schemas/FormLinkCounts"}},"required":["id","tableId","name","position","createdBy","createdAt","updatedBy","updatedAt","revision","kind","settings","links"]},"FractionalIndex":{"type":"string","minLength":1,"maxLength":255},"GenericPreview":{"type":"object","properties":{"kind":{"type":"string","const":"generic","description":"Any other action, such as a connector tool, shown as labeled fields."},"title":{"type":"string","description":"What the call does, in words."},"fields":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"object","properties":{"label":{"type":"string","minLength":1,"maxLength":128,"description":"The field's label."},"value":{"type":"string","maxLength":262144,"description":"The field's value, as text: an argument's whole value."},"from":{"description":"Who wrote the value: `tool` when the tool wrote it from what it read itself; `model`, or absent, otherwise.","$ref":"#/components/schemas/PreviewFieldOrigin"},"object":{"description":"The object whose name the value holds, such as a library file; a reader who may not view it reads the value hidden.","$ref":"#/components/schemas/AccessObjectRef"}},"required":["label","value"]},"description":"The labeled fields that describe the call: up to 50 fields, 256 KiB in all; every argument whole."}},"required":["kind","title","fields"]},"GetMentionSuggestionsResult":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/MentionCandidate"},"description":"The rows, those already in the chat or file first; a row the caller may not mention says why."}},"required":["items"]},"GetMessageResult":{"type":"object","properties":{"message":{"description":"The message.","$ref":"#/components/schemas/Message"},"included":{"description":"What it references: files, table cards, request cards, turns and annotations.","$ref":"#/components/schemas/MessageIncluded"}},"required":["message","included"]},"GrantedMember":{"type":"object","properties":{"memberId":{"description":"The member who gained access.","$ref":"#/components/schemas/MemberId"},"level":{"description":"The level the grant gives them now: view, edit or manage.","$ref":"#/components/schemas/AccessLevel"}},"required":["memberId","level"]},"GuestContact":{"type":"object","properties":{"id":{"description":"The guest's contact id.","$ref":"#/components/schemas/GuestContactId"},"organizationId":{"description":"The organization the contact belongs to.","$ref":"#/components/schemas/OrganizationId"},"name":{"anyOf":[{"type":"string","minLength":1,"maxLength":80},{"type":"null"}],"description":"The guest's name, from the link's issuer or given by the guest on the review page; null when neither gave one."},"email":{"anyOf":[{"$ref":"#/components/schemas/Email"},{"type":"null"}],"description":"The guest's email for a link's recipient; null for anyone else."},"createdAt":{"description":"When the contact was created.","$ref":"#/components/schemas/IsoDateTime"},"lastSeenAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}],"description":"When the guest last confirmed their email, or gave their name on a link that requires the code, on the review page; null until then."}},"required":["id","organizationId","name","email","createdAt","lastSeenAt"]},"GuestContactId":{"type":"string","pattern":"^gst_[0-9a-hjkmnp-tv-z]{26}$"},"HealthArea":{"type":"string","enum":["data","automations","performance","memory"]},"HealthAreaScore":{"type":"object","properties":{"area":{"description":"The area.","$ref":"#/components/schemas/HealthArea"},"score":{"anyOf":[{"$ref":"#/components/schemas/HealthScore"},{"type":"null"}],"description":"The latest score, from 0 to 100; null while no check has measured anything in this area."},"change":{"anyOf":[{"type":"integer","minimum":-100,"maximum":100},{"type":"null"}],"description":"How much the score moved over the last 30 days; null without a score 30 days ago."},"trend":{"maxItems":30,"type":"array","items":{"$ref":"#/components/schemas/HealthScorePoint"},"description":"The score of each nightly check of the last 30 days, oldest first."},"openCount":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many open issues of this area the caller may see."}},"required":["area","score","change","trend","openCount"]},"HealthCheckedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"health.checked","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"description":"What the event carries; for a change, the object as it is after it.","$ref":"#/components/schemas/HealthCheckedPayload"}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"HealthCheckedPayload":{"type":"object","properties":{"checkedAt":{"description":"When the check finished.","$ref":"#/components/schemas/IsoDateTime"},"scores":{"minItems":4,"maxItems":4,"type":"array","items":{"$ref":"#/components/schemas/HealthCheckedScore"},"description":"Each area once, in the order data, automations, performance, memory."}},"required":["checkedAt","scores"]},"HealthCheckedScore":{"type":"object","properties":{"area":{"description":"The area.","$ref":"#/components/schemas/HealthArea"},"score":{"anyOf":[{"$ref":"#/components/schemas/HealthScore"},{"type":"null"}],"description":"Its score; null when nothing was measured."}},"required":["area","score"]},"HealthColumnSubject":{"type":"object","properties":{"type":{"type":"string","const":"column","description":"The issue is about one field of a table."},"tableId":{"description":"The table the field belongs to.","$ref":"#/components/schemas/TableId"},"columnId":{"description":"The field.","$ref":"#/components/schemas/ColumnId"},"name":{"description":"The field's name now; null once it has been deleted.","type":["string","null"]},"tableName":{"description":"The table's name now; null once it has been deleted.","type":["string","null"]}},"required":["type","tableId","columnId","name","tableName"]},"HealthDismissReason":{"type":"string","enum":["not_a_problem","not_now","wrong"]},"HealthEmptyFieldEvidence":{"type":"object","properties":{"kind":{"type":"string","const":"mostly_empty_field","description":"A field that is mostly empty."},"filledCount":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many records have the field filled."},"recordCount":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many records the table holds."},"fillRate":{"type":"number","minimum":0,"maximum":1,"description":"The share of records with the field filled, from 0 to 1."}},"required":["kind","filledCount","recordCount","fillRate"]},"HealthEvidence":{"oneOf":[{"$ref":"#/components/schemas/HealthSplitSelectEvidence"},{"$ref":"#/components/schemas/HealthTextLinkEvidence"},{"$ref":"#/components/schemas/HealthOverlapEvidence"},{"$ref":"#/components/schemas/HealthEmptyFieldEvidence"},{"$ref":"#/components/schemas/HealthFailingFlowEvidence"},{"$ref":"#/components/schemas/HealthFlowCostEvidence"},{"$ref":"#/components/schemas/HealthUnusedMemoriesEvidence"},{"$ref":"#/components/schemas/HealthRepeatedSendBackEvidence"},{"$ref":"#/components/schemas/HealthSendBackWithoutMemoryEvidence"},{"$ref":"#/components/schemas/HealthTargetBehindEvidence"},{"$ref":"#/components/schemas/HealthTargetUnmeasurableEvidence"}]},"HealthFailingFlowEvidence":{"type":"object","properties":{"kind":{"type":"string","const":"failing_flow","description":"A flow whose last runs all failed."},"consecutiveFailures":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many of its latest runs failed in a row."},"runIds":{"maxItems":20,"type":"array","items":{"$ref":"#/components/schemas/FlowRunId"},"description":"The failed runs, the latest first."},"lastFailedAt":{"description":"When the latest of them ended.","$ref":"#/components/schemas/IsoDateTime"}},"required":["kind","consecutiveFailures","runIds","lastFailedAt"]},"HealthFix":{"type":"object","properties":{"action":{"description":"What the fix does.","$ref":"#/components/schemas/HealthFixAction"},"asksFirst":{"type":"boolean","description":"Whether Fleepr carries the fix out once it is approved in Approvals (it changes how data is organized). False: its button opens where a person fixes it, and they mark the issue fixed."}},"required":["action","asksFirst"]},"HealthFixAction":{"type":"string","enum":["merge_options","convert_to_link","merge_tables","review_field","review_flow","review_memories","rewrite_memory","review_target"]},"HealthFixStepBody":{"type":"object","properties":{"expectedRevision":{"description":"The `revision` you read. If the object changed since, the answer is `409 revision_conflict` and nothing changes.","$ref":"#/components/schemas/Revision"}},"required":["expectedRevision"],"additionalProperties":false},"HealthFlowCostEvidence":{"type":"object","properties":{"kind":{"type":"string","const":"flow_cost_up","description":"A flow whose runs cost more than they used to."},"recentRuns":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many runs ended in the last 7 days."},"baselineRuns":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many runs ended in the 28 days before them."},"recentCostPerRunMicros":{"anyOf":[{"$ref":"#/components/schemas/Micros"},{"type":"null"}],"description":"The average cost of a recent run, in micro-dollars; null for a caller who does not see usage (the organization's owner and admins do)."},"baselineCostPerRunMicros":{"anyOf":[{"$ref":"#/components/schemas/Micros"},{"type":"null"}],"description":"The average cost of a run in the 28 days before, in micro-dollars; null for a caller who does not see usage."},"ratio":{"type":"number","minimum":0,"description":"How many times the recent cost is the earlier one."}},"required":["kind","recentRuns","baselineRuns","recentCostPerRunMicros","baselineCostPerRunMicros","ratio"]},"HealthFlowSubject":{"type":"object","properties":{"type":{"type":"string","const":"flow","description":"The issue is about a flow."},"flowId":{"description":"The flow.","$ref":"#/components/schemas/FlowId"},"name":{"description":"The flow's name now; null once it has been deleted.","type":["string","null"]}},"required":["type","flowId","name"]},"HealthIssue":{"type":"object","properties":{"id":{"description":"The issue's id.","$ref":"#/components/schemas/HealthIssueId"},"organizationId":{"description":"The organization it belongs to.","$ref":"#/components/schemas/OrganizationId"},"key":{"type":"string","minLength":1,"maxLength":200,"description":"A stable key from the check, the same each time it finds this problem."},"area":{"description":"The area of Health it belongs to.","$ref":"#/components/schemas/HealthArea"},"kind":{"description":"What the check found.","$ref":"#/components/schemas/HealthIssueKind"},"severity":{"description":"How much it matters.","$ref":"#/components/schemas/HealthSeverity"},"status":{"description":"Where it is in its life.","$ref":"#/components/schemas/HealthIssueStatus"},"subject":{"description":"What it is about.","$ref":"#/components/schemas/HealthSubject"},"evidence":{"description":"The numbers behind it, as the check last measured them.","$ref":"#/components/schemas/HealthEvidence"},"fix":{"anyOf":[{"$ref":"#/components/schemas/HealthFix"},{"type":"null"}],"description":"What would fix it; null when the check proposes nothing."},"decidedBy":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"Who marked it fixed or dismissed it; null while it is open, or when Fleepr closed it."},"reason":{"anyOf":[{"$ref":"#/components/schemas/HealthDismissReason"},{"type":"null"}],"description":"Why it was dismissed; null unless dismissed."},"snoozedUntil":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}],"description":"For an issue dismissed as \"Not now\", when it may come back; null otherwise."},"openedAt":{"description":"When a check first found it.","$ref":"#/components/schemas/IsoDateTime"},"lastFoundAt":{"description":"When a check last found it.","$ref":"#/components/schemas/IsoDateTime"},"resolvedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}],"description":"When it was fixed or dismissed; null while it is open."},"reopenCount":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many times it came back after being fixed or dismissed."},"history":{"minItems":1,"maxItems":50,"type":"array","items":{"$ref":"#/components/schemas/HealthIssueChange"},"description":"What happened to it, oldest first: the first line and the latest ones."},"revision":{"description":"The issue's revision.","$ref":"#/components/schemas/Revision"},"viewer":{"description":"What the caller may do with it.","$ref":"#/components/schemas/HealthIssueViewer"}},"required":["id","organizationId","key","area","kind","severity","status","subject","evidence","fix","decidedBy","reason","snoozedUntil","openedAt","lastFoundAt","resolvedAt","reopenCount","history","revision","viewer"]},"HealthIssueChange":{"type":"object","properties":{"at":{"description":"When it happened.","$ref":"#/components/schemas/IsoDateTime"},"change":{"description":"What happened.","$ref":"#/components/schemas/HealthIssueChangeKind"},"by":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"The person who did it; null when Fleepr did."},"reason":{"anyOf":[{"$ref":"#/components/schemas/HealthDismissReason"},{"type":"null"}],"description":"Why it was dismissed; null on every other line."}},"required":["at","change","by","reason"]},"HealthIssueChangeKind":{"type":"string","enum":["opened","reopened","cleared","fixed","dismissed","reopened_by_member","waiting","withdrawn","applied"]},"HealthIssueClearedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"health_issue.cleared","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"description":"What the event carries; for a change, the object as it is after it.","$ref":"#/components/schemas/HealthIssueEventPayload"}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"HealthIssueEventPayload":{"type":"object","properties":{"issue":{"description":"The issue as it is now.","$ref":"#/components/schemas/HealthIssueWithoutViewer"}},"required":["issue"]},"HealthIssueFilter":{"type":"string","enum":["open","resolved"]},"HealthIssueFixRequestedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"health_issue.fix_requested","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"description":"What the event carries; for a change, the object as it is after it.","$ref":"#/components/schemas/HealthIssueEventPayload"}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"HealthIssueFixWithdrawnEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"health_issue.fix_withdrawn","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"description":"What the event carries; for a change, the object as it is after it.","$ref":"#/components/schemas/HealthIssueEventPayload"}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"HealthIssueId":{"type":"string","pattern":"^hli_[0-9a-hjkmnp-tv-z]{26}$"},"HealthIssueKind":{"type":"string","enum":["split_select_values","text_should_be_link","overlapping_tables","mostly_empty_field","failing_flow","flow_cost_up","unused_memories","repeated_send_back","send_back_without_memory","target_behind","target_unmeasurable"]},"HealthIssueOpenedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"health_issue.opened","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"description":"What the event carries; for a change, the object as it is after it.","$ref":"#/components/schemas/HealthIssueEventPayload"}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"HealthIssuePage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/HealthIssue"},"description":"This page of the list."},"nextCursor":{"anyOf":[{"$ref":"#/components/schemas/Cursor"},{"type":"null"}],"description":"Send it back as `cursor` to read the next page; null on the last page."},"totalCount":{"description":"How many items match across every page, among those you may see.","$ref":"#/components/schemas/TotalCount"}},"required":["items","nextCursor","totalCount"]},"HealthIssueReopenedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"health_issue.reopened","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"description":"What the event carries; for a change, the object as it is after it.","$ref":"#/components/schemas/HealthIssueEventPayload"}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"HealthIssueResolvedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"health_issue.resolved","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"description":"What the event carries; for a change, the object as it is after it.","$ref":"#/components/schemas/HealthIssueResolvedPayload"}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"HealthIssueResolvedPayload":{"type":"object","properties":{"issue":{"description":"The issue as it is now.","$ref":"#/components/schemas/HealthIssueWithoutViewer"},"appliedFix":{"default":null,"description":"The fix Fleepr carried out when the owner or an admin approved it; null when a person only marked the issue fixed or dismissed it, and in an event stored before the fixes were carried out.","anyOf":[{"$ref":"#/components/schemas/HealthFixAction"},{"type":"null"}]}},"required":["issue","appliedFix"]},"HealthIssueStatus":{"type":"string","enum":["open","waiting","fixed","dismissed"]},"HealthIssueViewer":{"type":"object","properties":{"canFix":{"type":"boolean","description":"Whether the caller may mark it fixed; for a fix Fleepr carries out, send it to Approvals, approve it and withdraw it."},"canDismiss":{"type":"boolean","description":"Whether the caller may dismiss it."},"canReopen":{"type":"boolean","description":"Whether the caller may reopen it once it is fixed or dismissed."}},"required":["canFix","canDismiss","canReopen"]},"HealthIssueWithoutViewer":{"type":"object","properties":{"id":{"description":"The issue's id.","$ref":"#/components/schemas/HealthIssueId"},"organizationId":{"description":"The organization it belongs to.","$ref":"#/components/schemas/OrganizationId"},"key":{"type":"string","minLength":1,"maxLength":200,"description":"A stable key from the check, the same each time it finds this problem."},"area":{"description":"The area of Health it belongs to.","$ref":"#/components/schemas/HealthArea"},"kind":{"description":"What the check found.","$ref":"#/components/schemas/HealthIssueKind"},"severity":{"description":"How much it matters.","$ref":"#/components/schemas/HealthSeverity"},"status":{"description":"Where it is in its life.","$ref":"#/components/schemas/HealthIssueStatus"},"subject":{"description":"What it is about.","$ref":"#/components/schemas/HealthSubject"},"evidence":{"description":"The numbers behind it, as the check last measured them.","$ref":"#/components/schemas/HealthEvidence"},"fix":{"anyOf":[{"$ref":"#/components/schemas/HealthFix"},{"type":"null"}],"description":"What would fix it; null when the check proposes nothing."},"decidedBy":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"Who marked it fixed or dismissed it; null while it is open, or when Fleepr closed it."},"reason":{"anyOf":[{"$ref":"#/components/schemas/HealthDismissReason"},{"type":"null"}],"description":"Why it was dismissed; null unless dismissed."},"snoozedUntil":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}],"description":"For an issue dismissed as \"Not now\", when it may come back; null otherwise."},"openedAt":{"description":"When a check first found it.","$ref":"#/components/schemas/IsoDateTime"},"lastFoundAt":{"description":"When a check last found it.","$ref":"#/components/schemas/IsoDateTime"},"resolvedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}],"description":"When it was fixed or dismissed; null while it is open."},"reopenCount":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many times it came back after being fixed or dismissed."},"history":{"minItems":1,"maxItems":50,"type":"array","items":{"$ref":"#/components/schemas/HealthIssueChange"},"description":"What happened to it, oldest first: the first line and the latest ones."},"revision":{"description":"The issue's revision.","$ref":"#/components/schemas/Revision"}},"required":["id","organizationId","key","area","kind","severity","status","subject","evidence","fix","decidedBy","reason","snoozedUntil","openedAt","lastFoundAt","resolvedAt","reopenCount","history","revision"]},"HealthMemorySubject":{"type":"object","properties":{"type":{"type":"string","const":"memory","description":"The issue is about one memory."},"memoryId":{"description":"The memory.","$ref":"#/components/schemas/MemoryId"}},"required":["type","memoryId"]},"HealthOrganizationSubject":{"type":"object","properties":{"type":{"type":"string","const":"organization","description":"The issue is about the organization as a whole."}},"required":["type"]},"HealthOverlapEvidence":{"type":"object","properties":{"kind":{"type":"string","const":"overlapping_tables","description":"Two tables that hold the same things."},"otherTableId":{"description":"The other table.","$ref":"#/components/schemas/TableId"},"otherTableName":{"description":"The table's name now; null once it has been deleted.","type":["string","null"]},"matchedCount":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many of this table's records share a name with the other's."},"recordCount":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many records this table holds."},"otherRecordCount":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many records the other table holds."},"overlapRate":{"type":"number","minimum":0,"maximum":1,"description":"The share of this table's records found in the other, from 0 to 1."}},"required":["kind","otherTableId","otherTableName","matchedCount","recordCount","otherRecordCount","overlapRate"]},"HealthRepeatedSendBackEvidence":{"type":"object","properties":{"kind":{"type":"string","const":"repeated_send_back","description":"A send-back that came back after a memory about it."},"memoryId":{"description":"The memory about it.","$ref":"#/components/schemas/MemoryId"},"fileId":{"anyOf":[{"$ref":"#/components/schemas/FileId"},{"type":"null"}],"description":"The file sent back last; null once it has been deleted."},"sendBackCount":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many times it was sent back since the memory was confirmed, of the send-backs the caller may view."}},"required":["kind","memoryId","fileId","sendBackCount"]},"HealthResolveAction":{"type":"string","enum":["fixed","dismissed"]},"HealthScore":{"type":"integer","minimum":0,"maximum":100},"HealthScorePoint":{"type":"object","properties":{"day":{"description":"The day of the nightly check, in the organization's time zone.","$ref":"#/components/schemas/IsoDate"},"score":{"description":"The score that night, from 0 to 100.","$ref":"#/components/schemas/HealthScore"}},"required":["day","score"]},"HealthSendBackWithoutMemoryEvidence":{"type":"object","properties":{"kind":{"type":"string","const":"send_back_without_memory","description":"A send-back that keeps coming back after its memory was rejected."},"memoryId":{"description":"The rejected memory about it.","$ref":"#/components/schemas/MemoryId"},"fileId":{"anyOf":[{"$ref":"#/components/schemas/FileId"},{"type":"null"}],"description":"The file sent back last; null once it has been deleted."},"sendBackCount":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many times it was sent back since the suggestion was rejected, of the send-backs the caller may view."}},"required":["kind","memoryId","fileId","sendBackCount"]},"HealthSeverity":{"type":"string","enum":["high","medium","low"]},"HealthSplitGroup":{"type":"object","properties":{"options":{"minItems":2,"type":"array","items":{"$ref":"#/components/schemas/HealthSplitOption"},"description":"The options that look like one value, the most used first."},"recordCount":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many records hold one of these options."}},"required":["options","recordCount"]},"HealthSplitOption":{"type":"object","properties":{"optionId":{"description":"One option of the field.","$ref":"#/components/schemas/SelectOptionId"},"label":{"description":"The option's label now; null once it has been removed from the field.","type":["string","null"]},"recordCount":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many records hold this option."}},"required":["optionId","label","recordCount"]},"HealthSplitSelectEvidence":{"type":"object","properties":{"kind":{"type":"string","const":"split_select_values","description":"Options of a select field that spell one value."},"groups":{"minItems":1,"maxItems":20,"type":"array","items":{"$ref":"#/components/schemas/HealthSplitGroup"},"description":"Each set of options that look like one value, the most used first."}},"required":["kind","groups"]},"HealthSubject":{"oneOf":[{"$ref":"#/components/schemas/HealthTableSubject"},{"$ref":"#/components/schemas/HealthColumnSubject"},{"$ref":"#/components/schemas/HealthFlowSubject"},{"$ref":"#/components/schemas/HealthMemorySubject"},{"$ref":"#/components/schemas/HealthTargetSubject"},{"$ref":"#/components/schemas/HealthOrganizationSubject"}]},"HealthSummary":{"type":"object","properties":{"organizationId":{"description":"The organization.","$ref":"#/components/schemas/OrganizationId"},"checkedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}],"description":"When the last nightly check finished; null before the first one."},"checksRun":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many nightly checks have finished, so a new organization can show \"Learning\" for a week."},"openCount":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many open issues the caller may see, waiting ones included."},"waitingCount":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many of them wait for a decision in Approvals."},"areas":{"minItems":4,"maxItems":4,"type":"array","items":{"$ref":"#/components/schemas/HealthAreaScore"},"description":"Each area once, in the order data, automations, performance, memory."}},"required":["organizationId","checkedAt","checksRun","openCount","waitingCount","areas"]},"HealthTableSubject":{"type":"object","properties":{"type":{"type":"string","const":"table","description":"The issue is about a table."},"tableId":{"description":"The table.","$ref":"#/components/schemas/TableId"},"name":{"description":"The table's name now; null once it has been deleted.","type":["string","null"]}},"required":["type","tableId","name"]},"HealthTarget":{"type":"object","properties":{"id":{"description":"The target's id.","$ref":"#/components/schemas/HealthTargetId"},"organizationId":{"description":"The organization it belongs to.","$ref":"#/components/schemas/OrganizationId"},"name":{"type":"string","minLength":1,"maxLength":80,"description":"What people call it: \"400 approved ads this month\"."},"ownerId":{"description":"The one person who owns it, and hears when it falls behind.","$ref":"#/components/schemas/MemberId"},"preset":{"anyOf":[{"$ref":"#/components/schemas/HealthTargetPreset"},{"type":"null"}],"description":"The preset it started from; null for a custom one."},"measure":{"description":"What it measures.","$ref":"#/components/schemas/HealthTargetMeasure"},"period":{"description":"How long each period is.","$ref":"#/components/schemas/HealthTargetPeriod"},"goal":{"type":"number","exclusiveMinimum":0,"maximum":1000000000,"description":"The number to hit each period: a rate as a share from 0 to 1."},"direction":{"description":"Which way is better.","$ref":"#/components/schemas/HealthTargetDirection"},"labels":{"type":"array","items":{"$ref":"#/components/schemas/HealthTargetLabel"},"description":"The names of the ids its conditions name, read when it is read (never stored)."},"current":{"anyOf":[{"$ref":"#/components/schemas/HealthTargetPeriodResult"},{"type":"null"}],"description":"The running period; null until it has been measured once."},"recent":{"maxItems":5,"type":"array","items":{"$ref":"#/components/schemas/HealthTargetPeriodResult"},"description":"The periods that ended, the latest first."},"neededPerDay":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}],"description":"For a higher-is-better count or sum: how many a day it still needs to reach its goal this period; null for any other target, or once the period ended."},"openIssueId":{"anyOf":[{"$ref":"#/components/schemas/HealthIssueId"},{"type":"null"}],"description":"Its open Health issue, if any."},"revision":{"description":"Changes with every edit: send it back to edit the target.","$ref":"#/components/schemas/Revision"},"createdBy":{"description":"Who added it.","$ref":"#/components/schemas/MemberId"},"createdAt":{"description":"When it was added.","$ref":"#/components/schemas/IsoDateTime"},"updatedAt":{"description":"When it was last edited.","$ref":"#/components/schemas/IsoDateTime"},"viewer":{"description":"What the reader may do with it.","$ref":"#/components/schemas/HealthTargetViewer"}},"required":["id","organizationId","name","ownerId","preset","measure","period","goal","direction","labels","current","recent","neededPerDay","openIssueId","revision","createdBy","createdAt","updatedAt","viewer"]},"HealthTargetAverage":{"type":"object","properties":{"kind":{"type":"string","const":"average","description":"The average of a number field."},"field":{"description":"The number field it averages.","$ref":"#/components/schemas/HealthTargetNumberField"}},"required":["kind","field"],"additionalProperties":false},"HealthTargetBehindEvidence":{"type":"object","properties":{"kind":{"type":"string","const":"target_behind","description":"A target behind in its running period."},"targetId":{"description":"The target.","$ref":"#/components/schemas/HealthTargetId"},"periodStart":{"description":"The period's first day, in the organization's time zone.","$ref":"#/components/schemas/IsoDate"},"periodEnd":{"description":"The day after its last day.","$ref":"#/components/schemas/IsoDate"},"value":{"description":"What the target measured so far in the period; null when it rests on fewer than 5 items (withheld: the target shows it to who may view them).","type":["number","null"]},"goal":{"type":"number","exclusiveMinimum":0,"description":"Its goal."},"direction":{"description":"Which way is better.","$ref":"#/components/schemas/HealthTargetDirection"},"calculation":{"description":"How it counts.","$ref":"#/components/schemas/HealthTargetCalculationKind"},"itemCount":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}],"description":"How many items counted so far; null when fewer than 5 (withheld, as the value)."}},"required":["kind","targetId","periodStart","periodEnd","value","goal","direction","calculation","itemCount"]},"HealthTargetCalculation":{"oneOf":[{"$ref":"#/components/schemas/HealthTargetCount"},{"$ref":"#/components/schemas/HealthTargetSum"},{"$ref":"#/components/schemas/HealthTargetAverage"},{"$ref":"#/components/schemas/HealthTargetRate"}]},"HealthTargetCalculationKind":{"type":"string","enum":["count","sum","average","rate"]},"HealthTargetCondition":{"type":"object","properties":{"field":{"description":"The native field it reads.","$ref":"#/components/schemas/HealthTargetField"},"operator":{"description":"How it compares.","$ref":"#/components/schemas/HealthTargetOperator"},"value":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"number","minimum":0,"maximum":100000}],"description":"The id or value it names, or the number a number field is compared with."},"tableId":{"description":"A `record` condition's table; left out for any other field.","$ref":"#/components/schemas/TableId"}},"required":["field","operator","value"],"additionalProperties":false},"HealthTargetCount":{"type":"object","properties":{"kind":{"type":"string","const":"count","description":"How many items."},"distinct":{"anyOf":[{"type":"string","enum":["file"]},{"type":"null"}],"description":"`file`: count each file once per period; null: count every item (round)."}},"required":["kind","distinct"],"additionalProperties":false},"HealthTargetCreatedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"health_target.created","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"description":"What the event carries; for a change, the object as it is after it.","$ref":"#/components/schemas/HealthTargetEventPayload"}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"HealthTargetDeletedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"health_target.deleted","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"description":"What the event carries; for a change, the object as it is after it.","$ref":"#/components/schemas/HealthTargetEventPayload"}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"HealthTargetDetail":{"type":"object","properties":{"target":{"description":"The target.","$ref":"#/components/schemas/HealthTarget"},"periods":{"maxItems":24,"type":"array","items":{"$ref":"#/components/schemas/HealthTargetPeriodResult"},"description":"Its periods, the running one first, then the latest that ended."},"history":{"maxItems":24,"type":"array","items":{"$ref":"#/components/schemas/HealthTargetVersion"},"description":"Its versions, the latest first."}},"required":["target","periods","history"]},"HealthTargetDirection":{"type":"string","enum":["higher","lower"]},"HealthTargetEventPayload":{"type":"object","properties":{"target":{"description":"The target as it is now (or was, deleted).","$ref":"#/components/schemas/HealthTargetEventTarget"}},"required":["target"]},"HealthTargetEventTarget":{"type":"object","properties":{"id":{"description":"The target's id.","$ref":"#/components/schemas/HealthTargetId"},"organizationId":{"description":"The organization it belongs to.","$ref":"#/components/schemas/OrganizationId"},"ownerId":{"description":"The one person who owns it, and hears when it falls behind.","$ref":"#/components/schemas/MemberId"},"preset":{"anyOf":[{"$ref":"#/components/schemas/HealthTargetPreset"},{"type":"null"}],"description":"The preset it started from; null for a custom one."},"measure":{"description":"What it measures.","$ref":"#/components/schemas/HealthTargetMeasure"},"period":{"description":"How long each period is.","$ref":"#/components/schemas/HealthTargetPeriod"},"goal":{"type":"number","exclusiveMinimum":0,"maximum":1000000000,"description":"The number to hit each period: a rate as a share from 0 to 1."},"direction":{"description":"Which way is better.","$ref":"#/components/schemas/HealthTargetDirection"},"current":{"anyOf":[{"$ref":"#/components/schemas/HealthTargetPeriodResult"},{"type":"null"}],"description":"The running period; null until it has been measured once."},"revision":{"description":"Changes with every edit: send it back to edit the target.","$ref":"#/components/schemas/Revision"}},"required":["id","organizationId","ownerId","preset","measure","period","goal","direction","current","revision"]},"HealthTargetField":{"type":"string","enum":["kind","outcome","round","approver","requested_by","chat","flow","record","hours_to_decide"]},"HealthTargetId":{"type":"string","pattern":"^tgt_[0-9a-hjkmnp-tv-z]{26}$"},"HealthTargetLabel":{"type":"object","properties":{"field":{"description":"The field of the condition that names it.","$ref":"#/components/schemas/HealthTargetField"},"value":{"type":"string","description":"The condition's value: the id it names."},"label":{"description":"Its name now; null once it no longer exists.","type":["string","null"]},"tableName":{"description":"A record's table, by name; null for any other field.","type":["string","null"]}},"required":["field","value","label","tableName"]},"HealthTargetList":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/HealthTarget"},"description":"The targets, by name."}},"required":["items"]},"HealthTargetMeasure":{"type":"object","properties":{"source":{"description":"Where its items come from.","$ref":"#/components/schemas/HealthTargetSource"},"conditions":{"maxItems":20,"type":"array","items":{"$ref":"#/components/schemas/HealthTargetCondition"},"description":"Which items count: every one must hold."},"calculation":{"description":"How its items become one number per period.","$ref":"#/components/schemas/HealthTargetCalculation"}},"required":["source","conditions","calculation"],"additionalProperties":false},"HealthTargetMeasuredEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"health_target.measured","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"description":"What the event carries; for a change, the object as it is after it.","$ref":"#/components/schemas/HealthTargetEventPayload"}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"HealthTargetMissing":{"type":"object","properties":{"field":{"type":"string","enum":["record","chat","flow"],"description":"What the condition reads."},"id":{"type":"string","minLength":1,"maxLength":64,"description":"The id it names, now gone."}},"required":["field","id"]},"HealthTargetNumberField":{"type":"string","enum":["hours_to_decide","round"]},"HealthTargetOperator":{"type":"string","enum":["is","is_not","eq","neq","gt","lt","gte","lte"]},"HealthTargetPeriod":{"type":"string","enum":["week","month","quarter"]},"HealthTargetPeriodResult":{"type":"object","properties":{"start":{"description":"The period's first day, in the organization's time zone.","$ref":"#/components/schemas/IsoDate"},"end":{"description":"The day after its last day (exclusive).","$ref":"#/components/schemas/IsoDate"},"value":{"description":"The number the target measured: a count, a sum, an average or a rate from 0 to 1. Null when it cannot be measured, and for an average or a rate with no items.","type":["number","null"]},"itemCount":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many items counted in the period; 0 when withheld."},"withheld":{"default":false,"description":"Whether the value and item count are withheld from the reader: the period rests on fewer than 5 items, one of which they may not view (never for the owner and admins), or a rate on fewer than 5 matched items or fewer than 5 others. Its status still shows.","type":"boolean"},"goal":{"type":"number","exclusiveMinimum":0,"description":"The goal the period was measured against, as it was then."},"direction":{"description":"Which way was better, as it was then.","$ref":"#/components/schemas/HealthTargetDirection"},"status":{"description":"Where the period stands.","$ref":"#/components/schemas/HealthTargetStatus"},"final":{"type":"boolean","description":"Whether the period has ended: its result no longer changes."},"computedAt":{"description":"When the result was last worked out.","$ref":"#/components/schemas/IsoDateTime"}},"required":["start","end","value","itemCount","withheld","goal","direction","status","final","computedAt"]},"HealthTargetPreset":{"type":"string","enum":["approved_deliverables","approval_time"]},"HealthTargetRate":{"type":"object","properties":{"kind":{"type":"string","const":"rate","description":"The share of items that match, from 0 to 1."},"match":{"minItems":1,"maxItems":20,"type":"array","items":{"$ref":"#/components/schemas/HealthTargetCondition"},"description":"What makes an item count towards the share."}},"required":["kind","match"],"additionalProperties":false},"HealthTargetSource":{"type":"string","enum":["approvals"]},"HealthTargetStatus":{"type":"string","enum":["on_track","behind","not_enough_data","met","missed","unmeasurable"]},"HealthTargetSubject":{"type":"object","properties":{"type":{"type":"string","const":"target","description":"The issue is about a target."},"targetId":{"description":"The target.","$ref":"#/components/schemas/HealthTargetId"},"name":{"description":"The target's name now; null once it has been deleted.","type":["string","null"]}},"required":["type","targetId","name"]},"HealthTargetSuggestion":{"type":"object","properties":{"id":{"description":"The suggestion's id.","$ref":"#/components/schemas/HealthTargetSuggestionId"},"organizationId":{"description":"The organization it is for.","$ref":"#/components/schemas/OrganizationId"},"preset":{"description":"The preset the target would measure.","$ref":"#/components/schemas/HealthTargetPreset"},"name":{"type":"string","minLength":1,"maxLength":80,"description":"The name the target would take."},"period":{"description":"The period the target would have.","$ref":"#/components/schemas/HealthTargetPeriod"},"goal":{"type":"number","exclusiveMinimum":0,"maximum":1000000000,"description":"The goal Fleepr suggests."},"direction":{"description":"Which way is better.","$ref":"#/components/schemas/HealthTargetDirection"},"basis":{"minItems":4,"maxItems":4,"type":"array","items":{"type":["number","null"]},"description":"The preset's value in each of the 4 weeks it rests on, the oldest first: over every approval in the organization, which is why only the owner and admins read suggestions."},"status":{"description":"Where the suggestion is.","$ref":"#/components/schemas/HealthTargetSuggestionStatus"},"suggestedAt":{"description":"When Fleepr suggested it.","$ref":"#/components/schemas/IsoDateTime"},"expiresAt":{"description":"When it expires if nobody decides it.","$ref":"#/components/schemas/IsoDateTime"},"decidedBy":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"Who accepted or dismissed it."},"decidedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}],"description":"When."},"targetId":{"anyOf":[{"$ref":"#/components/schemas/HealthTargetId"},{"type":"null"}],"description":"The target it became, once accepted."}},"required":["id","organizationId","preset","name","period","goal","direction","basis","status","suggestedAt","expiresAt","decidedBy","decidedAt","targetId"]},"HealthTargetSuggestionId":{"type":"string","pattern":"^tgs_[0-9a-hjkmnp-tv-z]{26}$"},"HealthTargetSuggestionList":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/HealthTargetSuggestion"},"description":"The suggestions waiting, newest first."}},"required":["items"]},"HealthTargetSuggestionStatus":{"type":"string","enum":["suggested","accepted","dismissed","expired"]},"HealthTargetSum":{"type":"object","properties":{"kind":{"type":"string","const":"sum","description":"The total of a number field."},"field":{"description":"The number field it adds up.","$ref":"#/components/schemas/HealthTargetNumberField"}},"required":["kind","field"],"additionalProperties":false},"HealthTargetUnmeasurableEvidence":{"type":"object","properties":{"kind":{"type":"string","const":"target_unmeasurable","description":"A target whose conditions name something that no longer exists."},"targetId":{"description":"The target.","$ref":"#/components/schemas/HealthTargetId"},"missing":{"minItems":1,"maxItems":20,"type":"array","items":{"$ref":"#/components/schemas/HealthTargetMissing"},"description":"What its conditions name and no longer exists."}},"required":["kind","targetId","missing"]},"HealthTargetUpdatedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"health_target.updated","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"description":"What the event carries; for a change, the object as it is after it.","$ref":"#/components/schemas/HealthTargetEventPayload"}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"HealthTargetVersion":{"type":"object","properties":{"number":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"The version, from 1 (when it was added)."},"name":{"type":"string","minLength":1,"maxLength":80,"description":"Its name then."},"ownerId":{"description":"Its owner then.","$ref":"#/components/schemas/MemberId"},"measure":{"description":"What it measured then.","$ref":"#/components/schemas/HealthTargetMeasure"},"period":{"description":"Its period then.","$ref":"#/components/schemas/HealthTargetPeriod"},"goal":{"type":"number","exclusiveMinimum":0,"maximum":1000000000,"description":"Its goal then."},"direction":{"description":"Which way was better then.","$ref":"#/components/schemas/HealthTargetDirection"},"editedBy":{"description":"Who made the edit.","$ref":"#/components/schemas/MemberId"},"editedAt":{"description":"When.","$ref":"#/components/schemas/IsoDateTime"}},"required":["number","name","ownerId","measure","period","goal","direction","editedBy","editedAt"]},"HealthTargetViewer":{"type":"object","properties":{"canEdit":{"type":"boolean","description":"Whether the reader may edit it."},"canDelete":{"type":"boolean","description":"Whether the reader may delete it."}},"required":["canEdit","canDelete"]},"HealthTextLinkEvidence":{"type":"object","properties":{"kind":{"type":"string","const":"text_should_be_link","description":"A text field whose values name records."},"targetTableId":{"description":"The table whose records the text names.","$ref":"#/components/schemas/TableId"},"targetTableName":{"description":"The table's name now; null once it has been deleted.","type":["string","null"]},"matchedCount":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many filled cells name a record of the other table."},"filledCount":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many cells of the field are filled."},"matchRate":{"type":"number","minimum":0,"maximum":1,"description":"The share of filled cells that name a record, from 0 to 1."}},"required":["kind","targetTableId","targetTableName","matchedCount","filledCount","matchRate"]},"HealthUnusedMemoriesEvidence":{"type":"object","properties":{"kind":{"type":"string","const":"unused_memories","description":"Confirmed memories that never shape an answer."},"memoryIds":{"maxItems":20,"type":"array","items":{"$ref":"#/components/schemas/MemoryId"},"description":"The memories, the longest unused first: only those the caller may see, so a reader who sees none of them does not see the issue."},"memoryCount":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many memories are unused that the caller may see: while the issue is open, counted from every memory unused now, not only those listed."}},"required":["kind","memoryIds","memoryCount"]},"IdempotencyKey":{"type":"string","pattern":"^[A-Za-z0-9_-]{8,128}$"},"IdentifyReviewGuestBody":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80,"description":"The guest's name, up to 80 characters, shown with their comments, annotations and decisions."}},"required":["name"],"additionalProperties":false},"ImportAgentBody":{"type":"object","properties":{"template":{"description":"The template, as `GET /v0/agents/{agentId}/template` exported it.","$ref":"#/components/schemas/AgentTemplate"},"skillConflict":{"description":"For a template skill whose name the organization already uses: `reuse` assigns the existing skill, `copy` adds a renamed copy.","$ref":"#/components/schemas/SkillConflict"}},"required":["template","skillConflict"],"additionalProperties":false},"ImportAgentResult":{"type":"object","properties":{"agent":{"description":"The new agent.","$ref":"#/components/schemas/Agent"},"skills":{"type":"array","items":{"$ref":"#/components/schemas/SkillSummary"},"description":"The skills the new agent was given, reused or created."},"unmetConnectorRequirements":{"type":"array","items":{"$ref":"#/components/schemas/ConnectorKey"},"description":"Every connector the template requires, whether or not the organization has connected it."}},"required":["agent","skills","unmetConnectorRequirements"]},"InAppPath":{"type":"string","maxLength":2048,"pattern":"^\\/(?![/\\\\])"},"Invite":{"type":"object","properties":{"id":{"description":"The invite's id.","$ref":"#/components/schemas/InviteId"},"organizationId":{"description":"The organization the invite is to.","$ref":"#/components/schemas/OrganizationId"},"memberId":{"description":"The member the invite activates: a new one, or the removed member of the same address.","$ref":"#/components/schemas/MemberId"},"email":{"description":"The invited address, in lowercase.","$ref":"#/components/schemas/Email"},"role":{"description":"The role the member gets on accepting: any role but owner.","$ref":"#/components/schemas/InviteRole"},"status":{"description":"`pending` until it is accepted, cancelled (`revoked`) or past its expiry (`expired`); `accepted` once the person joined.","$ref":"#/components/schemas/InviteStatus"},"invitedBy":{"description":"The member who sent the invite.","$ref":"#/components/schemas/MemberId"},"sendCount":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"How many times the invite email was sent, the first time included."},"lastSentAt":{"description":"When the invite email was last sent.","$ref":"#/components/schemas/IsoDateTime"},"expiresAt":{"description":"When the invite's link stops working: 7 days after it was last sent.","$ref":"#/components/schemas/IsoDateTime"},"acceptedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}],"description":"When the invite was accepted; null unless it was."},"revokedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}],"description":"When the invite was cancelled; null unless it was."},"undelivered":{"default":null,"description":"Why and when the latest invite email did not arrive (it bounced or was marked as spam); null when no problem was reported. Resending the invite clears it.","anyOf":[{"$ref":"#/components/schemas/EmailUndelivered"},{"type":"null"}]},"createdAt":{"description":"When the invite was created.","$ref":"#/components/schemas/IsoDateTime"}},"required":["id","organizationId","memberId","email","role","status","invitedBy","sendCount","lastSentAt","expiresAt","acceptedAt","revokedAt","undelivered","createdAt"]},"InviteAcceptedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"invite.accepted","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"description":"What the event carries; for a change, the object as it is after it.","$ref":"#/components/schemas/InviteEventPayload"}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"InviteByEmailBody":{"type":"object","properties":{"email":{"description":"The person's email address: a member's, or a new one, which is invited to the organization.","$ref":"#/components/schemas/Email"},"level":{"description":"The level to grant: `view` (the default), `edit` or `manage`.","$ref":"#/components/schemas/AccessLevel"}},"required":["email"],"additionalProperties":false},"InviteEventPayload":{"type":"object","properties":{"invite":{"description":"The invite after the change.","$ref":"#/components/schemas/Invite"}},"required":["invite"]},"InviteExpiredEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"invite.expired","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"description":"What the event carries; for a change, the object as it is after it.","$ref":"#/components/schemas/InviteEventPayload"}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"InviteId":{"type":"string","pattern":"^inv_[0-9a-hjkmnp-tv-z]{26}$"},"InviteMemberBody":{"type":"object","properties":{"email":{"description":"The address to invite; it must not belong to a member already.","$ref":"#/components/schemas/Email"},"role":{"description":"The role the person gets on accepting: `admin`, `member` or `viewer`.","$ref":"#/components/schemas/InviteRole"}},"required":["email","role"],"additionalProperties":false},"InviteMemberResult":{"type":"object","properties":{"invite":{"description":"The new invite.","$ref":"#/components/schemas/Invite"},"member":{"description":"The invited member, new or the removed member of the same address, with status `invited`.","$ref":"#/components/schemas/Member"}},"required":["invite","member"]},"InvitePreview":{"type":"object","properties":{"organizationName":{"type":"string","description":"The name of the organization the invite is to."},"inviterName":{"type":"string","description":"The name of the member who sent the invite."},"emailHint":{"type":"string","description":"The invited address, masked, such as `l***@example.com`, so a person can tell it is theirs."},"role":{"description":"The role the person gets on accepting.","$ref":"#/components/schemas/InviteRole"},"status":{"description":"The invite's status; only a `pending` invite can be accepted.","$ref":"#/components/schemas/InviteStatus"},"expiresAt":{"description":"When the invite's link stops working.","$ref":"#/components/schemas/IsoDateTime"}},"required":["organizationName","inviterName","emailHint","role","status","expiresAt"]},"InviteResentEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"invite.resent","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"description":"What the event carries; for a change, the object as it is after it.","$ref":"#/components/schemas/InviteEventPayload"}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"InviteRevokedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"invite.revoked","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"description":"What the event carries; for a change, the object as it is after it.","$ref":"#/components/schemas/InviteEventPayload"}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"InviteRole":{"type":"string","enum":["admin","member","viewer"]},"InviteStatus":{"type":"string","enum":["pending","accepted","revoked","expired"]},"InviteUndeliveredEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"invite.undelivered","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"description":"What the event carries; for a change, the object as it is after it.","$ref":"#/components/schemas/InviteEventPayload"}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"IsoDate":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"IsoDateTime":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{3}(?:Z))$"},"KnowledgeAgent":{"type":"object","properties":{"agentId":{"description":"The agent.","$ref":"#/components/schemas/AgentId"},"name":{"type":"string","description":"The agent's name."},"memories":{"type":"array","items":{"$ref":"#/components/schemas/KnowledgeMemory"},"description":"Its own memories that load, in the order read."}},"required":["agentId","name","memories"]},"KnowledgeDoc":{"type":"object","properties":{"memoryId":{"description":"The memory that points to it.","$ref":"#/components/schemas/MemoryId"},"fileId":{"description":"The doc.","$ref":"#/components/schemas/FileId"},"name":{"type":"string","description":"The doc's name."},"cut":{"type":"boolean","description":"Whether agents read only its start, as it is long."}},"required":["memoryId","fileId","name","cut"]},"KnowledgeElsewhere":{"type":"object","properties":{"otherRecords":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"The viewer's memories about other records of the tables of this chat's records."},"otherAgents":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"The viewer's memories about agents that are not in this chat."}},"required":["otherRecords","otherAgents"]},"KnowledgeHealthLine":{"type":"object","properties":{"issueId":{"description":"The issue.","$ref":"#/components/schemas/HealthIssueId"},"kind":{"description":"What kind of issue it is.","$ref":"#/components/schemas/HealthIssueKind"},"severity":{"description":"How much it matters.","$ref":"#/components/schemas/HealthSeverity"},"about":{"description":"The table or flow it is about, by name; null when none.","type":["string","null"]},"field":{"description":"The field it names, or null.","type":["string","null"]}},"required":["issueId","kind","severity","about","field"]},"KnowledgeLoaded":{"type":"object","properties":{"org":{"type":"array","items":{"$ref":"#/components/schemas/KnowledgeMemory"},"description":"The organization's memories every agent loads."},"records":{"type":"array","items":{"$ref":"#/components/schemas/KnowledgeRecord"},"description":"The records the chat is about that every reader sees."},"tables":{"type":"array","items":{"$ref":"#/components/schemas/KnowledgeTable"},"description":"The tables whose memories and profiles load: the records' tables and those shared in the chat."},"agents":{"type":"array","items":{"$ref":"#/components/schemas/KnowledgeAgent"},"description":"Each active agent of the chat, with its own memories."},"health":{"type":"array","items":{"$ref":"#/components/schemas/KnowledgeHealthLine"},"description":"The open Health issues agents read here."},"targets":{"type":"array","items":{"$ref":"#/components/schemas/KnowledgeTargetLine"},"description":"The targets about the chat's records agents read."},"docs":{"type":"array","items":{"$ref":"#/components/schemas/KnowledgeDoc"},"description":"The docs the loaded memories point to."}},"required":["org","records","tables","agents","health","targets","docs"]},"KnowledgeMemory":{"type":"object","properties":{"id":{"description":"The memory.","$ref":"#/components/schemas/MemoryId"},"text":{"type":"string","description":"Its words."},"subject":{"description":"What it is about.","$ref":"#/components/schemas/MemorySubject"},"type":{"description":"A rule, or a fact true for a while.","$ref":"#/components/schemas/MemoryType"},"pinned":{"type":"boolean","description":"Whether people pinned it, so it loads first when a layer is full."}},"required":["id","text","subject","type","pinned"]},"KnowledgeNotLoaded":{"type":"object","properties":{"memory":{"description":"The memory.","$ref":"#/components/schemas/KnowledgeMemory"},"reason":{"description":"Why it does not load.","$ref":"#/components/schemas/KnowledgeNotLoadedReason"}},"required":["memory","reason"]},"KnowledgeNotLoadedReason":{"type":"string","enum":["not_everyone_can_see","over_budget"]},"KnowledgeRecord":{"type":"object","properties":{"tableId":{"description":"The table that holds it.","$ref":"#/components/schemas/TableId"},"recordId":{"description":"The record.","$ref":"#/components/schemas/RecordId"},"label":{"type":"string","description":"The text of its table's primary column; empty when it has none."},"tableName":{"type":"string","description":"The table's name."},"memories":{"type":"array","items":{"$ref":"#/components/schemas/KnowledgeMemory"},"description":"The memories about it that load, in the order read."}},"required":["tableId","recordId","label","tableName","memories"]},"KnowledgeTable":{"type":"object","properties":{"tableId":{"description":"The table.","$ref":"#/components/schemas/TableId"},"name":{"type":"string","description":"The table's name."},"reasons":{"minItems":1,"type":"array","items":{"$ref":"#/components/schemas/KnowledgeTableReason"},"description":"Why it loads here: one reason or both."},"profile":{"anyOf":[{"$ref":"#/components/schemas/KnowledgeTableProfile"},{"type":"null"}],"description":"Its profile as agents read it, from the Org map: its description and other names; null when it has neither."},"memories":{"type":"array","items":{"$ref":"#/components/schemas/KnowledgeMemory"},"description":"The memories about it that load, in the order read."}},"required":["tableId","name","reasons","profile","memories"]},"KnowledgeTableProfile":{"type":"object","properties":{"about":{"description":"What the table is about; null when nobody wrote it.","type":["string","null"]},"aliases":{"type":"array","items":{"type":"string"},"description":"Its other names."}},"required":["about","aliases"]},"KnowledgeTableReason":{"type":"string","enum":["record_table","shared"]},"KnowledgeTargetLine":{"type":"object","properties":{"targetId":{"description":"The target.","$ref":"#/components/schemas/HealthTargetId"},"line":{"type":"string","description":"What it measures and where it stands, as agents read it."}},"required":["targetId","line"]},"LearnedNameVia":{"type":"string","enum":["which_one","subject_change","link_accept"],"description":"`which_one`: they picked it on a \"which one?\" question; `subject_change`: they moved a memory to it; `link_accept`: they accepted a card that linked a chat to it."},"LearnedRecordName":{"type":"object","properties":{"id":{"description":"The learned name's id.","$ref":"#/components/schemas/RecordNameId"},"recordId":{"description":"The record that learned it.","$ref":"#/components/schemas/RecordId"},"name":{"type":"string","minLength":1,"maxLength":80,"description":"The word, as the record's own name writes it, such as \"Francisco\"."},"via":{"anyOf":[{"$ref":"#/components/schemas/LearnedNameVia"},{"type":"null"}],"description":"How the answer it came from picked the record; null for a caller who may not remove it."},"learnedBy":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"Whose answer taught it; null for a caller who may not remove it."},"learnedAt":{"description":"When it was learned; for a caller who may not remove it, the day alone (its UTC midnight).","$ref":"#/components/schemas/IsoDateTime"}},"required":["id","recordId","name","via","learnedBy","learnedAt"]},"LibraryFacets":{"type":"object","properties":{"all":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many files the caller may view, with no filter and no search."},"owner":{"type":"object","properties":{"me":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many files match with `owner=me`."},"others":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many files match with `owner=others`."}},"required":["me","others"],"description":"The counts of each owner, under the other filters and the search but not `owner`."},"kind":{"type":"object","properties":{"image":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many images match."},"video":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many videos match."},"document":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many PDFs and documents match."}},"required":["image","video","document"],"description":"The counts of each type, under the other filters and the search but no type filter."},"needsMe":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many files match with `needsMe=true`, under the other filters and the search."}},"required":["all","owner","kind","needsMe"]},"LibraryKind":{"type":"string","enum":["image","video","document"]},"LibraryOwner":{"type":"string","enum":["me","others"]},"LibrarySort":{"type":"string","enum":["newest","oldest","name_asc","name_desc"]},"LibraryUploadInput":{"type":"object","properties":{"visibility":{"description":"Who may see the new file: everyone in the organization (`organization`), or only its uploader and the organization's owner and admins (`private`).","$ref":"#/components/schemas/Visibility"}},"required":["visibility"],"additionalProperties":false},"LinkedRecordColumn":{"type":"object","properties":{"id":{"description":"The column's id: the key of its cell in each record's `values`.","$ref":"#/components/schemas/ColumnId"},"tableId":{"description":"The table the column belongs to.","$ref":"#/components/schemas/TableId"},"name":{"type":"string","minLength":1,"maxLength":80,"description":"The column's name, shown in its header."},"position":{"description":"The column's place in the table: columns sort by this key, compared as text.","$ref":"#/components/schemas/FractionalIndex"},"readOnly":{"type":"boolean","description":"Whether only the server writes the column's cells; a record write that sets one answers `400 validation_failed`."},"revision":{"description":"Grows by one with every change to the column; send it as `expectedRevision` to change the column.","$ref":"#/components/schemas/Revision"},"type":{"type":"string","const":"linked_record","description":"The column's type, which decides what its cells hold."},"targetTableId":{"description":"The table whose records the cells link to.","$ref":"#/components/schemas/TableId"},"multiple":{"type":"boolean","description":"Whether a cell may link several records; false allows one."}},"required":["id","tableId","name","position","readOnly","revision","type","targetTableId","multiple"]},"LinkedRecordLabel":{"type":"object","properties":{"id":{"description":"The record's id.","$ref":"#/components/schemas/RecordId"},"tableId":{"description":"The table the record belongs to.","$ref":"#/components/schemas/TableId"},"label":{"type":"string","description":"The text of its table's primary column, as its link pill shows it."}},"required":["id","tableId","label"]},"LinkedRecordLabelPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/LinkedRecordLabel"},"description":"This page of the list."},"nextCursor":{"anyOf":[{"$ref":"#/components/schemas/Cursor"},{"type":"null"}],"description":"Send it back as `cursor` to read the next page; null on the last page."}},"required":["items","nextCursor"]},"ListAnnotationsResult":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Annotation"},"description":"Every annotation of the version, in number order."}},"required":["items"]},"ListApprovalLinksResult":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/ApprovalLink"},"description":"This page of the list."},"nextCursor":{"anyOf":[{"$ref":"#/components/schemas/Cursor"},{"type":"null"}],"description":"Send it back as `cursor` to read the next page; null on the last page."}},"required":["items","nextCursor"]},"ListChatsResult":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/ChatListRow"},"description":"This page of the list."},"nextCursor":{"anyOf":[{"$ref":"#/components/schemas/Cursor"},{"type":"null"}],"description":"Send it back as `cursor` to read the next page; null on the last page."},"totalCount":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many chats the caller can see in the organization, in all."}},"required":["items","nextCursor","totalCount"]},"ListConnectorsResult":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/ConnectorListItem"},"description":"Every connector Fleepr offers, each once."}},"required":["items"]},"ListFilesResult":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/FileSummary"},"description":"This page of the list."},"nextCursor":{"anyOf":[{"$ref":"#/components/schemas/Cursor"},{"type":"null"}],"description":"Send it back as `cursor` to read the next page; null on the last page."},"totalCount":{"description":"How many items match across every page, among those you may see.","$ref":"#/components/schemas/TotalCount"},"facets":{"description":"The filter counts, on the first page of a request with `facets=true`; absent otherwise.","$ref":"#/components/schemas/LibraryFacets"}},"required":["items","nextCursor","totalCount"]},"ListModelsResult":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/ModelOption"},"description":"The models agents can run, in the order the picker shows them; one is the default."}},"required":["items"]},"ListPinsResult":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/ChatListRow"},"description":"This page of the list."},"nextCursor":{"anyOf":[{"$ref":"#/components/schemas/Cursor"},{"type":"null"}],"description":"Send it back as `cursor` to read the next page; null on the last page."}},"required":["items","nextCursor"]},"ListPublicFileLinksResult":{"type":"object","properties":{"items":{"maxItems":100,"type":"array","items":{"$ref":"#/components/schemas/PublicFileLink"},"description":"The file's public links, newest first, at most 100."}},"required":["items"]},"LogCategory":{"type":"string","enum":["chat","table","media","flow","agent","skill","connector","team","security"]},"LogChange":{"type":"object","properties":{"label":{"type":"string","minLength":1,"description":"What changed, in words, such as \"Role\" or \"Approver added\"."},"from":{"anyOf":[{"$ref":"#/components/schemas/LogChangeValue"},{"type":"null"}],"description":"The value before the change; null when there is none to compare with (a creation, an older event) or the line states a fact rather than a change: then show `to` alone."},"to":{"anyOf":[{"$ref":"#/components/schemas/LogChangeValue"},{"type":"null"}],"description":"The value after the change; null when it was cleared or taken away, such as a removed approver."}},"required":["label","from","to"]},"LogChangeValue":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"text","description":"`text`: the value in words, shown as it is."},"text":{"type":"string","minLength":1,"description":"The value in words, such as \"Admin\" or \"2 of 3 approved\"."}},"required":["kind","text"]},{"type":"object","properties":{"kind":{"type":"string","const":"comment","description":"`comment`: a comment in a file's thread, to link to."},"fileId":{"description":"The file whose comments hold it.","$ref":"#/components/schemas/FileId"},"messageId":{"description":"The comment's id: open the file's comments at it.","$ref":"#/components/schemas/MessageId"}},"required":["kind","fileId","messageId"]}]},"LogEntry":{"type":"object","properties":{"id":{"description":"The entry's id: the id of the event it lists, as the organization stream sends it.","$ref":"#/components/schemas/EventId"},"occurredAt":{"description":"When the event happened.","$ref":"#/components/schemas/IsoDateTime"},"eventType":{"description":"What happened, as `<object>.<verb>`, such as `table.created`.","$ref":"#/components/schemas/EventType"},"label":{"type":"string","description":"A one-line summary to show, such as \"Table created: Influencer outreach\"."},"detail":{"description":"A second line with more detail, such as \"In Influencer outreach\" for a column added to that table; null when there is none.","type":["string","null"]},"category":{"description":"The area the entry belongs to, for its icon and the type filter, such as `chat` or `security`.","$ref":"#/components/schemas/LogCategory"},"by":{"description":"Who made the change: a member, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"The member an agent acted for; null when the author acted for themselves."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The chain of agent work the change was part of; null outside an agent's work."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change was part of; null outside a run."},"result":{"description":"`ok` (done), `warn` (warning) or `error` (failed).","$ref":"#/components/schemas/LogResult"},"object":{"anyOf":[{"$ref":"#/components/schemas/LogObject"},{"type":"null"}],"description":"The object the entry is about, with its name at the time; null when it is about none."},"apiKey":{"anyOf":[{"$ref":"#/components/schemas/ApiKeyRef"},{"type":"null"}],"description":"The API key the change was made with, directly or by an agent working for it; null for a change made without a key."},"turnId":{"anyOf":[{"$ref":"#/components/schemas/TurnId"},{"type":"null"}],"description":"The agent turn the entry is about, such as an agent's reply or a failed turn; null on every other entry. Read it with `chats.getTurn`, which answers only a caller who may view its thread."}},"required":["id","occurredAt","eventType","label","detail","category","by","onBehalfOf","chainId","flowRunId","result","object","apiKey","turnId"]},"LogEntryDetail":{"type":"object","properties":{"id":{"description":"The entry's id: the id of the event it lists, as the organization stream sends it.","$ref":"#/components/schemas/EventId"},"occurredAt":{"description":"When the event happened.","$ref":"#/components/schemas/IsoDateTime"},"eventType":{"description":"What happened, as `<object>.<verb>`, such as `table.created`.","$ref":"#/components/schemas/EventType"},"label":{"type":"string","description":"A one-line summary to show, such as \"Table created: Influencer outreach\"."},"detail":{"description":"A second line with more detail, such as \"In Influencer outreach\" for a column added to that table; null when there is none.","type":["string","null"]},"category":{"description":"The area the entry belongs to, for its icon and the type filter, such as `chat` or `security`.","$ref":"#/components/schemas/LogCategory"},"by":{"description":"Who made the change: a member, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"The member an agent acted for; null when the author acted for themselves."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The chain of agent work the change was part of; null outside an agent's work."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change was part of; null outside a run."},"result":{"description":"`ok` (done), `warn` (warning) or `error` (failed).","$ref":"#/components/schemas/LogResult"},"object":{"anyOf":[{"$ref":"#/components/schemas/LogObject"},{"type":"null"}],"description":"The object the entry is about, with its name at the time; null when it is about none."},"apiKey":{"anyOf":[{"$ref":"#/components/schemas/ApiKeyRef"},{"type":"null"}],"description":"The API key the change was made with, directly or by an agent working for it; null for a change made without a key."},"turnId":{"anyOf":[{"$ref":"#/components/schemas/TurnId"},{"type":"null"}],"description":"The agent turn the entry is about, such as an agent's reply or a failed turn; null on every other entry. Read it with `chats.getTurn`, which answers only a caller who may view its thread."},"changes":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/LogChange"}},{"type":"null"}],"description":"What the change was, line by line: for an approval its decision, round, count, how it was decided and its approvers; for a member or an invite the email, role and job title; for a save of a flow, an agent, a skill or a connection what it changed (a version, a state, a model, the skills and connections added or removed, or that the instructions, settings, credential or tools changed, never their content); for an access change who can see it and how many people, agents and invited people can; a rename, a column type or a memory's status from and to. Empty when there's nothing more to show; null when the entry's event is no longer kept (a deleted chat's history is purged after 30 days)."}},"required":["id","occurredAt","eventType","label","detail","category","by","onBehalfOf","chainId","flowRunId","result","object","apiKey","turnId","changes"]},"LogObject":{"type":"object","properties":{"ref":{"description":"The type and id of the object the entry is about.","$ref":"#/components/schemas/ObjectRef"},"name":{"type":"string","description":"The object's name when the event happened, even if it was renamed since."}},"required":["ref","name"]},"LogoToken":{"type":"string","pattern":"^[0-9a-f]{32}$"},"LogPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/LogEntry"},"description":"This page of the list."},"nextCursor":{"anyOf":[{"$ref":"#/components/schemas/Cursor"},{"type":"null"}],"description":"Send it back as `cursor` to read the next page; null on the last page."},"totalCount":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many entries the caller may see in the window."},"matchCount":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many of those entries match `q`, `filter` and `byKind`, across every page."},"windowDays":{"description":"How many days back the list reads: the one asked for, or 30, never past the retention.","$ref":"#/components/schemas/LogWindowDays"},"retentionDays":{"description":"The organization's log retention in days: the longest window there is.","$ref":"#/components/schemas/LogRetentionDays"}},"required":["items","nextCursor","totalCount","matchCount","windowDays","retentionDays"]},"LogResult":{"type":"string","enum":["ok","warn","error"]},"LogRetentionDays":{"type":"integer","minimum":1,"maximum":3650},"LogWindowDays":{"type":"integer","minimum":1,"maximum":3650},"MarkChatReadBody":{"type":"object","properties":{"upToMessageId":{"description":"The newest message of the chat you have seen. Your mentions in the chat up to it are marked read, with their notifications.","$ref":"#/components/schemas/MessageId"}},"required":["upToMessageId"],"additionalProperties":false},"MarkNotificationsReadBody":{"type":"object","properties":{"ids":{"description":"The notifications to mark as read, 1 to 200; send this or `all`.","minItems":1,"maxItems":200,"type":"array","items":{"$ref":"#/components/schemas/NotificationId"}},"all":{"description":"`true` marks every one of the caller's notifications as read; send this or `ids`.","type":"boolean","const":true}},"additionalProperties":false},"MarkNotificationsReadResult":{"type":"object","properties":{"unreadCount":{"description":"The caller's new unread count in the organization.","$ref":"#/components/schemas/UnreadCount"},"badgeCount":{"description":"The bell's new badge; read `unreadCount` when it is missing.","$ref":"#/components/schemas/BadgeCount"}},"required":["unreadCount"]},"McpConnectInput":{"type":"object","properties":{"url":{"description":"The server's address: `https` on port 443, a public host, no user name, query or fragment. Put keys in `headers`.","$ref":"#/components/schemas/Url"},"transport":{"description":"How to talk to the server: `streamable_http` or `sse`.","$ref":"#/components/schemas/McpTransport"},"headers":{"description":"Custom headers to send, such as an `Authorization` header, up to 20; their values are stored and never returned.","$ref":"#/components/schemas/McpHeaders"}},"required":["url","transport"],"additionalProperties":false},"McpConnectionConfig":{"type":"object","properties":{"url":{"description":"The MCP server's address: public HTTPS on port 443. A caller who may not edit the connection gets its origin followed by `/…`, since a path can hold a secret.","$ref":"#/components/schemas/Url"},"transport":{"description":"How Fleepr talks to the server: `streamable_http` or `sse`.","$ref":"#/components/schemas/McpTransport"},"headerNames":{"type":"array","items":{"$ref":"#/components/schemas/McpHeaderName"},"description":"The names of the custom headers that are set; their values are never returned."},"hasSecret":{"type":"boolean","description":"Whether header values are stored for this server."},"signIn":{"default":null,"description":"The sign-in of a server that accepts only OAuth tokens: whether one is needed, done or must be done again, where it opens, and who signed in. Null for a server that takes headers.","anyOf":[{"$ref":"#/components/schemas/McpSignIn"},{"type":"null"}]}},"required":["url","transport","headerNames","hasSecret","signIn"]},"McpHeaderName":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[!#$%&'*+.^_`|~0-9A-Za-z-]+$"},"McpHeaders":{"type":"object","propertyNames":{"$ref":"#/components/schemas/McpHeaderName"},"additionalProperties":{"$ref":"#/components/schemas/McpHeaderValue"}},"McpHeadersPatch":{"type":"object","propertyNames":{"$ref":"#/components/schemas/McpHeaderName"},"additionalProperties":{"anyOf":[{"$ref":"#/components/schemas/McpHeaderValue"},{"type":"null"}]}},"McpHeaderValue":{"type":"string","minLength":1,"maxLength":4096},"McpSignIn":{"type":"object","properties":{"state":{"description":"`needed`: the server wants a sign-in and nobody has signed in; `signed_in`: working, Fleepr renews it; `reconnect_needed`: the sign-in ended, so someone has to sign in again.","$ref":"#/components/schemas/McpSignInState"},"host":{"type":"string","minLength":1,"maxLength":253,"description":"The host the sign-in opens, the server's authorization server, such as `mcp.poolday.ai`."},"signedInBy":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"Who signed in last; null while nobody has."},"signedInAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}],"description":"When they signed in; null while nobody has."}},"required":["state","host","signedInBy","signedInAt"]},"McpSignInState":{"type":"string","enum":["needed","signed_in","reconnect_needed"]},"McpTransport":{"type":"string","enum":["streamable_http","sse"]},"McpUpdateInput":{"type":"object","properties":{"url":{"description":"The server's new address; only its owner or an admin may change it, and every stored header must then be set again or removed. It follows the rules of the address a server is added with, and the shortened one a caller who may not edit reads (its origin and `/…`) is refused.","$ref":"#/components/schemas/Url"},"transport":{"description":"The new transport: `streamable_http` or `sse`.","$ref":"#/components/schemas/McpTransport"},"headers":{"description":"Headers to change by name: a value sets one, null removes it, and headers left out stay.","$ref":"#/components/schemas/McpHeadersPatch"}},"additionalProperties":false},"Me":{"type":"object","properties":{"user":{"description":"The signed-in user.","$ref":"#/components/schemas/User"},"memberships":{"type":"array","items":{"$ref":"#/components/schemas/Membership"},"description":"The organizations where the user is an active member, one entry each."},"preferences":{"description":"The user's own appearance, language and email settings, the same in every organization.","$ref":"#/components/schemas/Preferences"},"lastOrganizationId":{"anyOf":[{"$ref":"#/components/schemas/OrganizationId"},{"type":"null"}],"description":"The organization the app opens first; null until the user has chosen one."},"uploads":{"type":"boolean","description":"Whether this server keeps uploaded files; when `false`, profile photos, attachments and other uploads are not available."},"mayCreateOrganization":{"type":"boolean","description":"Whether the user may create an organization. `false` while organizations are created by invitation only and the user is not one of the people who create them: `identity.createOrganization` answers `403 forbidden`, so ask an organization's owner or an admin for an invite instead."}},"required":["user","memberships","preferences","lastOrganizationId","uploads","mayCreateOrganization"]},"MediaGalleryBlock":{"type":"object","properties":{"kind":{"type":"string","const":"media_gallery","description":"A gallery of files."},"id":{"description":"The gallery's id.","$ref":"#/components/schemas/BlockId"},"title":{"anyOf":[{"type":"string","minLength":1,"maxLength":120},{"type":"null"}],"description":"The gallery's heading, such as \"Files for review\"; null for none."},"fileIds":{"minItems":1,"maxItems":24,"type":"array","items":{"$ref":"#/components/schemas/FileId"},"description":"The files, in the order the review dialog shows them; their details come in `included.files`."}},"required":["kind","id","title","fileIds"]},"Member":{"type":"object","properties":{"id":{"description":"The member's id, which stays the same when they are removed and restored, so history stays theirs.","$ref":"#/components/schemas/MemberId"},"organizationId":{"description":"The organization the member belongs to.","$ref":"#/components/schemas/OrganizationId"},"userId":{"anyOf":[{"$ref":"#/components/schemas/UserId"},{"type":"null"}],"description":"The login behind the member; null while they are invited and have not joined."},"email":{"description":"The member's email address; the address an invited member was invited at.","$ref":"#/components/schemas/Email"},"name":{"type":"string","minLength":1,"description":"The member's name; for someone invited who never joined, the part of their email address before the `@`."},"avatarUrl":{"anyOf":[{"$ref":"#/components/schemas/Url"},{"type":"null"}],"description":"A link to the member's profile photo; null when there is none, and the app shows initials."},"jobTitle":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}],"description":"The member's job title in this organization, such as \"Copywriter\"; null when none is set."},"role":{"description":"The member's role, which sets what they may do in the organization.","$ref":"#/components/schemas/OrgRole"},"status":{"description":"`invited`: has an invite and has not joined; `active`: works in the organization; `deactivated`: removed, and can be restored.","$ref":"#/components/schemas/MemberStatus"},"teamIds":{"type":"array","items":{"$ref":"#/components/schemas/TeamId"},"description":"The teams the member belongs to."},"lastActiveAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}],"description":"When Fleepr last recorded the member as active, which it does when they join; null when they never joined."},"joinedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}],"description":"When the member last joined the organization; null when they never joined."},"invite":{"anyOf":[{"$ref":"#/components/schemas/MemberInvite"},{"type":"null"}],"description":"The member's latest invite, for resending or cancelling it; null when they were never invited."},"deactivatedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}],"description":"When the member was removed; null unless their status is `deactivated`."},"revision":{"description":"Grows by one on every change to the member; send it back as `expectedRevision` when you update it.","$ref":"#/components/schemas/Revision"},"viewer":{"description":"What the caller may do with this member.","$ref":"#/components/schemas/MemberViewer"}},"required":["id","organizationId","userId","email","name","avatarUrl","jobTitle","role","status","teamIds","lastActiveAt","joinedAt","invite","deactivatedAt","revision","viewer"]},"MemberCounts":{"type":"object","properties":{"active":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many members are active."},"invited":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many people are invited and have not joined yet."},"deactivated":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many members were removed."}},"required":["active","invited","deactivated"]},"MemberDeactivatedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"member.deactivated","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"description":"What the event carries; for a change, the object as it is after it.","$ref":"#/components/schemas/MemberEventPayload"}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"MemberEventPayload":{"type":"object","properties":{"member":{"description":"The member after the change, as the receiving member sees it.","$ref":"#/components/schemas/Member"}},"required":["member"]},"MemberId":{"type":"string","pattern":"^mbr_[0-9a-hjkmnp-tv-z]{26}$"},"MemberInvite":{"type":"object","properties":{"id":{"description":"The invite's id, for resending or cancelling it.","$ref":"#/components/schemas/InviteId"},"status":{"description":"The invite's status; only a `pending` invite can be resent or cancelled.","$ref":"#/components/schemas/InviteStatus"},"lastSentAt":{"description":"When the invite email was last sent.","$ref":"#/components/schemas/IsoDateTime"},"expiresAt":{"description":"When the invite's link stops working.","$ref":"#/components/schemas/IsoDateTime"},"undelivered":{"default":null,"description":"Why and when the latest invite email did not arrive (it bounced or was marked as spam); null when no problem was reported.","anyOf":[{"$ref":"#/components/schemas/EmailUndelivered"},{"type":"null"}]}},"required":["id","status","lastSentAt","expiresAt","undelivered"]},"MemberInvitedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"member.invited","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"description":"What the event carries; for a change, the object as it is after it.","$ref":"#/components/schemas/MemberEventPayload"}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"MemberJoinedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"member.joined","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"description":"What the event carries; for a change, the object as it is after it.","$ref":"#/components/schemas/MemberEventPayload"}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"MemberPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Member"},"description":"This page of the list."},"nextCursor":{"anyOf":[{"$ref":"#/components/schemas/Cursor"},{"type":"null"}],"description":"Send it back as `cursor` to read the next page; null on the last page."},"counts":{"description":"The member counts of the whole organization, whatever the query's filters.","$ref":"#/components/schemas/MemberCounts"}},"required":["items","nextCursor","counts"]},"MemberReactivatedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"member.reactivated","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"description":"What the event carries; for a change, the object as it is after it.","$ref":"#/components/schemas/MemberEventPayload"}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"Membership":{"type":"object","properties":{"organizationId":{"description":"The organization's id.","$ref":"#/components/schemas/OrganizationId"},"organizationName":{"type":"string","description":"The organization's name."},"memberId":{"description":"The user's member in this organization: the id that owns, authors and decides for them there.","$ref":"#/components/schemas/MemberId"},"role":{"description":"The user's role in this organization.","$ref":"#/components/schemas/OrgRole"},"jobTitle":{"description":"The job title the user has in this organization, such as \"Account Director\"; null when none is set.","type":["string","null"]},"visibleChatCount":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many chats of this organization the user can see."},"memberCount":{"description":"How many active members the organization has; absent when unknown.","type":"integer","minimum":0,"maximum":9007199254740991},"squareLogoUrl":{"description":"A public link to the organization's square logo; null or absent when there is none, and the app shows its initial instead.","anyOf":[{"$ref":"#/components/schemas/Url"},{"type":"null"}]}},"required":["organizationId","organizationName","memberId","role","jobTitle","visibleChatCount"]},"MemberStatus":{"type":"string","enum":["invited","active","deactivated"]},"MemberUpdatedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"member.updated","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"description":"What the event carries; for a change, the object as it is after it.","$ref":"#/components/schemas/MemberEventPayload"}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"MemberViewer":{"type":"object","properties":{"canChangeRole":{"type":"boolean","description":"Whether the caller may change this member's role; never on the owner or a removed member."},"canDeactivate":{"type":"boolean","description":"Whether the caller may remove this member, reversibly; never the owner."},"canReactivate":{"type":"boolean","description":"Whether the caller may restore this removed member."},"canResendInvite":{"type":"boolean","description":"Whether the caller may send this member's pending invite again."},"canRevokeInvite":{"type":"boolean","description":"Whether the caller may cancel this member's pending invite."}},"required":["canChangeRole","canDeactivate","canReactivate","canResendInvite","canRevokeInvite"]},"Memory":{"type":"object","properties":{"id":{"description":"The memory's id.","$ref":"#/components/schemas/MemoryId"},"organizationId":{"description":"The organization it belongs to.","$ref":"#/components/schemas/OrganizationId"},"subject":{"description":"What it is about.","$ref":"#/components/schemas/MemorySubject"},"text":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}],"description":"One sentence, up to 200 characters; null once forgotten."},"type":{"description":"`rule` (lasting) or `fact` (true until `validUntil`).","$ref":"#/components/schemas/MemoryType"},"validUntil":{"anyOf":[{"$ref":"#/components/schemas/IsoDate"},{"type":"null"}],"description":"The day a fact stops being true; null for a rule."},"docId":{"anyOf":[{"$ref":"#/components/schemas/FileId"},{"type":"null"}],"description":"A doc in Files with the longer knowledge the sentence stands for (agents read it with the memory); null for none, or when the caller may not view it or it was deleted."},"status":{"description":"Where it stands.","$ref":"#/components/schemas/MemoryStatus"},"rejectReason":{"anyOf":[{"$ref":"#/components/schemas/MemoryRejectReason"},{"type":"null"}],"description":"Why it was rejected; null unless rejected."},"rejectNote":{"anyOf":[{"type":"string","minLength":1,"maxLength":500},{"type":"null"}],"description":"The words of a rejection for another reason; null otherwise."},"pinned":{"type":"boolean","description":"Always kept: never flagged as unused nor archived on its own."},"supersedesId":{"anyOf":[{"$ref":"#/components/schemas/MemoryId"},{"type":"null"}],"description":"The last memory this one replaced; null for none, or when the caller may not see it or it was restored."},"supersededById":{"anyOf":[{"$ref":"#/components/schemas/MemoryId"},{"type":"null"}],"description":"The memory that replaced this one; null for none, or when the caller may not see it or once restored."},"revises":{"anyOf":[{"$ref":"#/components/schemas/MemoryRevises"},{"type":"null"}],"description":"For a suggested new version (an agent’s suggestion that changes what a confirmed memory says): the memory it would change, with its words now. Confirming the suggestion makes its words that memory’s newest version (the old words stay in its versions) and closes the suggestion as rejected `revised`. Null for none, when the caller may not see that memory, or while the suggestion waits once that memory is no longer confirmed (confirming it then adds it as a memory of its own)."},"source":{"description":"Where it came from.","$ref":"#/components/schemas/MemorySource"},"createdBy":{"description":"Who added or suggested it: a person or an agent.","$ref":"#/components/schemas/ActorId"},"suggestedFor":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"The person a suggestion is for when an agent or Fleepr made it (an agent's: who it worked for); null when a person added it. While suggested, only its deciders and the person it came from see it, and once rejected too."},"confirmedBy":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"The person who last made it confirmed (added it as a decider, confirmed or restored it); null until then."},"confirmedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}],"description":"When it was last made confirmed, with `confirmedBy`; keeping it does not move it."},"decidedBy":{"anyOf":[{"$ref":"#/components/schemas/ActorId"},{"type":"null"}],"description":"Who made its latest decision: a person, or Fleepr's system actor (`sys_`) when a suggestion expired or a memory archived itself; null for none yet."},"decidedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}],"description":"When; null for none yet."},"archivedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}],"description":"When it was archived; null unless archived."},"archiveReason":{"anyOf":[{"$ref":"#/components/schemas/MemoryArchiveReason"},{"type":"null"}],"description":"Why it was archived: by a person, past its day, or unused; null unless archived."},"keptAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}],"description":"When a person last chose to keep it; null for never."},"unusedSince":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}],"description":"When Health found it unused: it shaped no answer for the threshold of active days (90 by default) while its scope was active. With no answer it archives itself 30 days later; keeping, pinning or an agent applying it clears this. Null otherwise, and always unless confirmed and unpinned."},"lastReadAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}],"description":"The day an agent last loaded it, as the start of that UTC day; null for never."},"lastAppliedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}],"description":"The day it last shaped an agent’s answer, as the start of that UTC day; null for never."},"readCount30d":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many turns loaded it in the 30 days before the UTC day of the organization’s latest nightly check began (written once a night)."},"appliedCount30d":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many answers it shaped in the 30 days before the UTC day of the organization’s latest nightly check began (written once a night)."},"versionCount":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"How many versions its words have had."},"revision":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"Grows with every change; send it back as `expectedRevision`."},"createdAt":{"description":"When it was added.","$ref":"#/components/schemas/IsoDateTime"},"updatedAt":{"description":"When it last changed.","$ref":"#/components/schemas/IsoDateTime"},"viewer":{"description":"What the caller may do with it.","$ref":"#/components/schemas/MemoryViewer"}},"required":["id","organizationId","subject","text","type","validUntil","docId","status","rejectReason","rejectNote","pinned","supersedesId","supersededById","revises","source","createdBy","suggestedFor","confirmedBy","confirmedAt","decidedBy","decidedAt","archivedAt","archiveReason","keptAt","unusedSince","lastReadAt","lastAppliedAt","readCount30d","appliedCount30d","versionCount","revision","createdAt","updatedAt","viewer"]},"MemoryArchiveReason":{"type":"string","enum":["person","valid_until","unused"]},"MemoryCounts":{"type":"object","properties":{"current":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"The suggested and confirmed memories the caller sees."},"org":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Of those, the ones about the organization."},"record":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Of those, the ones about a record."},"agent":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Of those, the ones about an agent."},"table":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Of those, the ones about a table."},"needsYou":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"The suggestions the caller decides."},"unused":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"The confirmed memories Health found unused."},"setAside":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"The archived and rejected memories the caller sees."}},"required":["current","org","record","agent","table","needsYou","unused","setAside"]},"MemoryCreatedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"memory.created","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"description":"What the event carries; for a change, the object as it is after it.","$ref":"#/components/schemas/MemoryEventPayload"}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"MemoryDecidedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"memory.decided","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"description":"What the event carries; for a change, the object as it is after it.","$ref":"#/components/schemas/MemoryDecidedPayload"}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"MemoryDecidedPayload":{"type":"object","properties":{"memoryId":{"description":"The memory.","$ref":"#/components/schemas/MemoryId"},"scope":{"description":"What it is about.","$ref":"#/components/schemas/MemoryScope"},"status":{"description":"Its status after the write.","$ref":"#/components/schemas/MemoryStatus"},"tableId":{"anyOf":[{"$ref":"#/components/schemas/TableId"},{"type":"null"}],"description":"The table of a record or table memory; null otherwise."},"recordId":{"anyOf":[{"$ref":"#/components/schemas/RecordId"},{"type":"null"}],"description":"The record of a record memory; null otherwise."},"agentId":{"anyOf":[{"$ref":"#/components/schemas/AgentId"},{"type":"null"}],"description":"The agent of an agent memory; null otherwise."},"action":{"description":"What was decided; `superseded` for the memory another one replaced.","$ref":"#/components/schemas/MemoryDecision"}},"required":["memoryId","scope","status","tableId","recordId","agentId","action"]},"MemoryDecision":{"type":"string","enum":["confirm","reject","keep","archive","restore","forget","supersede","superseded","expire"]},"MemoryDetail":{"type":"object","properties":{"id":{"description":"The memory's id.","$ref":"#/components/schemas/MemoryId"},"organizationId":{"description":"The organization it belongs to.","$ref":"#/components/schemas/OrganizationId"},"subject":{"description":"What it is about.","$ref":"#/components/schemas/MemorySubject"},"text":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}],"description":"One sentence, up to 200 characters; null once forgotten."},"type":{"description":"`rule` (lasting) or `fact` (true until `validUntil`).","$ref":"#/components/schemas/MemoryType"},"validUntil":{"anyOf":[{"$ref":"#/components/schemas/IsoDate"},{"type":"null"}],"description":"The day a fact stops being true; null for a rule."},"docId":{"anyOf":[{"$ref":"#/components/schemas/FileId"},{"type":"null"}],"description":"A doc in Files with the longer knowledge the sentence stands for (agents read it with the memory); null for none, or when the caller may not view it or it was deleted."},"status":{"description":"Where it stands.","$ref":"#/components/schemas/MemoryStatus"},"rejectReason":{"anyOf":[{"$ref":"#/components/schemas/MemoryRejectReason"},{"type":"null"}],"description":"Why it was rejected; null unless rejected."},"rejectNote":{"anyOf":[{"type":"string","minLength":1,"maxLength":500},{"type":"null"}],"description":"The words of a rejection for another reason; null otherwise."},"pinned":{"type":"boolean","description":"Always kept: never flagged as unused nor archived on its own."},"supersedesId":{"anyOf":[{"$ref":"#/components/schemas/MemoryId"},{"type":"null"}],"description":"The last memory this one replaced; null for none, or when the caller may not see it or it was restored."},"supersededById":{"anyOf":[{"$ref":"#/components/schemas/MemoryId"},{"type":"null"}],"description":"The memory that replaced this one; null for none, or when the caller may not see it or once restored."},"revises":{"anyOf":[{"$ref":"#/components/schemas/MemoryRevises"},{"type":"null"}],"description":"For a suggested new version (an agent’s suggestion that changes what a confirmed memory says): the memory it would change, with its words now. Confirming the suggestion makes its words that memory’s newest version (the old words stay in its versions) and closes the suggestion as rejected `revised`. Null for none, when the caller may not see that memory, or while the suggestion waits once that memory is no longer confirmed (confirming it then adds it as a memory of its own)."},"source":{"description":"Where it came from.","$ref":"#/components/schemas/MemorySource"},"createdBy":{"description":"Who added or suggested it: a person or an agent.","$ref":"#/components/schemas/ActorId"},"suggestedFor":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"The person a suggestion is for when an agent or Fleepr made it (an agent's: who it worked for); null when a person added it. While suggested, only its deciders and the person it came from see it, and once rejected too."},"confirmedBy":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"The person who last made it confirmed (added it as a decider, confirmed or restored it); null until then."},"confirmedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}],"description":"When it was last made confirmed, with `confirmedBy`; keeping it does not move it."},"decidedBy":{"anyOf":[{"$ref":"#/components/schemas/ActorId"},{"type":"null"}],"description":"Who made its latest decision: a person, or Fleepr's system actor (`sys_`) when a suggestion expired or a memory archived itself; null for none yet."},"decidedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}],"description":"When; null for none yet."},"archivedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}],"description":"When it was archived; null unless archived."},"archiveReason":{"anyOf":[{"$ref":"#/components/schemas/MemoryArchiveReason"},{"type":"null"}],"description":"Why it was archived: by a person, past its day, or unused; null unless archived."},"keptAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}],"description":"When a person last chose to keep it; null for never."},"unusedSince":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}],"description":"When Health found it unused: it shaped no answer for the threshold of active days (90 by default) while its scope was active. With no answer it archives itself 30 days later; keeping, pinning or an agent applying it clears this. Null otherwise, and always unless confirmed and unpinned."},"lastReadAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}],"description":"The day an agent last loaded it, as the start of that UTC day; null for never."},"lastAppliedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}],"description":"The day it last shaped an agent’s answer, as the start of that UTC day; null for never."},"readCount30d":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many turns loaded it in the 30 days before the UTC day of the organization’s latest nightly check began (written once a night)."},"appliedCount30d":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many answers it shaped in the 30 days before the UTC day of the organization’s latest nightly check began (written once a night)."},"versionCount":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"How many versions its words have had."},"revision":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"Grows with every change; send it back as `expectedRevision`."},"createdAt":{"description":"When it was added.","$ref":"#/components/schemas/IsoDateTime"},"updatedAt":{"description":"When it last changed.","$ref":"#/components/schemas/IsoDateTime"},"viewer":{"description":"What the caller may do with it.","$ref":"#/components/schemas/MemoryViewer"},"evidence":{"type":"array","items":{"$ref":"#/components/schemas/MemoryEvidence"},"description":"Why: what was said and where, oldest first, then the pieces whose source the caller may not open (no id, no time), so their place never tells when they came."}},"required":["id","organizationId","subject","text","type","validUntil","docId","status","rejectReason","rejectNote","pinned","supersedesId","supersededById","revises","source","createdBy","suggestedFor","confirmedBy","confirmedAt","decidedBy","decidedAt","archivedAt","archiveReason","keptAt","unusedSince","lastReadAt","lastAppliedAt","readCount30d","appliedCount30d","versionCount","revision","createdAt","updatedAt","viewer","evidence"]},"MemoryEventPayload":{"type":"object","properties":{"memoryId":{"description":"The memory.","$ref":"#/components/schemas/MemoryId"},"scope":{"description":"What it is about.","$ref":"#/components/schemas/MemoryScope"},"status":{"description":"Its status after the write.","$ref":"#/components/schemas/MemoryStatus"},"tableId":{"anyOf":[{"$ref":"#/components/schemas/TableId"},{"type":"null"}],"description":"The table of a record or table memory; null otherwise."},"recordId":{"anyOf":[{"$ref":"#/components/schemas/RecordId"},{"type":"null"}],"description":"The record of a record memory; null otherwise."},"agentId":{"anyOf":[{"$ref":"#/components/schemas/AgentId"},{"type":"null"}],"description":"The agent of an agent memory; null otherwise."}},"required":["memoryId","scope","status","tableId","recordId","agentId"]},"MemoryEvidence":{"type":"object","properties":{"sourceType":{"description":"What kind of thing it was said in.","$ref":"#/components/schemas/MemoryEvidenceSource"},"sourceId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Its id, to open it where it was said; null for a caller who may not open its source (a Health issue: who may not open the issue), since an id tells when it was made."},"quote":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}],"description":"A short excerpt; null once the memory is forgotten, and for a caller who may not open its source."},"sourceVisible":{"type":"boolean","description":"Whether the caller may open its source (the chat or file it was said in): when false the quote is null, and the client says \"From a chat you can't open\"."},"place":{"anyOf":[{"$ref":"#/components/schemas/MemoryEvidencePlace"},{"type":"null"}],"description":"Where it opens, for a caller who may open it: null otherwise, for a person who added it themselves, and for a chat the flow engine made (a run is opened from its flow)."},"addedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}],"description":"When it was added; null for a caller who may not open its source (a Health issue: who may not open the issue), since it follows when it was said."},"saidAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}],"description":"When it was said: a message's or a comment's own time, an answer's, a flow sign-off's decision, a Health issue's opening, a person who added the memory themselves: its creation. Null for a caller who may not open its source, as its quote (a Health issue's: who may not open the issue), and when its source is gone (a purged chat)."}},"required":["sourceType","sourceId","quote","sourceVisible","place","addedAt","saidAt"]},"MemoryEvidenceAdded":{"type":"object","properties":{"from":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"The place of the first piece added, from 1."},"count":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"How many pieces it added."}},"required":["from","count"]},"MemoryEvidencePlace":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"chat","description":"Said in a chat."},"chatId":{"description":"The chat.","$ref":"#/components/schemas/ChatId"},"messageId":{"description":"The message, to open the chat at.","$ref":"#/components/schemas/MessageId"}},"required":["type","chatId","messageId"]},{"type":"object","properties":{"type":{"type":"string","const":"file","description":"Said in a file's comments."},"fileId":{"description":"The file.","$ref":"#/components/schemas/FileId"},"messageId":{"description":"The comment.","$ref":"#/components/schemas/MessageId"}},"required":["type","fileId","messageId"]},{"type":"object","properties":{"type":{"type":"string","const":"flow","description":"A flow sign-off's reason."},"flowId":{"description":"The flow.","$ref":"#/components/schemas/FlowId"},"runId":{"description":"The run it was given in.","$ref":"#/components/schemas/FlowRunId"}},"required":["type","flowId","runId"]},{"type":"object","properties":{"type":{"type":"string","const":"health_issue","description":"A Health issue."},"issueId":{"description":"The issue.","$ref":"#/components/schemas/HealthIssueId"}},"required":["type","issueId"]}]},"MemoryEvidenceSource":{"type":"string","enum":["message","file_comment","health_issue","answer","review_comment","member","step_run"]},"MemoryHistory":{"type":"object","properties":{"versions":{"type":"array","items":{"$ref":"#/components/schemas/MemoryVersion"},"description":"The versions of its words the caller may read, newest first: one who sees the memory only since it was confirmed reads the version current at confirmation and those after it, which may be fewer than `versionCount`."}},"required":["versions"]},"MemoryId":{"type":"string","pattern":"^mem_[0-9a-hjkmnp-tv-z]{26}$"},"MemoryListSort":{"type":"string","enum":["changed","read"]},"MemoryListState":{"type":"string","enum":["current","needs_you","unused","set_aside"]},"MemoryPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Memory"},"description":"This page of the list."},"nextCursor":{"anyOf":[{"$ref":"#/components/schemas/Cursor"},{"type":"null"}],"description":"Send it back as `cursor` to read the next page; null on the last page."}},"required":["items","nextCursor"]},"MemoryRejectReason":{"type":"string","enum":["not_true","only_once","too_broad","already_covered","other","expired","revised"]},"MemoryResult":{"type":"object","properties":{"memory":{"description":"The memory after the write.","$ref":"#/components/schemas/MemoryDetail"},"conflicts":{"type":"array","items":{"$ref":"#/components/schemas/Memory"},"description":"Confirmed memories the caller may see, about an overlapping subject (the same one, a record and its table, anything and the organization), whose words are similar, newest change first. When `memory` is confirmed and `viewer.canDecide`, offer to replace them (decide `supersede`); for a suggestion they only inform. Empty when none."}},"required":["memory","conflicts"]},"MemoryRevises":{"type":"object","properties":{"id":{"description":"The memory it would change.","$ref":"#/components/schemas/MemoryId"},"text":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}],"description":"Its words now; null once forgotten."}},"required":["id","text"]},"MemoryScope":{"type":"string","enum":["org","record","agent","table"]},"MemorySource":{"type":"string","enum":["person","agent","send_back","answer","health_issue","review"]},"MemoryStatus":{"type":"string","enum":["suggested","confirmed","archived","rejected","forgotten"]},"MemorySubject":{"oneOf":[{"type":"object","properties":{"scope":{"type":"string","const":"org","description":"The whole organization."}},"required":["scope"]},{"type":"object","properties":{"scope":{"type":"string","const":"record","description":"One record of one of the organization’s tables."},"tableId":{"description":"The table that holds it.","$ref":"#/components/schemas/TableId"},"recordId":{"description":"The record.","$ref":"#/components/schemas/RecordId"},"label":{"description":"The record's display name: its table's name column, else its primary column; null when the record no longer exists.","type":["string","null"]},"tableName":{"description":"The table's name; null when it no longer exists.","type":["string","null"]}},"required":["scope","tableId","recordId","label","tableName"]},{"type":"object","properties":{"scope":{"type":"string","const":"agent","description":"One agent."},"agentId":{"description":"The agent.","$ref":"#/components/schemas/AgentId"}},"required":["scope","agentId"]},{"type":"object","properties":{"scope":{"type":"string","const":"table","description":"One table."},"tableId":{"description":"The table.","$ref":"#/components/schemas/TableId"},"tableName":{"description":"The table's name; null when it no longer exists.","type":["string","null"]}},"required":["scope","tableId","tableName"]}]},"MemorySubjectInput":{"oneOf":[{"type":"object","properties":{"scope":{"type":"string","const":"org","description":"The whole organization."}},"required":["scope"],"additionalProperties":false},{"type":"object","properties":{"scope":{"type":"string","const":"record","description":"One record of one of the organization’s tables."},"recordId":{"description":"The record.","$ref":"#/components/schemas/RecordId"}},"required":["scope","recordId"],"additionalProperties":false},{"type":"object","properties":{"scope":{"type":"string","const":"agent","description":"One agent."},"agentId":{"description":"The agent.","$ref":"#/components/schemas/AgentId"}},"required":["scope","agentId"],"additionalProperties":false},{"type":"object","properties":{"scope":{"type":"string","const":"table","description":"One table."},"tableId":{"description":"The table.","$ref":"#/components/schemas/TableId"}},"required":["scope","tableId"],"additionalProperties":false}]},"MemorySuggestedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"memory.suggested","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"description":"What the event carries; for a change, the object as it is after it.","$ref":"#/components/schemas/MemoryEventPayload"}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"MemorySuggestionMessages":{"type":"integer","minimum":1,"maximum":5},"MemorySuggestionPart":{"type":"object","properties":{"type":{"type":"string","const":"memory_suggestion","description":"A memory suggestion the reply made or added to, shown as a card to the person it came from and its deciders."},"memoryId":{"description":"The memory it shows, read as it stands now: its status, words and subject.","$ref":"#/components/schemas/MemoryId"},"memberId":{"description":"The person it came from: the member the agent worked for.","$ref":"#/components/schemas/MemberId"}},"required":["type","memoryId","memberId"]},"MemoryTextInput":{"type":"string","minLength":1,"maxLength":200,"description":"One sentence on one line, up to 200 characters, with no invisible or direction-changing character."},"MemoryTurnRead":{"type":"object","properties":{"turnId":{"description":"The turn.","$ref":"#/components/schemas/TurnId"},"at":{"description":"When the turn read it.","$ref":"#/components/schemas/IsoDateTime"},"applied":{"type":"boolean","description":"Whether the agent named it as shaping its answer."},"agent":{"type":"object","properties":{"id":{"description":"The agent's id.","$ref":"#/components/schemas/AgentId"},"name":{"type":"string","description":"The agent's name."}},"required":["id","name"],"description":"The agent whose turn it was."},"thread":{"description":"Where the turn ran.","$ref":"#/components/schemas/MemoryTurnThread"},"messageId":{"anyOf":[{"$ref":"#/components/schemas/MessageId"},{"type":"null"}],"description":"The turn's reply, to open the thread at; null for none."}},"required":["turnId","at","applied","agent","thread","messageId"]},"MemoryTurnReads":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/MemoryTurnRead"},"description":"The turns, newest first, at most 10."},"more":{"type":"boolean","description":"Whether more turns the caller may see read it in the last 30 days; also true when the read stopped at its bound before it knew."}},"required":["items","more"]},"MemoryTurnThread":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"chat","description":"A chat."},"chatId":{"description":"The chat.","$ref":"#/components/schemas/ChatId"},"name":{"type":"string","description":"The chat's name."}},"required":["type","chatId","name"]},{"type":"object","properties":{"type":{"type":"string","const":"file","description":"A file's comments."},"fileId":{"description":"The file.","$ref":"#/components/schemas/FileId"},"name":{"type":"string","description":"The file's name."}},"required":["type","fileId","name"]},{"type":"object","properties":{"type":{"type":"string","const":"flow","description":"A flow's own chat."},"flowId":{"anyOf":[{"$ref":"#/components/schemas/FlowId"},{"type":"null"}],"description":"The flow; null for a caller who may not view it (no link)."},"runId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The run whose chat it was; null for a flow's older chat."},"name":{"type":"string","description":"The flow's name, or the chat's own for a caller who may not view the flow."}},"required":["type","flowId","runId","name"]}]},"MemoryType":{"type":"string","enum":["rule","fact"]},"MemoryUpdatedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"memory.updated","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"description":"What the event carries; for a change, the object as it is after it.","$ref":"#/components/schemas/MemoryUpdatedPayload"}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"MemoryUpdatedPayload":{"type":"object","properties":{"memoryId":{"description":"The memory.","$ref":"#/components/schemas/MemoryId"},"scope":{"description":"What it is about.","$ref":"#/components/schemas/MemoryScope"},"status":{"description":"Its status after the write.","$ref":"#/components/schemas/MemoryStatus"},"tableId":{"anyOf":[{"$ref":"#/components/schemas/TableId"},{"type":"null"}],"description":"The table of a record or table memory; null otherwise."},"recordId":{"anyOf":[{"$ref":"#/components/schemas/RecordId"},{"type":"null"}],"description":"The record of a record memory; null otherwise."},"agentId":{"anyOf":[{"$ref":"#/components/schemas/AgentId"},{"type":"null"}],"description":"The agent of an agent memory; null otherwise."},"evidenceAdded":{"description":"Only on an evidence-only change: the pieces of evidence it added. Absent when the memory itself changed. Such an event reaches only the readers who may open the source of each piece.","$ref":"#/components/schemas/MemoryEvidenceAdded"},"subjectChanged":{"description":"Only on a subject change, which writes two events: `from` names the subject it left (its ids) and reaches who read it there; `to` names the new one and reaches who reads it now.","type":"string","enum":["from","to"]}},"required":["memoryId","scope","status","tableId","recordId","agentId"]},"MemoryVersion":{"type":"object","properties":{"number":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"Its number, from 1."},"text":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}],"description":"Its words; null once the memory is forgotten."},"type":{"description":"Its type then.","$ref":"#/components/schemas/MemoryType"},"validUntil":{"anyOf":[{"$ref":"#/components/schemas/IsoDate"},{"type":"null"}],"description":"The day it stopped being true then; null for a rule."},"createdBy":{"description":"Who wrote it.","$ref":"#/components/schemas/ActorId"},"createdAt":{"description":"When.","$ref":"#/components/schemas/IsoDateTime"}},"required":["number","text","type","validUntil","createdBy","createdAt"]},"MemoryViewer":{"type":"object","properties":{"canDecide":{"type":"boolean","description":"Whether the caller may change it: edit, pin, confirm, reject, archive, restore and forget it. The organization's owner and admins, and the person who decides its scope (a record's or a table's: the table's owner; an agent's: the agent's owner)."},"canChangeSubject":{"type":"boolean","description":"Whether the caller may move this suggestion to another subject (Change a suggestion’s subject): a decider of a suggestion; the new subject must be one they decide too."}},"required":["canDecide","canChangeSubject"]},"MentionCandidate":{"type":"object","properties":{"actorId":{"description":"The member or agent; look the name and avatar up in the directory.","$ref":"#/components/schemas/ActorId"},"kind":{"description":"Whether it is a `member` or an `agent`.","$ref":"#/components/schemas/MentionCandidateKind"},"inThread":{"type":"boolean","description":"Whether they are already in the chat or file: a person who can open it, or an agent added to it."},"addsAccess":{"type":"boolean","description":"Whether mentioning this agent adds it to the chat or file with view access. `false` for an agent that replies without joining."},"allowed":{"type":"boolean","description":"Whether the caller may mention them here."},"notAllowedReason":{"anyOf":[{"$ref":"#/components/schemas/MentionNotAllowedReason"},{"type":"null"}],"description":"Why not: `cannot_share` (an agent outside a private chat or file that the caller may not share), `not_in_private_thread` (a person without access to a private one), `agent_paused` or `agent_archived`; null when allowed."}},"required":["actorId","kind","inThread","addsAccess","allowed","notAllowedReason"]},"MentionCandidateKind":{"type":"string","enum":["member","agent"]},"MentionedRecord":{"type":"object","properties":{"recordId":{"description":"The record.","$ref":"#/components/schemas/RecordId"},"tableId":{"description":"The table that holds it.","$ref":"#/components/schemas/TableId"},"label":{"type":"string","description":"The name people call it by now: its naming column, else its primary column; empty when it has neither."},"tableName":{"type":"string","minLength":1,"maxLength":120,"description":"Its table's name now."}},"required":["recordId","tableId","label","tableName"]},"MentionNotAllowedReason":{"type":"string","enum":["cannot_share","not_in_private_thread","agent_paused","agent_archived"]},"MentionPart":{"type":"object","properties":{"type":{"type":"string","const":"mention","description":"A mention of a member or an agent."},"actorId":{"description":"The member or agent mentioned.","$ref":"#/components/schemas/ActorId"},"label":{"type":"string","minLength":1,"maxLength":120,"description":"Their name when the message was sent; show it only when the directory no longer knows them."}},"required":["type","actorId","label"]},"MentionSkippedNotice":{"type":"object","properties":{"code":{"type":"string","const":"mention_skipped","description":"An agent's mention named an agent that got no turn."},"agentId":{"description":"The agent that was mentioned.","$ref":"#/components/schemas/AgentId"},"reason":{"description":"Why it got no turn.","$ref":"#/components/schemas/MentionSkipReason"}},"required":["code","agentId","reason"]},"MentionSkipReason":{"type":"string","enum":["agents_paused","agent_paused","agent_archived","budget_exceeded","waiting_for_team"]},"Message":{"type":"object","properties":{"id":{"description":"The message's id.","$ref":"#/components/schemas/MessageId"},"thread":{"description":"Where the message was posted: a chat, or a file's comments.","$ref":"#/components/schemas/ThreadRef"},"fileVersionId":{"anyOf":[{"$ref":"#/components/schemas/FileVersionId"},{"type":"null"}],"description":"In a file's comments, the version commented on; null in a chat."},"seq":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"Its place in the thread, counting from 1; sort messages by it, never by id."},"author":{"description":"Who wrote it: a member, an agent or the system, or in a file's comments a guest reviewing through an approval link.","$ref":"#/components/schemas/AuthorRef"},"parts":{"minItems":1,"maxItems":64,"type":"array","items":{"$ref":"#/components/schemas/MessagePart"},"description":"What the message holds, in order: text, mentions, attachments, voice notes, blocks, memory cards (on an agent's reply in a chat, received only by their person and deciders), request cards and a question card, then on an agent's reply in a chat the note only the person who asked receives. A system message holds one part: the notice of a system line, or in a chat Fleepr's own question card."},"mentionedActorIds":{"type":"array","items":{"$ref":"#/components/schemas/ActorId"},"description":"The members and agents its mention parts name."},"triggeredTurnIds":{"type":"array","items":{"$ref":"#/components/schemas/TurnId"},"description":"The agent turns its mentions started, so a client can show which agents are replying."},"turnId":{"anyOf":[{"$ref":"#/components/schemas/TurnId"},{"type":"null"}],"description":"On an agent's reply, the turn that wrote it; null otherwise, and on an agent's card confirmation (one line after a person decided its memory or link card, with no turn and no chain)."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The chain of agent turns it belongs to: the one it started by mentioning agents, or the one an agent reply or a chain notice is part of; null otherwise."},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"On an agent's reply or a system line about its chain, the member the agents act for; on an agent's confirmation of a card (no turn), the member who decided the card; null on a person's own message."},"resolved":{"default":null,"description":"In a file's comments, when and by whom the comment was marked resolved; null while it is open, and always in a chat. An open comment of an earlier version carries into the review of the newer one.","anyOf":[{"$ref":"#/components/schemas/CommentResolution"},{"type":"null"}]},"clientMessageId":{"anyOf":[{"$ref":"#/components/schemas/IdempotencyKey"},{"type":"null"}],"description":"The `Idempotency-Key` it was posted with, to match it with the copy shown while sending; null for agent and system messages."},"createdAt":{"description":"When it was posted.","$ref":"#/components/schemas/IsoDateTime"},"hiddenFromReview":{"description":"On a guest's comment in a file's comments: true once the file's owner or an admin removed it from the review page; the team still sees it. Absent otherwise.","type":"boolean"},"revision":{"description":"Grows by one when the message changes, such as when a choice on its table card or its question card is answered.","$ref":"#/components/schemas/Revision"}},"required":["id","thread","fileVersionId","seq","author","parts","mentionedActorIds","triggeredTurnIds","turnId","chainId","onBehalfOf","resolved","clientMessageId","createdAt","revision"]},"MessageCreatedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"message.created","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"type":"object","properties":{"message":{"description":"The new message.","$ref":"#/components/schemas/Message"},"included":{"description":"What the message references: its files, request cards and turns.","$ref":"#/components/schemas/MessageIncluded"}},"required":["message","included"],"description":"What the event carries; for a change, the object as it is after it."}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"MessageId":{"type":"string","pattern":"^msg_[0-9a-hjkmnp-tv-z]{26}$"},"MessageIncluded":{"type":"object","properties":{"files":{"type":"array","items":{"$ref":"#/components/schemas/FileSummary"},"description":"The files that attachments and galleries show, each with its approval state."},"tableCards":{"type":"array","items":{"$ref":"#/components/schemas/TableCardPreview"},"description":"What each table card shows, one preview per card, matched by `blockId`."},"requests":{"type":"array","items":{"$ref":"#/components/schemas/ActionRequest"},"description":"The request cards that request parts and table card footers name."},"turns":{"type":"array","items":{"$ref":"#/components/schemas/Turn"},"description":"The thread's agent turns still queued, running or waiting, and the turns the messages name."},"annotations":{"type":"array","items":{"$ref":"#/components/schemas/Annotation"},"description":"In a file's comments, the annotations that annotation parts point to."},"unavailable":{"type":"array","items":{"$ref":"#/components/schemas/ObjectRef"},"description":"What the messages name that the caller may not view, or that was deleted: show each as unavailable, never by name."},"records":{"default":[],"description":"The records that record mentions name and the caller may view, with their label and table now. A record mention whose record is not here shows as \"Record not available\".","type":"array","items":{"$ref":"#/components/schemas/MentionedRecord"}}},"required":["files","tableCards","requests","turns","annotations","unavailable","records"]},"MessagePage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Message"},"description":"The messages, oldest first."},"included":{"description":"What the messages reference: files, table cards, request cards, turns and annotations.","$ref":"#/components/schemas/MessageIncluded"},"olderCursor":{"anyOf":[{"$ref":"#/components/schemas/Cursor"},{"type":"null"}],"description":"Send it as `before` to read older messages; null when there are none."},"newerCursor":{"anyOf":[{"$ref":"#/components/schemas/Cursor"},{"type":"null"}],"description":"Send it as `after` to read newer messages; null when this page holds the newest."},"streamCursor":{"anyOf":[{"$ref":"#/components/schemas/EventId"},{"type":"null"}],"description":"Send it as `Last-Event-ID` when you open the thread's stream, so nothing between this page and the stream is missed; null while the organization has no events yet."},"lastReadAt":{"description":"Only when you open a chat in the app (no `before` or `after`): when the newest message you had seen was posted before this read, for the \"New\" line; null when you never read the chat. Absent otherwise.","anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]}},"required":["items","included","olderCursor","newerCursor","streamCursor"]},"MessagePart":{"oneOf":[{"$ref":"#/components/schemas/TextPart"},{"$ref":"#/components/schemas/MentionPart"},{"$ref":"#/components/schemas/AttachmentPart"},{"$ref":"#/components/schemas/VoicePart"},{"$ref":"#/components/schemas/BlockPart"},{"$ref":"#/components/schemas/RequestPart"},{"$ref":"#/components/schemas/QuestionPart"},{"$ref":"#/components/schemas/AnnotationPart"},{"$ref":"#/components/schemas/QuotePart"},{"$ref":"#/components/schemas/NoticePart"},{"$ref":"#/components/schemas/MemorySuggestionPart"},{"$ref":"#/components/schemas/RecordMentionPart"}]},"MessagePartInput":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"text","description":"A run of text."},"text":{"type":"string","minLength":1,"maxLength":20000,"description":"The words, in a Markdown subset (emphasis, strikethrough, code, links, headings, blockquotes, thematic breaks, lists and tables), up to 20,000 characters. A mention is a `mention` part of its own, never text."}},"required":["type","text"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"mention","description":"A mention of a member or an agent."},"actorId":{"description":"Who to mention: a member, who is notified, or an agent, which gets a turn to reply. The server adds the name.","$ref":"#/components/schemas/ActorId"}},"required":["type","actorId"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"attachment","description":"A file from the media library."},"fileId":{"description":"A media library file you may view; the message keeps the version that is current now.","$ref":"#/components/schemas/FileId"}},"required":["type","fileId"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"voice","description":"A voice note, kept as its transcript."},"uploadId":{"description":"A completed `voice_note` upload of yours, up to 10 minutes; the message keeps its transcript. While it is still being transcribed, the post answers `422 upload_not_ready`: send it again a few seconds later.","$ref":"#/components/schemas/UploadId"}},"required":["type","uploadId"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"record_mention","description":"A mention of a record in one of your tables; in a chat, by a member only."},"recordId":{"description":"A record of a table you may view, in a chat only. It notifies nobody and starts no turn; a record you may not view, or that does not exist, answers `404 not_found`.","$ref":"#/components/schemas/RecordId"}},"required":["type","recordId"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"annotation","description":"A pointer to a note on the file, such as a mark at 0:04 of a video; in a file's comments only."},"annotationId":{"description":"An annotation on the file to point to.","$ref":"#/components/schemas/AnnotationId"}},"required":["type","annotationId"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"quote","description":"The words of a doc the comment is about, which the doc shows highlighted; in a doc's comments only."},"anchor":{"description":"The words of the version commented on that the comment is about; they must be in that version.","$ref":"#/components/schemas/TextAnchor"}},"required":["type","anchor"],"additionalProperties":false}]},"MessagePartsInput":{"minItems":1,"maxItems":64,"type":"array","items":{"$ref":"#/components/schemas/MessagePartInput"}},"MessagePostPreview":{"type":"object","properties":{"kind":{"type":"string","const":"message_post","description":"Post a message in a chat."},"chatId":{"description":"The chat to post in.","$ref":"#/components/schemas/ChatId"},"chatName":{"type":"string","description":"The chat's name."},"text":{"type":"string","description":"The message to post, in Markdown."},"files":{"default":[],"description":"The files the message attaches after its text, in order.","maxItems":10,"type":"array","items":{"$ref":"#/components/schemas/MessagePostPreviewFile"}}},"required":["kind","chatId","chatName","text","files"]},"MessagePostPreviewFile":{"type":"object","properties":{"fileId":{"description":"The file attached.","$ref":"#/components/schemas/FileId"},"fileName":{"type":"string","description":"The file's name."},"mimeType":{"type":"string","description":"The file's type, as a MIME type."}},"required":["fileId","fileName","mimeType"]},"MessageSearchHit":{"type":"object","properties":{"chat":{"type":"object","properties":{"id":{"description":"The chat's id.","$ref":"#/components/schemas/ChatId"},"name":{"type":"string","description":"The chat's name."}},"required":["id","name"],"description":"The chat the message is in."},"message":{"description":"The message that holds every word of the query.","$ref":"#/components/schemas/Message"}},"required":["chat","message"]},"MessageUpdatedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"message.updated","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"type":"object","properties":{"message":{"description":"The whole message after the change.","$ref":"#/components/schemas/Message"}},"required":["message"],"description":"What the event carries; for a change, the object as it is after it."}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"Micros":{"type":"integer","minimum":0,"maximum":9007199254740991},"ModelAlias":{"type":"string","minLength":1,"maxLength":64},"ModelAllowlist":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":64}},"ModelCapabilities":{"type":"object","properties":{"tools":{"type":"boolean","description":"Whether the model can call tools."},"vision":{"type":"boolean","description":"Whether the model reads images."},"reasoning":{"type":"boolean","description":"Whether the model reasons step by step before it answers."}},"required":["tools","vision","reasoning"]},"ModelOption":{"type":"object","properties":{"alias":{"description":"The alias to send as an agent's `modelAlias`.","$ref":"#/components/schemas/ModelAlias"},"label":{"type":"string","description":"The model's name, ready to show."},"description":{"type":"string","description":"What the model is good for, ready to show."},"contextTokens":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"How many tokens the model reads at once."},"capabilities":{"description":"What the model can do.","$ref":"#/components/schemas/ModelCapabilities"},"status":{"description":"`available`, or `deprecated`: agents already on it keep working, and no other agent may choose it.","$ref":"#/components/schemas/ModelStatus"},"isDefault":{"type":"boolean","description":"Whether a new agent that names no model gets this one, when the organization allows it."},"allowed":{"default":true,"description":"Whether the organization asked about lets its agents use the model; true for every model when none is.","type":"boolean"}},"required":["alias","label","description","contextTokens","capabilities","status","isDefault","allowed"]},"ModelStatus":{"type":"string","enum":["available","deprecated"]},"MultiSelectColumn":{"type":"object","properties":{"id":{"description":"The column's id: the key of its cell in each record's `values`.","$ref":"#/components/schemas/ColumnId"},"tableId":{"description":"The table the column belongs to.","$ref":"#/components/schemas/TableId"},"name":{"type":"string","minLength":1,"maxLength":80,"description":"The column's name, shown in its header."},"position":{"description":"The column's place in the table: columns sort by this key, compared as text.","$ref":"#/components/schemas/FractionalIndex"},"readOnly":{"type":"boolean","description":"Whether only the server writes the column's cells; a record write that sets one answers `400 validation_failed`."},"revision":{"description":"Grows by one with every change to the column; send it as `expectedRevision` to change the column.","$ref":"#/components/schemas/Revision"},"type":{"type":"string","const":"multi_select","description":"The column's type, which decides what its cells hold."},"options":{"maxItems":100,"type":"array","items":{"$ref":"#/components/schemas/SelectOption"},"description":"The options a cell picks from, in the order the menu lists them; up to 100."}},"required":["id","tableId","name","position","readOnly","revision","type","options"]},"MyAccess":{"type":"object","properties":{"level":{"anyOf":[{"$ref":"#/components/schemas/AccessLevel"},{"type":"null"}],"description":"The caller's level on the object, `view`, `edit` or `manage`, after their role's limits; null without access."},"actions":{"type":"array","items":{"$ref":"#/components/schemas/ObjectAction"},"description":"What the caller may do with the object: show the controls these actions allow, and only those."}},"required":["level","actions"]},"NamingColumnType":{"type":"string","enum":["text","email","url"]},"NewPassword":{"type":"string","format":"password","description":"8 to 72 bytes of UTF-8, with at least one lowercase letter (a-z), one uppercase letter (A-Z), one digit (0-9) and one symbol (ASCII punctuation: !\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~)."},"NoLimitOverride":{"type":"object","properties":{"value":{"anyOf":[{"$ref":"#/components/schemas/Micros"},{"type":"null"}],"description":"The budget, in millionths of a US dollar; null switches the budget off."}},"required":["value"]},"NoLimitOverrideInput":{"type":"object","properties":{"value":{"anyOf":[{"$ref":"#/components/schemas/Micros"},{"type":"null"}],"description":"The budget, in millionths of a US dollar; null switches the budget off."}},"required":["value"],"additionalProperties":false},"Notice":{"oneOf":[{"$ref":"#/components/schemas/AgentAddedNotice"},{"$ref":"#/components/schemas/MentionSkippedNotice"},{"$ref":"#/components/schemas/ChainStoppedNotice"},{"$ref":"#/components/schemas/TurnFailedNotice"},{"$ref":"#/components/schemas/AgentsPausedNotice"},{"$ref":"#/components/schemas/AgentsResumedNotice"},{"$ref":"#/components/schemas/ApprovalDecidedNotice"},{"$ref":"#/components/schemas/ApprovalDecisionUndoneNotice"},{"$ref":"#/components/schemas/ApproversAddedNotice"},{"$ref":"#/components/schemas/FileVersionAddedNotice"},{"$ref":"#/components/schemas/EditAccessNeededNotice"},{"$ref":"#/components/schemas/RestrictedObjectsUsedNotice"},{"$ref":"#/components/schemas/EmailUndeliveredNotice"}]},"NoticePart":{"type":"object","properties":{"type":{"type":"string","const":"notice","description":"A system line, such as \"Agents paused\"; or, last on an agent's reply, a note only the person who asked receives."},"notice":{"description":"What happened, as a `code` and its details; the client puts it in words.","$ref":"#/components/schemas/Notice"}},"required":["type","notice"]},"NotificationCreatedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"notification.created","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"type":"object","properties":{"notification":{"description":"The new notification.","$ref":"#/components/schemas/UserNotification"}},"required":["notification"],"description":"What the event carries; for a change, the object as it is after it."}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"NotificationId":{"type":"string","pattern":"^ntf_[0-9a-hjkmnp-tv-z]{26}$"},"NotificationKind":{"type":"string","enum":["mention","approval","agent","flow","invite","access_request","owner_deactivated","webhook","delay","change","credential","health","form"]},"NotificationLink":{"type":"object","properties":{"target":{"description":"The type and id of the item linked to.","$ref":"#/components/schemas/ObjectRef"},"name":{"type":"string","description":"The item's name when the notification was made."},"route":{"description":"The in-app path that opens the item.","$ref":"#/components/schemas/AppRoute"}},"required":["target","name","route"]},"NotificationPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/UserNotification"},"description":"This page of the list."},"nextCursor":{"anyOf":[{"$ref":"#/components/schemas/Cursor"},{"type":"null"}],"description":"Send it back as `cursor` to read the next page; null on the last page."},"unreadCount":{"description":"Every unread notification of the caller in the organization, whatever the query's filters.","$ref":"#/components/schemas/UnreadCount"},"badgeCount":{"description":"The bell's badge: the unread count without notifications about something waiting for a decision. Read `badgeCount`, or `unreadCount` when it is missing.","$ref":"#/components/schemas/BadgeCount"}},"required":["items","nextCursor","unreadCount"]},"NotificationReadEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"notification.read","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"type":"object","properties":{"ids":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/NotificationId"}},{"type":"string","const":"all"}],"description":"The notifications now read, or `all` when every one was marked read."},"unreadCount":{"description":"The recipient's new unread count.","$ref":"#/components/schemas/UnreadCount"},"badgeCount":{"description":"The bell's new badge; read `unreadCount` when it is missing.","$ref":"#/components/schemas/BadgeCount"}},"required":["ids","unreadCount"],"description":"What the event carries; for a change, the object as it is after it."}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"NotificationReason":{"type":"string","enum":["mentioned","approval_requested","approval_decided","request_pending","request_resolved","flow_failed","flow_signoff","invited","access_granted","budget_warning","access_requested","access_request_decided","owner_deactivated","owner_made_viewer","owner_transferred","flow_handed_over","email_undelivered","webhook_disabled","webhook_paused","api_key_deciding_paused","flow_date_not_moved","flow_record_reruns","activity_delayed","item_changed","credential_warning","question_waiting","health_issue","health_fix_waiting","access_restored","form_response","form_upload_cap","connection_reconnect","form_response_cap","review_comment"]},"NumberColumn":{"type":"object","properties":{"id":{"description":"The column's id: the key of its cell in each record's `values`.","$ref":"#/components/schemas/ColumnId"},"tableId":{"description":"The table the column belongs to.","$ref":"#/components/schemas/TableId"},"name":{"type":"string","minLength":1,"maxLength":80,"description":"The column's name, shown in its header."},"position":{"description":"The column's place in the table: columns sort by this key, compared as text.","$ref":"#/components/schemas/FractionalIndex"},"readOnly":{"type":"boolean","description":"Whether only the server writes the column's cells; a record write that sets one answers `400 validation_failed`."},"revision":{"description":"Grows by one with every change to the column; send it as `expectedRevision` to change the column.","$ref":"#/components/schemas/Revision"},"type":{"type":"string","const":"number","description":"The column's type, which decides what its cells hold."},"decimals":{"type":"integer","minimum":0,"maximum":6,"description":"How many decimal places the cells show, 0 to 6."},"format":{"description":"How the cells show their number: `plain` (12,000), `currency` (€12,000) or `percent` (12%).","$ref":"#/components/schemas/NumberFormat"},"currency":{"anyOf":[{"$ref":"#/components/schemas/CurrencyCode"},{"type":"null"}],"description":"The ISO 4217 code of the currency the cells show when `format` is `currency`, such as `EUR`."}},"required":["id","tableId","name","position","readOnly","revision","type","decimals","format","currency"]},"NumberFormat":{"type":"string","enum":["plain","currency","percent"]},"ObjectAbout":{"type":"object","properties":{"object":{"description":"The object these records are about.","$ref":"#/components/schemas/AboutObjectRef"},"records":{"maxItems":20,"type":"array","items":{"$ref":"#/components/schemas/AboutRecord"},"description":"The records the object is about that the caller may see, oldest link first. Records of a table the caller cannot view are left out."},"viewer":{"description":"What the caller may do with these links.","$ref":"#/components/schemas/AboutViewer"}},"required":["object","records","viewer"]},"ObjectAccess":{"type":"object","properties":{"object":{"description":"The object this access belongs to.","$ref":"#/components/schemas/AccessObjectRef"},"parent":{"anyOf":[{"$ref":"#/components/schemas/AccessObjectRef"},{"type":"null"}],"description":"The object this one sits in, such as a table in a database; null for now, as nothing sits in another."},"visibility":{"description":"`organization`: every member can view the object; `private`: only its owner, those it is shared with, and the organization's owner and admins. Always `organization` on a skill.","$ref":"#/components/schemas/Visibility"},"organizationLevel":{"anyOf":[{"$ref":"#/components/schemas/AccessLevel"},{"type":"null"}],"description":"The level every member gets when the object is visible to the organization, `view`; null when private."},"ownerId":{"description":"The member who owns the object; it changes only when the object is handed over.","$ref":"#/components/schemas/MemberId"},"members":{"type":"array","items":{"$ref":"#/components/schemas/ObjectMember"},"description":"Who has access and how: one grant per active or invited person and agent, the highest when they hold several."},"revision":{"description":"Grows with every change to the object's access; send it as `expectedRevision` to change the visibility or hand the object over.","$ref":"#/components/schemas/Revision"},"myAccess":{"description":"What the caller may do with the object, such as `share` to change who has access.","$ref":"#/components/schemas/MyAccess"}},"required":["object","parent","visibility","organizationLevel","ownerId","members","revision","myAccess"]},"ObjectAction":{"type":"string","enum":["view","edit","edit_columns","share","change_visibility","delete","export","pause_agents","transfer_ownership","respond"]},"ObjectDeletePreview":{"type":"object","properties":{"kind":{"type":"string","const":"object_delete","description":"Delete an object, such as a table, a file or a chat."},"object":{"description":"The object to delete.","$ref":"#/components/schemas/AccessObjectRef"},"name":{"type":"string","description":"The object's name."},"detail":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"description":"What goes with it, such as \"128 records\", or null."}},"required":["kind","object","name","detail"]},"ObjectEntry":{"type":"object","properties":{"id":{"description":"The object's own id, such as a chat's or a table's.","$ref":"#/components/schemas/AccessObjectId"},"type":{"description":"What kind of object it is, such as `chat`, `table` or `file`.","$ref":"#/components/schemas/ObjectType"},"organizationId":{"description":"The organization the object belongs to.","$ref":"#/components/schemas/OrganizationId"},"ownerId":{"description":"The member who owns the object; it changes only through a hand-over.","$ref":"#/components/schemas/MemberId"},"parent":{"anyOf":[{"$ref":"#/components/schemas/AccessObjectRef"},{"type":"null"}],"description":"The object this one belongs to, or null. Only a table may belong to another object, and none does yet."},"visibility":{"description":"`organization`: every member of the organization can view it; `private`: only the people and agents given access, and the organization's owner and admins.","$ref":"#/components/schemas/Visibility"},"name":{"type":"string","description":"The object's name, as its own page shows it."},"createdAt":{"description":"When the object was created.","$ref":"#/components/schemas/IsoDateTime"},"updatedAt":{"description":"When the object last changed.","$ref":"#/components/schemas/IsoDateTime"}},"required":["id","type","organizationId","ownerId","parent","visibility","name","createdAt","updatedAt"]},"ObjectEntryDetail":{"type":"object","properties":{"id":{"description":"The object's own id, such as a chat's or a table's.","$ref":"#/components/schemas/AccessObjectId"},"type":{"description":"What kind of object it is, such as `chat`, `table` or `file`.","$ref":"#/components/schemas/ObjectType"},"organizationId":{"description":"The organization the object belongs to.","$ref":"#/components/schemas/OrganizationId"},"ownerId":{"description":"The member who owns the object; it changes only through a hand-over.","$ref":"#/components/schemas/MemberId"},"parent":{"anyOf":[{"$ref":"#/components/schemas/AccessObjectRef"},{"type":"null"}],"description":"The object this one belongs to, or null. Only a table may belong to another object, and none does yet."},"visibility":{"description":"`organization`: every member of the organization can view it; `private`: only the people and agents given access, and the organization's owner and admins.","$ref":"#/components/schemas/Visibility"},"name":{"type":"string","description":"The object's name, as its own page shows it."},"createdAt":{"description":"When the object was created.","$ref":"#/components/schemas/IsoDateTime"},"updatedAt":{"description":"When the object last changed.","$ref":"#/components/schemas/IsoDateTime"},"myAccess":{"description":"What the caller may do with the object: their access level, never null here, and their actions.","$ref":"#/components/schemas/MyAccess"}},"required":["id","type","organizationId","ownerId","parent","visibility","name","createdAt","updatedAt","myAccess"]},"ObjectEntryPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/ObjectEntryDetail"},"description":"This page of the list."},"nextCursor":{"anyOf":[{"$ref":"#/components/schemas/Cursor"},{"type":"null"}],"description":"Send it back as `cursor` to read the next page; null on the last page."}},"required":["items","nextCursor"]},"ObjectMember":{"type":"object","properties":{"actorId":{"description":"The person (active, invited, or removed for a `removed` grant) or the agent who holds the grant.","$ref":"#/components/schemas/ActorId"},"level":{"description":"The level the grant gives: `view`, `edit` or `manage`.","$ref":"#/components/schemas/AccessLevel"},"source":{"description":"Where the grant comes from: `direct`, shared on this object; `organization`, the object is visible to the organization; `role`, the organization owner or an admin. `parent` is not used yet.","$ref":"#/components/schemas/AccessSource"},"via":{"anyOf":[{"$ref":"#/components/schemas/AccessObjectRef"},{"type":"null"}],"description":"The object the grant is inherited from; null when it comes from this object itself or a role."},"inviteEmail":{"anyOf":[{"$ref":"#/components/schemas/Email"},{"type":"null"}],"description":"The address the invite went to, for an invited person; null for active members and agents."},"removed":{"type":"boolean","description":"Whether the grant is held by a removed member: it gives nothing while they are removed, and comes back if they are restored. It can be removed or lowered here, never raised."},"fixed":{"type":"boolean","description":"Whether the grant cannot be removed here: the owner's, and any grant that does not come from this object."},"addedBy":{"description":"Who made the grant.","$ref":"#/components/schemas/ActorId"},"addedAt":{"description":"When the grant was made.","$ref":"#/components/schemas/IsoDateTime"}},"required":["actorId","level","source","via","inviteEmail","removed","fixed","addedBy","addedAt"]},"ObjectRef":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"organization","description":"What kind of object it is."},"id":{"description":"The object's id.","$ref":"#/components/schemas/OrganizationId"}},"required":["type","id"]},{"type":"object","properties":{"type":{"type":"string","const":"member","description":"What kind of object it is."},"id":{"description":"The object's id.","$ref":"#/components/schemas/MemberId"}},"required":["type","id"]},{"type":"object","properties":{"type":{"type":"string","const":"agent","description":"What kind of object it is."},"id":{"description":"The object's id.","$ref":"#/components/schemas/AgentId"}},"required":["type","id"]},{"type":"object","properties":{"type":{"type":"string","const":"team","description":"What kind of object it is."},"id":{"description":"The object's id.","$ref":"#/components/schemas/TeamId"}},"required":["type","id"]},{"type":"object","properties":{"type":{"type":"string","const":"invite","description":"What kind of object it is."},"id":{"description":"The object's id.","$ref":"#/components/schemas/InviteId"}},"required":["type","id"]},{"type":"object","properties":{"type":{"type":"string","const":"access_request","description":"What kind of object it is."},"id":{"description":"The object's id.","$ref":"#/components/schemas/AccessRequestId"}},"required":["type","id"]},{"type":"object","properties":{"type":{"type":"string","const":"notification","description":"What kind of object it is."},"id":{"description":"The object's id.","$ref":"#/components/schemas/NotificationId"}},"required":["type","id"]},{"type":"object","properties":{"type":{"type":"string","const":"chat","description":"What kind of object it is."},"id":{"description":"The object's id.","$ref":"#/components/schemas/ChatId"}},"required":["type","id"]},{"type":"object","properties":{"type":{"type":"string","const":"message","description":"What kind of object it is."},"id":{"description":"The object's id.","$ref":"#/components/schemas/MessageId"}},"required":["type","id"]},{"type":"object","properties":{"type":{"type":"string","const":"database","description":"What kind of object it is."},"id":{"description":"The object's id.","$ref":"#/components/schemas/DatabaseId"}},"required":["type","id"]},{"type":"object","properties":{"type":{"type":"string","const":"table","description":"What kind of object it is."},"id":{"description":"The object's id.","$ref":"#/components/schemas/TableId"}},"required":["type","id"]},{"type":"object","properties":{"type":{"type":"string","const":"column","description":"What kind of object it is."},"id":{"description":"The object's id.","$ref":"#/components/schemas/ColumnId"}},"required":["type","id"]},{"type":"object","properties":{"type":{"type":"string","const":"record","description":"What kind of object it is."},"id":{"description":"The object's id.","$ref":"#/components/schemas/RecordId"}},"required":["type","id"]},{"type":"object","properties":{"type":{"type":"string","const":"view","description":"What kind of object it is."},"id":{"description":"The object's id.","$ref":"#/components/schemas/ViewId"}},"required":["type","id"]},{"type":"object","properties":{"type":{"type":"string","const":"form_link","description":"What kind of object it is."},"id":{"description":"The object's id.","$ref":"#/components/schemas/FormLinkId"}},"required":["type","id"]},{"type":"object","properties":{"type":{"type":"string","const":"file","description":"What kind of object it is."},"id":{"description":"The object's id.","$ref":"#/components/schemas/FileId"}},"required":["type","id"]},{"type":"object","properties":{"type":{"type":"string","const":"file_version","description":"What kind of object it is."},"id":{"description":"The object's id.","$ref":"#/components/schemas/FileVersionId"}},"required":["type","id"]},{"type":"object","properties":{"type":{"type":"string","const":"annotation","description":"What kind of object it is."},"id":{"description":"The object's id.","$ref":"#/components/schemas/AnnotationId"}},"required":["type","id"]},{"type":"object","properties":{"type":{"type":"string","const":"approval","description":"What kind of object it is."},"id":{"description":"The object's id.","$ref":"#/components/schemas/ApprovalId"}},"required":["type","id"]},{"type":"object","properties":{"type":{"type":"string","const":"approval_link","description":"What kind of object it is."},"id":{"description":"The object's id.","$ref":"#/components/schemas/ApprovalLinkId"}},"required":["type","id"]},{"type":"object","properties":{"type":{"type":"string","const":"skill","description":"What kind of object it is."},"id":{"description":"The object's id.","$ref":"#/components/schemas/SkillId"}},"required":["type","id"]},{"type":"object","properties":{"type":{"type":"string","const":"connection","description":"What kind of object it is."},"id":{"description":"The object's id.","$ref":"#/components/schemas/ConnectionId"}},"required":["type","id"]},{"type":"object","properties":{"type":{"type":"string","const":"flow","description":"What kind of object it is."},"id":{"description":"The object's id.","$ref":"#/components/schemas/FlowId"}},"required":["type","id"]},{"type":"object","properties":{"type":{"type":"string","const":"flow_run","description":"What kind of object it is."},"id":{"description":"The object's id.","$ref":"#/components/schemas/FlowRunId"}},"required":["type","id"]},{"type":"object","properties":{"type":{"type":"string","const":"request","description":"What kind of object it is."},"id":{"description":"The object's id.","$ref":"#/components/schemas/ActionRequestId"}},"required":["type","id"]},{"type":"object","properties":{"type":{"type":"string","const":"turn","description":"What kind of object it is."},"id":{"description":"The object's id.","$ref":"#/components/schemas/TurnId"}},"required":["type","id"]},{"type":"object","properties":{"type":{"type":"string","const":"api_key","description":"What kind of object it is."},"id":{"description":"The object's id.","$ref":"#/components/schemas/ApiKeyId"}},"required":["type","id"]},{"type":"object","properties":{"type":{"type":"string","const":"webhook","description":"What kind of object it is."},"id":{"description":"The object's id.","$ref":"#/components/schemas/WebhookId"}},"required":["type","id"]},{"type":"object","properties":{"type":{"type":"string","const":"health_issue","description":"What kind of object it is."},"id":{"description":"The object's id.","$ref":"#/components/schemas/HealthIssueId"}},"required":["type","id"]},{"type":"object","properties":{"type":{"type":"string","const":"health_target","description":"What kind of object it is."},"id":{"description":"The object's id.","$ref":"#/components/schemas/HealthTargetId"}},"required":["type","id"]}]},"ObjectType":{"type":"string","enum":["chat","database","table","file","flow","agent","skill","connection"]},"OnIncompatible":{"type":"string","enum":["reject","clear"]},"OpenComments":{"type":"object","properties":{"count":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"How many comments of earlier rounds are still open."},"by":{"description":"Who wrote the newest of them: a member, an agent or a guest.","$ref":"#/components/schemas/AuthorRef"},"at":{"description":"When the newest of them was written.","$ref":"#/components/schemas/IsoDateTime"},"excerpt":{"anyOf":[{"type":"string","minLength":1,"maxLength":280},{"type":"null"}],"description":"The start of the newest one as plain text, up to 280 characters; null when it has no words."}},"required":["count","by","at","excerpt"]},"OpenFormBody":{"type":"object","properties":{"token":{"description":"A form link's secret: the part of its address after the `#`, as the page read it.","$ref":"#/components/schemas/FormLinkToken"},"viewId":{"description":"A form's id, for a member who responds inside Fleepr: needs their session cookie and view on the table.","$ref":"#/components/schemas/ViewId"},"address":{"type":"object","propertyNames":{"type":"string","maxLength":80},"additionalProperties":{"type":"string","maxLength":2000},"description":"The values the page's address prefills (`?Platform=TikTok`), by question name or column id."}},"additionalProperties":false},"OpenFormResult":{"type":"object","properties":{"form":{"description":"The form as the page shows it.","$ref":"#/components/schemas/PublicForm"},"session":{"description":"The page's session for this response: keep it for this tab and send it with every request.","$ref":"#/components/schemas/FormSession"},"expiresAt":{"description":"When the session stops working: the page opens the form again.","$ref":"#/components/schemas/IsoDateTime"}},"required":["form","session","expiresAt"]},"OpenReviewSessionBody":{"type":"object","properties":{"token":{"description":"The secret of the approval link: the part of its address after the `#`, as the page read it.","$ref":"#/components/schemas/ReviewToken"}},"required":["token"],"additionalProperties":false},"Organization":{"type":"object","properties":{"id":{"description":"The organization's id, which every path under `/v0/orgs/{orgId}` takes.","$ref":"#/components/schemas/OrganizationId"},"name":{"type":"string","minLength":1,"maxLength":80,"description":"The organization's name, 1 to 80 characters."},"about":{"type":"string","maxLength":500,"description":"A short text about the organization, up to 500 characters; empty when none is set."},"timeZone":{"description":"The IANA time zone, such as `Europe/Madrid`, used for schedules, digests and times of day.","$ref":"#/components/schemas/TimeZone"},"ownerId":{"description":"The one owner, always an active member; ownership moves only by transferring it.","$ref":"#/components/schemas/MemberId"},"plan":{"description":"The organization's plan, which sets the defaults of its settings.","$ref":"#/components/schemas/OrganizationPlan"},"settings":{"description":"The values the organization set itself; a null value follows the plan's default.","$ref":"#/components/schemas/OrganizationSettingsOverrides"},"effectiveSettings":{"description":"The settings in effect: the plan's defaults, overridden by each value set in `settings`.","$ref":"#/components/schemas/OrganizationSettings"},"logRetentionGraceEndsAt":{"default":null,"description":"When a shortened log retention starts deleting older entries, 7 days after the change; null when no shorter retention is waiting.","anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"agentsPaused":{"default":false,"description":"Whether every agent and flow of the organization is paused: no agent takes a turn and no flow runs.","type":"boolean"},"agentsPausedBy":{"default":null,"description":"The member who paused every agent; null while agents are not paused.","anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}]},"agentsPausedAt":{"default":null,"description":"When every agent was paused; null while agents are not paused.","anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"squareLogoUrl":{"default":null,"description":"A public link to the organization's square logo, shown where a small mark fits; null when there is none, and the app shows initials instead. It changes when the logo changes.","anyOf":[{"$ref":"#/components/schemas/Url"},{"type":"null"}]},"horizontalLogoUrl":{"default":null,"description":"A public link to the organization's horizontal logo, shown in the header of its emails; null when there is none. It changes when the logo changes.","anyOf":[{"$ref":"#/components/schemas/Url"},{"type":"null"}]},"createdAt":{"description":"When the organization was created.","$ref":"#/components/schemas/IsoDateTime"},"updatedAt":{"description":"When the organization was last changed.","$ref":"#/components/schemas/IsoDateTime"},"revision":{"description":"Grows by one on every change to the organization; send it back as `expectedRevision` when you update it.","$ref":"#/components/schemas/Revision"}},"required":["id","name","about","timeZone","ownerId","plan","settings","effectiveSettings","logRetentionGraceEndsAt","agentsPaused","agentsPausedBy","agentsPausedAt","squareLogoUrl","horizontalLogoUrl","createdAt","updatedAt","revision"]},"OrganizationAction":{"type":"string","enum":["edit_organization","transfer_ownership","invite_member","manage_members","create_chat","create_table","create_agent","create_skill","create_team","create_flow","manage_connections","view_logs","manage_ai_limits","view_usage","request_access","upload_file","create_doc","create_api_key","manage_api_keys","manage_webhooks","manage_health","add_memory","create_target"]},"OrganizationAgentsPausedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"organization.agents_paused","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"description":"What the event carries; for a change, the object as it is after it.","$ref":"#/components/schemas/OrganizationEventPayload"}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"OrganizationAgentsResumedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"organization.agents_resumed","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"description":"What the event carries; for a change, the object as it is after it.","$ref":"#/components/schemas/OrganizationEventPayload"}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"OrganizationDetail":{"type":"object","properties":{"id":{"description":"The organization's id, which every path under `/v0/orgs/{orgId}` takes.","$ref":"#/components/schemas/OrganizationId"},"name":{"type":"string","minLength":1,"maxLength":80,"description":"The organization's name, 1 to 80 characters."},"about":{"type":"string","maxLength":500,"description":"A short text about the organization, up to 500 characters; empty when none is set."},"timeZone":{"description":"The IANA time zone, such as `Europe/Madrid`, used for schedules, digests and times of day.","$ref":"#/components/schemas/TimeZone"},"ownerId":{"description":"The one owner, always an active member; ownership moves only by transferring it.","$ref":"#/components/schemas/MemberId"},"plan":{"description":"The organization's plan, which sets the defaults of its settings.","$ref":"#/components/schemas/OrganizationPlan"},"settings":{"description":"The values the organization set itself; a null value follows the plan's default.","$ref":"#/components/schemas/OrganizationSettingsOverrides"},"effectiveSettings":{"description":"The settings in effect: the plan's defaults, overridden by each value set in `settings`.","$ref":"#/components/schemas/OrganizationSettings"},"logRetentionGraceEndsAt":{"default":null,"description":"When a shortened log retention starts deleting older entries, 7 days after the change; null when no shorter retention is waiting.","anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"agentsPaused":{"default":false,"description":"Whether every agent and flow of the organization is paused: no agent takes a turn and no flow runs.","type":"boolean"},"agentsPausedBy":{"default":null,"description":"The member who paused every agent; null while agents are not paused.","anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}]},"agentsPausedAt":{"default":null,"description":"When every agent was paused; null while agents are not paused.","anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"squareLogoUrl":{"default":null,"description":"A public link to the organization's square logo, shown where a small mark fits; null when there is none, and the app shows initials instead. It changes when the logo changes.","anyOf":[{"$ref":"#/components/schemas/Url"},{"type":"null"}]},"horizontalLogoUrl":{"default":null,"description":"A public link to the organization's horizontal logo, shown in the header of its emails; null when there is none. It changes when the logo changes.","anyOf":[{"$ref":"#/components/schemas/Url"},{"type":"null"}]},"createdAt":{"description":"When the organization was created.","$ref":"#/components/schemas/IsoDateTime"},"updatedAt":{"description":"When the organization was last changed.","$ref":"#/components/schemas/IsoDateTime"},"revision":{"description":"Grows by one on every change to the organization; send it back as `expectedRevision` when you update it.","$ref":"#/components/schemas/Revision"},"stats":{"description":"Counts of members, agents and teams, and of the chats and files the caller can see.","$ref":"#/components/schemas/OrganizationStats"},"myRole":{"description":"The caller's role in the organization.","$ref":"#/components/schemas/OrgRole"},"myMemberId":{"description":"The caller's own member id in this organization.","$ref":"#/components/schemas/MemberId"},"myActions":{"type":"array","items":{"$ref":"#/components/schemas/OrganizationAction"},"description":"The organization-level actions the caller may take, such as `invite_member` or `create_flow`; use them to decide which controls to show."}},"required":["id","name","about","timeZone","ownerId","plan","settings","effectiveSettings","logRetentionGraceEndsAt","agentsPaused","agentsPausedBy","agentsPausedAt","squareLogoUrl","horizontalLogoUrl","createdAt","updatedAt","revision","stats","myRole","myMemberId","myActions"]},"OrganizationEventPayload":{"type":"object","properties":{"organization":{"description":"The organization after the change.","$ref":"#/components/schemas/Organization"}},"required":["organization"]},"OrganizationId":{"type":"string","pattern":"^org_[0-9a-hjkmnp-tv-z]{26}$"},"OrganizationPlan":{"type":"object","properties":{"id":{"description":"The plan's id; `pilot` is the only plan today.","$ref":"#/components/schemas/PlanId"}},"required":["id"]},"OrganizationSettings":{"type":"object","properties":{"logRetentionDays":{"description":"How many days log entries are kept, 1 to 3650; the log reads no further back.","$ref":"#/components/schemas/LogRetentionDays"},"outsideAgentsMayDecide":{"default":true,"description":"Whether API keys may take the decisions their members allowed them; `false` stops every key's deciding at once.","$ref":"#/components/schemas/OutsideAgentsMayDecide"},"shareHealthMetrics":{"default":true,"description":"Whether Fleepr may read the counts and rates of Health, never content, together with those of other organizations, to improve its checks and templates.","$ref":"#/components/schemas/ShareHealthMetrics"},"memorySuggestionMessages":{"default":2,"description":"How many different messages people wrote an agent needs before it suggests a memory, 1 to 5. Whatever the number, one is enough to add to a suggestion already waiting that says the same.","$ref":"#/components/schemas/MemorySuggestionMessages"},"publicFileLinks":{"default":true,"description":"Whether members and agents may make public links to files, which any server downloads with no sign-in; `false` stops every public link at once.","$ref":"#/components/schemas/PublicFileLinks"}},"required":["logRetentionDays","outsideAgentsMayDecide","shareHealthMetrics","memorySuggestionMessages","publicFileLinks"]},"OrganizationSettingsInput":{"type":"object","properties":{"logRetentionDays":{"description":"How many days to keep log entries, 1 to 3650; null returns to the plan's default. A shorter retention waits 7 days before it deletes anything.","anyOf":[{"$ref":"#/components/schemas/LogRetentionDays"},{"type":"null"}]},"outsideAgentsMayDecide":{"description":"Whether API keys may take the decisions their members allowed them; null returns to the plan's default.","anyOf":[{"$ref":"#/components/schemas/OutsideAgentsMayDecide"},{"type":"null"}]},"shareHealthMetrics":{"description":"Whether Fleepr may read the organization's Health counts and rates, never content, with other organizations'; null returns to the plan's default.","anyOf":[{"$ref":"#/components/schemas/ShareHealthMetrics"},{"type":"null"}]},"memorySuggestionMessages":{"description":"How many different messages people wrote an agent needs before it suggests a memory, 1 to 5; null returns to the plan's default.","anyOf":[{"$ref":"#/components/schemas/MemorySuggestionMessages"},{"type":"null"}]},"publicFileLinks":{"description":"Whether members and agents may make public links to files, which any server downloads; null returns to the plan's default.","anyOf":[{"$ref":"#/components/schemas/PublicFileLinks"},{"type":"null"}]}},"additionalProperties":false},"OrganizationSettingsOverrides":{"type":"object","properties":{"logRetentionDays":{"anyOf":[{"$ref":"#/components/schemas/LogRetentionDays"},{"type":"null"}],"description":"The organization's own log retention in days; null follows the plan's default."},"outsideAgentsMayDecide":{"default":null,"description":"The organization's own choice on whether API keys may decide; null follows the plan's default.","anyOf":[{"$ref":"#/components/schemas/OutsideAgentsMayDecide"},{"type":"null"}]},"shareHealthMetrics":{"default":null,"description":"The organization's own choice on whether Fleepr may read its Health metrics; null follows the plan's default.","anyOf":[{"$ref":"#/components/schemas/ShareHealthMetrics"},{"type":"null"}]},"memorySuggestionMessages":{"default":null,"description":"The organization's own number of messages before an agent suggests a memory; null follows the plan's default.","anyOf":[{"$ref":"#/components/schemas/MemorySuggestionMessages"},{"type":"null"}]},"publicFileLinks":{"default":null,"description":"The organization's own choice on whether public links to files work; null follows the plan's default.","anyOf":[{"$ref":"#/components/schemas/PublicFileLinks"},{"type":"null"}]}},"required":["logRetentionDays","outsideAgentsMayDecide","shareHealthMetrics","memorySuggestionMessages","publicFileLinks"]},"OrganizationStats":{"type":"object","properties":{"activeMembers":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many members are active."},"invitedMembers":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many people are invited and have not joined yet."},"agents":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many agents the organization has."},"teams":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many teams the organization has."},"visibleChats":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many chats the caller can see."},"visibleFiles":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many files the caller can see."}},"required":["activeMembers","invitedMembers","agents","teams","visibleChats","visibleFiles"]},"OrganizationUpdatedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"organization.updated","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"description":"What the event carries; for a change, the object as it is after it.","$ref":"#/components/schemas/OrganizationEventPayload"}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"OrgRole":{"type":"string","enum":["owner","admin","member","viewer"]},"OrgStreamEvent":{"oneOf":[{"$ref":"#/components/schemas/StreamReadyEvent"},{"$ref":"#/components/schemas/StreamReplayedEvent"},{"$ref":"#/components/schemas/StreamResetEvent"},{"$ref":"#/components/schemas/StreamClosedEvent"},{"$ref":"#/components/schemas/OrganizationUpdatedEvent"},{"$ref":"#/components/schemas/OrganizationAgentsPausedEvent"},{"$ref":"#/components/schemas/OrganizationAgentsResumedEvent"},{"$ref":"#/components/schemas/ActorUpdatedEvent"},{"$ref":"#/components/schemas/MemberInvitedEvent"},{"$ref":"#/components/schemas/MemberJoinedEvent"},{"$ref":"#/components/schemas/MemberUpdatedEvent"},{"$ref":"#/components/schemas/MemberDeactivatedEvent"},{"$ref":"#/components/schemas/MemberReactivatedEvent"},{"$ref":"#/components/schemas/InviteResentEvent"},{"$ref":"#/components/schemas/InviteRevokedEvent"},{"$ref":"#/components/schemas/InviteExpiredEvent"},{"$ref":"#/components/schemas/InviteAcceptedEvent"},{"$ref":"#/components/schemas/InviteUndeliveredEvent"},{"$ref":"#/components/schemas/AccessChangedEvent"},{"$ref":"#/components/schemas/AccessRevokedEvent"},{"$ref":"#/components/schemas/AccessOwnerChangedEvent"},{"$ref":"#/components/schemas/AccessRequestCreatedEvent"},{"$ref":"#/components/schemas/AccessRequestDecidedEvent"},{"$ref":"#/components/schemas/AboutChangedEvent"},{"$ref":"#/components/schemas/ChatCreatedEvent"},{"$ref":"#/components/schemas/ChatUpdatedEvent"},{"$ref":"#/components/schemas/ChatActivityEvent"},{"$ref":"#/components/schemas/ChatDeletedEvent"},{"$ref":"#/components/schemas/ChatPinnedEvent"},{"$ref":"#/components/schemas/ChatUnpinnedEvent"},{"$ref":"#/components/schemas/ChatReadEvent"},{"$ref":"#/components/schemas/TableCreatedEvent"},{"$ref":"#/components/schemas/TableUpdatedEvent"},{"$ref":"#/components/schemas/TableDeletedEvent"},{"$ref":"#/components/schemas/ColumnCreatedEvent"},{"$ref":"#/components/schemas/ColumnUpdatedEvent"},{"$ref":"#/components/schemas/ColumnTypeChangedEvent"},{"$ref":"#/components/schemas/ColumnDeletedEvent"},{"$ref":"#/components/schemas/RecordCreatedEvent"},{"$ref":"#/components/schemas/RecordUpdatedEvent"},{"$ref":"#/components/schemas/RecordDeletedEvent"},{"$ref":"#/components/schemas/RecordNamesChangedEvent"},{"$ref":"#/components/schemas/ViewCreatedEvent"},{"$ref":"#/components/schemas/ViewUpdatedEvent"},{"$ref":"#/components/schemas/ViewDeletedEvent"},{"$ref":"#/components/schemas/FormLinkCreatedEvent"},{"$ref":"#/components/schemas/FormLinkRevokedEvent"},{"$ref":"#/components/schemas/FormLinkUndeliveredEvent"},{"$ref":"#/components/schemas/FileCreatedEvent"},{"$ref":"#/components/schemas/FileUpdatedEvent"},{"$ref":"#/components/schemas/FileVersionAddedEvent"},{"$ref":"#/components/schemas/FileDeletedEvent"},{"$ref":"#/components/schemas/ApprovalRequestedEvent"},{"$ref":"#/components/schemas/ApprovalDecidedEvent"},{"$ref":"#/components/schemas/ApprovalDecisionUndoneEvent"},{"$ref":"#/components/schemas/ApprovalApproversChangedEvent"},{"$ref":"#/components/schemas/ApprovalRoundStartedEvent"},{"$ref":"#/components/schemas/ApprovalCompletedEvent"},{"$ref":"#/components/schemas/ApprovalCancelledEvent"},{"$ref":"#/components/schemas/ApprovalPausedEvent"},{"$ref":"#/components/schemas/ApprovalResumedEvent"},{"$ref":"#/components/schemas/AgentCreatedEvent"},{"$ref":"#/components/schemas/AgentUpdatedEvent"},{"$ref":"#/components/schemas/AgentPausedEvent"},{"$ref":"#/components/schemas/AgentResumedEvent"},{"$ref":"#/components/schemas/AgentArchivedEvent"},{"$ref":"#/components/schemas/TeamCreatedEvent"},{"$ref":"#/components/schemas/TeamUpdatedEvent"},{"$ref":"#/components/schemas/TeamDeletedEvent"},{"$ref":"#/components/schemas/SkillCreatedEvent"},{"$ref":"#/components/schemas/SkillUpdatedEvent"},{"$ref":"#/components/schemas/SkillVersionCreatedEvent"},{"$ref":"#/components/schemas/SkillDeletedEvent"},{"$ref":"#/components/schemas/AiLimitsUpdatedEvent"},{"$ref":"#/components/schemas/UsageBudgetWarningEvent"},{"$ref":"#/components/schemas/UsageBudgetExceededEvent"},{"$ref":"#/components/schemas/ConnectionCreatedEvent"},{"$ref":"#/components/schemas/ConnectionUpdatedEvent"},{"$ref":"#/components/schemas/ConnectionConnectedEvent"},{"$ref":"#/components/schemas/ConnectionHealthChangedEvent"},{"$ref":"#/components/schemas/ConnectionPausedEvent"},{"$ref":"#/components/schemas/ConnectionResumedEvent"},{"$ref":"#/components/schemas/ConnectionDisconnectedEvent"},{"$ref":"#/components/schemas/ConnectionDeletedEvent"},{"$ref":"#/components/schemas/FlowCreatedEvent"},{"$ref":"#/components/schemas/FlowUpdatedEvent"},{"$ref":"#/components/schemas/FlowVersionCreatedEvent"},{"$ref":"#/components/schemas/FlowActivatedEvent"},{"$ref":"#/components/schemas/FlowPausedEvent"},{"$ref":"#/components/schemas/FlowDeletedEvent"},{"$ref":"#/components/schemas/FlowRunStartedEvent"},{"$ref":"#/components/schemas/FlowRunStepStartedEvent"},{"$ref":"#/components/schemas/FlowRunStepCompletedEvent"},{"$ref":"#/components/schemas/FlowRunWaitingEvent"},{"$ref":"#/components/schemas/FlowRunSentBackEvent"},{"$ref":"#/components/schemas/FlowRunEndedEvent"},{"$ref":"#/components/schemas/RequestCreatedEvent"},{"$ref":"#/components/schemas/RequestUpdatedEvent"},{"$ref":"#/components/schemas/NotificationCreatedEvent"},{"$ref":"#/components/schemas/NotificationReadEvent"},{"$ref":"#/components/schemas/HealthIssueOpenedEvent"},{"$ref":"#/components/schemas/HealthIssueClearedEvent"},{"$ref":"#/components/schemas/HealthIssueResolvedEvent"},{"$ref":"#/components/schemas/HealthIssueReopenedEvent"},{"$ref":"#/components/schemas/HealthIssueFixRequestedEvent"},{"$ref":"#/components/schemas/HealthIssueFixWithdrawnEvent"},{"$ref":"#/components/schemas/HealthCheckedEvent"},{"$ref":"#/components/schemas/TableProfileUpdatedEvent"},{"$ref":"#/components/schemas/HealthTargetCreatedEvent"},{"$ref":"#/components/schemas/HealthTargetUpdatedEvent"},{"$ref":"#/components/schemas/HealthTargetDeletedEvent"},{"$ref":"#/components/schemas/HealthTargetMeasuredEvent"},{"$ref":"#/components/schemas/MemoryCreatedEvent"},{"$ref":"#/components/schemas/MemorySuggestedEvent"},{"$ref":"#/components/schemas/MemoryUpdatedEvent"},{"$ref":"#/components/schemas/MemoryDecidedEvent"}]},"OutsideAgentsMayDecide":{"type":"boolean"},"PageCoordinate":{"type":"number","minimum":0,"maximum":1},"PauseAgentBody":{"type":"object","properties":{"expectedRevision":{"description":"The `revision` you read. If the object changed since, the answer is `409 revision_conflict` and nothing changes.","$ref":"#/components/schemas/Revision"}},"required":["expectedRevision"],"additionalProperties":false},"PauseAgentsBody":{"type":"object","properties":{"expectedRevision":{"description":"The `revision` you read. If the object changed since, the answer is `409 revision_conflict` and nothing changes.","$ref":"#/components/schemas/Revision"}},"required":["expectedRevision"],"additionalProperties":false},"PauseFlowBody":{"type":"object","properties":{"expectedRevision":{"description":"The `revision` you read. If the object changed since, the answer is `409 revision_conflict` and nothing changes.","$ref":"#/components/schemas/Revision"}},"required":["expectedRevision"],"additionalProperties":false},"PersonActorId":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"$ref":"#/components/schemas/AgentId"}]},"PersonColumn":{"type":"object","properties":{"id":{"description":"The column's id: the key of its cell in each record's `values`.","$ref":"#/components/schemas/ColumnId"},"tableId":{"description":"The table the column belongs to.","$ref":"#/components/schemas/TableId"},"name":{"type":"string","minLength":1,"maxLength":80,"description":"The column's name, shown in its header."},"position":{"description":"The column's place in the table: columns sort by this key, compared as text.","$ref":"#/components/schemas/FractionalIndex"},"readOnly":{"type":"boolean","description":"Whether only the server writes the column's cells; a record write that sets one answers `400 validation_failed`."},"revision":{"description":"Grows by one with every change to the column; send it as `expectedRevision` to change the column.","$ref":"#/components/schemas/Revision"},"type":{"type":"string","const":"person","description":"The column's type, which decides what its cells hold."}},"required":["id","tableId","name","position","readOnly","revision","type"]},"PhotoCapture":{"type":"object","properties":{"kind":{"type":"string","const":"photo","description":"Take a photo."}},"required":["kind"]},"PlanId":{"type":"string","enum":["pilot"]},"PostFileCommentBody":{"type":"object","properties":{"versionId":{"description":"The version the comment is about.","$ref":"#/components/schemas/FileVersionId"},"parts":{"description":"The comment's content: text, mentions, references to annotations of the version, attachments and voice notes.","$ref":"#/components/schemas/MessagePartsInput"}},"required":["versionId","parts"],"additionalProperties":false},"PostMessageBody":{"type":"object","properties":{"parts":{"description":"The message's parts in order: text, mentions, attachments and voice notes. Up to 64 parts, 20 mentions, 10 attachments and 5 voice notes, with some text, an attachment or a voice note.","$ref":"#/components/schemas/ChatMessagePartsInput"}},"required":["parts"],"additionalProperties":false},"PostMessageResult":{"type":"object","properties":{"message":{"description":"The message as posted.","$ref":"#/components/schemas/Message"},"turns":{"type":"array","items":{"$ref":"#/components/schemas/Turn"},"description":"One queued turn for each agent the message mentions but those in `skippedMentions`, all in the chain it starts; a busy agent waits behind its earlier turns."},"accessAdded":{"type":"array","items":{"$ref":"#/components/schemas/AgentId"},"description":"The mentioned agents that the post added to the chat or file, with view access."},"skippedMentions":{"type":"array","items":{"$ref":"#/components/schemas/SkippedMention"},"description":"The mentioned agents that got no turn, each with the reason; the post went through anyway."},"included":{"description":"What the message references: its files, request cards and turns.","$ref":"#/components/schemas/MessageIncluded"}},"required":["message","turns","accessAdded","skippedMentions","included"]},"PostReviewCommentBody":{"type":"object","properties":{"versionId":{"description":"The version of the file the comment is about.","$ref":"#/components/schemas/FileVersionId"},"text":{"type":"string","minLength":1,"maxLength":5000,"description":"The comment as plain text, up to 5,000 characters; no mentions or attachments."},"annotationId":{"description":"An annotation a guest drew on that version that the comment refers to.","$ref":"#/components/schemas/AnnotationId"},"anchor":{"description":"On a doc only: the words of that version the comment is about, which the doc shows highlighted.","$ref":"#/components/schemas/TextAnchor"}},"required":["versionId","text"],"additionalProperties":false},"Preferences":{"type":"object","properties":{"theme":{"description":"`light`, `dark`, or `system` to follow the operating system.","$ref":"#/components/schemas/Theme"},"language":{"description":"The app's language.","$ref":"#/components/schemas/AppLanguage"},"agentReplyLanguage":{"description":"The language agents reply in: the app's language (`app`), or that of the message they answer (`message`).","$ref":"#/components/schemas/AgentReplyLanguage"},"emailDigest":{"description":"How often a summary email goes out: `off`, `daily` or `weekly`.","$ref":"#/components/schemas/EmailDigest"},"emailNotifications":{"description":"Which notifications also go by email; in-app notifications are always kept.","$ref":"#/components/schemas/EmailNotifications"},"sidebarMode":{"default":"full","description":"How the sidebar shows: `full`, `icons` only, or `hidden` until pointed at; `full` by default.","$ref":"#/components/schemas/SidebarMode"},"sidebarColor":{"default":"default","description":"The sidebar's color; `default` unless the person chose another.","$ref":"#/components/schemas/SidebarColor"},"updatedAt":{"description":"When the preferences last changed.","$ref":"#/components/schemas/IsoDateTime"}},"required":["theme","language","agentReplyLanguage","emailDigest","emailNotifications","sidebarMode","sidebarColor","updatedAt"]},"PreferencesPatch":{"type":"object","properties":{"theme":{"description":"`light`, `dark`, or `system` to follow the operating system.","$ref":"#/components/schemas/Theme"},"language":{"description":"The app's language.","$ref":"#/components/schemas/AppLanguage"},"agentReplyLanguage":{"description":"`app` for the app's language, or `message` for the language of the message an agent answers.","$ref":"#/components/schemas/AgentReplyLanguage"},"emailDigest":{"description":"How often a summary email goes out: `off`, `daily` or `weekly`.","$ref":"#/components/schemas/EmailDigest"},"emailNotifications":{"description":"Email switches to change; the ones left out keep their value.","$ref":"#/components/schemas/EmailNotificationsPatch"},"sidebarMode":{"description":"How the sidebar shows: `full`, `icons` only, or `hidden` until pointed at.","$ref":"#/components/schemas/SidebarMode"},"sidebarColor":{"description":"The sidebar's color.","$ref":"#/components/schemas/SidebarColor"}},"additionalProperties":false},"PreviewAgentRef":{"type":"object","properties":{"id":{"description":"The agent's id.","$ref":"#/components/schemas/AgentId"},"name":{"type":"string","description":"The agent's name."}},"required":["id","name"]},"PreviewAgentRefsChange":{"type":"object","properties":{"added":{"maxItems":100,"type":"array","items":{"$ref":"#/components/schemas/PreviewAgentRef"},"description":"The agents it adds."},"removed":{"maxItems":100,"type":"array","items":{"$ref":"#/components/schemas/PreviewAgentRef"},"description":"The agents it removes."}},"required":["added","removed"]},"PreviewCellValue":{"type":"object","properties":{"columnId":{"description":"The column's id.","$ref":"#/components/schemas/ColumnId"},"columnName":{"type":"string","description":"The column's name."},"display":{"type":"string","description":"The value as display text."}},"required":["columnId","columnName","display"]},"PreviewConnectionRef":{"type":"object","properties":{"id":{"description":"The connection's id.","$ref":"#/components/schemas/ConnectionId"},"name":{"type":"string","description":"The connection's name, as the person the agent works for reads it."}},"required":["id","name"]},"PreviewConnectionRefsChange":{"type":"object","properties":{"added":{"maxItems":100,"type":"array","items":{"$ref":"#/components/schemas/PreviewConnectionRef"},"description":"The connections it adds."},"removed":{"maxItems":100,"type":"array","items":{"$ref":"#/components/schemas/PreviewConnectionRef"},"description":"The connections it removes."}},"required":["added","removed"]},"PreviewFieldChange":{"type":"object","properties":{"columnId":{"description":"The column's id.","$ref":"#/components/schemas/ColumnId"},"columnName":{"type":"string","description":"The column's name."},"before":{"description":"The value before the change, as display text; null when empty.","type":["string","null"]},"after":{"description":"The value after the change, as display text; null when empty.","type":["string","null"]}},"required":["columnId","columnName","before","after"]},"PreviewFieldOrigin":{"type":"string","enum":["tool","model"]},"PreviewFilterCondition":{"type":"object","properties":{"condition":{"description":"The filter condition, exactly as it runs.","$ref":"#/components/schemas/FilterCondition"},"columnName":{"type":"string","description":"The name of the column it tests."},"valueLabel":{"description":"The value as people read it, such as an option's label; null for a condition without a value.","type":["string","null"]}},"required":["condition","columnName","valueLabel"]},"PreviewFlowStartChange":{"type":"object","properties":{"before":{"description":"The start before.","$ref":"#/components/schemas/FlowStart"},"after":{"description":"The start after.","$ref":"#/components/schemas/FlowStart"},"beforeWords":{"type":"string","maxLength":500,"description":"The start before, in words."},"afterWords":{"type":"string","maxLength":500,"description":"The start after, in words."}},"required":["before","after","beforeWords","afterWords"]},"PreviewFlowStep":{"type":"object","properties":{"id":{"anyOf":[{"$ref":"#/components/schemas/FlowStepId"},{"type":"null"}],"description":"The step's id; null for a step the change adds."},"assignee":{"description":"Who does the step: an agent, or a person who signs it off.","$ref":"#/components/schemas/FlowStepAssignee"},"assigneeName":{"type":"string","description":"The agent's or the person's name."},"does":{"type":"string","minLength":1,"maxLength":2000,"description":"What the step does, whole."},"passes":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"description":"What it hands on; null when not said."},"returnTo":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}],"description":"The earlier step a send-back returns to, from 0; or null."}},"required":["id","assignee","assigneeName","does","passes","returnTo"]},"PreviewFlowStepChange":{"type":"object","properties":{"change":{"description":"What the change does to the step.","$ref":"#/components/schemas/PreviewFlowStepChangeKind"},"before":{"anyOf":[{"$ref":"#/components/schemas/PreviewFlowStep"},{"type":"null"}],"description":"The step before; null for an added step."},"after":{"anyOf":[{"$ref":"#/components/schemas/PreviewFlowStep"},{"type":"null"}],"description":"The step after; null for a removed step."}},"required":["change","before","after"]},"PreviewFlowStepChangeKind":{"type":"string","enum":["added","edited","removed","moved","unchanged"]},"PreviewFormQuestion":{"type":"object","properties":{"columnId":{"description":"The column the question fills.","$ref":"#/components/schemas/ColumnId"},"columnName":{"type":"string","description":"The column's name, which the question shows without a label."},"columnType":{"description":"The column's type.","$ref":"#/components/schemas/ColumnType"},"label":{"anyOf":[{"type":"string","minLength":1,"maxLength":120},{"type":"null"}],"description":"The question's words; null shows the column's name."},"help":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"description":"The line under the question; null for none."},"required":{"type":"boolean","description":"Whether an editable question needs an answer."},"access":{"description":"`editable`, `read_only` or `hidden`.","$ref":"#/components/schemas/FormFieldAccess"},"display":{"anyOf":[{"$ref":"#/components/schemas/FormTextDisplay"},{"type":"null"}],"description":"A text question as one line or a box; null otherwise."},"files":{"anyOf":[{"$ref":"#/components/schemas/FormFileSettings"},{"type":"null"}],"description":"An attachments question's files: kinds, how many, how big, upload and captures; null otherwise."},"prefill":{"type":"boolean","description":"Whether a personal link's prefilled value may fill it (every question but a file question); a read-only or hidden question shows or takes only such a value."}},"required":["columnId","columnName","columnType","label","help","required","access","display","files","prefill"]},"PreviewFormQuestionChange":{"type":"object","properties":{"change":{"description":"What the change does to the question.","$ref":"#/components/schemas/PreviewFormQuestionChangeKind"},"question":{"description":"The question after the change; a removed one as it was.","$ref":"#/components/schemas/PreviewFormQuestion"}},"required":["change","question"]},"PreviewFormQuestionChangeKind":{"type":"string","enum":["added","changed","unchanged","removed"]},"PreviewInviteBody":{"type":"object","properties":{"token":{"type":"string","minLength":1,"maxLength":512,"description":"The token from the invite email's link."}},"required":["token"],"additionalProperties":false},"PreviewNewColumn":{"type":"object","properties":{"name":{"type":"string","description":"The column's name."},"type":{"description":"The column's type.","$ref":"#/components/schemas/ColumnType"},"options":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"The options of a select or multi-select column, in order; null for other types."},"targetTableId":{"anyOf":[{"$ref":"#/components/schemas/TableId"},{"type":"null"}],"description":"The table a `linked_record` column links to; null for other types."},"targetTableName":{"description":"The name of the table a `linked_record` column links to; null for other types, and for a reader who may not view that table.","type":["string","null"]},"multiple":{"type":"boolean","description":"`true` when a `linked_record` column may link to more than one record; `false` for other types."}},"required":["name","type","options","targetTableId","targetTableName","multiple"]},"PreviewPrefillValue":{"type":"object","properties":{"columnId":{"description":"The column's id.","$ref":"#/components/schemas/ColumnId"},"columnName":{"type":"string","description":"The question as the respondent reads it: its label, or its column's name when it has none."},"display":{"type":"string","description":"The value as display text."},"access":{"description":"`editable` (they may change it), `read_only` (they see it, unchanged) or `hidden` (they do not see it).","$ref":"#/components/schemas/FormFieldAccess"}},"required":["columnId","columnName","display","access"]},"PreviewSettingChange":{"type":"object","properties":{"label":{"type":"string","minLength":1,"maxLength":128,"description":"The setting, in words."},"before":{"description":"The setting before, whole; null when empty.","type":["string","null"]},"after":{"description":"The setting after, whole; null when empty.","type":["string","null"]}},"required":["label","before","after"]},"PreviewSkillRef":{"type":"object","properties":{"id":{"description":"The skill's id.","$ref":"#/components/schemas/SkillId"},"name":{"type":"string","description":"The skill's name."}},"required":["id","name"]},"PreviewSkillRefsChange":{"type":"object","properties":{"added":{"maxItems":100,"type":"array","items":{"$ref":"#/components/schemas/PreviewSkillRef"},"description":"The skills it adds."},"removed":{"maxItems":100,"type":"array","items":{"$ref":"#/components/schemas/PreviewSkillRef"},"description":"The skills it removes."}},"required":["added","removed"]},"PreviewTeamRef":{"type":"object","properties":{"id":{"description":"The team's id.","$ref":"#/components/schemas/TeamId"},"name":{"type":"string","description":"The team's name."}},"required":["id","name"]},"PreviewTeamRefsChange":{"type":"object","properties":{"added":{"maxItems":100,"type":"array","items":{"$ref":"#/components/schemas/PreviewTeamRef"},"description":"The teams it adds."},"removed":{"maxItems":100,"type":"array","items":{"$ref":"#/components/schemas/PreviewTeamRef"},"description":"The teams it removes."}},"required":["added","removed"]},"PreviewTextChange":{"type":"object","properties":{"before":{"description":"The value before the change, whole; null when empty.","type":["string","null"]},"after":{"description":"The value after the change, whole; null when empty.","type":["string","null"]}},"required":["before","after"]},"ProcessingStatus":{"type":"string","enum":["pending","processing","ready","failed"]},"PublicAnnotation":{"type":"object","properties":{"id":{"description":"The annotation's id.","$ref":"#/components/schemas/AnnotationId"},"fileId":{"description":"The file it is drawn on.","$ref":"#/components/schemas/FileId"},"versionId":{"description":"The version of the file it is drawn on.","$ref":"#/components/schemas/FileVersionId"},"page":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"The page it is drawn on, counting from 0; always 0 for an image, a video or an audio file."},"shape":{"description":"What was drawn, with coordinates from 0 to 1 of the page.","$ref":"#/components/schemas/Shape"},"timeMs":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}],"description":"The moment of a video it belongs to, in milliseconds; null for any other file."},"createdAt":{"description":"When it was drawn.","$ref":"#/components/schemas/IsoDateTime"},"number":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"Its number among the guests' annotations of its version, in the order they were drawn."},"authorName":{"type":"string","description":"The name of the guest who drew it."}},"required":["id","fileId","versionId","page","shape","timeMs","createdAt","number","authorName"]},"PublicApproval":{"type":"object","properties":{"round":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"The current round, counting from 1; each new version of the file starts the next one and clears the decisions. Send it with a decision."},"status":{"type":"string","enum":["pending","approved","cancelled"],"description":"`pending` while decisions are missing, `approved` once every approver approved, or `cancelled` when the file was deleted."},"isApprover":{"type":"boolean","description":"Whether the session's guest is an approver of this round."},"myDecision":{"anyOf":[{"type":"string","const":"approved"},{"type":"null"}],"description":"The guest's decision in this round, `approved`; null when they have not approved."},"canDecide":{"type":"boolean","description":"Whether the guest is an approver of this round while the approval is neither paused nor cancelled; they decide once per round, so check `myDecision` too."}},"required":["round","status","isApprover","myDecision","canDecide"]},"PublicComment":{"type":"object","properties":{"id":{"description":"The comment's id.","$ref":"#/components/schemas/MessageId"},"versionId":{"anyOf":[{"$ref":"#/components/schemas/FileVersionId"},{"type":"null"}],"description":"The version the comment is about, when it is the version the page shows; null for a comment on an earlier version."},"authorName":{"type":"string","description":"The name of the guest who wrote it."},"text":{"type":"string","description":"The comment, as plain text."},"verified":{"type":"boolean","description":"Whether the link's recipient wrote it after confirming their email with the one-time code; false for anyone who only gave a name."},"annotationId":{"anyOf":[{"$ref":"#/components/schemas/AnnotationId"},{"type":"null"}],"description":"The annotation the comment refers to; null when none."},"anchor":{"anyOf":[{"$ref":"#/components/schemas/TextAnchor"},{"type":"null"}],"description":"On a doc, the words the comment is about, which the doc shows highlighted; null when none."},"resolvedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}],"description":"When the comment was marked resolved; null while it is open. An open comment of an earlier version carries into the review of the version the page shows."},"createdAt":{"description":"When it was posted.","$ref":"#/components/schemas/IsoDateTime"}},"required":["id","versionId","authorName","text","verified","annotationId","anchor","resolvedAt","createdAt"]},"PublicDoc":{"type":"object","properties":{"content":{"description":"The content of the version under review, the editor's JSON, with every mention as the text `@Name`: no agent's id reaches the page.","$ref":"#/components/schemas/DocContent"},"pages":{"type":"array","items":{"$ref":"#/components/schemas/PublicDocPage"},"description":"Its pages, in order, each marked in or out of scope."}},"required":["content","pages"]},"PublicDocPage":{"type":"object","properties":{"id":{"description":"The page.","$ref":"#/components/schemas/DocPageId"},"number":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"Its number."},"heading":{"description":"The text of its first heading; null when it has none.","type":["string","null"]},"inScope":{"type":"boolean","description":"Whether the approval covers it."}},"required":["id","number","heading","inScope"]},"PublicFile":{"type":"object","properties":{"id":{"description":"The file's id.","$ref":"#/components/schemas/FileId"},"name":{"type":"string","minLength":1,"maxLength":255,"description":"The file's name."},"kind":{"description":"The type of file: `image`, `video`, `pdf`, `document` (an uploaded document such as a slide deck, a spreadsheet or a text file), `doc` (a doc written in Fleepr's editor), `audio` or `other`.","$ref":"#/components/schemas/FileKind"},"meta":{"description":"The current version's dimensions, length and page count, where they apply.","$ref":"#/components/schemas/FileMeta"},"thumbnailUrl":{"anyOf":[{"$ref":"#/components/schemas/Url"},{"type":"null"}],"description":"A signed link to a small preview image, valid until `urlsExpireAt`; null when there is none."},"urlsExpireAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}],"description":"When the signed links of this file and of its detail stop working, so fetch them again before then; null without links."},"versionId":{"description":"The version under review: the file's current one, or a doc's version frozen for its round.","$ref":"#/components/schemas/FileVersionId"},"versionNumber":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"The number of that version, counting from 1."},"approval":{"anyOf":[{"$ref":"#/components/schemas/PublicApproval"},{"type":"null"}],"description":"The file's approval as the guest sees it; null when the file has none."}},"required":["id","name","kind","meta","thumbnailUrl","urlsExpireAt","versionId","versionNumber","approval"]},"PublicFileDetail":{"type":"object","properties":{"file":{"description":"The file, with its approval as the guest sees it.","$ref":"#/components/schemas/PublicFile"},"pages":{"type":"array","items":{"$ref":"#/components/schemas/FileVersionPage"},"description":"The pages to show, each with a signed link: one for an image, and one per page of a PDF, up to its first 50; empty for any other file, or when there are none."},"posterUrl":{"anyOf":[{"$ref":"#/components/schemas/Url"},{"type":"null"}],"description":"A signed link to a video's still image; null for other files or when there is none."},"playbackUrl":{"anyOf":[{"$ref":"#/components/schemas/Url"},{"type":"null"}],"description":"A signed link that plays a video or audio file in a browser; null for other files, and until the version is `ready`."},"annotations":{"type":"array","items":{"$ref":"#/components/schemas/PublicAnnotation"},"description":"The annotations guests drew on the current version through the file's approval links."},"comments":{"type":"array","items":{"$ref":"#/components/schemas/PublicComment"},"description":"The comments guests made through the file's approval links: the newest 500, and every comment that explains a change request."},"doc":{"default":null,"description":"A doc written in Fleepr: the version under review, page by page; null for any other file.","anyOf":[{"$ref":"#/components/schemas/PublicDoc"},{"type":"null"}]}},"required":["file","pages","posterUrl","playbackUrl","annotations","comments","doc"]},"PublicFileLink":{"type":"object","properties":{"id":{"description":"The link's id.","$ref":"#/components/schemas/PublicFileLinkId"},"organizationId":{"description":"The organization the link belongs to.","$ref":"#/components/schemas/OrganizationId"},"fileId":{"description":"The file the link downloads.","$ref":"#/components/schemas/FileId"},"versionId":{"description":"The version of the file it downloads, whichever is current later.","$ref":"#/components/schemas/FileVersionId"},"versionNumber":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"That version's number, from 1."},"createdBy":{"description":"The member who made the link, or who allowed the card an agent made it under; it stops working when they can no longer view the file.","$ref":"#/components/schemas/MemberId"},"agentId":{"anyOf":[{"$ref":"#/components/schemas/AgentId"},{"type":"null"}],"description":"The agent that made the link under a card its maker allowed; null for a link a member made."},"expiresAt":{"description":"When the link stops working.","$ref":"#/components/schemas/IsoDateTime"},"status":{"description":"`active`, `revoked` (turned off by a member) or `expired` once past `expiresAt`.","$ref":"#/components/schemas/PublicFileLinkStatus"},"revokedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}],"description":"When the link was turned off; null unless `revoked`."},"revokedBy":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"Who turned it off; null unless `revoked`."},"openCount":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many times the link was opened."},"lastOpenedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}],"description":"When the link was last opened; null when never."},"createdAt":{"description":"When the link was made.","$ref":"#/components/schemas/IsoDateTime"}},"required":["id","organizationId","fileId","versionId","versionNumber","createdBy","agentId","expiresAt","status","revokedAt","revokedBy","openCount","lastOpenedAt","createdAt"]},"PublicFileLinkId":{"type":"string","pattern":"^pfl_[0-9a-hjkmnp-tv-z]{26}$"},"PublicFileLinks":{"type":"boolean"},"PublicFileLinkStatus":{"type":"string","enum":["active","revoked","expired"]},"PublicFileToken":{"type":"string","minLength":43,"maxLength":43,"pattern":"^[A-Za-z0-9_-]{43}$"},"PublicForm":{"type":"object","properties":{"organization":{"description":"Whose form it is.","$ref":"#/components/schemas/PublicFormOrganization"},"title":{"type":"string","minLength":1,"maxLength":120,"description":"The form's title."},"description":{"type":"string","maxLength":2000,"description":"Plain text under the title; links in it are made clickable. Empty for none."},"submitLabel":{"type":"string","minLength":1,"maxLength":40,"description":"The send button's words."},"askRespondent":{"description":"Whether the page asks the respondent's name and email: `off`, `optional` or `required`. Always `off` on a personal link (its recipient is known) and for a member (they respond as themselves).","$ref":"#/components/schemas/FormAskRespondent"},"respondingAs":{"anyOf":[{"type":"object","properties":{"name":{"type":"string","description":"The member's name."}},"required":["name"]},{"type":"null"}],"description":"The member the response is credited to, when one is signed in; null for someone outside."},"fields":{"type":"array","items":{"$ref":"#/components/schemas/PublicFormField"},"description":"The questions the page shows, in form order."}},"required":["organization","title","description","submitLabel","askRespondent","respondingAs","fields"]},"PublicFormField":{"type":"object","properties":{"columnId":{"description":"The question's column: the key of its answer in `values`.","$ref":"#/components/schemas/ColumnId"},"type":{"description":"The question's type, its column's.","$ref":"#/components/schemas/FormQuestionType"},"label":{"type":"string","minLength":1,"maxLength":120,"description":"The question, as the form words it."},"help":{"description":"A line under the question, or null.","type":["string","null"]},"required":{"type":"boolean","description":"Whether it needs an answer (a required checkbox must be ticked)."},"access":{"type":"string","enum":["editable","read_only"],"description":"`editable`: the respondent answers it; `read_only`: it shows its prefilled value only."},"display":{"anyOf":[{"$ref":"#/components/schemas/FormTextDisplay"},{"type":"null"}],"description":"A text question as one line or a paragraph; else null."},"options":{"type":"array","items":{"$ref":"#/components/schemas/SelectOption"},"description":"A select or multi-select question's options, in menu order; empty on other types."},"number":{"anyOf":[{"$ref":"#/components/schemas/PublicFormNumber"},{"type":"null"}],"description":"A number question's format; null on other types."},"includeTime":{"description":"Whether a date question takes a time too; null on other types.","type":["boolean","null"]},"value":{"description":"Where the answer starts (a personal link's or the address's prefilled value), or what a read-only question shows, as its cell; null when none. Always null on a person, a link or a file question (see `labels`).","$ref":"#/components/schemas/CellValue"},"labels":{"type":"array","items":{"type":"string"},"description":"A person or link question's prefilled value as text: the person's name, the linked records' labels. Empty otherwise."},"files":{"anyOf":[{"$ref":"#/components/schemas/FormFileSettings"},{"type":"null"}],"description":"A file question's settings: what it takes, how many, how big, and how; null on other types."}},"required":["columnId","type","label","help","required","access","display","options","number","includeTime","value","labels","files"]},"PublicFormFile":{"type":"object","properties":{"uploadId":{"description":"The upload's id, which the question's answer names.","$ref":"#/components/schemas/UploadId"},"name":{"type":"string","description":"The file's name."},"mimeType":{"type":"string","description":"The file's media type."},"sizeBytes":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"The file's size in bytes."},"kind":{"description":"What kind of file it is: an image, a video, audio, a document and so on.","$ref":"#/components/schemas/FileKind"}},"required":["uploadId","name","mimeType","sizeBytes","kind"]},"PublicFormNumber":{"type":"object","properties":{"decimals":{"type":"integer","minimum":0,"maximum":6,"description":"How many decimal places it shows."},"format":{"description":"`plain`, `currency` or `percent`.","$ref":"#/components/schemas/NumberFormat"},"currency":{"anyOf":[{"$ref":"#/components/schemas/CurrencyCode"},{"type":"null"}],"description":"The currency a `currency` number shows, or null."}},"required":["decimals","format","currency"]},"PublicFormOrganization":{"type":"object","properties":{"name":{"type":"string","description":"The organization's name."},"squareLogoUrl":{"anyOf":[{"$ref":"#/components/schemas/Url"},{"type":"null"}],"description":"The organization's square logo, or null."},"horizontalLogoUrl":{"anyOf":[{"$ref":"#/components/schemas/Url"},{"type":"null"}],"description":"The organization's horizontal logo, which the header shows first, or null."}},"required":["name","squareLogoUrl","horizontalLogoUrl"]},"PublicFormUpload":{"type":"object","properties":{"id":{"description":"The upload's id: complete it, discard it, or send it as the question's answer.","$ref":"#/components/schemas/UploadId"},"name":{"type":"string","description":"The file's name."},"mimeType":{"type":"string","description":"The file's media type."},"sizeBytes":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"The file's size in bytes."},"transfer":{"description":"How to send the bytes: one `PUT`, or parts.","$ref":"#/components/schemas/UploadTransfer"},"expiresAt":{"description":"When the upload must be completed by.","$ref":"#/components/schemas/IsoDateTime"}},"required":["id","name","mimeType","sizeBytes","transfer","expiresAt"]},"Question":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":40,"description":"The question's id, unique on the card."},"prompt":{"type":"string","minLength":1,"maxLength":300,"description":"The question itself."},"short":{"anyOf":[{"type":"string","minLength":1,"maxLength":40},{"type":"null"}],"description":"A word or two for its answer's chip, such as \"Placement\"; null shows the prompt."},"context":{"anyOf":[{"type":"string","minLength":1,"maxLength":300},{"type":"null"}],"description":"A line of background shown under the question; null for none."},"select":{"description":"`single`: one option or Other; `multi`: any number of options, and Other too.","$ref":"#/components/schemas/QuestionSelect"},"options":{"minItems":2,"maxItems":4,"type":"array","items":{"$ref":"#/components/schemas/QuestionOption"},"description":"The answers to choose from, 2 to 4; Other is always offered besides."},"resolves":{"default":null,"description":"The words people used that the record options resolve, in a \"which one?\" question; null otherwise, and null for a reader who may view none of its record options. Only a question with at least one record option holds it. Cards stored before the field existed read null.","anyOf":[{"type":"object","properties":{"text":{"type":"string","minLength":1,"maxLength":80,"description":"The words people used, as written, such as \"francisco\"."}},"required":["text"]},{"type":"null"}]}},"required":["id","prompt","short","context","select","options","resolves"]},"QuestionAnswer":{"type":"object","properties":{"choices":{"minItems":1,"maxItems":4,"type":"array","items":{"$ref":"#/components/schemas/QuestionChoice"},"description":"One answer per question, in the order of the questions."},"skipped":{"type":"boolean","description":"The answerer skipped: each answer is the option the asker recommended."},"answeredBy":{"description":"Who sent the answer: the card's answerer, or the organization's owner or an admin for them.","$ref":"#/components/schemas/MemberId"},"answeredAt":{"description":"When it was answered.","$ref":"#/components/schemas/IsoDateTime"}},"required":["choices","skipped","answeredBy","answeredAt"]},"QuestionAnswerer":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"member","description":"A member of the organization answers."},"memberId":{"description":"The member who answers.","$ref":"#/components/schemas/MemberId"}},"required":["kind","memberId"]}]},"QuestionCard":{"type":"object","properties":{"id":{"description":"The card's id; answering it names it.","$ref":"#/components/schemas/QuestionId"},"title":{"anyOf":[{"type":"string","minLength":1,"maxLength":120},{"type":"null"}],"description":"A heading for a set of questions, such as \"4 things Fleepr picked up\"; null for none."},"answerer":{"description":"Who answers it. Everyone else who sees it reads it without answering.","$ref":"#/components/schemas/QuestionAnswerer"},"questions":{"minItems":1,"maxItems":4,"type":"array","items":{"$ref":"#/components/schemas/Question"},"description":"The questions, 1 to 4, asked one at a time."},"allowSkip":{"type":"boolean","description":"Whether the answerer may skip and let the asker use its recommended options."},"state":{"description":"`open`, then `answered`, `superseded` (a message in the chat replied instead) or `closed`.","$ref":"#/components/schemas/QuestionCardState"},"answer":{"anyOf":[{"$ref":"#/components/schemas/QuestionAnswer"},{"type":"null"}],"description":"The answer, exactly while `answered`; null otherwise."},"supersededBy":{"anyOf":[{"$ref":"#/components/schemas/MessageId"},{"type":"null"}],"description":"The message written in the chat instead of an answer, exactly while `superseded`; null otherwise."}},"required":["id","title","answerer","questions","allowSkip","state","answer","supersededBy"]},"QuestionCardState":{"type":"string","enum":["open","answered","superseded","closed"]},"QuestionChoice":{"type":"object","properties":{"questionId":{"type":"string","minLength":1,"maxLength":40,"description":"The question answered."},"optionIds":{"maxItems":4,"type":"array","items":{"type":"string","minLength":1,"maxLength":40,"description":"The option's id, unique on the card."},"description":"The options chosen, in the order the question lists them."},"other":{"anyOf":[{"type":"string","minLength":1,"maxLength":500},{"type":"null"}],"description":"The answerer's own words, written under Other; null when they wrote none."}},"required":["questionId","optionIds","other"]},"QuestionId":{"type":"string","pattern":"^qst_[0-9a-hjkmnp-tv-z]{26}$"},"QuestionOption":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":40,"description":"The option's id, unique within its question; an answer names it."},"label":{"type":"string","minLength":1,"maxLength":80,"description":"The words of the option."},"hint":{"anyOf":[{"type":"string","minLength":1,"maxLength":160},{"type":"null"}],"description":"One line under the label that says what choosing it means; null for none."},"recommended":{"type":"boolean","description":"The option the asker would choose: tagged \"Recommended\", and what a skip answers."},"fromMemory":{"type":"boolean","description":"The option comes from a memory of the organization: tagged \"From Memory\"."},"record":{"default":null,"description":"The record this option stands for, in a \"which one?\" question; null otherwise. Its label is the record's display name and table name, written by the server. Each reader receives it as they may read it now: for a reader who may not view the record's table, or once the record is gone, record is null, the label reads \"A record\" and the hint is null. Cards stored before the field existed read null.","anyOf":[{"$ref":"#/components/schemas/QuestionOptionRecord"},{"type":"null"}]}},"required":["id","label","hint","recommended","fromMemory","record"]},"QuestionOptionRecord":{"type":"object","properties":{"recordId":{"description":"The record.","$ref":"#/components/schemas/RecordId"},"tableId":{"description":"Its table.","$ref":"#/components/schemas/TableId"}},"required":["recordId","tableId"]},"QuestionPart":{"type":"object","properties":{"type":{"type":"string","const":"question","description":"A question card: questions put to one person, answered on the card."},"question":{"description":"The card: its questions, who answers, its state and its answer.","$ref":"#/components/schemas/QuestionCard"}},"required":["type","question"]},"QuestionSelect":{"type":"string","enum":["single","multi"]},"QuotePart":{"type":"object","properties":{"type":{"type":"string","const":"quote","description":"The words of a doc the comment is about, which the doc shows highlighted; in a doc's comments only."},"anchor":{"description":"The words, their context and their page.","$ref":"#/components/schemas/TextAnchor"}},"required":["type","anchor"]},"ReactivateMemberBody":{"type":"object","properties":{"expectedRevision":{"description":"The `revision` you read. If the object changed since, the answer is `409 revision_conflict` and nothing changes.","$ref":"#/components/schemas/Revision"}},"required":["expectedRevision"],"additionalProperties":false},"RecordCreatedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"record.created","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"description":"What the event carries; for a change, the object as it is after it.","$ref":"#/components/schemas/RecordResult"}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"RecordDeletedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"record.deleted","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"description":"What the event carries; for a change, the object as it is after it.","$ref":"#/components/schemas/RecordDeletedPayload"}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"RecordDeletedPayload":{"type":"object","properties":{"recordId":{"description":"The record that was deleted.","$ref":"#/components/schemas/RecordId"},"tableId":{"description":"The table it was deleted from.","$ref":"#/components/schemas/TableId"}},"required":["recordId","tableId"]},"RecordId":{"type":"string","pattern":"^rec_[0-9a-hjkmnp-tv-z]{26}$"},"RecordIncluded":{"type":"object","properties":{"linkedRecords":{"type":"array","items":{"$ref":"#/components/schemas/LinkedRecordLabel"},"description":"The labels of the records the link cells point at; records the caller cannot view are left out."},"files":{"type":"array","items":{"$ref":"#/components/schemas/FileSummary"},"description":"The files the attachment cells hold; files the caller cannot view are left out."}},"required":["linkedRecords","files"]},"RecordMatchKind":{"type":"string","enum":["name","identifier","learned","word","near"],"description":"How a record matched: name (a whole name), identifier (a whole code, email or web address), learned (a whole name people taught), word (some words of a name) or near (a word spelled close to a name)."},"RecordMentionPart":{"type":"object","properties":{"type":{"type":"string","const":"record_mention","description":"A mention of a record in one of your tables; in a chat, by a member only."},"record":{"anyOf":[{"$ref":"#/components/schemas/RecordMentionTarget"},{"type":"null"}],"description":"The record, or null when you may not view its table or it was deleted."}},"required":["type","record"]},"RecordMentionTarget":{"type":"object","properties":{"recordId":{"description":"The record mentioned; its label comes in `included.records`.","$ref":"#/components/schemas/RecordId"},"tableId":{"description":"The table that holds it.","$ref":"#/components/schemas/TableId"}},"required":["recordId","tableId"]},"RecordNameId":{"type":"string","pattern":"^rnm_[0-9a-hjkmnp-tv-z]{26}$"},"RecordNames":{"type":"object","properties":{"items":{"maxItems":20,"type":"array","items":{"$ref":"#/components/schemas/LearnedRecordName"},"description":"The names it learned and still uses, newest first. Never where they were said."},"viewer":{"type":"object","properties":{"canRemove":{"type":"boolean","description":"Whether the caller may remove them: who may edit the table."}},"required":["canRemove"],"description":"What the caller may do with them."}},"required":["items","viewer"]},"RecordNamesChangedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"record.names_changed","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"description":"What the event carries; for a change, the object as it is after it.","$ref":"#/components/schemas/RecordNamesChangedPayload"}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"RecordNamesChangedPayload":{"type":"object","properties":{"recordId":{"description":"The record whose learned names changed.","$ref":"#/components/schemas/RecordId"},"tableId":{"description":"Its table.","$ref":"#/components/schemas/TableId"}},"required":["recordId","tableId"]},"RecordPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/TableRecord"},"description":"This page of the list."},"nextCursor":{"anyOf":[{"$ref":"#/components/schemas/Cursor"},{"type":"null"}],"description":"Send it back as `cursor` to read the next page; null on the last page."},"totalCount":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many records the table holds, whatever the view."},"matchCount":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many records match the view's search and filter, across every page."},"appliedView":{"description":"The view that ran: the one sent, without the conditions that were incomplete or invalid.","$ref":"#/components/schemas/TableView"},"included":{"description":"The labels of the records this page's link cells point at and the files its attachment cells hold.","$ref":"#/components/schemas/RecordIncluded"}},"required":["items","nextCursor","totalCount","matchCount","appliedView","included"]},"RecordResult":{"type":"object","properties":{"record":{"description":"The record, with every cell.","$ref":"#/components/schemas/TableRecord"},"included":{"description":"The labels of the records its link cells point at and the files its attachment cells hold, so cells render at once.","$ref":"#/components/schemas/RecordIncluded"}},"required":["record","included"]},"RecordsCreatePreview":{"type":"object","properties":{"kind":{"type":"string","const":"records_create","description":"Add records to a table."},"tableId":{"description":"The table it acts on.","$ref":"#/components/schemas/TableId"},"tableName":{"type":"string","description":"The table's name."},"count":{"type":"integer","minimum":1,"maximum":50,"description":"How many records the call adds."},"records":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"values":{"type":"array","items":{"$ref":"#/components/schemas/PreviewCellValue"},"description":"The record's values, cell by cell."}},"required":["values"]},"description":"Every new record, in order: as many as `count`."}},"required":["kind","tableId","tableName","count","records"]},"RecordsDeletePreview":{"type":"object","properties":{"kind":{"type":"string","const":"records_delete","description":"Delete records from a table."},"tableId":{"description":"The table it acts on.","$ref":"#/components/schemas/TableId"},"tableName":{"type":"string","description":"The table's name."},"count":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"How many records the call deletes."},"records":{"maxItems":10,"type":"array","items":{"type":"object","properties":{"recordId":{"description":"The record's id.","$ref":"#/components/schemas/RecordId"},"recordLabel":{"type":"string","description":"The record's label, as its table shows it."}},"required":["recordId","recordLabel"]},"description":"Every record named one by one, up to 10; empty for a delete chosen by a filter."},"filter":{"anyOf":[{"minItems":1,"maxItems":20,"type":"array","items":{"$ref":"#/components/schemas/PreviewFilterCondition"}},{"type":"null"}],"description":"The rule that chose the rows, all its conditions holding; null when the rows are named one by one."}},"required":["kind","tableId","tableName","count","records","filter"]},"RecordSearchHit":{"type":"object","properties":{"recordId":{"description":"The record's id.","$ref":"#/components/schemas/RecordId"},"tableId":{"description":"Its table's id.","$ref":"#/components/schemas/TableId"},"label":{"type":"string","description":"Its display name: its table's name column, else its primary column; empty when it has none."},"tableName":{"type":"string","minLength":1,"maxLength":120,"description":"Its table's name."},"tableRole":{"anyOf":[{"$ref":"#/components/schemas/TableRole"},{"type":"null"}],"description":"Its table's role on the Org map, or null when it has none."},"match":{"description":"How it matched the query, and by which of its names.","$ref":"#/components/schemas/RecordSearchMatch"},"context":{"anyOf":[{"type":"string","enum":["linked","related"]},{"type":"null"}],"description":"`linked` when the chat in `thread` is linked to it, `related` when the chat is linked to a record linked to or from it; null otherwise, and always without `thread`."}},"required":["recordId","tableId","label","tableName","tableRole","match","context"]},"RecordSearchMatch":{"type":"object","properties":{"kind":{"description":"`name`: a whole name; `identifier`: a whole code, email or web address of an identifying column; `learned`: a whole name people taught; `word`: some words of a name; `near`: a near spelling.","$ref":"#/components/schemas/RecordMatchKind"},"text":{"type":"string","description":"The name it matched by, as written, such as \"FMORALES\"."},"columnName":{"description":"For an `identifier` match, the name of the column that holds it; null for every other kind.","type":["string","null"]}},"required":["kind","text","columnName"]},"RecordSubmission":{"type":"object","properties":{"formId":{"description":"The form the response was sent through (it may have been deleted since).","$ref":"#/components/schemas/ViewId"},"formName":{"type":"string","minLength":1,"maxLength":80,"description":"The form's name when the response was sent."},"respondent":{"anyOf":[{"$ref":"#/components/schemas/FormRespondent"},{"type":"null"}],"description":"What someone outside gave as their name and email (or the personal link's recipient); null when a member of the organization responded, who is the record's creator."},"outside":{"type":"boolean","description":"True when no member was credited: someone outside the organization sent it through a link."}},"required":["formId","formName","respondent","outside"]},"RecordsUpdatePreview":{"type":"object","properties":{"kind":{"type":"string","const":"records_update","description":"Change records in a table."},"tableId":{"description":"The table it acts on.","$ref":"#/components/schemas/TableId"},"tableName":{"type":"string","description":"The table's name."},"count":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"How many records the call changes."},"changes":{"maxItems":10,"type":"array","items":{"type":"object","properties":{"recordId":{"description":"The record's id.","$ref":"#/components/schemas/RecordId"},"recordLabel":{"type":"string","description":"The record's label, as its table shows it."},"fields":{"type":"array","items":{"$ref":"#/components/schemas/PreviewFieldChange"},"description":"The fields that change, before and after."}},"required":["recordId","recordLabel","fields"]},"description":"Every record named one by one, up to 10; empty for a change chosen by a filter."},"filter":{"anyOf":[{"minItems":1,"maxItems":20,"type":"array","items":{"$ref":"#/components/schemas/PreviewFilterCondition"}},{"type":"null"}],"description":"The rule that chose the rows, all its conditions holding; null when the rows are named one by one."},"set":{"anyOf":[{"minItems":1,"maxItems":50,"type":"array","items":{"$ref":"#/components/schemas/PreviewCellValue"}},{"type":"null"}],"description":"The new values every changed row takes; null when each listed change says its own."}},"required":["kind","tableId","tableName","count","changes","filter","set"]},"RecordUpdatedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"record.updated","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"description":"What the event carries; for a change, the object as it is after it.","$ref":"#/components/schemas/RecordResult"}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"RecordValues":{"type":"object","propertyNames":{"$ref":"#/components/schemas/ColumnId"},"additionalProperties":{"$ref":"#/components/schemas/CellValue"}},"RenameFlowBody":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100,"description":"The flow's new name, 1 to 100 characters once trimmed."}},"required":["name"],"additionalProperties":false},"ReopenHealthIssueBody":{"type":"object","properties":{"expectedRevision":{"description":"The `revision` you read. If the object changed since, the answer is `409 revision_conflict` and nothing changes.","$ref":"#/components/schemas/Revision"}},"required":["expectedRevision"],"additionalProperties":false},"RequestableAccessLevel":{"type":"string","enum":["edit"]},"RequestAccessBody":{"type":"object","properties":{"level":{"description":"The level asked for: always `edit`.","$ref":"#/components/schemas/RequestableAccessLevel"},"message":{"description":"A note to the owner, up to 500 characters, such as why the edit access is needed.","type":"string","minLength":1,"maxLength":500,"pattern":"\\S"}},"required":["level"],"additionalProperties":false},"RequestAnswer":{"type":"string","enum":["allow","allow_once","deny"]},"RequestApprovalBody":{"type":"object","properties":{"approvers":{"minItems":1,"maxItems":20,"type":"array","items":{"$ref":"#/components/schemas/ApproverInput"},"description":"The members to ask, 1 to 20, each once."},"outsideAgentsMayDecide":{"deprecated":true,"description":"Ignored: the server decides whether approvers may decide through their API keys.","type":"boolean"},"docPageIds":{"description":"A doc's pages to approve, by id, from `GET /v0/files/{fileId}/doc`; left out for the whole doc. Only a doc takes it.","minItems":1,"maxItems":500,"type":"array","items":{"$ref":"#/components/schemas/DocPageId"}}},"required":["approvers"],"additionalProperties":false},"RequestCreatedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"request.created","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"type":"object","properties":{"request":{"description":"The new card, `pending`.","$ref":"#/components/schemas/ActionRequest"}},"required":["request"],"description":"What the event carries; for a change, the object as it is after it."}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"RequestDeciders":{"type":"object","properties":{"initiator":{"type":"boolean","description":"`true` when the member the agent acts for may decide, while they still hold what the card needs."},"ownerOf":{"anyOf":[{"$ref":"#/components/schemas/AccessObjectRef"},{"type":"null"}],"description":"The object whose current owner may decide, so a hand-over moves the decision; null for none."},"admins":{"type":"boolean","description":"`true` when the organization's owner and admins may decide."},"members":{"maxItems":20,"type":"array","items":{"$ref":"#/components/schemas/MemberId"},"description":"Members named to decide, besides the rules above; usually empty."}},"required":["initiator","ownerOf","admins","members"]},"RequestDecisionVia":{"type":"string","enum":["app","api_key","chat_grant"]},"RequestEmailChangeBody":{"type":"object","properties":{"newEmail":{"description":"The address to sign in with from now on; it must differ from the current one.","$ref":"#/components/schemas/Email"}},"required":["newEmail"],"additionalProperties":false},"RequestEmailChangeResult":{"type":"object","properties":{"pendingEmail":{"description":"The new address, which becomes the user's once both confirmation links are used.","$ref":"#/components/schemas/Email"}},"required":["pendingEmail"]},"RequestField":{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":160,"description":"What changes: a column's id, or an object's field such as `name` or `about`."},"label":{"type":"string","minLength":1,"maxLength":120,"description":"Its name as the card shows it."}},"required":["key","label"]},"RequestFooter":{"type":"object","properties":{"kind":{"type":"string","const":"request","description":"A question whose answer changes something: a request card."},"requestId":{"description":"The request card that carries the question and its buttons; it comes in `included.requests`.","$ref":"#/components/schemas/ActionRequestId"}},"required":["kind","requestId"]},"RequestKind":{"type":"string","enum":["edit_access","create","delete","bulk_change","confirm"]},"RequestPart":{"type":"object","properties":{"type":{"type":"string","const":"request","description":"A request card: the agent asks before it acts."},"requestId":{"description":"The request card; it comes in `included.requests`.","$ref":"#/components/schemas/ActionRequestId"}},"required":["type","requestId"]},"RequestPasswordResetBody":{"type":"object","properties":{"email":{"description":"The address of the account whose password to reset.","$ref":"#/components/schemas/Email"}},"required":["email"],"additionalProperties":false},"RequestToolRisk":{"type":"string","enum":["reversible","consequential","destructive"]},"RequestUpdatedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"request.updated","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"type":"object","properties":{"request":{"description":"The card as it is after the change.","$ref":"#/components/schemas/ActionRequest"},"change":{"description":"What changed, named after the new status; `reopened` is an undone decline, `finalized` the end of an Undo window, and `refreshed` a card rebuilt before it ran.","$ref":"#/components/schemas/ActionRequestChange"}},"required":["request","change"],"description":"What the event carries; for a change, the object as it is after it."}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"ResolveCommentBody":{"type":"object","properties":{"resolved":{"type":"boolean","description":"true to mark the comment resolved, false to open it again."}},"required":["resolved"],"additionalProperties":false},"ResolveHealthIssueBody":{"type":"object","properties":{"action":{"description":"`fixed` to mark it fixed, `dismissed` to dismiss it.","$ref":"#/components/schemas/HealthResolveAction"},"reason":{"description":"Why it is dismissed: `not_a_problem`, `not_now` (it may come back in 30 days) or `wrong`. Required to dismiss, refused otherwise.","$ref":"#/components/schemas/HealthDismissReason"},"expectedRevision":{"description":"The `revision` you read. If the object changed since, the answer is `409 revision_conflict` and nothing changes.","$ref":"#/components/schemas/Revision"}},"required":["action","expectedRevision"],"additionalProperties":false},"ResolveReviewCommentBody":{"type":"object","properties":{"resolved":{"type":"boolean","description":"true to mark the comment resolved, false to open it again."}},"required":["resolved"],"additionalProperties":false},"RestoredGrant":{"type":"object","properties":{"memberId":{"description":"The member whose kept grant gives them access again.","$ref":"#/components/schemas/MemberId"},"level":{"description":"The level the grant gives them: view, edit or manage.","$ref":"#/components/schemas/AccessLevel"},"how":{"type":"string","enum":["restored","invited"],"description":"`restored` (Restore) or `invited` (invited again through Team, effective once they join)."}},"required":["memberId","level","how"]},"RestoreDocVersionBody":{"type":"object","properties":{"versionId":{"description":"The doc's earlier version to go back to, from its versions (`GET /v0/files/{fileId}`).","$ref":"#/components/schemas/FileVersionId"},"expectedRevision":{"description":"The doc's `revision` you read (`GET /v0/files/{fileId}/doc`): if it changed since, the answer is `409 revision_conflict` and nothing is restored. Undoing an agent's edit sends it, so nothing made since is lost.","$ref":"#/components/schemas/Revision"}},"required":["versionId"],"additionalProperties":false},"RestoreMemoryVersionBody":{"type":"object","properties":{"expectedRevision":{"description":"The `revision` you read. If the object changed since, the answer is `409 revision_conflict` and nothing changes.","$ref":"#/components/schemas/Revision"}},"required":["expectedRevision"],"additionalProperties":false},"RestrictedObjectsUsedNotice":{"type":"object","properties":{"code":{"type":"string","const":"restricted_objects_used","description":"An agent's reply used something that some people in the chat cannot open; only the person who asked receives this note."},"agentId":{"description":"The agent that wrote the reply.","$ref":"#/components/schemas/AgentId"},"memberId":{"description":"The member who asked, whom the agents act for; nobody else receives the note.","$ref":"#/components/schemas/MemberId"},"objects":{"minItems":1,"maxItems":10,"type":"array","items":{"$ref":"#/components/schemas/AccessObjectRef"},"description":"The chats, files and tables it used that some people in the chat cannot open, in the order it read them, at most 10. Read their names with `GET /v0/objects/{objectId}`."}},"required":["code","agentId","memberId","objects"]},"ResumeAgentBody":{"type":"object","properties":{"expectedRevision":{"description":"The `revision` you read. If the object changed since, the answer is `409 revision_conflict` and nothing changes.","$ref":"#/components/schemas/Revision"}},"required":["expectedRevision"],"additionalProperties":false},"ResumeAgentsBody":{"type":"object","properties":{"expectedRevision":{"description":"The `revision` you read. If the object changed since, the answer is `409 revision_conflict` and nothing changes.","$ref":"#/components/schemas/Revision"}},"required":["expectedRevision"],"additionalProperties":false},"ResumeApprovalBody":{"type":"object","properties":{"expectedRevision":{"description":"The `revision` you read. If the object changed since, the answer is `409 revision_conflict` and nothing changes.","$ref":"#/components/schemas/Revision"}},"required":["expectedRevision"],"additionalProperties":false},"ResumeConnectionBody":{"type":"object","properties":{"expectedRevision":{"description":"The `revision` you read. If the object changed since, the answer is `409 revision_conflict` and nothing changes.","$ref":"#/components/schemas/Revision"}},"required":["expectedRevision"],"additionalProperties":false},"ReviewAnnotationCreatedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"type":{"type":"string","const":"review.annotation_created","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"type":"object","properties":{"annotation":{"description":"The new annotation.","$ref":"#/components/schemas/PublicAnnotation"}},"required":["annotation"],"description":"What the event carries; for a change, the object as it is after it."}},"required":["v","kind","id","occurredAt","type","payload"]},"ReviewAnnotationDeletedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"type":{"type":"string","const":"review.annotation_deleted","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"type":"object","properties":{"annotationId":{"description":"The deleted annotation's id.","$ref":"#/components/schemas/AnnotationId"},"fileId":{"description":"The file it was drawn on.","$ref":"#/components/schemas/FileId"},"versionId":{"description":"The version it was drawn on.","$ref":"#/components/schemas/FileVersionId"}},"required":["annotationId","fileId","versionId"],"description":"What the event carries; for a change, the object as it is after it."}},"required":["v","kind","id","occurredAt","type","payload"]},"ReviewApprovalUpdatedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"type":{"type":"string","const":"review.approval_updated","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"type":"object","properties":{"fileId":{"description":"The file whose approval changed.","$ref":"#/components/schemas/FileId"},"approval":{"anyOf":[{"$ref":"#/components/schemas/PublicApproval"},{"type":"null"}],"description":"The file's approval as it is now; null when the file no longer has one."}},"required":["fileId","approval"],"description":"What the event carries; for a change, the object as it is after it."}},"required":["v","kind","id","occurredAt","type","payload"]},"ReviewCodeSent":{"type":"object","properties":{"emailHint":{"type":"string","minLength":1,"maxLength":320,"description":"The recipient's email, partly hidden, where the code went."},"expiresAt":{"description":"When the code stops working, 10 minutes after it was sent.","$ref":"#/components/schemas/IsoDateTime"}},"required":["emailHint","expiresAt"]},"ReviewCommentCreatedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"type":{"type":"string","const":"review.comment_created","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"type":"object","properties":{"comment":{"description":"The new comment.","$ref":"#/components/schemas/PublicComment"}},"required":["comment"],"description":"What the event carries; for a change, the object as it is after it."}},"required":["v","kind","id","occurredAt","type","payload"]},"ReviewCommentRemovedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"type":{"type":"string","const":"review.comment_removed","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"type":"object","properties":{"commentId":{"description":"The removed comment's id.","$ref":"#/components/schemas/MessageId"},"fileId":{"description":"The file it was written on.","$ref":"#/components/schemas/FileId"}},"required":["commentId","fileId"],"description":"What the event carries; for a change, the object as it is after it."}},"required":["v","kind","id","occurredAt","type","payload"]},"ReviewCommentUpdatedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"type":{"type":"string","const":"review.comment_updated","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"type":"object","properties":{"comment":{"description":"The comment as it is now.","$ref":"#/components/schemas/PublicComment"}},"required":["comment"],"description":"What the event carries; for a change, the object as it is after it."}},"required":["v","kind","id","occurredAt","type","payload"]},"ReviewDecisionBody":{"type":"object","properties":{"round":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"The round you decide on, the file approval's current `round`; another one fails with `state_conflict`."},"decision":{"type":"string","const":"approved","description":"`approved`, the only decision: to ask for changes, comment, and the round stays open until approved."}},"required":["round","decision"],"additionalProperties":false},"ReviewDecisionResult":{"type":"object","properties":{"approval":{"description":"The file's approval after the decision.","$ref":"#/components/schemas/PublicApproval"}},"required":["approval"]},"ReviewFileUpdatedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"type":{"type":"string","const":"review.file_updated","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"type":"object","properties":{"file":{"description":"The file as it is now.","$ref":"#/components/schemas/PublicFile"}},"required":["file"],"description":"What the event carries; for a change, the object as it is after it."}},"required":["v","kind","id","occurredAt","type","payload"]},"ReviewGuest":{"type":"object","properties":{"id":{"description":"The guest's id as a contact.","$ref":"#/components/schemas/GuestContactId"},"name":{"anyOf":[{"type":"string","minLength":1,"maxLength":80},{"type":"null"}],"description":"The guest's name, to prefill the name field; null until the link's issuer or the guest gives one."},"email":{"anyOf":[{"$ref":"#/components/schemas/Email"},{"type":"null"}],"description":"The verified recipient's email; null for anyone else and on a link that requires no code."}},"required":["id","name","email"]},"ReviewPermissions":{"type":"object","properties":{"view":{"type":"boolean","description":"Whether the session sees the files: the recipient, or anyone when the link lets others comment."},"comment":{"type":"boolean","description":"Whether the session may comment on the files."},"annotate":{"type":"boolean","description":"Whether the session may draw annotations on the files."},"decide":{"type":"boolean","description":"Whether the session may approve: the link's recipient only."},"download":{"type":"boolean","description":"Whether the session may download the files: the link's recipient, when the link allows it."}},"required":["view","comment","annotate","decide","download"]},"ReviewRecipient":{"type":"object","properties":{"name":{"anyOf":[{"type":"string","minLength":1,"maxLength":80},{"type":"null"}],"description":"The recipient's name, once the session is the recipient's (its email confirmed with the code, or a name given on a link without one); null before that, for anyone else on the link, and when nobody gave one."},"emailHint":{"type":"string","minLength":1,"maxLength":320,"description":"The recipient's email, partly hidden, where the one-time code goes."}},"required":["name","emailHint"]},"ReviewRole":{"type":"string","enum":["recipient","other"]},"ReviewSession":{"type":"object","properties":{"id":{"description":"The session's id.","$ref":"#/components/schemas/ReviewSessionId"},"organizationName":{"type":"string","minLength":1,"description":"The name of the organization that shared the files."},"role":{"description":"`recipient` once the link's email is confirmed, or on a link without a code once a name is given; `other` before that and for anyone else.","$ref":"#/components/schemas/ReviewRole"},"requiresCode":{"type":"boolean","description":"Whether the recipient confirms their email with a one-time code; when false, the page asks for a name instead."},"recipient":{"description":"Whom the link is for, with their email partly hidden.","$ref":"#/components/schemas/ReviewRecipient"},"guest":{"anyOf":[{"$ref":"#/components/schemas/ReviewGuest"},{"type":"null"}],"description":"Who the session speaks as: the recipient once verified, or whoever gave a name; null before."},"permissions":{"description":"What the session may do; the server checks each again on every request.","$ref":"#/components/schemas/ReviewPermissions"},"expiresAt":{"description":"When the link, and with it the session, expires.","$ref":"#/components/schemas/IsoDateTime"},"files":{"maxItems":50,"type":"array","items":{"$ref":"#/components/schemas/PublicFile"},"description":"The link's files; empty while the session may not view them."}},"required":["id","organizationName","role","requiresCode","recipient","guest","permissions","expiresAt","files"]},"ReviewSessionId":{"type":"string","pattern":"^rvs_[0-9a-hjkmnp-tv-z]{26}$"},"ReviewStreamEvent":{"oneOf":[{"$ref":"#/components/schemas/StreamReadyEvent"},{"$ref":"#/components/schemas/StreamReplayedEvent"},{"$ref":"#/components/schemas/StreamResetEvent"},{"$ref":"#/components/schemas/StreamClosedEvent"},{"$ref":"#/components/schemas/ReviewFileUpdatedEvent"},{"$ref":"#/components/schemas/ReviewCommentCreatedEvent"},{"$ref":"#/components/schemas/ReviewCommentUpdatedEvent"},{"$ref":"#/components/schemas/ReviewCommentRemovedEvent"},{"$ref":"#/components/schemas/ReviewAnnotationCreatedEvent"},{"$ref":"#/components/schemas/ReviewAnnotationDeletedEvent"},{"$ref":"#/components/schemas/ReviewApprovalUpdatedEvent"}]},"ReviewToken":{"type":"string","minLength":1,"maxLength":512},"Revision":{"type":"integer","minimum":1,"maximum":9007199254740991},"RevokeSessionsBody":{"type":"object","properties":{"revokeApiKeys":{"description":"Also revoke every API key the user made, in every organization, so they stop working at once. Leave it out (or false) to keep them.","type":"boolean"},"pauseWebhooks":{"description":"Also turn off every webhook the user added or last pointed at a new address, in every organization, so they stop sending at once; someone who manages webhooks turns them on again. Leave it out (or false) to keep them.","type":"boolean"}},"additionalProperties":false},"SaveDocBody":{"type":"object","properties":{"content":{"description":"The doc's whole content, the editor's JSON.","$ref":"#/components/schemas/DocContent"},"leaseId":{"description":"The lease the editor took (`POST /v0/files/{fileId}/doc/edit`) and saves under.","$ref":"#/components/schemas/DocLeaseId"},"expectedRevision":{"description":"The `revision` you read. If the object changed since, the answer is `409 revision_conflict` and nothing changes.","$ref":"#/components/schemas/Revision"}},"required":["content","leaseId","expectedRevision"],"additionalProperties":false},"SaveFlowBody":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100,"description":"The flow's name, 1 to 100 characters."},"active":{"description":"`true` turns the flow on and `false` pauses it; left out, a new flow is paused and a saved one keeps its state.","type":"boolean"},"start":{"description":"How runs start: by hand, on a schedule, when an event happens, or when a record's date comes due.","$ref":"#/components/schemas/FlowStartInput"},"steps":{"minItems":1,"maxItems":30,"type":"array","items":{"$ref":"#/components/schemas/FlowStepInput"},"description":"The steps in order, 1 to 30; send an existing step's `id` to keep it."},"maxSendBacks":{"description":"How many times a run may send work back, from 0 to 10; left out, 3 on create and unchanged on save.","type":"integer","minimum":0,"maximum":10},"chatId":{"description":"A chat to give the flow, one the caller can see; `null` clears it, and left out, none on create and unchanged on save.","anyOf":[{"$ref":"#/components/schemas/ChatId"},{"type":"null"}]},"expectedRevision":{"description":"The `revision` you read. If the object changed since, the answer is `409 revision_conflict` and nothing changes.","$ref":"#/components/schemas/Revision"}},"required":["name","start","steps","expectedRevision"],"additionalProperties":false},"SearchDocsResult":{"type":"object","properties":{"items":{"maxItems":10,"type":"array","items":{"$ref":"#/components/schemas/DocSearchHit"},"description":"The passages found, best match first."}},"required":["items"]},"SearchMessagesResult":{"type":"object","properties":{"items":{"maxItems":25,"type":"array","items":{"$ref":"#/components/schemas/MessageSearchHit"},"description":"The messages found, newest first."},"more":{"type":"boolean","description":"Whether more messages match than `limit` returned."}},"required":["items","more"]},"SearchRecordsResult":{"type":"object","properties":{"items":{"maxItems":20,"type":"array","items":{"$ref":"#/components/schemas/RecordSearchHit"},"description":"The hits, best first."}},"required":["items"]},"SelectColumn":{"type":"object","properties":{"id":{"description":"The column's id: the key of its cell in each record's `values`.","$ref":"#/components/schemas/ColumnId"},"tableId":{"description":"The table the column belongs to.","$ref":"#/components/schemas/TableId"},"name":{"type":"string","minLength":1,"maxLength":80,"description":"The column's name, shown in its header."},"position":{"description":"The column's place in the table: columns sort by this key, compared as text.","$ref":"#/components/schemas/FractionalIndex"},"readOnly":{"type":"boolean","description":"Whether only the server writes the column's cells; a record write that sets one answers `400 validation_failed`."},"revision":{"description":"Grows by one with every change to the column; send it as `expectedRevision` to change the column.","$ref":"#/components/schemas/Revision"},"type":{"type":"string","const":"select","description":"The column's type, which decides what its cells hold."},"options":{"maxItems":100,"type":"array","items":{"$ref":"#/components/schemas/SelectOption"},"description":"The options a cell picks from, in the order the menu lists them; up to 100."}},"required":["id","tableId","name","position","readOnly","revision","type","options"]},"SelectOption":{"type":"object","properties":{"id":{"description":"The option's id: what a select or multi-select cell stores.","$ref":"#/components/schemas/SelectOptionId"},"label":{"type":"string","minLength":1,"maxLength":80,"description":"The option's text, up to 80 characters, unique within the column whatever the case."},"tone":{"description":"The option's tone: `neutral`, `live`, `warn` or `error`. Stored and returned, but not drawn: every option shows its label alone.","$ref":"#/components/schemas/SelectTone"}},"required":["id","label","tone"]},"SelectOptionId":{"type":"string","pattern":"^opt_[0-9a-hjkmnp-tv-z]{26}$"},"SelectOptionInput":{"type":"object","properties":{"id":{"description":"The id of an existing option, to keep or rename it; left out, the option is added with a new id.","$ref":"#/components/schemas/SelectOptionId"},"label":{"type":"string","minLength":1,"maxLength":80,"description":"The option's text, up to 80 characters, unique within the column whatever the case."},"tone":{"description":"The option's tone: `neutral`, `live`, `warn` or `error`. Stored and returned, but not drawn: every option shows its label alone.","$ref":"#/components/schemas/SelectTone"}},"required":["label","tone"],"additionalProperties":false},"SelectTone":{"type":"string","enum":["neutral","live","warn","error"]},"SendSignInCodeResult":{"type":"object","properties":{"sentTo":{"type":"string","description":"Where the code went, masked (\"l•••@agency.example\")."},"expiresAt":{"description":"When the code stops working.","$ref":"#/components/schemas/IsoDateTime"}},"required":["sentTo","expiresAt"]},"SetAgentsBody":{"type":"object","properties":{"agentIds":{"type":"array","items":{"$ref":"#/components/schemas/AgentId"},"description":"Every agent that may use the connection's tools, each once; empty for none."},"expectedRevision":{"description":"The `revision` you read. If the object changed since, the answer is `409 revision_conflict` and nothing changes.","$ref":"#/components/schemas/Revision"}},"required":["agentIds","expectedRevision"],"additionalProperties":false},"SetToolPoliciesBody":{"type":"object","properties":{"policies":{"type":"array","items":{"$ref":"#/components/schemas/ToolPolicy"},"description":"The policy of each tool, each once; a tool left out asks before running."},"expectedRevision":{"description":"The `revision` you read. If the object changed since, the answer is `409 revision_conflict` and nothing changes.","$ref":"#/components/schemas/Revision"}},"required":["policies","expectedRevision"],"additionalProperties":false},"SetToolPoliciesResult":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/ConnectionTool"},"description":"The connection's tools with their new policies."},"revision":{"description":"The connection's new `revision`, to send as `expectedRevision` with the next change.","$ref":"#/components/schemas/Revision"}},"required":["items","revision"]},"Sha256Hex":{"type":"string","pattern":"^[a-f0-9]{64}$"},"Shape":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"pin","description":"`pin`: a marker on one point of the page."},"x":{"description":"Where the pin is, across the page from 0 (left) to 1 (right).","$ref":"#/components/schemas/PageCoordinate"},"y":{"description":"Where the pin is, down the page from 0 (top) to 1 (bottom).","$ref":"#/components/schemas/PageCoordinate"}},"required":["kind","x","y"]},{"type":"object","properties":{"kind":{"type":"string","const":"freehand","description":"`freehand`: a stroke drawn by hand."},"points":{"minItems":2,"maxItems":2000,"type":"array","items":{"type":"array","prefixItems":[{"$ref":"#/components/schemas/PageCoordinate"},{"$ref":"#/components/schemas/PageCoordinate"}],"items":false,"minItems":2,"maxItems":2},"description":"The stroke as `[x, y]` points in drawing order, each from 0 to 1 of the page; 2 to 2,000 of them."}},"required":["kind","points"]},{"type":"object","properties":{"kind":{"type":"string","enum":["rect","ellipse","line"],"description":"`rect`: a box; `ellipse`: the oval that fills the box; `line`: a straight line between two points."},"x0":{"description":"One corner of the box, or the line's first end, across the page from 0 (left) to 1 (right).","$ref":"#/components/schemas/PageCoordinate"},"y0":{"description":"One corner of the box, or the line's first end, down the page from 0 (top) to 1 (bottom).","$ref":"#/components/schemas/PageCoordinate"},"x1":{"description":"The opposite corner of the box, or the line's other end, across the page from 0 (left) to 1 (right).","$ref":"#/components/schemas/PageCoordinate"},"y1":{"description":"The opposite corner of the box, or the line's other end, down the page from 0 (top) to 1 (bottom).","$ref":"#/components/schemas/PageCoordinate"}},"required":["kind","x0","y0","x1","y1"]}]},"ShareHealthMetrics":{"type":"boolean"},"SidebarColor":{"type":"string","enum":["default","aubergine","ocean","forest","clay"]},"SidebarMode":{"type":"string","enum":["full","icons","hidden"]},"SignInBody":{"type":"object","properties":{"email":{"description":"The address the account signs in with.","$ref":"#/components/schemas/Email"},"password":{"type":"string","minLength":1,"maxLength":128,"description":"The account's password."}},"required":["email","password"],"additionalProperties":false},"SignUpBody":{"type":"object","properties":{"email":{"description":"The address to create the account for; the verification email goes there.","$ref":"#/components/schemas/Email"}},"required":["email"],"additionalProperties":false},"SignUpResult":{"type":"object","properties":{"status":{"type":"string","const":"verification_sent","description":"Always `verification_sent`, whether or not the address already has an account."}},"required":["status"]},"Skill":{"type":"object","properties":{"id":{"description":"The skill's id.","$ref":"#/components/schemas/SkillId"},"organizationId":{"description":"The organization the skill belongs to.","$ref":"#/components/schemas/OrganizationId"},"name":{"type":"string","minLength":1,"maxLength":64,"description":"The skill's name, as its `SKILL.md` front matter carries it."},"description":{"type":"string","minLength":1,"maxLength":300,"description":"What agents see of the skill before they load its body."},"agentIds":{"type":"array","items":{"$ref":"#/components/schemas/AgentId"},"description":"The agents the skill is assigned to, only the agents the reader may view; each loads it whoever mentions the agent."},"currentVersion":{"description":"The version the skill is at now.","$ref":"#/components/schemas/SkillCurrentVersion"},"ownerId":{"description":"The member who owns the skill.","$ref":"#/components/schemas/MemberId"},"createdBy":{"description":"Who created the skill.","$ref":"#/components/schemas/ActorId"},"createdAt":{"description":"When the skill was created.","$ref":"#/components/schemas/IsoDateTime"},"updatedAt":{"description":"When the skill was last changed.","$ref":"#/components/schemas/IsoDateTime"},"revision":{"description":"Grows by one on every change to the skill; send it back as `expectedRevision` when you update it.","$ref":"#/components/schemas/Revision"},"body":{"type":"string","minLength":1,"maxLength":100000,"description":"The skill's current `SKILL.md`, front matter included."},"myAccess":{"description":"What the caller may do with the skill: their access level and actions.","$ref":"#/components/schemas/MyAccess"}},"required":["id","organizationId","name","description","agentIds","currentVersion","ownerId","createdBy","createdAt","updatedAt","revision","body","myAccess"]},"SkillConflict":{"type":"string","enum":["reuse","copy"]},"SkillCreatedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"skill.created","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"description":"What the event carries; for a change, the object as it is after it.","$ref":"#/components/schemas/SkillEventPayload"}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"SkillCreatePreview":{"type":"object","properties":{"kind":{"type":"string","const":"skill_create","description":"Create a skill."},"name":{"type":"string","minLength":1,"maxLength":64,"description":"The new skill's name."},"description":{"type":"string","minLength":1,"maxLength":300,"description":"The new skill's description."},"body":{"type":"string","minLength":1,"maxLength":100000,"description":"The new skill's `SKILL.md`, whole."},"agents":{"maxItems":100,"type":"array","items":{"$ref":"#/components/schemas/PreviewAgentRef"},"description":"The agents it is assigned to."}},"required":["kind","name","description","body","agents"]},"SkillCurrentVersion":{"type":"object","properties":{"id":{"description":"The version's id.","$ref":"#/components/schemas/SkillVersionId"},"number":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"The version number: 1 for the first, one more for every saved change."},"createdAt":{"description":"When the version was saved.","$ref":"#/components/schemas/IsoDateTime"},"createdBy":{"description":"Who saved the version.","$ref":"#/components/schemas/ActorId"}},"required":["id","number","createdAt","createdBy"]},"SkillDeletedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"skill.deleted","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"description":"What the event carries; for a change, the object as it is after it.","$ref":"#/components/schemas/SkillDeletedPayload"}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"SkillDeletedPayload":{"type":"object","properties":{"skillId":{"description":"The deleted skill's id.","$ref":"#/components/schemas/SkillId"}},"required":["skillId"]},"SkillEventPayload":{"type":"object","properties":{"skill":{"description":"The skill after the change.","$ref":"#/components/schemas/SkillWithoutAccess"}},"required":["skill"]},"SkillId":{"type":"string","pattern":"^skill_[0-9a-hjkmnp-tv-z]{26}$"},"SkillSummary":{"type":"object","properties":{"id":{"description":"The skill's id.","$ref":"#/components/schemas/SkillId"},"organizationId":{"description":"The organization the skill belongs to.","$ref":"#/components/schemas/OrganizationId"},"name":{"type":"string","minLength":1,"maxLength":64,"description":"The skill's name, as its `SKILL.md` front matter carries it."},"description":{"type":"string","minLength":1,"maxLength":300,"description":"What agents see of the skill before they load its body."},"agentIds":{"type":"array","items":{"$ref":"#/components/schemas/AgentId"},"description":"The agents the skill is assigned to, only the agents the reader may view; each loads it whoever mentions the agent."},"currentVersion":{"description":"The version the skill is at now.","$ref":"#/components/schemas/SkillCurrentVersion"},"ownerId":{"description":"The member who owns the skill.","$ref":"#/components/schemas/MemberId"},"createdBy":{"description":"Who created the skill.","$ref":"#/components/schemas/ActorId"},"createdAt":{"description":"When the skill was created.","$ref":"#/components/schemas/IsoDateTime"},"updatedAt":{"description":"When the skill was last changed.","$ref":"#/components/schemas/IsoDateTime"},"revision":{"description":"Grows by one on every change to the skill; send it back as `expectedRevision` when you update it.","$ref":"#/components/schemas/Revision"},"myAccess":{"description":"What the caller may do with the skill: their access level and actions.","$ref":"#/components/schemas/MyAccess"}},"required":["id","organizationId","name","description","agentIds","currentVersion","ownerId","createdBy","createdAt","updatedAt","revision","myAccess"]},"SkillSummaryPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/SkillSummary"},"description":"This page of the list."},"nextCursor":{"anyOf":[{"$ref":"#/components/schemas/Cursor"},{"type":"null"}],"description":"Send it back as `cursor` to read the next page; null on the last page."},"totalCount":{"description":"How many items match across every page, among those you may see.","$ref":"#/components/schemas/TotalCount"}},"required":["items","nextCursor","totalCount"]},"SkillUpdatedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"skill.updated","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"description":"What the event carries; for a change, the object as it is after it.","$ref":"#/components/schemas/SkillEventPayload"}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"SkillUpdatePreview":{"type":"object","properties":{"kind":{"type":"string","const":"skill_update","description":"Change a skill."},"skillId":{"description":"The skill it changes.","$ref":"#/components/schemas/SkillId"},"skillName":{"type":"string","description":"The skill's name now."},"name":{"anyOf":[{"$ref":"#/components/schemas/PreviewTextChange"},{"type":"null"}],"description":"The new name; null when it stays."},"description":{"anyOf":[{"$ref":"#/components/schemas/PreviewTextChange"},{"type":"null"}],"description":"The new description; null when it stays."},"body":{"anyOf":[{"$ref":"#/components/schemas/PreviewTextChange"},{"type":"null"}],"description":"The new `SKILL.md`, whole; null when it stays."},"agents":{"anyOf":[{"$ref":"#/components/schemas/PreviewAgentRefsChange"},{"type":"null"}],"description":"The agents it is assigned to and taken from; null when they stay."},"keptAgents":{"anyOf":[{"maxItems":100,"type":"array","items":{"$ref":"#/components/schemas/PreviewAgentRef"}},{"type":"null"}],"description":"Every agent it stays assigned to, whose instructions its new name, description or body change; null when they stay. Set exactly when the name, the description or the body changes."}},"required":["kind","skillId","skillName","name","description","body","agents","keptAgents"]},"SkillVersion":{"type":"object","properties":{"id":{"description":"The version's id.","$ref":"#/components/schemas/SkillVersionId"},"skillId":{"description":"The skill the version belongs to.","$ref":"#/components/schemas/SkillId"},"number":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"The version number: 1 for the first, one more for every saved change."},"name":{"type":"string","description":"The skill's name in this version."},"description":{"type":"string","description":"The skill's description in this version."},"contentHash":{"description":"A SHA-256 digest of the version's content; a save that changes nothing makes no new version.","$ref":"#/components/schemas/Sha256Hex"},"createdBy":{"description":"Who saved the version.","$ref":"#/components/schemas/ActorId"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"The member an agent saved the version for; null when a member saved it."},"createdAt":{"description":"When the version was saved.","$ref":"#/components/schemas/IsoDateTime"},"body":{"type":"string","description":"The skill's full `SKILL.md` in this version, front matter included."}},"required":["id","skillId","number","name","description","contentHash","createdBy","onBehalfOf","createdAt","body"]},"SkillVersionCreatedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"skill.version_created","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"description":"What the event carries; for a change, the object as it is after it.","$ref":"#/components/schemas/SkillEventPayload"}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"SkillVersionId":{"type":"string","pattern":"^skv_[0-9a-hjkmnp-tv-z]{26}$"},"SkillVersionRead":{"type":"object","properties":{"skillId":{"description":"The skill.","$ref":"#/components/schemas/SkillId"},"skillVersionId":{"description":"The version the turn read.","$ref":"#/components/schemas/SkillVersionId"},"number":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"The version's number, counting from 1."}},"required":["skillId","skillVersionId","number"]},"SkillVersionSummary":{"type":"object","properties":{"id":{"description":"The version's id.","$ref":"#/components/schemas/SkillVersionId"},"skillId":{"description":"The skill the version belongs to.","$ref":"#/components/schemas/SkillId"},"number":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"The version number: 1 for the first, one more for every saved change."},"name":{"type":"string","description":"The skill's name in this version."},"description":{"type":"string","description":"The skill's description in this version."},"contentHash":{"description":"A SHA-256 digest of the version's content; a save that changes nothing makes no new version.","$ref":"#/components/schemas/Sha256Hex"},"createdBy":{"description":"Who saved the version.","$ref":"#/components/schemas/ActorId"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"The member an agent saved the version for; null when a member saved it."},"createdAt":{"description":"When the version was saved.","$ref":"#/components/schemas/IsoDateTime"}},"required":["id","skillId","number","name","description","contentHash","createdBy","onBehalfOf","createdAt"]},"SkillVersionSummaryPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/SkillVersionSummary"},"description":"This page of the list."},"nextCursor":{"anyOf":[{"$ref":"#/components/schemas/Cursor"},{"type":"null"}],"description":"Send it back as `cursor` to read the next page; null on the last page."}},"required":["items","nextCursor"]},"SkillWithoutAccess":{"type":"object","properties":{"id":{"description":"The skill's id.","$ref":"#/components/schemas/SkillId"},"organizationId":{"description":"The organization the skill belongs to.","$ref":"#/components/schemas/OrganizationId"},"name":{"type":"string","minLength":1,"maxLength":64,"description":"The skill's name, as its `SKILL.md` front matter carries it."},"description":{"type":"string","minLength":1,"maxLength":300,"description":"What agents see of the skill before they load its body."},"agentIds":{"type":"array","items":{"$ref":"#/components/schemas/AgentId"},"description":"The agents the skill is assigned to, only the agents the reader may view; each loads it whoever mentions the agent."},"currentVersion":{"description":"The version the skill is at now.","$ref":"#/components/schemas/SkillCurrentVersion"},"ownerId":{"description":"The member who owns the skill.","$ref":"#/components/schemas/MemberId"},"createdBy":{"description":"Who created the skill.","$ref":"#/components/schemas/ActorId"},"createdAt":{"description":"When the skill was created.","$ref":"#/components/schemas/IsoDateTime"},"updatedAt":{"description":"When the skill was last changed.","$ref":"#/components/schemas/IsoDateTime"},"revision":{"description":"Grows by one on every change to the skill; send it back as `expectedRevision` when you update it.","$ref":"#/components/schemas/Revision"},"body":{"type":"string","minLength":1,"maxLength":100000,"description":"The skill's current `SKILL.md`, front matter included."}},"required":["id","organizationId","name","description","agentIds","currentVersion","ownerId","createdBy","createdAt","updatedAt","revision","body"]},"SkippedMention":{"type":"object","properties":{"agentId":{"description":"The agent that was mentioned.","$ref":"#/components/schemas/AgentId"},"reason":{"description":"Why it got no turn: `agents_paused` (agents are paused in the chat or the whole organization), `agent_paused`, `agent_archived`, `budget_exceeded`, or `waiting_for_team` (its own turn waits for the agents it asked).","$ref":"#/components/schemas/MentionSkipReason"}},"required":["agentId","reason"]},"SortDirection":{"type":"string","enum":["asc","desc"]},"SortSpec":{"type":"object","properties":{"columnId":{"description":"The column to sort by.","$ref":"#/components/schemas/ColumnId"},"direction":{"description":"`asc` for ascending, `desc` for descending; empty cells come last either way.","$ref":"#/components/schemas/SortDirection"}},"required":["columnId","direction"]},"StartDocRoundBody":{"type":"object","properties":{"docPageIds":{"description":"The pages to approve this round, by id; null for the whole doc; left out to keep the last round's that are still in the doc, or the whole doc when none is.","anyOf":[{"minItems":1,"maxItems":500,"type":"array","items":{"$ref":"#/components/schemas/DocPageId"}},{"type":"null"}]}},"additionalProperties":false},"StartGoogleSignInBody":{"type":"object","properties":{"redirectTo":{"description":"The in-app path to land on once signed in, such as `/chats`; it starts with a single `/`.","$ref":"#/components/schemas/InAppPath"}},"required":["redirectTo"],"additionalProperties":false},"StartGoogleSignInResult":{"type":"object","properties":{"authorizeUrl":{"description":"Google's sign-in page, for the browser to navigate to.","$ref":"#/components/schemas/Url"}},"required":["authorizeUrl"]},"StartRunBody":{"type":"object","properties":{"input":{"description":"Text for the first step to work on, up to 2,000 characters.","type":"string","maxLength":2000}},"additionalProperties":false},"StartSignInBody":{"type":"object","properties":{"expectedRevision":{"description":"The `revision` you read. If the object changed since, the answer is `409 revision_conflict` and nothing changes.","$ref":"#/components/schemas/Revision"}},"required":["expectedRevision"],"additionalProperties":false},"StartSignInResult":{"type":"object","properties":{"authorizeUrl":{"description":"The server's sign-in page for this attempt, to open in a popup: it works once, for 10 minutes, in the browser that asked for it.","$ref":"#/components/schemas/Url"}},"required":["authorizeUrl"]},"StepRun":{"type":"object","properties":{"id":{"description":"The step run's id.","$ref":"#/components/schemas/StepRunId"},"stepId":{"description":"The step it runs, in the flow version the run started with.","$ref":"#/components/schemas/FlowStepId"},"index":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"The step's position in the run's flow version, from 0."},"attempt":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"Which run of this step it is: 1, then one more each time a send-back makes the step run again."},"status":{"description":"`pending` has not started, `running` is working, `waiting` waits on a sign-off or a request card, and `sent_back` sent the work back to an earlier step; `completed`, `failed`, `cancelled` and `skipped` ended.","$ref":"#/components/schemas/StepRunStatus"},"turnId":{"anyOf":[{"$ref":"#/components/schemas/TurnId"},{"type":"null"}],"description":"For an agent step, the agent's turn that does the work; null for a person's sign-off."},"approvalId":{"anyOf":[{"$ref":"#/components/schemas/ApprovalId"},{"type":"null"}],"description":"For a person step, the sign-off approval the person decides; null for an agent step."},"note":{"description":"Why the work was sent back, on the step run that sent it and on the one that runs again; null otherwise.","type":["string","null"]},"startedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}],"description":"When the step run started; null while it is `pending`."},"endedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}],"description":"When the step run ended; null while it is `pending`, `running` or `waiting`."}},"required":["id","stepId","index","attempt","status","turnId","approvalId","note","startedAt","endedAt"]},"StepRunId":{"type":"string","pattern":"^srun_[0-9a-hjkmnp-tv-z]{26}$"},"StepRunStatus":{"type":"string","enum":["pending","running","waiting","completed","sent_back","failed","cancelled","skipped"]},"StorageAmount":{"type":"object","properties":{"count":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many uploads."},"bytes":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Their bytes, at the size each upload declared."}},"required":["count","bytes"]},"StorageKindRow":{"type":"object","properties":{"kind":{"description":"The type of file: `image`, `video`, `pdf`, `document` (an uploaded document such as a slide deck, a spreadsheet or a text file), `doc` (a doc written in Fleepr's editor), `audio` or `other`.","$ref":"#/components/schemas/FileKind"},"files":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many files of this kind the library holds."},"versions":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many versions those files hold."},"bytes":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"The bytes of every version of those files, with their previews."}},"required":["kind","files","versions","bytes"]},"StorageUsage":{"type":"object","properties":{"measuredAt":{"description":"When the usage was measured: on each request.","$ref":"#/components/schemas/IsoDateTime"},"month":{"type":"string","pattern":"^\\d{4}-(0[1-9]|1[0-2])$","description":"The calendar month `addedThisMonthBytes` counts, as `YYYY-MM` in the organization's time zone."},"totalBytes":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Everything stored: the library's `bytes` plus the bytes of every `uploads` amount."},"addedThisMonthBytes":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"The bytes that reached storage in `month`: every upload completed and every preview stored, still kept or not."},"library":{"type":"object","properties":{"files":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many files the library holds, deleted ones left out."},"versions":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many versions those files hold."},"bytes":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"The bytes of every version of those files, with their previews."},"renditionBytes":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"The part of `bytes` that previews take: page images, posters and thumbnails."}},"required":["files","versions","bytes","renditionBytes"],"description":"The library's live files, their versions and their bytes."},"byKind":{"type":"array","items":{"$ref":"#/components/schemas/StorageKindRow"},"description":"The library split by file kind, one row per kind, empty ones included; the rows add up to `library`."},"uploads":{"type":"object","properties":{"inProgress":{"description":"Uploads started and not completed yet.","$ref":"#/components/schemas/StorageAmount"},"held":{"description":"Completed uploads that no file version holds: profile photos, a voice note's audio until it is transcribed, a version not added yet.","$ref":"#/components/schemas/StorageAmount"},"awaitingCleanup":{"description":"Discarded or expired uploads and those of deleted files, until the hourly cleanup has cleared them.","$ref":"#/components/schemas/StorageAmount"}},"required":["inProgress","held","awaitingCleanup"],"description":"Bytes held outside the library, at the size each upload declared."}},"required":["measuredAt","month","totalBytes","addedThisMonthBytes","library","byKind","uploads"]},"StreamClosedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"control","description":"A control event: about the stream itself, not the data."},"type":{"type":"string","const":"stream.closed","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"type":"object","properties":{"reason":{"description":"Why the server closes the stream.","$ref":"#/components/schemas/StreamClosedReason"},"retryable":{"type":"boolean","description":"Whether to reconnect: true for a passing reason such as a deploy; false when access ended."}},"required":["reason","retryable"],"description":"What the event carries; for a change, the object as it is after it."}},"required":["v","kind","type","payload"]},"StreamClosedReason":{"type":"string","enum":["access_revoked","object_deleted","session_revoked","member_deactivated","link_invalid","api_key_invalid","shutdown","capacity"]},"StreamReadyEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"control","description":"A control event: about the stream itself, not the data."},"type":{"type":"string","const":"stream.ready","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"type":"object","properties":{"protocol":{"type":"number","const":0,"description":"The version of the stream protocol."},"scope":{"description":"What the stream follows.","$ref":"#/components/schemas/StreamScope"},"resumedFrom":{"anyOf":[{"$ref":"#/components/schemas/EventId"},{"type":"null"}],"description":"The `Last-Event-ID` the stream resumes after; null on a first connection."},"head":{"description":"The newest event id of the stream when it opened.","$ref":"#/components/schemas/EventId"},"heartbeatSeconds":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"How often the server pings; a client that hears nothing for three pings reconnects."}},"required":["protocol","scope","resumedFrom","head","heartbeatSeconds"],"description":"What the event carries; for a change, the object as it is after it."}},"required":["v","kind","type","payload"]},"StreamReplayedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"control","description":"A control event: about the stream itself, not the data."},"type":{"type":"string","const":"stream.replayed","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"type":"object","properties":{"count":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many missed events were sent again."}},"required":["count"],"description":"What the event carries; for a change, the object as it is after it."}},"required":["v","kind","type","payload"]},"StreamResetEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"control","description":"A control event: about the stream itself, not the data."},"type":{"type":"string","const":"stream.reset","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"type":"object","properties":{"reason":{"description":"Why the stream cannot catch up: an unknown id (`cursor_unknown`), one too old (`cursor_expired`) or too many missed events (`too_far_behind`).","$ref":"#/components/schemas/StreamResetReason"},"head":{"description":"The newest event id: read what you show again, then follow from here.","$ref":"#/components/schemas/EventId"}},"required":["reason","head"],"description":"What the event carries; for a change, the object as it is after it."}},"required":["v","kind","type","payload"]},"StreamResetReason":{"type":"string","enum":["cursor_unknown","cursor_expired","too_far_behind"]},"StreamScope":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"org","description":"The organization's stream."},"organizationId":{"description":"The organization's id.","$ref":"#/components/schemas/OrganizationId"}},"required":["kind","organizationId"]},{"type":"object","properties":{"kind":{"type":"string","const":"chat","description":"A chat's stream."},"chatId":{"description":"The chat's id.","$ref":"#/components/schemas/ChatId"}},"required":["kind","chatId"]},{"type":"object","properties":{"kind":{"type":"string","const":"file","description":"A file's stream."},"fileId":{"description":"The file's id.","$ref":"#/components/schemas/FileId"}},"required":["kind","fileId"]},{"type":"object","properties":{"kind":{"type":"string","const":"review","description":"The public review stream of an approval link."}},"required":["kind"]}]},"SubmitFormBody":{"type":"object","properties":{"session":{"description":"The session that opening the form answered.","$ref":"#/components/schemas/FormSession"},"values":{"type":"object","propertyNames":{"$ref":"#/components/schemas/ColumnId"},"additionalProperties":{},"description":"The answers, by the questions' column ids, each as its cell (a file question's answer: the ids of the uploads this session completed for it)."},"respondent":{"anyOf":[{"$ref":"#/components/schemas/FormRespondentInput"},{"type":"null"}],"description":"The respondent's name and email when the form asks for them (`askRespondent`); else null."},"website":{"type":"string","maxLength":2000,"description":"A field the page hides and leaves empty. Send an empty string."},"challenge":{"description":"A busy link's check: the token Turnstile gave after a `rate_limited` answer asked for it.","$ref":"#/components/schemas/FormChallengeToken"}},"required":["session","values","respondent","website"],"additionalProperties":false},"SubmitFormResult":{"type":"object","properties":{"thankYou":{"type":"string","maxLength":1000,"description":"What the page shows once the response is sent."},"allowAnother":{"type":"boolean","description":"Whether the page offers \"Submit another response\"."}},"required":["thankYou","allowAnother"]},"SystemColumn":{"type":"object","properties":{"id":{"description":"The column's id: the key of its cell in each record's `values`.","$ref":"#/components/schemas/ColumnId"},"tableId":{"description":"The table the column belongs to.","$ref":"#/components/schemas/TableId"},"name":{"type":"string","minLength":1,"maxLength":80,"description":"The column's name, shown in its header."},"position":{"description":"The column's place in the table: columns sort by this key, compared as text.","$ref":"#/components/schemas/FractionalIndex"},"readOnly":{"type":"boolean","const":true,"description":"Always true: the server computes these cells from the record."},"revision":{"description":"Grows by one with every change to the column; send it as `expectedRevision` to change the column.","$ref":"#/components/schemas/Revision"},"type":{"description":"What the server fills each cell with: `created_at` and `updated_at`, when the record was created and last edited; `created_by` and `updated_by`, who did it.","$ref":"#/components/schemas/SystemColumnType"}},"required":["id","tableId","name","position","readOnly","revision","type"]},"SystemColumnType":{"type":"string","enum":["created_at","created_by","updated_at","updated_by"]},"Table":{"type":"object","properties":{"id":{"description":"The table's id.","$ref":"#/components/schemas/TableId"},"organizationId":{"description":"The organization the table belongs to.","$ref":"#/components/schemas/OrganizationId"},"name":{"type":"string","minLength":1,"maxLength":120,"description":"The table's name, up to 120 characters."},"about":{"type":"string","maxLength":2000,"description":"The table's description, up to 2,000 characters; empty when it has none."},"recordCount":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many records the table holds."},"columnCount":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many columns the table has, system columns included."},"visibility":{"description":"`organization`: every member of the organization can view the table; `private`: only its owner, those it is shared with, and the organization's owner and admins.","$ref":"#/components/schemas/Visibility"},"ownerId":{"description":"The member who owns the table; members who cannot edit it ask them for access.","$ref":"#/components/schemas/MemberId"},"createdBy":{"description":"Who created the table: a member, an agent or the system.","$ref":"#/components/schemas/ActorId"},"createdAt":{"description":"When the table was created.","$ref":"#/components/schemas/IsoDateTime"},"updatedAt":{"description":"When the table or its columns last changed, a record added or deleted included; editing a record's cells does not change it.","$ref":"#/components/schemas/IsoDateTime"},"revision":{"description":"Grows with every change of the table or its columns and every record added or deleted, but not when a record's cells are edited; send it as `expectedRevision` to update the table.","$ref":"#/components/schemas/Revision"},"updatedBy":{"description":"Who last changed the table: a member, an agent or the system.","$ref":"#/components/schemas/ActorId"},"sizeBytes":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How much storage the table's cells take, in bytes."},"primaryColumnId":{"description":"The text column whose value labels each record: the record's title and its link pills.","$ref":"#/components/schemas/ColumnId"},"columns":{"type":"array","items":{"$ref":"#/components/schemas/Column"},"description":"The table's columns, in order."},"linksOut":{"type":"array","items":{"$ref":"#/components/schemas/TableLinkOut"},"description":"The link columns of this table and the tables they point at; tables the caller cannot view are left out."},"linksIn":{"type":"array","items":{"$ref":"#/components/schemas/TableLinkIn"},"description":"The link columns of other tables that point at this one; tables the caller cannot view are left out."},"sourceChatId":{"anyOf":[{"$ref":"#/components/schemas/ChatId"},{"type":"null"}],"description":"The chat where an agent's request created the table; null for a table created any other way, in a chat a flow made, or in a chat the caller may not view."},"accessSummary":{"description":"How many people, agents and invited people can access the table, with a few of them to show.","$ref":"#/components/schemas/AccessSummary"},"myAccess":{"description":"What the caller may do with the table: `edit` writes records, `edit_columns` changes columns, and so on.","$ref":"#/components/schemas/MyAccess"}},"required":["id","organizationId","name","about","recordCount","columnCount","visibility","ownerId","createdBy","createdAt","updatedAt","revision","updatedBy","sizeBytes","primaryColumnId","columns","linksOut","linksIn","sourceChatId","accessSummary","myAccess"]},"TableCardBlock":{"type":"object","properties":{"kind":{"type":"string","const":"table_card","description":"A live view of table rows."},"id":{"description":"The card's id: its preview in `included.tableCards` carries it, and answering its choice names it.","$ref":"#/components/schemas/BlockId"},"tableId":{"description":"The table the card shows.","$ref":"#/components/schemas/TableId"},"title":{"anyOf":[{"type":"string","minLength":1,"maxLength":120},{"type":"null"}],"description":"The card's heading, such as \"Budget by piece\"; null shows the table's name."},"view":{"anyOf":[{"$ref":"#/components/schemas/TableView"},{"type":"null"}],"description":"The search, filter and sort the card applies; null for none."},"viewLabel":{"anyOf":[{"type":"string","minLength":1,"maxLength":80},{"type":"null"}],"description":"A short label for the view, such as \"Filter: Black Friday\"; null for none."},"columnIds":{"anyOf":[{"minItems":1,"maxItems":12,"type":"array","items":{"$ref":"#/components/schemas/ColumnId"}},{"type":"null"}],"description":"The columns shown, in order; null shows the table's first columns."},"recordIds":{"anyOf":[{"minItems":1,"maxItems":50,"type":"array","items":{"$ref":"#/components/schemas/RecordId"}},{"type":"null"}],"description":"Rows pinned to the card; null shows the rows its view finds."},"maxRows":{"type":"integer","minimum":1,"maximum":20,"description":"The most rows the card shows."},"aggregates":{"type":"array","items":{"$ref":"#/components/schemas/CardAggregate"},"description":"The card's totals row: which columns, and how."},"footer":{"anyOf":[{"$ref":"#/components/schemas/CardFooter"},{"type":"null"}],"description":"A question under the card: a request card or a choice; null for none."}},"required":["kind","id","tableId","title","view","viewLabel","columnIds","recordIds","maxRows","aggregates","footer"]},"TableCardPreview":{"type":"object","properties":{"blockId":{"description":"The table card this preview is for.","$ref":"#/components/schemas/BlockId"},"tableId":{"description":"The table it shows.","$ref":"#/components/schemas/TableId"},"name":{"type":"string","description":"The table's name."},"recordCount":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many rows the table holds in all."},"matchCount":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many rows match the card's view."},"columns":{"type":"array","items":{"$ref":"#/components/schemas/Column"},"description":"The columns shown, in order."},"records":{"maxItems":20,"type":"array","items":{"$ref":"#/components/schemas/TableRecord"},"description":"The rows shown, at most the card's `maxRows`."},"linkedRecords":{"type":"array","items":{"$ref":"#/components/schemas/LinkedRecordLabel"},"description":"The labels of the rows that linked-record cells of the shown rows point to."},"files":{"type":"array","items":{"$ref":"#/components/schemas/FileSummary"},"description":"The files in the attachments cells of the shown rows; a file the caller may not view is left out, so show it as unavailable."},"aggregateValues":{"type":"array","items":{"$ref":"#/components/schemas/CardAggregateValue"},"description":"The totals row's values, one per total."},"canOpen":{"type":"boolean","description":"Whether the caller may open the table in full."}},"required":["blockId","tableId","name","recordCount","matchCount","columns","records","linkedRecords","files","aggregateValues","canOpen"]},"TableCreatedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"table.created","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"description":"What the event carries; for a change, the object as it is after it.","$ref":"#/components/schemas/TablePayload"}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"TableCreatePreview":{"type":"object","properties":{"kind":{"type":"string","const":"table_create","description":"Create a table."},"name":{"type":"string","description":"The new table's name."},"about":{"description":"The new table's description, or null.","type":["string","null"]},"visibility":{"description":"Who will view the new table: `organization` (every member) or `private` (its owner and its grants).","$ref":"#/components/schemas/Visibility"},"columns":{"minItems":1,"maxItems":50,"type":"array","items":{"$ref":"#/components/schemas/PreviewNewColumn"},"description":"The columns to create, in order."},"sampleRows":{"maxItems":5,"type":"array","items":{"type":"array","items":{"type":"string"}},"description":"Up to 5 sample rows, each as display text in column order."}},"required":["kind","name","about","visibility","columns","sampleRows"]},"TableDeletedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"table.deleted","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"description":"What the event carries; for a change, the object as it is after it.","$ref":"#/components/schemas/TableDeletedPayload"}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"TableDeletedPayload":{"type":"object","properties":{"tableId":{"description":"The table that was deleted.","$ref":"#/components/schemas/TableId"}},"required":["tableId"]},"TableId":{"type":"string","pattern":"^tbl_[0-9a-hjkmnp-tv-z]{26}$"},"TableLinkIn":{"type":"object","properties":{"tableId":{"description":"The table that links here.","$ref":"#/components/schemas/TableId"},"tableName":{"type":"string","description":"That table's name."},"columnId":{"description":"The link column of that table that points at this one.","$ref":"#/components/schemas/ColumnId"}},"required":["tableId","tableName","columnId"]},"TableLinkOut":{"type":"object","properties":{"columnId":{"description":"The link column of this table.","$ref":"#/components/schemas/ColumnId"},"tableId":{"description":"The table the column links to.","$ref":"#/components/schemas/TableId"},"tableName":{"type":"string","description":"That table's name."}},"required":["columnId","tableId","tableName"]},"TableListFacets":{"type":"object","properties":{"all":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Every table the caller can view, with no search and no filter."},"owner":{"type":"object","properties":{"me":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"The tables the caller owns that match the search."},"others":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"The tables other members own that the caller can view and that match the search."}},"required":["me","others"],"description":"How many tables each `owner` option would list, under the same search."}},"required":["all","owner"]},"TableListOwner":{"type":"string","enum":["me","others"]},"TableListSort":{"type":"string","enum":["name_asc","name_desc","newest","oldest"]},"TableNaming":{"type":"object","properties":{"nameColumnId":{"description":"The column people call a record by: a text column, the table's primary column unless someone chose another.","$ref":"#/components/schemas/ColumnId"},"identifierColumnIds":{"maxItems":3,"type":"array","items":{"$ref":"#/components/schemas/ColumnId"},"description":"Other columns that identify a record (a code, an email, a domain), at most 3: text, email or url columns, in order, never the name column."}},"required":["nameColumnId","identifierColumnIds"]},"TableNamingInput":{"type":"object","properties":{"nameColumnId":{"anyOf":[{"$ref":"#/components/schemas/ColumnId"},{"type":"null"}],"description":"The text column people call a record by; null is the table's primary column."},"identifierColumnIds":{"maxItems":3,"type":"array","items":{"$ref":"#/components/schemas/ColumnId"},"description":"Other text, email or url columns that identify a record, at most 3, distinct, never the name column."}},"required":["nameColumnId","identifierColumnIds"],"additionalProperties":false},"TableNamingOption":{"type":"object","properties":{"columnId":{"description":"The column's id.","$ref":"#/components/schemas/ColumnId"},"name":{"type":"string","description":"The column's name."},"type":{"description":"The column's type: only a text column names a record.","$ref":"#/components/schemas/NamingColumnType"},"isPrimary":{"type":"boolean","description":"Whether it is the table's primary column."}},"required":["columnId","name","type","isPrimary"]},"TablePayload":{"type":"object","properties":{"table":{"description":"The table after the change, without `myAccess`: get the table to learn what the caller may do.","$ref":"#/components/schemas/TableWithoutAccess"}},"required":["table"]},"TablePreview":{"type":"object","properties":{"columns":{"maxItems":3,"type":"array","items":{"$ref":"#/components/schemas/Column"},"description":"The table's first 3 columns, in order."},"records":{"maxItems":3,"type":"array","items":{"$ref":"#/components/schemas/TableRecord"},"description":"The table's first 3 records in table order, each with every cell, as the record list sends them."},"included":{"description":"The labels of the records and the files that the cells of the 3 columns shown point at; those the caller cannot view are left out.","$ref":"#/components/schemas/RecordIncluded"}},"required":["columns","records","included"]},"TableProfile":{"type":"object","properties":{"tableId":{"description":"The table it describes.","$ref":"#/components/schemas/TableId"},"organizationId":{"description":"The organization it belongs to.","$ref":"#/components/schemas/OrganizationId"},"tableName":{"type":"string","description":"The table's name."},"role":{"anyOf":[{"$ref":"#/components/schemas/TableRole"},{"type":"null"}],"description":"What the table is for; null while it is unclear."},"roleSource":{"description":"Whether a person confirmed the role.","$ref":"#/components/schemas/TableProfileSource"},"about":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"description":"The table's description, the same text as its Details (`Table.about`, up to 2,000 characters); null when it has none."},"aboutSource":{"description":"Whether a person wrote or confirmed the description (an empty one confirmed means \"none\").","$ref":"#/components/schemas/TableProfileSource"},"suggestedAbout":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}],"description":"Fleepr's suggested description, while the table has none and no person confirmed the field; null otherwise."},"aliases":{"maxItems":10,"type":"array","items":{"type":"string","minLength":1,"maxLength":40},"description":"Other words people use for the table, such as \"brand\" for Clients."},"aliasesSource":{"description":"Whether a person wrote or confirmed the other words.","$ref":"#/components/schemas/TableProfileSource"},"suggestedAliases":{"maxItems":5,"type":"array","items":{"type":"string","minLength":1,"maxLength":40},"description":"Other words Fleepr suggests, while no person confirmed the field; empty otherwise."},"naming":{"description":"The columns its records are named by and found by.","$ref":"#/components/schemas/TableNaming"},"namingSource":{"description":"Whether a person chose or confirmed the naming.","$ref":"#/components/schemas/TableProfileSource"},"namingOptions":{"type":"array","items":{"$ref":"#/components/schemas/TableNamingOption"},"description":"The columns the naming may use: the table's text, email and url columns, in order."},"source":{"description":"`suggested` exactly when a field holds a suggestion that waits for a person: a suggested role that is set, a suggested description or other words, or a suggested naming other than the primary column alone; `confirmed` otherwise.","$ref":"#/components/schemas/TableProfileSource"},"confirmedBy":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"The person who last edited the profile in Health; null when nobody has."},"facts":{"description":"Numbers about the table, as the nightly check last measured them.","$ref":"#/components/schemas/TableProfileFacts"},"updatedAt":{"description":"When it last changed.","$ref":"#/components/schemas/IsoDateTime"},"revision":{"description":"The profile's revision.","$ref":"#/components/schemas/Revision"},"viewer":{"description":"What the caller may do with the profile.","$ref":"#/components/schemas/TableProfileViewer"}},"required":["tableId","organizationId","tableName","role","roleSource","about","aboutSource","suggestedAbout","aliases","aliasesSource","suggestedAliases","naming","namingSource","namingOptions","source","confirmedBy","facts","updatedAt","revision","viewer"]},"TableProfileEventPayload":{"type":"object","properties":{"profile":{"description":"The profile as it is now.","$ref":"#/components/schemas/TableProfileWithoutViewer"}},"required":["profile"]},"TableProfileFacts":{"type":"object","properties":{"recordCount":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many records the table holds."},"recordsAddedLast30Days":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many records were added in the last 30 days."},"fillRate":{"anyOf":[{"type":"number","minimum":0,"maximum":1},{"type":"null"}],"description":"The share of filled cells across its fields, from 0 to 1; null for a table without records."},"linkedFromCount":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many other tables link to it, of those the caller may view (in `table_profile.updated`, of those the whole organization may view)."},"linksToCount":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many other tables it links to."}},"required":["recordCount","recordsAddedLast30Days","fillRate","linkedFromCount","linksToCount"]},"TableProfileField":{"type":"string","enum":["role","about","aliases","naming"]},"TableProfilePage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/TableProfile"},"description":"This page of the list."},"nextCursor":{"anyOf":[{"$ref":"#/components/schemas/Cursor"},{"type":"null"}],"description":"Send it back as `cursor` to read the next page; null on the last page."}},"required":["items","nextCursor"]},"TableProfileSource":{"type":"string","enum":["suggested","confirmed"]},"TableProfileUpdatedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"table_profile.updated","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"description":"What the event carries; for a change, the object as it is after it.","$ref":"#/components/schemas/TableProfileEventPayload"}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"TableProfileViewer":{"type":"object","properties":{"canEdit":{"type":"boolean","description":"Whether the caller may edit the profile (the owner and admins). Its description also asks edit on the table (the owner and admins hold it on every table); without it the write answers 403."}},"required":["canEdit"]},"TableProfileWithoutViewer":{"type":"object","properties":{"tableId":{"description":"The table it describes.","$ref":"#/components/schemas/TableId"},"organizationId":{"description":"The organization it belongs to.","$ref":"#/components/schemas/OrganizationId"},"tableName":{"type":"string","description":"The table's name."},"role":{"anyOf":[{"$ref":"#/components/schemas/TableRole"},{"type":"null"}],"description":"What the table is for; null while it is unclear."},"roleSource":{"description":"Whether a person confirmed the role.","$ref":"#/components/schemas/TableProfileSource"},"about":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"description":"The table's description, the same text as its Details (`Table.about`, up to 2,000 characters); null when it has none."},"aboutSource":{"description":"Whether a person wrote or confirmed the description (an empty one confirmed means \"none\").","$ref":"#/components/schemas/TableProfileSource"},"suggestedAbout":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}],"description":"Fleepr's suggested description, while the table has none and no person confirmed the field; null otherwise."},"aliases":{"maxItems":10,"type":"array","items":{"type":"string","minLength":1,"maxLength":40},"description":"Other words people use for the table, such as \"brand\" for Clients."},"aliasesSource":{"description":"Whether a person wrote or confirmed the other words.","$ref":"#/components/schemas/TableProfileSource"},"suggestedAliases":{"maxItems":5,"type":"array","items":{"type":"string","minLength":1,"maxLength":40},"description":"Other words Fleepr suggests, while no person confirmed the field; empty otherwise."},"naming":{"description":"The columns its records are named by and found by.","$ref":"#/components/schemas/TableNaming"},"namingSource":{"description":"Whether a person chose or confirmed the naming.","$ref":"#/components/schemas/TableProfileSource"},"namingOptions":{"type":"array","items":{"$ref":"#/components/schemas/TableNamingOption"},"description":"The columns the naming may use: the table's text, email and url columns, in order."},"source":{"description":"`suggested` exactly when a field holds a suggestion that waits for a person: a suggested role that is set, a suggested description or other words, or a suggested naming other than the primary column alone; `confirmed` otherwise.","$ref":"#/components/schemas/TableProfileSource"},"confirmedBy":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"The person who last edited the profile in Health; null when nobody has."},"facts":{"description":"Numbers about the table, as the nightly check last measured them.","$ref":"#/components/schemas/TableProfileFacts"},"updatedAt":{"description":"When it last changed.","$ref":"#/components/schemas/IsoDateTime"},"revision":{"description":"The profile's revision.","$ref":"#/components/schemas/Revision"}},"required":["tableId","organizationId","tableName","role","roleSource","about","aboutSource","suggestedAbout","aliases","aliasesSource","suggestedAliases","naming","namingSource","namingOptions","source","confirmedBy","facts","updatedAt","revision"]},"TableRecord":{"type":"object","properties":{"id":{"description":"The record's id.","$ref":"#/components/schemas/RecordId"},"tableId":{"description":"The table the record belongs to.","$ref":"#/components/schemas/TableId"},"position":{"description":"The record's place in table order: records sort by this key, compared as text.","$ref":"#/components/schemas/FractionalIndex"},"values":{"description":"Every cell of the record, by column id. An empty cell is null, false for a checkbox, and an empty list for multi-select, link and attachment cells.","$ref":"#/components/schemas/RecordValues"},"label":{"type":"string","description":"The text of the table's primary column: the record's title and link pill."},"createdAt":{"description":"When the record was created.","$ref":"#/components/schemas/IsoDateTime"},"createdBy":{"description":"Who created the record: a member, an agent or the system.","$ref":"#/components/schemas/ActorId"},"updatedAt":{"description":"When a cell of the record last changed.","$ref":"#/components/schemas/IsoDateTime"},"updatedBy":{"description":"Who last changed a cell of the record: a member, an agent or the system.","$ref":"#/components/schemas/ActorId"},"revision":{"description":"Grows by one with every change; send it as `expectedRevision` to refuse an update if the record changed since.","$ref":"#/components/schemas/Revision"},"submission":{"description":"How the record came from a form, or null when it did not (always sent; absent only on a record an older event carries). A record someone outside sent is created by the system actor, and its Created by shows the respondent's name, else their email, else \"Anonymous\".","anyOf":[{"$ref":"#/components/schemas/RecordSubmission"},{"type":"null"}]}},"required":["id","tableId","position","values","label","createdAt","createdBy","updatedAt","updatedBy","revision"]},"TableRole":{"type":"string","enum":["hub","activity","options"]},"TableSummary":{"type":"object","properties":{"id":{"description":"The table's id.","$ref":"#/components/schemas/TableId"},"organizationId":{"description":"The organization the table belongs to.","$ref":"#/components/schemas/OrganizationId"},"name":{"type":"string","minLength":1,"maxLength":120,"description":"The table's name, up to 120 characters."},"about":{"type":"string","maxLength":2000,"description":"The table's description, up to 2,000 characters; empty when it has none."},"recordCount":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many records the table holds."},"columnCount":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many columns the table has, system columns included."},"visibility":{"description":"`organization`: every member of the organization can view the table; `private`: only its owner, those it is shared with, and the organization's owner and admins.","$ref":"#/components/schemas/Visibility"},"ownerId":{"description":"The member who owns the table; members who cannot edit it ask them for access.","$ref":"#/components/schemas/MemberId"},"createdBy":{"description":"Who created the table: a member, an agent or the system.","$ref":"#/components/schemas/ActorId"},"createdAt":{"description":"When the table was created.","$ref":"#/components/schemas/IsoDateTime"},"updatedAt":{"description":"When the table or its columns last changed, a record added or deleted included; editing a record's cells does not change it.","$ref":"#/components/schemas/IsoDateTime"},"revision":{"description":"Grows with every change of the table or its columns and every record added or deleted, but not when a record's cells are edited; send it as `expectedRevision` to update the table.","$ref":"#/components/schemas/Revision"},"updatedBy":{"description":"Who last changed the table: a member, an agent or the system.","$ref":"#/components/schemas/ActorId"},"preview":{"description":"A preview of the table's first 3 columns and records, to show it as a card; empty lists when it has none.","$ref":"#/components/schemas/TablePreview"},"myAccess":{"description":"What the caller may do with the table: `edit` writes records, `edit_columns` changes columns, and so on.","$ref":"#/components/schemas/MyAccess"}},"required":["id","organizationId","name","about","recordCount","columnCount","visibility","ownerId","createdBy","createdAt","updatedAt","revision","updatedBy","preview","myAccess"]},"TableSummaryPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/TableSummary"},"description":"This page of the list."},"nextCursor":{"anyOf":[{"$ref":"#/components/schemas/Cursor"},{"type":"null"}],"description":"Send it back as `cursor` to read the next page; null on the last page."},"totalCount":{"description":"How many items match across every page, among those you may see.","$ref":"#/components/schemas/TotalCount"},"facets":{"description":"Counts for the `owner` filter; only on the first page of a request that sends `facets=true`.","$ref":"#/components/schemas/TableListFacets"}},"required":["items","nextCursor","totalCount"]},"TableUpdatedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"table.updated","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"description":"What the event carries; for a change, the object as it is after it.","$ref":"#/components/schemas/TablePayload"}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"TableView":{"type":"object","properties":{"search":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"description":"Text to find in any cell of a record, ignoring case and accents, up to 200 characters; null for no search."},"filter":{"maxItems":20,"type":"array","items":{"$ref":"#/components/schemas/FilterCondition"},"description":"Up to 20 conditions, which a record must all meet."},"sort":{"anyOf":[{"$ref":"#/components/schemas/SortSpec"},{"type":"null"}],"description":"The one column to sort by; null keeps table order, which also breaks ties."}},"required":["search","filter","sort"]},"TableWithoutAccess":{"type":"object","properties":{"id":{"description":"The table's id.","$ref":"#/components/schemas/TableId"},"organizationId":{"description":"The organization the table belongs to.","$ref":"#/components/schemas/OrganizationId"},"name":{"type":"string","minLength":1,"maxLength":120,"description":"The table's name, up to 120 characters."},"about":{"type":"string","maxLength":2000,"description":"The table's description, up to 2,000 characters; empty when it has none."},"recordCount":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many records the table holds."},"columnCount":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many columns the table has, system columns included."},"visibility":{"description":"`organization`: every member of the organization can view the table; `private`: only its owner, those it is shared with, and the organization's owner and admins.","$ref":"#/components/schemas/Visibility"},"ownerId":{"description":"The member who owns the table; members who cannot edit it ask them for access.","$ref":"#/components/schemas/MemberId"},"createdBy":{"description":"Who created the table: a member, an agent or the system.","$ref":"#/components/schemas/ActorId"},"createdAt":{"description":"When the table was created.","$ref":"#/components/schemas/IsoDateTime"},"updatedAt":{"description":"When the table or its columns last changed, a record added or deleted included; editing a record's cells does not change it.","$ref":"#/components/schemas/IsoDateTime"},"revision":{"description":"Grows with every change of the table or its columns and every record added or deleted, but not when a record's cells are edited; send it as `expectedRevision` to update the table.","$ref":"#/components/schemas/Revision"},"updatedBy":{"description":"Who last changed the table: a member, an agent or the system.","$ref":"#/components/schemas/ActorId"},"sizeBytes":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How much storage the table's cells take, in bytes."},"primaryColumnId":{"description":"The text column whose value labels each record: the record's title and its link pills.","$ref":"#/components/schemas/ColumnId"},"columns":{"type":"array","items":{"$ref":"#/components/schemas/Column"},"description":"The table's columns, in order."},"linksOut":{"type":"array","items":{"$ref":"#/components/schemas/TableLinkOut"},"description":"The link columns of this table and the tables they point at; tables the caller cannot view are left out."},"linksIn":{"type":"array","items":{"$ref":"#/components/schemas/TableLinkIn"},"description":"The link columns of other tables that point at this one; tables the caller cannot view are left out."},"sourceChatId":{"anyOf":[{"$ref":"#/components/schemas/ChatId"},{"type":"null"}],"description":"The chat where an agent's request created the table; null for a table created any other way, in a chat a flow made, or in a chat the caller may not view."},"accessSummary":{"description":"How many people, agents and invited people can access the table, with a few of them to show.","$ref":"#/components/schemas/AccessSummary"}},"required":["id","organizationId","name","about","recordCount","columnCount","visibility","ownerId","createdBy","createdAt","updatedAt","revision","updatedBy","sizeBytes","primaryColumnId","columns","linksOut","linksIn","sourceChatId","accessSummary"]},"Team":{"type":"object","properties":{"id":{"description":"The team's id.","$ref":"#/components/schemas/TeamId"},"organizationId":{"description":"The organization the team belongs to.","$ref":"#/components/schemas/OrganizationId"},"name":{"type":"string","minLength":1,"maxLength":60,"description":"The team's name, unique in the organization, ignoring case."},"about":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"description":"What the team does; null when it has no description."},"actorIds":{"type":"array","items":{"$ref":"#/components/schemas/ActorId"},"description":"The people and agents in the team; removed members and deleted agents are left out."},"createdAt":{"description":"When the team was created.","$ref":"#/components/schemas/IsoDateTime"},"updatedAt":{"description":"When the team was last changed.","$ref":"#/components/schemas/IsoDateTime"},"revision":{"description":"Grows by one on every change to the team; send it back as `expectedRevision` when you update it.","$ref":"#/components/schemas/Revision"}},"required":["id","organizationId","name","about","actorIds","createdAt","updatedAt","revision"]},"TeamCreatedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"team.created","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"description":"What the event carries; for a change, the object as it is after it.","$ref":"#/components/schemas/TeamEventPayload"}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"TeamDeletedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"team.deleted","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"description":"What the event carries; for a change, the object as it is after it.","$ref":"#/components/schemas/TeamDeletedPayload"}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"TeamDeletedPayload":{"type":"object","properties":{"teamId":{"description":"The deleted team's id.","$ref":"#/components/schemas/TeamId"}},"required":["teamId"]},"TeamEventPayload":{"type":"object","properties":{"team":{"description":"The team after the change.","$ref":"#/components/schemas/Team"}},"required":["team"]},"TeamId":{"type":"string","pattern":"^team_[0-9a-hjkmnp-tv-z]{26}$"},"TeamPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Team"},"description":"This page of the list."},"nextCursor":{"anyOf":[{"$ref":"#/components/schemas/Cursor"},{"type":"null"}],"description":"Send it back as `cursor` to read the next page; null on the last page."},"totalCount":{"description":"How many items match across every page, among those you may see.","$ref":"#/components/schemas/TotalCount"}},"required":["items","nextCursor","totalCount"]},"TeamUpdatedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"team.updated","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"description":"What the event carries; for a change, the object as it is after it.","$ref":"#/components/schemas/TeamEventPayload"}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"Teleprompter":{"type":"object","properties":{"textColumnId":{"description":"The text question whose answer or prefilled value is the teleprompter's text; never a hidden one.","$ref":"#/components/schemas/ColumnId"},"wordsPerMinute":{"type":"integer","minimum":60,"maximum":240,"description":"How fast the text scrolls at first, in words a minute: 60 to 240."},"size":{"description":"The text size at first: `s`, `m`, `l` or `xl`.","$ref":"#/components/schemas/TeleprompterSize"},"colors":{"description":"The colors at first, one of four high-contrast presets.","$ref":"#/components/schemas/TeleprompterColors"}},"required":["textColumnId","wordsPerMinute","size","colors"]},"TeleprompterColors":{"type":"string","enum":["light_on_dark","dark_on_light","yellow_on_dark","green_on_dark"]},"TeleprompterSize":{"type":"string","enum":["s","m","l","xl"]},"TestFormResponseBody":{"type":"object","properties":{"values":{"type":"object","propertyNames":{"$ref":"#/components/schemas/ColumnId"},"additionalProperties":{},"description":"The answers, by column id, as the form page would send them."},"linkId":{"description":"A link of the form whose prefilled values to apply, as a response through it would. Left out: none.","anyOf":[{"$ref":"#/components/schemas/FormLinkId"},{"type":"null"}]},"address":{"description":"Values prefilled in the address (`?Platform=TikTok`), by question name or column id.","type":"object","propertyNames":{"type":"string","maxLength":80},"additionalProperties":{"type":"string","maxLength":2000}}},"required":["values"],"additionalProperties":false},"TestFormResponseResult":{"type":"object","properties":{"values":{"description":"The cells a response like this would write, by column id.","$ref":"#/components/schemas/RecordValues"}},"required":["values"]},"TextAnchor":{"type":"object","properties":{"pageId":{"description":"The page the words were on when the comment was written.","$ref":"#/components/schemas/DocPageId"},"quote":{"type":"string","minLength":1,"maxLength":500,"description":"The words the comment is about, up to 500 characters."},"prefix":{"type":"string","maxLength":32,"description":"Up to 32 characters of the text just before the words."},"suffix":{"type":"string","maxLength":32,"description":"Up to 32 characters of the text just after the words."}},"required":["pageId","quote","prefix","suffix"],"additionalProperties":false},"TextColumn":{"type":"object","properties":{"id":{"description":"The column's id: the key of its cell in each record's `values`.","$ref":"#/components/schemas/ColumnId"},"tableId":{"description":"The table the column belongs to.","$ref":"#/components/schemas/TableId"},"name":{"type":"string","minLength":1,"maxLength":80,"description":"The column's name, shown in its header."},"position":{"description":"The column's place in the table: columns sort by this key, compared as text.","$ref":"#/components/schemas/FractionalIndex"},"readOnly":{"type":"boolean","description":"Whether only the server writes the column's cells; a record write that sets one answers `400 validation_failed`."},"revision":{"description":"Grows by one with every change to the column; send it as `expectedRevision` to change the column.","$ref":"#/components/schemas/Revision"},"type":{"type":"string","const":"text","description":"The column's type, which decides what its cells hold."}},"required":["id","tableId","name","position","readOnly","revision","type"]},"TextDeltaEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"provisional","description":"A provisional event: live progress, such as an agent reply being written. Never stored or replayed."},"turnId":{"description":"The agent turn the progress belongs to.","$ref":"#/components/schemas/TurnId"},"attempt":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"The attempt of the turn, from 1; it grows each time the turn starts again."},"index":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"A counter per turn attempt, from 1, to drop repeats and notice gaps."},"emittedAt":{"description":"When the server sent it.","$ref":"#/components/schemas/IsoDateTime"},"type":{"type":"string","const":"text.delta","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"type":"object","properties":{"messageId":{"description":"The id the reply being written will have.","$ref":"#/components/schemas/MessageId"},"offset":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"The reply's length before this text, in UTF-16 code units: append when it equals the text you hold, skip what you already have, and read the turn's draft again on a gap."},"text":{"type":"string","minLength":1,"maxLength":2048,"description":"The next piece of the reply."}},"required":["messageId","offset","text"],"description":"What the event carries; for a change, the object as it is after it."}},"required":["v","kind","turnId","attempt","index","emittedAt","type","payload"]},"TextPart":{"type":"object","properties":{"type":{"type":"string","const":"text","description":"A run of text."},"text":{"type":"string","minLength":1,"maxLength":20000,"description":"The words, in a Markdown subset (emphasis, strikethrough, code, links, headings, blockquotes, thematic breaks, lists and tables), up to 20,000 characters. A mention is a `mention` part of its own, never text."}},"required":["type","text"]},"Theme":{"type":"string","enum":["light","dark","system"]},"ThreadKey":{"type":"string","pattern":"^(chat:chat_[0-9a-hjkmnp-tv-z]{26}|file:file_[0-9a-hjkmnp-tv-z]{26})$"},"ThreadRef":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"chat","description":"A chat."},"chatId":{"description":"The chat's id.","$ref":"#/components/schemas/ChatId"}},"required":["kind","chatId"]},{"type":"object","properties":{"kind":{"type":"string","const":"file","description":"A file's comments."},"fileId":{"description":"The file's id.","$ref":"#/components/schemas/FileId"}},"required":["kind","fileId"]}]},"TimeOfDay":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$"},"TimeZone":{"type":"string","maxLength":64,"pattern":"^[A-Za-z][A-Za-z0-9_+-]*(?:\\/[A-Za-z0-9_+-]+)*$"},"ToolActivity":{"type":"object","properties":{"id":{"description":"The call's id.","$ref":"#/components/schemas/ToolActivityId"},"turnId":{"description":"The turn that made the call.","$ref":"#/components/schemas/TurnId"},"attempt":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"The turn's attempt the call belongs to."},"index":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"Its order among the turn's calls, counting from 1."},"tool":{"description":"The tool called.","$ref":"#/components/schemas/ToolActivityTool"},"phase":{"description":"`started`, `awaiting_approval` (on its request card), `awaiting_team` (until the agents asked finish) or `awaiting_answer` (until a person answers its question card) or `awaiting_time` (until its wake-up time), then one of `succeeded`, `failed`, `declined` or `cancelled`.","$ref":"#/components/schemas/ToolActivityPhase"},"requestId":{"anyOf":[{"$ref":"#/components/schemas/ActionRequestId"},{"type":"null"}],"description":"The request card the call became, when it had to ask first; null otherwise."},"targets":{"maxItems":32,"type":"array","items":{"$ref":"#/components/schemas/ObjectRef"},"description":"The objects the call used that the caller may view."},"summary":{"anyOf":[{"type":"string","minLength":1,"maxLength":280},{"type":"null"}],"description":"What the call did, in a few words, such as \"Read 12 records\"; null when there is none."},"failureCode":{"anyOf":[{"$ref":"#/components/schemas/ToolFailureCode"},{"type":"null"}],"description":"Why the call failed, such as `timeout` or `not_found`; null unless it failed."},"startedAt":{"description":"When the call started.","$ref":"#/components/schemas/IsoDateTime"},"endedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}],"description":"When the call ended; null while it runs or waits."}},"required":["id","turnId","attempt","index","tool","phase","requestId","targets","summary","failureCode","startedAt","endedAt"]},"ToolActivityEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"provisional","description":"A provisional event: live progress, such as an agent reply being written. Never stored or replayed."},"turnId":{"description":"The agent turn the progress belongs to.","$ref":"#/components/schemas/TurnId"},"attempt":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"The attempt of the turn, from 1; it grows each time the turn starts again."},"index":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"A counter per turn attempt, from 1, to drop repeats and notice gaps."},"emittedAt":{"description":"When the server sent it.","$ref":"#/components/schemas/IsoDateTime"},"type":{"type":"string","const":"tool.activity","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"type":"object","properties":{"activity":{"description":"The tool call, in its new phase.","$ref":"#/components/schemas/ToolActivity"}},"required":["activity"],"description":"What the event carries; for a change, the object as it is after it."}},"required":["v","kind","turnId","attempt","index","emittedAt","type","payload"]},"ToolActivityId":{"type":"string","pattern":"^tact_[0-9a-hjkmnp-tv-z]{26}$"},"ToolActivityPhase":{"type":"string","enum":["started","awaiting_approval","awaiting_team","awaiting_answer","awaiting_time","succeeded","failed","declined","cancelled"]},"ToolActivityTool":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":160,"description":"The tool's name, such as `record_query`."},"version":{"type":"string","minLength":1,"maxLength":160,"description":"The tool's version."},"displayName":{"type":"string","minLength":1,"maxLength":80,"description":"What the activity line shows while the tool runs, such as \"Reading records\"."},"source":{"description":"Where the tool comes from: `native` (Fleepr itself), `connector`, or `mcp` (a remote MCP server).","$ref":"#/components/schemas/ToolSource"},"risk":{"description":"How much a call can change: `read`, `reversible`, `consequential` or `destructive`.","$ref":"#/components/schemas/ToolRisk"}},"required":["name","version","displayName","source","risk"]},"ToolFailureCode":{"type":"string","enum":["input_invalid","authorization_denied","not_found","conflict","timeout","limit_exceeded","output_invalid","execution_failed","unavailable","network_error","response_too_large","cancelled"]},"ToolGrant":{"type":"object","properties":{"id":{"description":"The grant's id.","$ref":"#/components/schemas/ToolGrantId"},"chatId":{"description":"The chat the tool is allowed in.","$ref":"#/components/schemas/ChatId"},"tool":{"description":"The tool it covers.","$ref":"#/components/schemas/ToolGrantTool"},"connectionId":{"anyOf":[{"$ref":"#/components/schemas/ConnectionId"},{"type":"null"}],"description":"The connection it covers, for a connector's or an MCP server's tool; null for Fleepr's own."},"grantedBy":{"description":"The member whose Allow made it.","$ref":"#/components/schemas/MemberId"},"requestId":{"description":"The card whose Allow made it.","$ref":"#/components/schemas/ActionRequestId"},"createdAt":{"description":"When it was allowed.","$ref":"#/components/schemas/IsoDateTime"},"viewer":{"description":"What the caller may do with it.","$ref":"#/components/schemas/ToolGrantViewer"}},"required":["id","chatId","tool","connectionId","grantedBy","requestId","createdAt","viewer"]},"ToolGrantId":{"type":"string","pattern":"^tgr_[0-9a-hjkmnp-tv-z]{26}$"},"ToolGrantList":{"type":"object","properties":{"items":{"maxItems":100,"type":"array","items":{"$ref":"#/components/schemas/ToolGrant"},"description":"The chat's grants, newest first."}},"required":["items"]},"ToolGrantTool":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":160,"description":"The tool's name."},"version":{"type":"string","minLength":1,"maxLength":160,"description":"The version allowed; another version asks again."},"displayName":{"type":"string","minLength":1,"maxLength":80,"description":"The tool's name as people read it."},"source":{"description":"Where the tool comes from: `native`, `connector` or `mcp`.","$ref":"#/components/schemas/ToolSource"}},"required":["name","version","displayName","source"]},"ToolGrantViewer":{"type":"object","properties":{"canRevoke":{"type":"boolean","description":"`true` when the caller may revoke the grant: the member who allowed it, or an admin."}},"required":["canRevoke"]},"ToolPolicy":{"type":"object","properties":{"toolName":{"description":"The tool's name, as the tool list shows it.","$ref":"#/components/schemas/ConnectionToolName"},"readOnly":{"type":"boolean","description":"`true` runs the tool without asking; `false` asks with a confirm card first."}},"required":["toolName","readOnly"],"additionalProperties":false},"ToolResult":{"type":"object","properties":{"id":{"description":"The tool result's id.","$ref":"#/components/schemas/ToolResultId"},"sourceTurnId":{"description":"The turn whose tool call this is the result of.","$ref":"#/components/schemas/TurnId"},"turnId":{"description":"The new turn of the same agent that reads the result.","$ref":"#/components/schemas/TurnId"},"chainId":{"description":"The chain the new turn starts.","$ref":"#/components/schemas/ChainId"},"toolName":{"type":"string","minLength":1,"maxLength":160,"description":"The tool's name, as the MCP server lists it."},"fileIds":{"maxItems":10,"type":"array","items":{"$ref":"#/components/schemas/FileId"},"description":"The files the result delivered."},"createdAt":{"description":"When the result was delivered.","$ref":"#/components/schemas/IsoDateTime"}},"required":["id","sourceTurnId","turnId","chainId","toolName","fileIds","createdAt"]},"ToolResultId":{"type":"string","pattern":"^tres_[0-9a-hjkmnp-tv-z]{26}$"},"ToolRisk":{"type":"string","enum":["read","reversible","consequential","destructive"]},"ToolSource":{"type":"string","enum":["native","connector","mcp"]},"TotalCount":{"type":"integer","minimum":0,"maximum":9007199254740991},"TransferObjectOwnershipBody":{"type":"object","properties":{"ownerId":{"description":"The member who becomes the owner: active, not a viewer, and not the current owner.","$ref":"#/components/schemas/MemberId"},"expectedRevision":{"description":"The `revision` you read. If the object changed since, the answer is `409 revision_conflict` and nothing changes.","$ref":"#/components/schemas/Revision"},"removePreviousOwnerGrant":{"description":"Also remove the edit access the previous owner would keep. Leave it out (or false) to let them keep edit until someone removes it. Access from the organization or an admin role stays.","type":"boolean"}},"required":["ownerId","expectedRevision"],"additionalProperties":false},"TransferOwnershipBody":{"type":"object","properties":{"toMemberId":{"description":"The new owner: an active member of the organization who is not a viewer.","$ref":"#/components/schemas/MemberId"},"expectedRevision":{"description":"The `revision` you read. If the object changed since, the answer is `409 revision_conflict` and nothing changes.","$ref":"#/components/schemas/Revision"}},"required":["toMemberId","expectedRevision"],"additionalProperties":false},"Turn":{"type":"object","properties":{"id":{"description":"The turn's id.","$ref":"#/components/schemas/TurnId"},"agentId":{"description":"The agent whose turn it is.","$ref":"#/components/schemas/AgentId"},"thread":{"anyOf":[{"$ref":"#/components/schemas/ThreadRef"},{"type":"null"}],"description":"The chat or file comments the agent replies in; null only for a flow step that posts nowhere."},"trigger":{"description":"What started the turn.","$ref":"#/components/schemas/TurnTrigger"},"chain":{"description":"The turn's place in its chain: who it acts for and which agent called it.","$ref":"#/components/schemas/TurnChainLink"},"status":{"description":"`queued`, `running`, `awaiting_approval` (paused on its request card), `awaiting_team` (paused until the agents it asked finish), `awaiting_answer` (paused until a person answers its question card) or `awaiting_time` (asleep until `wakeAt`), then one of `completed`, `failed` or `cancelled`.","$ref":"#/components/schemas/TurnStatus"},"endReason":{"anyOf":[{"$ref":"#/components/schemas/TurnEndReason"},{"type":"null"}],"description":"Why the turn ended, such as `completed`, `cancelled_by_member` or `model_timeout`; null until then."},"failure":{"anyOf":[{"$ref":"#/components/schemas/TurnFailure"},{"type":"null"}],"description":"What went wrong, when the turn failed; null otherwise."},"attempt":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many times the turn has started: its first run, retries and resumes; 0 while first queued."},"pendingRequestId":{"anyOf":[{"$ref":"#/components/schemas/ActionRequestId"},{"type":"null"}],"description":"The request card the turn waits on while `awaiting_approval`; null otherwise."},"replyMessageIds":{"type":"array","items":{"$ref":"#/components/schemas/MessageId"},"description":"The messages the turn has written so far, in order."},"modelAlias":{"description":"The model the turn runs on, as an alias, fixed when it first starts; null before then.","type":["string","null"]},"agentRevision":{"anyOf":[{"$ref":"#/components/schemas/Revision"},{"type":"null"}],"description":"The agent's `revision` when the turn first started: the instructions it ran with; null before then."},"queuedAt":{"description":"When the turn was queued.","$ref":"#/components/schemas/IsoDateTime"},"startedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}],"description":"When the turn started running; null before then."},"awaitingApprovalSince":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}],"description":"While `awaiting_approval`, when its request card was raised; null otherwise."},"wakeAt":{"description":"While `awaiting_time`, when the turn wakes and goes back in the queue on its own; null otherwise.","anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"cancelRequestedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}],"description":"When someone asked to stop the running turn; null if nobody did."},"endedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}],"description":"When the turn ended; null until then."},"cancelledBy":{"anyOf":[{"$ref":"#/components/schemas/ActorId"},{"type":"null"}],"description":"Who cancelled the turn; null unless someone did."},"usage":{"anyOf":[{"$ref":"#/components/schemas/TurnUsage"},{"type":"null"}],"description":"Tokens, calls, time and cost of the turn, set when it ends; null until then, and may stay null for a turn that ended before it ran."},"revision":{"description":"Grows by one on every change to the turn; of two copies, keep the one with the higher revision.","$ref":"#/components/schemas/Revision"}},"required":["id","agentId","thread","trigger","chain","status","endReason","failure","attempt","pendingRequestId","replyMessageIds","modelAlias","agentRevision","queuedAt","startedAt","awaitingApprovalSince","cancelRequestedAt","endedAt","cancelledBy","usage","revision"]},"TurnAwaitingAnswerEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"turn.awaiting_answer","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"type":"object","properties":{"turn":{"description":"The turn, now `awaiting_answer`.","$ref":"#/components/schemas/Turn"}},"required":["turn"],"description":"What the event carries; for a change, the object as it is after it."}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"TurnAwaitingApprovalEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"turn.awaiting_approval","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"type":"object","properties":{"turn":{"description":"The turn, now `awaiting_approval`.","$ref":"#/components/schemas/Turn"},"requestId":{"description":"The request card the turn waits on.","$ref":"#/components/schemas/ActionRequestId"}},"required":["turn","requestId"],"description":"What the event carries; for a change, the object as it is after it."}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"TurnAwaitingTeamEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"turn.awaiting_team","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"type":"object","properties":{"turn":{"description":"The turn, now `awaiting_team`.","$ref":"#/components/schemas/Turn"}},"required":["turn"],"description":"What the event carries; for a change, the object as it is after it."}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"TurnAwaitingTimeEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"turn.awaiting_time","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"type":"object","properties":{"turn":{"description":"The turn, now `awaiting_time`, with its `wakeAt`.","$ref":"#/components/schemas/Turn"}},"required":["turn"],"description":"What the event carries; for a change, the object as it is after it."}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"TurnCancelRequestedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"turn.cancel_requested","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"type":"object","properties":{"turn":{"description":"The turn, with `cancelRequestedAt` set; `turn.ended` follows.","$ref":"#/components/schemas/Turn"}},"required":["turn"],"description":"What the event carries; for a change, the object as it is after it."}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"TurnChainLink":{"type":"object","properties":{"chainId":{"description":"The chain the turn belongs to.","$ref":"#/components/schemas/ChainId"},"depth":{"type":"integer","minimum":1,"maximum":10,"description":"The turn's depth: 1 for a person's mention, a flow step or a delivered tool result, one more for each agent that called the next."},"parentTurnId":{"anyOf":[{"$ref":"#/components/schemas/TurnId"},{"type":"null"}],"description":"The turn whose agent mentioned this one; null at depth 1."},"initiatorId":{"description":"The member the chain acts for: whose message started it, for a flow run the flow's owner, or for a delivered tool result the initiator of the chain whose turn made the call.","$ref":"#/components/schemas/MemberId"},"agentPath":{"minItems":1,"maxItems":10,"type":"array","items":{"$ref":"#/components/schemas/AgentId"},"description":"The agents from the chain's first turn down to this one, ending with this turn's agent. The turn reaches only what the member it acts for and each of these agents can reach."}},"required":["chainId","depth","parentTurnId","initiatorId","agentPath"]},"TurnContextSizesShown":{"type":"object","properties":{"total":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Every part of the input together, as written: what \"about N tokens\" reads."},"system":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Fleepr's own fixed text in the system role: the rules every agent reads."},"instructions":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"The agent's own instructions."},"skills":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"The listing of its skills: their names and descriptions."},"history":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"The thread's messages, the turn's own data and the request."},"tools":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"The tools it was offered: their names, descriptions and input schemas."}},"required":["total","system","instructions","skills","history","tools"]},"TurnDetail":{"type":"object","properties":{"turn":{"description":"The turn.","$ref":"#/components/schemas/Turn"},"chain":{"description":"The chain the turn belongs to.","$ref":"#/components/schemas/Chain"},"activities":{"type":"array","items":{"$ref":"#/components/schemas/ToolActivity"},"description":"The tool calls the turn made, in order."},"requests":{"type":"array","items":{"$ref":"#/components/schemas/ActionRequest"},"description":"The request cards the turn raised."},"skillVersionsRead":{"type":"array","items":{"$ref":"#/components/schemas/SkillVersionRead"},"description":"The skills the turn read, each at the version it read."},"health":{"type":"array","items":{"$ref":"#/components/schemas/TurnHealthUse"},"description":"The open Health issues the turn read about its tables and flow, as the caller may see them: one about a table or flow they may not view is left out."},"memories":{"description":"The memories the turn read and those that shaped its answer, as the caller sees them: a memory they may not see is left out.","$ref":"#/components/schemas/TurnMemoryUses"},"contextSizes":{"anyOf":[{"$ref":"#/components/schemas/TurnContextSizesShown"},{"type":"null"}],"description":"The size of the turn's input as its latest attempt wrote it, numbers only (about 4 bytes a token): its total and the parts no caller sees differently, the same for every caller; null before its first attempt read its context, and for a turn that ran before they were kept."}},"required":["turn","chain","activities","requests","skillVersionsRead","health","memories","contextSizes"]},"TurnDraft":{"type":"object","properties":{"turnId":{"description":"The running turn.","$ref":"#/components/schemas/TurnId"},"attempt":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"The turn's current attempt."},"messageId":{"description":"The id the reply being written will have; the `message.created` event with it replaces the draft.","$ref":"#/components/schemas/MessageId"},"text":{"type":"string","maxLength":100000,"description":"The reply's text so far."},"blocks":{"type":"array","items":{"$ref":"#/components/schemas/DraftBlock"},"description":"The blocks placed in the reply so far."},"activities":{"type":"array","items":{"$ref":"#/components/schemas/ToolActivity"},"description":"The tool calls of the turn's current attempt."},"stage":{"description":"What the agent is doing: `preparing`, `grounding`, `thinking`, `generating`, `tool_execution` or `finalizing`.","$ref":"#/components/schemas/TurnStage"},"lastIndex":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"The `index` of the last live event already in the draft; drop the turn's events up to it."},"updatedAt":{"description":"When the draft last changed.","$ref":"#/components/schemas/IsoDateTime"}},"required":["turnId","attempt","messageId","text","blocks","activities","stage","lastIndex","updatedAt"]},"TurnEndedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"turn.ended","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"type":"object","properties":{"turn":{"description":"The ended turn, with its `endReason`, `failure`, `usage` and `replyMessageIds`: fetch any reply you have not received.","$ref":"#/components/schemas/Turn"}},"required":["turn"],"description":"What the event carries; for a change, the object as it is after it."}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"TurnEndReason":{"type":"string","enum":["completed","cancelled_by_member","agents_paused","agent_paused","agent_archived","chain_stopped","access_revoked","thread_deleted","budget_exceeded","model_error","model_timeout","execution_timeout","max_steps_reached","output_limit_reached","authorization_lost","tool_error","internal_error"]},"TurnFailedNotice":{"type":"object","properties":{"code":{"type":"string","const":"turn_failed","description":"An agent's turn failed."},"turnId":{"description":"The turn that failed.","$ref":"#/components/schemas/TurnId"},"agentId":{"description":"The agent whose turn it was.","$ref":"#/components/schemas/AgentId"},"reason":{"description":"Why it failed, such as `model_timeout` or `budget_exceeded`.","$ref":"#/components/schemas/TurnEndReason"}},"required":["code","turnId","agentId","reason"]},"TurnFailure":{"type":"object","properties":{"message":{"type":"string","minLength":1,"maxLength":512,"description":"What went wrong, in words that are safe to show."},"retryable":{"type":"boolean","description":"Whether asking the agent again may work."}},"required":["message","retryable"]},"TurnHealthUse":{"type":"object","properties":{"issueId":{"description":"The issue.","$ref":"#/components/schemas/HealthIssueId"},"kind":{"description":"What kind of issue it is.","$ref":"#/components/schemas/HealthIssueKind"},"severity":{"description":"How much it matters.","$ref":"#/components/schemas/HealthSeverity"},"status":{"description":"Its status now: it may have been fixed since.","$ref":"#/components/schemas/HealthIssueStatus"},"subject":{"description":"What it is about.","$ref":"#/components/schemas/HealthSubject"}},"required":["issueId","kind","severity","status","subject"]},"TurnId":{"type":"string","pattern":"^turn_[0-9a-hjkmnp-tv-z]{26}$"},"TurnMemoryUse":{"type":"object","properties":{"id":{"description":"The memory.","$ref":"#/components/schemas/MemoryId"},"subject":{"description":"What it is about.","$ref":"#/components/schemas/MemorySubject"},"text":{"description":"Its words now; null once forgotten.","type":["string","null"]},"status":{"description":"Its status now: `archived` for one the agent found set aside, which a person may restore.","$ref":"#/components/schemas/MemoryStatus"}},"required":["id","subject","text","status"]},"TurnMemoryUses":{"type":"object","properties":{"applied":{"type":"array","items":{"$ref":"#/components/schemas/TurnMemoryUse"},"description":"Shaped this answer: the memories the agent named."},"read":{"type":"array","items":{"$ref":"#/components/schemas/TurnMemoryUse"},"description":"Read, not needed this time: the memories the turn read that it did not name."}},"required":["applied","read"]},"TurnQueuedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"turn.queued","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"type":"object","properties":{"turn":{"description":"The new turn, `queued`.","$ref":"#/components/schemas/Turn"}},"required":["turn"],"description":"What the event carries; for a change, the object as it is after it."}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"TurnRequeuedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"turn.requeued","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"type":"object","properties":{"turn":{"description":"The turn, `queued` again.","$ref":"#/components/schemas/Turn"},"reason":{"description":"Why: `approval_decided`, `retry_scheduled`, `request_closed` (its card closed without a decision), `team_finished` (the agents it waited for have finished), `question_answered` (its question card was answered), `question_superseded` (someone wrote in the chat instead of answering it) or `time_reached` (the time it slept until has come).","$ref":"#/components/schemas/TurnRequeueReason"}},"required":["turn","reason"],"description":"What the event carries; for a change, the object as it is after it."}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"TurnRequeueReason":{"type":"string","enum":["approval_decided","retry_scheduled","request_closed","team_finished","question_answered","question_superseded","time_reached"]},"TurnSnapshotEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"provisional","description":"A provisional event: live progress, such as an agent reply being written. Never stored or replayed."},"turnId":{"description":"The agent turn the progress belongs to.","$ref":"#/components/schemas/TurnId"},"attempt":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"The attempt of the turn, from 1; it grows each time the turn starts again."},"index":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"A counter per turn attempt, from 1, to drop repeats and notice gaps."},"emittedAt":{"description":"When the server sent it.","$ref":"#/components/schemas/IsoDateTime"},"type":{"type":"string","const":"turn.snapshot","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"description":"What the event carries; for a change, the object as it is after it.","$ref":"#/components/schemas/TurnDraft"}},"required":["v","kind","turnId","attempt","index","emittedAt","type","payload"]},"TurnStage":{"type":"string","enum":["preparing","grounding","thinking","generating","tool_execution","finalizing"]},"TurnStageEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"provisional","description":"A provisional event: live progress, such as an agent reply being written. Never stored or replayed."},"turnId":{"description":"The agent turn the progress belongs to.","$ref":"#/components/schemas/TurnId"},"attempt":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"The attempt of the turn, from 1; it grows each time the turn starts again."},"index":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"A counter per turn attempt, from 1, to drop repeats and notice gaps."},"emittedAt":{"description":"When the server sent it.","$ref":"#/components/schemas/IsoDateTime"},"type":{"type":"string","const":"turn.stage","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"type":"object","properties":{"stage":{"description":"What the agent is doing now, such as `thinking` or `tool_execution`.","$ref":"#/components/schemas/TurnStage"}},"required":["stage"],"description":"What the event carries; for a change, the object as it is after it."}},"required":["v","kind","turnId","attempt","index","emittedAt","type","payload"]},"TurnStartedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"turn.started","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"type":"object","properties":{"turn":{"description":"The turn, now `running`, with its `attempt` one higher.","$ref":"#/components/schemas/Turn"}},"required":["turn"],"description":"What the event carries; for a change, the object as it is after it."}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"TurnStatus":{"type":"string","enum":["queued","running","awaiting_approval","awaiting_team","awaiting_answer","awaiting_time","completed","failed","cancelled"]},"TurnTrigger":{"type":"object","properties":{"kind":{"description":"`member_mention`: a person's mention; `agent_mention`: another agent's mention in its reply; `flow_step`: a step of a flow run; `tool_result`: the result of one of its earlier tool calls arrived.","$ref":"#/components/schemas/TurnTriggerKind"},"messageId":{"anyOf":[{"$ref":"#/components/schemas/MessageId"},{"type":"null"}],"description":"The message whose mention started the turn; null for a flow step and a tool result."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"For a flow step, the flow run; null otherwise."},"stepRunId":{"anyOf":[{"$ref":"#/components/schemas/StepRunId"},{"type":"null"}],"description":"For a flow step, the step's run; null otherwise."},"toolResultId":{"description":"For a `tool_result` turn, the tool result that started it; null or absent otherwise.","anyOf":[{"$ref":"#/components/schemas/ToolResultId"},{"type":"null"}]}},"required":["kind","messageId","flowRunId","stepRunId"]},"TurnTriggerKind":{"type":"string","enum":["member_mention","agent_mention","flow_step","tool_result"]},"TurnUsage":{"type":"object","properties":{"modelAlias":{"type":"string","description":"The model the turn ran on, as an alias from `GET /v0/models`."},"inputTokens":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Tokens sent to the model, across all its calls."},"outputTokens":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Tokens the model wrote."},"reasoningTokens":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Tokens the model spent reasoning before it answered."},"cachedInputTokens":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Input tokens read from the model's cache, which cost less."},"totalTokens":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Every token of the turn."},"modelCalls":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many times the turn called the model."},"toolCalls":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many tool calls the turn made."},"durationMs":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How long the turn ran, in milliseconds, not counting time it waited for approval, its team or an answer."},"costMicros":{"anyOf":[{"$ref":"#/components/schemas/Micros"},{"type":"null"}],"description":"What the turn cost, in millionths of a US dollar; null in events, for anyone but the organization's owner and admins, and when no cost is known."}},"required":["modelAlias","inputTokens","outputTokens","reasoningTokens","cachedInputTokens","totalTokens","modelCalls","toolCalls","durationMs","costMicros"]},"UndeliveredEmailItem":{"type":"string","enum":["email","approval_link","form_link"]},"UndoChoiceResult":{"type":"object","properties":{"message":{"description":"The message with the table card, its choice open again.","$ref":"#/components/schemas/Message"}},"required":["message"]},"UndoDecisionResult":{"type":"object","properties":{"approval":{"description":"The approval after the decision was withdrawn.","$ref":"#/components/schemas/Approval"},"notice":{"anyOf":[{"$ref":"#/components/schemas/Message"},{"type":"null"}],"description":"The line the undo wrote in the file's thread, a system message."}},"required":["approval","notice"]},"UndoDeclineRequestBody":{"type":"object","properties":{"expectedRevision":{"description":"The `revision` you read. If the object changed since, the answer is `409 revision_conflict` and nothing changes.","$ref":"#/components/schemas/Revision"}},"required":["expectedRevision"],"additionalProperties":false},"UnreadCount":{"type":"integer","minimum":0,"maximum":9007199254740991},"UpdateAgentBody":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":60,"pattern":"\\S","description":"The name people @mention the agent by, up to 60 characters, unique among the agents that are not deleted, ignoring case."},"title":{"description":"The role the agent plays, such as \"Copywriter\", up to 80 characters; null removes it.","anyOf":[{"type":"string","minLength":1,"maxLength":80,"pattern":"\\S"},{"type":"null"}]},"avatarUploadId":{"description":"Your own finished, unused upload with purpose `agent_avatar` for the agent's photo; null removes the photo.","anyOf":[{"$ref":"#/components/schemas/UploadId"},{"type":"null"}]},"teamIds":{"description":"The teams the agent belongs to, each once; replaces the current list.","type":"array","items":{"$ref":"#/components/schemas/TeamId"}},"modelAlias":{"description":"A model alias from `GET /v0/models` that is `available` and that the organization allows, or the one the agent already uses; left out on create, the default.","$ref":"#/components/schemas/ModelAlias"},"instructions":{"description":"The agent's instructions, in Markdown, up to 20,000 characters.","type":"string","maxLength":20000},"skillIds":{"description":"The skills assigned to the agent, each once; replaces the current list.","type":"array","items":{"$ref":"#/components/schemas/SkillId"}},"connectionIds":{"description":"The connections whose tools the agent may use; replaces those the caller can see, and each one added or removed needs edit on it.","type":"array","items":{"$ref":"#/components/schemas/ConnectionId"}},"webTools":{"description":"Whether the agent has the web tools; default off.","type":"boolean"},"visibility":{"description":"Who sees the agent: `organization`, the default, or `private` for its owner, admins and the people it is shared with. Only the agent's owner and the organization's owner and admins change it.","$ref":"#/components/schemas/Visibility"},"expectedRevision":{"description":"The `revision` you read. If the object changed since, the answer is `409 revision_conflict` and nothing changes.","$ref":"#/components/schemas/Revision"}},"required":["expectedRevision"],"additionalProperties":false},"UpdateAiLimitsBody":{"type":"object","properties":{"dailyBudgetMicros":{"anyOf":[{"$ref":"#/components/schemas/NoLimitOverrideInput"},{"type":"null"}],"description":"The organization's own daily budget: `{ \"value\": null }` switches it off, and null follows the plan's default."},"monthlyBudgetMicros":{"anyOf":[{"$ref":"#/components/schemas/NoLimitOverrideInput"},{"type":"null"}],"description":"The organization's own monthly budget: `{ \"value\": null }` switches it off, and null follows the plan's default."},"softWarningPercent":{"anyOf":[{"type":"integer","minimum":1,"maximum":100,"description":"The share of a budget, in percent, at which the owner and admins are warned."},{"type":"null"}],"description":"The organization's own warning threshold, in percent; null follows the plan's default."},"chainMaxDepth":{"anyOf":[{"type":"integer","minimum":1,"maximum":5,"description":"How deep a chain of agents may go, from 1 to 5: 1 lets no agent hand off to another, 3 allows two hops."},{"type":"null"}],"description":"The organization's own chain depth, from 1 to 5; null follows the plan's default."},"chainMaxTurns":{"anyOf":[{"type":"integer","minimum":1,"maximum":50,"description":"The most agent turns one chain may run, across every agent it reaches."},{"type":"null"}],"description":"The organization's own limit of turns per chain, from 1 to 50; null follows the plan's default."},"chainBudgetMicros":{"anyOf":[{"$ref":"#/components/schemas/NoLimitOverrideInput"},{"type":"null"}],"description":"The organization's own budget per chain: `{ \"value\": null }` switches it off, and null follows the plan's default."},"approvalTtlSeconds":{"anyOf":[{"type":"integer","minimum":300,"maximum":2592000,"description":"How long a request card waits for a decision before it expires, in seconds: 5 minutes to 30 days."},{"type":"null"}],"description":"The organization's own request card lifetime, in seconds; null follows the plan's default."},"declineUndoSeconds":{"anyOf":[{"type":"integer","minimum":0,"maximum":300,"description":"How many seconds a person has to undo declining a request card, up to 300."},{"type":"null"}],"description":"The organization's own undo window after a decline, in seconds; null follows the plan's default."},"maxActiveTurnsPerChat":{"anyOf":[{"type":"integer","minimum":1,"maximum":50,"description":"How many agent turns may run at once in one chat; more wait as `queued`."},{"type":"null"}],"description":"The organization's own limit of turns running at once per chat; null follows the plan's default."},"maxActiveTurnsPerMember":{"anyOf":[{"type":"integer","minimum":1,"maximum":50,"description":"How many agent turns may run at once for the chains one member started; more wait as `queued`."},{"type":"null"}],"description":"The organization's own limit of turns running at once per member; null follows the plan's default."},"maxActiveTurnsPerOrganization":{"anyOf":[{"type":"integer","minimum":1,"maximum":500,"description":"How many agent turns may run at once in the organization; more wait as `queued`."},{"type":"null"}],"description":"The organization's own limit of turns running at once in all; null follows the plan's default."},"modelAllowlist":{"description":"The model aliases agents may use, each once, which also allows every alias that runs the same model; null allows every model, and leaving it out keeps the list.","anyOf":[{"$ref":"#/components/schemas/ModelAllowlist"},{"type":"null"}]},"expectedRevision":{"description":"The `revision` you read. If the object changed since, the answer is `409 revision_conflict` and nothing changes.","$ref":"#/components/schemas/Revision"}},"required":["dailyBudgetMicros","monthlyBudgetMicros","softWarningPercent","chainMaxDepth","chainMaxTurns","chainBudgetMicros","approvalTtlSeconds","declineUndoSeconds","maxActiveTurnsPerChat","maxActiveTurnsPerMember","maxActiveTurnsPerOrganization","expectedRevision"],"additionalProperties":false},"UpdateChatBody":{"type":"object","properties":{"name":{"description":"The new name, 1 to 120 characters; it ends the automatic title. Left out, the name stays.","type":"string","minLength":1,"maxLength":120},"about":{"description":"The new description, up to 2,000 characters. Left out, the description stays.","type":"string","maxLength":2000},"expectedRevision":{"description":"The `revision` you read. If the object changed since, the answer is `409 revision_conflict` and nothing changes.","$ref":"#/components/schemas/Revision"}},"required":["expectedRevision"],"additionalProperties":false},"UpdateColumnBody":{"type":"object","properties":{"name":{"description":"The new name, up to 80 characters.","type":"string","minLength":1,"maxLength":80},"position":{"description":"The new place: a key that sorts, as text, between its new neighbors' `position`.","$ref":"#/components/schemas/FractionalIndex"},"settings":{"description":"The column's current type with the settings to change; to change the type, use `POST /v0/columns/{columnId}/change-type`.","$ref":"#/components/schemas/ColumnSettingsInput"},"expectedRevision":{"description":"The `revision` you read. If the object changed since, the answer is `409 revision_conflict` and nothing changes.","$ref":"#/components/schemas/Revision"}},"required":["expectedRevision"],"additionalProperties":false},"UpdateConnectionBody":{"type":"object","properties":{"name":{"description":"The new name, unique in the organization, up to 80 characters.","$ref":"#/components/schemas/ConnectionName"},"mcp":{"description":"An MCP server's settings to change; refused on any other connector.","$ref":"#/components/schemas/McpUpdateInput"},"credential":{"description":"A new credential that replaces the stored one, never returned; Fleepr checks it. Refused on an MCP server.","$ref":"#/components/schemas/ConnectorCredential"},"expectedRevision":{"description":"The `revision` you read. If the object changed since, the answer is `409 revision_conflict` and nothing changes.","$ref":"#/components/schemas/Revision"}},"required":["expectedRevision"],"additionalProperties":false},"UpdateFileBody":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":255,"description":"The file's new name, 1 to 255 characters once trimmed."}},"required":["name"],"additionalProperties":false},"UpdateFormLinkBody":{"type":"object","properties":{"expiresAt":{"description":"When the link stops working; null: never.","anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}]},"maxResponses":{"description":"How many responses the link takes; null: no limit.","anyOf":[{"type":"integer","minimum":1,"maximum":1000000},{"type":"null"}]}},"additionalProperties":false},"UpdateHealthTargetBody":{"type":"object","properties":{"expectedRevision":{"description":"The `revision` you read. If the object changed since, the answer is `409 revision_conflict` and nothing changes.","$ref":"#/components/schemas/Revision"},"name":{"description":"A new name.","type":"string","minLength":1,"maxLength":80},"ownerId":{"description":"A new owner: an active member.","$ref":"#/components/schemas/MemberId"},"measure":{"description":"What it measures from now on.","$ref":"#/components/schemas/HealthTargetMeasure"},"period":{"description":"A new period length.","$ref":"#/components/schemas/HealthTargetPeriod"},"goal":{"description":"A new goal.","type":"number","exclusiveMinimum":0,"maximum":1000000000},"direction":{"description":"Which way is better from now on.","$ref":"#/components/schemas/HealthTargetDirection"}},"required":["expectedRevision"],"additionalProperties":false},"UpdateMeBody":{"type":"object","properties":{"name":{"description":"The user's new name, 1 to 80 characters and not only spaces.","type":"string","minLength":1,"maxLength":80,"pattern":"\\S"},"avatarUploadId":{"description":"A completed upload with purpose `avatar` to use as the profile photo; null removes the photo.","anyOf":[{"$ref":"#/components/schemas/UploadId"},{"type":"null"}]},"lastOrganizationId":{"description":"The organization the app opens first; one where the user is an active member.","$ref":"#/components/schemas/OrganizationId"}},"additionalProperties":false},"UpdateMemberBody":{"type":"object","properties":{"role":{"description":"The new role: `admin`, `member` or `viewer`; ownership moves only by transferring it.","$ref":"#/components/schemas/InviteRole"},"jobTitle":{"description":"The new job title, up to 80 characters; null clears it.","anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"expectedRevision":{"description":"The `revision` you read. If the object changed since, the answer is `409 revision_conflict` and nothing changes.","$ref":"#/components/schemas/Revision"}},"required":["expectedRevision"],"additionalProperties":false},"UpdateMemoryBody":{"type":"object","properties":{"text":{"description":"The memory's words: one sentence on one line, up to 200 characters.","$ref":"#/components/schemas/MemoryTextInput"},"type":{"description":"A new type.","$ref":"#/components/schemas/MemoryType"},"validUntil":{"description":"A new day a fact stops being true, or null for none.","anyOf":[{"$ref":"#/components/schemas/IsoDate"},{"type":"null"}]},"pinned":{"description":"Always keep it, or not.","type":"boolean"},"docId":{"description":"A doc in Files to point to, which the caller may view, or null for none. Send it only to change it: a caller who may not view the current doc reads null, and null sent back clears it.","anyOf":[{"$ref":"#/components/schemas/FileId"},{"type":"null"}]},"expectedRevision":{"description":"The `revision` you read. If the object changed since, the answer is `409 revision_conflict` and nothing changes.","$ref":"#/components/schemas/Revision"}},"required":["expectedRevision"],"additionalProperties":false},"UpdateObjectMemberBody":{"type":"object","properties":{"level":{"description":"The new level: `view`, `edit` or `manage`; an agent cannot get `manage`.","$ref":"#/components/schemas/AccessLevel"}},"required":["level"],"additionalProperties":false},"UpdateOrganizationBody":{"type":"object","properties":{"name":{"description":"The organization's new name, 1 to 80 characters and not only spaces.","type":"string","minLength":1,"maxLength":80,"pattern":"\\S"},"about":{"description":"The new text about the organization, up to 500 characters; empty clears it.","type":"string","maxLength":500},"timeZone":{"description":"The new IANA time zone, such as `America/New_York`.","$ref":"#/components/schemas/TimeZone"},"settings":{"description":"Settings to change; a key left out stays as it is, and null returns to the plan's default.","$ref":"#/components/schemas/OrganizationSettingsInput"},"squareLogoUploadId":{"description":"A finished upload of yours with purpose `organization_logo` to use as the square logo; null removes it.","anyOf":[{"$ref":"#/components/schemas/UploadId"},{"type":"null"}]},"horizontalLogoUploadId":{"description":"A finished upload of yours with purpose `organization_logo` to use as the horizontal logo; null removes it.","anyOf":[{"$ref":"#/components/schemas/UploadId"},{"type":"null"}]},"expectedRevision":{"description":"The `revision` you read. If the object changed since, the answer is `409 revision_conflict` and nothing changes.","$ref":"#/components/schemas/Revision"}},"required":["expectedRevision"],"additionalProperties":false},"UpdateRecordBody":{"type":"object","properties":{"values":{"description":"The cells to change, by column id; the cells left out keep their value.","$ref":"#/components/schemas/RecordValues"},"expectedRevision":{"description":"The record's `revision` you read, to get `409 revision_conflict` if it changed since. Left out, the last write wins for each cell.","$ref":"#/components/schemas/Revision"}},"required":["values"],"additionalProperties":false},"UpdateSkillBody":{"type":"object","properties":{"name":{"description":"The skill's name, up to 64 characters; it is written into the front matter of its `SKILL.md`.","type":"string","minLength":1,"maxLength":64,"pattern":"\\S"},"description":{"description":"What agents see of the skill before they load its body, up to 300 characters; written into the front matter.","type":"string","minLength":1,"maxLength":300,"pattern":"\\S"},"body":{"description":"The skill's `SKILL.md`, up to 100,000 characters with its front matter.","type":"string","minLength":1,"maxLength":100000,"pattern":"\\S"},"agentIds":{"description":"The skill's agents, each once; replaces the agents the caller may view, while those they may not view stay assigned. Each agent added or removed needs edit on it.","type":"array","items":{"$ref":"#/components/schemas/AgentId"}},"expectedRevision":{"description":"The `revision` you read. If the object changed since, the answer is `409 revision_conflict` and nothing changes.","$ref":"#/components/schemas/Revision"}},"required":["expectedRevision"],"additionalProperties":false},"UpdateTableBody":{"type":"object","properties":{"name":{"description":"The new name, up to 120 characters.","type":"string","minLength":1,"maxLength":120},"about":{"description":"The new description, up to 2,000 characters.","type":"string","maxLength":2000},"expectedRevision":{"description":"The `revision` you read. If the object changed since, the answer is `409 revision_conflict` and nothing changes.","$ref":"#/components/schemas/Revision"}},"required":["expectedRevision"],"additionalProperties":false},"UpdateTableProfileBody":{"type":"object","properties":{"role":{"description":"What the table is for; null marks it unclear.","anyOf":[{"$ref":"#/components/schemas/TableRole"},{"type":"null"}]},"about":{"description":"The table's description (`Table.about`, the same text as its Details), at most 2000 characters; empty clears it, which also turns down a suggested one. Asks edit on the table (403 otherwise).","type":"string","maxLength":2000},"aliases":{"description":"Other words people use for the table, at most 10 of up to 40 characters each. Replaces the list.","maxItems":10,"type":"array","items":{"type":"string","minLength":1,"maxLength":40}},"naming":{"description":"The columns records are named by and found by (400 `validation_failed` with an issue at the field otherwise).","$ref":"#/components/schemas/TableNamingInput"},"confirm":{"description":"Fields to confirm as they are shown: `about` takes the suggested description (edit on the table asked), `aliases` adds the suggested words (up to 10), `role` and `naming` keep what they hold. A field also sent above is confirmed by its value instead.","minItems":1,"maxItems":4,"type":"array","items":{"$ref":"#/components/schemas/TableProfileField"}},"expectedRevision":{"description":"The `revision` you read. Left out, the last write wins; sent, a profile changed since answers `409 revision_conflict`.","$ref":"#/components/schemas/Revision"}},"additionalProperties":false},"UpdateTeamBody":{"type":"object","properties":{"name":{"description":"The team's name, up to 60 characters, unique in the organization, ignoring case.","type":"string","minLength":1,"maxLength":60,"pattern":"\\S"},"about":{"description":"What the team does, up to 500 characters; null removes it.","anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"actorIds":{"description":"The full new list of people and agents in the team, each once; hidden ones stay in the team.","type":"array","items":{"$ref":"#/components/schemas/ActorId"}},"expectedRevision":{"description":"The `revision` you read. If the object changed since, the answer is `409 revision_conflict` and nothing changes.","$ref":"#/components/schemas/Revision"}},"required":["expectedRevision"],"additionalProperties":false},"UpdateViewBody":{"type":"object","properties":{"name":{"description":"The view's new name, up to 80 characters.","type":"string","minLength":1,"maxLength":80},"position":{"description":"The view's new place in the menu.","$ref":"#/components/schemas/FractionalIndex"},"settings":{"description":"The form's whole settings, which replace the current ones.","$ref":"#/components/schemas/FormSettings"},"expectedRevision":{"description":"The `revision` you read. If the object changed since, the answer is `409 revision_conflict` and nothing changes.","$ref":"#/components/schemas/Revision"}},"required":["expectedRevision"],"additionalProperties":false},"UpdateVisibilityBody":{"type":"object","properties":{"visibility":{"description":"`organization`: every member can view the object; `private`: only its owner, those it is shared with, and the organization's owner and admins.","$ref":"#/components/schemas/Visibility"},"expectedRevision":{"description":"The `revision` you read. If the object changed since, the answer is `409 revision_conflict` and nothing changes.","$ref":"#/components/schemas/Revision"}},"required":["visibility","expectedRevision"],"additionalProperties":false},"UpdateWebhookBody":{"type":"object","properties":{"expectedRevision":{"description":"The `revision` you read. If the object changed since, the answer is `409 revision_conflict` and nothing changes.","$ref":"#/components/schemas/Revision"},"name":{"description":"The new name, up to 100 characters.","type":"string","minLength":1,"maxLength":100},"url":{"description":"The new address: `https` on port 443 with a public host. A new address starts its failures afresh.","maxLength":2048,"$ref":"#/components/schemas/Url"},"events":{"description":"The new set of events to send, at least one, each once.","minItems":1,"type":"array","items":{"$ref":"#/components/schemas/WebhookEventType"}},"active":{"description":"`false` turns it off; `true` turns it on and clears why Fleepr turned it off, refused while its owner cannot act.","type":"boolean"}},"required":["expectedRevision"],"additionalProperties":false},"Upload":{"type":"object","properties":{"id":{"description":"The upload's id.","$ref":"#/components/schemas/UploadId"},"organizationId":{"description":"The organization the upload belongs to.","$ref":"#/components/schemas/OrganizationId"},"purpose":{"description":"What the upload is for: `attachment` (a file for a message, a table cell or the media library), `voice_note` (the audio of a voice message, kept only as its transcript), `file_version` (a new version of a file), `avatar` (a profile photo), `agent_avatar` (an agent's photo) or `organization_logo` (one of the organization's logos).","$ref":"#/components/schemas/UploadPurpose"},"name":{"type":"string","minLength":1,"maxLength":255,"description":"The file's name, up to 255 characters; the file the upload becomes takes it."},"mimeType":{"type":"string","minLength":1,"description":"The media type of the bytes, such as `image/png` or `audio/webm;codecs=opus`."},"sizeBytes":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"The exact size of the file in bytes; storage takes exactly this many."},"checksumSha256":{"anyOf":[{"$ref":"#/components/schemas/Sha256Hex"},{"type":"null"}],"description":"The SHA-256 of the stored bytes, which the server computes after completion; null until it has."},"status":{"description":"`pending` until it is completed, then `uploaded`; `aborted` once discarded, or `expired` once it can no longer be used, such as when it was not completed by `expiresAt`.","$ref":"#/components/schemas/UploadStatus"},"transfer":{"anyOf":[{"$ref":"#/components/schemas/UploadTransfer"},{"type":"null"}],"description":"How to send the bytes: in the answer that starts the upload, and in its replays while it is pending; null everywhere else."},"expiresAt":{"description":"When the upload must be completed by, an hour after it starts for one `PUT` and a day for parts; after that it expires.","$ref":"#/components/schemas/IsoDateTime"},"createdAt":{"description":"When the upload started.","$ref":"#/components/schemas/IsoDateTime"}},"required":["id","organizationId","purpose","name","mimeType","sizeBytes","checksumSha256","status","transfer","expiresAt","createdAt"]},"UploadId":{"type":"string","pattern":"^upl_[0-9a-hjkmnp-tv-z]{26}$"},"UploadPart":{"type":"object","properties":{"partNumber":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"The number of the part, counting from 1 in the order of the bytes."},"url":{"description":"A signed link to `PUT` exactly this part's bytes to, with no headers; send a failed part to it again.","$ref":"#/components/schemas/Url"}},"required":["partNumber","url"]},"UploadPurpose":{"type":"string","enum":["attachment","voice_note","file_version","avatar","agent_avatar","organization_logo"]},"UploadStatus":{"type":"string","enum":["pending","uploaded","failed","aborted","expired"]},"UploadTransfer":{"oneOf":[{"type":"object","properties":{"method":{"type":"string","const":"put","description":"`put`: send the whole file in one request."},"url":{"description":"A signed link to `PUT` the whole file to.","$ref":"#/components/schemas/Url"},"headers":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"},"description":"The headers the `PUT` must carry, exactly as given, such as `content-type`."}},"required":["method","url","headers"]},{"type":"object","properties":{"method":{"type":"string","const":"multipart","description":"`multipart`: send the file in parts, each to its own link."},"partSizeBytes":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"The size of every part in bytes; the last part carries what is left."},"parts":{"minItems":1,"type":"array","items":{"$ref":"#/components/schemas/UploadPart"},"description":"One signed link per part, in order."}},"required":["method","partSizeBytes","parts"]}]},"UpsertRecordsBody":{"type":"object","properties":{"matchColumnId":{"description":"The column whose value finds each record: a text, URL, email or number column of the table that is not read-only.","$ref":"#/components/schemas/ColumnId"},"records":{"minItems":1,"maxItems":500,"type":"array","items":{"$ref":"#/components/schemas/UpsertRecordsItem"},"description":"The records to create or update, 1 to 500; new ones are added at the end in this order."}},"required":["matchColumnId","records"],"additionalProperties":false},"UpsertRecordsItem":{"type":"object","properties":{"values":{"description":"The record's cells, by column id, with a value in the match column; a matched record keeps the cells left out.","$ref":"#/components/schemas/RecordValues"}},"required":["values"],"additionalProperties":false},"Url":{"type":"string","format":"uri"},"UrlColumn":{"type":"object","properties":{"id":{"description":"The column's id: the key of its cell in each record's `values`.","$ref":"#/components/schemas/ColumnId"},"tableId":{"description":"The table the column belongs to.","$ref":"#/components/schemas/TableId"},"name":{"type":"string","minLength":1,"maxLength":80,"description":"The column's name, shown in its header."},"position":{"description":"The column's place in the table: columns sort by this key, compared as text.","$ref":"#/components/schemas/FractionalIndex"},"readOnly":{"type":"boolean","description":"Whether only the server writes the column's cells; a record write that sets one answers `400 validation_failed`."},"revision":{"description":"Grows by one with every change to the column; send it as `expectedRevision` to change the column.","$ref":"#/components/schemas/Revision"},"type":{"type":"string","const":"url","description":"The column's type, which decides what its cells hold."}},"required":["id","tableId","name","position","readOnly","revision","type"]},"UsageBudget":{"type":"object","properties":{"dailyLimitMicros":{"anyOf":[{"$ref":"#/components/schemas/Micros"},{"type":"null"}],"description":"The daily budget in effect, in millionths of a US dollar; null when there is none."},"monthlyLimitMicros":{"anyOf":[{"$ref":"#/components/schemas/Micros"},{"type":"null"}],"description":"The monthly budget in effect, in millionths of a US dollar; null when there is none."},"spentTodayMicros":{"description":"What was spent today, in millionths of a US dollar.","$ref":"#/components/schemas/Micros"},"spentThisMonthMicros":{"description":"What was spent this calendar month, in millionths of a US dollar.","$ref":"#/components/schemas/Micros"},"state":{"description":"`ok`; `warning` once spending reaches the warning threshold of a budget; `exceeded` once a budget is spent.","$ref":"#/components/schemas/BudgetState"}},"required":["dailyLimitMicros","monthlyLimitMicros","spentTodayMicros","spentThisMonthMicros","state"]},"UsageBudgetExceededEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"usage.budget_exceeded","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"description":"What the event carries; for a change, the object as it is after it.","$ref":"#/components/schemas/UsageBudgetPayload"}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"UsageBudgetPayload":{"type":"object","properties":{"period":{"description":"Which budget: the `day`'s, the `month`'s or a `chain`'s.","$ref":"#/components/schemas/BudgetPeriod"},"spentMicros":{"description":"What has been spent against the budget, in millionths of a US dollar.","$ref":"#/components/schemas/Micros"},"limitMicros":{"description":"The budget, in millionths of a US dollar.","$ref":"#/components/schemas/Micros"}},"required":["period","spentMicros","limitMicros"]},"UsageBudgetWarningEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"usage.budget_warning","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"description":"What the event carries; for a change, the object as it is after it.","$ref":"#/components/schemas/UsageBudgetPayload"}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"UsageGroupBy":{"type":"string","enum":["day","agent","chain","member"]},"UsageReport":{"type":"object","properties":{"from":{"description":"The first day of the report, included.","$ref":"#/components/schemas/IsoDate"},"to":{"description":"The last day of the report, included.","$ref":"#/components/schemas/IsoDate"},"groupBy":{"description":"How the rows are grouped: by `day`, `agent`, `chain` or `member`.","$ref":"#/components/schemas/UsageGroupBy"},"rows":{"type":"array","items":{"$ref":"#/components/schemas/UsageRow"},"description":"One row per group, as `groupBy` says."},"totals":{"description":"The totals for the whole period.","$ref":"#/components/schemas/UsageTotals"},"budget":{"description":"Today's and this month's spending against the budgets, whatever the report's dates.","$ref":"#/components/schemas/UsageBudget"}},"required":["from","to","groupBy","rows","totals","budget"]},"UsageRow":{"type":"object","properties":{"key":{"type":"string","minLength":1,"description":"The group: a date for `day`, else the agent's, chain's or member's id, or the organization's system actor for Fleepr's own model calls (table suggestions), labelled Fleepr."},"label":{"type":"string","description":"The group's name, ready to show."},"turns":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many agent turns ran."},"inputTokens":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many tokens were sent to the models."},"outputTokens":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many tokens the models wrote."},"reasoningTokens":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many tokens the models spent reasoning before they answered."},"cachedInputTokens":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many input tokens were read from the model provider's cache."},"costMicros":{"description":"What it cost, in millionths of a US dollar.","$ref":"#/components/schemas/Micros"}},"required":["key","label","turns","inputTokens","outputTokens","reasoningTokens","cachedInputTokens","costMicros"]},"UsageTotals":{"type":"object","properties":{"turns":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many agent turns ran."},"inputTokens":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many tokens were sent to the models."},"outputTokens":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many tokens the models wrote."},"reasoningTokens":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many tokens the models spent reasoning before they answered."},"cachedInputTokens":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many input tokens were read from the model provider's cache."},"costMicros":{"description":"What it cost, in millionths of a US dollar.","$ref":"#/components/schemas/Micros"}},"required":["turns","inputTokens","outputTokens","reasoningTokens","cachedInputTokens","costMicros"]},"User":{"type":"object","properties":{"id":{"description":"The user's id: one login, which acts through its own member in each organization.","$ref":"#/components/schemas/UserId"},"email":{"description":"The address the user signs in with.","$ref":"#/components/schemas/Email"},"name":{"type":"string","minLength":1,"maxLength":80,"description":"The user's name, 1 to 80 characters, shown for them in every organization they belong to."},"avatarUrl":{"anyOf":[{"$ref":"#/components/schemas/Url"},{"type":"null"}],"description":"A link to the user's profile photo; null when there is none, and the app shows initials instead."}},"required":["id","email","name","avatarUrl"]},"UserId":{"type":"string","pattern":"^usr_[0-9a-hjkmnp-tv-z]{26}$"},"UserNotification":{"type":"object","properties":{"id":{"description":"The notification's id, to mark it as read.","$ref":"#/components/schemas/NotificationId"},"organizationId":{"description":"The organization the notification belongs to.","$ref":"#/components/schemas/OrganizationId"},"recipientId":{"description":"The member the notification is for.","$ref":"#/components/schemas/MemberId"},"kind":{"description":"What the notification is about, for its icon and the email switch it follows, such as `mention`.","$ref":"#/components/schemas/NotificationKind"},"reason":{"description":"Why the recipient was notified, such as `mentioned` or `approval_requested`; it sets the wording.","$ref":"#/components/schemas/NotificationReason"},"eventId":{"description":"The id of the event that caused the notification.","$ref":"#/components/schemas/EventId"},"by":{"anyOf":[{"$ref":"#/components/schemas/AuthorRef"},{"type":"null"}],"description":"Who caused the notification; null when no one did."},"title":{"type":"string","description":"The headline to show, written from `reason`."},"body":{"description":"A second line with more detail; null when there is none.","type":["string","null"]},"target":{"description":"The item the notification is about, such as a message, a file, a flow run or a request.","$ref":"#/components/schemas/ObjectRef"},"route":{"description":"The in-app path that opens `target`.","$ref":"#/components/schemas/AppRoute"},"links":{"maxItems":50,"type":"array","items":{"$ref":"#/components/schemas/NotificationLink"},"description":"More items to open, up to 50, such as each flow or connection that paused with a removed member; empty for most notifications."},"readAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}],"description":"When the recipient read it; null while it is unread."},"createdAt":{"description":"When the notification was made.","$ref":"#/components/schemas/IsoDateTime"}},"required":["id","organizationId","recipientId","kind","reason","eventId","by","title","body","target","route","links","readAt","createdAt"]},"ValidationIssue":{"type":"object","properties":{"path":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}]},"description":"Where the problem is, starting with the part of the request: `params`, `query`, `body` or `headers`. Empty on the last issue, `too_many_issues`, when more issues were found than an answer lists."},"code":{"type":"string","description":"Which rule failed, for code to read."},"message":{"type":"string","description":"What is wrong, in plain English."}},"required":["path","code","message"]},"VerifyEmailBody":{"type":"object","properties":{"token":{"type":"string","minLength":1,"maxLength":512,"description":"The token from the verification email's link."},"email":{"description":"The address the verification page shows, from the link: a link whose account has another address is refused (`410 link_invalid`) before anything is set, so nobody finishes a sign-up into an account that is not the one they were shown.","$ref":"#/components/schemas/Email"},"name":{"type":"string","minLength":1,"maxLength":80,"pattern":"\\S","description":"The name the person chooses, 1 to 80 characters and not only spaces. Bidi controls and invisible characters are dropped, and a name of nothing else is refused as blank."},"password":{"description":"The password the person chooses for the account.","$ref":"#/components/schemas/NewPassword"}},"required":["token","email","name","password"],"additionalProperties":false},"VerifyReviewCodeBody":{"type":"object","properties":{"code":{"type":"string","pattern":"^[0-9]{6}$","description":"The 6-digit code from the email; spaces around it are ignored."}},"required":["code"],"additionalProperties":false},"VideoCapture":{"type":"object","properties":{"kind":{"type":"string","const":"video","description":"Record a video."},"maxSeconds":{"type":"integer","minimum":10,"maximum":600,"description":"The longest take, in seconds: 10 to 600."},"camera":{"description":"The camera it opens with: `front` or `back`.","$ref":"#/components/schemas/CaptureCamera"},"teleprompter":{"anyOf":[{"$ref":"#/components/schemas/Teleprompter"},{"type":"null"}],"description":"The teleprompter, or null for none."}},"required":["kind","maxSeconds","camera","teleprompter"]},"View":{"oneOf":[{"$ref":"#/components/schemas/FormView"}]},"ViewCreatedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"view.created","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"description":"What the event carries; for a change, the object as it is after it.","$ref":"#/components/schemas/ViewPayload"}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"ViewDeletedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"view.deleted","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"description":"What the event carries; for a change, the object as it is after it.","$ref":"#/components/schemas/ViewDeletedPayload"}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"ViewDeletedPayload":{"type":"object","properties":{"viewId":{"description":"The view that was deleted.","$ref":"#/components/schemas/ViewId"},"tableId":{"description":"Its table.","$ref":"#/components/schemas/TableId"},"name":{"type":"string","description":"The view's name."},"tableName":{"type":"string","description":"The name of the view's table."}},"required":["viewId","tableId","name","tableName"]},"ViewId":{"type":"string","pattern":"^view_[0-9a-hjkmnp-tv-z]{26}$"},"ViewKind":{"type":"string","enum":["form"]},"ViewList":{"type":"object","properties":{"items":{"maxItems":50,"type":"array","items":{"$ref":"#/components/schemas/View"},"description":"The table's views, in menu order."}},"required":["items"]},"ViewPayload":{"type":"object","properties":{"view":{"description":"The view after the change.","$ref":"#/components/schemas/View"},"tableName":{"type":"string","description":"The name of the view's table."}},"required":["view","tableName"]},"ViewUpdatedEvent":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"durable","description":"A durable event: a change that is stored and can be replayed."},"id":{"description":"The event id, in order of writing. Send the last one you received as `Last-Event-ID` to resume.","$ref":"#/components/schemas/EventId"},"organizationId":{"description":"The organization the event belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the change was made.","$ref":"#/components/schemas/IsoDateTime"},"actor":{"description":"Who made the change: a person, an agent, the system or a guest.","$ref":"#/components/schemas/AuthorRef"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/MemberId"},{"type":"null"}],"description":"When an agent made the change, the member it acted for; otherwise null."},"chainId":{"anyOf":[{"$ref":"#/components/schemas/ChainId"},{"type":"null"}],"description":"The agent chain the change belongs to, if any; otherwise null."},"flowRunId":{"anyOf":[{"$ref":"#/components/schemas/FlowRunId"},{"type":"null"}],"description":"The flow run the change belongs to, if any; otherwise null."},"object":{"description":"The object the event is about.","$ref":"#/components/schemas/ObjectRef"},"type":{"type":"string","const":"view.updated","description":"What happened, as `<object>.<verb>`: it decides the shape of `payload`."},"payload":{"description":"What the event carries; for a change, the object as it is after it.","$ref":"#/components/schemas/ViewPayload"}},"required":["v","kind","id","organizationId","occurredAt","actor","onBehalfOf","chainId","flowRunId","object","type","payload"]},"Visibility":{"type":"string","enum":["organization","private"]},"VoicePart":{"type":"object","properties":{"type":{"type":"string","const":"voice","description":"A voice note, kept as its transcript."},"transcript":{"type":"string","minLength":1,"maxLength":20000,"description":"What was said, as plain text. The recording itself is not kept, so there is nothing to play."},"durationSeconds":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"How long the recording was, in seconds, rounded up."}},"required":["type","transcript","durationSeconds"]},"WaitingAccessRequest":{"type":"object","properties":{"kind":{"type":"string","const":"access","description":"`access`: a member's \"Ask to edit\" request."},"accessRequest":{"description":"The access request, as reading that request answers the caller.","$ref":"#/components/schemas/AccessRequest"},"decidesAs":{"minItems":1,"maxItems":8,"type":"array","items":{"$ref":"#/components/schemas/DecidingRight"},"description":"Why the caller decides it, one or more: `approver` or `step_person` (it names them), `initiator` (their request started the agent's work), `owner` (of what it is about), `named` (a card's rule names them), `admin` (as the organization's owner or an admin, for someone else's item) or `health` (a Health fix, which the organization's owner and admins decide)."},"group":{"description":"`yours` when the caller decides it by their own right; `admin` when they decide it only as an admin.","$ref":"#/components/schemas/WaitingGroup"},"counted":{"type":"boolean","description":"Whether it adds to the counts now: always in `yours`; in `admin`, when no one else decides it by their own right, or it expires within two hours."},"countsFrom":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}],"description":"When an `admin` item that does not count yet starts counting, two hours before it expires; null otherwise."},"waitingSince":{"description":"Since when it waits: the start of a file's current round, or when the sign-off, card, request or fix was made.","$ref":"#/components/schemas/IsoDateTime"},"expiresAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}],"description":"When it expires: an agent's card only; null for every other kind, which never expires."}},"required":["kind","accessRequest","decidesAs","group","counted","countsFrom","waitingSince","expiresAt"]},"WaitingCard":{"type":"object","properties":{"kind":{"type":"string","const":"agent","description":"`agent`: an agent's request card."},"request":{"description":"The card, as reading that request answers the caller.","$ref":"#/components/schemas/ActionRequest"},"decidesAs":{"minItems":1,"maxItems":8,"type":"array","items":{"$ref":"#/components/schemas/DecidingRight"},"description":"Why the caller decides it, one or more: `approver` or `step_person` (it names them), `initiator` (their request started the agent's work), `owner` (of what it is about), `named` (a card's rule names them), `admin` (as the organization's owner or an admin, for someone else's item) or `health` (a Health fix, which the organization's owner and admins decide)."},"group":{"description":"`yours` when the caller decides it by their own right; `admin` when they decide it only as an admin.","$ref":"#/components/schemas/WaitingGroup"},"counted":{"type":"boolean","description":"Whether it adds to the counts now: always in `yours`; in `admin`, when no one else decides it by their own right, or it expires within two hours."},"countsFrom":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}],"description":"When an `admin` item that does not count yet starts counting, two hours before it expires; null otherwise."},"waitingSince":{"description":"Since when it waits: the start of a file's current round, or when the sign-off, card, request or fix was made.","$ref":"#/components/schemas/IsoDateTime"},"expiresAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}],"description":"When it expires: an agent's card only; null for every other kind, which never expires."}},"required":["kind","request","decidesAs","group","counted","countsFrom","waitingSince","expiresAt"]},"WaitingCounts":{"type":"object","properties":{"all":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many items count, every kind together."},"flow":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many flow sign-offs count."},"file":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many file approvals count."},"agent":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many agents' request cards count."},"access":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many \"Ask to edit\" requests count."},"question":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many flow runs' question cards count."},"health_fix":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many Health fixes count."},"fleepr_weekly":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many of Fleepr's weekly items count (one a week at most)."}},"required":["all","flow","file","agent","access","question","health_fix","fleepr_weekly"]},"WaitingFile":{"type":"object","properties":{"kind":{"type":"string","const":"file","description":"`file`: a file's approval."},"approval":{"description":"The file's approval, as reading that approval answers the caller.","$ref":"#/components/schemas/Approval"},"openComments":{"anyOf":[{"$ref":"#/components/schemas/OpenComments"},{"type":"null"}],"description":"The comments of earlier rounds still open, to check against the new version; null in the first round or when none is open."},"decidesAs":{"minItems":1,"maxItems":8,"type":"array","items":{"$ref":"#/components/schemas/DecidingRight"},"description":"Why the caller decides it, one or more: `approver` or `step_person` (it names them), `initiator` (their request started the agent's work), `owner` (of what it is about), `named` (a card's rule names them), `admin` (as the organization's owner or an admin, for someone else's item) or `health` (a Health fix, which the organization's owner and admins decide)."},"group":{"description":"`yours` when the caller decides it by their own right; `admin` when they decide it only as an admin.","$ref":"#/components/schemas/WaitingGroup"},"counted":{"type":"boolean","description":"Whether it adds to the counts now: always in `yours`; in `admin`, when no one else decides it by their own right, or it expires within two hours."},"countsFrom":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}],"description":"When an `admin` item that does not count yet starts counting, two hours before it expires; null otherwise."},"waitingSince":{"description":"Since when it waits: the start of a file's current round, or when the sign-off, card, request or fix was made.","$ref":"#/components/schemas/IsoDateTime"},"expiresAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}],"description":"When it expires: an agent's card only; null for every other kind, which never expires."}},"required":["kind","approval","openComments","decidesAs","group","counted","countsFrom","waitingSince","expiresAt"]},"WaitingFleeprWeekly":{"type":"object","properties":{"kind":{"type":"string","const":"fleepr_weekly","description":"`fleepr_weekly`: Fleepr's weekly item for the caller."},"week":{"description":"The Monday of its week, in the organization’s time zone.","$ref":"#/components/schemas/IsoDate"},"thingCount":{"type":"integer","minimum":1,"maximum":24,"description":"How many things the item asks about in all (\"N things Fleepr picked up\")."},"messages":{"minItems":1,"maxItems":6,"type":"array","items":{"$ref":"#/components/schemas/Message"},"description":"The messages that carry its cards still open, in the order they were posted, as reading each message answers the caller: answer each there."},"decidesAs":{"minItems":1,"maxItems":8,"type":"array","items":{"$ref":"#/components/schemas/DecidingRight"},"description":"Why the caller decides it, one or more: `approver` or `step_person` (it names them), `initiator` (their request started the agent's work), `owner` (of what it is about), `named` (a card's rule names them), `admin` (as the organization's owner or an admin, for someone else's item) or `health` (a Health fix, which the organization's owner and admins decide)."},"group":{"description":"`yours` when the caller decides it by their own right; `admin` when they decide it only as an admin.","$ref":"#/components/schemas/WaitingGroup"},"counted":{"type":"boolean","description":"Whether it adds to the counts now: always in `yours`; in `admin`, when no one else decides it by their own right, or it expires within two hours."},"countsFrom":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}],"description":"When an `admin` item that does not count yet starts counting, two hours before it expires; null otherwise."},"waitingSince":{"description":"Since when it waits: the start of a file's current round, or when the sign-off, card, request or fix was made.","$ref":"#/components/schemas/IsoDateTime"},"expiresAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}],"description":"When it expires: an agent's card only; null for every other kind, which never expires."}},"required":["kind","week","thingCount","messages","decidesAs","group","counted","countsFrom","waitingSince","expiresAt"]},"WaitingGroup":{"type":"string","enum":["yours","admin"]},"WaitingHealthFix":{"type":"object","properties":{"kind":{"type":"string","const":"health_fix","description":"`health_fix`: a Health issue's fix, sent to Approvals."},"issue":{"description":"The issue, as reading that issue answers the caller.","$ref":"#/components/schemas/HealthIssue"},"decidesAs":{"minItems":1,"maxItems":8,"type":"array","items":{"$ref":"#/components/schemas/DecidingRight"},"description":"Why the caller decides it, one or more: `approver` or `step_person` (it names them), `initiator` (their request started the agent's work), `owner` (of what it is about), `named` (a card's rule names them), `admin` (as the organization's owner or an admin, for someone else's item) or `health` (a Health fix, which the organization's owner and admins decide)."},"group":{"description":"`yours` when the caller decides it by their own right; `admin` when they decide it only as an admin.","$ref":"#/components/schemas/WaitingGroup"},"counted":{"type":"boolean","description":"Whether it adds to the counts now: always in `yours`; in `admin`, when no one else decides it by their own right, or it expires within two hours."},"countsFrom":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}],"description":"When an `admin` item that does not count yet starts counting, two hours before it expires; null otherwise."},"waitingSince":{"description":"Since when it waits: the start of a file's current round, or when the sign-off, card, request or fix was made.","$ref":"#/components/schemas/IsoDateTime"},"expiresAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}],"description":"When it expires: an agent's card only; null for every other kind, which never expires."}},"required":["kind","issue","decidesAs","group","counted","countsFrom","waitingSince","expiresAt"]},"WaitingItem":{"oneOf":[{"$ref":"#/components/schemas/WaitingFile"},{"$ref":"#/components/schemas/WaitingSignOff"},{"$ref":"#/components/schemas/WaitingCard"},{"$ref":"#/components/schemas/WaitingAccessRequest"},{"$ref":"#/components/schemas/WaitingQuestion"},{"$ref":"#/components/schemas/WaitingHealthFix"},{"$ref":"#/components/schemas/WaitingFleeprWeekly"}]},"WaitingOnMe":{"type":"object","properties":{"items":{"maxItems":350,"type":"array","items":{"$ref":"#/components/schemas/WaitingItem"},"description":"What waits, most urgent first: up to 50 of each kind, a kind with more keeping those the caller decides by their own right before the others."},"counts":{"description":"How many items count, per kind and in all: the numbers to show.","$ref":"#/components/schemas/WaitingCounts"},"adminCount":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many items the caller decides only as an admin, counted or not."},"truncated":{"description":"Per kind, whether the read stopped before the end, so more may wait (show \"50+\").","$ref":"#/components/schemas/WaitingTruncated"}},"required":["items","counts","adminCount","truncated"]},"WaitingQuestion":{"type":"object","properties":{"kind":{"type":"string","const":"question","description":"`question`: a flow run's question card."},"message":{"description":"The message that carries the open card, as reading that message answers the caller: answer it there.","$ref":"#/components/schemas/Message"},"flowRunId":{"description":"The flow run the card waits in; the run waits for the answer.","$ref":"#/components/schemas/FlowRunId"},"decidesAs":{"minItems":1,"maxItems":8,"type":"array","items":{"$ref":"#/components/schemas/DecidingRight"},"description":"Why the caller decides it, one or more: `approver` or `step_person` (it names them), `initiator` (their request started the agent's work), `owner` (of what it is about), `named` (a card's rule names them), `admin` (as the organization's owner or an admin, for someone else's item) or `health` (a Health fix, which the organization's owner and admins decide)."},"group":{"description":"`yours` when the caller decides it by their own right; `admin` when they decide it only as an admin.","$ref":"#/components/schemas/WaitingGroup"},"counted":{"type":"boolean","description":"Whether it adds to the counts now: always in `yours`; in `admin`, when no one else decides it by their own right, or it expires within two hours."},"countsFrom":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}],"description":"When an `admin` item that does not count yet starts counting, two hours before it expires; null otherwise."},"waitingSince":{"description":"Since when it waits: the start of a file's current round, or when the sign-off, card, request or fix was made.","$ref":"#/components/schemas/IsoDateTime"},"expiresAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}],"description":"When it expires: an agent's card only; null for every other kind, which never expires."}},"required":["kind","message","flowRunId","decidesAs","group","counted","countsFrom","waitingSince","expiresAt"]},"WaitingSignOff":{"type":"object","properties":{"kind":{"type":"string","const":"flow","description":"`flow`: a flow run's sign-off."},"approval":{"description":"The sign-off's approval, as reading that approval answers the caller.","$ref":"#/components/schemas/Approval"},"decidesAs":{"minItems":1,"maxItems":8,"type":"array","items":{"$ref":"#/components/schemas/DecidingRight"},"description":"Why the caller decides it, one or more: `approver` or `step_person` (it names them), `initiator` (their request started the agent's work), `owner` (of what it is about), `named` (a card's rule names them), `admin` (as the organization's owner or an admin, for someone else's item) or `health` (a Health fix, which the organization's owner and admins decide)."},"group":{"description":"`yours` when the caller decides it by their own right; `admin` when they decide it only as an admin.","$ref":"#/components/schemas/WaitingGroup"},"counted":{"type":"boolean","description":"Whether it adds to the counts now: always in `yours`; in `admin`, when no one else decides it by their own right, or it expires within two hours."},"countsFrom":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}],"description":"When an `admin` item that does not count yet starts counting, two hours before it expires; null otherwise."},"waitingSince":{"description":"Since when it waits: the start of a file's current round, or when the sign-off, card, request or fix was made.","$ref":"#/components/schemas/IsoDateTime"},"expiresAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}],"description":"When it expires: an agent's card only; null for every other kind, which never expires."}},"required":["kind","approval","decidesAs","group","counted","countsFrom","waitingSince","expiresAt"]},"WaitingTruncated":{"type":"object","properties":{"flow":{"type":"boolean","description":"Whether more flow sign-offs may wait than the answer holds."},"file":{"type":"boolean","description":"Whether more file approvals may wait than the answer holds."},"agent":{"type":"boolean","description":"Whether more agents' request cards may wait than the answer holds."},"access":{"type":"boolean","description":"Whether more \"Ask to edit\" requests may wait than the answer holds."},"question":{"type":"boolean","description":"Whether more flow runs' question cards may wait than the answer holds."},"health_fix":{"type":"boolean","description":"Whether more Health fixes may wait than the answer holds."},"fleepr_weekly":{"type":"boolean","description":"Whether more of Fleepr's weekly items may wait than the answer holds."}},"required":["flow","file","agent","access","question","health_fix","fleepr_weekly"]},"Webhook":{"type":"object","properties":{"id":{"description":"The webhook's id, sent with each delivery in the `Fleepr-Webhook-Id` header.","$ref":"#/components/schemas/WebhookId"},"organizationId":{"description":"The organization the webhook belongs to.","$ref":"#/components/schemas/OrganizationId"},"name":{"type":"string","description":"A name that says where events go, such as \"Zapier: approvals to Slack\"."},"url":{"description":"The address deliveries are posted to: public HTTPS on port 443.","$ref":"#/components/schemas/Url"},"events":{"type":"array","items":{"$ref":"#/components/schemas/WebhookEventType"},"description":"The events sent to the address, such as `file.created`."},"active":{"type":"boolean","description":"Whether the webhook sends events; an inactive one sends nothing."},"disabledReason":{"anyOf":[{"$ref":"#/components/schemas/WebhookDisabledReason"},{"type":"null"}],"description":"`failing` when Fleepr turned the webhook off after its deliveries failed for 3 days and at least 10 attempts in a row; null otherwise."},"pausedReason":{"anyOf":[{"$ref":"#/components/schemas/WebhookPausedReason"},{"type":"null"}],"description":"Why Fleepr turned it off: its owner was removed (`owner_deactivated`) or made a viewer (`owner_made_viewer`), or whoever last set its address or events can no longer manage webhooks (`address_setter_lost_access`). Null otherwise; it stays set until someone turns the webhook on again."},"failingSince":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}],"description":"When the event deliveries' current run of failures started; null while they succeed."},"lastDeliveryAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}],"description":"When a delivery was last attempted; null before the first."},"secretPrefix":{"type":"string","description":"The signing secret's first 12 characters, `whsec_` and 6 more, to tell which secret a receiver holds."},"ownerId":{"description":"The member who added the webhook; each delivery holds only what they may see.","$ref":"#/components/schemas/MemberId"},"createdAt":{"description":"When the webhook was added.","$ref":"#/components/schemas/IsoDateTime"},"updatedAt":{"description":"When the webhook last changed.","$ref":"#/components/schemas/IsoDateTime"},"revision":{"description":"Grows by one on every change to the webhook; send it back as `expectedRevision` when you update it.","$ref":"#/components/schemas/Revision"}},"required":["id","organizationId","name","url","events","active","disabledReason","pausedReason","failingSince","lastDeliveryAt","secretPrefix","ownerId","createdAt","updatedAt","revision"]},"WebhookDelivery":{"type":"object","properties":{"id":{"description":"The delivery's id, sent in the `Fleepr-Delivery-Id` header; a redelivery has a new one.","$ref":"#/components/schemas/WebhookDeliveryId"},"webhookId":{"description":"The webhook it was sent to.","$ref":"#/components/schemas/WebhookId"},"kind":{"description":"`event`: an event as it happened; `test`: a test ping; `redelivery`: an event sent again.","$ref":"#/components/schemas/WebhookDeliveryKind"},"eventId":{"anyOf":[{"$ref":"#/components/schemas/WebhookEventId"},{"type":"null"}],"description":"The event's id as the receiver gets it, the same on every attempt and redelivery, so receivers drop repeats; null for a test."},"eventType":{"anyOf":[{"$ref":"#/components/schemas/WebhookEventType"},{"type":"string","const":"webhook.test"}],"description":"The type of the event sent, or `webhook.test` for a test ping."},"status":{"description":"`pending`: not tried yet; `retrying`: failed, tried again at `nextAttemptAt`; `delivered`: the receiver answered 2xx; `failed`: given up, after 24 hours of retries or a test's one attempt; `skipped`: never sent.","$ref":"#/components/schemas/WebhookDeliveryStatus"},"attempts":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many times Fleepr has tried to send it."},"responseStatus":{"anyOf":[{"type":"integer","minimum":100,"maximum":599},{"type":"null"}],"description":"The HTTP status of the receiver's last answer; null when no answer came."},"failure":{"anyOf":[{"$ref":"#/components/schemas/WebhookFailureCode"},{"type":"null"}],"description":"Why the last attempt failed, such as `timeout` or `status` (an answer other than 2xx); null when it did not fail."},"skipReason":{"anyOf":[{"$ref":"#/components/schemas/WebhookSkipReason"},{"type":"null"}],"description":"Why it was never sent, such as `no_access` (the webhook's owner may not see the item); null unless `skipped`."},"createdAt":{"description":"When the delivery was queued.","$ref":"#/components/schemas/IsoDateTime"},"lastAttemptAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}],"description":"When it was last tried; null before the first attempt."},"nextAttemptAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}],"description":"When it will be tried again; null when no attempt is due."},"deliveredAt":{"anyOf":[{"$ref":"#/components/schemas/IsoDateTime"},{"type":"null"}],"description":"When the receiver accepted it; null unless `delivered`."},"redeliveryOf":{"anyOf":[{"$ref":"#/components/schemas/WebhookDeliveryId"},{"type":"null"}],"description":"The delivery this one sends again; null unless it is a redelivery."}},"required":["id","webhookId","kind","eventId","eventType","status","attempts","responseStatus","failure","skipReason","createdAt","lastAttemptAt","nextAttemptAt","deliveredAt","redeliveryOf"]},"WebhookDeliveryId":{"type":"string","pattern":"^whd_[0-9a-hjkmnp-tv-z]{26}$"},"WebhookDeliveryKind":{"type":"string","enum":["event","test","redelivery"]},"WebhookDeliveryPage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/WebhookDelivery"},"description":"This page of the list."},"nextCursor":{"anyOf":[{"$ref":"#/components/schemas/Cursor"},{"type":"null"}],"description":"Send it back as `cursor` to read the next page; null on the last page."}},"required":["items","nextCursor"]},"WebhookDeliveryStatus":{"type":"string","enum":["pending","retrying","delivered","failed","skipped"]},"WebhookDisabledReason":{"type":"string","enum":["failing"]},"WebhookEventId":{"type":"string","pattern":"^(?:evt_[0-9a-f]{32}|0|[1-9][0-9]{0,18})$"},"WebhookEventType":{"type":"string","enum":["file.created","file.version_added","record.created","record.updated","approval.decided","approval.completed"]},"WebhookFailureCode":{"type":"string","enum":["address_refused","timeout","network","redirect","status","secret_missing"]},"WebhookId":{"type":"string","pattern":"^whk_[0-9a-hjkmnp-tv-z]{26}$"},"WebhookList":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Webhook"},"description":"The organization's webhooks, newest first, at most 20."}},"required":["items"]},"WebhookPausedReason":{"type":"string","enum":["owner_deactivated","owner_made_viewer","address_setter_lost_access"]},"WebhookSkipReason":{"type":"string","enum":["no_access","owner_cannot_act","webhook_off","event_gone"]},"WebhookTestBody":{"type":"object","properties":{"v":{"type":"number","const":0,"description":"The version of the event envelope."},"kind":{"type":"string","const":"test","description":"A test: no event, nothing changed."},"id":{"description":"The test delivery's id, also sent as `Fleepr-Event-Id` and `Fleepr-Delivery-Id`.","$ref":"#/components/schemas/WebhookDeliveryId"},"type":{"type":"string","const":"webhook.test","description":"Always `webhook.test`."},"organizationId":{"description":"The organization the webhook belongs to.","$ref":"#/components/schemas/OrganizationId"},"occurredAt":{"description":"When the test was sent.","$ref":"#/components/schemas/IsoDateTime"},"webhookId":{"description":"The webhook that sent it, also sent as `Fleepr-Webhook-Id`.","$ref":"#/components/schemas/WebhookId"},"payload":{"type":"object","properties":{"webhook":{"type":"object","properties":{"id":{"description":"The webhook's id.","$ref":"#/components/schemas/WebhookId"},"name":{"type":"string","description":"The webhook's name, as Settings shows it."}},"required":["id","name"],"description":"The webhook that sent the test."}},"required":["webhook"],"description":"What the test carries: only the webhook."}},"required":["v","kind","id","type","organizationId","occurredAt","webhookId","payload"]}},"securitySchemes":{"session":{"type":"apiKey","in":"cookie","name":"__Host-fleepr_session","description":"The session of a signed-in person: a cookie the API sets when they sign in, which no script can read (`HttpOnly`). The web app sends it with every request, and so does Test Request on this page. Scripts use an API key instead."},"review":{"type":"apiKey","in":"cookie","name":"__Host-fleepr_review","description":"A guest's review session: the cookie the public review page gets when it opens an approval link. It is sent to the public review endpoints only."},"apiKey":{"type":"http","scheme":"bearer","description":"An organization API key, sent as `Authorization: Bearer flk_...`, for scripts, automations and outside agents. The organization's owner and admins make keys in Settings, API keys. A key acts as the member who made it, limited by its scope (read only, or read and write). A request that sends a key is the key's, even with a session cookie."}}}}