{"openapi":"3.1.0","info":{"title":"Moxo API","version":"3.0.0","description":"The Moxo API lets your own systems start and run flows, act on their steps, build templates and read what happened.\n\nThe base URL is your region's API address: `https://api.moxo.com` (US), `https://api.eu.moxo.com` (EU), `https://api.au.moxo.com` (Australia) or `https://api.sg.moxo.com` (Singapore). A token works only in the region your organization is in. Every REST path starts with `/v1`, and requests and responses are JSON.\n\n## Quick start\n\n1. Create a personal access token in **Settings → Personal access tokens**. It needs the **Personal access tokens** permission, which Owner and Admin have and an admin turns on for other groups. It is shown once, so store it in a secret manager.\n2. List your templates:\n\n```bash\ncurl https://api.moxo.com/v1/templates \\\n  -H \"Authorization: Bearer mxo_pat_YOUR_TOKEN\"\n```\n\n3. Start a flow from one of them, giving each role a person who is already a user in your organization:\n\n```bash\ncurl -X POST https://api.moxo.com/v1/templates/tmpl_123/start \\\n  -H \"Authorization: Bearer mxo_pat_YOUR_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"name\": \"Acme onboarding\",\n    \"roleAssignments\": [\n      { \"roleId\": \"role-customer\", \"email\": \"ana@example.com\" }\n    ]\n  }'\n```\n\nThe response carries the new flow's `id`. Read the flow with `GET /v1/flows/{id}`. [Run flows from code](/docs/guides/run-flows-from-code) continues from here, in Node.js and Python.\n\n## Authentication\n\nSend a token in the `Authorization` header of every request:\n\n```\nAuthorization: Bearer mxo_pat_...\n```\n\nThere are two kinds of token:\n\n- **Personal access token** (`mxo_pat_`): acts as you, with your permissions in Moxo. Use it for scripts, for trying the API and for anything done as yourself. It expires by default.\n- **Organization API key** (`mxo_sk_`): your organization's credential for systems that run unattended. It is limited to the scopes you give it, can be limited to IP ranges, and does not depend on any one person's account.\n\nA personal access token sees exactly what its person sees in Moxo, so an admin's token sees what an admin sees. An organization API key sees what an admin sees, within its scopes.\n\nCreate a personal access token in **Settings → Personal access tokens**, and an organization API key in **Settings → API keys** (admins). A token is shown once, when you create it, so store it in a secret manager.\n\n### Scopes\n\nEach endpoint names the scope an organization API key needs to call it. A `:write` scope includes its `:read` scope, so `flows:write` covers `flows:read`. Give a key only the scopes it needs.\n\n- `flows:read`: list and read flows, their steps and their history.\n- `flows:write`: start, cancel and complete flows and steps.\n- `templates:read`: list and read templates, their published versions, outlines and files, and run a template's publish checks.\n- `templates:write`: includes `templates:read`. Building, changing, publishing and deleting a template act as a person, so they take a personal access token whatever the key holds.\n- `external_users:read`: list and read external users and accounts.\n- `external_users:write`: create, change and delete external users and accounts.\n- `reports:read`: read dashboards, SLA and bottleneck reports.\n- `data_tables:read`: list data tables and read their columns and records.\n- `data_tables:write`: create and change tables, columns and records, and import a CSV.\n- `relationships:read`: list relationships and read one, by its id or your own external reference.\n- `relationships:write`: create a relationship, change one, delete one, and sync or import a batch. A key holding this acts for the whole organization, as an admin does in the app.\n- `chat:read`: read the chat inside a flow (`GET /v1/flows/{id}/messages`).\n- `conversations:read`: list and read conversations, both group conversations and flow chats.\n- `conversations:write`: create, change, archive and delete conversations, manage their members and send messages.\n- `actions:read`: list and read the actions your organization has sent or received (`GET /v1/actions`), and the action webhooks (`GET /v1/organization/action-webhooks`).\n- `actions:write`: includes `actions:read`. Set the action webhooks and send them a test (`/v1/organization/action-webhooks`). Sending an action, reminding people about it and canceling it act as a person, so they take a personal access token.\n- `team:read`: list internal users, pending invitations, personas and permission groups.\n- `team:write`: invite internal users, and change an internal user with `PATCH /v1/users/{id}`, their persona included. Creating and changing personas and permission groups themselves acts as a person, so it takes a personal access token.\n- `users:email`: change the email an external user signs in with (`email` on `PATCH /v1/users/{id}`), for someone your organization knows by a unique ID. The key also needs `external_users:write`, which every change on `PATCH /v1/users/{id}` takes. `*` does not include it: name it when you create the key.\n- `users:unique_id`: change the unique ID of an external user your organization already knows by one (`uniqueId` on `PATCH /v1/users/{id}`). The old ID is recorded in the audit log. The key also needs `external_users:write`, which every change on `PATCH /v1/users/{id}` takes. `*` does not include it: name it when you create the key.\n- `audit:read`: read the organization's audit log.\n- `ai:generate`: ask the AI builder for a draft template (`POST /v1/ai/generations`) and read your own generation jobs.\n- `sdk:mint`: create short-lived SDK session tokens for your users (`POST /sdk/auth/sessions`). A session has its user's own permissions for running and building work, not the key's scopes and never an admin's, and works only in the embedded screens and the `/sdk` calls: `/v1` and the MCP server refuse it.\n- `*`: every scope except `users:email` and `users:unique_id`.\n\nA personal access token has no scopes. It can do through the API what its person can do in the app, as set in **People → Orchestrator permissions**, and it works only while that permission includes **Personal access tokens**: turned off, the token answers `403 CAPABILITY_DENIED` until it is turned back on.\n\n### Which token each endpoint takes\n\nTwo things are done only in the app, never with a token:\n\n- Managing API keys, so that no token can create another.\n- Billing and plan changes.\n\nEvery other `/v1` endpoint that takes a token accepts a personal access token, and most accept an organization API key with the right scope. Endpoints that act as a person need a personal access token:\n\n- Completing, declining, preparing or reviewing your own step, or picking a record on it.\n- Reading, marking or approving the items you review together.\n- Force-completing a step.\n- Posting, editing, deleting, resolving, pinning or reacting in a flow's chat, and getting files ready for a message.\n- Filling in, writing or restoring a flow's artifacts, and reading a document's versions (an organization API key with `flows:read` reads the artifacts).\n- Filing a flow under tags.\n- Reading or taking part in a step's document collaboration: the page, sending, approving, drafting, comments and a manager's upload or reminder.\n- Reading or changing a Prepare document, the Word file a person prepares before signing.\n- Writing a flow note (an organization API key with `flows:read` reads them).\n- Starting an adaptive flow with no template.\n- Sending an action, reminding people about it or canceling it.\n- Deleting a template.\n- Restoring a template version.\n- Starting a test run.\n- Listening for a webhook test event, and reading what it started.\n- Making, renaming, moving or removing a template folder.\n- Building, changing or publishing a template, with or without AI.\n- Reading an AI agent as a file.\n- Creating, changing or publishing an AI agent (an organization API key with `templates:read` reads them).\n- Changing a template's setup (an organization API key with `templates:read` reads it).\n- Setting up how a template starts, and reading its email start (an organization API key with `templates:read` reads its schedules and app triggers).\n- Making, renaming or removing folders in a conversation's files.\n- Joining a group conversation you can read.\n- Leaving a group conversation.\n- Handing a group conversation to a teammate.\n- Managing a group conversation.\n- Opening a relationship’s conversation.\n- Creating, changing or deleting personas and permission groups, and taking a persona from someone (an organization API key with `team:read` reads them).\n- Listing the steps waiting on you.\n- Reading your meetings and linking them to work.\n- Reading your own profile (an organization API key reads people with `GET /v1/users`).\n- Unread counts and read markers.\n\nThe Headless SDK's `/sdk/v1/*` endpoints take only a short-lived SDK session token, created with `POST /sdk/auth/sessions`, and refuse personal access tokens and organization API keys. Self-serve signup's `/v1/provision/*` endpoints take no token: the verified email and its single-use grant are the credential.\n\n## Key concepts\n\nFour words cover most of this reference. The [Glossary](#tag/glossary) defines the rest.\n\n- **Template**: the process you design and publish.\n- **Flow**: one run of a template, started for a specific case.\n- **Step**: one piece of work in a flow, done by a person, an AI or an automation.\n- **Role**: who does a step, such as Client or Reviewer. Each role is filled with real people when a flow starts.\n\n## Pagination\n\nMost lists page with `limit` and `offset`. Each page includes `pagination.total` and `pagination.hasMore`. For the next page, add `limit` to `offset`:\n\n```bash\ncurl \"https://api.moxo.com/v1/flows?limit=50&offset=50\" \\\n  -H \"Authorization: Bearer mxo_pat_YOUR_TOKEN\"\n```\n\nA list filtered by `updatedSince`, and any list that says so, pages with `cursor` instead: send `pagination.nextCursor` back as it is, with the same filters. A changed cursor returns `400 INVALID_CURSOR`.\n\nEvery call reads its query parameters as its reference lists them. A parameter the call does not list returns `400 UNKNOWN_PARAMETER` naming it. A `limit` or `offset` outside the listed range, a value a filter does not take, or a parameter sent twice returns `400 VALIDATION_FAILED` naming it. Nothing is clamped or ignored.\n\n## Idempotency\n\nEndpoints that create or send something, such as a flow, a user or an email, accept an optional `Idempotency-Key` header; each one lists it among its parameters. Send a new UUID with each request. If the request fails on the network, retry it with the same key: for 10 minutes, a retry returns the first response and changes nothing. A key is up to 256 letters, digits, `-`, `_`, `:` or `.`; any other key returns `400 INVALID_IDEMPOTENCY_KEY` and nothing runs.\n\n- **Still running:** a second request with the same key returns `425 IDEMPOTENT_REQUEST_PENDING` with `Retry-After`. Retry after that many seconds.\n- **After a `4xx`:** nothing was saved, so the key is free. Fix the request and send it again with the same key.\n- **After a `5xx`:** the change may have been made, so the key stays held for the 10 minutes and retries with it return `425`. To retry sooner, use a new key and accept that the change may happen twice.\n- **After 10 minutes:** the same key runs the request again. A late retry can start a second flow or send a second email, so use a new key for it.\n- **Reused for a different request:** a key sent again with another body, path, query or method returns `422 IDEMPOTENCY_KEY_REUSED` and nothing runs; the first request's result stays. Use a new key for each request.\n- **What the first request made was deleted:** a retry returns `410 IDEMPOTENCY_RESULT_LOST`. Check what happened, then use a new key.\n- **Per token:** two tokens can use the same key without affecting each other.\n\nA retry of a call that creates something returns that thing as it is now, read again, not as it was. A retry of a call that sends a reminder or an invitation returns the same `{ \"success\": true }` as the first call. The guarantee covers the change the first call made, not the delivery of the email it sent.\n\nEndpoints that set something to a fixed state, such as `PATCH`, `DELETE`, activate or skip, ignore the header: repeating them is already safe.\n\n## Response format\n\nA successful response has `success: true` and the result in `data`:\n\n```json\n{\n  \"success\": true,\n  \"data\": { \"id\": \"flow_123\" }\n}\n```\n\nRarely, a change is saved but its full response can't be put together. The response then keeps its success status and carries `success: true`, the `id` of what changed in `data`, and `changed` and `message` when the endpoint returns them. The change is made, so don't send the request again: read the resource to see the rest.\n\nAn error response has `success: false` and the details in `error`:\n\n```json\n{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"NOT_FOUND\",\n    \"message\": \"Flow not found\",\n    \"requestId\": \"req_abc123\"\n  }\n}\n```\n\n## Errors\n\nAn error response has an HTTP status, an `error.code` your code can act on, and an `error.message` that says what went wrong. A request that fails its schema check returns `400 VALIDATION_FAILED`, and `error.details` names each field. Each endpoint lists the errors it returns, and [Errors](#tag/errors) lists every code with what to do. Include `error.requestId` when you contact support.\n\n## Rate limits\n\n- 1,000 requests per minute for each token. Past it, a request returns `429 RATE_LIMITED`.\n- 10 failed tokens per 15 minutes from one IP address: a token that is mistyped, expired or revoked, or sent from an address the key does not allow. Past it, every request from that address returns `429 AUTH_BRUTEFORCE_LIMIT`, even with a good token, until the window passes.\n- 20 actions an hour from one person into each conversation, and 20 from no conversation (`POST /v1/actions`). Past it, the call returns `429 TOO_MANY_REQUESTS` with `error.retryAt`, when sending works again. For this code, wait for `Retry-After`, not the `RateLimit` reset.\n\nEach response carries a `RateLimit` header (`limit`, `remaining`, and `reset` in seconds) and a `RateLimit-Policy` header. A `429` carries `Retry-After`: wait that many seconds, then retry.\n\n## Knowledge limits\n\n- A knowledge file can be up to 100 MB, and about 5 million tokens of text. Text past that is read in part, and the file says so.\n- An agent holds up to 500 files and 1 GB of knowledge. Files shared in its setup chat have their own 500 files and 1 GB. A Google Drive folder or a website counts as one source.\n- What counts is the agent's draft. A file only a published version still uses does not count: it stays for the flows that run on that version.\n- The organization library holds up to 1,000 files and sources and 10 GB.\n- A website crawl reads up to 500 pages in 20 minutes, and follows the site's robots.txt.\n- These are the standard limits. Moxo can raise an organization's agent and library limits on request.\n- A request past a limit answers `400` with a sentence that says the limit, what is used, and what to do next.\n\n## Versioning and changelog\n\nThis reference describes version 3.0.0 of the API, which `GET /v1/health` also returns. The [changelog](/v1/changelog) lists every change with its date and, when one applies, how to migrate.\n\nA renamed field keeps working. This reference shows only the new name, but a request that sends the older one is still read as the new one, and its answer carries a `Deprecation` header (`RFC 9745`) with a `Link` to the changelog (`rel=\"deprecation\"`). An answer keeps sending each renamed field beside its new one, marked deprecated here. No date is set for an older name to stop working; send the new one.\n\nA setting that went with a removed feature is ignored, not refused: nothing is stored, and the answer carries a `Warning` header that names it (`299 - \"<name> is no longer used; it was ignored.\"`). An older way to write the same thing, such as a reference written `{Intake / Email}`, is read as the current one and named the same way.\n\n## Guides\n\n- [Run flows from code](/docs/guides/run-flows-from-code): start flows, complete steps and read the results, in Node.js and Python.\n- [Build templates from code](/docs/guides/build-templates-from-code): create, change, check and publish templates with a list of changes.\n- [Templates as files](/docs/guides/templates-as-files): keep a template in a repository as a `.yaml` file, and push your edits.\n- [Agents as files](/docs/guides/agents-as-files): keep an AI agent in a repository as a `.yaml` file, and push your edits to its draft.\n- [Webhooks](/docs/guides/webhooks): get an HTTP request when a flow, step or action changes, and verify that it came from Moxo.\n- [llms.txt](/llms.txt): the machine-readable index of these docs, for AI coding assistants.\n- [The whole reference as markdown](/docs/reference.md)\n\nAll guides are at [/docs/guides](/docs/guides). To connect an AI agent, see the [MCP server](/docs/mcp). To put Moxo inside your own app, see the [Web SDK](/docs/sdk) and the [Headless SDK](/docs/headless)."},"servers":[{"url":"https://api.moxo.com","description":"US"},{"url":"https://api.eu.moxo.com","description":"EU"},{"url":"https://api.au.moxo.com","description":"Australia"},{"url":"https://api.sg.moxo.com","description":"Singapore"}],"security":[{"bearerAuth":[]}],"tags":[{"name":"Flows","description":"Start, list, cancel and manage flows. A flow is one run of a template."},{"name":"Steps","description":"A step is one piece of work inside a flow; the app also calls it an action. This section covers everything you can do to a step: complete it, decline it, give it to someone else, give the assignee the material they need, or step in and move it along yourself.\n\n## Who each endpoint is for\n\nEvery step has an **assignee**, the person whose turn it is, and every flow has **flow managers**, who run it. Calling one side's endpoint for the other is the most common mistake here, so the flow manager endpoints are labeled `(manager)`. The rest are the assignee's own actions, or work from either side.\n\n- **Assignee**, doing their own work: `complete`, `decline`, `prepare-complete`, `review-approve`, `review-decline`, `resolve-output`, and uploading to `files`.\n- **Flow manager**, acting on someone else's step: `attachments`, `reassign`, `remind`, `skip`, `reopen`, `retry`, `force-complete`.\n\nEither side can read, download and delete a step's files, and `GET` the step itself.\n\nTwo things follow from that split:\n\n- **Assignee endpoints need a personal access token.** An organization API key is not a person, so it can't record a person's work. Those endpoints return `403 ASSIGNEE_REQUIRED` to a key. Flow manager endpoints accept either token.\n- **`complete` and `force-complete` record different things.** `complete` records that the work was done: by the assignee, or by a flow manager who holds no part in the step, which is recorded as done on the assignee's behalf (`completedOnBehalfOf` on the step, \"on behalf of\" in the audit log). `force-complete` records that a flow manager closed the step without its work, with a reason. The audit trail shows the difference.\n\n**Naming a step.** `stepId` takes either the step's template id (`step-2`, which exists before the step starts and stays the same when it is reopened) or its execution id (one run of the step). Four endpoints are narrower, and each says so on its own `stepId`:\n\n- `retry` takes an execution id only, because it names the run that failed. Its parameter is `{stepExecId}`.\n- `resolve-output` takes an execution id only. A template step id returns `404`.\n- `prepare-complete` takes a template id only. To name one run of a repeating step, add `?stepExecutionId=`.\n- `GET` on a step finds top-level steps only, so a step that is only inside `steps[].paths[]` returns `404`.\n\nWhen a step runs once for each item, several runs share one template id. What a template id then means depends on the endpoint, and each endpoint's `stepId` says which. In short: the flow manager actions take the run in progress and return `409 AMBIGUOUS_STEP` while several are open; the review actions take the run awaiting review and return `404` if there is none; `reopen` and `GET` on a step refuse as soon as the step has more than one run (`GET` lists the runs' ids); `prepare-complete` returns `400 EXECUTION_REQUIRED`; `reassign` takes the first run with that id. Naming the run by its execution id avoids the question wherever an execution id is accepted.\n\n## Giving material vs. collecting work\n\nTwo endpoints move files in opposite directions:\n\n- **`POST .../steps/{stepId}/files`**: the assignee **hands work in**. The file becomes part of their submission when the step is done, and until then only the person who uploaded it can see it. You act as the assignee.\n- **`POST .../steps/{stepId}/attachments`**: you **hand material out**. The file appears as **Reference materials** on the step, and the assignee sees it **immediately**. You act as a flow manager.\n\n**To show someone a document, use `attachments`.** A file uploaded through `files` belongs to a draft submission that only its uploader can see, so a file you upload for an assignee is one they never see. The call still returns `201`.\n\n### Giving each run its own documents\n\nA flow often needs documents that differ each time it runs: a contract, a statement, a personal letter. Attachments on the template can't do this, because they are the same for every run. Attach the documents when the flow starts instead:\n\n```bash\n# 1. Start the flow\nPOST /v1/templates/{templateId}/start {\"roleAssignments\":[{\"roleId\":\"role-customer\",\"email\":\"ana@example.com\"}]} -> { \"data\": { \"id\": \"flow_123\" } }\n\n# 2. Attach this run's document to the step that needs it.\n#    The step doesn't need to have started.\nPOST /v1/flows/flow_123/steps/step-2/attachments\n{ \"kind\": \"file\", \"fileName\": \"agreement.pdf\", \"fileSize\": 51200, \"mimeType\": \"application/pdf\" }\n\n# 3. Upload the bytes, with requiredHeaders exactly as returned\nPUT  {uploadUrl}\n\n# 4. Only if the response included completionUrl:\nPOST {completionUrl}\n```\n\nBy the time the client reaches step 2, the document is waiting for them.\n\n> **Steps 3 and 4 are required.** The upload URL's signature covers `requiredHeaders`, so a `PUT` without them is refused. When the response includes `completionUrl`, calling it starts the file's safety check, and without that call nobody is shown the file. Both apply to `files` uploads too.\n\nA web link works the same way, with no upload:\n\n```json\n{ \"kind\": \"link\", \"url\": \"https://example.com/policy\", \"title\": \"Privacy policy\" }\n```\n\n## Completing a step\n\nThe body of `POST /v1/flows/{id}/steps/{stepId}/complete` depends on the step type, and is always a JSON object: send `{}` when there is nothing to say. To see what a step expects, read it with `GET /v1/flows/{id}/steps/{stepId}` (`steps[].id` from `GET /v1/flows/{id}` names it): each type below says where its ids are. Each body below is sent to a real server in Moxo's automated tests.\n\nCall `complete` as the person whose turn it is, with their personal access token, or as someone covering for them. A flow manager, the flow's owner or an admin who holds no part in the step can also complete it with `complete`: it is recorded as done by them on behalf of the step's assignee (`completedOnBehalfOf` on the step, and \"on behalf of\" in the audit log). To close a step without its work and show that it was forced, use `POST /v1/flows/{id}/steps/{stepId}/force-complete` with a `reason`.\n\n### Form\n\nSend each answer in `resultData`, keyed by the field's `fieldId`. `GET /v1/flows/{id}/steps/{stepId}` lists the fields in `formFields`, each with its `fieldId`, its type and, for a choice, the `value` of each option. A field's `key` or label in place of its id returns `400 VALIDATION_FAILED` naming the id to send. A table takes a list of rows, each cell keyed by its column's id, `key` or label; it is stored under the label. A column named twice in one row, or one the table doesn't have, returns `400 VALIDATION_FAILED` naming it.\n\n```json\n{\n  \"resultData\": {\n    \"fld-company\": \"Acme\",\n    \"fld-employees\": 250\n  }\n}\n```\n\n### Questionnaire\n\nSend each answer in `resultData`, keyed by the question's id. `GET /v1/flows/{id}/steps/{stepId}` lists the questions in `formFields`, each with its id as `fieldId` and, for a choice, the `value` of each option. A question's text in place of its id, or the answers wrapped in `{ \"answers\": { … } }`, returns `400 VALIDATION_FAILED` naming what to send.\n\n```json\n{\n  \"resultData\": {\n    \"q-risk\": \"Moderate\"\n  }\n}\n```\n\n### Poll\n\nSend your vote in `resultData.answers`: for each question, a list with the option you chose (several when the question allows more than one). A question is named by its `questionId` and an option by its `value`: `GET /v1/flows/{id}/steps/{stepId}` lists them in `pollQuestions`, each question with its `questionId`, `allowMultiple`, `allowOther` and `options` (`value`, `label`). For an \"Other\" answer, send `\"__other__\"` and the text in `resultData.otherText`, keyed by the question. Send the step's `askedFingerprint` back beside `resultData`: when the poll changed since you read it, the vote is not recorded and the call returns `409 STEP_CHANGED`. Read the step again and vote on what it asks now.\n\n```json\n{\n  \"resultData\": {\n    \"answers\": {\n      \"q1\": [\n        \"o1\"\n      ]\n    }\n  },\n  \"askedFingerprint\": \"af1-3b0c9e14a2d75f68\"\n}\n```\n\nA vote is recorded when you send it. The poll completes when everyone has voted, or earlier when the poll is set to close on a majority.\n\n### Checklist\n\nSend each item's status in `resultData.checklistState`, keyed by its `itemId`. `GET /v1/flows/{id}/steps/{stepId}` lists the items in `checklistItems`, each with its `itemId`, `label` and `status`. Every item must be `DONE` or `SKIPPED` (or one of the statuses the template allows, `config.checklist.completionStatuses`); otherwise the call returns `400 CHECKLIST_INCOMPLETE`. An item you leave out keeps the status it has.\n\n```json\n{\n  \"resultData\": {\n    \"checklistState\": {\n      \"item-documents\": {\n        \"status\": \"DONE\"\n      },\n      \"item-signature\": {\n        \"status\": \"SKIPPED\"\n      }\n    }\n  }\n}\n```\n\n### Approval\n\nTo approve, send `\"decision\": \"APPROVED\"`. Without it the call returns `400 VALIDATION_FAILED`, and `error.details` says what to send. To send the step back for changes, or to reject it, call `decline`: see \"Declining an approval\" below.\n\n```json\n{\n  \"resultData\": {\n    \"decision\": \"APPROVED\"\n  }\n}\n```\n\n### Acknowledgement\n\nSend an empty object. Completing the step is the acknowledgement. A call with no body at all returns `400 VALIDATION_FAILED`.\n\n```json\n{}\n```\n\n### File request\n\nUpload each file with `POST /v1/flows/{id}/steps/{stepId}/files` (then `PUT` the bytes to `uploadUrl` with `requiredHeaders`, and call `completionUrl` when the response has one). Then complete the step with the `fileId`s you got back. With no file, the call returns `400 VALIDATION_ERROR`.\n\n```json\n{\n  \"resultData\": {\n    \"files\": [\n      \"file-statement\"\n    ]\n  }\n}\n```\n\n### Decision\n\nSend the chosen option's `outcomeId` (its `key` returns `400 VALIDATION_FAILED` naming the id). A step's `outcomes` list its options as `{ outcomeId, key, label }`, on `GET /v1/flows/{id}/steps/{stepId}` and on each step of `GET /v1/flows/{id}`, including a decision added to a running flow.\n\n```json\n{\n  \"resultData\": {\n    \"outcomeId\": \"o-approve\"\n  }\n}\n```\n\n### To-do\n\nSend an empty object when the task is done.\n\n```json\n{}\n```\n\n### PDF form\n\nSend each answer in `resultData.fieldValues`, keyed by the PDF field's `fieldId`, as text. The fields are in the step's settings, `config.pdfForm.fields` (`GET /v1/flows/{id}/steps/{stepId}/settings`, for a flow manager), and in the template. A required field left out returns `400 VALIDATION_FAILED`. `fieldValues` must be inside `resultData`: at the top level it is not read as the PDF's answers.\n\n```json\n{\n  \"resultData\": {\n    \"fieldValues\": {\n      \"f-company\": \"Acme Holdings\"\n    }\n  }\n}\n```\n\n### Document review\n\nSend an empty object when the review is done. Comments on the document are made in Moxo; completing the step makes the reviewed copy from them. If the reviewed copy can't be made, the call returns `500 REVIEWED_COPY_FAILED`: send it again.\n\n```json\n{}\n```\n\n### Prepare document\n\nSend an empty object to submit the document as it stands. The assignee edits it first with the Prepare document calls: `GET /v1/flows/{id}/steps/{stepExecId}/prepared-document` reads the versions, `POST …/prepared-document/versions` uploads an edited Word copy, and `POST …/prepared-document/versions/{versionId}/restore` makes an earlier version the latest. Completing submits that latest version. The step records the PDF as `prepared_document` and the Word file as `prepared_document_word`. Anything sent in their place is ignored. With no file for the latest version, the call returns `409 PREPARED_DOCUMENT_MISSING`. A placeholder still written as `{{name}}` returns `422 UNFILLED_PLACEHOLDERS`, and `error.details.placeholders` names each one. While someone else has the document open in Moxo, it returns `409 EDITING_BY_OTHER`. While the latest changes are still saving, `409 STILL_SAVING`. While the PDF is still being made, `409 CHECK_PENDING`. When a later e-sign step's signature block is no longer in the document, `422 SIGNATURE_BLOCK`. If the PDF can't be made, `503 PDF_FAILED`: send it again. `force-complete` closes the step with the document as it stands and does not refuse for those checks. When no PDF can be made that way, the step completes with the Word file only and `preparedDocumentPdfMissing` on the result says why.\n\n```json\n{}\n```\n\n### Web app\n\nSend an empty object when the work in the web app is done. Who may complete it is set on the step: one the web app finishes with its own call (`completionMode: \"WEBHOOK\"`) returns `409 COMPLETION_REQUIRES_WEBHOOK`, and one set for your team to confirm (`manualCompletedBy: \"member\"`) is completed by a person of your organization. For a page uploaded to Moxo, the answers are what the person entered on the page; anything sent with `complete` in their place is ignored.\n\n```json\n{}\n```\n\n### Declining an approval\n\nCall `POST /v1/flows/{id}/steps/{stepId}/decline` with a `reason`, which the audit trail and the requester see. Call `decline` as an approver whose turn it is, with their personal access token: the decline is recorded on their seat. An approver may decline their own approval whether or not they manage the flow. A flow manager, the flow's owner or an admin who isn't one of the step's open approvers gets `410 NO_ACTIVE_SLOT`, and anyone else gets `403 FORBIDDEN`. What it does depends on the approval's `onReject` setting. By default (`approver_decides`, or `revise_and_resubmit`) it sends the step back for changes: the earlier steps it names reopen (`targetStepIds`, each an execution id from `steps[].id` or a template step id, when the approver picks them), and the approval asks again when they are done.\n\n```json\n{\n  \"reason\": \"The bank statement is missing.\"\n}\n```\n\nWhen the approval's `onReject.action` is `end_flow` (the flow ends) or `rejection_steps` (the steps in `rejectBranch` run), a decline rejects. Send `\"action\": \"reject\"` to say so. Each approval offers only what its `onReject` allows: `reject` on an approval that sends back, or `request_changes` on one that rejects, returns `400 VALIDATION_ERROR`, and `error.details` names the `onReject` values that allow it. To make an approval rejectable, set `onReject` on the step when you build the template.\n\n```json\n{\n  \"reason\": \"Outside our lending policy.\",\n  \"action\": \"reject\"\n}\n```\n\n### Steps finished another way\n\nThese steps finish when their own work is done, in Moxo or in the service they use, and the step records that work (a signature, a payment, a booking). Wait for them: completing one by hand records none of it. A flow manager can still close one early with `force-complete` and a `reason`, recorded as forced, unless that step's line says `force-complete` is refused.\n\n- **Custom action.** Finished on its page in Moxo: each person answers on the page and sends their answers, which become the step's outputs. `complete` from someone who hasn't sent their answers returns `400 CUSTOM_ACTION_NOT_CONFIRMED`, and anything sent with `complete` in place of the answers is ignored. If a required answer is empty it returns `400 CUSTOM_ACTION_ANSWERS_MISSING`, and if the page changed after they answered, `409 CUSTOM_ACTION_PAGE_CHANGED`: they answer on the page again. While the page waits for the person preparing the step, `complete` returns `409 CUSTOM_ACTION_PAGE_WAITING`. `force-complete` closes the step without any answers.\n- **E-signature.** Finished by signing: each signer signs from their task, and the step completes when the last one has. `complete` returns `409 ESIGN_SIGNATURE_REQUIRED`.\n- **Document collaboration.** When the sides take turns or edit together, the step finishes when everyone agrees on the document. Each side acts with the document collaboration calls: approve the current version (`POST /v1/flows/{id}/steps/{stepId}/doc-collab/approve`, or `…/doc-collab/approve-content` for text written together) or send your draft as a new version (`…/doc-collab/send`). `complete` from someone on the step returns `409 DOC_COLLAB_USE_TURN_ACTIONS`. In Comment only, a reviewer marks the document reviewed with `complete`.\n- **DocuSign.** Finished in DocuSign: the step completes when every signer has signed the envelope and DocuSign reports it.\n- **Adobe Acrobat Sign.** Finished in Adobe Acrobat Sign: the step completes when every signer has signed and Adobe reports it.\n- **Identity verification.** Finished by the verification service: the person verifies from their task, and the step completes with the service's result.\n- **Collect payment.** Finished by the payment: the person pays from their task, and the step completes when the payment provider confirms it.\n- **Jotform.** Finished in Jotform: the step completes when the person submits the form and Jotform sends the submission.\n- **Time booking.** Finished by booking: the person picks a time from their task, and the step completes with the meeting.\n- **Watch video.** Finished by watching: the person watches the video from their task, to the end when the step requires it, and confirms the sentence if the step asks for one. `complete` from someone who hasn't watched it returns `409 VIDEO_NOT_WATCHED`, and from someone who hasn't confirmed, `409 VIDEO_NOT_CONFIRMED`. `force-complete` is refused the same way: `409 VIDEO_NOT_WATCHED` while anyone still pending hasn't watched, and `409 VIDEO_NOT_CONFIRMED` while anyone hasn't confirmed.\n- **Packet.** Finished on its own buttons: the person does the parts on the packet's pages in Moxo, and a button that finishes it (Submit, or an outcome of the template's own) completes the step with that outcome. `complete` returns `409 PACKET_FINISHES_ON_ITS_BUTTONS`. `force-complete` closes the packet with no outcome and closes every part left.\n- **Goal.** Finished in its conversation: the step completes when the conversation has what the goal asks for and the person confirms it.\n\n### Steps that run on their own\n\nAutomations (AI, email, webhook, data and API call steps), waits, AI agents and sub-flows finish on their own: `complete` refuses them with `409 STEP_RUNS_ON_ITS_OWN`. A flow manager can still close one early with `force-complete` and a `reason`, recorded as forced. It then ends with only the `resultData` you send, so a later step that reads its output gets nothing unless you send it. If one fails, `POST /v1/flows/{id}/steps/{stepId}/retry` runs it again.\n\n## Which steps accept file uploads\n\n`POST .../steps/{stepId}/files` adds a file to the assignee's submission, so it only matters on a step that collects one:\n\n- **File request**: the upload is the submission. Pass the ids to `complete` as `resultData.files`.\n- **Form**: the upload becomes a field's value. Send its id under the `FILE_UPLOAD` field's id when you complete the step; the upload alone does nothing.\n- **E-sign, PDF form and Document review**: only while the step is being prepared, as the document to sign, fill in or review.\n- **Any other step**: the upload is accepted but not used. Nobody is shown the file and no step refers to it. To give the assignee something to read, use `attachments`.\n\nOn any other step the call still returns `201`, so check the step type before you upload."},{"name":"Actions","description":"Send one request to a person outside any flow, such as a signature, an approval, a form or a file, then list them, remind people and cancel them. These are not a flow's steps, which are under Flows and Steps."},{"name":"Templates","description":"Read, publish, version and manage templates: the processes flows are started from. To create a template or change its steps, see Build templates."},{"name":"Build templates","description":"Build and change templates from code: see what your organization can use, create a draft from a list of changes, change it, check it, read its outline and publish it. A personal access token builds as its person. An organization API key with `templates:read` and `templates:write` builds as the organization, with administrator permissions. A test run needs a personal access token.\n\n→ **[Read the guide: Build templates from code](/docs/guides/build-templates-from-code)**","externalDocs":{"description":"Read the guide: Build templates from code","url":"/docs/guides/build-templates-from-code"}},{"name":"AI agents","description":"The AI agents a template's steps use: list them, create and change drafts, publish them and add knowledge files. These endpoints need a personal access token, and changing an agent also needs the **Manage AI agents** permission."},{"name":"Template setup","description":"A template's settings around its steps: owners, folder, mode, chat support and FAQ. These endpoints need a personal access token and edit access to the template."},{"name":"Template start","description":"How a template starts without anyone pressing Start: on a schedule, on an app event or from an email. These endpoints need a personal access token."},{"name":"Users","description":"Internal and external users, in one resource. `kind` tells them apart:\n\n- `internal`: your own team, who sign in to the orchestrator portal.\n- `external`: clients, vendors and partners, who use magic links or a portal.\n- `agent`: an AI agent that does work in flows.\n- `service`: the organization API key behind a request.\n\nFilter the list with `?kind=external` to get one kind.\n\nTwo separate things decide what a user can do. Their **persona** decides where they work: the orchestrator portal (`orchestrator_portal`), a named portal (`portal`) or magic links only (`magic_link`). A user can have more than one persona and switch between them from the profile menu. Their **access to a flow** decides what they can do in it: a flow manager runs the flow, a participant sees their own steps and anything shared with them, and a viewer can only look. Being an organization admin doesn't make someone a flow manager, and being a flow manager gives no organization-wide rights.\n\nExternal users can belong to an account, the company they work for. See Accounts."},{"name":"Personas","description":"The personas in your organization, read-only. Send a persona's id when you invite a user: it decides where they work, in the orchestrator portal, a named portal or magic links only."},{"name":"Accounts","description":"Group external users by the company they belong to, for reporting, for filtering and to give everyone at a company access to the same flows."},{"name":"Relationships","description":"A relationship is the standing link between people at your organization and the client they look after: who it is for, who on your side runs it, and everything that has been done with them. Name one by its `id`, as you would a flow or a template — or by the `externalRef` your own system already keys it on.\n\nName a person the way every other call does: by their user id (`usr_…`), their email, or, with Partner unique ID on, the unique ID your organization knows them by. The party takes `userIds`, `emails` and `uniqueIds`; a team member takes one of `userId`, `email` or `uniqueId`; the list filters `partyUserIds` and `teamUserIds` take any of the three. Every person in an answer carries their `userId`, `email` and `uniqueId`."},{"name":"Meetings","description":"Your own meetings: the calls your connected calendar and recorders bring in, Moxo's short recap of each, and linking them to work. Only you see yours, so these endpoints need a personal access token. Moxo does not keep transcripts."},{"name":"Desks","description":"A desk is a shared queue a team picks work from. When a template gives a role to a desk, every step for that role goes to the desk's queue. Read-only here: desks are set up in the app."},{"name":"Organization","description":"The organization a token belongs to, search across its flows, templates and external users, and its audit trail. Each answers what the token's person sees in the app; an organization API key reads within its scopes."},{"name":"Conversations","description":"Group conversations and flow chats. The list includes both by default: send `kind=group` for group conversations only, or `kind=flow` for flow chats only. Detail, messages and files under `/v1/conversations/{id}` take group conversation ids only. A flow's chat is on `GET /v1/flows/{id}/messages` (scope `chat:read`). Scopes: `conversations:read` and `conversations:write`."},{"name":"External tasks","description":"Work a template hands to your own systems, when those systems can't accept calls from Moxo. When a flow reaches a Wait set to **Your system picks up a task**, an external task opens under the Wait's task name. Your system claims open tasks, does the work, then completes each one with values or fails it with a reason. A claim is held for a set time, so a worker that stops never keeps a task. No callback URL is created. Every endpoint here needs an organization API key: `flows:read` to list, `flows:write` for everything else. A personal access token gets `403 ORG_KEY_REQUIRED`.\n\n## How your system connects\n\nEvery call goes out from your network. Moxo never calls in.\n\n1. **Set up the Wait.** In the template builder, set a Wait to **Your system picks up a task**. Give it a task name (for example `verify-account`), choose the values it sends from earlier steps (for example the account ID a person entered), and map the values your system sends back (for example `verified`).\n2. **Create an organization API key** with `flows:write` in **Settings → API keys**.\n3. **Run a worker** that checks for tasks every few seconds or minutes:\n   - `POST /v1/external-tasks/claim {\"taskName\": \"verify-account\", \"workerName\": \"verifier-1\"}` claims up to 10 waiting tasks in one call. Each comes with its `id`, `values` and `lockToken`, and is held for you until `lockedUntil`. An empty list means nothing is waiting.\n   - Do the work in your own systems. If it takes longer, call `POST /v1/external-tasks/{id}/extend {\"lockToken\": \"…\"}`.\n   - Finish with `POST /v1/external-tasks/{id}/complete {\"lockToken\": \"…\", \"values\": {\"verified\": true}}` and an `Idempotency-Key`, so a retry completes the task once.\n   - If your system couldn't do the work, for example because another system was down, call `POST /v1/external-tasks/{id}/fail {\"lockToken\": \"…\", \"reason\": \"Core banking did not answer.\", \"retryInMinutes\": 10}`. The task comes back after the pause. After the last try, the step fails on the flow and a flow manager can retry it.\n4. **Send answers as values.** \"Not verified\" is an answer: send `{\"verified\": false}` and branch on it with a Decision after the Wait. Use fail only when your system couldn't do the work.\n\nTwo copies of a worker never get the same task. When a worker stops, its hold runs out and the task goes back to the queue. Every claim gets its own `lockToken`, shown once. Extend, complete and fail need it, so a worker whose hold ran out can't finish, fail or extend the claim that came after it (`409 LOCK_EXPIRED`). Completing or failing a task whose step was reopened, skipped or canceled returns `409 STEP_NOT_ACTIVE` and changes nothing. `workerName` is a label shown on the flow page.\n\nAn organization API key reaches every flow in its organization, but receives only the values each Wait sends."},{"name":"Webhooks","description":"Start a flow from your own system with an incoming webhook, and resume a Wait step by calling the URL Moxo gave you. To have Moxo call your system when something happens, see [Webhooks](/docs/guides/webhooks).","externalDocs":{"description":"Read the guide: Webhooks","url":"/docs/guides/webhooks"}},{"name":"Reports","description":"Dashboard metrics, per-template performance, SLA compliance, and bottleneck analysis."},{"name":"Data tables","description":"Your organization's own tables: a vendor list, a client roster, a rate card. Create a table and its columns in one call, read and write the records inside it, or load a CSV. Flows read from these tables at runtime (a Look-up step, a picker on a form), so a table kept current here keeps every flow that references it current too."},{"name":"Connections","description":"The organization's connected app accounts, AI providers, Secrets and MCP servers, by name and id, never a credential. Ask which templates use one with `GET /v1/templates?uses=connection:<id>`."},{"name":"AI","description":"Describe a process in plain language, and the AI builder creates a draft template with any draft AI agents it needs. A generation runs in the background: start it, then poll for the result."},{"name":"System","description":"Service health and operational status endpoints for monitoring and uptime checks."},{"name":"Web SDK","description":"Embed Moxo screens in your own product, such as Salesforce Lightning, your CRM or an internal tool: the flow list, flow detail, templates, start a flow, the launcher, and chat (chat, chat list and chat detail). The `@moxo/sdk` npm package has a small runtime for your page and a sandboxed iframe that shows the same screens as the Moxo portal, so a change to the portal reaches your embed in the same release.\n\nYour backend exchanges an organization API key or a personal access token for a 15-minute session token (`POST /sdk/auth/sessions`). Your page passes that token to the SDK, which renews it in the background, so the browser never sees your long-lived token. When the session's persona can use more than one portal, send `portal_id`. Without it, the call returns `400 PORTAL_REQUIRED` with that persona's portal ids in `error.details`.\n\nTo build the screens yourself instead, use the **Headless SDK** below. It uses the same sessions, and your own UI renders everything from `/sdk/v1`.\n\nQuick start, components, authentication, callback events and error codes:\n\n→ **[Open the Web SDK documentation](/docs/sdk)**","externalDocs":{"description":"Open the Web SDK documentation","url":"/docs/sdk"}},{"name":"Headless SDK","description":"Per-person data for apps that build their own UI on Moxo. Every call uses a short-lived SDK session token, created by your backend with `POST /sdk/auth/sessions`, and returns exactly what that person can see: their spotlight, flows, templates, flow chat, group conversations and notifications, with live updates from the `/sdk/events` stream. Sessions for every persona are accepted here, magic link personas included; the Web SDK components have narrower rules. The exception is `GET /sdk/v1/templates`, the templates a person can start themselves, which accepts portal sessions only. Requires the Headless SDK on your organization's plan. To leave flow chats out of the Messages inbox, list conversations with `kind=group`.\n\nTo have Moxo build the screens instead, use the **Web SDK** above. It uses the same sessions, with iframe components you add to your page.\n\nInstalling `@moxo/sdk/data`, sessions, retries and routing notifications into your own UI:\n\n→ **[Open the Headless SDK documentation](/docs/headless)**","externalDocs":{"description":"Open the Headless SDK documentation","url":"/docs/headless"}},{"name":"MCP Server","description":"Connect AI agents and AI clients, such as Claude Desktop, Cursor, Continue or your own, to Moxo through the Model Context Protocol. The MCP server uses the same tokens, scopes and organization boundaries as the REST API.\n\nThe MCP page lists every tool, how to install the server in popular clients and how to call it over HTTPS:\n\n→ **[Open the MCP server documentation](/docs/mcp)**","externalDocs":{"description":"Open the MCP server documentation","url":"/docs/mcp"}},{"name":"Changelog","description":"Version history for the public REST API: every breaking change, deprecation and addition, with its release date, its category and, when one applies, a migration note.\n\n→ **[Open the REST API changelog](/v1/changelog)**","externalDocs":{"description":"Open the REST API changelog","url":"/v1/changelog"}},{"name":"Errors","description":"Every error response has an HTTP status and an `error.code`. Below is every code the API returns, with its HTTP status, what it means and what to do. Each endpoint lists the codes it returns.\n\n## Any call\n\n- `UNAUTHORIZED` (401): The token is missing or not valid. Send `Authorization: Bearer <token>` with a token from Settings → API keys.\n- `INVALID_TOKEN` (400, 401): The token matches no token on this host: it is mistyped, no longer exists, or belongs to another region (each region keeps its own tokens). With `400`, the token in a callback URL (a Wait step's or a Grok Bot step's) is not in the right form. Check the token, or create a new one in Settings → API keys. If your organization is in another region, use its address: `api.moxo.com` (US), `api.eu.moxo.com` (EU), `api.au.moxo.com` (Australia) or `api.sg.moxo.com` (Singapore). For a callback, use the URL the step gave you as it is.\n- `API_ADDRESS_CHANGED` (409): The token's organization is served at another address now. `error.apiBaseUrl` is that address. Send the same call to `error.apiBaseUrl` with the same token.\n- `ORG_PAUSED` (503): The organization is paused for a moment, so nothing was read or changed. Wait the number of seconds in `Retry-After`, then retry.\n- `TOKEN_EXPIRED` (401): The token has expired. Create a new token.\n- `TOKEN_REVOKED` (401): The token was revoked. Create a new token.\n- `FORBIDDEN` (403): The token is valid but cannot do this. Use a token whose owner (or scopes) can do it in the app.\n- `INSUFFICIENT_SCOPE` (403): The organization API key lacks the scope this call needs, or the caller cannot change a person the call would change. Add the scope named on the call to the key, or use a token that can change that person.\n- `IP_NOT_ALLOWED` (403): The request came from an address outside the key's allowlist. Call from an allowed address, or add this one to the key's allowlist.\n- `ORG_NETWORK_RESTRICTED` (403): An internal user's token was used from outside the organization's approved sign-in networks. `error.clientIp` is the address Moxo saw; `error.orgId` and `error.orgName` name the organization. Organization API keys are not affected. Call from an approved network, or use an organization API key for unattended systems.\n- `AUTH_POLICY_UNAVAILABLE` (503): The organization's sign-in policy could not be read, so the request was refused rather than allowed. Retry with backoff.\n- `NOT_FOUND` (404): It doesn't exist, or you can't see it. Check the id, and that the token can see it in the app.\n- `BAD_REQUEST` (400): The request body or parameters are not valid. Fix the request as the message says.\n- `VALIDATION_FAILED` (400): The request failed its schema check; `error.details` names each field. Fix each field named in `error.details`.\n- `RATE_LIMITED` (429, 503): Too many requests (429), or too many of the same heavy request running at once (503, a data table download). Wait the number of seconds in `Retry-After`, then retry.\n- `AUTH_BRUTEFORCE_LIMIT` (429): Your IP address sent 10 tokens that failed (mistyped, expired, revoked or from a blocked address) in 15 minutes, so every request from it is refused for a while, even one with a good token. Fix the token, wait the number of seconds in `Retry-After`, then retry.\n- `UNSUPPORTED_MEDIA_TYPE` (415): The request's `Content-Type` isn't one this call takes: a body is JSON, and an upload is `multipart/form-data`. Send the body with the content type the message names.\n- `QUOTA_EXCEEDED` (402): The plan's quota is used up (monthly flows, AI credits). Wait for the quota to reset, or change the plan.\n- `UNKNOWN_PARAMETER` (400): The call does not take a query parameter that was sent; the message names it and where the parameters are listed. Remove it, or fix its spelling.\n- `INVALID_IDEMPOTENCY_KEY` (400): The `Idempotency-Key` header is longer than 256 characters, uses a character other than letters, digits, `-`, `_`, `:` and `.`, or was sent twice. Nothing ran. Send one key in that format, such as a UUID.\n\n## Specific calls\n\n- `ACCESS_REQUEST_ALREADY_DECIDED` (409): Someone already approved or declined this request to join the flow. Nothing to do. List the open requests again to see what is left.\n- `ACK_ALREADY_ACKNOWLEDGED` (400): Someone has already acknowledged this step, so what they acknowledged cannot change. Leave its content as it is, or remove the step and add a new one.\n- `ACTION_ASSIST_FILE_NOT_IN_ORG` (400): A file named in the files Assist reads (`config.assist.faqFiles`) is not a file of your organization. Remove that file id, or upload the file again and send its new id.\n- `ACTION_ASSIST_FILE_UNAVAILABLE` (409): A file named in the files Assist reads (`config.assist.faqFiles`) is neither one this flow's Assist already reads nor an upload of the token's person, so it can't be added. Remove that file id, or upload the file with the same token and send its new id.\n- `ACTION_CLOSED` (409): The step closed at its due date (Close at the due date). What was saved has been sent on, and it can't be changed now. A flow manager can reopen it with a new close.\n- `ACTION_ENDED` (409): The flow is a one-off action that has ended. An action is one ask, so it can't be continued or have its steps reopened once it has finished. Send a new action to the person instead.\n- `ACTION_NOT_OPEN` (409): The step has no close, or isn't open, so there is nothing to close now. Read the flow again; nothing was changed.\n- `ACTION_ONE_ASK` (409): The flow is a one-off action (`kind: \"action\"`). An action is one ask, so a step can't be added to it, on any plan. Send a new action instead, or start a flow.\n- `ACTION_TEST_ONE_STEP` (400): The flow is a test the sender sent to themselves, and a test holds one request only. Send a real flow to add steps.\n- `ACTIONS_LIMITED_TO_MANAGERS` (403): Your organization lets only conversation managers send actions in a conversation, and the token's person is not a manager of this one. Use a manager's personal access token, or ask an admin to change who may send actions.\n- `ADD_SEAT_NOT_SUPPORTED` (400): This step type takes its people from its own sides, so a person cannot be added here. Add the person to the side's role.\n- `ADMIN_INVITE_REQUIRES_ADMIN` (403): Only an admin can give someone an admin persona: by inviting them, or by activating an invitation that makes them an admin. Nothing was changed. An admin does it, or the person accepts their invitation themselves.\n- `AI_DISABLED` (403): The organization has AI turned off. An admin turns AI on in Settings.\n- `AI_UNAVAILABLE` (503): The AI could not answer just now, so nothing was written. `error.retryable` says whether a retry can help: `true` for a passing failure, `false` when the AI account itself needs attention from Moxo. When `error.retryable` is `true`, retry after the number of seconds in `Retry-After`. When it is `false`, do not retry; contact support with the `requestId`.\n- `ALREADY_COMPLETED` (409): The step, or your part in it, is already done. Nothing to do; read the step to see the result.\n- `ALREADY_EXISTS` (409): A relationship with this external reference is already here. Send `PATCH` to change the one that is there, or create yours under a reference of its own.\n- `ALREADY_FIRED` (409): This flow monitor already ran on this flow, so it cannot be turned off. Nothing to do. A monitor runs once.\n- `ALREADY_PAUSED` (409): The flow is already paused; `error.pauseEpisodeId` names the pause. Nothing to do.\n- `ALREADY_SENT` (409): A newer version was sent since you read the collaboration. Read the collaboration again and act on the current version.\n- `AMBIGUOUS_ATTACHMENT` (409): Two attachments on the step point at the same address and share an id, so removing one would be a guess. Give them different addresses in the template.\n- `AMBIGUOUS_MULTI_ROLE_ASSIGNMENT` (400): The step has more than one role, and the person could fill more than one. Name the roles with `roleIds`.\n- `AMBIGUOUS_SLOT` (400): You hold more than one open part on this approval, so the request does not say which to decline; `error.availableSlotIds` lists them. Decline in Moxo, where each part is shown, or ask a flow manager.\n- `AMBIGUOUS_STEP` (409): More than one run of the step is open, so the step's template id does not say which. Name the run with its execution id.\n- `ANCHOR_INSIDE_MOVED_STEP` (409): The step would move next to a step inside itself. Pick an anchor outside the step.\n- `APPROVAL_DECIDED_OTHERWISE` (409): The approval itself was already decided another way this round, so your decision was not made (while it still waits on other approvers, your own part decided another way is `410 NO_ACTIVE_SLOT`). `error.decision` is the one that stands (`APPROVE`, `REJECT` or `REQUEST_CHANGES`). The same decision sent again answers `200` with `changed: false`. Read the step. To decide again, reopen it first.\n- `ARCHWAY_REQUIRES_DETACH_ACK` (409): The template was installed from an Archway bundle, and this change would detach it from that bundle. Nothing was changed. Send the same request again with the header `x-archway-detach-ack: 1` to make the change and detach the template.\n- `ASSIGNEE_NOT_HUMAN` (400): The assignee is an AI agent or a service account. Choose a person.\n- `ASSIGNEE_NOT_IN_CONVERSATION` (400): Someone you asked is not in the conversation the action is sent in. Add them to the conversation first, or ask someone who is in it.\n- `ASSIGNEE_NOT_INVITABLE` (400): The assignee was deactivated or removed. Choose an active person.\n- `ASSIGNEE_REQUIRED` (403): An organization API key called an assignee's endpoint. A key is not a person, so it can't record a person's work. Use the assignee's personal access token.\n- `ASSIGNMENT_NOT_SUPPORTED` (400): Moxo does not edit this step type's settings on a running flow. Use reassign.\n- `ATTACHMENT_ALREADY_BOUND` (409): A file in `attachmentFileIds` is already on another message. Upload the file again for this message.\n- `ATTACHMENT_BAD_STATUS` (400): A file in `attachmentFileIds` hasn't finished uploading. Finish the upload (the `PUT`, then the `completionUrl` when there is one), then send the message.\n- `ATTACHMENT_NOT_FOUND` (404): A file in `attachmentFileIds` doesn't exist. Send the `fileId` the upload link or the project copy answered.\n- `ATTACHMENT_NOT_OWNED` (403): Only the person who uploaded a file can send it. Upload the file with your own token.\n- `ATTACHMENT_NOT_REMOVABLE` (409): The material comes from the template, so it can't be removed from a running step. Change the template so new flows leave it out.\n- `ATTACHMENT_SCAN_FAILED` (400): The virus scan blocked a file in `attachmentFileIds`. Choose a different file.\n- `ATTACHMENT_VISIBILITY_MISMATCH` (403): A file from someone outside your organization can't go in a message only your team sees. Send it on a step its participants see.\n- `ATTACHMENT_WRONG_FLOW` (400): A file in `attachmentFileIds` was uploaded for another flow. Upload it for this flow.\n- `AUTOMATION_AI_INSTRUCTION_RETIRED` (400): The action's `config.automations` adds an AI instruction (`kind: \"ai\"`), which an action no longer takes; `error.entryIds` names each one. Use an app or an agent entry, or leave the entry out.\n- `AUTOMATIONS_REQUIRE_SEE_ALL` (400): Automated actions can be shown only to a role that sees every action. Turn on `allowViewAllActions` in the same call.\n- `AWAIT_FIRST_WORD` (403): The organization has turned off your side writing first, and this relationship has no conversation yet. Wait for the client to write. Once the conversation exists, your side can answer in it.\n- `BATCH_NOT_ACTIVE` (409): Someone earlier in the order has not finished. Wait for it to finish.\n- `BUILDING_BLOCK_EXPANSION_FAILED` (422): A building block in the template could not be set up for this flow. Fix the building block in the template, then start again.\n- `CALENDAR_RECONNECT_NEEDED` (409): The host's calendar connection was refused, so the meeting wasn't canceled or moved. Nothing was changed. The host reconnects their calendar, then try again.\n- `CALENDAR_UNAVAILABLE` (503): The host's calendar didn't answer, so the meeting wasn't canceled or moved. Nothing was changed. Try again in a moment.\n- `CANDIDATES_CHANGED` (409): The records a lookup asked someone to pick changed after the list was shown. Nothing was saved. `data.outputResolution` is the current list. Show the new list and send the pick again with its `round`.\n- `CANNOT_DEACTIVATE_SELF` (400): A personal access token can't deactivate or delete its own person. Nothing was changed. Use another person's token, or an organization API key that may deactivate them.\n- `CANT_APPLY` (409): Moxo can't make the suggested change where it is, such as inside the signature block. Make the change yourself in an edited copy, or dismiss the suggestion.\n- `CAPABILITY_DENIED` (403): The person behind the token lacks the permission this call needs. Give them the permission in People → Orchestrator permissions, or use a token whose owner has it.\n- `CAPABILITY_DISABLED` (400): The organization's plan does not include this step type or setting. Leave it out, or change the plan.\n- `CHANGE_REFUSED` (422): An AI agent update (`PATCH /v1/agents/{id}`) was refused by the agent file's rules, and nothing was saved. `error.issues` lists each problem with where it is. Fix each issue and send the update again.\n- `CHANGES_OTHER_STEPS` (409): The move or add would change more than the step it names. Use Edit process in the app.\n- `CHANGES_REFUSED` (422): The change list was refused and nothing was saved. Fix each issue in `data` and resend the whole list.\n- `CHANGES_TARGETS_UNAVAILABLE` (422): A request for changes named steps none of which can take them (not a step before this approval, or skipped). Nothing changed. Name a step before the approval that was done, or approve or reject instead.\n- `CHECK_PENDING` (409): The PDF is still being made, or the document is still being checked. Submit again in a minute.\n- `CHECKLIST_INCOMPLETE` (400): A checklist item is not in a status that finishes the step (`DONE` or `SKIPPED`, or what the template allows). Send every item's status in `resultData.checklistState`, keyed by its `itemId`.\n- `CLOSE_IN_PAST` (400): The new close has already passed. Send a `closesAt` still ahead.\n- `CLOSE_REQUIRED` (400): The step closes at its due date, and neither its own close nor its template's due date gives one still ahead. Send `closesAt`, a date and time still ahead.\n- `CODE_INVALID` (401): The code is wrong or expired. Ask for a new code.\n- `COMMENTS_DISABLED` (403): Comments are off for this flow; reading still works. Turn comments on for the template, or read only.\n- `COMPLETED_FLOW_KEPT` (403): The flow has completed and its template keeps its completed flows (`settings.allowDeleteCompletedFlows` is `false`), so nobody can delete it. Archive the flow to hide it. To delete it anyway, someone who can edit the template turns the setting on, deletes it, and turns the setting back off.\n- `COMPLETION_MODE_LOCKED` (409): Someone has already responded, so whether anyone or everyone must answer cannot change. Leave the completion mode as it is. People can still be added or removed.\n- `COMPLETION_MODE_NOT_ALLOWED` (400): This step type has no Anyone or Everyone to set (a poll asks each person to vote). Leave the completion mode out of the settings.\n- `COMPLETION_REQUIRES_MEMBER` (403): Only an internal user can confirm this Web App step. Use an internal user's token.\n- `COMPLETION_REQUIRES_WEBHOOK` (409): This Web App step is finished by the web app's own call to Moxo. Let the web app finish it, or have a flow manager force-complete it.\n- `CONFLICT` (409): Someone else changed it at the same moment. Read it again and resend.\n- `CONFLICTING_START_RULES` (400): `skipSequentialOrder` and `dependsOnStepIds` were both sent; a step starts one way or the other. Send one of them.\n- `CONFLICTS_CHANGED` (409): The passages to choose between changed since you read them. `error.conflicts` lists them now. Choose again for the passages listed.\n- `CONNECTION_BUNDLE_REJECTED` (400): The connections sent for the template's steps were refused. Send connections the template can use.\n- `CONNECTION_CHOICE_REQUIRED` (409): Several connected accounts could be used; the response lists them. Send `connectionId`.\n- `CONNECTION_REQUIRED` (409): No connected account exists for this app; `error.connectUrl` is where a person connects one. For an app trigger, only the organization's accounts count: one a person connected for themselves alone does not. When Moxo saves a template it is an issue code instead: the action names an account your organization does not have, and the issue carries `connectUrl`. A change sent from code saves such an action waiting for its account instead (`needsAPerson` with the link). Have a person open the `connectUrl` and connect the app, then retry with the new account's id (`GET /v1/connections`).\n- `CONTENT_MOVED` (409): Someone saved the text since you read it. `error.contentRevision` is the revision now. Read the collaboration again and approve the text as it stands.\n- `CONVERSATION_NEEDS_CREATOR` (400): An organization API key started a conversation without naming who on your team starts it. Name them in `startedBy`: they become its manager.\n- `CONVERSATION_UNAVAILABLE` (409): The conversation is archived, so nothing can be posted, sent or changed in it. Unarchive it first, or use another conversation.\n- `CREATOR_NOT_INTERNAL` (400): `startedBy` names someone who is not an active member of your team. Name an active person inside your organization.\n- `CREDENTIAL_NOT_ACCEPTED` (422): An issue code: the change list sends a password or user name a person types into the step in Moxo, such as a web app's Basic auth. These never travel through the API; nothing was saved. Leave it out, or send it back as the read shows it (`null`), to keep the saved one. A person sets it in Moxo.\n- `CUSTOM_ACTION_ANSWERS_MISSING` (400): A required answer on the custom action's page is empty. `error.details.missing` lists the output ids. Answer those on the page, then send again.\n- `CUSTOM_ACTION_NOT_CONFIRMED` (400): A custom action is completed with the answers its person sent from the action's page, and this person hasn't sent theirs. The person answers on the page and sends their answers, then the step can be completed.\n- `CUSTOM_ACTION_PAGE_CHANGED` (409): The custom action's page changed after the person answered it. The person checks their answers on the page again and sends them.\n- `CUSTOM_ACTION_PAGE_NOT_APPROVED` (409): The template version holds a custom action step with no approved page (a version published before pages existed, or a test run of an unfinished draft), so the flow can't start. Build the step's page, approve it and publish the template again, then start the flow from the new version.\n- `CUSTOM_ACTION_PAGE_WAITING` (409): The custom action's page couldn't be filled for this flow, so it is waiting for the person preparing the step. Wait until the page is ready, or force-complete the step with a reason.\n- `DECISION_MIN_OUTCOMES` (400): A decision needs at least 2 options. Send 2 or more options.\n- `DECISION_OPTION_ID_INVALID` (400): Two decision options share an id, or an id is not text. Give each option its own text id, or leave the ids out.\n- `DECISION_OPTION_LABEL_REQUIRED` (400): A decision option has no label. Give every option a `label`.\n- `DECLINE_FAILED` (400): The decline couldn't be applied; the message says why. Nothing changed. Read the step, then decline again or act on its current state.\n- `DESK_NOT_FOUND` (404): The team desk does not exist in your organization. Send a desk id from your organization.\n- `DIRECT_CHAT` (400): A direct chat is two people and cannot be left. Archive the conversation instead.\n- `DIRECTORY_MANAGED` (409): The organization's directory sets this for this person; `error.field` names the field. Change it in the directory.\n- `DOC_COLLAB_FILE_TYPE_NOT_ACCEPTED` (422): The file is not a type a collaboration's documents can use. Upload a Word document (.docx), a PDF, a PowerPoint (.pptx), an Excel file (.xlsx) or an image.\n- `DOC_COLLAB_USE_TURN_ACTIONS` (409): This document collaboration finishes when everyone on it agrees on the document. Approve the current version with `POST /v1/flows/{id}/steps/{stepId}/doc-collab/approve` (`…/doc-collab/approve-content` for text written together), or send your version with `…/doc-collab/send`.\n- `DOCUMENT_REPLACE_FAILED` (500): The new document couldn't be put in place, so the step keeps its previous document. Try again.\n- `DOCUMENT_REPLACE_REQUIRED` (400): The edit names a different document than the step's. Replace the document with `POST /v1/flows/{id}/steps/{stepId}/document`, or send the setting as Get step settings shows it.\n- `DOCUMENT_REPLACED` (409): Someone else saved a different file first. Read the step again before replacing it.\n- `DOCUMENT_UNREADABLE` (400): The PDF cannot be opened. Send a PDF that opens.\n- `DRAFT_CHANGED` (409): Your side's draft changed since you read it. `error.draftRev` is its revision now. Read the collaboration again, then name the draft as it stands.\n- `DUE_DATE_IN_PAST` (400): The due date has already passed. Send a date in the future.\n- `DUPLICATE` (409): Someone in the organization already has this email, or is invited with it. Nothing was changed or sent. `error.existingUserId` is their id when you may read them. An inactive internal user is the same answer, with `error.reason` `deactivated_member`. Use that person. To send their invitation again, call `POST /v1/users/{id}/resend-invite`. An inactive internal user is reactivated with `POST /v1/users/{id}/activate`.\n- `DUPLICATE_FOLDER` (409): A folder with that name is already beside it in the conversation's files. Choose another name, or use the folder that is there.\n- `DUPLICATE_STEP_STATUS_ID` (400): Two entries in `stepStatuses` share an `id`, so nothing was saved. A status's `id` is its identity: the `key` a published version holds follows it. `error.id` names the repeated one. Give each status its own `id`. To keep a published status, send it once with its `id`.\n- `EDITING_BY_OTHER` (409): Someone else has the document open in Moxo. Submit when they are done.\n- `EMAIL_BELONGS_TO_ANOTHER_ACCOUNT` (409): The new email is already used to sign in to Moxo by someone else. Nothing was changed. Use another email, or find out who holds this one.\n- `EMAIL_BELONGS_TO_ANOTHER_USER` (409): A session by `uniqueId` carried an `email` that belongs to someone else in your organization, so your records name two different people. Send the person's own email with their `uniqueId`, or leave `email` out.\n- `EMAIL_CHANGE_ALONE` (400): `email` was sent with other fields. Changing the email someone signs in with moves them to the new email's sign-in, so it is a request of its own. Nothing was changed. Send `email` alone in one `PATCH /v1/users/{id}`, and the other fields in another.\n- `EMAIL_CHANGE_NOT_ALLOWED` (409): This person's email can't change from here; `error.reason` says why: `org_key_only` (only an organization API key can), `internal_member` (they are an internal user), `no_unique_id` (they have no unique ID) or `sign_in_provider` (they sign in with Google, which owns their email). Nothing was changed. Use an organization API key with the `users:email` scope, give the person a unique ID first, or ask the person to change their email themselves. An internal user always changes their own.\n- `EMPTY_FILE` (400): The file sent has no bytes. Send the file again, with its content.\n- `ESIGN_ALREADY_SIGNED` (400, 409): Someone has already signed the document. Leave the document as it is.\n- `ESIGN_PREPARER_PLACED` (409): A preparer has placed the signing fields, so the document and its fields cannot change. Leave the document and fields as they are. The name, due date and reminders still change.\n- `ESIGN_REINIT_FAILED` (500): The signing document couldn't be rebuilt, so the step keeps its previous document and signing files. Try again.\n- `ESIGN_SIGNATURE_REQUIRED` (409): An e-signature step finishes when the document is signed. Sign it, or have a flow manager force-complete it.\n- `ESIGN_SOURCE_DOCUMENT_LOCKED` (409): The template prevents replacing this PDF; nothing was saved. Keep the PDF the template set.\n- `EVAL_RUN_RATE_LIMITED` (429): You started too many eval runs this hour. Wait the number of seconds in `Retry-After`, then start it again.\n- `EXECUTION_ORDER_STARTED` (409): The step has started, so when it starts can no longer change. Leave `skipSequentialOrder` and `dependsOnStepIds` as they are.\n- `EXECUTION_REQUIRED` (400): Two or more copies of the step are waiting to be prepared. Name one with `?stepExecutionId=`.\n- `EXTERNAL_APP_UNDECLARED_INPUT` (422): An issue code: an app step has an input key that its action does not take, so no run reads it. The issue names the key and the action's inputs. Nothing was saved. A key the template already holds, sent back unchanged, is not refused: no run reads it, and it is removed when the template is read, saved or published. Key `externalApp.inputs` by the action's input ids (`GET /v1/step-types/EXTERNAL_APP?app=<appId>` lists them), and remove the key the issue names. Custom properties go inside the action's list input (`customFields`, `fields`).\n- `EXTERNAL_APP_UNKNOWN_ACTION` (422): An issue code: an app step names an app, or an action of its app, that the app catalog does not have, so no run could call it. Nothing was saved. Choose one of the app's actions (`GET /v1/step-types/EXTERNAL_APP?app=<appId>` lists them).\n- `EXTERNAL_CANNOT_LEAVE` (403): Someone from outside the organization cannot leave a conversation. A manager removes them.\n- `FEATURE_DISABLED` (403): The organization's plan does not include this feature; `error.feature` names it, and `error.upgradeAvailable` is `true` when a plan upgrade adds it. When `error.feature` is `haiFlow`, `haiActions` or `haiChat`, it names a Moxo product the organization does not have: new work for that product is refused, and work already running carries on. Turn it on for the organization, or skip the call.\n- `FEATURE_NOT_ON_PLAN` (422): A step whose action type your organization's plan doesn't include. As an issue code it names the change that adds it; on its own it refuses a save, or an import of your own file or bundle, that adds one. A step the template already has keeps its type, and publishes and runs. Nothing was saved. Remove the step, or ask an admin to add the action type to the plan. `get_build_context` lists the action types your plan includes.\n- `FIELD_KEY_LOCKED` (409): A published question or table column can't change its `key`, so nothing was saved. `error.fields` lists each one as `{ fieldId, key, attemptedKey }`, where `key` is the one it keeps. Send the published `key` and change the `label` instead. For a different key, add a new field.\n- `FIELD_LABEL_REQUIRED` (422): An issue code: a question the change list writes has no label, or only spaces. A heading, page break or other layout piece may leave its label empty. Give the question a `label`.\n- `FIELD_NOT_ON_REPLACEMENT` (422): An issue code: `remove_step` names a `replacedBy` that has no field for what another action reads from the removed one. The issue names each reader. Nothing is blanked and nothing was saved. Add the field to the replacement, or change the readers in the same list.\n- `FILE_INFECTED` (422): A file failed its safety check; nothing was stored. Send a clean file.\n- `FILE_NOT_AVAILABLE` (422): Part of this template can't be written as a file yet. Use the outline and change lists for this template.\n- `FILE_NOT_FOUND` (404): The upload named by `fileId` is not one you uploaded into this step, or it is gone. Upload the file again (`POST /v1/flows/{id}/steps/{stepExecId}/prepared-document/upload-init`) and name its `fileId`.\n- `FILE_NOT_READY` (409): The file failed to generate, so it has no link. Generate the file again.\n- `FILE_REFUSED` (422): A pushed template file can't be read; nothing was checked or saved. `data.issues` lists each problem with where it is. Fix each issue in the file and push it again.\n- `FILE_REJECTED` (404, 409, 413, 422): The file can't be used: it isn't your upload into this step, failed the virus check, or isn't a document the collaboration takes. `error.fileCode` says which. Upload the file again with `POST …/doc-collab/upload-init`, or upload another one.\n- `FILE_TOO_LARGE` (413): The file is larger than the limit: the call's own (20 MB for a PDF), or your organization's upload rules. Send a smaller file.\n- `FLOW_ARCHIVED` (409): The flow is archived. Unarchive it (`POST /v1/flows/{id}/unarchive`), then try again.\n- `FLOW_BUSY` (503): Another change is working on the same flow and it stayed busy past a few seconds. Nothing was saved. Wait for the Retry-After header, then send the same request again (the same Idempotency-Key is accepted).\n- `FLOW_CANCELLED` (403): The flow was canceled. Nothing more can happen on it.\n- `FLOW_NOT_RUNNING` (409): The flow has finished. Continue the flow first, if that is what you want.\n- `FLOW_PAUSED` (409): The flow is paused. Resume the flow, then retry.\n- `FLOW_PAUSED_INSERT_BEFORE_CURRENT` (409): The flow is paused, and the step would go before the step the flow is on. Add it after that step, or resume the flow first.\n- `FLOW_PAUSED_START_NOW` (409): A sub-flow was sent with `start: \"now\"` while the flow is paused: a sub-flow never starts under a paused flow, so nothing was added. Resume the flow first, or send `start: \"later\"` with `afterStepId`.\n- `FOLDER_CYCLE` (409): A folder can't move into itself or into one of its own folders. Pick a parent outside the folder you are moving.\n- `FOLDER_NOT_FOUND` (404): The template folder named in the body is not in your organization, or was just deleted. List the folders with `GET /v1/template-folders` and send one of their ids.\n- `FOLDER_TOO_DEEP` (409): Template folders go 5 levels deep: the new folder, or the folder being moved with everything in it, would go past level 5. Pick a parent higher up, or move fewer levels at once.\n- `FOR_EACH_SOURCE_UNRESOLVABLE` (409): A For each step still cannot read the list it repeats over. Skip it, or fix its list and retry.\n- `FORM_FIELD_ID_DUPLICATE` (422): An issue code: two questions have the same `fieldId`. An id names one question everywhere (its answer, references, updates). Nothing was saved. Give each question its own `fieldId`, or leave it out and Moxo makes one from the `handle`.\n- `FORM_QUESTIONS_LOCKED` (400): Someone has already answered this form, questionnaire or PDF form, or saved a draft of it, so its questions, PDF fields and PDF cannot change. Leave the questions as they are, or send a new form to ask something different. The name, due date and reminders still change.\n- `GENERATION_QUOTA_EXCEEDED` (429): This credential's monthly AI generation quota is used up. Wait for next month, or use another credential.\n- `GOAL_NEEDS_ADAPTIVE` (400): A goal was sent for a predefined flow, which has none. Send `mode: \"adaptive\"` with the goal, or leave the goal out.\n- `GRANT_ALREADY_USED` (401): The grant was already used. Verify the email again for a new grant.\n- `GRANT_INVALID` (401): The grant is not valid or has expired. Verify the email again for a new grant.\n- `HOST_ROLE_UNASSIGNED` (400): The template books a meeting, and the role that hosts it was given nobody at the start. Give the host role a member of your team in `roleAssignments`.\n- `IDEMPOTENCY_IN_PROGRESS` (409): A request with this idempotency key is still running. Retry after `Retry-After` seconds.\n- `IDEMPOTENCY_KEY_REUSED` (422): This `Idempotency-Key` was already used for a different request (another body, path, query or method). Nothing ran. Use a new key for each request; resend the same request to retry it.\n- `IDEMPOTENCY_RESULT_LOST` (410): The first result for this `Idempotency-Key` can no longer be rebuilt. Treat the outcome as unknown, check, and use a new key.\n- `IDEMPOTENT_REQUEST_PENDING` (425): The first request with this `Idempotency-Key` is still running. Retry after `Retry-After` seconds.\n- `IDENTITY_AMBIGUOUS` (400): The person was named two ways: `userId` with `email`, or `userId` with `uniqueId`. Send only one; `userId` stays the same if the person changes their email.\n- `IDENTITY_REQUIRED` (400): None of `uniqueId`, `email` and `userId` was sent. Send one of them.\n- `IDP_PERSONA_LOCKED` (409): The identity provider gave this persona, so it cannot be replaced here. Change it in the identity provider.\n- `INSERT_BEFORE_STARTED_STEP` (409): The step to insert before has started, or the flow has moved past it; nothing was added. Insert before a step that has not started.\n- `INVALID_CURSOR` (400): The cursor can't be read, or was changed. Send the previous page's `nextCursor` as it is, with the same filters.\n- `INVALID_DOCUMENT` (400): The document is not in the editor's JSON form. Send the `doc` in the form the artifact read returns it.\n- `INVALID_ITEM` (400): The item does not match the loop's item fields; `error.field` names the field. Send the loop's field names with text, numbers, yes or no, or lists of text.\n- `INVALID_OWNER` (400): The person named to own the conversation is not a teammate still in it who can be reached. Choose a teammate who is in the conversation and can still be reached.\n- `INVALID_STATE` (400): The flow or step is not in a state that allows this (for example it has finished). Read it again and act on its current state.\n- `INVALID_STEP_SETTINGS` (400): A setting does not belong to this step type, or is outside its limits. Fix the setting the message names.\n- `INVALID_STEP_TYPE` (400): This call works on another kind of step (a decline, on an approval only). Use the call for this kind of step.\n- `INVALID_UNIQUE_ID` (400): The `uniqueId` is not a valid unique ID: empty, longer than 128 characters, with a character other than letters, digits and `@ . _ + -`, or shaped like a Moxo person id (`usr_…`, a UUID). Nothing was changed. Send your own identifier for the person, such as a customer number.\n- `IS_TEST_RUN` (400): The flow is a test run, which can't be continued. Start a new test run.\n- `KICKOFF_VALIDATION_FAILED` (400): A kickoff field value is missing or not valid; the details name each field. Fix each field named in the details.\n- `LAST_OWNER` (400): This would remove the last Owner. Make someone else an Owner first.\n- `LAST_PERSONA` (400): A person keeps at least one persona, and this is their last one. Nothing was changed. Give them another persona first, then take this one.\n- `LAST_TEAMMATE` (409): The last teammate who can still be reached cannot leave, so someone from the team stays. Add a teammate first, or archive the conversation.\n- `LINK_NOT_ALLOWED` (422): The conversation is with an external user on WhatsApp, and the organization sends WhatsApp without links, so a message or a change to one with a web address is not sent. Nothing was posted. `error.message` is the organization's own sentence for it. Take the web address out and send again.\n- `LINK_TARGET_NOT_FOUND` (404): The flow, project or conversation to link a meeting to does not exist, or the token's person cannot see it. Link to a flow they can open, a project they are a member of, or a conversation they are in.\n- `LIVE_AI_NOT_EDITABLE` (400): AI help is fixed once the step is sent: AI preparation, Assist on or off, its agent and what it may read of earlier steps, Advise, AI Review and Rename files. On a sent action an AI reviewer can still be added, swapped, given new instructions or swapped out for a person until the action is in review; switching Review off while it is AI is refused. `error.details.settings` lists what the save changed. Leave those settings as they are. What Assist knows and how it answers still change.\n- `LIVE_PREPARERS_STARTED` (400): Preparation may have started, so who prepares is fixed. `error.details.settings` is `[\"preparers\"]`. Leave the preparers as they are.\n- `LOCK_EXPIRED` (409): Your hold on the task ran out, or the task was claimed again. Claim it again.\n- `LOCKED` (409): Someone else has the document open in Moxo's editor, so it can't be changed until they close it. Try again once `editingBy` is gone from `GET /v1/flows/{id}/steps/{stepExecId}/prepared-document`.\n- `LOOP_CLOSED` (409): Every item of the For each finished and the flow moved on. Add a step to the flow instead.\n- `LOOP_ITEM_UNSUPPORTED` (409): The For each runs over uploaded files, and an added file needs its own upload and scan. Add a step to the flow instead.\n- `LOOP_LIMIT_REACHED` (409): The For each is at its item limit; added items count toward it. Raise the loop's limit in the template for later flows.\n- `LOOP_NOT_STARTED` (409): The For each has not started yet, so it has no items to add to. Wait until the flow reaches the loop.\n- `MEETING_ALREADY_CANCELED` (409): The meeting is already canceled. Nothing to do; read the step to see it.\n- `MEETING_CANCEL_BOOKING_TOO_OLD` (409): The meeting was booked, with no calendar, before Moxo kept who to tell when it is canceled, so it is not canceled here. Tell the people on the meeting directly.\n- `MEETING_CANCEL_FORBIDDEN` (403): Only the flow's managers can cancel this meeting; with the step's `bookerCanCancel`, also its host and an internal user who booked. Ask a flow manager to cancel it.\n- `MEETING_CHANGE_IN_PROGRESS` (409): Someone else is moving or canceling this meeting right now. Nothing was changed. Try again in a moment.\n- `MEETING_CHANGE_STEP_CHANGED` (409): The step changed while the meeting was being moved. Read the step again.\n- `MEETING_NOT_BOOKED` (409): The step is not a Time Booking step with a booked meeting. Name the Time Booking step whose meeting was booked.\n- `MEETING_NOT_ON_CALENDAR` (409): The meeting's event is no longer on the host's calendar, so it was not moved. Moxo never recreates it. Book the meeting again.\n- `MEETING_RESCHEDULE_BOOKING_TOO_OLD` (409): The meeting was booked before Moxo kept its host and calendar, so it can't be moved here. Move it in the host's calendar.\n- `MEETING_RESCHEDULE_FORBIDDEN` (403): Only the flow's managers can move this meeting; with the step's `bookerCanReschedule`, also its host and an internal user who booked. Ask a flow manager to move it.\n- `MEETING_RESCHEDULE_NO_HOURS` (409): The booking has no hours or calendar to read free times from. Move it in the host's calendar.\n- `MEETING_RESCHEDULE_NOT_SUPPORTED` (409): The meeting was booked through Calendly or Zoom Scheduler, which reschedule on their own side. Reschedule it in Calendly or Zoom.\n- `MEETING_SAME_TIME` (409): The meeting is already at this time. Pick another time.\n- `MEETING_STARTED` (409): The meeting has already started, so it can't be canceled or moved. End it in the meeting itself.\n- `MEETING_TIME_NOT_FREE` (409): The new time is not one of the host's free times under the booking's rules, or someone took it meanwhile. Nothing was changed. List the free times again and pick one.\n- `MEETINGS_NOT_AVAILABLE` (403): Meetings is not on for the token's person: their organization does not have the Conductor turned on, or they cannot use it. Ask an admin of the organization to turn on the Conductor.\n- `MENTION_EXTERNAL` (400): A person in `mentions` is outside your organization and isn't on the flow. Only your organization's people can be tagged in. Add them to the flow as a member first, or leave them out of `mentions`.\n- `MENTION_INACTIVE` (400): A person in `mentions` is deactivated. Leave them out of `mentions`.\n- `MENTION_NOT_ALLOWED` (403): A person in `mentions` isn't on the flow, and you can't add them by tagging: only a flow manager can, on a step (`targetStepExecutionId`), while the template's Tag anyone in the organization setting is on. Mention people on the flow, or ask a flow manager to tag them or add them as a member.\n- `MENTION_UNKNOWN` (400): A person in `mentions` is not in this organization. Send `usr_` ids from this organization's people.\n- `MESSAGE_DELETE_FORBIDDEN` (403): Only the person who sent a message can delete it. Delete a message you sent.\n- `MESSAGE_DELETED` (410): The message was deleted. Read the chat again.\n- `MESSAGE_EDIT_FORBIDDEN` (403): Only the person who sent a message can edit it. Edit a message you sent.\n- `MILESTONE_NAME_TAKEN` (409): The flow already has a milestone with that name (ignoring case); nothing was added. Choose another name, or join that milestone with its `milestoneId`.\n- `MILESTONE_NOT_HERE` (409): The milestone is not next to where the step lands, or a new milestone was asked for a step placed further on than asked; nothing was added. Pick a milestone the message names, or leave `milestone` out.\n- `MINT_QUOTA_EXCEEDED` (429): Your plan's daily number of SDK sessions is used up. It resets at midnight UTC. Wait for the reset, or change the plan.\n- `MINT_QUOTA_UNAVAILABLE` (503): The day's session count could not be read, so the session was refused rather than allowed. Retry in a moment.\n- `MISSING_DEPENDENCY` (400): A choice this list depends on isn't in `resource` yet, such as a pipeline before its stages; the message names it. Add that choice to `resource`, then ask again.\n- `NESTED_STEPS_NOT_A_SETTING` (422): An issue code: `update_step` was sent a branch's `paths`, a decision's `outcomes`, a loop's `steps` or an approval branch's `steps` that differ from what is saved. They hold the steps inside the step, which `update_step` does not change. Sent back unchanged, they change nothing. Nothing was saved. Change a path or an outcome with `update_paths`, and the steps inside it with `add_step`, `update_step`, `move_step` and `remove_step`.\n- `NESTED_STEPS_NOT_ALLOWED` (400): A step added here cannot contain other steps. Add each step on its own.\n- `NEXT_OWNER_REQUIRED` (400): The owner is leaving and did not name who owns the conversation next. Send `nextOwnerUserId`, the public id of a teammate who is in the conversation.\n- `NO_ACTIVE_SLOT` (410): This person has no open part on the step: it was already decided, or they never had one. Nothing to do; read the step to see the result.\n- `NO_DOCUMENT_SLOT` (422): The step has no document of its own, so a file cannot be its document. Upload the file as reference material (`slotKind: \"reference\"`).\n- `NO_FILE` (400): The request has no file in its form. Send the file as the `file` part.\n- `NO_MILESTONES_HERE` (400): A milestone was chosen where the flow has no milestones; nothing was added. Leave `milestone` out.\n- `NO_PERSONA` (422): The person holds no persona for their kind of user, so the session would have nowhere to go. An admin gives them a persona.\n- `NO_PREPARERS` (400): The step has nobody preparing it, so it cannot go back to its preparers. Send it back to its assignee (leave out `sendBackTo`).\n- `NO_RESTORE_SNAPSHOT` (409): This canceled flow can't be reopened: it was canceled before reopening existed, or an End flow step ended it. Start a new flow from the template.\n- `NOT_A_CHANGE` (409): The AI suggestion is a comment: it changes nothing, so there is nothing to accept. Dismiss it once you have read it (`POST …/suggestions/{suggestionId}/dismiss`).\n- `NOT_A_LOOP` (400): The step is not a For each. Name the For each step.\n- `NOT_A_LOOP_ITEM_STEP` (400): fillLoopItem was sent for a step that is not assigned to the current person of a For each. Send it only on that step, or leave fillLoopItem out.\n- `NOT_ACTIVE_REVIEWER` (403): It is another reviewer's turn on this item. Wait until it is your turn.\n- `NOT_AN_EDITOR` (403): Only an editor of the document can do this. Use an editor's token.\n- `NOT_AUTHOR` (403): Only the person who wrote the comment can remove it. Use the writer's token.\n- `NOT_COMBINABLE` (422): The held copy can't be combined into the draft automatically. `error.reason` says why. Use it instead of the draft, or combine it in Word.\n- `NOT_EDITABLE` (422): The flow is not running. Continue the flow first.\n- `NOT_FEED_OWNED` (409): This relationship was made in Moxo, and the upsert and the import do not overwrite hand-built work. Send `PATCH` or `DELETE`, which act on any relationship, or leave it as it is.\n- `NOT_IN_REVIEW_GROUP` (404): The run's step is not reviewed together with the loop's other items. Review the run on its own with `review-approve` or `review-decline`.\n- `NOT_LISTENING` (409): Nobody is listening for a test event. Choose Listen for a test event in the app, or call `POST /v1/templates/{id}/webhook-config/test-listen`, then send to the new test URL.\n- `NOT_ON_A_SIDE` (403): You're not on a side of this document collaboration, so you can't act for one. Use the token of a person on the side, or ask a flow manager to add the person to the side's role.\n- `NOT_PAUSED` (409): The flow is not paused. Nothing to do.\n- `NOT_STEP_ASSIGNEE` (403): You are not an assignee of this step with work left to do. Use the assignee's token.\n- `NOT_SYSTEM_GROUP` (400): Only the built-in Owner, Admin and Member permission groups can be reset to how they come. Change a group your organization made with `PUT /v1/permission-groups/{id}`.\n- `NOT_THE_OWNER` (400, 403): Only the owner can hand the conversation to someone else, or name who owns it next when they leave. Leave `nextOwnerUserId` out when you are not the owner. To hand it over, use the owner's personal access token.\n- `NOT_YOUR_SECTION` (403): The section isn't yours to mark done or reopen. Use the token of a person whose role owns the section, or an editor's.\n- `NOT_YOUR_TURN` (403, 409): It isn't your turn yet: your side's turn on a document collaboration (409), a preparation another preparer (or the AI) does first (409), or a document being prepared by a person when you aren't the one preparing it now (403). Read the step again: `turn` names the side whose turn it is; a preparer waits until the one before them is done.\n- `NOTES_DISABLED` (404): Notes are off for this flow. Turn Notes on for the template, or for your organization.\n- `NOTHING_IN_PROGRESS` (409): A sub-flow was sent with `start: \"now\"`, and nothing is in progress on the flow for it to start beside; nothing was added. Send `start: \"later\"` with `afterStepId`.\n- `NOTHING_TO_DISCARD` (409): There is nothing to discard: the template was never published, so there is no published version to go back to, or it has no unpublished changes. To remove a template that was never published, delete it with `DELETE /v1/templates/{id}`.\n- `NOTHING_TO_REMIND` (400): Nobody is waiting on this flow or step, or the step isn't waiting on the person you named. Nothing to do. Read the step to see who it is waiting on.\n- `ORG_CHART_NO_APPROVER` (422): Neither a manager nor the template's fallback person can take a role filled from the org chart, so the flow did not start. Fix the org chart, or set the template's fallback person.\n- `ORG_FROZEN` (402): The organization is paused. Resume the organization, then retry.\n- `ORG_KEY_NOT_SUPPORTED` (403): Only a particular person can do this in the app, and an organization API key is not that person. Use that person's personal access token, as the message says.\n- `ORG_KEY_REQUIRED` (403): This call needs an organization API key, and a personal access token was sent. Use an organization API key with the scope the call names.\n- `ORG_NAME_NOT_ALLOWED` (400): The organization name was refused; the grant is not spent. Choose another name.\n- `ORG_SUSPENDED` (402): The organization's account is suspended, so no new work starts. An admin updates billing in Moxo.\n- `ORIGIN_HEADER_REQUIRED` (400): The request had no `Origin` header, so the session could not be tied to a page. Server frameworks do not send one by default. Send `Origin` with your page's origin, such as `https://app.example.com`.\n- `ORIGIN_NOT_ALLOWED` (403): The `Origin` header is not one of your organization's allowed SDK origins. Send an allowed origin, or have an admin add this one in Settings → Web SDK.\n- `OTHER_PEOPLES_CHANGES` (409): Other people also have unpublished changes on this template. Send `includeOtherPeoplesChanges: true` to discard theirs too.\n- `OTP_COOLDOWN` (429): A code was sent a moment ago. Wait, then ask again.\n- `OUTPUT_NOT_DECLARED` (400): A Goal step was completed with a `resultData` key it declares no output for; the message names each, `error.details.undeclared` lists them and `error.details.outputs` lists the outputs the step has. Nothing was saved. Key `resultData` by the step's output ids only.\n- `OVER_GRANT` (403): The persona or permission group gives permissions you don't have yourself. Nothing was changed. Someone who holds those permissions does it, or, for an invitation, the person accepts it themselves.\n- `OWN_REVIEW` (403): The person a review is about cannot remove that step. Have another manager do it.\n- `PACKET_ASK_NOT_REOPENABLE` (400): A part picked was never done (left out, or the packet finished early), so there is nothing to redo. The message names it. Pick only parts that were done.\n- `PACKET_ASKS_NOT_PICKED` (400): A packet goes back to its person with the parts to redo, and none were named, one is not part of this packet, or the step is not a packet. Send `packetAskIds` with step ids from the packet's `asks`, and only for a packet.\n- `PACKET_FINISHES_ON_ITS_BUTTONS` (409): A Packet finishes when its person presses one of its own buttons that finishes it, which records the outcome. A complete would close it with no outcome and its parts undone. Let its person finish it, or a flow manager can force-complete it with a reason.\n- `PAGE_RANGE_INVALID` (400): `pages` is missing, or is not written as pages and ranges separated by commas. Send `pages` as pages and ranges, such as `3,7,12-14`, numbered from 1.\n- `PAGE_RANGE_OUTSIDE_DOCUMENT` (400): `pages` names a page the file does not have. `error.pageCount` is the number of pages it has. Ask again for pages between 1 and `error.pageCount`.\n- `PAGES_NOT_A_PDF` (422): The file is not a PDF, so its pages cannot be sent on their own. Download the whole file instead.\n- `PAGES_UNREADABLE` (422): The file's pages could not be opened. Download the whole file instead.\n- `PAT_CANNOT_IMPERSONATE` (403): A personal access token can create a session only for its own person, and the request named someone else. Use an organization API key with `sdk:mint` to create sessions for other people.\n- `PATH_CLOSED` (409): The path can no longer take a step there (it finished, the flow took another path, a Decision has started and not been answered, or the spot is before the last action that has started). The path a Decision chose can still take a step. Edit process lists the same code. Add the step after the last action that has started, on a path that is still open.\n- `PATH_NOT_STARTED` (409): A sub-flow with uploaded start details would go into a path that has not started, so its uploads have no run to belong to. Add it once the path is running, or start it without uploads.\n- `PAYLOAD_TOO_LARGE` (413): The request is larger than this call allows. Send a smaller file, or fewer files.\n- `PDF_FAILED` (503): The PDF of this document could not be made. Send the call again.\n- `PERSON_NOT_EXTERNAL` (400): A relationship is for the people you work with, and one of the people named is on your own team. Name external people in `party`, and put your own people in `team`.\n- `PERSON_TOKEN_REQUIRED` (403): This call acts as a person, and an organization API key was sent. Use a personal access token.\n- `PERSONA_AMBIGUOUS` (400): Both `persona_id` and `persona_name` were sent, or the name matches more than one persona the person holds; the message lists their ids. Send `persona_id` alone.\n- `PERSONA_NOT_HELD` (403): The person does not hold that persona, or it does not exist. Name a persona the person holds, or give it to them in People.\n- `PERSONA_REQUIRED` (422): The person holds several personas and none is their default; the message lists them. Send `persona_id`.\n- `PERSONA_TYPE_MISMATCH` (400): An external user can only hold an external persona. Choose a persona from `GET /v1/personas?userType=external`.\n- `PERSONAS_FROM_IDP_ONLY` (409): The organization only takes personas from its identity provider. Give the persona in the identity provider.\n- `PICKED_ID_NOT_FOUND` (422): An issue code from check and publish: an id a person picks from a connected app (a Jotform form, a DocuSign template, an Acrobat Sign library document, a scheduling page) is not in the connected account, so the step could not start. Pick it again on the step, from the account the step uses.\n- `PORTAL_BINDING_MISSING` (403): The SDK session is not linked to a portal, so it has no catalog to start from. Create the session with `portal_id`.\n- `PORTAL_ID_IGNORED_FOR_NON_PORTAL_PERSONA` (400): `portal_id` was sent, but the persona is not for a portal (it is for the orchestrator portal or magic links). Leave out `portal_id`, or name a portal persona.\n- `PORTAL_NOT_GRANTED_BY_PERSONA` (403): The persona does not give the portal in `portal_id`; the message lists the portals it gives. Send one of those portals.\n- `PORTAL_REQUIRED` (400): The session's persona can use more than one portal, and no `portal_id` was sent; `error.details` lists its portal ids. Send `portal_id`.\n- `PREPARATION_INCOMPLETE` (422): The step's preparation is missing something its assignee needs (a document to review or a PDF to fill in); `error.missing` names it. Nothing was saved. Add what `error.missing` names, then complete the preparation again.\n- `PREPARE_ACTIVATION_PENDING` (409): The step is still being set up, so its preparation cannot be completed yet. Try again in a moment.\n- `PREPARE_EDIT_LOCKED` (422): The change would alter something the flow depends on, which a preparer cannot change. Change only what the template lets a preparer change.\n- `PREPARE_FAILED` (400, 422): The step's preparation can't be completed as sent; the message says why. Fix what the message names and send it again.\n- `PREPARED_DOCUMENT_MISSING` (409): The latest version of this document has no file. Restore an earlier version, then submit.\n- `PREVIOUS_KEY_GRACE_NOT_FOR_URL_TOKEN` (400): This webhook's key is the token in its URL (`none`), so the old URL stops working at once when it is replaced. Leave out `previousKeyGraceSeconds`, or switch the webhook to `hmac` or `api_key` first.\n- `PROGRESS_ONLY` (403): The step is shared with you as progress only. Read the flow instead.\n- `PROGRESS_ONLY_REQUIRES_SEE_ALL` (400): Progress only can be turned on only for a role that sees every action. Turn on `allowViewAllActions` in the same call.\n- `PROGRESS_ONLY_REQUIRES_VIEWER` (400): Progress only is not available for a role that manages the flow. Leave `showProgressOnly` off for this role.\n- `PROTECTED_BRAND_RESERVED` (409): The name is reserved. Choose another name.\n- `PROVIDER_ERROR` (502): The app failed to answer. Try again later.\n- `PROVISIONING_DISABLED` (403): Self-serve signup is switched off in this environment. Sign up in the app instead.\n- `PROVISIONING_UNAVAILABLE` (503): Self-serve signup is not available right now. Retry with the same grant.\n- `READ_ONLY` (403): You can read this document collaboration but not act on it, as in the app (a read-only viewer, or a step that only lets you comment). Use the token of a person who takes part in it.\n- `RECONNECT_REQUIRED` (409): The app's connection has expired, so its lists can't be read. A person reconnects the app in Connected apps.\n- `RECORDING_DELETED` (409): The meeting was recorded in Moxo and you chose not to have it read, which deleted the recording, so there is nothing left to read. Nothing can bring it back: leave it set aside. A new recording is a new meeting.\n- `RELATIONSHIP_INCOMPLETE` (400): A new relationship was sent with no `party`, so there is nobody it is for. Send `party`, either named people or an account.\n- `REMINDER_NOT_SENT` (502): A recipient was tried and the reminder reached nobody; nothing was recorded. Try again.\n- `REOPEN_CLOSED_ACTION_MANAGER_ONLY` (403): The step closed at its due date; only a flow manager can reopen it. Ask a flow manager to reopen it.\n- `REOPENED_STEP_FAILED` (409): The step reopened but could not start again, so it is now `FAILED`. The message says why. Fix what the message names (the step shows it too). A failed signature step starts over when a step before it is reopened (to send a new document, for example).\n- `REQUIRED_OUTPUTS_MISSING` (400): A Goal step was completed without one of its required outputs; the message names each, and `error.details.missing` lists their ids. Nothing was saved. Send every required output in `resultData`, keyed by its id.\n- `REVIEW_CHANGED` (409): Who reviews the step changed while the answer was on its way, so nothing was recorded. Send the same answer again; a retry is safe and goes to the review as it now stands.\n- `REVIEW_GROUP_APPROVE_IN_PROGRESS` (409): An approval you started is still running. Wait for it to finish, then read the list again.\n- `REVIEW_GROUP_APPROVE_NOT_STARTED` (503): The approval could not start, so nothing was approved. Send the call again.\n- `REVIEW_GROUP_FORBIDDEN` (403): You review none of these items and do not manage the flow. Use the token of a person who reviews the items.\n- `REVIEW_GROUP_NOT_APPROVE_ALL` (400): Items in this loop move on as each is approved, so they are not marked reviewed. Approve each item when it is ready.\n- `REVIEW_GROUP_NOT_READY` (409): The loop moves its items on together, and not every item is in review yet. Approve once every item is in.\n- `REVIEW_ITEM_CHANGED` (409): The item changed since you read it (sent back, resubmitted or no longer in review). Read the list again and use the item's new `invocationEpoch`.\n- `REVIEW_REQUIRED` (409): The step has an AI reviewer. Complete it in Moxo: in the app, the person's portal, or the link in their email.\n- `REVIEWED_COPY_FAILED` (500): The reviewed copy of the document couldn't be made, so the step was not completed. Send the call again.\n- `REVISION_REQUIRED` (409): A template file push came with a file that does not say which revision of the template it was pulled from (no `revision:` line, no `baseVersion`), so it could undo changes made since. Nothing was saved. Pull the template again, make your change in that file, then push it. To replace the template with the file as it is, push with `overwrite: true`.\n- `ROLE_ALREADY_EXISTS` (409): Another role of this flow has that name. Pick another name, or use the role that has it.\n- `ROLE_ASSIGNED_AUTOMATICALLY` (400): This role of the sub-flow is filled automatically (a fixed person or a team desk), so it cannot be set here. Leave the role out.\n- `ROLE_ASSIGNMENT_NOT_SUPPORTED` (400): This step type takes its people from its own sides, not from `roleIds`. Add the person to the side's role instead.\n- `ROLE_FILLED_FROM_ORG_CHART` (400): This role is filled from the org chart, so it cannot be set here. Leave the role out.\n- `ROLE_NEEDS_INTERNAL_USER` (400): The role is filled by internal users (a flow manager or meeting host role), and no one in your organization has the email sent for it. A flow start adds only external users. Invite the person to your team first, or name someone already in it.\n- `ROLE_NOT_ASSIGNEE` (400): Only an Assignee role takes extra powers; this role manages or only views the flow. Choose an Assignee role.\n- `ROLE_NOT_FOUND` (400, 404): A role id names no role of this flow: in the path (404), or in the body (400). Use a role id from the flow's roles.\n- `ROLE_NOT_HELD` (409): The person named in `holderUserId` no longer holds this role. Read the flow again and send the person who holds it now, or leave `holderUserId` out.\n- `ROLE_VISIBILITY_LOCKED` (400): This role always sees every action of the flow. Leave its visibility as it is.\n- `SANDBOX_ORG_LIMIT` (409): The limit of sandbox organizations was reached. Use one of your existing sandboxes.\n- `SCAN_BUSY` (503): The safety check is busy. Try again shortly.\n- `SCAN_PENDING` (425): An upload the request names is still being checked. Retry shortly.\n- `SCAN_UNAVAILABLE` (409, 503): The safety check could not run. Try again shortly.\n- `SDK_MINT_REQUIRES_API_KEY` (403): A signed-in browser session tried to create an SDK session. Only your server can, with a token. Call from your server with an organization API key or a personal access token.\n- `SDK_NO_ALLOWED_ORIGINS` (403): Your organization has no allowed SDK origins, so no page can use a session. An admin adds your page's origin in Settings → Web SDK.\n- `SDK_NOT_ENABLED` (403): The Web SDK is not turned on for your organization, so no session can be created. An admin turns it on in Settings → Web SDK.\n- `SDK_SESSION_AUDIT_UNAVAILABLE` (503): The new SDK session could not be recorded in the audit log, so it was not created. Retry after the seconds in `Retry-After`.\n- `SDK_SESSION_NOT_ALLOWED_HERE` (403): An SDK session token was sent to a call outside the embedded Moxo screens and the `/sdk` calls, such as `/v1` or the MCP server. Call it from your server with your organization API key or a personal access token.\n- `SEAT_ALREADY_DONE` (409): The person's part is already done or no longer needed. Reopen the step to have it redone.\n- `SEAT_NOT_ON_STEP` (400): The person named is not on this step (an id nobody in your organization holds gets the same answer), so no reminder was sent. Read the step to see who is on it, and name one of them.\n- `SEAT_REMIND_MANAGER_ONLY` (403): A participant whose role can send reminders reminds everyone the step waits on, never one named person or section. Leave out `userId` and `sectionId`, or ask a flow manager.\n- `SECRET_HASHED_ONLY` (409): Moxo keeps only a hash of this API key secret, so it can't be shown again. Replace the secret with `/regenerate`, which shows the new one once.\n- `SECRET_NEEDS_REGENERATE` (409): This signing secret can no longer be used (an incoming webhook's, or one Moxo signs its own calls with), so it can't be shown or used. Replace the secret with `/regenerate` and give the sender the new one.\n- `SECTIONS_NOT_SUPPORTED` (400): Only a document written together in sections has sections to remind. Send no `sectionId` for this step.\n- `SEND_BACK_MANAGER_ONLY` (403): A participant whose role can reopen completed actions sends one back to whoever did it, never to its preparers. Leave out `sendBackTo`, or ask a flow manager.\n- `SEND_BACK_NOT_ALLOWED` (400): Only a finished step, or one still with its assignee, can go back to its preparers; a step in review cannot, and a Packet never does (it goes back to its person). Wait for the review, or send it back to its assignee (a Packet with `packetAskIds`).\n- `SERVICE_KEY_CANNOT_CHOOSE_PERSONA` (403): A key gives only the default member persona: it can't invite with another one, or activate an invitation that gives another one. Nothing was changed. A person with the right does it with a personal access token, or the person accepts their invitation themselves.\n- `SERVICE_KEY_CANNOT_INVITE_ADMIN` (403): A key can't give someone an admin persona: not by inviting them, and not by activating an invitation that makes them an admin. Nothing was changed. An admin does it with a personal access token, or the person accepts their invitation themselves.\n- `SERVICE_UNAVAILABLE` (503): Part of the work could not be scheduled (for example a file rename). Try again.\n- `SIGNATURE_ALREADY_USED` (409): An incoming webhook delivery with this exact `X-Moxo-Signature` was already received and started no flow (its conditions skipped it, or it is still starting one), so this one starts nothing. When that delivery started a flow, the same request answers `200` with that flow instead. Sign each new delivery with the current time.\n- `SIGNATURE_BLOCK` (422): A later e-sign step's signature block is no longer in the document. `error.details.problems` names what moved. Put the signature block back, then submit.\n- `SIGNING_BUSY` (503): Someone is signing this document, or another change to it is under way, right now. A change to several steps names the step still busy. Try again shortly.\n- `SIGNUP_NOT_ALLOWED` (403): The signup was refused. Sign up in the app instead.\n- `SLOT_FORWARDED` (410): This person's part was forwarded to someone else, so it is no longer theirs to decide. Nothing to do; the person it was forwarded to decides.\n- `SLOT_NO_LONGER_ACTIONABLE` (410): This person's part ended another way (no longer needed, or the step moved on), so it can't be decided. Read the step to see where it stands.\n- `STALE_ACTION` (409): The step changed while the request was running. Read the step again and retry.\n- `STALE_WRITE` (409): Someone saved the document since the `rev` you sent; `data.currentRev` is its revision now. Read it again, merge your change, and save with the new `rev` as `baseRev`.\n- `START_FIELD_REQUIRED` (400): A start detail the sub-flow requires was not sent; `error.field` names it. Send it in `subFlow.customFields`.\n- `START_NOW_UNAVAILABLE` (409): A sub-flow sent with `start: \"now\"` would wait where it goes in the flow instead of starting; nothing was added. Send `start: \"later\"` with `afterStepId`.\n- `START_PEOPLE_CHANGED` (409): Someone with an email the start was adding joined your organization while the flow was starting, so nothing was started or added. Send the start again (the same Idempotency-Key is fine): it uses the person who is now there.\n- `STEP_ALREADY_ANSWERED` (409): Someone has already answered this step (an approver decided, someone voted, chose, sent files, ticked a checklist item or marked it done), so what was asked cannot change, an approval's or a decision's files included. `error.details.lockReason` says which. Leave its content as it is. The name, due date and reminders still change.\n- `STEP_ALREADY_FINISHED` (409): Nobody will act on this step again, so material or a file added to it would never be read, and its record stays as it was. Attach it to a step still to come.\n- `STEP_AWAITING_REVIEW` (409): The step is in its review. Wait for the review to finish.\n- `STEP_CHANGED` (409): What the step asks changed since you read it: the `askedFingerprint` you sent with the answer or decline is not the step's now. Nothing was saved. Read the step again and answer what it asks now, sending its new `askedFingerprint`.\n- `STEP_COMPLETES_ON_ITS_OWN` (409): The step is completed by its own event (signed in DocuSign or Adobe Sign, verified, paid, a Jotform submitted, a time booked), so a complete would record it done with nothing done. The message says what closes it. Let the event close it, or a flow manager can force-complete it with a reason.\n- `STEP_CONNECTION_FOREIGN` (422): An issue code: the action holds an account or saved secret that is no longer in your organization (it was removed in Manage → Connected apps). Choose another account on the action, or remove it.\n- `STEP_CONNECTION_WRONG_APP` (422): An issue code: the action's account is for another app. A Collect payment action takes an account of the provider it names (Stripe or QuickBooks); DocuSign, Adobe Acrobat Sign and Jotform actions take their own app; a REST API or Webhook action signs in with a saved Secret or a signing account such as a Sumsub account. A change that sets one is refused; publish and check report one the template already holds. Set the action's `connectionId` to an account of that app (`GET /v1/connections`), or for a REST API or Webhook action, to a saved Secret or a signing account.\n- `STEP_HAS_NO_REVIEW` (409): The step has no review, so there is no reviewer to reassign; a reassign never adds a review. Reassign its assignee, or add reviewers to the step in the flow or the template.\n- `STEP_IN_REVIEW` (409): The step is with its reviewer, so it can't be closed now. Wait for the review.\n- `STEP_NAME_REQUIRED` (422): An issue code: an action the change list adds or renames has a name of only spaces. Give the action a `name`.\n- `STEP_NOT_ACTIVE` (409): The step is no longer waiting: it is done, or the flow moved on, was reopened or was canceled. Read the flow again; nothing was changed.\n- `STEP_NOT_EDITABLE` (400, 409): The step has finished, or is past the point where its settings can change. Reopen the step first, if that is what you want.\n- `STEP_NOT_FOUND` (404): The template has no action with the `stepId` in the path. Read the action ids with `GET /v1/templates/{id}/outline`.\n- `STEP_NOT_OPEN` (409): The step hasn't started or is finished, so its step status can't change. Set it on an open step, or reopen this one first.\n- `STEP_NOT_REACHED` (409): The flow hasn't reached this step yet, so it can't be acted on. Wait until the step starts, or act on the step the flow is on now.\n- `STEP_NOT_SENT_TO_REVIEW` (409): A force-complete could not send the step to its reviewer yet. Read the step again. Send `skipReview: true` to complete it without its review.\n- `STEP_NOT_VISIBLE` (403): You cannot see the step this message is about. Post on a step you can see, or on the flow.\n- `STEP_ON_HOLD` (409): The step is on hold (a calendar or app connection still to make, a paused wait), so it takes no file until it resumes. Send the file once the step resumes.\n- `STEP_REF_AMBIGUOUS` (409): Several copies share this step, so a change here would change every copy. Change the step in the template instead.\n- `STEP_RUNS_ON_ITS_OWN` (409): This step runs on its own (a wait, an AI step, an AI agent, a sub-flow, or another automation), so it cannot be completed by hand. Let it finish, or force-complete it with a reason.\n- `STEP_SETTINGS_NOT_EDITABLE` (400): Moxo doesn't change this type of step's settings on a running flow. Change its name, description or due date instead.\n- `STEP_STARTED` (409): The step has started, so its assignees cannot be set here. Use reassign.\n- `STEP_STILL_READ` (422): An issue code: the change list removes an action that another action (or a template setting) still reads, so the reader would be left reading nothing. The issue names each reader. Nothing is blanked and nothing was saved. Give `remove_step` a `replacedBy` naming the action that supplies the data now, or change or remove each reader in the same list.\n- `STEP_TYPE_NO_ATTACHMENTS` (400): This kind of step shows its assignee no reference material (an automation, a control, or a document review, whose document has its own place). Attach the material to a step people act on.\n- `STEP_TYPE_NO_DOCUMENT` (400): This step is not built around a document. Send the document to a step that has one.\n- `STILL_SAVING` (409): The latest changes are still saving. Submit again in a moment.\n- `STORAGE_KEY_NOT_ACCEPTED` (422): An issue code: a step's file was named by a stored file's address, typed in, where it takes the id of a file uploaded to the step. `where.path` names the setting; nothing was saved. Upload the file to the step (`POST /v1/templates/{id}/steps/{stepId}/attachments/upload-init` with `slotKind: \"document\"`) and send the `fileId` it returns, for example `document: { \"ref\": \"<fileId>\" }`.\n- `STRAND` (422): A started step cannot move, and nothing can move in front of one. Move only steps that are still ahead.\n- `SUB_FLOW_CHILD_CHANGED` (409): The template the sub-flow uses was published again while it was being added. Check the template and send the request again.\n- `SUB_FLOW_CHILD_NOT_PUBLISHED` (400): The template the sub-flow uses has not been published. Publish it, then try again.\n- `SUB_FLOW_CHILD_NOT_STARTABLE_BY_EDITOR` (403): You may not start the template the sub-flow uses. Choose a template you can start, or ask someone who can.\n- `SUB_FLOW_CHILD_ROLE_UNMAPPED` (400): A role the sub-flow cannot start without (the host of a meeting it opens with) has nobody to fill it; the message names it. Send it in `subFlow.roleAssignments`, or leave `matchRoles` on with a role of this flow of the same name.\n- `SUB_FLOW_CHILD_UNAVAILABLE` (400): The template the sub-flow uses is archived. Choose another template.\n- `SUB_FLOW_DESK_REQUIRED` (400): A role of the sub-flow takes a team desk chosen at start, and none was sent; the message names it. Send it in `subFlow.deskSelections`.\n- `SUB_FLOW_OPEN` (409): This step's sub-flow is still running or paused, and the flow waits for it. Finish or cancel the sub-flow, then retry.\n- `SUB_FLOW_ROLE_HAS_SEVERAL` (400): The role named by `fromRoleId` is held by several people, and the sub-flow role takes one person. Send one person by `userId` or `email` instead.\n- `SUB_FLOWS_OPEN` (409): A sub-flow beneath this flow is still running or paused. Finish or cancel each sub-flow listed in error.details.subFlows, then retry.\n- `SUBMITTING` (409): The document is being submitted, so it can't be changed now. Read the step again: once it is submitted, it is done.\n- `SUGGESTIONS_OPEN` (409): Suggested edits are open on the document. `error.count` says how many. Send the count you agree to leave out (`withoutSuggestionCount` or `dropSuggestionCount`).\n- `TASK_NOT_CLAIMED` (409): The task is not claimed. Claim it first.\n- `TEMPLATE_ARCHIVED` (409): The template is archived, so it starts nothing. Restore it in Moxo, then start it.\n- `TEMPLATE_BEING_EDITED` (409): Someone is editing this template in Moxo right now, so nothing was changed. `error.editingBy` names them. Your own changes are never refused for this. Try again when they finish; editing frees up after 5 minutes without activity.\n- `TEMPLATE_MODE_LOCKED` (409): Flows have already started from this template, so its mode (predefined or adaptive) can't change. Its goal still can. Duplicate the template and set the mode on the copy.\n- `TEMPLATE_NOT_FOUND` (404): The template does not exist, or you cannot see it. Check the template id.\n- `TEMPLATE_NOT_IN_PORTAL_CATALOG` (403): The template is not in this portal's catalog, or there is no template with this id. Pick a template from `GET /sdk/v1/templates`, or add it to the catalog.\n- `TEMPLATE_NOT_PUBLISHED` (409): The template was never published, so it starts nothing. Publish it. An incoming webhook can use its test URL.\n- `TEMPLATE_NOT_READY` (422): A test run needs the draft complete, as publishing does. `issues` lists each gap (a Parallel path with no steps, an action nobody does), where it is and how to fix it. Nothing started. Fix each issue with a change list or a file push, then start the test run again.\n- `TEMPLATE_NOT_STARTABLE` (400): The template is not set up to be started this way. Turn on self-start for the template, or start it another way.\n- `TEMPLATE_VERSION_CONFLICT` (409): Someone changed the draft since the revision you sent; nothing was changed. `currentVersion` is the draft revision now. Read the draft again and resend.\n- `TEST_KIND_NOT_SUPPORTED` (400): This agent has no Test run on a template step: a chat agent tests as a conversation, the Conductor isn't tested on a step, and an agent with no type yet can't run. Test a chat agent in Agent Foundry; give an untyped agent its type first.\n- `TEST_RUN_ALREADY_IN_FLIGHT` (425): The same test of this agent is already running. Read the running test, or retry after `Retry-After` seconds.\n- `TIME_ENTRY_INVALID` (400): A time entry value is not valid; `error.field` names it. Fix the field and resend.\n- `TIME_ENTRY_REQUIRED` (400): The template requires time on this step, and no `timeEntry` was sent. Send `timeEntry`, or leave `timePrompt` out.\n- `TITLE_EDIT_DISABLED` (403): The organization does not let people set their own title. An admin sets the title, or turns the setting on.\n- `TOO_MANY_ATTACHMENTS` (400): Too many files for one message. Send up to 10 files with one message.\n- `TOO_MANY_MENTIONS` (400): `mentions` names more than 10 people who aren't on the flow. Tag at most 10 new people in one message.\n- `TOO_MANY_REQUESTS` (429): The person behind the token has sent `error.limit` actions (20) in the last hour from the same place, so this one was not sent. `error.home` says where they were counted: `conversation` means sent into this conversation, `project` means sent from this project in Moxo, and `standalone` means sent from no conversation and no project. `error.windowMinutes` is the window counted (60), `error.retryAt` is when sending works again, and `error.retryAfterSeconds` is the wait until then. Wait the number of seconds in `Retry-After` (the same as `error.retryAfterSeconds`), then send again. For this code, wait for `Retry-After`, not the `RateLimit` reset, which counts the token's own requests.\n- `UNFILLED_PLACEHOLDERS` (422): A placeholder is still written as `{{name}}`. `error.details.placeholders` names each one. Fill each placeholder, then submit.\n- `UNIQUE_ID_CHANGE_NOT_ALLOWED` (409): This person's unique ID can't change from here; `error.reason` says why: `org_key_only` (only an organization API key can), `internal_member` (they are an internal user) or `no_unique_id` (they have no unique ID to change). Nothing was changed. Use an organization API key that names the `users:unique_id` scope, for an external user who already has a unique ID.\n- `UNIQUE_ID_CONFLICT` (409): Someone in the organization already holds this `uniqueId`. Nothing was changed or sent. `error.existingUserId` is their id when you may read them. Use that person: to make sure someone exists, add them and on this answer use `existingUserId`.\n- `UNKNOWN_FIELD` (400): No template you can see has this field key. Use a field key from a template you can see.\n- `UNKNOWN_KEY` (400): A custom field key does not exist. Use a key the organization has.\n- `UNKNOWN_PERSON` (400): A person named by id or email is not in this organization. Check the id or the address. On `party`, an unknown email is created as an external user; on `team`, the person must already be here.\n- `UNKNOWN_SETTING` (422): An issue code: a setting the action, or the template (`update_settings`), does not have. `where.path` names it; nothing was saved. Remove it; the fix lists the settings that exist there.\n- `UNKNOWN_STEP_STATUS` (400): The flow's template doesn't list a step status with this key. Send a `key` from the template's `stepStatuses`.\n- `UNSUPPORTED_FILE_TYPE` (415): The file is not a kind this call or this step takes (for example a PDF, or a spreadsheet for an Update spreadsheet step). Send a file of the kind the message names.\n- `UPLOAD_NOT_LANDED` (409): The file has not finished uploading. Finish the upload, then call complete again.\n- `UPLOAD_TYPE_NOT_ALLOWED` (415): Your organization's upload rules don't allow this kind of file; the message lists the kinds they allow. Send a file of a kind the message lists, or ask an admin to change the upload rules.\n- `USER_NOT_FOUND` (404): The person is not a member of your organization. Use the id of a member.\n- `VALIDATION_ERROR` (400): A value sent is missing or not valid; the message names the field. On a flow start, `error.kickoffInputErrors` lists each start value the template needs. Send each value named, by its field `id` in `customFields`.\n- `VALUE_TOO_LONG` (400): A value is longer than 256 characters. Send a shorter value.\n- `VERSION_CONFLICT` (409): The template changed since the `baseVersion` you sent, or since the revision a pushed template file was pulled at (`changedSince` says what changed); nothing was saved. Read the current `draftRevision` and resend your changes. For a template file: pull it again, make your change in that file, then push it.\n- `VIDEO_NOT_CONFIRMED` (409): This Watch video step asks the person to confirm a sentence after watching. Have the person confirm it from their task.\n- `VIDEO_NOT_WATCHED` (409): A Watch video step finishes when the person has watched the video to the end. Have the person watch the video from their task.\n- `VIEW_ONLY` (403): The file can only be viewed, so it is not downloaded. View it in the app.\n- `VIOLATIONS` (422): The move or add would take a step into or out of a branch, decision or loop, or change one that has started. Keep the step in its place in the structure.\n- `WAITS_FOR_LATER_STEP` (400): A step in `dependsOnStepIds` comes after this one. Name only steps that come before it.\n- `WATERMARK_UNAVAILABLE` (422): The file must be watermarked with the name of the person downloading it, and the key names no person. Download it with a personal access token.\n- `WEBHOOK_ADDRESS_CHANGED` (409): The incoming webhook's organization is served at another address now. `error.webhookBaseUrl` is that address; the path after it stays the same. Change the address in the sending system to `error.webhookBaseUrl` followed by the same path.\n- `WORKING_COPY_NOT_ALLOWED` (403): `copy=working` asks for a template's working copy, with its unpublished changes, and only someone who may change the template reads it. Read it without `copy` for the published copy, or ask an owner for edit access.\n- `WRONG_PERSONA_SURFACE` (403): The SDK session's persona cannot use this call. Mint the session for a portal persona.\n- `WRONG_TEMPLATE_KIND` (400): The template is the wrong kind for this call (an action template, not a process). Use a process template."},{"name":"Glossary","description":"The words this reference uses, in plain terms.\n\n## The work\n\n### Template\n\nThe design a flow is started from: its steps, roles and fields. You build it once and start it many times.\n\nIn the API: `/v1/templates`.\n\n### Flow\n\nOne live run of a template, with its own people, answers and files.\n\nIn the API: `/v1/flows`.\n\n### Origin flow\n\nThe flow that started this one, through a Sub-flow, Start a flow or Schedule a flow step. Only a sub-flow is canceled with it.\n\nIn the API: `originFlowId` and `startedByKind` on a flow; `startedFlows` on the origin.\n\n### Step\n\nOne task inside a flow, done by a person or run by Moxo. The app also calls it an action; in a flow the two words mean the same thing.\n\nIn the API: `/v1/flows/{id}/steps`; `steps[]` on a template.\n\n### Action type\n\nWhat kind of task a step is, such as Form, Approval or File request. Each type has its own settings.\n\nIn the API: `type` on a step; its settings are `StepConfig_<TYPE>`.\n\n### Path\n\nOne branch inside a step, such as each outcome of a Decision. Its steps run only when the flow takes that path.\n\nIn the API: `paths[]` on a step.\n\n### Milestone\n\nA named stage of a template, such as Intake or Review. Each step can belong to one.\n\nIn the API: `milestones[]` on a template; `milestone` on a step.\n\n### Version and draft\n\nPublishing a template makes a new version live; flows keep the version they started on. Edits go to a draft, whose save counter is its draft revision.\n\nIn the API: `version` and `/v1/templates/{id}/versions`; `draft.draftRevision`.\n\n### Building block\n\nA template used inside another template as one step. Its roles and fields can be filled when the flow starts.\n\nIn the API: `buildingBlockRoleAssignments` and `buildingBlockFieldValues` on start.\n\n### Test run\n\nA real run of a draft, with every role you don't name given to you, so you can try it before publishing. Its emails and calls really go out, marked as a test.\n\nIn the API: `POST /v1/templates/{id}/test-runs`.\n\n### Walkthrough\n\nA run of a draft where every outside call is simulated, so nothing leaves Moxo. Start one as a test run with simulate set to true.\n\nIn the API: `POST /v1/templates/{id}/test-runs`.\n\n## People\n\n### Role\n\nA part to play in a template, such as Client or Reviewer. When a flow starts, each role is given to a person or a desk. A role is not internal or external itself: whoever fills it is.\n\nIn the API: `roles[]` on a template; `roleAssignments` on start; `/v1/flows/{id}/roles/{roleId}/assign`.\n\n### Assignee\n\nThe person assigned one specific step. Being on a flow doesn't make someone an assignee.\n\nIn the API: `assignees` on a step.\n\n### Flow manager, participant, viewer\n\nHow someone is on a flow: a flow manager runs it, a participant does the steps of their roles, a viewer can only look.\n\nIn the API: `access`: `manager`, `participant`, `viewer` on `/v1/flows/{id}/members`.\n\n### Template owner\n\nSomeone who can change a template and decide who uses it.\n\nIn the API: `/v1/templates/{id}/owners`.\n\n### Internal and external\n\nInternal users are your own team. External users are clients, vendors and partners outside your organization.\n\nIn the API: `kind` on a user: `internal` or `external`.\n\n### Persona\n\nWhich screen a person uses: the orchestrator portal, a named portal, or magic links only. One person can have several.\n\nIn the API: `/v1/personas`; its `access`: `orchestrator_portal`, `portal` or `magic_link`.\n\n### Account\n\nA company your external users belong to. Flows link to an account through their external people.\n\nIn the API: `/v1/accounts`; `accounts` on a flow.\n\n### Desk\n\nA shared queue a team picks work from. A role can be given to a desk instead of one person.\n\nIn the API: `/v1/desks`.\n\n## Data\n\n### Flow field\n\nA value stored on the flow, such as a deal size or a platform ID. Some are asked for when the flow starts; others fill in as it runs. The app calls them custom fields.\n\nIn the API: `customFields` on a template and a flow.\n\n### Custom user field\n\nA value your organization keeps about each person, such as a region or an employee number.\n\nIn the API: `customFields` on a user.\n\n### Data table\n\nYour organization's own table, such as a vendor list or a rate card. Flows read from it and write to it.\n\nIn the API: `/v1/data-tables`.\n\n### Changed since\n\nOnly what changed at or after a time, oldest first, paged with a cursor. At least once; for people who can't see every part of a flow, only changes they can see count.\n\nIn the API: `updatedSince` on `/v1/flows` and `/v1/templates`; `lastChangedAt` on each row.\n\n## Connecting\n\n### Connection\n\nYour organization's sign-in to another app, such as HubSpot or Google Drive, that steps and agents use.\n\nIn the API: `/v1/connections` (names and ids); `/v1/flow-triggers/connections`; `connectionsToBind` on an agent; `409 CONNECTION_REQUIRED`.\n\n### Dependencies, and depends on\n\nA template’s dependencies are the systems it uses: connections, Secrets, agents and other templates. A step’s dependsOnStepIds only lets it start sooner, once those steps are done.\n\nIn the API: `expand` set to `dependencies` on `/v1/templates/{id}` adds `dependencies[]`; `uses` on `/v1/templates`; dependsOnStepIds in the config of `POST /v1/flows/{id}/steps`.\n\n### Secret\n\nA stored key or password a REST API step uses, named in the template and never shown again.\n\nIn the API: `restApi.pendingSecretName` in `StepConfig_REST_API`.\n\n### Incoming webhook\n\nA web address another system calls to start a flow.\n\nIn the API: `/v1/webhooks/incoming/{templateId}`.\n\n### Outgoing webhook\n\nAn event Moxo sends to your system when something happens in a flow, such as a step completing.\n\nIn the API: the [Webhooks](/docs/guides/webhooks) guide (`WebhookEventPayload`).\n\n### External task\n\nWork a Wait hands to your own system: it claims the task, does the work and sends the result back, with nothing calling into your network. In the builder: Wait until, Your system picks up a task.\n\nIn the API: `/v1/external-tasks`.\n\n### Start link\n\nA link anyone you share it with can use to start a flow.\n\nIn the API: `start_link` in `startedBy.method`.\n\n### Schedule\n\nStarts a template's flows at set times.\n\nIn the API: `/v1/schedules`.\n\n### AI agent\n\nAn assistant a template's steps can use, with its own inputs, outputs and tools.\n\nIn the API: `/v1/agents`.\n\n## Access\n\n### Organization API key and personal access token\n\nAn organization API key is your organization's credential for systems: it reaches what an admin reaches, limited by its scopes. A personal access token acts as one person, with that person's permissions; use it for anything done as yourself. A personal access token sees exactly what its person sees in Moxo, so an admin's token sees what an admin sees. An organization API key sees what an admin sees, within its scopes.\n\nIn the API: `mxo_sk_…` and `mxo_pat_…`, sent as `Authorization: Bearer`.\n\n### Magic link\n\nThe emailed link that opens a step without signing in.\n\nIn the API: `magic_link` as a persona's `access`.\n\n### Portal\n\nA branded site where people sign in to see their flows and steps. Its audience is your own team, people outside your organization, or both.\n\nIn the API: `portal` as a persona's `access`, with its `portal`.\n\n### Action sent on its own\n\nOne request sent to a person outside any flow, such as a signature or an approval. It belongs to no flow and has no steps.\n\nIn the API: `/v1/actions`."}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"A personal access token (mxo_pat_...) or an organization API key (mxo_sk_...)."}},"schemas":{"StepSettings_FORM":{"type":"object","properties":{"options":{"description":"Switches for the files attached to this step. A type takes only the ones its step settings show.","type":"object","properties":{"preventDownload":{"description":"Prevent download: people can open the files attached to this step to read them, but can't download them. Needs view-only attachments switched on for your organization.","type":"boolean"}}},"aiEscalation":{"$ref":"#/components/schemas/StepSetting_aiEscalation"},"visibleToAllAssignees":{"description":"The older form of `visibility.mode: \"ALL\"`. Use `visibility` instead.","type":"boolean"},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"},"preparers":{"$ref":"#/components/schemas/StepSetting_preparers"},"reviewers":{"$ref":"#/components/schemas/StepSetting_reviewers"},"formFields":{"minItems":1,"type":"array","items":{"type":"object","properties":{"handle":{"type":"string","description":"A name you choose for the field, such as `client_name` or `is_us_citizen`: lowercase, and unique in this form. Required on a new field. Later changes in the same list use it where a field id goes; read the field's id from the outline."},"label":{"type":"string","description":"The question the person filling in the form reads, in sentence case, such as `Annual revenue` or `Are you a US citizen?`. Required to publish. When it is left out, a label is made from `handle`."},"type":{"type":"string","enum":["TEXT_SINGLE_LINE","TEXT_MULTI_LINE","SINGLE_SELECT","MULTI_SELECT","DROPDOWN","DYNAMIC_DROPDOWN","DATA_TABLE_LOOKUP","FILE_UPLOAD","DATE","NUMBER","EMAIL","PHONE","CURRENCY","CALCULATED","NAME","ADDRESS","SIGNATURE","YES_NO","RATING","NPS","SCALE","MATRIX","RANKING","URL","TIME","HIDDEN","AUTO_NUMBER","COUNTRY_SELECT","REPEATING_GROUP","HEADING","PARAGRAPH","IMAGE","VIDEO","PAGE_BREAK","LINE_SEPARATOR","FIELD_GROUP","TABLE"],"description":"The field's type."},"required":{"type":"boolean","description":"Whether the field must be answered."},"readOnly":{"description":"When `true`, the assignee sees the value but can't change it. Don't combine it with `required`: a read-only field isn't checked.","type":"boolean"},"options":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string","description":"The option as people see it."},"value":{"type":"string","description":"The value stored when it is chosen."},"id":{"type":"string","description":"The option's id. Keep it when sending the list back."}},"required":["label","value"]},"description":"For a choice field: its options, each `{ label, value }`."},"placeholder":{"description":"A hint shown inside the empty field, such as `jane@example.com`. Leave it out unless it adds something the label doesn't.","type":"string"},"helpText":{"type":"string","description":"Text shown under the field to help people answer."},"context":{"description":"A note for the AI preparer only, for when the label alone doesn't say which value belongs here. The person filling in the form never sees it.","type":"string","maxLength":500},"defaultValue":{"description":"A starting value, filled in before the assignee opens the form: fixed text, or a reference to an earlier value, such as `${{ steps.collect_kyc_documents.fields.full_name }}`, `${{ fields.company_name }}` or `${{ roles.customer.email }}`. A reference is read when the form opens, so the assignee sees the value filled in and can change it (unless `readOnly` is set). The step it reads must come earlier in the flow.","type":"string"},"integrationKey":{"description":"The key this field's value has in an outgoing webhook's or API call's payload. Defaults to the label in snake case (`Customer Email` becomes `customer_email`). Set it only when the receiving system expects another key, such as `customerEmail`.","type":"string","maxLength":64,"pattern":"^[a-zA-Z0-9_-]+$"},"width":{"type":"string","enum":["full","half"],"description":"`full` (the default) or `half` the form's width."},"validation":{"type":"object","properties":{"minLength":{"type":"number","description":"For text: the fewest characters accepted."},"maxLength":{"type":"number","description":"For text: the most characters accepted."},"min":{"type":"number","description":"For a number: the smallest value accepted."},"max":{"type":"number","description":"For a number: the largest value accepted."},"precision":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"For a number: the most decimal places accepted."},"pattern":{"type":"string","description":"For text: a regular expression the answer must match."},"customMessage":{"type":"string","description":"The message shown when the answer fails a check."},"minDateFromFieldId":{"type":"string","description":"For a date: the earliest date accepted is the answer to this other date field, by its id or `handle`."},"maxDateFromFieldId":{"type":"string","description":"For a date: the latest date accepted is the answer to this other date field, by its id or `handle`."},"defaultToCurrentDate":{"type":"boolean","description":"For a date: starts the field at today."},"futureDatesOnly":{"type":"boolean","description":"For a date: accepts only dates after today."},"pastDatesOnly":{"type":"boolean","description":"For a date: accepts only dates before today."},"allowedDaysOfMonth":{"minItems":1,"type":"array","items":{"anyOf":[{"type":"number","const":1},{"type":"number","const":15}]},"description":"For a date: the only days of the month accepted, `1`, `15` or both."},"allowLastDayOfMonth":{"type":"boolean","description":"For a date: also accepts the last day of the month, beside `allowedDaysOfMonth`."}},"description":"Checks on the answer. Only the ones for the field's type apply."},"conditionalLogic":{"type":"object","properties":{"action":{"description":"Whether the field is shown or hidden when the conditions match. `show`: shown only when they match. `hide`: hidden when they match.","type":"string","enum":["show","hide"]},"logicType":{"description":"How the conditions combine. `all`: every condition must match. `any`: at least one must match.","type":"string","enum":["all","any"]},"conditions":{"type":"array","items":{"$ref":"#/components/schemas/StepSetting_conditionsItem"},"description":"The conditions that decide whether the field is shown. Each one tests another field in this form (`fieldKey`) or a value from earlier in the flow (`source: \"ddr\"` with `ref`)."}},"required":["action","logicType","conditions"],"description":"When the field is shown: `action`, `logicType` and `conditions`."},"config":{"description":"Settings for the field's type. Use these keys exactly: a key the type doesn't have is ignored, and the default applies. `SCALE`: `{ min, max, step, leftLabel, rightLabel }` (defaults 1, 10 and 1; `step` must be positive). `NPS`: `{ leftLabel, rightLabel }`. `CURRENCY`: `{ currencyCode }`, an ISO 4217 code such as `USD`. `CALCULATED`: `{ formula, format, decimals }`, where `formula` uses `{{field:<handle>}}` and `{{column:<table handle>:<column key>}}`, and `format` is `NUMBER`, `CURRENCY` or `PERCENTAGE`; the field is read-only. `RANKING`: `{ items }`, the options to rank. `MATRIX`: `{ rows, columns }`. `MULTI_SELECT`: `{ searchOptions: true }` lets the person type to filter a long list of options.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"allowMultiple":{"description":"For a `DATA_TABLE_LOOKUP` field: when `true`, the person can pick several records. Leave it out, or send `false`, for one.","type":"boolean"},"subFields":{"type":"array","items":{"type":"object","properties":{"id":{"description":"The column's id. When you change a column, keep its id, even if you rename it. Leave it out on a new column.","type":"string"},"key":{"type":"string","description":"The column's key, used to reference it."},"label":{"type":"string","description":"The column's label."},"type":{"type":"string","enum":["TEXT_SINGLE_LINE","TEXT_MULTI_LINE","DROPDOWN","MULTI_SELECT","NUMBER","DATE","EMAIL","URL","TIME","PHONE","CURRENCY","COUNTRY_SELECT","DATA_TABLE_LOOKUP","FILE_UPLOAD","DYNAMIC_DROPDOWN"],"description":"The column's type."},"required":{"type":"boolean","description":"Whether each row must fill it."},"readOnly":{"description":"When `true`, the assignee can't edit the column. A preparer, AI or person, can still fill it, for example a question for a later step to answer. Don't combine it with `required`.","type":"boolean"},"hidden":{"description":"When `true`, the column holds data the assignee doesn't see, such as an id to write back later. A preparer can still fill it. Don't combine it with `required`.","type":"boolean"},"options":{"description":"The options of a `DROPDOWN` or `MULTI_SELECT` column, each `{ value, label }`, with `color` for a colored badge. A cell stores the option's `value`.","type":"array","items":{"type":"object","properties":{"value":{"type":"string","description":"What a cell stores when this option is picked. Usually the same as `label`."},"label":{"type":"string","description":"The option's visible text, such as \"In progress\" or \"Done\"."},"color":{"description":"A badge color for a status-style option, such as `green`, `amber` or `red`. Omit it for a plain dropdown option.","type":"string"}},"required":["value","label"]}},"placeholder":{"type":"string","description":"A hint shown in an empty cell."},"widthChars":{"description":"The column's width in characters, 8 to 60. Used for text, number and URL columns, and ignored with `widthMode` `auto`. Set it only for a column with long values, such as addresses, or very short ones, such as a 2-letter code.","type":"integer","minimum":8,"maximum":60},"widthMode":{"description":"For a text, number or URL column: `auto` fits the column to its longest value, so long comments stay readable (the table scrolls). `fixed`, or leaving it out, uses `widthChars`, or the default width. Use `auto` only for long text.","type":"string","enum":["fixed","auto"]},"defaultValue":{"description":"The value a new row starts with. Can include references to flow values. Not for file columns.","type":"string"},"displayFormat":{"description":"For a `DATE` column: how the date is shown, `locale`, `MDY`, `DMY` or `YMD`. The value is kept as `YYYY-MM-DD`.","type":"string","enum":["locale","MDY","DMY","YMD"]},"format":{"type":"string","enum":["text","ssn","zip","phone","email","number","date"],"description":"The format a text column must have: `text`, `ssn`, `zip`, `phone`, `email`, `number` or `date`."},"validation":{"type":"object","properties":{"minLength":{"type":"number","description":"For text: the fewest characters accepted."},"maxLength":{"type":"number","description":"For text: the most characters accepted."},"min":{"type":"number","description":"For a number: the smallest value accepted."},"max":{"type":"number","description":"For a number: the largest value accepted."},"precision":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"For a number: the most decimal places accepted."},"pattern":{"type":"string","description":"For text: a regular expression the answer must match."},"customMessage":{"type":"string","description":"The message shown when the answer fails a check."},"minDateFromFieldId":{"type":"string","description":"For a date: the earliest date accepted is the value of this other column, by its id or key."},"maxDateFromFieldId":{"type":"string","description":"For a date: the latest date accepted is the value of this other column, by its id or key."},"defaultToCurrentDate":{"type":"boolean","description":"For a date: starts the field at today."},"futureDatesOnly":{"type":"boolean","description":"For a date: accepts only dates after today."},"pastDatesOnly":{"type":"boolean","description":"For a date: accepts only dates before today."},"allowedDaysOfMonth":{"minItems":1,"type":"array","items":{"anyOf":[{"type":"number","const":1},{"type":"number","const":15}]},"description":"For a date: the only days of the month accepted, `1`, `15` or both."},"allowLastDayOfMonth":{"type":"boolean","description":"For a date: also accepts the last day of the month, beside `allowedDaysOfMonth`."}},"description":"Checks on the answer. Only the ones for the field's type apply."},"config":{"description":"For a `CURRENCY` column: `{ \"currencyCode\": \"USD\" }`, an ISO 4217 code. For a `DYNAMIC_DROPDOWN` column: `{ \"sourceMode\": \"prior_step\", \"optionsSourceRef\": \"{ref:step:STEP_ID/field:FIELD_ID}\" }`, the earlier answer whose values every row picks from. Leave it out for other columns.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"showTotal":{"type":"boolean","description":"Whether the table shows the column's total."},"rowFormula":{"type":"object","properties":{"formula":{"type":"string","maxLength":500,"description":"The formula, naming each input by its `id`."},"inputs":{"maxItems":10,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","maxLength":40,"pattern":"^[A-Za-z0-9_-]+$","description":"The name the formula uses for this input."},"ref":{"type":"string","maxLength":500,"description":"The input's value: a column of the row or a flow value, as a reference."}},"required":["id","ref"]},"description":"The values the formula uses."},"emptyAsZero":{"type":"boolean","description":"Whether an empty input counts as 0."}},"required":["formula"],"description":"Works out the column from other values in the same row, with a formula."},"autoFillFrom":{"type":"object","properties":{"sourceFieldId":{"type":"string","description":"The \"Look up a record\" question whose record fills this one, by its id."},"column":{"type":"string","description":"The record's column that fills it, by name."},"columnFieldId":{"type":"string","description":"The record's column that fills it, by id, so a rename does not break it."}},"description":"Fills this column from the record picked in a `DATA_TABLE_LOOKUP` column in the same row."},"calculateFrom":{"type":"object","properties":{"leftFieldId":{"type":"string","description":"The first column of the sum, by its id."},"op":{"type":"string","enum":["multiply","divide","add","subtract"],"description":"The sum: `add`, `subtract`, `multiply` or `divide`."},"right":{"description":"The other side of the sum: a column by its id, or a number."}},"description":"Works out a number column from other columns in the same row."}},"required":["key","label","type"]},"description":"For a repeating group: its columns."},"minRows":{"type":"number","description":"For a repeating group: the fewest rows."},"maxRows":{"type":"number","description":"For a repeating group: the most rows."},"minRowsRef":{"type":"string","description":"For a repeating group: the fewest rows, read from a number earlier in the flow, as a reference."},"maxRowsRef":{"type":"string","description":"For a repeating group: the most rows, read from a number earlier in the flow, as a reference."},"validateCells":{"type":"boolean","description":"For a repeating group: check each cell against its column's settings when the form is submitted."},"itemLabel":{"description":"For a repeating group: the name for one entry, such as `Beneficiary`. The form then reads \"Add Beneficiary\" and \"Beneficiary 1\" instead of \"row\". Leave it out for a general list.","type":"string","maxLength":40},"itemLabelPlural":{"description":"For a repeating group: the plural of `itemLabel`, such as `Beneficiaries`. Needed only when the plural isn't regular.","type":"string","maxLength":40},"repeatingGroupLayout":{"description":"For a repeating group: `table` (the default) shows a table on a wide screen and cards on a narrow one; `cards` always shows cards, which suits a group with many columns.","type":"string","enum":["table","cards"]},"allowDuplicateRows":{"description":"For a repeating group: `true` shows a Duplicate last button beside Add, in the table and in cards. It copies the last row's answers the person can edit. File uploads are left out, read-only and hidden columns start from their defaults, and calculated columns are worked out again. The new row is added at the end. Leave it out to hide the button.","type":"boolean"},"frozenColumnCount":{"description":"For a repeating group shown as a table: how many columns, counted from the first, stay in view while the table scrolls sideways, from 0 to 3. Leave it out to freeze none.","type":"integer","minimum":0,"maximum":3},"repeatingGroupLabelColumnId":{"description":"For a repeating group shown as cards (`repeatingGroupLayout` `cards`): the column whose value titles each card, by its id (or its key, when it has no id). Defaults to the first column. Not used in the table layout.","type":"string","maxLength":80},"summaries":{"description":"For a repeating group: values worked out down the rows and shown under the table. A sum, average, minimum, maximum or count is `{ columnId, calc: { kind: \"aggregate\", aggregate }, name, row }`, where `aggregate` is `sum`, `avg`, `min`, `max` or `count`; all but `count` need a `NUMBER` or `CURRENCY` column. A formula over the table's totals is `calc: { kind: \"formula\", formula, format, decimals }`: `formula` uses `{{column:<table field id>:<column id>}}` for a column's sum (add `:avg`, `:min`, `:max` or `:count`), numbers, `+ - * /` and brackets, and `format` is `NUMBER`, `CURRENCY` or `PERCENTAGE`; give it a `name`, and `columnId` says where it shows. `columnId` is a column's id (or key). `name` is what later steps see, such as `Sum of Loan amount`, and `row` puts summaries into one footer row, such as `Total`. Keep an existing summary's `id`.","maxItems":40,"type":"array","items":{"type":"object","properties":{"id":{"description":"The total's id: `sum_<uuid>` or `sum_<column id>_<aggregate>`. The value is saved under this key, so it never matches another answer's key.","type":"string","maxLength":80,"pattern":"^sum_[A-Za-z0-9][A-Za-z0-9_-]*$"},"name":{"type":"string","maxLength":120,"description":"The summary's name, which later steps see, such as `Sum of Loan amount`."},"columnId":{"type":"string","minLength":1,"maxLength":80,"description":"The id or key of the column, from `subFields[]`, whose footer shows the value."},"row":{"type":"string","maxLength":60,"description":"The footer row it is shown in, such as `Total`. Summaries with the same `row` share one row."},"calc":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","const":"aggregate","description":"`aggregate`: one calculation down one column."},"aggregate":{"type":"string","enum":["sum","avg","min","max","count"],"description":"`sum`, `avg`, `min` or `max` of a `NUMBER` or `CURRENCY` column, or `count` of any column."}},"required":["kind","aggregate"]},{"type":"object","properties":{"kind":{"type":"string","const":"formula","description":"`formula`: arithmetic over this table's totals."},"formula":{"type":"string","minLength":1,"maxLength":500,"description":"The formula: `{{column:<table field id>:<column id>}}` for a column's sum (add `:avg`, `:min`, `:max` or `:count` for another total), numbers, `+ - * /` and brackets."},"format":{"type":"string","enum":["NUMBER","CURRENCY","PERCENTAGE"],"description":"For a formula: `NUMBER`, `CURRENCY` or `PERCENTAGE`."},"decimals":{"type":"integer","minimum":0,"maximum":6,"description":"For a formula: decimal places, 0 to 6."}},"required":["kind","formula"]}],"description":"What the summary works out: `{ kind: \"aggregate\", aggregate }` or `{ kind: \"formula\", formula, format, decimals }`."}},"required":["columnId","calc"]}},"prefillFromInput":{"description":"For a repeating group: the key of a repeating group flow field asked for at the start, whose rows fill this group. Set `readOnly` to `true` with it.","type":"string","maxLength":80},"assignedRoleHandle":{"description":"With `fieldAssignment` `per-role`: the role that fills this field, by its name, its id, or the `handle` of a role added earlier in the same list.","type":"string"},"shared":{"description":"With `fieldAssignment` `per-role`: everyone on the step fills this field. Each field has either `assignedRoleHandle` or `shared`.","type":"boolean","const":true},"groupId":{"description":"The form group this field belongs to.","type":"string"},"dependsOn":{"type":"object","properties":{"fieldHandle":{"type":"string","description":"For a dropdown whose options depend on another field's answer: that field's `handle`, declared earlier in this form's `formFields`."},"mapping":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}},"description":"Each answer of the other field, with the options this field shows for it."},"fieldId":{"type":"string","description":"The question this one depends on, by its id."}},"required":["fieldHandle","mapping"],"description":"For a dropdown whose options depend on another field's answer: `{ fieldHandle, mapping }`."},"fieldId":{"type":"string","description":"The question's id. Keep it when sending the list back."},"assignedRoleId":{"description":"With per-role field assignment: the `roleId` of the role that fills in this field.","type":"string"},"assignedRoleIds":{"description":"With per-role field assignment: the `roleId`s of the roles that fill in this field, when two or more do. Use instead of `assignedRoleId`.","type":"array","items":{"type":"string"}},"assignedToEveryone":{"description":"With per-role field assignment: `true` when everyone assigned to the action fills in this field. Takes precedence over `assignedRoleIds` and `assignedRoleId`.","type":"boolean","const":true},"groupTitle":{"type":"string","description":"A field group's heading, shown on each copy when the group repeats."},"key":{"type":"string","description":"An older id for the field: its answers are saved under it when the field has no `fieldId`."},"autoFillFrom":{"type":"object","properties":{"sourceFieldId":{"type":"string","description":"The \"Look up a record\" question whose record fills this one, by its id."},"column":{"type":"string","description":"The record's column that fills it, by name."},"columnFieldId":{"type":"string","description":"The record's column that fills it, by id, so a rename does not break it."}},"description":"Fills this field from a column of the record someone picked in a `DATA_TABLE_LOOKUP` field on the same form."},"defaultFromDDR":{"type":"string","description":"Fills a `FILE_UPLOAD` field with the files that started the flow, such as the attachments of the email that started it."},"repeatFrom":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Repeats this group of fields once for each row of a table field on the same form."},"collapsible":{"type":"boolean","description":"Lets people filling the form open and close this `FIELD_GROUP` by its heading. A group that can collapse needs a `label`."},"startCollapsed":{"type":"boolean","description":"With `collapsible` on, the group starts closed when the form opens. A closed group still opens on submit when a required field inside it is empty."},"sensitive":{"type":"boolean","description":"Keeps the answers private in reports: reports show only how many people answered."}},"required":["handle","label","type"]},"description":"The form's fields, at least one."},"fieldAssignment":{"description":"Set to `per-role` to assign each field to one of the step's roles, whose assignee fills it in.","type":"string","enum":["per-role"]},"hideOtherRoleFields":{"description":"When `true` and `fieldAssignment` is `per-role`, each person sees only the fields assigned to their own roles. When `false` or omitted, everyone sees the whole form, and other roles' fields are read-only.","type":"boolean"},"display":{"description":"How the form is shown to the person answering. `standard` (the default) shows the whole form on one scrolling page; `focused` shows one section per screen, which suits a long form answered on a phone; `on-step` (Fill in right on the step) shows the questions right on the action in a web browser, so the person answers and submits without opening the form first. `on-step` applies only to a form with no `PAGE_BREAK`, `TABLE`, `REPEATING_GROUP` or `MATRIX` field; any other form opens on its own screen. It changes only the presentation, never the questions or their order.","type":"string","enum":["standard","focused","on-step"]},"autoFolder":{"description":"A folder in the flow's Files panel for the files the assignee attaches to `FILE_UPLOAD` fields. It also receives the submission's PDF and CSV, unless `exportFolder` names a different folder. A plain name is used as written. The name can include a value from earlier in the flow. An empty value is left out, and the text around it stays. If nothing is left, the file stays unfiled.","type":"string"},"exportFolder":{"description":"A folder in the flow's Files panel for the submission's PDF and CSV, kept apart from the files the assignee attached. Omit it to keep them with the attachments. A plain name is used as written. The name can include a value from earlier in the flow. An empty value is left out, and the text around it stays. If nothing is left, the file stays unfiled.","type":"string"},"formPdfOptions":{"description":"What the PDF of a submitted form leaves out. Applies to the stored PDF, its preview and the Word export, for the whole form. Omit it, or set both values to `false`, for the full PDF. The CSV is not affected.","type":"object","properties":{"leaveOutBlankAnswers":{"description":"When `true`, a field with no answer is left out of the PDF and the Word export instead of printing a dash. `false` and `0` count as answers.","type":"boolean"},"leaveOutLayoutFields":{"description":"When `true`, every `HEADING`, `PARAGRAPH` and `IMAGE` field is left out of the PDF and the Word export. Fields that take an answer, and page breaks, stay.","type":"boolean"}}},"attachments":{"description":"Reference material shown on the step: files, web links or both. A web link (`{ kind: \"link\", url }`) is a page the assignee should open. Its `url` can be a fixed `https://` address or a reference to a value from earlier in the flow, such as `${{ steps.look_up_portal_link.fields.latest_url }}`, so a running flow always links to the latest address.","type":"array","items":{"anyOf":[{"type":"object","properties":{"ref":{"type":"string","description":"A file from an earlier step, as a reference such as `${{ steps.upload_contract.fields.uploaded_files }}`, or an uploaded file's id."}},"required":["ref"]},{"$ref":"#/components/schemas/StepSetting_attachmentsItem"},{"type":"object","properties":{"kind":{"type":"string","const":"file","description":"Set to `file`."},"ref":{"type":"string","description":"A file: an uploaded file's id, or a reference to a file from an earlier step."},"name":{"type":"string","minLength":1,"maxLength":255,"description":"The file's name as shown on the step."}},"required":["kind","ref"]}]}},"assist":{"description":"Assignee Assist on this form. `{ enabled: true }` lets the person filling it in ask for help. Leave it out, or send `{ enabled: false }`, to leave Assist off.","type":"object","properties":{"enabled":{"type":"boolean","description":"Turns on Assignee Assist for this step. `true` opens a helper panel where the person working on the step can ask questions and, on a form, get help filling it in. `false`, or no `assist` object, leaves Assist off."},"agentId":{"type":"string","description":"The agent that helps. Leave it out for your organization's default."},"grantedPriorFields":{"maxItems":25,"type":"array","items":{"type":"string","minLength":1},"description":"Values from earlier steps that Assist may also read, each a reference to a flow value, such as `${{ steps.lookup.fields.portal_url }}`. Each is read in addition to what Assist reads by default."},"whatToKnow":{"description":"Facts and contacts Assist may share with the person asked, such as office hours or who to call. Up to 4,000 characters.","type":"string","maxLength":4000},"answerStyle":{"description":"How Assist answers: tone, length and what to avoid. Ignored when `agentId` picks an agent. Up to 2,000 characters.","type":"string","maxLength":2000},"faqFiles":{"description":"Up to 5 file ids Assist reads and may quote from. The person asked can't see or open them.","maxItems":5,"type":"array","items":{"type":"string","minLength":1,"maxLength":128}},"summarizeQuestions":{"description":"`true` adds a summary of what people asked Assist to the managers' Private notes. It uses AI credits. Off when omitted.","type":"boolean"},"privateNotesGuidance":{"description":"What to include in the Private notes summary of people's questions. Used only when `summarizeQuestions` is `true`. Assist never reads it in chat. Up to 2,000 characters.","type":"string","maxLength":2000},"disclaimer":{"description":"The note shown under the Assist chat box. Assist never reads it. Leave it out to show the default note. Up to 300 characters.","type":"string","maxLength":300}},"required":["enabled"]},"guidedFill":{"description":"Guided fill on this form. `{ enabled: true }` lets the participant complete the form from the chat, with the form beside it. Leave it out to keep the form manual only. Separate from `assist`.","type":"object","properties":{"enabled":{"type":"boolean","description":"Allows guided fill on this form. `true` lets the participant complete the form from the chat, with the form beside it. `false`, or no object, keeps the form manual only."},"defaultMode":{"default":"guided","description":"Where the form opens when guided fill is allowed: `guided` opens the chat, `manual` opens the form. Defaults to `guided`. The participant can switch.","type":"string","enum":["guided","manual"]}},"required":["enabled"]},"closeAtDue":{"$ref":"#/components/schemas/StepSetting_closeAtDue"},"formSource":{"description":"Where this form's questions come from. Omit for the questions in `formFields`.","type":"object","properties":{"kind":{"type":"string","enum":["authored","endpoint"],"description":"`authored`: the questions in `formFields`. `endpoint`: the questions come from your system, the first time the assignee opens the form."},"request":{"type":"object","properties":{"url":{"type":"string","description":"Your endpoint's https:// address. May hold references, filled in when the form is first opened."},"method":{"type":"string","enum":["GET","POST"],"description":"GET or POST. A GET sends no body."},"queryParams":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"},"description":"Query parameters added to the address, by name. Values may hold references."},"headers":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"},"description":"Request headers, by name. Values may hold references. Moxo always sends Accept: application/json."},"body":{"description":"The JSON body, as an object or as JSON text. References inside its strings are filled in when the request is sent."},"connectionId":{"type":"string","description":"The saved Secret the request signs in with. When set, inline sign-in is ignored."},"auth":{"type":"object","properties":{"type":{"type":"string","enum":["none","bearer","basic"],"description":"Inline sign-in: none, a Bearer token, or Basic."}},"description":"Inline sign-in, when no saved Secret is set."}},"description":"The request Moxo sends to your endpoint when the form's questions come from your system (`kind: \"endpoint\"`)."}},"required":["kind"]}},"required":["assignees"],"title":"Form settings","description":"The settings a `FORM` step is sent with, beside the shared ones in `StepSettings`. This is the schema `POST /v1/templates` and `POST /v1/templates/{id}/changes` check a step against: a setting not listed here is refused with `UNKNOWN_SETTING`.\n\nSome settings depend on your organization's plan. One your plan doesn't include is refused with `UNKNOWN_SETTING`.\n\n**Checked when you publish.** A save keeps a step that isn't finished; `POST /v1/templates/{id}/check` and publish name what is still missing:\n- Add at least one field to this form.\n- Add your endpoint, or turn off Load the form from your system.\n- This step has an API key typed in directly, so it’s stored in plain text where anyone who can edit the template could read it. Open the lookup field’s source settings and choose a saved Secret under Authentication, so it’s kept secure and hidden.\n- This step has an API key typed in directly, so it’s stored in plain text where anyone who can edit the template could read it. Open the Form’s request and choose a saved Secret under Authentication, so it’s kept secure and hidden.\n\nA template read (`GET /v1/templates/{id}`) returns the step's settings as stored, in `StepConfig_FORM`.","x-moxo-step-type":"FORM"},"StepSettings_QUESTIONNAIRE":{"type":"object","properties":{"options":{"description":"Switches for the files attached to this step. A type takes only the ones its step settings show.","type":"object","properties":{"preventDownload":{"description":"Prevent download: people can open the files attached to this step to read them, but can't download them. Needs view-only attachments switched on for your organization.","type":"boolean"}}},"aiEscalation":{"$ref":"#/components/schemas/StepSetting_aiEscalation"},"visibleToAllAssignees":{"description":"The older form of `visibility.mode: \"ALL\"`. Use `visibility` instead.","type":"boolean"},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"},"preparers":{"$ref":"#/components/schemas/StepSetting_preparers"},"reviewers":{"$ref":"#/components/schemas/StepSetting_reviewers"},"advisors":{"description":"An AI advisor that shows a recommendation before the assignee acts. Optional. For Approval, Decision, To-do and Questionnaire steps.","type":"object","properties":{"participants":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","const":"AI","description":"The advisor's type. Always `AI`."},"agentId":{"description":"The id of one of your organization's AI agents. Leave it out to use the organization's default.","type":"string"},"context":{"description":"What the advisor considers for this step, for example `Consider the budget from ${{ steps.budget_review.fields.approved_amount }}`.","type":"string"},"inputs":{"description":"The values the advisor can see, each a reference to a value from earlier in the flow or a fixed value, filled in when the step runs. When left out, the references in `context` are used instead.","type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"The name the AI sees this value under."},"value":{"type":"string","description":"Fixed text, or a reference to a flow value, such as `${{ steps.intake.fields.company_name }}`."},"type":{"type":"string","enum":["TEXT","FILE"],"description":"`TEXT` (the default) or `FILE`, for a file the AI reads."}},"required":["name","value"]}},"roleId":{"type":"string","description":"For a person: the role that takes this seat, by its id."},"contactId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"An external user named on the seat, by the `usr_` id the template read shows. `null` follows the read, as for `userId`."},"userId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"A person named on the seat, by the `usr_` id the template read shows. `null` where the read showed `null` (someone with no id here) keeps the saved person; `null` where it showed an id takes them off the seat."},"prompt":{"type":"string","description":"The AI participant's step context: instructions for this step only."},"criteria":{"type":"string","description":"For an AI reviewer: what to check. Read before `prompt`."},"privateNotesGuidance":{"type":"string","maxLength":2000,"description":"When no agent is named: what the AI notes privately for the flow's managers."},"sendBackReply":{"type":"string","enum":["outcome_with_reason","outcome_only"],"description":"When the AI sends work back and no agent is named: what the reply says, `outcome_with_reason` or `outcome_only`."},"howToExplain":{"type":"string","maxLength":2000,"description":"When the AI sends work back and no agent is named: how it explains what to fix."},"participantId":{"type":"string","description":"The participant's id on the step. Keep it when sending the seat back; leave it out for a new participant."},"order":{"type":"number","description":"The participant's place in the seat, from 0, when they act one after another."}},"required":["type"]},"description":"The advisors: AI agents, each with optional instructions and values to see."},"sequential":{"type":"boolean","description":"Whether the advisors act one after another."},"completion":{"type":"object","properties":{"mode":{"type":"string","enum":["ANY_ONE","ALL"],"description":"`ANY_ONE`: one participant finishing is enough. `ALL`: every participant finishes."}},"required":["mode"],"description":"When the seat is done."},"showToExternalAssignee":{"anyOf":[{"type":"boolean"},{"type":"boolean"}],"description":"Advisors only. `true`: an assignee outside your organization may read the recommendation, as advice from your organization."},"canEditAnswers":{"description":"Reviewers only, on a Form, PDF form or File request step. `true` lets the reviewer whose turn it is edit the submitted answers (on a File request, add and remove its files) during review, in the Moxo app, instead of sending them back. Off unless set.","type":"boolean"},"reviewItemsTogether":{"description":"Reviewers only, on a person's step inside a For each whose items run at the same time. `true` gives the reviewer one list and one notice for every item instead of one review per item; each item keeps its own run and review. With the loop's `syncStepsAcrossIterations` on, the reviewer approves every item at once (`approve_reviews_together`); off, each item is approved on its own. Publish refuses it in a Repeat while, on an \"Approve before it runs\" step, with no person or role reviewing, and in a loop that runs items one at a time. Off unless set.","type":"boolean"}},"required":["participants"]},"questionnaire":{"description":"The questions to ask.","type":"object","properties":{"questions":{"type":"array","items":{"type":"object","properties":{"questionId":{"type":"string","description":"The question's id. Completing the step names each answer by it: give each question one, or read the ids from the template after saving."},"question":{"type":"string","description":"The question as people see it."},"answerType":{"type":"string","enum":["SINGLE_SELECT","MULTI_SELECT","TEXT","YES_NO","DATE","TIME"],"description":"How the question is answered: `SINGLE_SELECT`, `MULTI_SELECT`, `TEXT`, `YES_NO`, `DATE` or `TIME`."},"options":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string","description":"What an answer stores when this option is picked. Usually the same as `label`."},"label":{"type":"string","description":"The text people see."}},"required":["value","label"]},"description":"For `SINGLE_SELECT` and `MULTI_SELECT`: the choices, each `{ value, label }`."},"required":{"type":"boolean","description":"Whether the question must be answered."}},"required":["question","answerType"]},"description":"The questions, in order."}},"required":["questions"]},"review":{"description":"Whether someone checks the answers before the step completes. Optional.","type":"object","properties":{"required":{"type":"boolean","description":"`true` seats the `reviewer` role, so the answers are reviewed before the questionnaire completes. `false` is accepted only when the step has no reviewers; on a step that has reviewers it is refused (`QUESTIONNAIRE_REVIEW_OFF_WITH_REVIEWERS`): remove them with the step's `reviewers` setting."},"reviewer":{"description":"The role, by name, that reviews the answers. Required when `required` is `true`. Saving the template seats that role as the step's reviewer.","type":"string"}},"required":["required"]},"exportFolder":{"description":"A folder in the Files panel that the generated submission PDF and CSV are put in. A questionnaire collects no files, so this is the only thing it can file. A plain name is used as written. The name can include a value from earlier in the flow. An empty value is left out, and the text around it stays. If nothing is left, the file stays unfiled.","type":"string"},"attachments":{"description":"Reference material shown on the step: files, web links or both. A web link (`{ kind: \"link\", url }`) is a page the assignee should open. Its `url` can be a fixed `https://` address or a reference to a value from earlier in the flow, such as `${{ steps.look_up_portal_link.fields.latest_url }}`, so a running flow always links to the latest address.","type":"array","items":{"anyOf":[{"type":"object","properties":{"ref":{"type":"string","description":"A file from an earlier step, as a reference such as `${{ steps.upload_contract.fields.uploaded_files }}`, or an uploaded file's id."}},"required":["ref"]},{"$ref":"#/components/schemas/StepSetting_attachmentsItem"},{"type":"object","properties":{"kind":{"type":"string","const":"file","description":"Set to `file`."},"ref":{"type":"string","description":"A file: an uploaded file's id, or a reference to a file from an earlier step."},"name":{"type":"string","minLength":1,"maxLength":255,"description":"The file's name as shown on the step."}},"required":["kind","ref"]}]}}},"required":["assignees"],"title":"Questionnaire settings","description":"The settings a `QUESTIONNAIRE` step is sent with, beside the shared ones in `StepSettings`. This is the schema `POST /v1/templates` and `POST /v1/templates/{id}/changes` check a step against: a setting not listed here is refused with `UNKNOWN_SETTING`.\n\nSome settings depend on your organization's plan. One your plan doesn't include is refused with `UNKNOWN_SETTING`.\n\n**Checked when you publish.** A save keeps a step that isn't finished; `POST /v1/templates/{id}/check` and publish name what is still missing:\n- Add at least one question.\n\nA template read (`GET /v1/templates/{id}`) returns the step's settings as stored, in `StepConfig_QUESTIONNAIRE`.","x-moxo-step-type":"QUESTIONNAIRE"},"StepSettings_POLL":{"type":"object","properties":{"options":{"description":"Switches for the files attached to this step. A type takes only the ones its step settings show.","type":"object","properties":{"preventDownload":{"description":"Prevent download: people can open the files attached to this step to read them, but can't download them. Needs view-only attachments switched on for your organization.","type":"boolean"}}},"visibleToAllAssignees":{"description":"The older form of `visibility.mode: \"ALL\"`. Use `visibility` instead.","type":"boolean"},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"},"preparers":{"$ref":"#/components/schemas/StepSetting_preparers"},"poll":{"description":"The settings of a Poll step, a group vote. Each of `questions[]` has a closed set of at least two `options[]`; per question, `allowMultiple` allows several choices and `allowOther` adds a free-text answer. Each option is `{ value, label }`: a vote names the option by its `value` (left out, by its place: `o1`, `o2`, …). `closeOnMajorityValue` (single-choice questions only) closes the poll early when the option with that value has more than half of the assignees' votes. `hideVoterNames` makes the results anonymous. `resultsVisibility` sets who sees the tally: `MANAGER_ONLY` (the default), `LIVE` or `AFTER_CLOSE`. A poll closes once everyone has voted; `close.mode` sets what happens until then: `ALL_RESPONDED` (keep waiting), `MANUAL` (a flow manager closes it) or `DEADLINE` (it closes at the step's due date, so set `due` too).","type":"object","properties":{"questions":{"type":"array","items":{"type":"object","properties":{"questionId":{"type":"string","description":"The question's id. Votes name the question by it. When it is left out, the question's position is used: `q1` for the first, `q2` for the second, and so on."},"question":{"type":"string","minLength":1,"description":"The question as voters see it."},"options":{"minItems":2,"type":"array","items":{"type":"object","properties":{"value":{"type":"string","description":"What a vote names the option by. When it is left out, the option's position is used: `o1` for the first, `o2` for the second, and so on."},"label":{"type":"string","minLength":1,"description":"The option as voters see it."}},"required":["label"]},"description":"The options, at least two."},"allowMultiple":{"type":"boolean","description":"Whether a voter can pick several options."},"allowOther":{"type":"boolean","description":"Adds an \"Other\" option with a written answer."},"closeOnMajorityValue":{"type":"string","minLength":1,"description":"For a single-choice question: close the poll early once the option with this `value` has more than half of the voters."}},"required":["question","options"]},"description":"The questions, each with at least two options."},"hideVoterNames":{"type":"boolean","description":"When `true`, the results don't show who voted for what."},"resultsVisibility":{"type":"string","enum":["MANAGER_ONLY","LIVE","AFTER_CLOSE"],"description":"Who sees the results: `MANAGER_ONLY` (the default), `LIVE` (voters see them as votes arrive) or `AFTER_CLOSE` (voters see them once the poll closes)."},"close":{"type":"object","properties":{"mode":{"type":"string","enum":["ALL_RESPONDED","MANUAL","DEADLINE"],"description":"A poll always closes once everyone has voted. Otherwise: `ALL_RESPONDED` keeps waiting, `MANUAL` waits for a manager to close it, and `DEADLINE` closes it at the step's due date (set `stepDue` too)."}},"required":["mode"],"description":"When the poll closes if not everyone has voted."}},"required":["questions","close"]},"attachments":{"description":"Reference material shown on the step: files, web links or both. A web link (`{ kind: \"link\", url }`) is a page the assignee should open. Its `url` can be a fixed `https://` address or a reference to a value from earlier in the flow, such as `${{ steps.look_up_portal_link.fields.latest_url }}`, so a running flow always links to the latest address.","type":"array","items":{"anyOf":[{"type":"object","properties":{"ref":{"type":"string","description":"A file from an earlier step, as a reference such as `${{ steps.upload_contract.fields.uploaded_files }}`, or an uploaded file's id."}},"required":["ref"]},{"$ref":"#/components/schemas/StepSetting_attachmentsItem"},{"type":"object","properties":{"kind":{"type":"string","const":"file","description":"Set to `file`."},"ref":{"type":"string","description":"A file: an uploaded file's id, or a reference to a file from an earlier step."},"name":{"type":"string","minLength":1,"maxLength":255,"description":"The file's name as shown on the step."}},"required":["kind","ref"]}]}}},"required":["assignees","poll"],"title":"Poll settings","description":"The settings a `POLL` step is sent with, beside the shared ones in `StepSettings`. This is the schema `POST /v1/templates` and `POST /v1/templates/{id}/changes` check a step against: a setting not listed here is refused with `UNKNOWN_SETTING`.\n\nSome settings depend on your organization's plan. One your plan doesn't include is refused with `UNKNOWN_SETTING`.\n\n**Checked when you publish.** A save keeps a step that isn't finished; `POST /v1/templates/{id}/check` and publish name what is still missing:\n- Add at least one poll question.\n- A deadline poll needs an end date — set when voting closes.\n\nA template read (`GET /v1/templates/{id}`) returns the step's settings as stored, in `StepConfig_POLL`.","x-moxo-step-type":"POLL"},"StepSettings_FILE_REQUEST":{"type":"object","properties":{"options":{"description":"Switches for the files attached to this step. A type takes only the ones its step settings show.","type":"object","properties":{"preventDownload":{"description":"Prevent download: people can open the files attached to this step to read them, but can't download them. Needs view-only attachments switched on for your organization.","type":"boolean"}}},"aiEscalation":{"$ref":"#/components/schemas/StepSetting_aiEscalation"},"visibleToAllAssignees":{"description":"The older form of `visibility.mode: \"ALL\"`. Use `visibility` instead.","type":"boolean"},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"},"preparers":{"$ref":"#/components/schemas/StepSetting_preparers"},"reviewers":{"$ref":"#/components/schemas/StepSetting_reviewers"},"fileRequest":{"description":"The upload settings.","type":"object","properties":{"maxFiles":{"description":"The most files one step accepts, 1 to 50.","type":"integer","minimum":1,"maximum":50},"maxFileSizeMB":{"description":"The largest file accepted, in megabytes, 1 to 100. Defaults to 100.","type":"integer","minimum":1,"maximum":100},"allowedTypes":{"type":"array","items":{"type":"string"},"description":"The file types accepted, such as `pdf` or `jpg`. Leave it out to accept any."},"instructions":{"type":"string","description":"What to upload, as the assignee sees it."},"autoFolder":{"description":"One folder in the Files panel that uploaded files are put in. A plain name is used as written. A slash with no spaces stays in the name. Several folders are `folderPath`, not this field. The name can include a value from earlier in the flow. An empty value is left out, and the text around it stays. If nothing is left, the file stays unfiled.","type":"string"},"folderPath":{"description":"Nested folders for uploaded files, from the parent down, at most 3. Use this when the files should land in more than one folder. A single folder stays in `autoFolder`. Each entry is one folder name and can include a value from earlier in the flow, filled in on its own. A slash inside that value stays in that one folder. A folder that already exists under its parent is used again. Do not send a fourth entry.","minItems":2,"maxItems":3,"type":"array","items":{"type":"string","minLength":1,"maxLength":255}}}},"reviewer":{"description":"The role, by name, of the person who checks the uploaded files before the step completes. Saving the template seats that role as the step's reviewer.","type":"string"},"aiRename":{"description":"Renames the uploaded files when the step completes. `mode: \"ai\"` names each file from its content, with an optional hint in `additionalPrompt`, and uses AI credits. `mode: \"pattern\"` builds names from `nameTemplate` and flow values, without credits. Renaming happens as the step completes, so later steps see the new names.","type":"object","properties":{"enabled":{"default":false,"description":"Whether uploaded files are renamed when the step completes. `mode: \"ai\"` names each file from its content and uses AI credits; `mode: \"pattern\"` builds names from flow values without credits. Defaults to `false`.","type":"boolean"},"mode":{"default":"ai","description":"How the files are renamed. `ai` (the default): AI picks each name. `pattern`: `nameTemplate` is filled in with flow values, using no AI credits; a value that is missing keeps the file's original name. The file type always stays the upload's own.","type":"string","enum":["ai","pattern"]},"additionalPrompt":{"description":"A hint for AI renaming, which can include flow values, for example `{Client legal name}-Invoice, BAS, or Payroll Summary-{Financial year}`. Used only when `mode` is `ai`. A file whose value is missing keeps its name.","type":"string","maxLength":2000},"nameTemplate":{"description":"The naming pattern, with flow value references, for example `${{ fields.xero_code }}-${{ thisFile.fileType }}-${{ fields.financial_year }}`. Used only when `mode` is `pattern`. A file whose reference can't be filled keeps its name. The file type is the upload's extension (such as `pdf` or `xlsx`), or a type from its MIME type.","type":"string","maxLength":500}}},"attachments":{"description":"Reference material shown on the step: files, web links or both. A web link (`{ kind: \"link\", url }`) is a page the assignee should open. Its `url` can be a fixed `https://` address or a reference to a value from earlier in the flow, such as `${{ steps.look_up_portal_link.fields.latest_url }}`, so a running flow always links to the latest address.","type":"array","items":{"anyOf":[{"type":"object","properties":{"ref":{"type":"string","description":"A file from an earlier step, as a reference such as `${{ steps.upload_contract.fields.uploaded_files }}`, or an uploaded file's id."}},"required":["ref"]},{"$ref":"#/components/schemas/StepSetting_attachmentsItem"},{"type":"object","properties":{"kind":{"type":"string","const":"file","description":"Set to `file`."},"ref":{"type":"string","description":"A file: an uploaded file's id, or a reference to a file from an earlier step."},"name":{"type":"string","minLength":1,"maxLength":255,"description":"The file's name as shown on the step."}},"required":["kind","ref"]}]}},"assist":{"description":"Assignee Assist on this file request. `{ enabled: true }` lets the assignee ask for help. Leave it out, or send `{ enabled: false }`, to leave Assist off.","type":"object","properties":{"enabled":{"type":"boolean","description":"Turns on Assignee Assist for this step. `true` opens a helper panel where the person working on the step can ask questions and, on a form, get help filling it in. `false`, or no `assist` object, leaves Assist off."},"agentId":{"type":"string","description":"The agent that helps. Leave it out for your organization's default."},"grantedPriorFields":{"maxItems":25,"type":"array","items":{"type":"string","minLength":1},"description":"Values from earlier steps that Assist may also read, each a reference to a flow value, such as `${{ steps.lookup.fields.portal_url }}`. Each is read in addition to what Assist reads by default."},"whatToKnow":{"description":"Facts and contacts Assist may share with the person asked, such as office hours or who to call. Up to 4,000 characters.","type":"string","maxLength":4000},"answerStyle":{"description":"How Assist answers: tone, length and what to avoid. Ignored when `agentId` picks an agent. Up to 2,000 characters.","type":"string","maxLength":2000},"faqFiles":{"description":"Up to 5 file ids Assist reads and may quote from. The person asked can't see or open them.","maxItems":5,"type":"array","items":{"type":"string","minLength":1,"maxLength":128}},"summarizeQuestions":{"description":"`true` adds a summary of what people asked Assist to the managers' Private notes. It uses AI credits. Off when omitted.","type":"boolean"},"privateNotesGuidance":{"description":"What to include in the Private notes summary of people's questions. Used only when `summarizeQuestions` is `true`. Assist never reads it in chat. Up to 2,000 characters.","type":"string","maxLength":2000},"disclaimer":{"description":"The note shown under the Assist chat box. Assist never reads it. Leave it out to show the default note. Up to 300 characters.","type":"string","maxLength":300}},"required":["enabled"]},"closeAtDue":{"$ref":"#/components/schemas/StepSetting_closeAtDue"},"applyRetentionPolicy":{"type":"boolean","description":"Whether the organization's file deletion policy applies to the files uploaded here, when it covers only the steps that ask for it."},"retentionSelection":{"oneOf":[{"type":"object","properties":{"mode":{"type":"string","const":"inherit","description":"Set to `inherit`."}},"required":["mode"]},{"type":"object","properties":{"mode":{"type":"string","const":"keep","description":"Set to `keep`."}},"required":["mode"]},{"type":"object","properties":{"mode":{"type":"string","const":"rule","description":"Set to `rule`."},"ruleId":{"type":"string","minLength":1,"description":"The retention rule. Required when the choice is a named rule."}},"required":["mode","ruleId"]}],"description":"The retention choice for new uploads: the organization policy, an exemption, or a named rule. A named rule must include its rule."}},"required":["assignees"],"title":"File Request settings","description":"The settings a `FILE_REQUEST` step is sent with, beside the shared ones in `StepSettings`. This is the schema `POST /v1/templates` and `POST /v1/templates/{id}/changes` check a step against: a setting not listed here is refused with `UNKNOWN_SETTING`.\n\nSome settings depend on your organization's plan. One your plan doesn't include is refused with `UNKNOWN_SETTING`.\n\n**Checked when you publish.** A save keeps a step that isn't finished; `POST /v1/templates/{id}/check` and publish name what is still missing:\n- Pattern rename needs a naming pattern. Type the name you want, or insert data from earlier steps.\n\nA template read (`GET /v1/templates/{id}`) returns the step's settings as stored, in `StepConfig_FILE_REQUEST`.","x-moxo-step-type":"FILE_REQUEST"},"StepSettings_TODO":{"type":"object","properties":{"options":{"description":"Switches for the files attached to this step. A type takes only the ones its step settings show.","type":"object","properties":{"preventDownload":{"description":"Prevent download: people can open the files attached to this step to read them, but can't download them. Needs view-only attachments switched on for your organization.","type":"boolean"}}},"visibleToAllAssignees":{"description":"The older form of `visibility.mode: \"ALL\"`. Use `visibility` instead.","type":"boolean"},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"},"preparers":{"$ref":"#/components/schemas/StepSetting_preparers"},"advisors":{"$ref":"#/components/schemas/StepSetting_advisors_2"},"attachments":{"description":"Reference material shown on the step: files, web links or both. A web link (`{ kind: \"link\", url }`) is a page the assignee should open. Its `url` can be a fixed `https://` address or a reference to a value from earlier in the flow, such as `${{ steps.look_up_portal_link.fields.latest_url }}`, so a running flow always links to the latest address.","type":"array","items":{"anyOf":[{"type":"object","properties":{"ref":{"type":"string","description":"A file from an earlier step, as a reference such as `${{ steps.upload_contract.fields.uploaded_files }}`, or an uploaded file's id."}},"required":["ref"]},{"type":"object","properties":{"kind":{"type":"string","const":"link","description":"Set to `link`."},"url":{"type":"string","minLength":1,"maxLength":2048,"description":"An absolute `http` or `https` address, or a reference to a value from earlier in the flow, filled in when the step runs."},"title":{"description":"A short label for the link. Defaults to the address.","type":"string","maxLength":200},"description":{"description":"Optional text shown on hover, cut to about 140 characters.","type":"string","maxLength":1000}},"required":["kind","url"]},{"type":"object","properties":{"kind":{"type":"string","const":"file","description":"Set to `file`."},"ref":{"type":"string","description":"A file: an uploaded file's id, or a reference to a file from an earlier step."},"name":{"type":"string","minLength":1,"maxLength":255,"description":"The file's name as shown on the step."}},"required":["kind","ref"]}]}}},"required":["assignees"],"title":"To-Do settings","description":"The settings a `TODO` step is sent with, beside the shared ones in `StepSettings`. This is the schema `POST /v1/templates` and `POST /v1/templates/{id}/changes` check a step against: a setting not listed here is refused with `UNKNOWN_SETTING`.\n\nSome settings depend on your organization's plan. One your plan doesn't include is refused with `UNKNOWN_SETTING`.\n\nA template read (`GET /v1/templates/{id}`) returns the step's settings as stored, in `StepConfig_TODO`.","x-moxo-step-type":"TODO"},"StepSettings_CHECKLIST":{"type":"object","properties":{"visibleToAllAssignees":{"description":"The older form of `visibility.mode: \"ALL\"`. Use `visibility` instead.","type":"boolean"},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"},"preparers":{"$ref":"#/components/schemas/StepSetting_preparers"},"checklist":{"type":"object","properties":{"itemAssignment":{"description":"With `per-role`, each item belongs to one role, or to anyone on the step, and each person submits their own part. Use it with `completion` set to `ALL`, so the step waits for every role.","type":"string","enum":["per-role"]},"hideOtherRoleItems":{"description":"With `true`, when `itemAssignment` is `per-role`, each person sees only their own items and the items anyone can do. Left out or `false`, everyone sees the whole list, with other roles' items read-only.","type":"boolean"},"items":{"minItems":1,"maxItems":500,"type":"array","items":{"type":"object","properties":{"itemId":{"type":"string","description":"The item's id. Keep it when you change an item; leave it out on a new one. Completing the step names items by this id."},"label":{"type":"string","description":"The item as people see it."},"description":{"type":"string","description":"More detail on the item. Optional."},"assignedRoleHandle":{"description":"With `itemAssignment` `per-role`: the role this item belongs to, by its name, its id, or the `handle` of a role added earlier in the same list.","type":"string"},"shared":{"description":"With `itemAssignment` `per-role`: anyone on the step can do this item. Each item has either `assignedRoleHandle` or `shared`.","type":"boolean","const":true},"linkedStepId":{"description":"The id of an earlier action this item follows. The item is done when that action is done, and not needed when that action is skipped or not on the path taken. The item keeps its own label. Leave it out for an item someone marks.","type":"string"},"assignedRoleId":{"anyOf":[{"type":"string"},{"type":"string"}],"description":"The `roleId` of the role that does this item."}},"required":["label"]},"description":"The items to complete, 1 to 500. Each has a label and an optional description."},"completionStatuses":{"default":["DONE","SKIPPED"],"description":"The item statuses that let the assignee complete the step. Defaults to `[\"DONE\", \"SKIPPED\"]`. Use `[\"DONE\"]` to forbid skipping, for example in a compliance review. It can't hold only `NOT_STARTED`, which would complete the step at once.","minItems":1,"type":"array","items":{"type":"string","enum":["NOT_STARTED","DONE","SKIPPED"]}}},"required":["items"],"description":"The items assignees work through, marking each one Done or Skipped."},"attachments":{"description":"Reference material shown on the step: files, web links or both. A web link (`{ kind: \"link\", url }`) is a page the assignee should open. Its `url` can be a fixed `https://` address or a reference to a value from earlier in the flow, such as `${{ steps.look_up_portal_link.fields.latest_url }}`, so a running flow always links to the latest address.","type":"array","items":{"anyOf":[{"type":"object","properties":{"ref":{"type":"string","description":"A file from an earlier step, as a reference such as `${{ steps.upload_contract.fields.uploaded_files }}`, or an uploaded file's id."}},"required":["ref"]},{"type":"object","properties":{"kind":{"type":"string","const":"link","description":"Set to `link`."},"url":{"type":"string","minLength":1,"maxLength":2048,"description":"An absolute `http` or `https` address, or a reference to a value from earlier in the flow, filled in when the step runs."},"title":{"description":"A short label for the link. Defaults to the address.","type":"string","maxLength":200},"description":{"description":"Optional text shown on hover, cut to about 140 characters.","type":"string","maxLength":1000}},"required":["kind","url"]}]}}},"required":["assignees","checklist"],"title":"Checklist settings","description":"The settings a `CHECKLIST` step is sent with, beside the shared ones in `StepSettings`. This is the schema `POST /v1/templates` and `POST /v1/templates/{id}/changes` check a step against: a setting not listed here is refused with `UNKNOWN_SETTING`.\n\nSome settings depend on your organization's plan. One your plan doesn't include is refused with `UNKNOWN_SETTING`.\n\n**Checked when you publish.** A save keeps a step that isn't finished; `POST /v1/templates/{id}/check` and publish name what is still missing:\n- Checklist must have at least one item.\n- Enter a label for every checklist item.\n\nA template read (`GET /v1/templates/{id}`) returns the step's settings as stored, in `StepConfig_CHECKLIST`.\n\n**Coming soon:** can't be added to a template.","x-moxo-step-type":"CHECKLIST"},"StepSettings_APPROVAL":{"type":"object","properties":{"options":{"description":"Switches for the files attached to this step. A type takes only the ones its step settings show.","type":"object","properties":{"preventDownload":{"description":"Prevent download: people can open the files attached to this step to read them, but can't download them. Needs view-only attachments switched on for your organization.","type":"boolean"},"watermarkOnView":{"description":"Watermark: each person sees the PDFs attached to this step stamped with their name. Needs document watermarking switched on for your organization.","type":"boolean"}}},"visibleToAllAssignees":{"description":"The older form of `visibility.mode: \"ALL\"`. Use `visibility` instead.","type":"boolean"},"approval":{"description":"How the approvers act, and in what order. How many must approve is `completion.mode`.","type":"object","properties":{"assigneeOrder":{"description":"Whether the approvers act one after another (`SEQUENTIAL`) or at the same time (`PARALLEL`).","type":"string","enum":["SEQUENTIAL","PARALLEL"]}}},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"},"preparers":{"$ref":"#/components/schemas/StepSetting_preparers"},"advisors":{"$ref":"#/components/schemas/StepSetting_advisors"},"attachments":{"description":"Reference material shown on the step: files, web links or both. A web link (`{ kind: \"link\", url }`) is a page the assignee should open. Its `url` can be a fixed `https://` address or a reference to a value from earlier in the flow, such as `${{ steps.look_up_portal_link.fields.latest_url }}`, so a running flow always links to the latest address.","type":"array","items":{"anyOf":[{"type":"object","properties":{"ref":{"type":"string","description":"A file from an earlier step, as a reference such as `${{ steps.upload_contract.fields.uploaded_files }}`, or an uploaded file's id."}},"required":["ref"]},{"$ref":"#/components/schemas/StepSetting_attachmentsItem"},{"type":"object","properties":{"kind":{"type":"string","const":"file","description":"Set to `file`."},"ref":{"type":"string","description":"A file: an uploaded file's id, or a reference to a file from an earlier step."},"name":{"type":"string","minLength":1,"maxLength":255,"description":"The file's name as shown on the step."}},"required":["kind","ref"]}]}},"onReject":{"description":"What a decline does. `approver_decides` (the default): the approver sends the work back for changes. `revise_and_resubmit`: the work goes back to the steps this setting names. `rejection_steps`: the steps in `rejectBranch` run. `end_flow`: the flow ends. An approver can reject (decline with `action: \"reject\"`) only with `rejection_steps` or `end_flow`; otherwise a decline sends the work back.","type":"object","properties":{"action":{"type":"string","enum":["revise_and_resubmit","approver_decides","rejection_steps","end_flow"],"description":"What a decline does: `approver_decides` (the default), `revise_and_resubmit`, `rejection_steps` or `end_flow`."},"reopenStepIds":{"type":"array","items":{"type":"string"},"description":"With `revise_and_resubmit`: the steps the work goes back to, by id or the `handle` of a step added earlier in the same list."},"allowedStepIds":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"With `approver_decides`: the steps the approver may send the work back to, by id or the `handle` of a step added earlier in the same list. Leave it out, or `null`, for any earlier step."},"reworkStyle":{"type":"string","enum":["reopen_selected","rerun_from_step"],"description":"With `revise_and_resubmit`: `reopen_selected` (the default) reopens the steps in `reopenStepIds`; `rerun_from_step` goes back to `restartFromStepId` and runs every step after it again, automations included, before asking for approval again."},"restartFromStepId":{"type":"string","description":"With `reworkStyle` `rerun_from_step`: the earlier step the flow goes back to, by id or the `handle` of a step added earlier in the same list."}},"required":["action"]},"approveBranch":{"description":"The steps that run when the step is approved.","type":"object","properties":{"steps":{"maxItems":0,"type":"array","items":{"type":"object","properties":{},"additionalProperties":{}},"description":"Always `[]` here. Add the steps it holds with `add_step`, with `pathId` `\"approveBranch\"` or `\"rejectBranch\"` and `parentStepId` set to this step."}},"required":["steps"]},"rejectBranch":{"description":"The steps that run when the approval is rejected, with `onReject.action` `rejection_steps`.","type":"object","properties":{"steps":{"maxItems":0,"type":"array","items":{"type":"object","properties":{},"additionalProperties":{}},"description":"Always `[]` here. Add the steps it holds with `add_step`, with `pathId` `\"approveBranch\"` or `\"rejectBranch\"` and `parentStepId` set to this step."}},"required":["steps"]}},"required":["assignees"],"title":"Approval settings","description":"The settings a `APPROVAL` step is sent with, beside the shared ones in `StepSettings`. This is the schema `POST /v1/templates` and `POST /v1/templates/{id}/changes` check a step against: a setting not listed here is refused with `UNKNOWN_SETTING`.\n\nSome settings depend on your organization's plan. One your plan doesn't include is refused with `UNKNOWN_SETTING`.\n\nA template read (`GET /v1/templates/{id}`) returns the step's settings as stored, in `StepConfig_APPROVAL`.","x-moxo-step-type":"APPROVAL"},"StepSettings_ACKNOWLEDGEMENT":{"type":"object","properties":{"options":{"description":"Switches for the files attached to this step. A type takes only the ones its step settings show.","type":"object","properties":{"preventDownload":{"description":"Prevent download: people can open the files attached to this step to read them, but can't download them. Needs view-only attachments switched on for your organization.","type":"boolean"},"watermarkOnView":{"description":"Watermark: each person sees the PDFs attached to this step stamped with their name. Needs document watermarking switched on for your organization.","type":"boolean"},"requireAttachmentReview":{"description":"The person must open each attached file before they can acknowledge.","type":"boolean"},"buttonLabel":{"description":"The words on the acknowledge button, at most 60 characters. Leave it out and the button says I Acknowledge.","type":"string","maxLength":60}}},"visibleToAllAssignees":{"description":"The older form of `visibility.mode: \"ALL\"`. Use `visibility` instead.","type":"boolean"},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"},"preparers":{"$ref":"#/components/schemas/StepSetting_preparers"},"attachments":{"description":"Reference material shown on the step: files, web links or both. A web link (`{ kind: \"link\", url }`) is a page the assignee should open. Its `url` can be a fixed `https://` address or a reference to a value from earlier in the flow, such as `${{ steps.look_up_portal_link.fields.latest_url }}`, so a running flow always links to the latest address.","type":"array","items":{"anyOf":[{"type":"object","properties":{"ref":{"type":"string","description":"A file from an earlier step, as a reference such as `${{ steps.upload_contract.fields.uploaded_files }}`, or an uploaded file's id."}},"required":["ref"]},{"type":"object","properties":{"kind":{"type":"string","const":"link","description":"Set to `link`."},"url":{"type":"string","minLength":1,"maxLength":2048,"description":"An absolute `http` or `https` address, or a reference to a value from earlier in the flow, filled in when the step runs."},"title":{"description":"A short label for the link. Defaults to the address.","type":"string","maxLength":200},"description":{"description":"Optional text shown on hover, cut to about 140 characters.","type":"string","maxLength":1000}},"required":["kind","url"]},{"type":"object","properties":{"kind":{"type":"string","const":"file","description":"Set to `file`."},"ref":{"type":"string","description":"A file: an uploaded file's id, or a reference to a file from an earlier step."},"name":{"type":"string","minLength":1,"maxLength":255,"description":"The file's name as shown on the step."}},"required":["kind","ref"]}]}}},"required":["assignees"],"title":"Acknowledgement settings","description":"The settings a `ACKNOWLEDGEMENT` step is sent with, beside the shared ones in `StepSettings`. This is the schema `POST /v1/templates` and `POST /v1/templates/{id}/changes` check a step against: a setting not listed here is refused with `UNKNOWN_SETTING`.\n\nSome settings depend on your organization's plan. One your plan doesn't include is refused with `UNKNOWN_SETTING`.\n\nA template read (`GET /v1/templates/{id}`) returns the step's settings as stored, in `StepConfig_ACKNOWLEDGEMENT`.","x-moxo-step-type":"ACKNOWLEDGEMENT"},"StepSettings_WATCH_VIDEO":{"type":"object","properties":{"visibleToAllAssignees":{"description":"The older form of `visibility.mode: \"ALL\"`. Use `visibility` instead.","type":"boolean"},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"},"video":{"type":"object","properties":{"requireFullWatch":{"type":"boolean","description":"true (the default when left out): the action cannot be completed, skipped or force-completed until each person has watched the video to the end, with no skipping ahead. false: progress is still recorded but does not hold the action."},"confirmText":{"type":"string","maxLength":200,"description":"A sentence each person ticks after watching, at most 200 characters. Left out: no confirmation is asked."},"allowDownload":{"type":"boolean","description":"true lets people download the video. Left out or false: the video can only be played."},"file":{"description":"The video to watch: a `video/mp4` or `video/webm` file uploaded to this step, up to 250 MB. Required before the template can be published.","type":"object","properties":{"fileId":{"type":"string","minLength":1,"description":"Id of a file uploaded to this step."},"name":{"description":"The file name to show, as uploaded.","type":"string","maxLength":500}},"required":["fileId"]},"poster":{"description":"A still image shown before the video plays, uploaded to this step.","type":"object","properties":{"fileId":{"type":"string","minLength":1,"description":"Id of a file uploaded to this step."},"name":{"description":"The file name to show, as uploaded.","type":"string","maxLength":500}},"required":["fileId"]},"captions":{"description":"Captions for the video: a WebVTT file uploaded to this step.","type":"object","properties":{"fileId":{"type":"string","minLength":1,"description":"Id of a file uploaded to this step."},"name":{"description":"The file name to show, as uploaded.","type":"string","maxLength":500}},"required":["fileId"]},"durationSec":{"description":"The video's length in seconds. Watched means watched to within 2 seconds of this.","type":"number","exclusiveMinimum":0,"maximum":86400}},"description":"The video, its poster and captions, and how watching it is required."}},"required":["assignees"],"title":"Watch video settings","description":"The settings a `WATCH_VIDEO` step is sent with, beside the shared ones in `StepSettings`. This is the schema `POST /v1/templates` and `POST /v1/templates/{id}/changes` check a step against: a setting not listed here is refused with `UNKNOWN_SETTING`.\n\nSome settings depend on your organization's plan. One your plan doesn't include is refused with `UNKNOWN_SETTING`.\n\n**Checked when you publish.** A save keeps a step that isn't finished; `POST /v1/templates/{id}/check` and publish name what is still missing:\n- Add a video before you publish.\n- Set how long the video is before you publish.\n- The video has to be longer than zero seconds.\n\nA template read (`GET /v1/templates/{id}`) returns the step's settings as stored, in `StepConfig_WATCH_VIDEO`.","x-moxo-step-type":"WATCH_VIDEO"},"StepSettings_PACKET":{"type":"object","properties":{"aiEscalation":{"$ref":"#/components/schemas/StepSetting_aiEscalation"},"visibleToAllAssignees":{"description":"The older form of `visibility.mode: \"ALL\"`. Use `visibility` instead.","type":"boolean"},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"},"preparers":{"$ref":"#/components/schemas/StepSetting_preparers"},"reviewers":{"$ref":"#/components/schemas/StepSetting_reviewers"},"attachments":{"description":"Reference material shown on the step: files, web links or both. A web link (`{ kind: \"link\", url }`) is a page the assignee should open. Its `url` can be a fixed `https://` address or a reference to a value from earlier in the flow, such as `${{ steps.look_up_portal_link.fields.latest_url }}`, so a running flow always links to the latest address.","type":"array","items":{"anyOf":[{"type":"object","properties":{"ref":{"type":"string","description":"A file from an earlier step, as a reference such as `${{ steps.upload_contract.fields.uploaded_files }}`, or an uploaded file's id."}},"required":["ref"]},{"type":"object","properties":{"kind":{"type":"string","const":"link","description":"Set to `link`."},"url":{"type":"string","minLength":1,"maxLength":2048,"description":"An absolute `http` or `https` address, or a reference to a value from earlier in the flow, filled in when the step runs."},"title":{"description":"A short label for the link. Defaults to the address.","type":"string","maxLength":200},"description":{"description":"Optional text shown on hover, cut to about 140 characters.","type":"string","maxLength":1000}},"required":["kind","url"]},{"type":"object","properties":{"kind":{"type":"string","const":"file","description":"Set to `file`."},"ref":{"type":"string","description":"A file: an uploaded file's id, or a reference to a file from an earlier step."},"name":{"type":"string","minLength":1,"maxLength":255,"description":"The file's name as shown on the step."}},"required":["kind","ref"]}]}},"asks":{"description":"The asks, each `{ handle, type, config }` with type `FORM`, `FILE_REQUEST`, `ACKNOWLEDGEMENT` or `ESIGN` and no assignees, preparers, reviewers or `assist` of its own (an AI reviewer is allowed; Assist is set on the packet). A one-question choice is a `FORM` with one single-select field.","type":"array","items":{"type":"object","properties":{},"additionalProperties":{}}},"packet":{"description":"The pages, their buttons and the outcomes. Left out: one page with a Submit button that finishes as Submitted.","type":"object","properties":{"pages":{"type":"array","items":{"type":"object","properties":{"pageId":{"description":"An existing page's `pageId`. Leave it out on a new page.","type":"string"},"handle":{"description":"A name a button can use for this new page in the same change.","type":"string"},"title":{"type":"string","maxLength":80,"description":"The page title the person sees."},"items":{"maxItems":30,"type":"array","items":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"ask","description":"One of the asks."},"askId":{"type":"string","minLength":1,"description":"The ask's `handle` in this change, or its `stepId` when it already exists."},"itemId":{"type":"string","minLength":1,"description":"The item's id on its page."}},"required":["kind","askId"]},{"type":"object","properties":{"kind":{"type":"string","const":"text","description":"Words on the page."},"text":{"type":"string","description":"Words on the page. May hold references to earlier answers, such as `${{ steps.company_details.fields.company_name }}`."},"itemId":{"type":"string","minLength":1,"description":"The item's id on its page."}},"required":["kind","text"]}]},"description":"What the page holds, in order. Every ask sits on exactly one page."},"buttons":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string","maxLength":40,"description":"The words on the button, a few words (\"Continue\", \"Submit\")."},"primary":{"description":"Whether this is the page's one main button.","type":"boolean"},"goTo":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"next","description":"Goes to the next page shown."}},"required":["kind"]},{"type":"object","properties":{"kind":{"type":"string","const":"page","description":"Goes to a chosen page."},"pageId":{"type":"string","minLength":1,"description":"The page to go to: its `pageId`, or the `handle` or title of a page this change adds."}},"required":["kind","pageId"]},{"type":"object","properties":{"kind":{"type":"string","const":"finish","description":"Finishes the packet with an outcome."},"outcomeHandle":{"type":"string","minLength":1,"description":"The outcome to finish with: its `handle` in this change, its label, or its existing `outcomeId`."},"outcomeId":{"type":"string","minLength":1,"description":"The `outcomeId` of the outcome to finish with."}},"required":["kind","outcomeHandle"]}],"description":"Where the button goes: the next page, a chosen page, or finish with an outcome."},"buttonId":{"type":"string","minLength":1,"description":"The button's id on its page."}},"required":["label","goTo"]},"description":"The page's buttons: 1 to 4, one of them main. The last page has a button that finishes."},"back":{"description":"Whether the page shows a Back button. The first page shown never does. Default `true`.","type":"boolean"}},"required":["title","items","buttons"]},"description":"The pages, in the order they are shown."},"outcomes":{"maxItems":6,"type":"array","items":{"type":"object","properties":{"handle":{"description":"A name a finishing button can use for this outcome in the same change (`outcomeHandle`).","type":"string"},"label":{"type":"string","maxLength":40,"description":"The outcome's name, which is the packet's `outcome` output: \"Submitted\", or your own such as \"Withdrawn\"."},"needsAsks":{"type":"boolean","description":"`true`: finishing needs every required ask done (\"Submitted\"). `false`: an early end, and the asks left are skipped."},"outcomeId":{"type":"string","minLength":1,"description":"The outcome's id. A finishing button names it."}},"required":["label","needsAsks"]},"description":"How the packet can finish. At least one outcome needs the asks; an early-ending one (`needsAsks: false`) is optional."}},"required":["pages","outcomes"]},"assist":{"description":"Assist for the person doing the packet: one switch covers every ask. `{ \"enabled\": true }` lets them ask for help on each ask, and get help filling in a form ask. Leave it out, or send `{ \"enabled\": false }`, to keep it off. An ask never has its own.","type":"object","properties":{"enabled":{"type":"boolean","description":"Turns on Assignee Assist for this step. `true` opens a helper panel where the person working on the step can ask questions and, on a form, get help filling it in. `false`, or no `assist` object, leaves Assist off."},"agentId":{"type":"string","description":"The agent that helps. Leave it out for your organization's default."},"grantedPriorFields":{"maxItems":25,"type":"array","items":{"type":"string","minLength":1},"description":"Values from earlier steps that Assist may also read, each a reference to a flow value, such as `${{ steps.lookup.fields.portal_url }}`. Each is read in addition to what Assist reads by default."},"whatToKnow":{"description":"Facts and contacts Assist may share with the person asked, such as office hours or who to call. Up to 4,000 characters.","type":"string","maxLength":4000},"answerStyle":{"description":"How Assist answers: tone, length and what to avoid. Ignored when `agentId` picks an agent. Up to 2,000 characters.","type":"string","maxLength":2000},"faqFiles":{"description":"Up to 5 file ids Assist reads and may quote from. The person asked can't see or open them.","maxItems":5,"type":"array","items":{"type":"string","minLength":1,"maxLength":128}},"summarizeQuestions":{"description":"`true` adds a summary of what people asked Assist to the managers' Private notes. It uses AI credits. Off when omitted.","type":"boolean"},"privateNotesGuidance":{"description":"What to include in the Private notes summary of people's questions. Used only when `summarizeQuestions` is `true`. Assist never reads it in chat. Up to 2,000 characters.","type":"string","maxLength":2000},"disclaimer":{"description":"The note shown under the Assist chat box. Assist never reads it. Leave it out to show the default note. Up to 300 characters.","type":"string","maxLength":300}},"required":["enabled"]}},"required":["assignees","asks"],"title":"Packet settings","description":"The settings a `PACKET` step is sent with, beside the shared ones in `StepSettings`. This is the schema `POST /v1/templates` and `POST /v1/templates/{id}/changes` check a step against: a setting not listed here is refused with `UNKNOWN_SETTING`.\n\nSome settings depend on your organization's plan. One your plan doesn't include is refused with `UNKNOWN_SETTING`.\n\nA template read (`GET /v1/templates/{id}`) returns the step's settings as stored, in `StepConfig_PACKET`.","x-moxo-step-type":"PACKET"},"StepSettings_DOCUMENT_REVIEW":{"type":"object","properties":{"options":{"description":"Switches for the files attached to this step. A type takes only the ones its step settings show.","type":"object","properties":{"preventDownload":{"description":"Prevent download: people can open the files attached to this step to read them, but can't download them. Needs view-only attachments switched on for your organization.","type":"boolean"},"watermarkOnView":{"description":"Watermark: each person sees the PDFs attached to this step stamped with their name. Needs document watermarking switched on for your organization.","type":"boolean"}}},"visibleToAllAssignees":{"description":"The older form of `visibility.mode: \"ALL\"`. Use `visibility` instead.","type":"boolean"},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"},"preparers":{"$ref":"#/components/schemas/StepSetting_preparers"},"document":{"type":"object","properties":{"ref":{"type":"string","description":"The PDF: a file uploaded for this step, or a reference to an earlier step's file."}},"required":["ref"],"description":"The PDF the step uses."}},"required":["assignees"],"title":"Document Review settings","description":"The settings a `DOCUMENT_REVIEW` step is sent with, beside the shared ones in `StepSettings`. This is the schema `POST /v1/templates` and `POST /v1/templates/{id}/changes` check a step against: a setting not listed here is refused with `UNKNOWN_SETTING`.\n\nSome settings depend on your organization's plan. One your plan doesn't include is refused with `UNKNOWN_SETTING`.\n\n**Checked when you publish.** A save keeps a step that isn't finished; `POST /v1/templates/{id}/check` and publish name what is still missing:\n- Choose the document to review, or assign a person to upload it when the flow runs. An AI preparer can’t create the document.\n\nA template read (`GET /v1/templates/{id}`) returns the step's settings as stored, in `StepConfig_DOCUMENT_REVIEW`.","x-moxo-step-type":"DOCUMENT_REVIEW"},"StepSettings_DOCUMENT_COLLABORATION":{"type":"object","properties":{"options":{"description":"Switches for the files attached to this step. A type takes only the ones its step settings show.","type":"object","properties":{"watermarkOnView":{"description":"Watermark: each person sees the PDFs attached to this step stamped with their name. Needs document watermarking switched on for your organization.","type":"boolean"}}},"visibleToAllAssignees":{"description":"The older form of `visibility.mode: \"ALL\"`. Use `visibility` instead.","type":"boolean"},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"},"preparers":{"$ref":"#/components/schemas/StepSetting_preparers"},"collaboration":{"description":"How people work on the documents. Required when you add the step. When you change an existing step, send only the keys you change. A `sides` or `documents` list you send replaces the whole list, so list every side (keeping each id) and every document (with its starting text).","oneOf":[{"type":"object","properties":{"mode":{"type":"string","const":"take_turns","description":"`take_turns`: the sides pass the documents back and forth until every side approves the same version."},"documents":{"minItems":1,"maxItems":10,"type":"array","items":{"$ref":"#/components/schemas/StepSettings_DOCUMENT_COLLABORATION_documentsItem"},"description":"The documents, agreed together as one package. 1 to 10."},"sides":{"minItems":2,"maxItems":6,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,39}$","description":"A short id for the side, unique in the step (for example `firm` or `client`)."},"name":{"type":"string","minLength":1,"maxLength":60,"description":"The side's name as people see it, for example `Our team` or `Client`. Up to 60 characters."},"roleIds":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"string","minLength":1},"description":"The roles on this side (role handles or names from the template's roles), 1 to 10. A role is on exactly one side, and the step's `assignees` lists exactly the roles of every side, in side order."},"readyToSend":{"description":"Who can act for the side. Leave out for `ANY_ONE`: anyone on the side can send or approve for it. `ALL`: everyone on the side must approve before it goes back. `IN_ORDER`: the side's people go one after another.","type":"string","enum":["ANY_ONE","ALL","IN_ORDER"]}},"required":["id","name","roleIds"]},"description":"The sides that take turns, in turn order, starting with the side that drafts version 1. 2 to 6, usually two: your organization and the other party. With two sides, the second side takes the first turn, on version 1 sent by the first; with three or more, the first side goes first. Each side is a separate party, or a team taking its own pass in a relay; people on one team are never split into sides."},"firstPass":{"description":"How the first round runs. Leave out for `IN_ORDER`: each side takes one pass, in side order, before approvals open (a relay such as legal, then finance, then the client). `OPEN`: any side may send first.","type":"string","enum":["IN_ORDER","OPEN"]},"firstTurnSideId":{"description":"The id of the side that goes first. Leave out for the default: the second side when there are two, otherwise the first. With two sides, list the side that drafts version 1 first: when the second side goes first, version 1 counts as sent by the first side; when the first side goes first, version 1 counts as sent by nobody. To have the first side approve version 1 before the other side sees it, use the step's preparation instead.","type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,39}$"},"versionOneFromSideId":{"description":"The id of the side version 1 counts as sent by (that side has approved it). Leave out with two sides taking turns in order: it follows from who goes first. With three or more sides, or an `OPEN` first round, set it only when that side drafted version 1. Must differ from the side that goes first.","type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,39}$"},"turnDueHours":{"description":"Hours each side has for its turn, 1 to 1440, for example `72` for three days. Leave out for no time limit per turn.","type":"integer","minimum":1,"maximum":1440},"acceptEmailReplies":{"description":"Whether people can reply to the turn email with their edited document instead of uploading it in Moxo. Defaults to off.","type":"boolean"},"insertFrom":{"$ref":"#/components/schemas/StepSettings_DOCUMENT_COLLABORATION_insertFrom"},"completion":{"anyOf":[{"type":"string","enum":["ONE","MAJORITY","ALL","SEQUENTIAL"]},{"type":"string","enum":["ONE","MAJORITY","ALL"]}],"description":"When the collaboration is done."},"sections":{"$ref":"#/components/schemas/StepSettings_DOCUMENT_COLLABORATION_sections"}},"required":["mode","documents","sides"]},{"type":"object","properties":{"mode":{"type":"string","const":"edit_together","description":"`edit_together`: the step's assignees write the Moxo documents together, live, then approve the same text."},"documents":{"minItems":1,"maxItems":10,"type":"array","items":{"$ref":"#/components/schemas/StepSettings_DOCUMENT_COLLABORATION_documentsItem"},"description":"The Moxo documents, each with `moxo`. 1 to 10. Files can't be edited together."},"completion":{"description":"When the step is done. Leave out for `ALL`: everyone approves the same text. `ONE`: anyone. `MAJORITY`: more than half.","type":"string","enum":["ONE","MAJORITY","ALL","SEQUENTIAL"]},"sections":{"description":"The sections, when each person or team writes their own part, such as each department writing its section.","type":"object","properties":{"editorRoleIds":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"string","minLength":1},"description":"Roles that can edit every section and ask for approval when the sections are done. 1 to 10."},"items":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"object","properties":{"sectionId":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,39}$","description":"The section id of a heading in the first document's starting text (`## Pricing {#pricing}` has the id `pricing`)."},"ownerRoleId":{"type":"string","minLength":1,"description":"The role that writes this section; one of the step's assignees."},"dueAfterDays":{"description":"When the section is due, in days after the step starts.","type":"integer","minimum":1,"maximum":90}},"required":["sectionId","ownerRoleId"]},"description":"The sections, each `{ sectionId, ownerRoleId, dueAfterDays }`: a heading of the document, the role that writes it, and how many days after the step starts it is due."},"hideOtherSections":{"description":"When `true`, people read only the start and their own sections until the editor asks for approval.","type":"boolean"}},"required":["editorRoleIds","items"]},"sides":{"type":"array","items":{"$ref":"#/components/schemas/StepSettings_DOCUMENT_COLLABORATION_sidesItem"},"description":"The sides that take turns, in turn order, starting with the side that drafts version 1. 2 to 6, usually two: your organization and the other party. With two sides, the second side takes the first turn, on version 1 sent by the first; with three or more, the first side goes first. Each side is a separate party, or a team taking its own pass in a relay; people on one team are never split into sides."},"firstPass":{"anyOf":[{"type":"string","enum":["IN_ORDER","OPEN"]},{"type":"string","enum":["IN_ORDER","OPEN"]}],"description":"How the first round runs. Leave out for `IN_ORDER`: each side takes one pass, in side order, before approvals open (a relay such as legal, then finance, then the client). `OPEN`: any side may send first."},"firstTurnSideId":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,39}$","description":"The id of the side that goes first. Leave out for the default: the second side when there are two, otherwise the first. With two sides, list the side that drafts version 1 first: when the second side goes first, version 1 counts as sent by the first side; when the first side goes first, version 1 counts as sent by nobody. To have the first side approve version 1 before the other side sees it, use the step's preparation instead."},"versionOneFromSideId":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,39}$","description":"The id of the side version 1 counts as sent by (that side has approved it). Leave out with two sides taking turns in order: it follows from who goes first. With three or more sides, or an `OPEN` first round, set it only when that side drafted version 1. Must differ from the side that goes first."},"turnDueHours":{"anyOf":[{"type":"integer","minimum":1,"maximum":1440},{"type":"integer","minimum":1,"maximum":1440}],"description":"Hours each side has for its turn, 1 to 1440, for example `72` for three days. Leave out for no time limit per turn."},"acceptEmailReplies":{"anyOf":[{"type":"boolean"},{"type":"boolean"}],"description":"Whether people can reply to the turn email with their edited document instead of uploading it in Moxo. Defaults to off."},"insertFrom":{"$ref":"#/components/schemas/StepSettings_DOCUMENT_COLLABORATION_insertFrom"}},"required":["mode","documents"]},{"type":"object","properties":{"mode":{"type":"string","const":"comment_only","description":"`comment_only`: the step's assignees review the documents and comment on them; nobody edits. Each marks them reviewed, and the step ends with a reviewed copy carrying every comment."},"documents":{"minItems":1,"maxItems":10,"type":"array","items":{"$ref":"#/components/schemas/StepSettings_DOCUMENT_COLLABORATION_documentsItem"},"description":"The documents to review, 1 to 10: files of any accepted kind (Word, PDF, images, PowerPoint, Excel) or Moxo documents."},"completion":{"description":"When the step is done. Leave out for `ALL`: everyone reviews. `ONE`: anyone. `MAJORITY`: more than half. `SEQUENTIAL`: one at a time, in the order of the step's assignees, such as the client first, then Legal.","type":"string","enum":["ONE","MAJORITY","ALL","SEQUENTIAL"]},"sides":{"type":"array","items":{"$ref":"#/components/schemas/StepSettings_DOCUMENT_COLLABORATION_sidesItem"},"description":"The sides that take turns, in turn order, starting with the side that drafts version 1. 2 to 6, usually two: your organization and the other party. With two sides, the second side takes the first turn, on version 1 sent by the first; with three or more, the first side goes first. Each side is a separate party, or a team taking its own pass in a relay; people on one team are never split into sides."},"firstPass":{"anyOf":[{"type":"string","enum":["IN_ORDER","OPEN"]},{"type":"string","enum":["IN_ORDER","OPEN"]}],"description":"How the first round runs. Leave out for `IN_ORDER`: each side takes one pass, in side order, before approvals open (a relay such as legal, then finance, then the client). `OPEN`: any side may send first."},"firstTurnSideId":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,39}$","description":"The id of the side that goes first. Leave out for the default: the second side when there are two, otherwise the first. With two sides, list the side that drafts version 1 first: when the second side goes first, version 1 counts as sent by the first side; when the first side goes first, version 1 counts as sent by nobody. To have the first side approve version 1 before the other side sees it, use the step's preparation instead."},"versionOneFromSideId":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,39}$","description":"The id of the side version 1 counts as sent by (that side has approved it). Leave out with two sides taking turns in order: it follows from who goes first. With three or more sides, or an `OPEN` first round, set it only when that side drafted version 1. Must differ from the side that goes first."},"turnDueHours":{"anyOf":[{"type":"integer","minimum":1,"maximum":1440},{"type":"integer","minimum":1,"maximum":1440}],"description":"Hours each side has for its turn, 1 to 1440, for example `72` for three days. Leave out for no time limit per turn."},"acceptEmailReplies":{"anyOf":[{"type":"boolean"},{"type":"boolean"}],"description":"Whether people can reply to the turn email with their edited document instead of uploading it in Moxo. Defaults to off."},"insertFrom":{"$ref":"#/components/schemas/StepSettings_DOCUMENT_COLLABORATION_insertFrom"},"sections":{"$ref":"#/components/schemas/StepSettings_DOCUMENT_COLLABORATION_sections"}},"required":["mode","documents"]}]},"assist":{"type":"object","properties":{"enabled":{"type":"boolean","description":"Turns on Assignee Assist for this step. `true` opens a helper panel where the person working on the step can ask questions and, on a form, get help filling it in. `false`, or no `assist` object, leaves Assist off."},"agentId":{"type":"string","description":"The agent that helps. Leave it out for your organization's default."},"grantedPriorFields":{"maxItems":25,"type":"array","items":{"type":"string","minLength":1},"description":"Values from earlier steps that Assist may also read, each a reference to a flow value, such as `${{ steps.lookup.fields.portal_url }}`. Each is read in addition to what Assist reads by default."},"whatToKnow":{"description":"Facts and contacts Assist may share with the person asked, such as office hours or who to call. Up to 4,000 characters.","type":"string","maxLength":4000},"answerStyle":{"description":"How Assist answers: tone, length and what to avoid. Ignored when `agentId` picks an agent. Up to 2,000 characters.","type":"string","maxLength":2000},"faqFiles":{"description":"Up to 5 file ids Assist reads and may quote from. The person asked can't see or open them.","maxItems":5,"type":"array","items":{"type":"string","minLength":1,"maxLength":128}},"summarizeQuestions":{"description":"`true` adds a summary of what people asked Assist to the managers' Private notes. It uses AI credits. Off when omitted.","type":"boolean"},"privateNotesGuidance":{"description":"What to include in the Private notes summary of people's questions. Used only when `summarizeQuestions` is `true`. Assist never reads it in chat. Up to 2,000 characters.","type":"string","maxLength":2000},"disclaimer":{"description":"The note shown under the Assist chat box. Assist never reads it. Leave it out to show the default note. Up to 300 characters.","type":"string","maxLength":300}},"required":["enabled"],"description":"Assist on this collaboration: whether the people working on it can ask the AI for help."}},"required":["assignees","collaboration"],"title":"Document Collaboration settings","description":"The settings a `DOCUMENT_COLLABORATION` step is sent with, beside the shared ones in `StepSettings`. This is the schema `POST /v1/templates` and `POST /v1/templates/{id}/changes` check a step against: a setting not listed here is refused with `UNKNOWN_SETTING`.\n\nSome settings depend on your organization's plan. One your plan doesn't include is refused with `UNKNOWN_SETTING`.\n\nA template read (`GET /v1/templates/{id}`) returns the step's settings as stored, in `StepConfig_DOCUMENT_COLLABORATION`.","x-moxo-step-type":"DOCUMENT_COLLABORATION"},"StepSettings_PREPARE_DOCUMENT_BY_PERSON":{"type":"object","properties":{"aiEscalation":{"$ref":"#/components/schemas/StepSetting_aiEscalation"},"visibleToAllAssignees":{"description":"The older form of `visibility.mode: \"ALL\"`. Use `visibility` instead.","type":"boolean"},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"},"preparers":{"$ref":"#/components/schemas/StepSetting_preparers"},"reviewers":{"$ref":"#/components/schemas/StepSetting_reviewers"},"advisors":{"$ref":"#/components/schemas/StepSetting_advisors_2"},"prepareDocument":{"description":"The prepare-document settings: the Word template filled with values from the flow when the step starts, which the assignee edits and submits. Its outputs are the prepared document as a PDF and as a Word file.","type":"object","properties":{"wordTemplate":{"description":"The Word template (.docx) the assignee edits once it is filled. Set when the Word file is uploaded to the step; leave it out when you create the step.","type":"object","properties":{"ref":{"description":"The `fileId` of the Word file (.docx) uploaded to the step. Set when the file is uploaded.","type":"string"},"fileName":{"description":"The Word file's name, as it was uploaded.","type":"string"},"fill":{"type":"object","properties":{"slots":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"},"description":"Each `{{placeholder}}` in the Word file, by name, with the reference to the value that fills it, for example `${{ steps.intake_form.fields.client_name }}`. An empty string leaves it unfilled."}},"required":["slots"],"description":"How the file's placeholders are filled: `slots` maps each `{{placeholder}}` name to the reference that fills it, or `\"\"` for one nobody maps."}},"required":["fill"]},"fileName":{"description":"The name of the generated files, without extension, for example `Area Development Agreement`.","type":"string"}}}},"required":["assignees"],"title":"Prepare document settings","description":"The settings a `PREPARE_DOCUMENT_BY_PERSON` step is sent with, beside the shared ones in `StepSettings`. This is the schema `POST /v1/templates` and `POST /v1/templates/{id}/changes` check a step against: a setting not listed here is refused with `UNKNOWN_SETTING`.\n\nSome settings depend on your organization's plan. One your plan doesn't include is refused with `UNKNOWN_SETTING`.\n\nA template read (`GET /v1/templates/{id}`) returns the step's settings as stored, in `StepConfig_PREPARE_DOCUMENT_BY_PERSON`.","x-moxo-step-type":"PREPARE_DOCUMENT_BY_PERSON"},"StepSettings_ESIGN":{"type":"object","properties":{"options":{"description":"Switches for the files attached to this step. A type takes only the ones its step settings show.","type":"object","properties":{"preventDownload":{"description":"Prevent download: people can open the files attached to this step to read them, but can't download them. Needs view-only attachments switched on for your organization.","type":"boolean"}}},"aiEscalation":{"$ref":"#/components/schemas/StepSetting_aiEscalation"},"visibleToAllAssignees":{"description":"The older form of `visibility.mode: \"ALL\"`. Use `visibility` instead.","type":"boolean"},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"},"preparers":{"$ref":"#/components/schemas/StepSetting_preparers"},"reviewers":{"$ref":"#/components/schemas/StepSetting_reviewers"},"esign":{"description":"The e-signature settings.","type":"object","properties":{"documentName":{"type":"string","description":"The document's name, shown to signers."},"documentDescription":{"type":"string","description":"A description of the document, shown to signers."},"signingOrder":{"type":"string","enum":["SEQUENTIAL","PARALLEL"],"description":"`SEQUENTIAL`: signers sign one after another, in the order of `signers`. `PARALLEL`: all at once."},"defaultFontSize":{"description":"The font size, in points from 8 to 36, for values typed into the document when a field doesn't set its own. Leave it empty to fit each value to its field.","type":"number","minimum":8,"maximum":36},"signers":{"description":"The signers' role names, in signing order, for example `[\"Client\", \"Account Manager\"]`.","type":"array","items":{"type":"string"}},"autoFolder":{"description":"The folder in the Files panel where the signed PDF and its certificate of completion are saved. A plain name is used as written. The name can include a value from earlier in the flow. An empty value is left out, and the text around it stays. If nothing is left, the file stays unfiled.","type":"string"},"autoDetectSignerRoleId":{"description":"The signer role given to the fields Moxo finds in the document. Cleared when the document is removed.","type":"string"},"requireSmsVerification":{"description":"When `true`, each signer enters a one-time code sent by text message to their phone number before they can sign. The check is recorded on the certificate of completion. Available when the organization's plan includes text messaging.","type":"boolean"},"sourceDocumentLocked":{"description":"When `true`, the person preparing the step can check the signers and signing fields but can't replace the PDF, so a later e-signature step that signs this step's signed document can have its fields placed in advance. Set it only when the step has an attached document and a person prepares it. It can't be changed after a flow starts.","type":"boolean"},"placeFieldsFromSampleLabels":{"description":"When `true`, each signing field follows the label it was placed beside if that label moves to another page. When omitted, the field stays on its page number.","type":"boolean"},"optionalSignerRoleIds":{"type":"array","items":{"type":"string"},"description":"The signer roles whose signature is optional, by id."},"provider":{"type":"string","description":"Who runs the signing. `NATIVE` is Moxo's own signing."},"appearance":{"type":"object","properties":{"mode":{"type":"string","enum":["inherit","custom"],"description":"`inherit` uses the document's own style; `custom` uses `font` and `colorHex`."},"font":{"type":"string","enum":["HELVETICA","TIMES","COURIER"],"description":"With `mode` `custom`: `HELVETICA`, `TIMES` or `COURIER`."},"colorHex":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$","description":"With `mode` `custom`: the ink color, such as `#1F3A5F`."}},"required":["mode"],"description":"The font and ink color of the text typed into the signed document."}}},"document":{"description":"The PDF to sign. Set `ref` to the `fileId` of the PDF uploaded to the step (`POST /v1/templates/{id}/steps/{stepId}/attachments/upload-init` with `slotKind: \"document\"`), or to a reference to an earlier step that produces a file. A stored file's address typed in is refused with `STORAGE_KEY_NOT_ACCEPTED`.","type":"object","properties":{"ref":{"anyOf":[{"type":"string","description":"The `fileId` of the PDF uploaded to the step, or a reference to an earlier step's file, such as `${{ steps.file_request.fields.uploaded_files }}`. Resolves to the PDF to sign when the step runs."},{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"literal","description":"Set to `literal`."},"expectedType":{"type":"string","description":"The type the value has, such as `TEXT`, `NUMBER`, `DATE`, `BOOLEAN` or `FILE`. An output read across a loop's rounds is a list, such as `LIST<TEXT>`."},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}],"description":"A fixed value. Its JSON type follows `expectedType`: a number for `NUMBER`, a boolean for `BOOLEAN` and text for everything else."}},"required":["kind","expectedType","value"]},{"$ref":"#/components/schemas/StepSetting_ref_2"},{"$ref":"#/components/schemas/StepSetting_ref_5"},{"type":"object","properties":{"kind":{"type":"string","const":"flow-input","description":"Set to `flow-input`."},"expectedType":{"type":"string","description":"The type the value has, such as `TEXT`, `NUMBER`, `DATE`, `BOOLEAN` or `FILE`. An output read across a loop's rounds is a list, such as `LIST<TEXT>`."},"inputId":{"type":"string","description":"The `key` of a flow field asked for when the flow starts, for example `client_name`. Not an id. Read from the start form's values."}},"required":["kind","expectedType","inputId"]},{"type":"object","properties":{"kind":{"type":"string","const":"custom-field","description":"Set to `custom-field`."},"expectedType":{"type":"string","description":"The type the value has, such as `TEXT`, `NUMBER`, `DATE`, `BOOLEAN` or `FILE`. An output read across a loop's rounds is a list, such as `LIST<TEXT>`."},"fieldId":{"type":"string","description":"For `custom-field`: the custom user field's id."}},"required":["kind","expectedType","fieldId"]},{"type":"object","properties":{"kind":{"type":"string","const":"organization","description":"Set to `organization`."},"expectedType":{"type":"string","const":"TEXT","description":"Set to `TEXT`."},"attribute":{"type":"string","enum":["name","id"],"description":"For `organization`: `name` or `id`. For `flow-metadata`: the flow's `duedate`, `startdate`, `name` or `id`."}},"required":["kind","expectedType","attribute"]},{"type":"object","properties":{"kind":{"type":"string","const":"flow-metadata","description":"Set to `flow-metadata`."},"expectedType":{"type":"string","description":"The type the value has, such as `TEXT`, `NUMBER`, `DATE`, `BOOLEAN` or `FILE`. An output read across a loop's rounds is a list, such as `LIST<TEXT>`."},"attribute":{"type":"string","enum":["duedate","startdate","name","id"],"description":"For `organization`: `name` or `id`. For `flow-metadata`: the flow's `duedate`, `startdate`, `name` or `id`."}},"required":["kind","expectedType","attribute"]},{"$ref":"#/components/schemas/StepSetting_ref_3"},{"$ref":"#/components/schemas/StepSetting_ref"}]}],"description":"The PDF: the `fileId` of the PDF uploaded to the step, or a structured reference to an earlier step's file."}},"required":["ref"]},"fields":{"description":"The fields found in the PDF, each with the `roleId` of the signer who fills it. Every field needs a `roleId`.","type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The field's id. Keep it when you change a field; leave it out on a new one."},"type":{"type":"string","enum":["signature","initials","stamp","date_signed","full_name","text","checkbox","dropdown","radio","multi_select"],"description":"The field's type: `signature`, `initials`, `stamp`, `date_signed`, `full_name`, `text`, `checkbox`, `dropdown`, `radio` or `multi_select`. A `stamp` box holds a picture of the signer's seal, chosen while signing. A signer whose only boxes are stamps signs with the stamp, and the certificate shows the method as Stamp."},"roleId":{"type":"string","description":"The signer who fills it: a role's name, its id, or the `handle` of a role added earlier in the same list."},"required":{"default":true,"type":"boolean","description":"Whether the signer must fill it. Defaults to `true`."},"page":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"The page the field is on, counting from 1."},"x":{"type":"number","minimum":0,"maximum":100,"description":"The field's left edge, as a percentage of the page width."},"y":{"type":"number","minimum":0,"maximum":100,"description":"The field's top edge, as a percentage of the page height."},"width":{"type":"number","minimum":0.1,"maximum":100,"description":"The field's width, as a percentage of the page width."},"height":{"type":"number","minimum":0.1,"maximum":100,"description":"The field's height, as a percentage of the page height."},"defaultValue":{"type":"string","description":"For a text or full-name field: the value it starts with, fixed or a reference to a flow value."},"placeholder":{"type":"string","description":"A hint shown in the empty field. It is never printed."},"label":{"type":"string","description":"The field's label, as signers see it."},"context":{"type":"string","maxLength":500,"description":"A note for the AI preparer only. Signers never see it."},"locked":{"type":"boolean","description":"For a text or full-name field: can't be changed once the signer fills it."},"forceCurrentDate":{"type":"boolean","description":"For a signing date: filled with today's date and locked."},"onlyFutureDates":{"type":"boolean","description":"For a signing date: accepts only future dates."},"maxLength":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"For a text or full-name field: the most characters accepted."},"options":{"type":"array","items":{"type":"string"},"description":"For a dropdown, radio or multi-select field: its options."},"checkboxGroup":{"type":"string","description":"For checkboxes: a group name. Checkboxes in one group act like radio buttons: checking one unchecks the others."},"format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"text","description":"Set to `text`."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"number","description":"Set to `number`."},"min":{"description":"The smallest number accepted, inclusive. Taken from the PDF's own range check on upload, or set in the field editor.","type":"number"},"max":{"description":"The largest number accepted, inclusive. Taken from the PDF's own range check on upload, or set in the field editor.","type":"number"},"customMessage":{"description":"The message shown when a number is out of range, instead of the standard one. Set in the field editor; an upload never fills it in.","type":"string","maxLength":500}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"phone","description":"Set to `phone`."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"email","description":"Set to `email`."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"zip","description":"Set to `zip`."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"ssn","description":"Set to `ssn`."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"date","description":"Set to `date`."},"defaultToCurrentDate":{"type":"boolean","description":"Starts the date at today."},"futureDatesOnly":{"type":"boolean","description":"Accepts only dates after today."},"pastDatesOnly":{"type":"boolean","description":"Accepts only dates before today."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"custom","description":"Set to `custom`."},"regex":{"type":"string","minLength":1,"maxLength":500,"description":"For a pattern format: the regular expression the value must match."}},"required":["type","regex"]}],"description":"The format a text field must have, such as a number, an email or a date."},"fontSize":{"type":"number","minimum":8,"maximum":36,"description":"The text size, in points, 8 to 36."},"fontColor":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$","description":"The text color, as a hex color such as `#1a2b3c`."},"pdfFieldName":{"type":"string","description":"The field's name in the PDF. Set by Moxo when the PDF is read; send back what Moxo returned, or leave it out."},"origin":{"type":"string","enum":["acroform","anchor","custom"],"description":"Whether the field is the PDF's own form field (`acroform`) or drawn on the page (`anchor`, `custom`). Required with `pdfFieldName`. Set by Moxo when the PDF is read; send back what Moxo returned, or leave it out."},"inferredFrom":{"type":"string","enum":["auto","manual"],"description":"Whether Moxo found the field (`auto`) or a person placed it (`manual`). Set by Moxo; leave it out."},"widgetPositions":{"type":"array","items":{"type":"object","properties":{"page":{"type":"number","description":"The page the box is on, counting from 1."},"x":{"type":"number","description":"The box's left edge, as a percentage of the page width."},"y":{"type":"number","description":"The box's top edge, as a percentage of the page height."},"width":{"type":"number","description":"The box's width, as a percentage of the page width."},"height":{"type":"number","description":"The box's height, as a percentage of the page height."},"optionValue":{"type":"string","description":"The option this box selects."}},"required":["page","x","y","width","height","optionValue"]},"description":"For a radio field: one box for each option. Set by Moxo when the PDF is read; send back what Moxo returned, or leave it out."},"readOnly":{"type":"boolean","description":"The signer can't change it: it shows its value."},"signatureLine":{"type":"boolean","description":"Whether a line is drawn under the signature."},"labelAnchor":{"type":"object","properties":{"text":{"type":"string","minLength":1,"maxLength":40,"description":"The printed label this field follows, such as `By:`."},"nearby":{"description":"The line of text above that label, when one is close enough to tell two copies apart.","type":"string","minLength":1,"maxLength":200},"occurrence":{"type":"integer","minimum":1,"maximum":20,"description":"Which copy of the label this field follows. The first copy is 1."},"occurrenceCount":{"type":"integer","minimum":1,"maximum":20,"description":"How many copies of that label, with the same line above, the sample had."},"dx":{"type":"number","minimum":-2000,"maximum":2000,"description":"How far the field sits to the right of the label, in points. A negative number sits to its left."},"dy":{"type":"number","minimum":-2000,"maximum":2000,"description":"How far the field sits below the label, in points. A negative number sits above it."}},"required":["text","occurrence","occurrenceCount","dx","dy"],"description":"Where this field sits relative to a printed label on the sample. Recorded when fields are placed from the sample's labels. Absent when the field stays on its page number."},"defaultValueSource":{"type":"string","enum":["builder","ddr","ai","person"],"description":"Where the field's starting value comes from."},"defaultValueFrom":{"type":"string","maxLength":300,"description":"The value the field starts with, as a reference to a flow value."},"fieldId":{"type":"string","description":"The field's id in the shared document-field form."},"kind":{"type":"string","description":"The field's kind in the shared document-field form, for example a signature or a date."}},"required":["id","type","roleId","page","x","y","width","height"]}},"attachments":{"description":"Reference material shown on the step: files, web links or both. A web link (`{ kind: \"link\", url }`) is a page the assignee should open. Its `url` can be a fixed `https://` address or a reference to a value from earlier in the flow, such as `${{ steps.look_up_portal_link.fields.latest_url }}`, so a running flow always links to the latest address.","type":"array","items":{"anyOf":[{"type":"object","properties":{"ref":{"type":"string","description":"A file from an earlier step, as a reference such as `${{ steps.upload_contract.fields.uploaded_files }}`, or an uploaded file's id."}},"required":["ref"]},{"$ref":"#/components/schemas/StepSetting_attachmentsItem"},{"type":"object","properties":{"kind":{"type":"string","const":"file","description":"Set to `file`."},"ref":{"type":"string","description":"A file: an uploaded file's id, or a reference to a file from an earlier step."},"name":{"type":"string","minLength":1,"maxLength":255,"description":"The file's name as shown on the step."}},"required":["kind","ref"]}]}},"assist":{"description":"Assignee Assist on this signing step. `{ enabled: true }` lets the signer ask for help. Leave it out, or send `{ enabled: false }`, to leave Assist off.","type":"object","properties":{"enabled":{"type":"boolean","description":"Turns on Assignee Assist for this step. `true` opens a helper panel where the person working on the step can ask questions and, on a form, get help filling it in. `false`, or no `assist` object, leaves Assist off."},"agentId":{"type":"string","description":"The agent that helps. Leave it out for your organization's default."},"grantedPriorFields":{"maxItems":25,"type":"array","items":{"type":"string","minLength":1},"description":"Values from earlier steps that Assist may also read, each a reference to a flow value, such as `${{ steps.lookup.fields.portal_url }}`. Each is read in addition to what Assist reads by default."},"whatToKnow":{"description":"Facts and contacts Assist may share with the person asked, such as office hours or who to call. Up to 4,000 characters.","type":"string","maxLength":4000},"answerStyle":{"description":"How Assist answers: tone, length and what to avoid. Ignored when `agentId` picks an agent. Up to 2,000 characters.","type":"string","maxLength":2000},"faqFiles":{"description":"Up to 5 file ids Assist reads and may quote from. The person asked can't see or open them.","maxItems":5,"type":"array","items":{"type":"string","minLength":1,"maxLength":128}},"summarizeQuestions":{"description":"`true` adds a summary of what people asked Assist to the managers' Private notes. It uses AI credits. Off when omitted.","type":"boolean"},"privateNotesGuidance":{"description":"What to include in the Private notes summary of people's questions. Used only when `summarizeQuestions` is `true`. Assist never reads it in chat. Up to 2,000 characters.","type":"string","maxLength":2000},"disclaimer":{"description":"The note shown under the Assist chat box. Assist never reads it. Leave it out to show the default note. Up to 300 characters.","type":"string","maxLength":300}},"required":["enabled"]}},"required":["assignees"],"title":"E-Signature settings","description":"The settings a `ESIGN` step is sent with, beside the shared ones in `StepSettings`. This is the schema `POST /v1/templates` and `POST /v1/templates/{id}/changes` check a step against: a setting not listed here is refused with `UNKNOWN_SETTING`.\n\nSome settings depend on your organization's plan. One your plan doesn't include is refused with `UNKNOWN_SETTING`.\n\n**Checked when you publish.** A save keeps a step that isn't finished; `POST /v1/templates/{id}/check` and publish name what is still missing:\n- Add the document to sign, or assign a person to upload it when the flow runs. An AI preparer can fill in fields but can’t create the document to sign.\n- This step signs a document created earlier in the flow, so there’s no file yet to place signature fields on. Turn on Prepare (under “Enhance this action”) and assign a preparer to position the fields when the flow runs.\n\nA template read (`GET /v1/templates/{id}`) returns the step's settings as stored, in `StepConfig_ESIGN`.","x-moxo-step-type":"ESIGN"},"StepSettings_DOCUSIGN":{"type":"object","properties":{"aiEscalation":{"$ref":"#/components/schemas/StepSetting_aiEscalation"},"visibleToAllAssignees":{"description":"The older form of `visibility.mode: \"ALL\"`. Use `visibility` instead.","type":"boolean"},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"},"reviewers":{"$ref":"#/components/schemas/StepSetting_reviewers"},"docusign":{"type":"object","properties":{"connectionId":{"type":"string","description":"The id of the DocuSign connection the step sends with. An organization admin sets it in the step's settings in Moxo."},"mode":{"description":"`template` (the default): send an existing DocuSign template. `document`: upload your own PDF, with its fields placed by anchor text. `multi_template`: send several DocuSign templates in one envelope, signed together.","type":"string","enum":["template","document","multi_template"]},"templateId":{"description":"The DocuSign template id. Required when `mode` is `template`.","type":"string"},"templateName":{"description":"The selected DocuSign template's name, for display only.","type":"string"},"document":{"description":"The PDF to send. Required when `mode` is `document`. Send exactly one of `ref` or `ddrRef`.","type":"object","properties":{"ref":{"description":"The key of a PDF uploaded while building the template, set when the upload finishes.","type":"string"},"ddrRef":{"description":"A file from an earlier step, as a reference such as `${{ steps.file_request.fields.uploaded_files }}`. Resolved in each flow when the step starts.","type":"string"}}},"roleMapping":{"type":"array","items":{"type":"object","properties":{"docusignRoleName":{"type":"string","description":"The DocuSign template role's name, such as `Buyer`. In `document` mode, use the Moxo role's name."},"moxoRoleId":{"type":"string","description":"The id of the Moxo template role that signs as this DocuSign role."},"anchors":{"description":"The fields this role's recipient signs, initials or dates, placed by anchor text. Required in `document` mode.","type":"array","items":{"type":"object","properties":{"anchorString":{"type":"string","minLength":1,"description":"The exact text DocuSign looks for in the PDF, matching capitals by default. Can't be empty: DocuSign refuses an envelope with an empty anchor."},"type":{"type":"string","enum":["signHereTabs","initialHereTabs","dateSignedTabs","fullNameTabs","textTabs","dateTabs","numberTabs"],"description":"The field type: `signHereTabs` (signature), `initialHereTabs` (initials), `dateSignedTabs` (date signed), `fullNameTabs` (full name), `textTabs` (text), `dateTabs` (date) or `numberTabs` (number)."},"xOffset":{"description":"Horizontal distance from the anchor text, in inches. Positive moves right.","type":"number"},"yOffset":{"description":"Vertical distance from the anchor text, in inches. Positive moves down.","type":"number"}},"required":["anchorString","type"]}}},"required":["docusignRoleName","moxoRoleId"]},"description":"In `template` mode, maps each DocuSign template role to a Moxo role. In `document` mode, each entry also has `anchors[]`, which say where DocuSign places the fields."},"emailSubject":{"description":"The envelope's email subject. Either text with references such as `${{ roles.customer.name }}`, or a list of parts, such as `[{ kind: \"text\", text: \"Sign your \" }, { kind: \"role\", roleName: \"Customer\", field: \"name\" }, { kind: \"text\", text: \" agreement\" }]`. The list form is checked: it can name only roles and fields the template has. Saved as text.","anyOf":[{"type":"string"},{"type":"array","items":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"text","description":"The part's type."},"text":{"type":"string","description":"Fixed text."}},"required":["kind","text"]},{"type":"object","properties":{"kind":{"type":"string","const":"input","description":"The part's type."},"key":{"type":"string","minLength":1,"description":"The key of a start field the template declares."}},"required":["kind","key"]},{"type":"object","properties":{"kind":{"type":"string","const":"role","description":"The part's type."},"roleName":{"type":"string","minLength":1,"description":"A role's name."},"field":{"type":"string","enum":["name","email","phone","title"],"description":"Which of the role's details: `name`, `email`, `phone` or `title`."}},"required":["kind","roleName","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"flow","description":"The part's type."},"field":{"type":"string","enum":["name","description","dueDate","startDate","dueTimestamp","startTimestamp","id"],"description":"Which detail of the flow: `name`, `description`, `dueDate`, `startDate`, `dueTimestamp`, `startTimestamp` or `id`."}},"required":["kind","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"organization","description":"The part's type."},"field":{"type":"string","enum":["name","id"],"description":"Which detail of the organization: `name` or `id`."}},"required":["kind","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"system","description":"The part's type."},"field":{"type":"string","const":"today","description":"Today's date, in the organization's time zone."}},"required":["kind","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"step","description":"The part's type."},"stepName":{"type":"string","minLength":1,"description":"The name of an earlier step."},"field":{"type":"string","minLength":1,"description":"The name of that step's output."}},"required":["kind","stepName","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"current_item","description":"The part's type."},"field":{"type":"string","minLength":1,"description":"A field of the current item, in a step that repeats for each item."}},"required":["kind","field"]}]}}]},"emailBody":{"description":"The envelope's email body. Either text with references to values from earlier in the flow, or a list of parts: `{ kind: \"text\", text }` and `{ kind: \"role\" | \"input\" | \"step\" | \"flow\" | \"organization\" | \"current_item\", ... }`. Saved as text.","anyOf":[{"type":"string"},{"type":"array","items":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"text","description":"The part's type."},"text":{"type":"string","description":"Fixed text."}},"required":["kind","text"]},{"type":"object","properties":{"kind":{"type":"string","const":"input","description":"The part's type."},"key":{"type":"string","minLength":1,"description":"The key of a start field the template declares."}},"required":["kind","key"]},{"type":"object","properties":{"kind":{"type":"string","const":"role","description":"The part's type."},"roleName":{"type":"string","minLength":1,"description":"A role's name."},"field":{"type":"string","enum":["name","email","phone","title"],"description":"Which of the role's details: `name`, `email`, `phone` or `title`."}},"required":["kind","roleName","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"flow","description":"The part's type."},"field":{"type":"string","enum":["name","description","dueDate","startDate","dueTimestamp","startTimestamp","id"],"description":"Which detail of the flow: `name`, `description`, `dueDate`, `startDate`, `dueTimestamp`, `startTimestamp` or `id`."}},"required":["kind","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"organization","description":"The part's type."},"field":{"type":"string","enum":["name","id"],"description":"Which detail of the organization: `name` or `id`."}},"required":["kind","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"system","description":"The part's type."},"field":{"type":"string","const":"today","description":"Today's date, in the organization's time zone."}},"required":["kind","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"step","description":"The part's type."},"stepName":{"type":"string","minLength":1,"description":"The name of an earlier step."},"field":{"type":"string","minLength":1,"description":"The name of that step's output."}},"required":["kind","stepName","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"current_item","description":"The part's type."},"field":{"type":"string","minLength":1,"description":"A field of the current item, in a step that repeats for each item."}},"required":["kind","field"]}]}}]},"ccRecipients":{"description":"People who get a copy of the envelope by email but don't sign.","type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"The copy recipient's name. Can include references to values from earlier in the flow."},"email":{"type":"string","description":"The copy recipient's email address. Can include references to values from earlier in the flow."}},"required":["name","email"]}},"multiTemplate":{"description":"With `mode` `multi_template`, when flow data names the templates to send. Leave it out to pick the templates in the step in Moxo.","type":"object","properties":{"templates":{"anyOf":[{"type":"object","properties":{"source":{"type":"string","const":"data","description":"`data`: flow data names the templates when the step runs."},"value":{"type":"string","minLength":1,"description":"A reference to the flow value that names the templates, such as `${{ steps.intake.fields.documents }}`."}},"required":["source","value"]},{"type":"object","properties":{"source":{"type":"string","const":"picked","description":"Set to `picked`."},"items":{"minItems":1,"maxItems":5,"type":"array","items":{"type":"object","properties":{"templateId":{"type":"string","minLength":1,"description":"The template's id in the DocuSign account. Check and publish make sure the account has it."},"templateName":{"type":"string","description":"The template's name, shown in Moxo. The run uses `templateId`."}},"required":["templateId"]},"description":"The DocuSign templates to send together, in envelope order, each picked from the account."}},"required":["source","items"]}],"description":"Which templates to send: `{ \"source\": \"data\", \"value\" }`."},"fillFields":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"tabLabel":{"type":"string","minLength":1,"description":"The label of the DocuSign field to fill."},"value":{"type":"string","description":"The value written into it. Can include flow values."}},"required":["tabLabel","value"]},"description":"Values written into the templates' fields, each by the field's label."}},"required":["templates"]},"fillFields":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"tabLabel":{"type":"string","minLength":1,"description":"The label of the DocuSign field to fill."},"value":{"type":"string","description":"The value written into it. Can include flow values."}},"required":["tabLabel","value"]},"description":"Values written into the template's fields, each by the field's label."},"optionalSignerRoleIds":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"string"}]},"description":"The signer roles that sign only if someone is assigned, by id. A role here with nobody assigned when the envelope is created is left off it."},"documentName":{"type":"string","description":"The name of the uploaded document, shown in the template builder."}},"required":["connectionId","roleMapping"],"description":"The DocuSign settings. `mode` is `template`, `document` or `multi_template` (several templates in one envelope)."},"approveBeforeRun":{"description":"Whether a person approves what this step is about to send before it creates the payment page, envelope or agreement. When `true`, the step waits when it starts until someone approves; nothing reaches the payment or signing provider before that, and the payer or signer sees that it is being prepared. Set who approves in the step's `reviewers`: a step with approval on and no approver can't be published.","type":"boolean"},"approvalRejectMode":{"description":"What a rejection does, with `approveBeforeRun`. `halt` (the default for this step) stops the flow and nothing is sent; `skip` skips this step and the flow continues.","type":"string","enum":["skip","halt"]}},"required":["docusign"],"title":"DocuSign settings","description":"The settings a `DOCUSIGN` step is sent with, beside the shared ones in `StepSettings`. This is the schema `POST /v1/templates` and `POST /v1/templates/{id}/changes` check a step against: a setting not listed here is refused with `UNKNOWN_SETTING`.\n\nSome settings depend on your organization's plan. One your plan doesn't include is refused with `UNKNOWN_SETTING`.\n\n**Checked when you publish.** A save keeps a step that isn't finished; `POST /v1/templates/{id}/check` and publish name what is still missing:\n- DocuSign step needs a connected DocuSign account.\n- DocuSign step needs at least one role mapped.\n- Choose the DocuSign templates this step sends.\n- Choose the flow data that names the DocuSign templates this step sends.\n- A DocuSign step sends at most 5 templates. Remove one.\n- A DocuSign step fills in at most 50 template fields. Remove one.\n- This step has template fields to fill in, but only From template fills them in. Remove the fields, or switch the step to From template.\n- Approve-before-it-runs is on but no approver is assigned. Pick who approves, or turn it off.\n\nA template read (`GET /v1/templates/{id}`) returns the step's settings as stored, in `StepConfig_DOCUSIGN`.","x-moxo-step-type":"DOCUSIGN"},"StepSettings_ADOBE_SIGN":{"type":"object","properties":{"aiEscalation":{"$ref":"#/components/schemas/StepSetting_aiEscalation"},"visibleToAllAssignees":{"description":"The older form of `visibility.mode: \"ALL\"`. Use `visibility` instead.","type":"boolean"},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"},"preparers":{"$ref":"#/components/schemas/StepSetting_preparers"},"reviewers":{"$ref":"#/components/schemas/StepSetting_reviewers"},"adobeSign":{"type":"object","properties":{"connectionId":{"default":"","description":"The id of the Adobe Acrobat Sign connection. An organization admin chooses it in the step editor. It may be left out while the step is being built; the step can't be published until it is chosen.","type":"string"},"mode":{"description":"What is sent. `template` sends a library document saved in Acrobat Sign. `document` sends an uploaded PDF, or a file from an earlier step, and places signing fields at marker text. Defaults to `template`.","type":"string","enum":["template","document"]},"libraryDocumentId":{"description":"The Acrobat Sign library document id (what Acrobat Sign calls a template). Required when `mode` is `template`. Set when an admin chooses the document in the step editor.","type":"string"},"libraryDocumentName":{"description":"The library document's name, for display only.","type":"string"},"document":{"description":"The PDF to send. Required when `mode` is `document`. Set exactly one of `ref` or `ddrRef`.","type":"object","properties":{"ref":{"description":"The `fileId` of a PDF uploaded to the step while editing the template.","type":"string"},"ddrRef":{"description":"A reference to a PDF file produced by an earlier step.","type":"string"}}},"documentName":{"description":"The uploaded PDF's name, for display only.","type":"string"},"signers":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string","description":"A display name for this signer, such as `Signer 1` or `Client`. Not sent to Adobe."},"moxoRoleId":{"type":"string","description":"The id of the template role that signs in this position."},"order":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The signing position, starting at 1 with no gaps. Signers with the same number sign at the same time; ascending numbers sign one after another."},"role":{"description":"The signer's Adobe participant role. Defaults to `SIGNER`; other roles approve or acknowledge instead of signing.","type":"string","enum":["SIGNER","APPROVER","ACCEPTOR","FORM_FILLER"]},"authenticationMethod":{"description":"An optional identity check Adobe runs in the signing session, such as `EMAIL_OTP`.","type":"string","enum":["NONE","EMAIL_OTP"]},"anchors":{"description":"Where this signer's fields go, with `mode` set to `document`. Optional: signature fields already in the PDF are used when they cover this signer. Needed when the step runs only if they don't.","type":"array","items":{"type":"object","properties":{"anchorText":{"type":"string","description":"Text in the PDF that marks where the field goes, such as `SIGN_HERE_1`. Leave it empty when the PDF already has signature fields for this signer, or when the file comes from an earlier step and isn't available yet."},"type":{"type":"string","enum":["SIGNATURE","INITIALS","DATE_SIGNED"],"description":"The field Adobe places at the marker."},"xOffset":{"description":"The horizontal offset from the marker, in points. Positive moves right.","type":"number"},"yOffset":{"description":"The vertical offset from the marker, in points. Positive moves down.","type":"number"}},"required":["anchorText","type"]}}},"required":["label","moxoRoleId","order"]},"description":"The signers, in order. Acrobat Sign matches signers by position. With a library document, the order matches each role to the document's field group. With a PDF, each signer also has `anchors` for the signing fields to place."},"agreementName":{"description":"The agreement's name, which recipients see as the email subject; Acrobat Sign has one name and message, not a subject and body. Accepts text with references such as `${{ roles.customer.name }}`, or a list of tokens (preferred).","anyOf":[{"type":"string"},{"type":"array","items":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"text","description":"The part's type."},"text":{"type":"string","description":"Fixed text."}},"required":["kind","text"]},{"type":"object","properties":{"kind":{"type":"string","const":"input","description":"The part's type."},"key":{"type":"string","minLength":1,"description":"The key of a start field the template declares."}},"required":["kind","key"]},{"type":"object","properties":{"kind":{"type":"string","const":"role","description":"The part's type."},"roleName":{"type":"string","minLength":1,"description":"A role's name."},"field":{"type":"string","enum":["name","email","phone","title"],"description":"Which of the role's details: `name`, `email`, `phone` or `title`."}},"required":["kind","roleName","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"flow","description":"The part's type."},"field":{"type":"string","enum":["name","description","dueDate","startDate","dueTimestamp","startTimestamp","id"],"description":"Which detail of the flow: `name`, `description`, `dueDate`, `startDate`, `dueTimestamp`, `startTimestamp` or `id`."}},"required":["kind","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"organization","description":"The part's type."},"field":{"type":"string","enum":["name","id"],"description":"Which detail of the organization: `name` or `id`."}},"required":["kind","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"system","description":"The part's type."},"field":{"type":"string","const":"today","description":"Today's date, in the organization's time zone."}},"required":["kind","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"step","description":"The part's type."},"stepName":{"type":"string","minLength":1,"description":"The name of an earlier step."},"field":{"type":"string","minLength":1,"description":"The name of that step's output."}},"required":["kind","stepName","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"current_item","description":"The part's type."},"field":{"type":"string","minLength":1,"description":"A field of the current item, in a step that repeats for each item."}},"required":["kind","field"]}]}}]},"message":{"description":"The message shown to participants with the agreement. Accepts text with references to values from earlier in the flow, or a list of tokens (preferred).","anyOf":[{"type":"string"},{"type":"array","items":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"text","description":"The part's type."},"text":{"type":"string","description":"Fixed text."}},"required":["kind","text"]},{"type":"object","properties":{"kind":{"type":"string","const":"input","description":"The part's type."},"key":{"type":"string","minLength":1,"description":"The key of a start field the template declares."}},"required":["kind","key"]},{"type":"object","properties":{"kind":{"type":"string","const":"role","description":"The part's type."},"roleName":{"type":"string","minLength":1,"description":"A role's name."},"field":{"type":"string","enum":["name","email","phone","title"],"description":"Which of the role's details: `name`, `email`, `phone` or `title`."}},"required":["kind","roleName","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"flow","description":"The part's type."},"field":{"type":"string","enum":["name","description","dueDate","startDate","dueTimestamp","startTimestamp","id"],"description":"Which detail of the flow: `name`, `description`, `dueDate`, `startDate`, `dueTimestamp`, `startTimestamp` or `id`."}},"required":["kind","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"organization","description":"The part's type."},"field":{"type":"string","enum":["name","id"],"description":"Which detail of the organization: `name` or `id`."}},"required":["kind","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"system","description":"The part's type."},"field":{"type":"string","const":"today","description":"Today's date, in the organization's time zone."}},"required":["kind","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"step","description":"The part's type."},"stepName":{"type":"string","minLength":1,"description":"The name of an earlier step."},"field":{"type":"string","minLength":1,"description":"The name of that step's output."}},"required":["kind","stepName","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"current_item","description":"The part's type."},"field":{"type":"string","minLength":1,"description":"A field of the current item, in a step that repeats for each item."}},"required":["kind","field"]}]}}]},"ccRecipients":{"description":"People who get a copy of the agreement by email but don't sign. Adobe takes an email address only, with no name. They get no email while `sendAdobeEmails` is false.","type":"array","items":{"type":"object","properties":{"email":{"type":"string","description":"The copy recipient's email address. Can include references to values from earlier in the flow."}},"required":["email"]}},"sendAdobeEmails":{"description":"Whether Adobe Acrobat Sign emails the signers. `false`, the default for a new step, means signers get only Moxo's email and sign inside their action. `true` keeps Adobe's own invitation, reminder and signed-copy emails. A step saved without it behaves as `true`.","type":"boolean"}},"required":["signers"],"description":"The Adobe Acrobat Sign settings: a library document or a PDF for this flow, with ordered signers matched to the template's roles. For a PDF, signing fields are placed at marker text in the document."},"approveBeforeRun":{"description":"Whether a person approves what this step is about to send before it creates the payment page, envelope or agreement. When `true`, the step waits when it starts until someone approves; nothing reaches the payment or signing provider before that, and the payer or signer sees that it is being prepared. Set who approves in the step's `reviewers`: a step with approval on and no approver can't be published.","type":"boolean"},"approvalRejectMode":{"description":"What a rejection does, with `approveBeforeRun`. `halt` (the default for this step) stops the flow and nothing is sent; `skip` skips this step and the flow continues.","type":"string","enum":["skip","halt"]}},"required":["adobeSign"],"title":"Adobe Acrobat Sign settings","description":"The settings a `ADOBE_SIGN` step is sent with, beside the shared ones in `StepSettings`. This is the schema `POST /v1/templates` and `POST /v1/templates/{id}/changes` check a step against: a setting not listed here is refused with `UNKNOWN_SETTING`.\n\nSome settings depend on your organization's plan. One your plan doesn't include is refused with `UNKNOWN_SETTING`.\n\n**Checked when you publish.** A save keeps a step that isn't finished; `POST /v1/templates/{id}/check` and publish name what is still missing:\n- Adobe Acrobat Sign step needs a connected Acrobat Sign account.\n- Adobe Acrobat Sign step needs at least one signer.\n- Approve-before-it-runs is on but no approver is assigned. Pick who approves, or turn it off.\n\nA template read (`GET /v1/templates/{id}`) returns the step's settings as stored, in `StepConfig_ADOBE_SIGN`.","x-moxo-step-type":"ADOBE_SIGN"},"StepSettings_JOTFORM":{"type":"object","properties":{"visibleToAllAssignees":{"description":"The older form of `visibility.mode: \"ALL\"`. Use `visibility` instead.","type":"boolean"},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"},"jotform":{"type":"object","properties":{"connectionId":{"type":"string","description":"The id of the Jotform connection. An organization admin chooses it in the step editor."},"formId":{"type":"string","description":"The id of the Jotform form the assignee fills. Chosen in the step editor."},"formTitle":{"description":"The form's title, for display only.","type":"string"},"openMode":{"description":"How the form opens. `inside_moxo` (the default) shows it in a window inside Moxo; `new_tab` opens it in a new browser tab.","type":"string","enum":["inside_moxo","new_tab"]}},"required":["connectionId","formId"],"description":"The Jotform settings: the form to fill and the connection that owns it. The person who fills it is the step's assignee. The step completes when Jotform reports the submission."}},"required":["jotform","assignees"],"title":"Jotform settings","description":"The settings a `JOTFORM` step is sent with, beside the shared ones in `StepSettings`. This is the schema `POST /v1/templates` and `POST /v1/templates/{id}/changes` check a step against: a setting not listed here is refused with `UNKNOWN_SETTING`.\n\nSome settings depend on your organization's plan. One your plan doesn't include is refused with `UNKNOWN_SETTING`.\n\n**Checked when you publish.** A save keeps a step that isn't finished; `POST /v1/templates/{id}/check` and publish name what is still missing:\n- Jotform step needs a connected Jotform account.\n- Choose a Jotform form for this step.\n\nA template read (`GET /v1/templates/{id}`) returns the step's settings as stored, in `StepConfig_JOTFORM`.","x-moxo-step-type":"JOTFORM"},"StepSettings_IDENTITY_VERIFICATION":{"type":"object","properties":{"aiEscalation":{"$ref":"#/components/schemas/StepSetting_aiEscalation"},"visibleToAllAssignees":{"description":"The older form of `visibility.mode: \"ALL\"`. Use `visibility` instead.","type":"boolean"},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"},"reviewers":{"$ref":"#/components/schemas/StepSetting_reviewers"},"identityVerification":{"type":"object","properties":{"provider":{"type":"string","enum":["yoti","sumsub","didit"],"description":"The provider that runs the check: `yoti`, `sumsub` when the organization has Sumsub verification turned on, or `didit` when it has Didit verification turned on."},"connectionId":{"type":"string","description":"The id of the provider's connection. An admin sets it in the step's settings in Moxo."},"checks":{"description":"The checks the person must pass. The document's authenticity is always checked. `DOCUMENT`: the ID document only. `DOCUMENT_FACE_MATCH`: the document and a selfie matched to its photo. `DOCUMENT_LIVENESS`: the document and a check that the person is present. `DOCUMENT_FACE_MATCH_LIVENESS` (the default): all three, the usual KYC set.","type":"string","enum":["DOCUMENT","DOCUMENT_FACE_MATCH","DOCUMENT_LIVENESS","DOCUMENT_FACE_MATCH_LIVENESS"]},"captureMethod":{"description":"`CAMERA_AND_UPLOAD` (the default) lets the person upload pictures of the document; `CAMERA` requires a live capture.","type":"string","enum":["CAMERA_AND_UPLOAD","CAMERA"]},"maxAttempts":{"description":"How many finished sessions without approval the person gets before the step completes with `overall_status` `FAILED`. Defaults to 3. A rejected attempt sends the step back to the person with the reason. A result the provider couldn't confirm (`CONSIDER`) goes to the step's reviewers, who approve it or send it back; with no reviewers, it counts as an attempt without approval.","type":"integer","minimum":1,"maximum":10},"sumsub":{"description":"Sumsub settings, used only when `provider` is `sumsub`. `checks`, `captureMethod`, `maxAttempts` and reviewers don't apply: the Sumsub level decides what is checked, and Sumsub handles resubmission and manual review.","type":"object","properties":{"externalUserId":{"description":"Your own id for the person in Sumsub, up to 512 characters, usually a value from an earlier step such as a CRM id. Required unless `applicantId` is set.","type":"string","maxLength":512},"applicantId":{"description":"An existing Sumsub applicant id from an earlier step, up to 64 characters. When set, it is used instead of `externalUserId`.","type":"string","maxLength":512},"applicantType":{"description":"`individual` (the default) verifies a person; `company` verifies a business.","type":"string","enum":["individual","company"]},"companyName":{"description":"The company's name, for a new company applicant.","type":"string","maxLength":256},"companyCountry":{"description":"The country of a new company applicant, as an ISO 3166-1 alpha-3 code such as `GBR`.","type":"string"},"levelName":{"description":"The Sumsub verification level's name, exactly as it appears in your Sumsub dashboard. Required for Sumsub.","type":"string","maxLength":256},"isWorkflow":{"description":"`true` when the level is a Sumsub workflow: the step then finishes when the workflow completes, instead of on the applicant review.","type":"boolean"},"resetStepEnabled":{"description":"`true` to reset one Sumsub step each time the person opens verification.","type":"boolean"},"resetStep":{"description":"The Sumsub step to reset when `resetStepEnabled` is `true`.","type":"string","enum":["APPLICANT_DATA","IDENTITY","IDENTITY2","IDENTITY3","IDENTITY4","SELFIE","SELFIE2","PROOF_OF_RESIDENCE","PROOF_OF_RESIDENCE2","PAYMENT_METHODS","QUESTIONNAIRE","PHONE_VERIFICATION","EMAIL_VERIFICATION","E_KYC","COMPANY_DATA","COMPANY_DOCUMENTS"]},"buttonText":{"description":"The text on the person's button. Defaults to `Start Verification`.","type":"string","maxLength":60},"openMode":{"description":"`inside_moxo` (the default) opens Sumsub in a window inside Moxo on a computer; `new_tab` always opens a new tab. Phones always use a new tab.","type":"string","enum":["inside_moxo","new_tab"]}}},"didit":{"description":"Didit settings, used only when `provider` is `didit`. `checks`, `captureMethod`, `maxAttempts` and reviewers don't apply: the Didit workflow decides what is checked, and Didit handles resubmission and manual review.","type":"object","properties":{"workflowId":{"description":"The id of a workflow published in your Didit account. Chosen from a list in the step's settings in Moxo.","type":"string","maxLength":64},"workflowLabel":{"description":"Didit's name for the chosen workflow, for display only.","type":"string","maxLength":120},"buttonText":{"description":"The text on the person's button. Defaults to `Verify identity`.","type":"string","maxLength":60},"openMode":{"description":"`inside_moxo` (the default) opens Didit in a window inside Moxo on a computer; `new_tab` always opens a new tab. Phones always use a new tab.","type":"string","enum":["inside_moxo","new_tab"]}}}},"required":["provider","connectionId"],"description":"Which provider and connection run the check, which checks to ask for, and how many attempts the person gets. The step has exactly one assignee: the person being verified. It completes when the provider approves, or with `overall_status` `FAILED` once the attempts run out, and a condition can branch on either. Add reviewers when a person should decide results the provider couldn't confirm."}},"required":["identityVerification","assignees"],"title":"Identity verification settings","description":"The settings a `IDENTITY_VERIFICATION` step is sent with, beside the shared ones in `StepSettings`. This is the schema `POST /v1/templates` and `POST /v1/templates/{id}/changes` check a step against: a setting not listed here is refused with `UNKNOWN_SETTING`.\n\nSome settings depend on your organization's plan. One your plan doesn't include is refused with `UNKNOWN_SETTING`.\n\n**Checked when you publish.** A save keeps a step that isn't finished; `POST /v1/templates/{id}/check` and publish name what is still missing:\n- Choose which identity-verification provider runs this check.\n- Identity verification needs a connected provider account.\n- Enter the External user ID, or an Applicant ID from an earlier step, so Sumsub knows who is being verified.\n- Enter the Sumsub verification level, exactly as it appears in Sumsub.\n- Choose which Sumsub step to reset, or turn Reset step off.\n- This step uses a value from an earlier step that no longer exists. Open it and pick an available value.\n- Choose the Didit workflow this step runs.\n\nA template read (`GET /v1/templates/{id}`) returns the step's settings as stored, in `StepConfig_IDENTITY_VERIFICATION`.","x-moxo-step-type":"IDENTITY_VERIFICATION"},"StepSettings_COLLECT_PAYMENT":{"type":"object","properties":{"aiEscalation":{"$ref":"#/components/schemas/StepSetting_aiEscalation"},"visibleToAllAssignees":{"description":"The older form of `visibility.mode: \"ALL\"`. Use `visibility` instead.","type":"boolean"},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"},"reviewers":{"$ref":"#/components/schemas/StepSetting_reviewers"},"payment":{"type":"object","properties":{"connectionId":{"type":"string","description":"The id of the Stripe or QuickBooks connection. An organization admin sets it in the step's settings."},"provider":{"type":"string","enum":["stripe","quickbooks"],"description":"`stripe` or `quickbooks`. Both support `pay_invoice` and `payment_link`; only `stripe` supports `new_checkout`."},"mode":{"type":"string","enum":["pay_invoice","new_checkout","payment_link"],"description":"`pay_invoice`: pay an invoice made earlier in the flow, usually by a Stripe or QuickBooks create-invoice step. Needs `invoiceId`. Stripe and QuickBooks. `new_checkout`: a one-off Stripe checkout made when the step starts, for an amount from this flow. Needs `amount`, `currency` and `description`. Stripe only. `payment_link`: a new single-use payment link made when the step starts. Needs `amount`, `currency` and `description`, and for QuickBooks also `customerEmail` (the invoice is made for you)."},"invoiceId":{"description":"Required for `pay_invoice`: the invoice to pay, usually a reference to an earlier step's output, such as `${{ steps.create_invoice.fields.invoice_id }}`. A fixed invoice id also works, for testing.","type":"string"},"amount":{"description":"The amount the payer owes, in major units (`2450` is $2,450). A number or a flow value reference. Required for `new_checkout` and `payment_link`.","anyOf":[{"type":"number"},{"type":"string"}]},"currency":{"description":"The currency, as an ISO 4217 code such as `USD`, `EUR` or `GBP`, or a reference to a flow value. Required for `new_checkout` and `payment_link`. Whether the account takes the currency is checked when the step starts: a QuickBooks company without multicurrency must use its home currency.","type":"string","minLength":1},"description":{"description":"The line the payer sees on the Stripe page or the QuickBooks invoice. Can include references to flow values.","anyOf":[{"type":"string"},{"type":"array","items":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"text","description":"The part's type."},"text":{"type":"string","description":"Fixed text."}},"required":["kind","text"]},{"type":"object","properties":{"kind":{"type":"string","const":"input","description":"The part's type."},"key":{"type":"string","minLength":1,"description":"The key of a start field the template declares."}},"required":["kind","key"]},{"type":"object","properties":{"kind":{"type":"string","const":"role","description":"The part's type."},"roleName":{"type":"string","minLength":1,"description":"A role's name."},"field":{"type":"string","enum":["name","email","phone","title"],"description":"Which of the role's details: `name`, `email`, `phone` or `title`."}},"required":["kind","roleName","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"flow","description":"The part's type."},"field":{"type":"string","enum":["name","description","dueDate","startDate","dueTimestamp","startTimestamp","id"],"description":"Which detail of the flow: `name`, `description`, `dueDate`, `startDate`, `dueTimestamp`, `startTimestamp` or `id`."}},"required":["kind","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"organization","description":"The part's type."},"field":{"type":"string","enum":["name","id"],"description":"Which detail of the organization: `name` or `id`."}},"required":["kind","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"system","description":"The part's type."},"field":{"type":"string","const":"today","description":"Today's date, in the organization's time zone."}},"required":["kind","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"step","description":"The part's type."},"stepName":{"type":"string","minLength":1,"description":"The name of an earlier step."},"field":{"type":"string","minLength":1,"description":"The name of that step's output."}},"required":["kind","stepName","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"current_item","description":"The part's type."},"field":{"type":"string","minLength":1,"description":"A field of the current item, in a step that repeats for each item."}},"required":["kind","field"]}]}}]},"customerEmail":{"description":"Required for QuickBooks with `payment_link`: the email of the customer the invoice is made for. The customer is found by email, or created when there is none. Can be a reference to a flow value, such as `${{ steps.intake.fields.email }}`. Not used for Stripe.","type":"string"},"existingLinkUrl":{"description":"For Stripe with `payment_link`: the address of an existing Stripe payment link to use, instead of making a new one each time the step starts. Not used for QuickBooks.","type":"string","format":"uri"}},"required":["connectionId","provider","mode"],"description":"How the payment is collected. `mode` is `pay_invoice`, `new_checkout` or `payment_link`; `provider` is `stripe` (all three modes) or `quickbooks` (`pay_invoice` and `payment_link`)."},"allowMarkAsPaid":{"description":"Whether the assignee sees an \"Already paid this another way?\" link, which completes the step with a required reason. The step is marked complete and recorded in the audit trail, but nothing is reconciled in Stripe or QuickBooks. Defaults to `true`; set `false` where payment must be confirmed by the provider.","type":"boolean"},"approveBeforeRun":{"description":"Whether a person approves what this step is about to send before it creates the payment page, envelope or agreement. When `true`, the step waits when it starts until someone approves; nothing reaches the payment or signing provider before that, and the payer or signer sees that it is being prepared. Set who approves in the step's `reviewers`: a step with approval on and no approver can't be published.","type":"boolean"},"approvalRejectMode":{"description":"What a rejection does, with `approveBeforeRun`. `halt` (the default for this step) stops the flow and nothing is sent; `skip` skips this step and the flow continues.","type":"string","enum":["skip","halt"]}},"required":["payment","assignees"],"title":"Collect Payment settings","description":"The settings a `COLLECT_PAYMENT` step is sent with, beside the shared ones in `StepSettings`. This is the schema `POST /v1/templates` and `POST /v1/templates/{id}/changes` check a step against: a setting not listed here is refused with `UNKNOWN_SETTING`.\n\nSome settings depend on your organization's plan. One your plan doesn't include is refused with `UNKNOWN_SETTING`.\n\n**Checked when you publish.** A save keeps a step that isn't finished; `POST /v1/templates/{id}/check` and publish name what is still missing:\n- Collect Payment step needs a connected Stripe or QuickBooks account.\n- Collect Payment step needs a provider selected.\n- Collect Payment step needs a payment mode selected.\n- Pay invoice mode needs an invoice id (use a value from a prior step).\n- New checkout mode needs an amount.\n- New checkout mode needs a currency.\n- Payment link mode needs an amount.\n- Payment link mode needs a currency.\n- QuickBooks payment link mode needs a customer email so we can attach the invoice.\n- Approve-before-it-runs is on but no approver is assigned. Pick who approves, or turn it off.\n\nA template read (`GET /v1/templates/{id}`) returns the step's settings as stored, in `StepConfig_COLLECT_PAYMENT`.","x-moxo-step-type":"COLLECT_PAYMENT"},"StepSettings_DECISION":{"type":"object","properties":{"options":{"description":"Switches for the files attached to this step. A type takes only the ones its step settings show.","type":"object","properties":{"preventDownload":{"description":"Prevent download: people can open the files attached to this step to read them, but can't download them. Needs view-only attachments switched on for your organization.","type":"boolean"}}},"visibleToAllAssignees":{"description":"The older form of `visibility.mode: \"ALL\"`. Use `visibility` instead.","type":"boolean"},"decision":{"description":"How the decision is made: one person decides, with no vote. For a group verdict, use an approval step.","type":"object","properties":{"completion":{"type":"object","properties":{"mode":{"description":"Always `ONE`: the first outcome chosen wins. For a majority or a unanimous verdict, use an approval step.","type":"string","enum":["ONE"]}},"description":"When the decision is made."},"assigneeOrder":{"description":"Always `PARALLEL`: everyone assigned is asked at once.","type":"string","enum":["PARALLEL"]}}},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"},"preparers":{"$ref":"#/components/schemas/StepSetting_preparers"},"advisors":{"$ref":"#/components/schemas/StepSetting_advisors"},"attachments":{"description":"Reference material shown on the step: files, web links or both. A web link (`{ kind: \"link\", url }`) is a page the assignee should open. Its `url` can be a fixed `https://` address or a reference to a value from earlier in the flow, such as `${{ steps.look_up_portal_link.fields.latest_url }}`, so a running flow always links to the latest address.","type":"array","items":{"anyOf":[{"type":"object","properties":{"ref":{"type":"string","description":"A file from an earlier step, as a reference such as `${{ steps.upload_contract.fields.uploaded_files }}`, or an uploaded file's id."}},"required":["ref"]},{"$ref":"#/components/schemas/StepSetting_attachmentsItem"},{"type":"object","properties":{"kind":{"type":"string","const":"file","description":"Set to `file`."},"ref":{"type":"string","description":"A file: an uploaded file's id, or a reference to a file from an earlier step."},"name":{"type":"string","minLength":1,"maxLength":255,"description":"The file's name as shown on the step."}},"required":["kind","ref"]}]}}},"required":["assignees"],"title":"Decision settings","description":"The settings a `DECISION` step is sent with, beside the shared ones in `StepSettings`. This is the schema `POST /v1/templates` and `POST /v1/templates/{id}/changes` check a step against: a setting not listed here is refused with `UNKNOWN_SETTING`.\n\nSome settings depend on your organization's plan. One your plan doesn't include is refused with `UNKNOWN_SETTING`.\n\n**Checked when you publish.** A save keeps a step that isn't finished; `POST /v1/templates/{id}/check` and publish name what is still missing:\n- Decision requires at least 2 outcomes.\n\nA template read (`GET /v1/templates/{id}`) returns the step's settings as stored, in `StepConfig_DECISION`.","x-moxo-step-type":"DECISION"},"StepSettings_CUSTOM_ACTION":{"type":"object","properties":{"visibleToAllAssignees":{"description":"The older form of `visibility.mode: \"ALL\"`. Use `visibility` instead.","type":"boolean"},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"},"preparers":{"$ref":"#/components/schemas/StepSetting_preparers"},"actionConfig":{"type":"object","properties":{"brief":{"description":"What the page shows and asks, in plain words. Can include values from earlier in the flow.","anyOf":[{"type":"string"},{"type":"array","items":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"text","description":"The part's type."},"text":{"type":"string","description":"Fixed text."}},"required":["kind","text"]},{"type":"object","properties":{"kind":{"type":"string","const":"input","description":"The part's type."},"key":{"type":"string","minLength":1,"description":"The key of a start field the template declares."}},"required":["kind","key"]},{"type":"object","properties":{"kind":{"type":"string","const":"role","description":"The part's type."},"roleName":{"type":"string","minLength":1,"description":"A role's name."},"field":{"type":"string","enum":["name","email","phone","title"],"description":"Which of the role's details: `name`, `email`, `phone` or `title`."}},"required":["kind","roleName","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"flow","description":"The part's type."},"field":{"type":"string","enum":["name","description","dueDate","startDate","dueTimestamp","startTimestamp","id"],"description":"Which detail of the flow: `name`, `description`, `dueDate`, `startDate`, `dueTimestamp`, `startTimestamp` or `id`."}},"required":["kind","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"organization","description":"The part's type."},"field":{"type":"string","enum":["name","id"],"description":"Which detail of the organization: `name` or `id`."}},"required":["kind","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"system","description":"The part's type."},"field":{"type":"string","const":"today","description":"Today's date, in the organization's time zone."}},"required":["kind","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"step","description":"The part's type."},"stepName":{"type":"string","minLength":1,"description":"The name of an earlier step."},"field":{"type":"string","minLength":1,"description":"The name of that step's output."}},"required":["kind","stepName","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"current_item","description":"The part's type."},"field":{"type":"string","minLength":1,"description":"A field of the current item, in a step that repeats for each item."}},"required":["kind","field"]}]}}]},"briefFiles":{"description":"Files the page is built from: uploaded files, or files from earlier steps.","type":"array","items":{"type":"object","properties":{"kind":{"type":"string","const":"file","description":"Always `file`."},"ref":{"type":"string","description":"A file: an uploaded file's id, or a reference to a file from an earlier step."},"name":{"description":"The file's name, as people see it.","type":"string","minLength":1,"maxLength":255}},"required":["kind","ref"]}},"briefUrls":{"description":"Web pages the page is built from.","type":"array","items":{"type":"string","format":"uri"}},"outputs":{"minItems":1,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z][A-Za-z0-9_-]{0,63}$","description":"The answer's id, unique in the step. A new id is lower case letters, digits and underscores, starting with a letter. An id already saved, including one with capitals or hyphens, is kept. Later steps refer to the answer by it."},"label":{"type":"string","minLength":1,"description":"The answer's name, as people see it."},"type":{"type":"string","enum":["text","number","boolean","date","time","select","multi_select"],"description":"The kind of answer: `text`, `number`, `boolean`, `date`, `time`, `select` or `multi_select`."},"required":{"default":true,"description":"Whether the person must give this answer. Defaults to `true`.","type":"boolean"},"options":{"description":"The choices of a `select` or `multi_select` answer: at least two, all different, none containing `|`.","type":"array","items":{"type":"string","minLength":1}},"description":{"description":"Help text that says what the answer is for.","type":"string"},"items":{"description":"Set for an answer given once per item, such as one per listing. The items are known when the run starts.","oneOf":[{"type":"object","properties":{"source":{"type":"string","const":"field","description":"`field`: one item per row of a list from earlier in the flow."},"ref":{"type":"string","minLength":1,"maxLength":500,"description":"The list from an earlier step the items come from: a table, a data table lookup or a file field."}},"required":["source","ref"]}]}},"required":["id","label","type"]},"description":"The answers the page collects, at least one. Each is available to later steps as `${{ steps.<step>.fields.<output> }}`. An answer given once per item is a list."}},"required":["brief","outputs"],"description":"The settings of a Custom action step: what its page is built from, and the answers it collects."}},"required":["actionConfig","assignees"],"title":"Custom Action settings","description":"The settings a `CUSTOM_ACTION` step is sent with, beside the shared ones in `StepSettings`. This is the schema `POST /v1/templates` and `POST /v1/templates/{id}/changes` check a step against: a setting not listed here is refused with `UNKNOWN_SETTING`.\n\nSome settings depend on your organization's plan. One your plan doesn't include is refused with `UNKNOWN_SETTING`.\n\n**Checked when you publish.** A save keeps a step that isn't finished; `POST /v1/templates/{id}/check` and publish name what is still missing:\n- Say what the page should do.\n- Add at least one output.\n- Name this output.\n- Add at least two different options.\n\nA template read (`GET /v1/templates/{id}`) returns the step's settings as stored, in `StepConfig_CUSTOM_ACTION`.","x-moxo-step-type":"CUSTOM_ACTION"},"StepSettings_CONVERSATION":{"type":"object","properties":{"visibleToAllAssignees":{"description":"The older form of `visibility.mode: \"ALL\"`. Use `visibility` instead.","type":"boolean"},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"},"conversation":{"description":"The AI agent that runs this step. In a Goal step, the agent is the step.","type":"object","properties":{"agent":{"type":"object","properties":{"objective":{"description":"What the assignee should accomplish in the conversation: text, or a list of typed parts when it includes references to flow values.","anyOf":[{"type":"string"},{"type":"array","items":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"text","description":"The part's type."},"text":{"type":"string","description":"Fixed text."}},"required":["kind","text"]},{"type":"object","properties":{"kind":{"type":"string","const":"input","description":"The part's type."},"key":{"type":"string","minLength":1,"description":"The key of a start field the template declares."}},"required":["kind","key"]},{"type":"object","properties":{"kind":{"type":"string","const":"role","description":"The part's type."},"roleName":{"type":"string","minLength":1,"description":"A role's name."},"field":{"type":"string","enum":["name","email","phone","title"],"description":"Which of the role's details: `name`, `email`, `phone` or `title`."}},"required":["kind","roleName","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"flow","description":"The part's type."},"field":{"type":"string","enum":["name","description","dueDate","startDate","dueTimestamp","startTimestamp","id"],"description":"Which detail of the flow: `name`, `description`, `dueDate`, `startDate`, `dueTimestamp`, `startTimestamp` or `id`."}},"required":["kind","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"organization","description":"The part's type."},"field":{"type":"string","enum":["name","id"],"description":"Which detail of the organization: `name` or `id`."}},"required":["kind","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"system","description":"The part's type."},"field":{"type":"string","const":"today","description":"Today's date, in the organization's time zone."}},"required":["kind","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"step","description":"The part's type."},"stepName":{"type":"string","minLength":1,"description":"The name of an earlier step."},"field":{"type":"string","minLength":1,"description":"The name of that step's output."}},"required":["kind","stepName","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"current_item","description":"The part's type."},"field":{"type":"string","minLength":1,"description":"A field of the current item, in a step that repeats for each item."}},"required":["kind","field"]}]}}]},"outputs":{"description":"The values the conversation collects or works out. Later steps can reference each one. Leave it empty only on a Goal step whose values aren't decided yet: they are proposed when the step is set up.","type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The output's unique id, used as its key in references."},"label":{"type":"string","description":"The output's name, as people see it."},"type":{"type":"string","enum":["text","number","boolean","date","select","file","list"],"description":"The value's type: `text`, `number`, `boolean`, `date`, `select`, `file` or `list`."},"kind":{"default":"collected","description":"`collected`: the agent asks the assignee for it. `computed`: the agent works it out from the conversation, such as a risk tier from an overview of assets. Defaults to `collected`.","type":"string","enum":["collected","computed"]},"required":{"default":true,"type":"boolean","description":"Whether the conversation must collect it. Defaults to `true`."},"options":{"description":"The allowed choices, for a `select` output.","type":"array","items":{"type":"string"}},"description":{"type":"string","description":"What the value is, to guide the agent."}},"required":["id","label","type"]}},"knowledge":{"description":"Knowledge files the agent uses while it runs. The assignee never sees them.","type":"array","items":{"type":"object","properties":{"fileId":{"type":"string","description":"The file's id."},"name":{"type":"string","description":"The file's name."},"sizeBytes":{"type":"number","description":"The file's size, in bytes."},"uploadedAt":{"type":"string","description":"When the file was uploaded."}},"required":["fileId","name"]}},"sensitiveZones":{"description":"Topics the agent avoids pressing on.","type":"array","items":{"type":"string"}},"persona":{"description":"The agent's tone, voice and style.","type":"string"},"behaviorRules":{"description":"Rules the agent follows, in free text.","type":"array","items":{"type":"string"}},"escalation":{"description":"Brings a flow manager into the chat when the AI can't reach the goal.","type":"object","properties":{"enabled":{"default":false,"description":"Whether a person can be brought in at all. With `false`, the assignee can't ask for one and the AI can't bring one in.","type":"boolean"},"to":{"type":"object","properties":{"kind":{"type":"string","enum":["role","team_desk"],"description":"Who is brought in: `role`, the people in a role that manages the flow, or `team_desk`, whoever is on duty at a team desk."},"id":{"type":"string","description":"The role's id (`kind` `role`) or the team desk's id (`kind` `team_desk`). It must be able to manage the flow."}},"required":["kind","id"],"description":"Who is brought in."},"allowAssigneeRequest":{"default":true,"description":"Whether the assignee can ask for a person from the chat. The AI also brings one in when the assignee asks in their own words.","type":"boolean"},"autoTriggers":{"type":"object","properties":{"stuckAfterTurns":{"description":"Bring in a person after the AI has asked about the same required answer this many times without progress.","type":"integer","minimum":1,"maximum":9007199254740991},"onSensitiveZone":{"description":"Bring in a person when the conversation reaches a topic marked as sensitive.","type":"boolean"}},"description":"When a person is brought in without being asked."}}}},"required":["objective"],"description":"The agent that holds the conversation for this step, from start to finish."}},"required":["agent"]}},"required":["assignees"],"title":"Goal settings","description":"The settings a `CONVERSATION` step is sent with, beside the shared ones in `StepSettings`. This is the schema `POST /v1/templates` and `POST /v1/templates/{id}/changes` check a step against: a setting not listed here is refused with `UNKNOWN_SETTING`.\n\nSome settings depend on your organization's plan. One your plan doesn't include is refused with `UNKNOWN_SETTING`.\n\n**Checked when you publish.** A save keeps a step that isn't finished; `POST /v1/templates/{id}/check` and publish name what is still missing:\n- Goal step requires an objective.\n\nA template read (`GET /v1/templates/{id}`) returns the step's settings as stored, in `StepConfig_CONVERSATION`.","x-moxo-step-type":"CONVERSATION"},"StepSettings_WEB_APP":{"type":"object","properties":{"visibleToAllAssignees":{"description":"The older form of `visibility.mode: \"ALL\"`. Use `visibility` instead.","type":"boolean"},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"},"preparers":{"$ref":"#/components/schemas/StepSetting_preparers"},"webAppConfig":{"description":"The web app settings.","type":"object","properties":{"source":{"description":"Where the page comes from: a hosted URL (the default) or an uploaded HTML file.","default":"hosted","type":"string","enum":["hosted","upload"]},"htmlFile":{"description":"The uploaded HTML file, when `source` is `upload`.","type":"object","properties":{"fileId":{"type":"string","format":"uuid","description":"The uploaded HTML file's id."},"fileName":{"type":"string","minLength":1,"description":"The file's original name."},"sizeBytes":{"description":"The file's size in bytes.","type":"integer","minimum":0,"maximum":9007199254740991}},"required":["fileId"]},"keepCompletedFile":{"description":"When `true`, a PDF of the completed page is saved on the step, so later steps can reference it.","type":"boolean"},"answerFields":{"description":"The names of the uploaded page's form fields. Each becomes an answer later steps can reference. Set when the file is added.","maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}},"url":{"description":"The web app's URL. Required unless `source` is `upload`. Can include references to values from earlier in the flow, for example `https://app.example.com/form?id=${{ fields.client_id }}`.","type":"string"},"method":{"description":"The HTTP method used to open the URL.","default":"GET","type":"string","enum":["GET","POST"]},"parameters":{"description":"Query parameters added to the URL.","type":"array","items":{"type":"object","properties":{"key":{"type":"string","description":"The parameter's name."},"value":{"type":"string","description":"The parameter's value. Can include references to values from earlier in the flow."}},"required":["key","value"]}},"completionMode":{"default":"MANUAL","description":"How a hosted page's step completes. `MANUAL`: the assignee selects Mark Complete. `WEBHOOK`: the outside system confirms with a callback. Defaults to `MANUAL`. An uploaded page (`source: upload`) is finished by its assignee's own Submit and ignores this setting; a change through this API saves it without one.","type":"string","enum":["MANUAL","WEBHOOK"]},"buttonLabel":{"description":"The label of the button that opens the web app.","default":"Open Application","type":"string"},"openInsideMoxo":{"description":"When `true`, the web app opens in a window inside Moxo on desktop instead of a new tab. On mobile, and with `POST`, it still opens outside Moxo.","type":"boolean"},"modalWidthPct":{"description":"The window's width, as a percent of the browser window. Defaults to 90.","type":"number","minimum":40,"maximum":100},"modalHeightPct":{"description":"The window's height, as a percent of the browser window. Defaults to 85.","type":"number","minimum":40,"maximum":100},"manualCompletedBy":{"default":"assignee","type":"string","enum":["assignee","member"],"description":"With manual completion: who confirms the page is done, `assignee` or `member` (a member of your team)."},"webhookAuth":{"anyOf":[{"type":"null"},{"type":"object","properties":{"connectionId":{"type":"string","minLength":1,"description":"A saved Basic auth Secret of your organization, by name or id. The read shows its id."}},"required":["connectionId"],"additionalProperties":false},{"type":"object","properties":{"username":{"type":"null","description":"Always `null`, as the read shows it: the saved one is kept."},"password":{"type":"null","description":"Always `null`, as the read shows it: the saved one is kept."}}}],"description":"\"Require Basic Auth\": `{ \"connectionId\": \"<Secret name or id>\" }` checks each call against a saved Basic auth Secret of your organization, and `null` turns it off. A user name and password typed into the step are set in Moxo and never sent through the API; send the read's `null`s back, or leave it out, to keep them."}}}},"required":["assignees"],"title":"Web App settings","description":"The settings a `WEB_APP` step is sent with, beside the shared ones in `StepSettings`. This is the schema `POST /v1/templates` and `POST /v1/templates/{id}/changes` check a step against: a setting not listed here is refused with `UNKNOWN_SETTING`.\n\nSome settings depend on your organization's plan. One your plan doesn't include is refused with `UNKNOWN_SETTING`.\n\n**Checked when you publish.** A save keeps a step that isn't finished; `POST /v1/templates/{id}/check` and publish name what is still missing:\n- Add the web address for this step.\n- Add the HTML file for this step.\n\nA template read (`GET /v1/templates/{id}`) returns the step's settings as stored, in `StepConfig_WEB_APP`.","x-moxo-step-type":"WEB_APP"},"StepSettings_PREPARE_DOCUMENT":{"type":"object","properties":{"visibleToAllAssignees":{"description":"The older form of `visibility.mode: \"ALL\"`. Use `visibility` instead.","type":"boolean"},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"},"prepareDocument":{"description":"The prepare-document settings: the PDF whose form fields, or the Word template whose placeholders, are filled with values from the flow when the step runs. The filled PDF can be used by a later file request, email or e-signature step.","type":"object","properties":{"documentRef":{"description":"The PDF to fill: the `fileId` of the PDF uploaded to the step, or a reference to an earlier step's file.","type":"string"},"fileName":{"description":"The name of the generated file, without extension, for example `Direct Deposit Authorization`.","type":"string"},"fields":{"description":"The fields found in the PDF, each filled with a flow value.","type":"array","items":{"type":"object","properties":{"pdfFieldName":{"type":"string","description":"The field's name in the PDF. Set by Moxo when the PDF is read; send back what Moxo returned, or leave it out."},"label":{"type":"string","description":"The field's label, as people see it."},"fieldType":{"type":"string","enum":["text","checkbox","dropdown","radio","signature","multi_select"],"description":"The field's type: `text`, `checkbox`, `dropdown`, `radio`, `signature` or `multi_select`."},"defaultValue":{"description":"The fixed value written when the reference has no value.","type":"string"},"options":{"type":"array","items":{"type":"string"},"description":"For a dropdown, radio or multi-select field: its options."},"dataRef":{"description":"The reference to the value that fills this field, for example `${{ fields.employee_name }}`. Leave it empty to keep the field blank, for example a signature signed by hand after download.","type":"string"},"maxLength":{"type":"number","description":"For text: the most characters accepted."},"format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"text","description":"Set to `text`."}},"required":["type"]},{"$ref":"#/components/schemas/StepSetting_format"},{"type":"object","properties":{"type":{"type":"string","const":"phone","description":"Set to `phone`."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"email","description":"Set to `email`."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"zip","description":"Set to `zip`."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"ssn","description":"Set to `ssn`."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"date","description":"Set to `date`."},"defaultToCurrentDate":{"type":"boolean","description":"Starts the date at today."},"futureDatesOnly":{"type":"boolean","description":"Accepts only dates after today."},"pastDatesOnly":{"type":"boolean","description":"Accepts only dates before today."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"custom","description":"Set to `custom`."},"regex":{"type":"string","minLength":1,"maxLength":500,"description":"For a pattern format: the regular expression the value must match."}},"required":["type","regex"]}],"description":"The format a text field must have, such as a number, an email or a date."},"page":{"type":"number","description":"The page the field is on, counting from 1."},"x":{"type":"number","description":"The field's left edge, as a percentage of the page width."},"y":{"type":"number","description":"The field's top edge, as a percentage of the page height."},"width":{"type":"number","description":"The field's width, as a percentage of the page width."},"height":{"type":"number","description":"The field's height, as a percentage of the page height."},"origin":{"type":"string","enum":["acroform","anchor","custom"],"description":"Whether the field is the PDF's own form field (`acroform`) or drawn on the page (`anchor`, `custom`). Set by Moxo when the PDF is read; send back what Moxo returned, or leave it out."},"recovered":{"description":"Set when Moxo found this blank from a box drawn on the PDF. Send it back on a field Moxo returned; leave it out on a field you place.","type":"boolean","const":true},"fieldId":{"type":"string","description":"The field's id. Keep it when sending the list back."},"context":{"type":"string","maxLength":500,"description":"A note for the AI that fills the field in: what the field asks for."},"required":{"type":"boolean","description":"Whether the field must be filled in."},"readOnly":{"type":"boolean","description":"Whether the field is shown but can't be changed."},"defaultValueSource":{"type":"string","enum":["builder","ddr","ai","person"],"description":"Where the field's starting value comes from."},"defaultValueFrom":{"type":"string","maxLength":300,"description":"The value the field starts with, as a reference to a flow value."},"placeholder":{"type":"string","description":"A hint shown in the empty field."},"multiline":{"type":"boolean","description":"Whether the field takes several lines of text."},"fontSize":{"type":"number","exclusiveMinimum":0,"description":"The size of the text written into the field, in points. Leave it out to use the form's size."},"widgetPositions":{"type":"array","items":{"$ref":"#/components/schemas/StepSetting_widgetPositionsItem"},"description":"Where the field's boxes are on the document: one entry per box, such as one per choice of a radio group."},"assignedRoleId":{"type":"string","description":"The role that fills the field in, by its id."},"conditionalLogic":{"type":"object","properties":{"action":{"description":"Whether the field is shown or hidden when the conditions match. `show`: shown only when they match. `hide`: hidden when they match.","type":"string","enum":["show","hide"]},"logicType":{"description":"How the conditions combine. `all`: every condition must match. `any`: at least one must match.","type":"string","enum":["all","any"]},"conditions":{"type":"array","items":{"type":"object","properties":{"source":{"description":"Where the condition reads its value. `form`, or omitted: a field in this form. `ddr`: a value from earlier in the flow, such as an earlier step's answer, a start field or a role's details.","type":"string","enum":["form","ddr"]},"fieldKey":{"description":"The field in this form to test, by its field id. Required for a condition on this form, which is the default. Leave it out when `source` is `ddr`, where `ref` names the value instead.","type":"string"},"ref":{"description":"The value to test when `source` is `ddr`: a reference to a value from earlier in the flow, such as `${{ steps.intake.fields.segment }}`. Required for that source.","type":"string"},"operator":{"description":"How to compare the value. One of `equals`, `not_equals`, `contains`, `not_contains`, `greater_than`, `less_than`, `greater_than_or_equal`, `less_than_or_equal`, `starts_with`, `ends_with`, `is_empty`, `is_not_empty`, `in` or `not_in`.","type":"string","enum":["equals","not_equals","contains","not_contains","greater_than","less_than","greater_than_or_equal","less_than_or_equal","starts_with","ends_with","is_empty","is_not_empty","in","not_in"]},"value":{"type":"string","description":"The value the other field is compared with."},"valueRef":{"description":"The value to compare against, from earlier in the flow, such as `${{ steps.intake.fields.tier }}`. When set, the rule uses that value instead of `value`. A reference that is missing or empty does not match.","type":"string"},"relativeValue":{"type":"object","properties":{"anchor":{"type":"string","const":"today","description":"The date the offset counts from. Only `today` is supported: the date is worked out again each time the rule runs, so it never goes out of date."},"direction":{"type":"string","enum":["before","after"],"description":"Whether the compared date is before or after the anchor. With `offset` and `unit`, `before`, `3` and `years` mean three years before today."},"offset":{"type":"integer","minimum":0,"maximum":1000,"description":"How many units from the anchor: a whole number from 0 to 1000."},"unit":{"type":"string","enum":["days","weeks","months","years"],"description":"The unit of the offset: `days`, `weeks`, `months` or `years`."}},"required":["anchor","direction","offset","unit"],"description":"A value relative to today the other field is compared with, for a date."},"columnId":{"description":"For a rule on a Look up a record field in this form: the id of a column of the record it picks, from the field's `config.source.columns`. The rule then compares that column instead of the whole record. For an option column, `value` is the option id. When several records are picked, `equals` matches when any of them matches. A timestamp column, and a lookup with no columns, take only `is_empty` and `is_not_empty`.","type":"string"}},"required":["operator"]},"description":"The conditions that decide whether the field is shown. Each one tests another field in this form (`fieldKey`) or a value from earlier in the flow (`source: \"ddr\"` with `ref`)."}},"required":["action","logicType","conditions"],"description":"When the field is shown: the rules on other fields' values."},"initiallyHidden":{"type":"boolean","const":true,"description":"Set to `true`."}},"required":["pdfFieldName","label"]}},"defaultFontSize":{"type":"number","exclusiveMinimum":0,"description":"The text size, in points, for fields that don't set their own."},"appearance":{"type":"object","properties":{"mode":{"type":"string","enum":["inherit","custom"],"description":"`inherit` uses the PDF's own look; `custom` uses `font` and `colorHex`."},"font":{"type":"string","enum":["HELVETICA","TIMES","COURIER"],"description":"With `custom`: `HELVETICA`, `TIMES` or `COURIER`."},"colorHex":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$","description":"With `custom`: the text color, as a hex color such as `#1a2b3c`."}},"required":["mode"],"description":"How filled-in text looks: `inherit` (the default) or `custom`, with `font` and `colorHex`."},"wordTemplate":{"description":"A Word template (.docx) to fill instead of a PDF: each of its `{{placeholders}}` is filled with a value from the flow. Set when the Word file is uploaded to the step. On this step every placeholder needs a value, because nobody fills one in.","type":"object","properties":{"ref":{"description":"The `fileId` of the Word file (.docx) uploaded to the step. Set when the file is uploaded.","type":"string"},"fileName":{"description":"The Word file's name, as it was uploaded.","type":"string"},"fill":{"type":"object","properties":{"slots":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"},"description":"Each `{{placeholder}}` in the Word file, by name, with the reference to the value that fills it, for example `${{ steps.intake_form.fields.client_name }}`. An empty string leaves it unfilled."}},"required":["slots"],"description":"How the file's placeholders are filled: `slots` maps each `{{placeholder}}` name to the reference that fills it, or `\"\"` for one nobody maps."}},"required":["fill"]}}},"blockOnFailure":{"type":"boolean","description":"Whether a failure stops the flow (\"Block the workflow if this step fails\"). `false` lets the flow continue past it; the failure is still recorded. Stops it when left out."}},"title":"Prepare document settings","description":"The settings a `PREPARE_DOCUMENT` step is sent with, beside the shared ones in `StepSettings`. This is the schema `POST /v1/templates` and `POST /v1/templates/{id}/changes` check a step against: a setting not listed here is refused with `UNKNOWN_SETTING`.\n\nSome settings depend on your organization's plan. One your plan doesn't include is refused with `UNKNOWN_SETTING`.\n\n**Checked when you publish.** A save keeps a step that isn't finished; `POST /v1/templates/{id}/check` and publish name what is still missing:\n- Some custom fields are missing position info. Draw them on the PDF canvas to fix this.\n- Some fields sit on a page this PDF no longer has. Move them onto a page.\n- A single-select field needs at least two options, each with its own value and a button placed on the PDF.\n\nA template read (`GET /v1/templates/{id}`) returns the step's settings as stored, in `StepConfig_PREPARE_DOCUMENT`.","x-moxo-step-type":"PREPARE_DOCUMENT"},"StepSettings_PDF_FORM":{"type":"object","properties":{"aiEscalation":{"$ref":"#/components/schemas/StepSetting_aiEscalation"},"visibleToAllAssignees":{"description":"The older form of `visibility.mode: \"ALL\"`. Use `visibility` instead.","type":"boolean"},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"},"preparers":{"$ref":"#/components/schemas/StepSetting_preparers"},"reviewers":{"$ref":"#/components/schemas/StepSetting_reviewers"},"guidedFill":{"description":"Guided fill on this PDF form. `{ enabled: true }` lets the participant fill it in from the chat. Leave it out to keep it manual only. Separate from `assist`.","type":"object","properties":{"enabled":{"type":"boolean","description":"Allows guided fill on this form. `true` lets the participant complete the form from the chat, with the form beside it. `false`, or no object, keeps the form manual only."},"defaultMode":{"default":"guided","description":"Where the form opens when guided fill is allowed: `guided` opens the chat, `manual` opens the form. Defaults to `guided`. The participant can switch.","type":"string","enum":["guided","manual"]}},"required":["enabled"]},"pdfForm":{"description":"The fillable PDF's settings.","type":"object","properties":{"documentUrl":{"description":"An older, temporary link to the PDF, which expires after about an hour. The PDF is set by its `fileId` instead.","type":"string"},"fileName":{"description":"The PDF's original file name, used when it is downloaded.","type":"string"},"fields":{"type":"array","items":{"type":"object","properties":{"pdfFieldName":{"type":"string","description":"The field's name in the PDF. Set by Moxo when the PDF is read; send back what Moxo returned, or leave it out."},"label":{"type":"string","description":"The field's label, as people see it."},"fieldType":{"type":"string","enum":["text","checkbox","dropdown","radio","signature","multi_select"],"description":"The field's type: `text`, `checkbox`, `dropdown`, `radio`, `signature` or `multi_select`."},"required":{"type":"boolean","description":"Whether the field must be filled in."},"requiredSource":{"description":"Where the field's required setting came from: `imported` (the PDF marks it required; uploading the PDF again refreshes it) or `builder` (set in Moxo). Send back the value Moxo returned for the field; otherwise leave it out.","type":"string","enum":["imported","builder"]},"readOnly":{"type":"boolean","description":"Shown with its value, and can't be changed."},"defaultValue":{"type":"string","description":"The value the field starts with: fixed text or a reference to a flow value."},"options":{"type":"array","items":{"type":"string"},"description":"For a dropdown, radio or multi-select field: its options."},"dataRef":{"description":"A reference to a value from earlier in the flow that fills in this field in advance.","type":"string"},"assignedRoleId":{"description":"With per-role field assignment: the id of the role that fills in this field.","type":"string"},"maxLength":{"type":"number","description":"For text: the most characters accepted."},"format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"text","description":"Set to `text`."}},"required":["type"]},{"$ref":"#/components/schemas/StepSetting_format"},{"type":"object","properties":{"type":{"type":"string","const":"phone","description":"Set to `phone`."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"email","description":"Set to `email`."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"zip","description":"Set to `zip`."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"ssn","description":"Set to `ssn`."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"date","description":"Set to `date`."},"defaultToCurrentDate":{"type":"boolean","description":"Starts the date at today."},"futureDatesOnly":{"type":"boolean","description":"Accepts only dates after today."},"pastDatesOnly":{"type":"boolean","description":"Accepts only dates before today."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"custom","description":"Set to `custom`."},"regex":{"type":"string","minLength":1,"maxLength":500,"description":"For a pattern format: the regular expression the value must match."}},"required":["type","regex"]}],"description":"The format a text field must have, such as a number, an email or a date."},"formatSource":{"description":"Where the field's format came from: `imported` (read from the PDF; uploading the PDF again refreshes it) or `builder` (set in Moxo). Send back the value Moxo returned for the field; otherwise leave it out.","type":"string","enum":["imported","builder"]},"page":{"type":"number","description":"The page the field is on, counting from 1."},"x":{"type":"number","description":"The field's left edge, as a percentage of the page width."},"y":{"type":"number","description":"The field's top edge, as a percentage of the page height."},"width":{"type":"number","description":"The field's width, as a percentage of the page width."},"height":{"type":"number","description":"The field's height, as a percentage of the page height."},"origin":{"description":"Where the field came from: `acroform` (one of the PDF's own form fields), `anchor` (found automatically by AI) or `custom` (added in the template builder).","type":"string","enum":["acroform","anchor","custom"]},"recovered":{"description":"Set when Moxo found this blank from a box drawn on the PDF. Send it back on a field Moxo returned; leave it out on a field you place.","type":"boolean","const":true},"conditionalLogic":{"description":"When the field is shown or hidden, with the same rules as a form field: `{ action: \"show\" | \"hide\", logicType: \"all\" | \"any\", conditions: [...] }`. Rules the PDF already has are imported with it.","type":"object","properties":{"action":{"description":"Whether the field is shown or hidden when the conditions match. `show`: shown only when they match. `hide`: hidden when they match.","type":"string","enum":["show","hide"]},"logicType":{"description":"How the conditions combine. `all`: every condition must match. `any`: at least one must match.","type":"string","enum":["all","any"]},"conditions":{"type":"array","items":{"$ref":"#/components/schemas/StepSetting_conditionsItem"},"description":"The conditions that decide whether the field is shown. Each one tests another field in this form (`fieldKey`) or a value from earlier in the flow (`source: \"ddr\"` with `ref`)."}},"required":["action","logicType","conditions"]},"conditionalLogicSource":{"description":"Where the field's show or hide rule came from: `imported` (read from the PDF) or `builder` (set in Moxo). Leave it out when the field has no rule.","type":"string","enum":["imported","builder"]},"initiallyHidden":{"description":"The PDF hides this field when it opens, and none of the field's own rules shows it. Keep the value read from the PDF; leave it out otherwise, and on a field that has its own rule.","type":"boolean","const":true},"fieldId":{"type":"string","description":"The field's id. Keep it when sending the list back."},"context":{"type":"string","maxLength":500,"description":"A note for the AI that fills the field in: what the field asks for."},"defaultValueSource":{"type":"string","enum":["builder","ddr","ai","person"],"description":"Where the field's starting value comes from."},"defaultValueFrom":{"type":"string","maxLength":300,"description":"The value the field starts with, as a reference to a flow value."},"placeholder":{"type":"string","description":"A hint shown in the empty field."},"multiline":{"type":"boolean","description":"Whether the field takes several lines of text."},"fontSize":{"type":"number","exclusiveMinimum":0,"description":"The size of the text written into the field, in points. Leave it out to use the form's size."},"widgetPositions":{"type":"array","items":{"$ref":"#/components/schemas/StepSetting_widgetPositionsItem"},"description":"Where the field's boxes are on the document: one entry per box, such as one per choice of a radio group."}},"required":["pdfFieldName","label"]},"description":"The PDF's fields, each with its label, type, who fills it and where it is. Set by Moxo when the PDF is read; send back what Moxo returned, or leave it out."},"autoFolder":{"description":"A folder in the flow's Files panel for the filled PDF. A plain name is used as written. The name can include a value from earlier in the flow. An empty value is left out, and the text around it stays. If nothing is left, the file stays unfiled.","type":"string"},"conditionalImport":{"type":"object","properties":{"importedRuleCount":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many show and hide rules were read from the PDF. Set by Moxo on upload: leave it out on a new step, and send it back unchanged otherwise."},"unsupported":{"type":"array","items":{"type":"object","properties":{"source":{"type":"string","description":"The script or field in the PDF the warning is about: a field name, a script name, or `document`. Set by Moxo on upload."},"reason":{"type":"string","description":"Why the script wasn't brought in: a calculation, a rule that mixes all-of and any-of conditions, or a show or hide script that couldn't be read. Set by Moxo on upload."},"code":{"description":"The warning's code, such as `hide_unbound`, `calculate` or `js_unparsed`. Set by Moxo on upload.","type":"string"},"place":{"description":"What the warning is about: `field`, `widget`, `link`, `page` or `document`. Set by Moxo on upload.","type":"string"},"page":{"description":"The page the warning is about, counting from 1. Set by Moxo on upload.","type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"fact":{"description":"What the warning says, in a form Moxo words in each language. Set by Moxo on upload.","type":"object","properties":{"kind":{"type":"string","description":"The kind of warning, such as `range`, `keystroke` or `hidden_at_open`. Set by Moxo on upload."}},"required":["kind"],"additionalProperties":{}}},"required":["source","reason"]},"description":"Warnings about scripts in the PDF that weren't brought in, at most 50. Set by Moxo on upload."},"unsupportedMore":{"description":"How many more warnings there were than `unsupported` lists. Set by Moxo on upload.","type":"integer","minimum":0,"maximum":9007199254740991},"extractionLimited":{"description":"`true` when the PDF's encryption or structure kept its show and hide rules from being read. Its fields were still added, but some rules may be missing. Set by Moxo on upload.","type":"boolean"},"unplacedFields":{"description":"The fields, by label, left off the form because their page couldn't be found in the PDF. Set by Moxo on upload.","type":"array","items":{"type":"string"}},"requiredCount":{"description":"How many of the added fields the PDF itself marks required. Set by Moxo on upload.","type":"integer","minimum":0,"maximum":9007199254740991},"notImported":{"description":"The parts of the PDF that weren't added as fields, at most 50. Set by Moxo on upload: leave it out.","type":"array","items":{"type":"object","properties":{"pdfFieldName":{"type":"string","description":"The field's full name in the PDF. Set by Moxo on upload."},"label":{"type":"string","description":"The label the field would have had. Set by Moxo on upload."},"code":{"type":"string","description":"Why it wasn't added: `button` (a push button, not a question) or `no_page` (the PDF doesn't say which page it is on). Set by Moxo on upload."},"rects":{"description":"A push button's boxes, as percentages of the page. Set by Moxo on upload.","type":"array","items":{"type":"object","properties":{"page":{"type":"number","description":"The page the box is on, counting from 1."},"x":{"type":"number","description":"The box's left edge, as a percentage of the page width."},"y":{"type":"number","description":"The box's top edge, as a percentage of the page height."},"width":{"type":"number","description":"The box's width, as a percentage of the page width."},"height":{"type":"number","description":"The box's height, as a percentage of the page height."}},"required":["page","x","y","width","height"]}}},"required":["pdfFieldName","label","code"]}},"notImportedMore":{"description":"How many more parts weren't added than `notImported` lists. Set by Moxo on upload.","type":"integer","minimum":0,"maximum":9007199254740991},"fieldDiff":{"description":"What changed since the PDF was last uploaded. Set by Moxo when the PDF is uploaded again.","type":"object","properties":{"added":{"type":"array","items":{"type":"string"},"description":"The fields, by label, that gained a show or hide rule when the PDF was uploaded again."},"removed":{"type":"array","items":{"type":"string"},"description":"The fields, by label, whose show or hide rule was dropped when the PDF was uploaded again."},"conditionsChanged":{"type":"array","items":{"type":"string"},"description":"The fields, by label, whose show or hide rule changed when the PDF was uploaded again."}},"required":["added","removed","conditionsChanged"]}},"required":["importedRuleCount","unsupported"],"description":"What Moxo read from the PDF's own show and hide rules. Set by Moxo on upload: leave it out on a new step, and send it back unchanged otherwise."},"defaultFontSize":{"type":"number","exclusiveMinimum":0,"description":"The size of the text written into the form, in points."},"appearance":{"type":"object","properties":{"mode":{"type":"string","enum":["inherit","custom"],"description":"`inherit` uses the document's own style; `custom` uses `font` and `colorHex`."},"font":{"type":"string","enum":["HELVETICA","TIMES","COURIER"],"description":"With `mode` `custom`: `HELVETICA`, `TIMES` or `COURIER`."},"colorHex":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$","description":"With `mode` `custom`: the ink color, such as `#1F3A5F`."}},"required":["mode"],"description":"The style of the text written into the document."},"requireOptionalConfirmation":{"type":"boolean","description":"Whether the person is asked to confirm before leaving optional fields empty."},"textOverflow":{"type":"string","enum":["shrink","keep"],"description":"What happens to an answer longer than its box: `shrink` prints it smaller until it fits (the default), `keep` keeps the text size and cuts off the end."}}},"attachments":{"description":"Reference material shown on the step: files, web links or both. A web link (`{ kind: \"link\", url }`) is a page the assignee should open. Its `url` can be a fixed `https://` address or a reference to a value from earlier in the flow, such as `${{ steps.look_up_portal_link.fields.latest_url }}`, so a running flow always links to the latest address.","type":"array","items":{"anyOf":[{"type":"object","properties":{"ref":{"type":"string","description":"A file from an earlier step, as a reference such as `${{ steps.upload_contract.fields.uploaded_files }}`, or an uploaded file's id."}},"required":["ref"]},{"$ref":"#/components/schemas/StepSetting_attachmentsItem"},{"type":"object","properties":{"kind":{"type":"string","const":"file","description":"Set to `file`."},"ref":{"type":"string","description":"A file: an uploaded file's id, or a reference to a file from an earlier step."},"name":{"type":"string","minLength":1,"maxLength":255,"description":"The file's name as shown on the step."}},"required":["kind","ref"]}]}}},"required":["assignees"],"title":"PDF Form settings","description":"The settings a `PDF_FORM` step is sent with, beside the shared ones in `StepSettings`. This is the schema `POST /v1/templates` and `POST /v1/templates/{id}/changes` check a step against: a setting not listed here is refused with `UNKNOWN_SETTING`.\n\nSome settings depend on your organization's plan. One your plan doesn't include is refused with `UNKNOWN_SETTING`.\n\n**Checked when you publish.** A save keeps a step that isn't finished; `POST /v1/templates/{id}/check` and publish name what is still missing:\n- Add the PDF to fill in, or assign someone to upload it when the flow runs.\n- We couldn’t find any fillable boxes on this PDF. Add fields in the editor, or upload a fillable PDF.\n- Some custom fields are missing position info. Draw them on the PDF canvas to fix this.\n- Some fields sit on a page this PDF no longer has. Move them onto a page.\n- A single-select field needs at least two options, each with its own value and a button placed on the PDF.\n\nA template read (`GET /v1/templates/{id}`) returns the step's settings as stored, in `StepConfig_PDF_FORM`.","x-moxo-step-type":"PDF_FORM"},"StepSettings_TIME_BOOKING":{"type":"object","properties":{"visibleToAllAssignees":{"description":"The older form of `visibility.mode: \"ALL\"`. Use `visibility` instead.","type":"boolean"},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"},"booking":{"type":"object","properties":{"providerKind":{"description":"Where free times come from. `calendar` (the default): the host's Google or Outlook calendar, and `availability` can limit the days and hours offered. `manual`: the weekly hours in `availability`, with no connected app. `scheduler`: Zoom Scheduler or Calendly takes the booking.","type":"string","enum":["calendar","scheduler","manual"]},"calendarProvider":{"description":"The calendar the meeting is booked on and free times are read from, on the host's own account: `GOOGLE_CALENDAR` or `OUTLOOK_CALENDAR`. Required to publish, unless `providerKind` is `scheduler` or `manual`.","type":"string","enum":["GOOGLE_CALENDAR","OUTLOOK_CALENDAR"]},"meetingType":{"description":"How the meeting is held: `GOOGLE_MEET`, `TEAMS`, `ZOOM`, `OFFLINE` (in person; put the address in `location`), `PHONE` (a phone call; the booker's number shows on the booked meeting) `MEETING_LINK` (a link you give in `meetingLinkUrl`) or `MOXO_MEET` (a meeting held in Moxo, when the organization has Moxo Meet; the booking writes it and its join link goes on the event). `GOOGLE_MEET` with `GOOGLE_CALENDAR`, or `TEAMS` with `OUTLOOK_CALENDAR`, needs one connected app; `GOOGLE_MEET` with `OUTLOOK_CALENDAR`, `TEAMS` with `GOOGLE_CALENDAR`, and `ZOOM` with either calendar need the host to have both connected. `OFFLINE`, `PHONE`, `MEETING_LINK` and `MOXO_MEET` need no video app. Required to publish, unless `providerKind` is `scheduler`.","type":"string","enum":["GOOGLE_MEET","TEAMS","ZOOM","OFFLINE","PHONE","MEETING_LINK","MOXO_MEET"]},"alsoOffer":{"description":"Lets the person booking choose how to meet. `meetingType` is the way selected first; `alsoOffer` is the other one. One of the two is `OFFLINE` (in person) and the other a remote meeting app: `MOXO_MEET`, `TEAMS`, `GOOGLE_MEET` or `ZOOM`. The person booking picks in person or remote, never the app. Only with the host's live calendar (`providerKind` `calendar` or absent); never `MEETING_LINK` or `PHONE`.","type":"string","enum":["GOOGLE_MEET","TEAMS","ZOOM","OFFLINE","MOXO_MEET"]},"hostRoleId":{"description":"The first meeting host: a role's name, its id, or the `handle` of a role added earlier in the same list. Also send `hostRoleIds`. When the flow starts, someone on your team must hold it. Required to publish, unless `providerKind` is `scheduler`.","type":"string"},"hostRoleIds":{"description":"The meeting hosts, in order. One role stays a single host. Two or more roles, or one specific-user role with two or more people, set `bookWith`.","type":"array","items":{"type":"string"}},"bookWith":{"description":"`any` offers a time any host is free. `all` offers a time every host is free, as one event the first host owns. Leave it out for a single host.","type":"string","enum":["any","all"]},"tieBreak":{"description":"With `bookWith` `any`: `priority` (the default) gives the time to the first free host in order. `balance` gives it to the free host with the fewest meetings.","type":"string","enum":["priority","balance"]},"balanceWindow":{"description":"With `tieBreak` `balance`: `today` (the default) or `week`, Monday through Sunday in that host's time zone.","type":"string","enum":["today","week"]},"hostPriorityUserIds":{"description":"The order of the saved people when one specific-user role is the only host and `tieBreak` is `priority`.","type":"array","items":{"type":"string"}},"duration":{"description":"How long the meeting is, in minutes: a whole number from 15 to 480, in steps of 5. 30 is the default. 90 is an hour and a half.","type":"integer","minimum":15,"maximum":480,"multipleOf":5},"startIntervalMinutes":{"description":"How far apart the times a person can book start: 15, 30 or 60 minutes. Leave it out and a new time starts as often as the meeting is long. A chosen spacing lines starts up to the clock the hours are written in. Hours that open at 9:10 with every 15 minutes offer 9:15 first. A spacing longer than the meeting leaves a gap. For a calendar or for hours you set. Zoom Scheduler and Calendly do not use it.","anyOf":[{"type":"number","const":15},{"type":"number","const":30},{"type":"number","const":60}]},"timeDisplay":{"description":"The clock on the booking page: `auto` (the default) follows the booker's browser, `hour12` shows am and pm, and `hour24` shows 00 to 23. Changes only how times are shown.","type":"string","enum":["auto","hour12","hour24"]},"bookingBufferDays":{"description":"The fewest days from today before a time can be booked: a whole number from 0 (the default, the same day) to 365. With 2, the earliest bookable day is the day after tomorrow. For `calendar` bookings only: leave it out, or 0, with `scheduler`.","type":"integer","minimum":0,"maximum":365},"meetingTitle":{"description":"The meeting's title, on the calendar event and the booker's invite. Can include references to flow values.","type":"string"},"agenda":{"description":"What the meeting is about. Can include references to flow values.","type":"string"},"location":{"description":"The address, for an in-person meeting (`meetingType` `OFFLINE`). It goes on the calendar event and the booked meeting. Can include references to flow values.","type":"string"},"pickPlaceAtBooking":{"description":"`true` lets a team member booking their own action pick an office and a meeting room from the organization's Microsoft 365, or type another place. Only with `calendarProvider` `OUTLOOK_CALENDAR` and `meetingType` `OFFLINE`. A client booking the same step gets `location`.","type":"boolean"},"bookerCanCancel":{"description":"`true` lets the host and an internal user who booked cancel the meeting before it starts. The flow's managers can always cancel it. Not with `providerKind` `scheduler`.","type":"boolean"},"bookerCanReschedule":{"description":"`true` lets the host and an internal user who booked move the meeting to another free time before it starts. The flow's managers can always reschedule it. Not with `providerKind` `scheduler`.","type":"boolean"},"onMeetingCanceled":{"description":"What canceling the meeting does to the flow: `continue` (the default) leaves it running, `end_flow` cancels it. Not with `providerKind` `scheduler`.","type":"string","enum":["continue","end_flow"]},"meetingLinkUrl":{"description":"Required with `MEETING_LINK`: a full `https` address, or a reference to a flow value that gives one, such as a link an API call step returned.","type":"string"},"meetingLinkAudience":{"description":"With `MEETING_LINK`: who sees the link. `booker_only` (the default), or `everyone_invited` for a shared link every invitee may open.","type":"string","enum":["everyone_invited","booker_only"]},"meetingLinkHostNote":{"description":"With `MEETING_LINK`: a note for the host and their colleagues, hidden from the booker, up to 2000 characters. Can include references to flow values.","type":"string"},"participants":{"description":"More people in the meeting besides the booker: `{ \"type\": \"ROLE\", \"roleId\" }` for a role (its name, its id, or the `handle` of a role added earlier in the same list), `{ \"type\": \"CONTACT\", \"contactId\" }` for an external user, or `{ \"type\": \"USER\", \"userId\" }` for someone on your team.","type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["ROLE","CONTACT","USER"],"description":"`ROLE` (whoever holds a role), `CONTACT` (an external user) or `USER` (someone on your team)."},"roleId":{"type":"string","description":"For `ROLE`: the role, by its name, its id, or the `handle` of a role added earlier in the same list."},"contactId":{"type":"string","description":"For `CONTACT`: the external user's id."},"userId":{"type":"string","description":"For `USER`: the person's user id."},"email":{"type":"string","description":"The person's email."}},"required":["type"]}},"availability":{"description":"The days and hours people can book, in `timezone`. Required with `providerKind` `manual`. With `calendar` it is optional, and limits the hours offered (set `bookableHours` to `true`); without it, 9:00 to 17:00 every day in the booker's time zone is offered. Not used with `scheduler`.","type":"object","properties":{"timezone":{"type":"string","description":"The IANA time zone the weekly hours are in, such as `America/Los_Angeles`, or `host` for the host's own time zone."},"bookableHours":{"description":"Set to `true` for these hours to limit a `calendar` booking. Without it, they aren't applied.","type":"boolean","const":true},"weeklyWindows":{"minItems":1,"type":"array","items":{"type":"object","properties":{"dayOfWeek":{"type":"integer","minimum":0,"maximum":6,"description":"The day: `0` is Sunday and `6` is Saturday."},"start":{"type":"string","description":"The local start time, as `HH:mm`."},"end":{"type":"string","description":"The local end time, as `HH:mm`, after `start`."}},"required":["dayOfWeek","start","end"]},"description":"The hours offered each week, each `{ dayOfWeek, start, end }`."},"dateOverrides":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"The day, as `YYYY-MM-DD`."},"blocked":{"type":"boolean","description":"Whether the day can't be booked at all."},"windows":{"type":"array","items":{"type":"object","properties":{"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$","description":"When the hours start, as `HH:MM`."},"end":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$","description":"When the hours end, as `HH:MM`."}},"required":["start","end"]},"description":"The hours that can be booked that day."}},"required":["date"]},"description":"Days whose hours differ from the weekly hours."}},"required":["timezone","weeklyWindows"]},"extraReminder":{"type":"object","properties":{"enabled":{"type":"boolean","description":"Whether the extra reminder is sent. Defaults to `false`."},"hoursBefore":{"type":"integer","minimum":1,"maximum":24,"description":"How many hours before the meeting the extra reminder goes: a whole number from 1 to 24. Defaults to 24."},"recipients":{"type":"object","properties":{"booker":{"type":"boolean","description":"Whether the person who books the meeting gets it. Defaults to `false`."},"additionalParticipants":{"type":"boolean","description":"Whether the step's additional participants get it. Defaults to `true`."}},"description":"Who gets the extra reminder. The host never does. With `enabled` `true`, pick at least one, or publishing is refused."}},"description":"One more reminder before the meeting, on top of the reminder always sent 10 minutes before. Leave it out for none. Only with the meeting reminders beta on for your organization, and not with `providerKind` `scheduler`."},"offeredBranchIds":{"maxItems":500,"type":"array","items":{"type":"string","minLength":1,"maxLength":256},"description":"On a Time Booking action sent from a conversation: the Microsoft 365 room lists (branches), by id, a person choosing to meet in person may pick from. Leave it out to offer every branch. Ignored on a template: a flow started from a template always offers every branch."},"schedulerProvider":{"type":"string","enum":["zoom","calendly"],"description":"With `providerKind` `scheduler`: the scheduling app, `zoom` or `calendly`."},"connectionId":{"type":"string","description":"With `providerKind` `scheduler`: the host's account in that app, by its id or name."},"scheduleId":{"type":"string","description":"With `providerKind` `scheduler`: the schedule or event type in that app the person books."},"scheduleName":{"type":"string","description":"The schedule's name, as shown on the step."},"durationMinutes":{"type":"number","description":"How long the meeting is, in minutes, as shown on the step."},"meetingPurpose":{"type":"string","description":"A short note on what the meeting is for, passed on to the scheduling app. Can include flow values."}},"description":"The meeting the assignee books with the host."}},"required":["assignees"],"title":"Time Booking settings","description":"The settings a `TIME_BOOKING` step is sent with, beside the shared ones in `StepSettings`. This is the schema `POST /v1/templates` and `POST /v1/templates/{id}/changes` check a step against: a setting not listed here is refused with `UNKNOWN_SETTING`.\n\nSome settings depend on your organization's plan. One your plan doesn't include is refused with `UNKNOWN_SETTING`.\n\n**Checked when you publish.** A save keeps a step that isn't finished; `POST /v1/templates/{id}/check` and publish name what is still missing:\n- Pick the role that hosts the meeting — when the flow starts it must be assigned to an internal team member (external participants cannot host a meeting on their own calendar).\n- Choose which calendar this meeting books against (for example Google Calendar or Outlook) before publishing.\n- Choose how this meeting is held (for example Google Meet, Microsoft Teams, or in person) before publishing.\n- Choose the time zone for the hours you offer.\n- Add at least one weekly window so people can pick a time.\n- Connect the scheduling account this step books on.\n- Choose the booking type this step offers before publishing.\n- Choose a scheduling provider before publishing.\n- Set the booking buffer to a whole number of days between 0 and 365.\n- Enter 15 to 480 minutes, in steps of 5.\n- Booking buffer is only supported for calendar bookings, not scheduler bookings.\n\nA template read (`GET /v1/templates/{id}`) returns the step's settings as stored, in `StepConfig_TIME_BOOKING`.","x-moxo-step-type":"TIME_BOOKING"},"StepSettings_SINGLE_CHOICE_BRANCH":{"type":"object","properties":{"visibleToAllAssignees":{"description":"The older form of `visibility.mode: \"ALL\"`. Use `visibility` instead.","type":"boolean"},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"}},"required":["paths"],"title":"Single Choice Branch (If/Else) settings","description":"The settings a `SINGLE_CHOICE_BRANCH` step is sent with, beside the shared ones in `StepSettings`. This is the schema `POST /v1/templates` and `POST /v1/templates/{id}/changes` check a step against: a setting not listed here is refused with `UNKNOWN_SETTING`.\n\nSome settings depend on your organization's plan. One your plan doesn't include is refused with `UNKNOWN_SETTING`.\n\n**Checked when you publish.** A save keeps a step that isn't finished; `POST /v1/templates/{id}/check` and publish name what is still missing:\n- Branch requires at least 2 paths.\n- Add a default “otherwise” path so the flow always has somewhere to go when no condition matches.\n\nA template read (`GET /v1/templates/{id}`) returns the step's settings as stored, in `StepConfig_SINGLE_CHOICE_BRANCH`.","x-moxo-step-type":"SINGLE_CHOICE_BRANCH"},"StepSettings_MULTI_CHOICE_BRANCH":{"type":"object","properties":{"visibleToAllAssignees":{"description":"The older form of `visibility.mode: \"ALL\"`. Use `visibility` instead.","type":"boolean"},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"}},"required":["paths"],"title":"Multi Choice Branch settings","description":"The settings a `MULTI_CHOICE_BRANCH` step is sent with, beside the shared ones in `StepSettings`. This is the schema `POST /v1/templates` and `POST /v1/templates/{id}/changes` check a step against: a setting not listed here is refused with `UNKNOWN_SETTING`.\n\nSome settings depend on your organization's plan. One your plan doesn't include is refused with `UNKNOWN_SETTING`.\n\n**Checked when you publish.** A save keeps a step that isn't finished; `POST /v1/templates/{id}/check` and publish name what is still missing:\n- Branch requires at least 2 paths.\n\nA template read (`GET /v1/templates/{id}`) returns the step's settings as stored, in `StepConfig_MULTI_CHOICE_BRANCH`.","x-moxo-step-type":"MULTI_CHOICE_BRANCH"},"StepSettings_PARALLEL_BRANCH":{"type":"object","properties":{"visibleToAllAssignees":{"description":"The older form of `visibility.mode: \"ALL\"`. Use `visibility` instead.","type":"boolean"},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"}},"required":["paths"],"title":"Parallel Branch settings","description":"The settings a `PARALLEL_BRANCH` step is sent with, beside the shared ones in `StepSettings`. This is the schema `POST /v1/templates` and `POST /v1/templates/{id}/changes` check a step against: a setting not listed here is refused with `UNKNOWN_SETTING`.\n\nSome settings depend on your organization's plan. One your plan doesn't include is refused with `UNKNOWN_SETTING`.\n\n**Checked when you publish.** A save keeps a step that isn't finished; `POST /v1/templates/{id}/check` and publish name what is still missing:\n- Parallel branch requires at least 2 paths.\n\nA template read (`GET /v1/templates/{id}`) returns the step's settings as stored, in `StepConfig_PARALLEL_BRANCH`.","x-moxo-step-type":"PARALLEL_BRANCH"},"StepSettings_JUMP":{"type":"object","properties":{"targetStepId":{"description":"The step to go to, by its id. Send this or `targetHandle`.","type":"string"},"preserveData":{"description":"When `true`, the target step's previous answers are kept as a draft, so the assignee edits them instead of starting again. Defaults to `false`: a clean start.","type":"boolean"},"visibleToAllAssignees":{"description":"The older form of `visibility.mode: \"ALL\"`. Use `visibility` instead.","type":"boolean"},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"},"targetHandle":{"description":"The step to go to: the `handle` of an earlier step to loop back to, or of a later step on the main path to skip ahead to. A jump inside a parallel path, a loop or a multi-choice path goes only to an earlier step of that same path. Never a step in another path.","type":"string"}},"title":"Jump settings","description":"The settings a `JUMP` step is sent with, beside the shared ones in `StepSettings`. This is the schema `POST /v1/templates` and `POST /v1/templates/{id}/changes` check a step against: a setting not listed here is refused with `UNKNOWN_SETTING`.\n\nSome settings depend on your organization's plan. One your plan doesn't include is refused with `UNKNOWN_SETTING`.\n\n**Where it goes.** A `JUMP` step goes inside a path, an outcome or a branch of a `DECISION`, `SINGLE_CHOICE_BRANCH` or `APPROVAL` step: add it with `parentStepId` and the `pathId` or `outcomeId` of that place. Anywhere else, the change is refused.\n\n**Checked when you publish.** A save keeps a step that isn't finished; `POST /v1/templates/{id}/check` and publish name what is still missing:\n- Jump has no target step.\n\nA template read (`GET /v1/templates/{id}`) returns the step's settings as stored, in `StepConfig_JUMP`.","x-moxo-step-type":"JUMP"},"StepSettings_TERMINATE":{"type":"object","properties":{"terminateStatus":{"description":"How the flow ends: `COMPLETED`, or `CANCELLED` (the default).","type":"string","enum":["COMPLETED","CANCELLED"]},"terminateReason":{"description":"A short reason shown when the flow ends. It can include references to flow values.","type":"string"},"visibleToAllAssignees":{"description":"The older form of `visibility.mode: \"ALL\"`. Use `visibility` instead.","type":"boolean"},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"}},"title":"Terminate settings","description":"The settings a `TERMINATE` step is sent with, beside the shared ones in `StepSettings`. This is the schema `POST /v1/templates` and `POST /v1/templates/{id}/changes` check a step against: a setting not listed here is refused with `UNKNOWN_SETTING`.\n\nSome settings depend on your organization's plan. One your plan doesn't include is refused with `UNKNOWN_SETTING`.\n\nA template read (`GET /v1/templates/{id}`) returns the step's settings as stored, in `StepConfig_TERMINATE`.","x-moxo-step-type":"TERMINATE"},"StepSettings_WAIT":{"type":"object","properties":{"visibleToAllAssignees":{"description":"The older form of `visibility.mode: \"ALL\"`. Use `visibility` instead.","type":"boolean"},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"},"waitFor":{"description":"What the step waits for.","type":"object","properties":{"type":{"type":"string","enum":["DURATION","DATE","SUB_FLOW_COMPLETION","EXTERNAL_APP_EVENT","EXTERNAL_TASK","CONDITION_RECHECK","CONNECTED_APP_EVENT","DATA_TABLE_VALUE","MEETING_TRANSCRIPT"],"description":"What the step waits for. `DURATION`: minutes, hours or calendar days (another unit becomes the nearest of those). `DATE`: a date, which can be a flow value. `SUB_FLOW_COMPLETION`: a Sub-flow step to finish. `EXTERNAL_APP_EVENT`: another system to call a link Moxo makes, and Moxo can tell that system. `EXTERNAL_TASK`: your system to pick up a task, for a system Moxo can't call, such as a bank or an internal network; it needs `externalTask.taskName`, `externalTask.inputs` lists the values it receives, and `outputVariables` maps the values it sends back. `CONDITION_RECHECK`: a condition, checked on a schedule, to become true. A wait for a connected app's event is set up in Moxo: when you change one, leave its `waitFor` as it is."},"duration":{"description":"How long to wait. Used when `type` is `DURATION`.","type":"object","properties":{"value":{"type":"number","minimum":1,"description":"How many units to wait, 1 or more."},"unit":{"type":"string","enum":["MINUTES","HOURS","DAYS"],"description":"The unit: `MINUTES`, `HOURS` or `DAYS` (calendar days). Business days and other units are not supported."}},"required":["value","unit"]},"date":{"description":"The date to wait until, used when `type` is `DATE`: an ISO 8601 date, or a reference to a value from earlier in the flow, such as `${{ steps.plan_dates.fields.target_date }}`.","type":"string"},"subFlowStepId":{"description":"The id of the Sub-flow step to wait for. Used when `type` is `SUB_FLOW_COMPLETION`.","type":"string"},"childStepIds":{"description":"Specific steps of the child flow to wait for, by step id. Used when `type` is `SUB_FLOW_COMPLETION`. When empty or left out, the step waits for the whole child flow. When set, it moves on once these steps are completed or skipped, as `completionMode` says.","type":"array","items":{"type":"string"}},"completionMode":{"description":"How many of the steps in `childStepIds` must finish: `ALL`, every listed step, or `ANY`, the first one to finish. Defaults to `ALL`.","type":"string","enum":["ALL","ANY"]},"outputVariables":{"description":"Values to take from what ended the wait and save as this step's outputs, so later steps can use them. Used when `type` is `EXTERNAL_APP_EVENT`, `EXTERNAL_TASK` or `CONNECTED_APP_EVENT`. `key` is the output name later steps read; `ref` is the path to the value in the source: the whole JSON body that was posted for `EXTERNAL_APP_EVENT` (for example `data.analyst.email`), the `values` your system sent when it completed the task for `EXTERNAL_TASK` (for example `verified`), or the connected app's record for `CONNECTED_APP_EVENT` (for example `amount`). `CONNECTED_APP_EVENT` outputs are set up in the step editor in Moxo.","type":"array","items":{"type":"object","properties":{"key":{"type":"string","minLength":1,"description":"The name the value is saved under. Later steps read it as `${{ steps.<this wait step>.fields.<key> }}`. Use a short name such as `analystEmail`. `webhookPayload` and `callbackUrl` are reserved."},"ref":{"type":"string","minLength":1,"description":"Where the value is in the source, as a path. For `EXTERNAL_APP_EVENT` the path starts at the whole posted JSON body; don't skip a `data` wrapper (for example `data.analyst.email`, `status`, `$.data.risk.score`). For `CONNECTED_APP_EVENT` the path uses the app's own field names on the watched record, with no wrapper (for example `amount`, `dealstage`, `Owner.Name`). For `EXTERNAL_TASK` the path uses the names in the `values` your system sent with complete (for example `verified`, `notes`, `result.score`). A list item can be named by index either way: `line_items.0.sku` and `line_items[0].sku` are the same."}},"required":["key","ref"]}},"webhookUrl":{"description":"The URL Moxo posts to when the step starts, used when `type` is `EXTERNAL_APP_EVENT`. The request includes the callback URL that resumes the flow. Can include flow value references.","type":"string"},"webhookHeaders":{"description":"HTTP headers to send with that request, such as `Authorization`. Used when `type` is `EXTERNAL_APP_EVENT`. Optional. Values can include flow value references.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"externalTask":{"description":"The task your own system picks up, used when `type` is `EXTERNAL_TASK` (shown in Moxo as \"Your system picks up a task\"): the task name your system claims with an organization API key, the values from earlier steps it receives, how long a claim is held and how many tries it gets. Required for `EXTERNAL_TASK`. Moxo never calls your system and creates no callback URL.","type":"object","properties":{"taskName":{"type":"string","description":"The task name your system claims, for example `verify-account`. Letters, numbers and dashes, up to 64 characters. Required."},"inputs":{"description":"The values your system receives, each from an earlier step and each with a key. Only these values are sent; nothing else from the flow is shared.","type":"array","items":{"type":"object","properties":{"key":{"type":"string","description":"The name your system reads this value under, for example `account_id`. Starts with a letter, followed by letters, numbers or underscores."},"value":{"type":"string","description":"Where the value comes from: a reference to an earlier step's answer, such as `${{ steps.enter_account_id.fields.account_id }}`, or a fixed value. Filled in when the task opens."}},"required":["key","value"]}},"lockMinutes":{"description":"How long a claimed task is held for your system before it goes back to the queue, in minutes. 1 to 60. Defaults to 15.","type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"maxTries":{"description":"How many tries your system gets before the step fails. 1 to 10. Defaults to 3. A flow manager can then retry the step.","type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["taskName"]},"condition":{"description":"The condition to wait for, used when `type` is `CONDITION_RECHECK`. It has the same shape as a Business rule step's condition and is checked against the flow's values each time.","type":"object","properties":{},"additionalProperties":{}},"recheckIntervalMinutes":{"description":"How often the condition is checked, in minutes, when `type` is `CONDITION_RECHECK`. 5 to 1440. Defaults to 60.","type":"integer","minimum":5,"maximum":1440},"expectedResolveBy":{"description":"How long the wait is expected to take, used when `type` is `EXTERNAL_APP_EVENT` or `SUB_FLOW_COMPLETION`. Optional. While the step is inside this window, it is not flagged as stalled.","anyOf":[{"type":"object","properties":{"kind":{"type":"string","const":"duration","description":"Set to `duration`."},"value":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991,"description":"For `duration`: how many units, a whole number above 0."},"unit":{"type":"string","enum":["MINUTES","HOURS","DAYS"],"description":"The unit: `MINUTES`, `HOURS` or `DAYS` (calendar days). Business days and other units are not supported."},"dateRef":{"anyOf":[{"type":"string","minLength":1,"description":"A date (ISO 8601) or a reference to a date in the flow, such as `${{ fields.target_date }}`."},{"type":"string","minLength":1}],"description":"For `absolute`: the date, as an ISO date or a reference to a flow value, such as `${{ fields.target_date }}`."}},"required":["kind","value","unit"]},{"type":"object","properties":{"kind":{"type":"string","const":"absolute","description":"Set to `absolute`."},"dateRef":{"type":"string","minLength":1,"description":"For `absolute`: the date, as an ISO date or a reference to a flow value, such as `${{ fields.target_date }}`."},"value":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}],"description":"For `duration`: how many units, a whole number above 0."},"unit":{"anyOf":[{"type":"string","enum":["MINUTES","HOURS","DAYS"]},{"type":"string","enum":["MINUTES","HOURS","DAYS"],"description":"The unit: `MINUTES`, `HOURS` or `DAYS` (calendar days). Business days and other units are not supported."}],"description":"The unit: `MINUTES`, `HOURS` or `DAYS` (calendar days). Business days and other units are not supported."}},"required":["kind","dateRef"]}]},"app":{"type":"string","description":"With `type` `EXTERNAL_APP_EVENT`: the app the event comes from."},"event":{"type":"string","description":"With `type` `EXTERNAL_APP_EVENT`: the event to wait for."},"connectedApp":{"type":"object","properties":{"provider":{"anyOf":[{"type":"string","minLength":1},{"type":"string","minLength":1,"description":"The app, for example `hubspot`."}],"description":"The app, for example `hubspot`."},"connectionId":{"anyOf":[{"type":"string","minLength":1},{"type":"string","minLength":1,"description":"The id of the connected app account the step uses, chosen when the template is built."}],"description":"The id of the connected app account the step uses, chosen when the template is built."},"event":{"anyOf":[{"type":"string","minLength":1},{"type":"string","minLength":1,"description":"The app's event, for example `deal.stage.change`."}],"description":"The app's event, for example `deal.stage.change`."},"recordIdRef":{"anyOf":[{"type":"string","minLength":1},{"type":"string","minLength":1}],"description":"The id of the record to watch: a reference to a value from earlier in the flow, such as `${{ trigger.deal.hs_object_id }}` or `${{ fields.deal_id }}`, or a fixed id. Read once, when the step starts. Not used by events that identify their record in more than one way; those use `recordIdRefs`."},"recordIdRefs":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}],"description":"For events that identify their record in more than one way (for example Sumsub's \"Applicant is flagged\", by `applicantId` or `externalUserId`): one flow value reference or fixed value for each way, at least one filled. They are tried in that order at each check."},"recheckMinutes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}],"description":"How often to check, in minutes, for events that let you choose. For Sumsub: a multiple of 5, from 5 to 1440."},"stopAfterDays":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}],"description":"A time limit in whole days, for events that have one. For Sumsub: 1 to 30. When it passes, the step fails as timed out."},"resource":{"type":"object","properties":{},"additionalProperties":{},"description":"The kind of record to watch, for events that apply to more than one kind. HubSpot's `record.field.changed` needs `{ sobject: 'deals' | 'tickets' | 'companies' | 'contacts' }`: the record type whose property is watched."},"condition":{"type":"object","properties":{},"additionalProperties":{},"description":"A filter on the watched record's fields. Optional. When empty or left out, the step moves on at any event on the record."},"conditionSummary":{"anyOf":[{"type":"string"},{"type":"string"}],"description":"A readable summary of the condition, such as \"Stage is Closed Won\", using the app's own labels. Shown in Moxo only; it doesn't affect the wait."}},"required":["provider","connectionId","event"],"description":"The connected app record to watch, used when `type` is `CONNECTED_APP_EVENT`: the app, the account, the event, the record and the condition."},"dataTableWait":{"type":"object","properties":{"tableId":{"anyOf":[{"type":"string","minLength":1,"description":"The data table whose row is watched."},{"type":"string","minLength":1,"description":"The data table whose row is watched."}],"description":"The data table whose row is watched."},"rowMatch":{"type":"object","properties":{"match":{"type":"string","enum":["ALL","ANY"],"description":"How the conditions combine: `ALL`, every condition must hold, or `ANY`, at least one must."},"conditions":{"maxItems":25,"type":"array","items":{"$ref":"#/components/schemas/StepSetting_conditionsItem_2"},"description":"The conditions that pick the row: each names a column (`fieldId`, its id, key or name), an operator (`op`) and a value."}},"required":["match","conditions"],"description":"Which row to watch. When several rows match, the earliest created one is used."},"valueMatch":{"type":"object","properties":{"match":{"type":"string","enum":["ALL","ANY"],"description":"How the conditions combine: `ALL`, every condition must hold, or `ANY`, at least one must."},"conditions":{"maxItems":25,"type":"array","items":{"$ref":"#/components/schemas/StepSetting_conditionsItem_2"},"description":"The conditions the row must meet for the wait to end: each names a column (`fieldId`, its id, key or name), an operator (`op`) and a value."}},"required":["match","conditions"],"description":"The condition the row must meet for the wait to end."}},"required":["tableId","rowMatch","valueMatch"],"description":"The data table row to watch and the value that ends the wait, used when `type` is `DATA_TABLE_VALUE`."},"meetingTranscript":{"type":"object","properties":{"timeBookingStepId":{"anyOf":[{"type":"string","minLength":1,"description":"The Time Booking step whose current booking this wait follows."},{"type":"string","minLength":1,"description":"The Time Booking step whose current booking this wait follows."}],"description":"The Time Booking step whose current booking this wait follows."},"recorders":{"type":"array","items":{"anyOf":[{"type":"string","enum":["google_meet","fathom","granola","moxo"]},{"type":"string","enum":["google_meet","fathom","granola","moxo"]}]},"description":"Which of the host's recordings to read: `google_meet`, `fathom`, `granola` or `moxo`. Google Calendar and Outlook are calendars, not recordings. At least one."},"noTranscript":{"type":"object","properties":{"value":{"anyOf":[{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"How long after the meeting ends before that action, as a whole number of 1 or more."},{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"How long after the meeting ends before that action, as a whole number of 1 or more."}],"description":"How long after the meeting ends before that action, as a whole number of 1 or more."},"unit":{"anyOf":[{"type":"string","enum":["MINUTES","HOURS","DAYS"],"description":"The unit: `MINUTES`, `HOURS` or `DAYS`."},{"type":"string","enum":["MINUTES","HOURS","DAYS"],"description":"The unit: `MINUTES`, `HOURS` or `DAYS`."}],"description":"The unit: `MINUTES`, `HOURS` or `DAYS`."},"action":{"anyOf":[{"type":"string","enum":["KEEP_WAITING","COMPLETE"],"description":"What to do when no transcript arrives in time. `KEEP_WAITING` tells the flow manager and the step stays open. `COMPLETE` ends the wait and its outputs are empty."},{"type":"string","enum":["KEEP_WAITING","COMPLETE"],"description":"What to do when no transcript arrives in time. `KEEP_WAITING` tells the flow manager and the step stays open. `COMPLETE` ends the wait and its outputs are empty."}],"description":"What to do when no transcript arrives in time. `KEEP_WAITING` tells the flow manager and the step stays open. `COMPLETE` ends the wait and its outputs are empty."}},"required":["value","unit","action"],"description":"How long to wait after the meeting ends, and whether to keep waiting or complete the step."}},"required":["timeBookingStepId","recorders","noTranscript"],"description":"The Time Booking step this wait follows, which of the host's recordings to read, and what happens when no transcript arrives. Used when `type` is `MEETING_TRANSCRIPT`."}},"required":["type"]},"notifications":{"description":"Emails the people in some roles while the Wait waits: when it starts, on a repeat, and before it ends. Off, or left out, sends nothing.","type":"object","properties":{"enabled":{"type":"boolean","description":"Whether the Wait sends these emails."},"roleIds":{"description":"The roles to email, each by its name, its id, or the `handle` of a role added earlier in the same list.","type":"array","items":{"type":"string"}},"subject":{"type":"string","description":"The email's subject. It can include values from earlier in the flow."},"body":{"type":"string","description":"The email's message. It can include values from earlier in the flow, but never the Wait's callback link."},"onStart":{"type":"boolean","description":"Send one when the Wait starts."},"repeat":{"anyOf":[{"type":"object","properties":{"every":{"type":"number","description":"How many hours or days between emails, 1 or more."},"unit":{"type":"string","enum":["HOURS","DAYS"],"description":"`HOURS` or `DAYS`."},"upTo":{"type":"number","description":"The most emails the repeat sends, 1 to 10."}},"required":["every","unit","upTo"]},{"type":"null"}],"description":"Send again while the Wait waits, or `null` for no repeat."},"beforeEnd":{"anyOf":[{"type":"object","properties":{"value":{"type":"number","description":"How many hours or days before the end."},"unit":{"type":"string","enum":["HOURS","DAYS"],"description":"`HOURS` or `DAYS`."}},"required":["value","unit"]},{"type":"null"}],"description":"For a Wait that ends at a set time (a length or a date): send one this long before it ends, or `null` for none."}},"required":["enabled"]}},"title":"Wait settings","description":"The settings a `WAIT` step is sent with, beside the shared ones in `StepSettings`. This is the schema `POST /v1/templates` and `POST /v1/templates/{id}/changes` check a step against: a setting not listed here is refused with `UNKNOWN_SETTING`.\n\nSome settings depend on your organization's plan. One your plan doesn't include is refused with `UNKNOWN_SETTING`.\n\n**Checked when you publish.** A save keeps a step that isn't finished; `POST /v1/templates/{id}/check` and publish name what is still missing:\n- Wait step has no wait type configured.\n- Wait for sub-flow needs a sub-flow step selected.\n- Wait for connected app needs a connected account selected.\n- Wait for connected app needs an event selected.\n- Wait for connected app needs the record to watch (e.g. a deal ID reference).\n- Your system picks up a task needs a task name.\n- Wait for a data table value needs a table selected.\n\nA template read (`GET /v1/templates/{id}`) returns the step's settings as stored, in `StepConfig_WAIT`.","x-moxo-step-type":"WAIT"},"StepSettings_FOR_EACH":{"type":"object","properties":{"visibleToAllAssignees":{"description":"The older form of `visibility.mode: \"ALL\"`. Use `visibility` instead.","type":"boolean"},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"},"dataSource":{"description":"Where the items come from, which sets how many times the loop runs.","type":"object","properties":{"type":{"type":"string","enum":["COUNT","LIST","DATA_TABLE","ROLES","SPREADSHEET"],"description":"How the items are found. `COUNT`: repeat a number of times; `count` is a number or a reference to a value from earlier in the flow that holds a number. `LIST`: one item for each entry in a list from an earlier step (a repeating section, a multi-select, uploaded files, an API call or AI list, or a JSON array). `DATA_TABLE`: one item for each record in a data table, optionally filtered. `SPREADSHEET`: one item for each row of an uploaded spreadsheet. `ROLES`: one item for each role, seated with only that role. `scope` is `all` (every role, including internal roles), `addedByStep` (the roles one Add role step made) or `specific` (chosen roles)."},"count":{"description":"How many times to repeat, used when `type` is `COUNT`: a number, or a reference to a number field, such as `${{ fields.entity_count }}` or `${{ steps.entity_form.fields.count }}`.","anyOf":[{"type":"number"},{"type":"string"}]},"stepRef":{"description":"The name of the step that holds the data, such as `Entity List Form`. Used when `type` is `LIST`, and for `COUNT` when its reference names a step.","type":"string"},"stepId":{"description":"The Add role step whose roles this loop repeats, when `scope` is `addedByStep`.","type":"string"},"fieldRef":{"description":"The list to repeat over, used when `type` is `LIST`: a reference to a list field, such as `${{ steps.entity_list_form.fields.entity_list }}`.","type":"string"},"itemsPath":{"description":"For `LIST`: where the list is inside the field, when the field holds an object around it, as a dot path of object keys (no list positions).","type":"string"},"tableId":{"description":"The id of the data table to repeat over, used when `type` is `DATA_TABLE`.","type":"string"},"filter":{"description":"Which records to repeat over, used when `type` is `DATA_TABLE`: `{ match: \"ALL\" | \"ANY\", conditions: [{ fieldId, op, value? }] }`. Optional; leave it out to use every record.","type":"object","properties":{"match":{"type":"string","enum":["ALL","ANY"],"description":"How the conditions combine: `ALL`, every condition must hold, or `ANY`, at least one must."},"conditions":{"maxItems":25,"type":"array","items":{"$ref":"#/components/schemas/StepSetting_conditionsItem_2"},"description":"The conditions, each `{ fieldId, op, value }`: a column, a comparison and the value to compare with."}},"required":["match","conditions"]},"columnTypes":{"description":"Each column's field type, in the same order as columns, used when `type` is `DATA_TABLE`.","type":"array","items":{"type":"string"}},"scope":{"description":"Which roles an Each role loop repeats. `all`: every role in the flow, including internal roles. `addedByStep`: the roles one Add role step made. `specific`: the roles named in `roleIds`.","type":"string","enum":["all","addedByStep","specific"]},"roleIds":{"description":"The roles to repeat, when `scope` is `specific`. A role that was deleted is skipped. The loop runs in the flow's role order.","type":"array","items":{"type":"string"}},"columns":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"object","properties":{"header":{"type":"string","minLength":1,"description":"The column's header in the spreadsheet."},"name":{"type":"string","minLength":1,"description":"The name each item's value goes by in the loop."},"type":{"default":"TEXT","type":"string","enum":["TEXT","NUMBER","DATE","BOOLEAN"],"description":"The type of the column's values."}},"required":["header","name"]}]},"description":"The columns each item carries. For `DATA_TABLE`: column names. For `SPREADSHEET`: `{ header, name, type }` objects."},"fileRef":{"type":"string","minLength":1,"description":"The uploaded spreadsheet, used when `type` is `SPREADSHEET`: a reference to an earlier File request step's files, such as `${{ steps.upload_dec_form.fields.uploaded_files }}`."},"sheetName":{"type":"string","description":"The worksheet to read, by name, used when `type` is `SPREADSHEET`. Leave it out to use the first sheet."},"sheetIndex":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"The worksheet to read, by position (the first is 0), used when `type` is `SPREADSHEET` and `sheetName` is left out."},"dataStartRow":{"default":2,"type":"integer","minimum":1,"maximum":9007199254740991,"description":"The first row to repeat over, counting from 1, used when `type` is `SPREADSHEET`. Rows above it are skipped. Defaults to 2."},"headerRow":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"The row that holds the column headers, counting from 1, used when `type` is `SPREADSHEET`. Optional. Defaults to the row directly above `dataStartRow`; set it only when the headers and the data are not next to each other."}},"required":["type"]},"steps":{"description":"Always `[]` here. Add the steps to repeat with `add_step`, with `pathId: \"forEach\"` and `parentStepId` set to this step. They run once for each item.","maxItems":0,"type":"array","items":{"type":"object","properties":{},"additionalProperties":{}}},"executionMode":{"description":"How the items run: `PARALLEL`, all at once (the default), or `SEQUENTIAL`, one at a time, in order.","type":"string","enum":["PARALLEL","SEQUENTIAL"]},"iterationLabel":{"description":"The name each item shows: plain text, such as `Entity`, or a reference to the item's data, such as `${{ current.item.fieldName }}`.","type":"string"},"maxIterations":{"description":"The most items the loop runs. Defaults to 50; up to 400.","type":"number"},"iterationStaggerSeconds":{"description":"Seconds between the start of each item in `PARALLEL` mode, so item `i` starts at `i` times this value instead of all at once. Use it when the repeated steps call another system with a rate limit. Up to 300. Defaults to 0: every item starts at once. Ignored in `SEQUENTIAL` mode.","type":"number"},"syncStepsAcrossIterations":{"description":"When `true`, every item finishes a step before any item starts the next one. Defaults to `false`: each item moves through the steps on its own. Applies in both modes; while it is on, `iterationStaggerSeconds` is ignored, so notifications for a step people work on go out together.","type":"boolean"}},"title":"For Each (Loop) settings","description":"The settings a `FOR_EACH` step is sent with, beside the shared ones in `StepSettings`. This is the schema `POST /v1/templates` and `POST /v1/templates/{id}/changes` check a step against: a setting not listed here is refused with `UNKNOWN_SETTING`.\n\nSome settings depend on your organization's plan. One your plan doesn't include is refused with `UNKNOWN_SETTING`.\n\n**Checked when you publish.** A save keeps a step that isn't finished; `POST /v1/templates/{id}/check` and publish name what is still missing:\n- Add at least one step inside the loop.\n- Choose the list this loop should repeat over.\n\nA template read (`GET /v1/templates/{id}`) returns the step's settings as stored, in `StepConfig_FOR_EACH`.","x-moxo-step-type":"FOR_EACH"},"StepSettings_REPEAT_WHILE":{"type":"object","properties":{"visibleToAllAssignees":{"description":"The older form of `visibility.mode: \"ALL\"`. Use `visibility` instead.","type":"boolean"},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"},"steps":{"description":"Always `[]` here. Add the steps to repeat with `add_step`, with `pathId: \"forEach\"` and `parentStepId` set to this step. They run once each round, and the first round always runs.","maxItems":0,"type":"array","items":{"type":"object","properties":{},"additionalProperties":{}}},"conditions":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["EQUALS","NOT_EQUALS","CONTAINS","NOT_CONTAINS","ARRAY_CONTAINS","GREATER_THAN","LESS_THAN","GREATER_THAN_OR_EQUAL","LESS_THAN_OR_EQUAL","STARTS_WITH","ENDS_WITH","IS_EMPTY","NOT_EMPTY","IN","NOT_IN"],"description":"The comparison, such as `EQUALS`, `CONTAINS` or `IS_EMPTY`."},"left":{"description":"What to check: a reference to a flow value, such as `${{ steps.review.fields.decision }}`, or a fixed value. For `IS_EMPTY` and `NOT_EMPTY`, the only value. Not the current round's item: to cap the rounds, set `maxIterations`.","anyOf":[{"type":"string"},{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"literal","description":"Set to `literal`."},"expectedType":{"type":"string","description":"The type the value has, such as `TEXT`, `NUMBER`, `DATE`, `BOOLEAN` or `FILE`. An output read across a loop's rounds is a list, such as `LIST<TEXT>`."},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}],"description":"A fixed value. Its JSON type follows `expectedType`: a number for `NUMBER`, a boolean for `BOOLEAN` and text for everything else."}},"required":["kind","expectedType","value"]},{"$ref":"#/components/schemas/StepSetting_ref_2"},{"$ref":"#/components/schemas/StepSetting_ref_5"},{"type":"object","properties":{"kind":{"type":"string","const":"flow-input","description":"Set to `flow-input`."},"expectedType":{"type":"string","description":"The type the value has, such as `TEXT`, `NUMBER`, `DATE`, `BOOLEAN` or `FILE`. An output read across a loop's rounds is a list, such as `LIST<TEXT>`."},"inputId":{"type":"string","description":"The `key` of a flow field asked for when the flow starts, for example `client_name`. Not an id. Read from the start form's values."}},"required":["kind","expectedType","inputId"]},{"type":"object","properties":{"kind":{"type":"string","const":"custom-field","description":"Set to `custom-field`."},"expectedType":{"type":"string","description":"The type the value has, such as `TEXT`, `NUMBER`, `DATE`, `BOOLEAN` or `FILE`. An output read across a loop's rounds is a list, such as `LIST<TEXT>`."},"fieldId":{"type":"string","description":"For `custom-field`: the custom user field's id."}},"required":["kind","expectedType","fieldId"]},{"type":"object","properties":{"kind":{"type":"string","const":"organization","description":"Set to `organization`."},"expectedType":{"type":"string","const":"TEXT","description":"Set to `TEXT`."},"attribute":{"type":"string","enum":["name","id"],"description":"For `organization`: `name` or `id`. For `flow-metadata`: the flow's `duedate`, `startdate`, `name` or `id`."}},"required":["kind","expectedType","attribute"]},{"type":"object","properties":{"kind":{"type":"string","const":"flow-metadata","description":"Set to `flow-metadata`."},"expectedType":{"type":"string","description":"The type the value has, such as `TEXT`, `NUMBER`, `DATE`, `BOOLEAN` or `FILE`. An output read across a loop's rounds is a list, such as `LIST<TEXT>`."},"attribute":{"type":"string","enum":["duedate","startdate","name","id"],"description":"For `organization`: `name` or `id`. For `flow-metadata`: the flow's `duedate`, `startdate`, `name` or `id`."}},"required":["kind","expectedType","attribute"]},{"$ref":"#/components/schemas/StepSetting_ref_3"},{"$ref":"#/components/schemas/StepSetting_ref"}]}]},"right":{"description":"What to compare with: a reference to a flow value, or a fixed value. Required for comparisons such as `EQUALS`, `NOT_EQUALS` and `CONTAINS`; leave it out for `IS_EMPTY` and `NOT_EMPTY`.","anyOf":[{"type":"string"},{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"literal","description":"Set to `literal`."},"expectedType":{"type":"string","description":"The type the value has, such as `TEXT`, `NUMBER`, `DATE`, `BOOLEAN` or `FILE`. An output read across a loop's rounds is a list, such as `LIST<TEXT>`."},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}],"description":"A fixed value. Its JSON type follows `expectedType`: a number for `NUMBER`, a boolean for `BOOLEAN` and text for everything else."}},"required":["kind","expectedType","value"]},{"$ref":"#/components/schemas/StepSetting_ref_2"},{"$ref":"#/components/schemas/StepSetting_ref_5"},{"type":"object","properties":{"kind":{"type":"string","const":"flow-input","description":"Set to `flow-input`."},"expectedType":{"type":"string","description":"The type the value has, such as `TEXT`, `NUMBER`, `DATE`, `BOOLEAN` or `FILE`. An output read across a loop's rounds is a list, such as `LIST<TEXT>`."},"inputId":{"type":"string","description":"The `key` of a flow field asked for when the flow starts, for example `client_name`. Not an id. Read from the start form's values."}},"required":["kind","expectedType","inputId"]},{"type":"object","properties":{"kind":{"type":"string","const":"custom-field","description":"Set to `custom-field`."},"expectedType":{"type":"string","description":"The type the value has, such as `TEXT`, `NUMBER`, `DATE`, `BOOLEAN` or `FILE`. An output read across a loop's rounds is a list, such as `LIST<TEXT>`."},"fieldId":{"type":"string","description":"For `custom-field`: the custom user field's id."}},"required":["kind","expectedType","fieldId"]},{"type":"object","properties":{"kind":{"type":"string","const":"organization","description":"Set to `organization`."},"expectedType":{"type":"string","const":"TEXT","description":"Set to `TEXT`."},"attribute":{"type":"string","enum":["name","id"],"description":"For `organization`: `name` or `id`. For `flow-metadata`: the flow's `duedate`, `startdate`, `name` or `id`."}},"required":["kind","expectedType","attribute"]},{"type":"object","properties":{"kind":{"type":"string","const":"flow-metadata","description":"Set to `flow-metadata`."},"expectedType":{"type":"string","description":"The type the value has, such as `TEXT`, `NUMBER`, `DATE`, `BOOLEAN` or `FILE`. An output read across a loop's rounds is a list, such as `LIST<TEXT>`."},"attribute":{"type":"string","enum":["duedate","startdate","name","id"],"description":"For `organization`: `name` or `id`. For `flow-metadata`: the flow's `duedate`, `startdate`, `name` or `id`."}},"required":["kind","expectedType","attribute"]},{"$ref":"#/components/schemas/StepSetting_ref_3"},{"$ref":"#/components/schemas/StepSetting_ref"}]}]}},"required":["type"]},"description":"Checked after each round: while they hold, another round starts. They can read flow fields, steps before the loop and steps inside it (their answer in the round just finished), such as repeat while `${{ steps.review.fields.decision }}` equals `Changes needed`."},"conditionLogic":{"description":"How `conditions` combine: `ALL`, every condition must hold (the default), or `ANY`, one is enough.","type":"string","enum":["ALL","ANY"]},"maxIterations":{"description":"The most rounds the loop runs: 50 by default, up to 400. Set it lower when the process has its own limit, such as at most 3 revisions.","type":"integer","minimum":1,"maximum":400}},"title":"Repeat while settings","description":"The settings a `REPEAT_WHILE` step is sent with, beside the shared ones in `StepSettings`. This is the schema `POST /v1/templates` and `POST /v1/templates/{id}/changes` check a step against: a setting not listed here is refused with `UNKNOWN_SETTING`.\n\nSome settings depend on your organization's plan. One your plan doesn't include is refused with `UNKNOWN_SETTING`.\n\n**Checked when you publish.** A save keeps a step that isn't finished; `POST /v1/templates/{id}/check` and publish name what is still missing:\n- Add at least one step to repeat.\n- Choose when to repeat.\n\nA template read (`GET /v1/templates/{id}`) returns the step's settings as stored, in `StepConfig_REPEAT_WHILE`.","x-moxo-step-type":"REPEAT_WHILE"},"StepSettings_SUB_FLOW":{"type":"object","properties":{"visibleToAllAssignees":{"description":"The older form of `visibility.mode: \"ALL\"`. Use `visibility` instead.","type":"boolean"},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"},"subFlow":{"description":"The settings of a Sub-flow step, which starts a child flow.","type":"object","properties":{"flowTemplateId":{"description":"The id of the template the child flow starts from.","type":"string"},"flowTemplateVersionId":{"description":"Read-only. The child template's published version, fixed when this template is published.","type":"string"},"flowNameTemplate":{"description":"Text that names the child flow, which can include flow value references, for example `Site validation: ${{ current.item.name }}` inside a loop. When empty, the child template's own naming rule is used, then its name.","type":"string","maxLength":200},"assigneeMappings":{"description":"Which of the child flow's roles each role of this flow fills, by `roleId`.","type":"array","items":{"type":"object","properties":{"parentRoleId":{"type":"string","description":"The role in this flow whose person fills the child flow's role: its name, its id, or the `handle` of a role added earlier in the same list."},"childRoleId":{"type":"string","description":"The `roleId` of the role in the child template that this flow's role fills."},"currentItem":{"type":"object","properties":{"emailColumn":{"description":"The label of the loop column that holds the person's email.","type":"string"},"emailColumnId":{"description":"The id of that column, so renaming the column doesn't break the mapping.","type":"string"}},"description":"Inside a For each loop: fills the child role with the person in the current row, by the email column."}},"required":["parentRoleId","childRoleId"]}},"inputMappings":{"description":"Values from this flow passed into the child flow's start fields.","type":"array","items":{"type":"object","properties":{"parentRef":{"anyOf":[{"type":"string","description":"A reference to a value in this flow, for example `${{ fields.client_name }}` or `${{ steps.address_form.fields.country }}`."},{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"literal","description":"Set to `literal`."},"expectedType":{"type":"string","description":"The type the value has, such as `TEXT`, `NUMBER`, `DATE`, `BOOLEAN` or `FILE`. An output read across a loop's rounds is a list, such as `LIST<TEXT>`."},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}],"description":"A fixed value. Its JSON type follows `expectedType`: a number for `NUMBER`, a boolean for `BOOLEAN` and text for everything else."}},"required":["kind","expectedType","value"]},{"$ref":"#/components/schemas/StepSetting_ref_2"},{"$ref":"#/components/schemas/StepSetting_ref_5"},{"type":"object","properties":{"kind":{"type":"string","const":"flow-input","description":"Set to `flow-input`."},"expectedType":{"type":"string","description":"The type the value has, such as `TEXT`, `NUMBER`, `DATE`, `BOOLEAN` or `FILE`. An output read across a loop's rounds is a list, such as `LIST<TEXT>`."},"inputId":{"type":"string","description":"The `key` of a flow field asked for when the flow starts, for example `client_name`. Not an id. Read from the start form's values."}},"required":["kind","expectedType","inputId"]},{"type":"object","properties":{"kind":{"type":"string","const":"custom-field","description":"Set to `custom-field`."},"expectedType":{"type":"string","description":"The type the value has, such as `TEXT`, `NUMBER`, `DATE`, `BOOLEAN` or `FILE`. An output read across a loop's rounds is a list, such as `LIST<TEXT>`."},"fieldId":{"type":"string","description":"For `custom-field`: the custom user field's id."}},"required":["kind","expectedType","fieldId"]},{"type":"object","properties":{"kind":{"type":"string","const":"organization","description":"Set to `organization`."},"expectedType":{"type":"string","const":"TEXT","description":"Set to `TEXT`."},"attribute":{"type":"string","enum":["name","id"],"description":"For `organization`: `name` or `id`. For `flow-metadata`: the flow's `duedate`, `startdate`, `name` or `id`."}},"required":["kind","expectedType","attribute"]},{"type":"object","properties":{"kind":{"type":"string","const":"flow-metadata","description":"Set to `flow-metadata`."},"expectedType":{"type":"string","description":"The type the value has, such as `TEXT`, `NUMBER`, `DATE`, `BOOLEAN` or `FILE`. An output read across a loop's rounds is a list, such as `LIST<TEXT>`."},"attribute":{"type":"string","enum":["duedate","startdate","name","id"],"description":"For `organization`: `name` or `id`. For `flow-metadata`: the flow's `duedate`, `startdate`, `name` or `id`."}},"required":["kind","expectedType","attribute"]},{"$ref":"#/components/schemas/StepSetting_ref_3"},{"$ref":"#/components/schemas/StepSetting_ref"}]}],"description":"A reference to a value in this flow, preferably as a structured reference. A text reference is also accepted and is converted the next time the template is saved."},"subFlowField":{"type":"string","description":"The start field key on the child template that receives the value."}},"required":["parentRef","subFlowField"]}},"outputMappings":{"description":"Values from the finished child flow saved on this step's outputs, for later steps to use.","type":"array","items":{"type":"object","properties":{"subFlowOutputRef":{"type":"string","description":"A reference to one of the child flow's outputs, written `StepName / FieldName` without braces."},"parentOutputKey":{"type":"string","description":"The key the value is saved under on this step's outputs. Later steps read it as `${{ steps.<sub-flow step>.fields.<parentOutputKey> }}`."}},"required":["subFlowOutputRef","parentOutputKey"]}},"variableMappings":{"description":"Replaced by `inputMappings` and `outputMappings`; use those instead.","type":"array","items":{"type":"object","properties":{"parentKey":{"type":"string","description":"Replaced by `inputMappings` and `outputMappings`; use those instead."},"childKey":{"type":"string","description":"Replaced by `inputMappings` and `outputMappings`; use those instead."}},"required":["parentKey","childKey"]}},"waitForCompletion":{"description":"Replaced by `continuation.mode`, and still accepted: `false` means the step finishes as soon as the child flow starts, and it wins over `continuation.mode`.","type":"boolean"},"continuation":{"description":"When this Sub-flow step counts as complete.","type":"object","properties":{"mode":{"description":"When this step moves on. `child_flow_complete` (the default): when the whole child flow finishes. `specific_child_steps`: as soon as the steps in `childStepIds` finish, per `completionMode`, for when this flow needs data only from the first few child steps. `child_flow_started`: as soon as the child flow starts, without waiting. The child keeps running on its own and its `outputMappings` still arrive on this step later, so later steps that read them may run first; add a Wait with type `SUB_FLOW_COMPLETION` to wait for them.","type":"string","enum":["child_flow_complete","specific_child_steps","child_flow_started"]},"childStepIds":{"description":"With `specific_child_steps`, the child flow's step ids that must finish (completed or skipped) before this step moves on. They must come from the child template's published version.","type":"array","items":{"type":"string"}},"completionMode":{"description":"With `specific_child_steps`: `ALL` waits for every listed step, `ANY` moves on when the first one finishes. Defaults to `ALL`.","type":"string","enum":["ALL","ANY"]}}}}}},"title":"Sub Flow settings","description":"The settings a `SUB_FLOW` step is sent with, beside the shared ones in `StepSettings`. This is the schema `POST /v1/templates` and `POST /v1/templates/{id}/changes` check a step against: a setting not listed here is refused with `UNKNOWN_SETTING`.\n\nSome settings depend on your organization's plan. One your plan doesn't include is refused with `UNKNOWN_SETTING`.\n\n**Checked when you publish.** A save keeps a step that isn't finished; `POST /v1/templates/{id}/check` and publish name what is still missing:\n- No sub-flow template selected.\n\nA template read (`GET /v1/templates/{id}`) returns the step's settings as stored, in `StepConfig_SUB_FLOW`.","x-moxo-step-type":"SUB_FLOW"},"StepSettings_BUILDING_BLOCK":{"type":"object","properties":{"visibleToAllAssignees":{"description":"The older form of `visibility.mode: \"ALL\"`. Use `visibility` instead.","type":"boolean"},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"},"buildingBlock":{"description":"The template to include in this flow, added when the flow starts.","type":"object","properties":{"blockTemplateId":{"description":"The id of the building block's template.","type":"string"},"blockTemplateVersionId":{"description":"A specific version of the building block to include. Without it, the block's latest published version is used when the flow starts.","type":"string"},"inputBindings":{"description":"Values from this flow for the building block's input fields, as references to flow values. Block inputs left unfilled are asked for on this template's start form.","type":"array","items":{"type":"object","properties":{"blockInputFieldId":{"type":"string","description":"The id of an input field on the building block's template: the block input being filled."},"parentRef":{"type":"string","description":"A reference to a value in this flow that fills the block input, such as `${{ fields.vault_address }}` or `${{ steps.collect_vault_config.fields.address }}`. It replaces the block's own references when the flow starts."}},"required":["blockInputFieldId","parentRef"]}},"roleBindings":{"description":"How each of the building block's roles maps onto this template: onto an existing role (`alias`) or as a new role (`promote`).","type":"array","items":{"type":"object","properties":{"blockRoleId":{"type":"string","description":"The `roleId` of a role on the building block's template."},"mode":{"type":"string","enum":["alias","promote","current_item"],"description":"`alias`: maps the block role onto an existing role in this template, whose assignee does the block's steps. `promote`: adds the block role to this template as a new role. `current_item`: assigns the block's steps for this role to the current person of the enclosing For each, the same way a step assigned to \"The current person\" works; valid only when this step is inside a For each."},"hostRoleId":{"description":"The `roleId` of the existing role this block role maps onto. Required when `mode` is `alias`.","type":"string"},"holderUserId":{"description":"The person who takes this new role on the running flow, as `usr_…`. Send them when mode is promote.","type":"string"},"emailColumn":{"description":"With `mode` `current_item`: the name of the column in the enclosing loop's list that holds the current person's email. Optional; without it, the email column is picked automatically.","type":"string"},"emailColumnId":{"description":"The email column's permanent id. Moxo sets it from `emailColumn` when the template is saved; don't set it.","type":"string"}},"required":["blockRoleId","mode"]}},"exposedOutputs":{"description":"A copy of the outputs the building block exposes, taken when it was connected. Later steps refer to them as `${{ steps.<block step>.fields.<output> }}`.","type":"array","items":{"type":"object","properties":{"exposedKey":{"type":"string","description":"The output's key, which stays the same when the building block renames its own output."},"exposedName":{"type":"string","description":"The output's name, shown when choosing a value to refer to."},"type":{"type":"string","description":"The output's type, such as `TEXT`, `NUMBER`, `DATE`, `BOOLEAN` or `FILE`."}},"required":["exposedKey","exposedName","type"]}},"blockName":{"description":"A copy of the building block's name, shown on the collapsed block.","type":"string"},"stepCount":{"description":"A copy of the building block's number of steps, shown as \"N steps\" on the collapsed block.","type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}}}},"title":"Building block settings","description":"The settings a `BUILDING_BLOCK` step is sent with, beside the shared ones in `StepSettings`. This is the schema `POST /v1/templates` and `POST /v1/templates/{id}/changes` check a step against: a setting not listed here is refused with `UNKNOWN_SETTING`.\n\nSome settings depend on your organization's plan. One your plan doesn't include is refused with `UNKNOWN_SETTING`.\n\n**Checked when you publish.** A save keeps a step that isn't finished; `POST /v1/templates/{id}/check` and publish name what is still missing:\n- No building block selected.\n\nA template read (`GET /v1/templates/{id}`) returns the step's settings as stored, in `StepConfig_BUILDING_BLOCK`.","x-moxo-step-type":"BUILDING_BLOCK"},"StepSettings_AI_CUSTOM_PROMPT":{"type":"object","properties":{"aiEscalation":{"$ref":"#/components/schemas/StepSetting_aiEscalation"},"visibleToAllAssignees":{"description":"The older form of `visibility.mode: \"ALL\"`. Use `visibility` instead.","type":"boolean"},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"},"aiAutomation":{"$ref":"#/components/schemas/StepSetting_aiAutomation"},"blockOnFailure":{"type":"boolean","description":"Whether a failure stops the flow (\"Block the workflow if this step fails\"). `false` lets the flow continue past it; the failure is still recorded. Stops it when left out."}},"title":"AI Custom Prompt settings","description":"The settings a `AI_CUSTOM_PROMPT` step is sent with, beside the shared ones in `StepSettings`. This is the schema `POST /v1/templates` and `POST /v1/templates/{id}/changes` check a step against: a setting not listed here is refused with `UNKNOWN_SETTING`.\n\nSome settings depend on your organization's plan. One your plan doesn't include is refused with `UNKNOWN_SETTING`.\n\n**Checked when you publish.** A save keeps a step that isn't finished; `POST /v1/templates/{id}/check` and publish name what is still missing:\n- AI prompt step has no prompt text.\n- AI step has no output fields configured.\n- Human review is on but no reviewer is assigned — pick who reviews the AI output, or turn off human review.\n\nA template read (`GET /v1/templates/{id}`) returns the step's settings as stored, in `StepConfig_AI_CUSTOM_PROMPT`.","x-moxo-step-type":"AI_CUSTOM_PROMPT"},"StepSettings_AI_EXTRACT":{"type":"object","properties":{"aiEscalation":{"$ref":"#/components/schemas/StepSetting_aiEscalation"},"visibleToAllAssignees":{"description":"The older form of `visibility.mode: \"ALL\"`. Use `visibility` instead.","type":"boolean"},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"},"aiAutomation":{"$ref":"#/components/schemas/StepSetting_aiAutomation"},"blockOnFailure":{"type":"boolean","description":"Whether a failure stops the flow (\"Block the workflow if this step fails\"). `false` lets the flow continue past it; the failure is still recorded. Stops it when left out."}},"title":"AI Extract settings","description":"The settings a `AI_EXTRACT` step is sent with, beside the shared ones in `StepSettings`. This is the schema `POST /v1/templates` and `POST /v1/templates/{id}/changes` check a step against: a setting not listed here is refused with `UNKNOWN_SETTING`.\n\nSome settings depend on your organization's plan. One your plan doesn't include is refused with `UNKNOWN_SETTING`.\n\n**Checked when you publish.** A save keeps a step that isn't finished; `POST /v1/templates/{id}/check` and publish name what is still missing:\n- AI step has no input fields configured.\n- AI step has no output fields configured.\n- Human review is on but no reviewer is assigned — pick who reviews the AI output, or turn off human review.\n\nA template read (`GET /v1/templates/{id}`) returns the step's settings as stored, in `StepConfig_AI_EXTRACT`.","x-moxo-step-type":"AI_EXTRACT"},"StepSettings_AI_SUMMARIZE":{"type":"object","properties":{"aiEscalation":{"$ref":"#/components/schemas/StepSetting_aiEscalation"},"visibleToAllAssignees":{"description":"The older form of `visibility.mode: \"ALL\"`. Use `visibility` instead.","type":"boolean"},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"},"aiAutomation":{"description":"The AI settings of the step: what the AI does, the data it receives and the outputs it produces.","type":"object","properties":{"agentId":{"description":"Not a setting of this step type: sending one is refused. To run an agent, use an AI agent step.","not":{}},"actionType":{"type":"string","enum":["CUSTOM_PROMPT","EXTRACT","SUMMARIZE","TRANSCRIBE","TRANSLATE","WRITE"],"description":"What the AI step does. Must match the step's type: `CUSTOM_PROMPT`, `EXTRACT`, `SUMMARIZE`, `TRANSCRIBE`, `TRANSLATE` or `WRITE`."},"prompt":{"description":"What the AI should do. On a Custom prompt step it is the main instruction; on the other AI steps it refines what the step already does. Plain text, which can include references to flow values, or a list of parts: `{ \"kind\": \"text\", \"text\": \"...\" }` and references.","anyOf":[{"type":"string"},{"type":"array","items":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"text","description":"The part's type."},"text":{"type":"string","description":"Fixed text."}},"required":["kind","text"]},{"type":"object","properties":{"kind":{"type":"string","const":"input","description":"The part's type."},"key":{"type":"string","minLength":1,"description":"The key of a start field the template declares."}},"required":["kind","key"]},{"type":"object","properties":{"kind":{"type":"string","const":"role","description":"The part's type."},"roleName":{"type":"string","minLength":1,"description":"A role's name."},"field":{"type":"string","enum":["name","email","phone","title"],"description":"Which of the role's details: `name`, `email`, `phone` or `title`."}},"required":["kind","roleName","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"flow","description":"The part's type."},"field":{"type":"string","enum":["name","description","dueDate","startDate","dueTimestamp","startTimestamp","id"],"description":"Which detail of the flow: `name`, `description`, `dueDate`, `startDate`, `dueTimestamp`, `startTimestamp` or `id`."}},"required":["kind","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"organization","description":"The part's type."},"field":{"type":"string","enum":["name","id"],"description":"Which detail of the organization: `name` or `id`."}},"required":["kind","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"system","description":"The part's type."},"field":{"type":"string","const":"today","description":"Today's date, in the organization's time zone."}},"required":["kind","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"step","description":"The part's type."},"stepName":{"type":"string","minLength":1,"description":"The name of an earlier step."},"field":{"type":"string","minLength":1,"description":"The name of that step's output."}},"required":["kind","stepName","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"current_item","description":"The part's type."},"field":{"type":"string","minLength":1,"description":"A field of the current item, in a step that repeats for each item."}},"required":["kind","field"]}]}}]},"inputFields":{"minItems":1,"type":"array","items":{"$ref":"#/components/schemas/StepSetting_inputFieldsItem"},"description":"The data the AI reads, at least one entry. Each entry is `{ handle, name, type }` with where its value comes from: `value`, a reference as a pulled template file writes it (`\"${{ steps.intake.fields.notes }}\"`), or `source`, whose `kind` says where the value comes from: `literal` (fixed text), `step-output` (an output of an earlier step), `role-data` (a detail of the person in a role), `for-each-aggregate` (an output of a step inside a loop, one value for each round), `flow-input` (a flow field asked for at the start), `custom-field` (a custom user field), `organization` (your organization's name or id), `flow-metadata` (the flow's due date, start date, name or id) or `trigger` (the email that started the flow)."},"outputFields":{"description":"The data the AI produces. Later steps can reference each output.","type":"array","items":{"$ref":"#/components/schemas/StepSetting_outputFieldsItem"}},"humanReview":{"description":"Whether a member reviews the AI output before the flow continues. When `true`, also set `reviewers`: a step with review turned on and no reviewer can't be published. Defaults to `false`.","type":"boolean"},"reviewChat":{"description":"Whether reviewers can talk to the AI about its output and revise the draft in place. Applies only when `humanReview` is `true`. Approving still sends the draft on. Defaults to `false`.","type":"boolean"},"reviewSample":{"description":"With `humanReview` on, the reviewer checks `size` lines (from 1 to 500), each picked with the same chance, of the list output named by `outputKey`, instead of every line. The output is a `LIST`, or a CSV, XLSX or JSON file. On a new step, leave `reviewSample` out to check every line. On `update_step`, leave it out to keep the sample the step already has, and send `null` to check every line. When the step's automation agent sets `reviewSampleSize`, the review checks at least that many even if `reviewSample` is left out, and sending `null` or a smaller `size` is refused (`422 CHANGES_REFUSED`, `LOCKED_BY_AGENT`).","anyOf":[{"type":"object","properties":{"size":{"type":"integer","minimum":1,"maximum":500,"description":"How many lines the reviewer checks, from 1 to 500, each picked with the same chance."},"outputKey":{"type":"string","minLength":1,"maxLength":200,"description":"The name of the list output the lines come from: a `LIST` output, or a CSV, XLSX or JSON file output."}},"required":["size","outputKey"],"additionalProperties":false},{"type":"null"}]},"reviewers":{"$ref":"#/components/schemas/StepSetting_reviewers_2"},"model":{"description":"The AI model this step uses, instead of the default.","type":"string"},"preprocessing":{"description":"Preparation for scanned documents: a scan is converted to structured text before the AI reads it.","type":"object","properties":{"mode":{"default":"auto","description":"When scanned documents are prepared. `auto` prepares scanned documents only, `always` prepares every document, `never` sends documents as they are. Defaults to `auto`.","type":"string","enum":["auto","always","never"]}}},"extractionMode":{"description":"How a document is read. `standard` reads it in large sections and suits most documents. `high_accuracy` reads it in sections of up to 3 pages, for dense multi-page documents such as general ledgers or bank statements. Defaults to `standard`.","type":"string","enum":["standard","high_accuracy"]},"extractMethod":{"description":"Optional advanced extraction. `complex_documents` turns on advanced extraction, which also reads scanned documents. Extraction itself is always on.","type":"string","enum":["standard","complex_documents"]},"extractArithmeticCheck":{"description":"Whether the step checks that the extracted figures add up (a running balance, each journal's debits and credits). When on, a read whose figures do not add up pauses for a person to review.","type":"boolean"},"extractArithmeticVerification":{"description":"The earlier name of `extractArithmeticCheck`. Still read when `extractArithmeticCheck` is not set; new saves use `extractArithmeticCheck`.","type":"boolean"},"extractPack":{"$ref":"#/components/schemas/StepSetting_extractPack"},"extractVerificationCriteria":{"description":"Plain-language checks run as part of arithmetic verification. Up to 8. `journal_footing` checks that a ledger's debits equal its credits; `custom` is a check you write.","maxItems":8,"type":"array","items":{"$ref":"#/components/schemas/StepSetting_extractVerificationCriteriaItem"}},"extractDocumentAbout":{"description":"An optional note on how accounts appear in the file and which lines to ignore. Plain text, up to 4,000 characters. Used when arithmetic verification is on.","type":"string","maxLength":4000},"summaryFormat":{"type":"string","description":"The shape of the summary, for example bullet points or a paragraph."},"maxLength":{"anyOf":[{"type":"string"},{"type":"number"}],"description":"How long the summary should be."},"focusAreas":{"type":"array","items":{"type":"string"},"description":"What the summary should focus on."}},"required":["actionType","inputFields"]},"blockOnFailure":{"type":"boolean","description":"Whether a failure stops the flow (\"Block the workflow if this step fails\"). `false` lets the flow continue past it; the failure is still recorded. Stops it when left out."}},"title":"AI Summarize settings","description":"The settings a `AI_SUMMARIZE` step is sent with, beside the shared ones in `StepSettings`. This is the schema `POST /v1/templates` and `POST /v1/templates/{id}/changes` check a step against: a setting not listed here is refused with `UNKNOWN_SETTING`.\n\nSome settings depend on your organization's plan. One your plan doesn't include is refused with `UNKNOWN_SETTING`.\n\n**Checked when you publish.** A save keeps a step that isn't finished; `POST /v1/templates/{id}/check` and publish name what is still missing:\n- AI step has no input fields configured.\n- AI step has no output fields configured.\n- Human review is on but no reviewer is assigned — pick who reviews the AI output, or turn off human review.\n\nA template read (`GET /v1/templates/{id}`) returns the step's settings as stored, in `StepConfig_AI_SUMMARIZE`.","x-moxo-step-type":"AI_SUMMARIZE"},"StepSettings_AI_TRANSCRIBE":{"type":"object","properties":{"aiEscalation":{"$ref":"#/components/schemas/StepSetting_aiEscalation"},"visibleToAllAssignees":{"description":"The older form of `visibility.mode: \"ALL\"`. Use `visibility` instead.","type":"boolean"},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"},"aiAutomation":{"description":"The AI settings of the step: what the AI does, the data it receives and the outputs it produces.","type":"object","properties":{"agentId":{"description":"Not a setting of this step type: sending one is refused. To run an agent, use an AI agent step.","not":{}},"actionType":{"type":"string","enum":["CUSTOM_PROMPT","EXTRACT","SUMMARIZE","TRANSCRIBE","TRANSLATE","WRITE"],"description":"What the AI step does. Must match the step's type: `CUSTOM_PROMPT`, `EXTRACT`, `SUMMARIZE`, `TRANSCRIBE`, `TRANSLATE` or `WRITE`."},"prompt":{"description":"What the AI should do. On a Custom prompt step it is the main instruction; on the other AI steps it refines what the step already does. Plain text, which can include references to flow values, or a list of parts: `{ \"kind\": \"text\", \"text\": \"...\" }` and references.","anyOf":[{"type":"string"},{"type":"array","items":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"text","description":"The part's type."},"text":{"type":"string","description":"Fixed text."}},"required":["kind","text"]},{"type":"object","properties":{"kind":{"type":"string","const":"input","description":"The part's type."},"key":{"type":"string","minLength":1,"description":"The key of a start field the template declares."}},"required":["kind","key"]},{"type":"object","properties":{"kind":{"type":"string","const":"role","description":"The part's type."},"roleName":{"type":"string","minLength":1,"description":"A role's name."},"field":{"type":"string","enum":["name","email","phone","title"],"description":"Which of the role's details: `name`, `email`, `phone` or `title`."}},"required":["kind","roleName","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"flow","description":"The part's type."},"field":{"type":"string","enum":["name","description","dueDate","startDate","dueTimestamp","startTimestamp","id"],"description":"Which detail of the flow: `name`, `description`, `dueDate`, `startDate`, `dueTimestamp`, `startTimestamp` or `id`."}},"required":["kind","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"organization","description":"The part's type."},"field":{"type":"string","enum":["name","id"],"description":"Which detail of the organization: `name` or `id`."}},"required":["kind","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"system","description":"The part's type."},"field":{"type":"string","const":"today","description":"Today's date, in the organization's time zone."}},"required":["kind","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"step","description":"The part's type."},"stepName":{"type":"string","minLength":1,"description":"The name of an earlier step."},"field":{"type":"string","minLength":1,"description":"The name of that step's output."}},"required":["kind","stepName","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"current_item","description":"The part's type."},"field":{"type":"string","minLength":1,"description":"A field of the current item, in a step that repeats for each item."}},"required":["kind","field"]}]}}]},"inputFields":{"minItems":1,"type":"array","items":{"$ref":"#/components/schemas/StepSetting_inputFieldsItem"},"description":"The data the AI reads, at least one entry. Each entry is `{ handle, name, type }` with where its value comes from: `value`, a reference as a pulled template file writes it (`\"${{ steps.intake.fields.notes }}\"`), or `source`, whose `kind` says where the value comes from: `literal` (fixed text), `step-output` (an output of an earlier step), `role-data` (a detail of the person in a role), `for-each-aggregate` (an output of a step inside a loop, one value for each round), `flow-input` (a flow field asked for at the start), `custom-field` (a custom user field), `organization` (your organization's name or id), `flow-metadata` (the flow's due date, start date, name or id) or `trigger` (the email that started the flow)."},"outputFields":{"description":"The data the AI produces. Later steps can reference each output.","type":"array","items":{"$ref":"#/components/schemas/StepSetting_outputFieldsItem"}},"humanReview":{"description":"Whether a member reviews the AI output before the flow continues. When `true`, also set `reviewers`: a step with review turned on and no reviewer can't be published. Defaults to `false`.","type":"boolean"},"reviewChat":{"description":"Whether reviewers can talk to the AI about its output and revise the draft in place. Applies only when `humanReview` is `true`. Approving still sends the draft on. Defaults to `false`.","type":"boolean"},"reviewSample":{"description":"With `humanReview` on, the reviewer checks `size` lines (from 1 to 500), each picked with the same chance, of the list output named by `outputKey`, instead of every line. The output is a `LIST`, or a CSV, XLSX or JSON file. On a new step, leave `reviewSample` out to check every line. On `update_step`, leave it out to keep the sample the step already has, and send `null` to check every line. When the step's automation agent sets `reviewSampleSize`, the review checks at least that many even if `reviewSample` is left out, and sending `null` or a smaller `size` is refused (`422 CHANGES_REFUSED`, `LOCKED_BY_AGENT`).","anyOf":[{"type":"object","properties":{"size":{"type":"integer","minimum":1,"maximum":500,"description":"How many lines the reviewer checks, from 1 to 500, each picked with the same chance."},"outputKey":{"type":"string","minLength":1,"maxLength":200,"description":"The name of the list output the lines come from: a `LIST` output, or a CSV, XLSX or JSON file output."}},"required":["size","outputKey"],"additionalProperties":false},{"type":"null"}]},"reviewers":{"$ref":"#/components/schemas/StepSetting_reviewers_2"},"model":{"description":"The AI model this step uses, instead of the default.","type":"string"},"preprocessing":{"description":"Preparation for scanned documents: a scan is converted to structured text before the AI reads it.","type":"object","properties":{"mode":{"default":"auto","description":"When scanned documents are prepared. `auto` prepares scanned documents only, `always` prepares every document, `never` sends documents as they are. Defaults to `auto`.","type":"string","enum":["auto","always","never"]}}},"extractionMode":{"description":"How a document is read. `standard` reads it in large sections and suits most documents. `high_accuracy` reads it in sections of up to 3 pages, for dense multi-page documents such as general ledgers or bank statements. Defaults to `standard`.","type":"string","enum":["standard","high_accuracy"]},"extractMethod":{"description":"Optional advanced extraction. `complex_documents` turns on advanced extraction, which also reads scanned documents. Extraction itself is always on.","type":"string","enum":["standard","complex_documents"]},"extractArithmeticCheck":{"description":"Whether the step checks that the extracted figures add up (a running balance, each journal's debits and credits). When on, a read whose figures do not add up pauses for a person to review.","type":"boolean"},"extractArithmeticVerification":{"description":"The earlier name of `extractArithmeticCheck`. Still read when `extractArithmeticCheck` is not set; new saves use `extractArithmeticCheck`.","type":"boolean"},"extractPack":{"$ref":"#/components/schemas/StepSetting_extractPack"},"extractVerificationCriteria":{"description":"Plain-language checks run as part of arithmetic verification. Up to 8. `journal_footing` checks that a ledger's debits equal its credits; `custom` is a check you write.","maxItems":8,"type":"array","items":{"$ref":"#/components/schemas/StepSetting_extractVerificationCriteriaItem"}},"extractDocumentAbout":{"description":"An optional note on how accounts appear in the file and which lines to ignore. Plain text, up to 4,000 characters. Used when arithmetic verification is on.","type":"string","maxLength":4000},"sourceLanguage":{"type":"string","description":"The language spoken in the recording, or `auto` to detect it."},"options":{"type":"object","properties":{"speakerIdentification":{"type":"boolean","description":"Names who is speaking."},"maxSpeakers":{"type":"number","description":"The most speakers to tell apart."},"includeTimestamps":{"type":"boolean","description":"Adds timestamps to the transcript."}},"description":"Transcription options: whether to name who speaks, how many speakers to tell apart and whether to add timestamps."}},"required":["actionType","inputFields"]},"blockOnFailure":{"type":"boolean","description":"Whether a failure stops the flow (\"Block the workflow if this step fails\"). `false` lets the flow continue past it; the failure is still recorded. Stops it when left out."}},"title":"AI Transcribe settings","description":"The settings a `AI_TRANSCRIBE` step is sent with, beside the shared ones in `StepSettings`. This is the schema `POST /v1/templates` and `POST /v1/templates/{id}/changes` check a step against: a setting not listed here is refused with `UNKNOWN_SETTING`.\n\nSome settings depend on your organization's plan. One your plan doesn't include is refused with `UNKNOWN_SETTING`.\n\n**Checked when you publish.** A save keeps a step that isn't finished; `POST /v1/templates/{id}/check` and publish name what is still missing:\n- AI step has no input fields configured.\n- AI step has no output fields configured.\n- Human review is on but no reviewer is assigned — pick who reviews the AI output, or turn off human review.\n\nA template read (`GET /v1/templates/{id}`) returns the step's settings as stored, in `StepConfig_AI_TRANSCRIBE`.","x-moxo-step-type":"AI_TRANSCRIBE"},"StepSettings_AI_TRANSLATE":{"type":"object","properties":{"aiEscalation":{"$ref":"#/components/schemas/StepSetting_aiEscalation"},"visibleToAllAssignees":{"description":"The older form of `visibility.mode: \"ALL\"`. Use `visibility` instead.","type":"boolean"},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"},"aiAutomation":{"description":"The AI settings of the step: what the AI does, the data it receives and the outputs it produces.","type":"object","properties":{"agentId":{"description":"Not a setting of this step type: sending one is refused. To run an agent, use an AI agent step.","not":{}},"actionType":{"type":"string","enum":["CUSTOM_PROMPT","EXTRACT","SUMMARIZE","TRANSCRIBE","TRANSLATE","WRITE"],"description":"What the AI step does. Must match the step's type: `CUSTOM_PROMPT`, `EXTRACT`, `SUMMARIZE`, `TRANSCRIBE`, `TRANSLATE` or `WRITE`."},"prompt":{"description":"What the AI should do. On a Custom prompt step it is the main instruction; on the other AI steps it refines what the step already does. Plain text, which can include references to flow values, or a list of parts: `{ \"kind\": \"text\", \"text\": \"...\" }` and references.","anyOf":[{"type":"string"},{"type":"array","items":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"text","description":"The part's type."},"text":{"type":"string","description":"Fixed text."}},"required":["kind","text"]},{"type":"object","properties":{"kind":{"type":"string","const":"input","description":"The part's type."},"key":{"type":"string","minLength":1,"description":"The key of a start field the template declares."}},"required":["kind","key"]},{"type":"object","properties":{"kind":{"type":"string","const":"role","description":"The part's type."},"roleName":{"type":"string","minLength":1,"description":"A role's name."},"field":{"type":"string","enum":["name","email","phone","title"],"description":"Which of the role's details: `name`, `email`, `phone` or `title`."}},"required":["kind","roleName","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"flow","description":"The part's type."},"field":{"type":"string","enum":["name","description","dueDate","startDate","dueTimestamp","startTimestamp","id"],"description":"Which detail of the flow: `name`, `description`, `dueDate`, `startDate`, `dueTimestamp`, `startTimestamp` or `id`."}},"required":["kind","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"organization","description":"The part's type."},"field":{"type":"string","enum":["name","id"],"description":"Which detail of the organization: `name` or `id`."}},"required":["kind","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"system","description":"The part's type."},"field":{"type":"string","const":"today","description":"Today's date, in the organization's time zone."}},"required":["kind","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"step","description":"The part's type."},"stepName":{"type":"string","minLength":1,"description":"The name of an earlier step."},"field":{"type":"string","minLength":1,"description":"The name of that step's output."}},"required":["kind","stepName","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"current_item","description":"The part's type."},"field":{"type":"string","minLength":1,"description":"A field of the current item, in a step that repeats for each item."}},"required":["kind","field"]}]}}]},"inputFields":{"minItems":1,"type":"array","items":{"$ref":"#/components/schemas/StepSetting_inputFieldsItem"},"description":"The data the AI reads, at least one entry. Each entry is `{ handle, name, type }` with where its value comes from: `value`, a reference as a pulled template file writes it (`\"${{ steps.intake.fields.notes }}\"`), or `source`, whose `kind` says where the value comes from: `literal` (fixed text), `step-output` (an output of an earlier step), `role-data` (a detail of the person in a role), `for-each-aggregate` (an output of a step inside a loop, one value for each round), `flow-input` (a flow field asked for at the start), `custom-field` (a custom user field), `organization` (your organization's name or id), `flow-metadata` (the flow's due date, start date, name or id) or `trigger` (the email that started the flow)."},"outputFields":{"description":"The data the AI produces. Later steps can reference each output.","type":"array","items":{"$ref":"#/components/schemas/StepSetting_outputFieldsItem"}},"humanReview":{"description":"Whether a member reviews the AI output before the flow continues. When `true`, also set `reviewers`: a step with review turned on and no reviewer can't be published. Defaults to `false`.","type":"boolean"},"reviewChat":{"description":"Whether reviewers can talk to the AI about its output and revise the draft in place. Applies only when `humanReview` is `true`. Approving still sends the draft on. Defaults to `false`.","type":"boolean"},"reviewSample":{"description":"With `humanReview` on, the reviewer checks `size` lines (from 1 to 500), each picked with the same chance, of the list output named by `outputKey`, instead of every line. The output is a `LIST`, or a CSV, XLSX or JSON file. On a new step, leave `reviewSample` out to check every line. On `update_step`, leave it out to keep the sample the step already has, and send `null` to check every line. When the step's automation agent sets `reviewSampleSize`, the review checks at least that many even if `reviewSample` is left out, and sending `null` or a smaller `size` is refused (`422 CHANGES_REFUSED`, `LOCKED_BY_AGENT`).","anyOf":[{"type":"object","properties":{"size":{"type":"integer","minimum":1,"maximum":500,"description":"How many lines the reviewer checks, from 1 to 500, each picked with the same chance."},"outputKey":{"type":"string","minLength":1,"maxLength":200,"description":"The name of the list output the lines come from: a `LIST` output, or a CSV, XLSX or JSON file output."}},"required":["size","outputKey"],"additionalProperties":false},{"type":"null"}]},"reviewers":{"$ref":"#/components/schemas/StepSetting_reviewers_2"},"model":{"description":"The AI model this step uses, instead of the default.","type":"string"},"preprocessing":{"description":"Preparation for scanned documents: a scan is converted to structured text before the AI reads it.","type":"object","properties":{"mode":{"default":"auto","description":"When scanned documents are prepared. `auto` prepares scanned documents only, `always` prepares every document, `never` sends documents as they are. Defaults to `auto`.","type":"string","enum":["auto","always","never"]}}},"extractionMode":{"description":"How a document is read. `standard` reads it in large sections and suits most documents. `high_accuracy` reads it in sections of up to 3 pages, for dense multi-page documents such as general ledgers or bank statements. Defaults to `standard`.","type":"string","enum":["standard","high_accuracy"]},"extractMethod":{"description":"Optional advanced extraction. `complex_documents` turns on advanced extraction, which also reads scanned documents. Extraction itself is always on.","type":"string","enum":["standard","complex_documents"]},"extractArithmeticCheck":{"description":"Whether the step checks that the extracted figures add up (a running balance, each journal's debits and credits). When on, a read whose figures do not add up pauses for a person to review.","type":"boolean"},"extractArithmeticVerification":{"description":"The earlier name of `extractArithmeticCheck`. Still read when `extractArithmeticCheck` is not set; new saves use `extractArithmeticCheck`.","type":"boolean"},"extractPack":{"$ref":"#/components/schemas/StepSetting_extractPack"},"extractVerificationCriteria":{"description":"Plain-language checks run as part of arithmetic verification. Up to 8. `journal_footing` checks that a ledger's debits equal its credits; `custom` is a check you write.","maxItems":8,"type":"array","items":{"$ref":"#/components/schemas/StepSetting_extractVerificationCriteriaItem"}},"extractDocumentAbout":{"description":"An optional note on how accounts appear in the file and which lines to ignore. Plain text, up to 4,000 characters. Used when arithmetic verification is on.","type":"string","maxLength":4000},"sourceLanguage":{"type":"string","description":"The language of the input, or `auto` to detect it."},"targetLanguage":{"type":"string","description":"The language to translate into. Defaults to English."},"domain":{"type":"string","description":"The subject area, so its terms are translated correctly (for example `LEGAL` or `MEDICAL`)."},"formalityLevel":{"type":"string","description":"How formal the translation is, for languages that mark formality."}},"required":["actionType","inputFields"]},"blockOnFailure":{"type":"boolean","description":"Whether a failure stops the flow (\"Block the workflow if this step fails\"). `false` lets the flow continue past it; the failure is still recorded. Stops it when left out."}},"title":"AI Translate settings","description":"The settings a `AI_TRANSLATE` step is sent with, beside the shared ones in `StepSettings`. This is the schema `POST /v1/templates` and `POST /v1/templates/{id}/changes` check a step against: a setting not listed here is refused with `UNKNOWN_SETTING`.\n\nSome settings depend on your organization's plan. One your plan doesn't include is refused with `UNKNOWN_SETTING`.\n\n**Checked when you publish.** A save keeps a step that isn't finished; `POST /v1/templates/{id}/check` and publish name what is still missing:\n- AI step has no input fields configured.\n- AI step has no output fields configured.\n- Human review is on but no reviewer is assigned — pick who reviews the AI output, or turn off human review.\n\nA template read (`GET /v1/templates/{id}`) returns the step's settings as stored, in `StepConfig_AI_TRANSLATE`.","x-moxo-step-type":"AI_TRANSLATE"},"StepSettings_AI_WRITE":{"type":"object","properties":{"aiEscalation":{"$ref":"#/components/schemas/StepSetting_aiEscalation"},"visibleToAllAssignees":{"description":"The older form of `visibility.mode: \"ALL\"`. Use `visibility` instead.","type":"boolean"},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"},"aiAutomation":{"description":"The AI settings of the step: what the AI does, the data it receives and the outputs it produces.","type":"object","properties":{"agentId":{"description":"Not a setting of this step type: sending one is refused. To run an agent, use an AI agent step.","not":{}},"actionType":{"type":"string","enum":["CUSTOM_PROMPT","EXTRACT","SUMMARIZE","TRANSCRIBE","TRANSLATE","WRITE"],"description":"What the AI step does. Must match the step's type: `CUSTOM_PROMPT`, `EXTRACT`, `SUMMARIZE`, `TRANSCRIBE`, `TRANSLATE` or `WRITE`."},"prompt":{"description":"What the AI should do. On a Custom prompt step it is the main instruction; on the other AI steps it refines what the step already does. Plain text, which can include references to flow values, or a list of parts: `{ \"kind\": \"text\", \"text\": \"...\" }` and references.","anyOf":[{"type":"string"},{"type":"array","items":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"text","description":"The part's type."},"text":{"type":"string","description":"Fixed text."}},"required":["kind","text"]},{"type":"object","properties":{"kind":{"type":"string","const":"input","description":"The part's type."},"key":{"type":"string","minLength":1,"description":"The key of a start field the template declares."}},"required":["kind","key"]},{"type":"object","properties":{"kind":{"type":"string","const":"role","description":"The part's type."},"roleName":{"type":"string","minLength":1,"description":"A role's name."},"field":{"type":"string","enum":["name","email","phone","title"],"description":"Which of the role's details: `name`, `email`, `phone` or `title`."}},"required":["kind","roleName","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"flow","description":"The part's type."},"field":{"type":"string","enum":["name","description","dueDate","startDate","dueTimestamp","startTimestamp","id"],"description":"Which detail of the flow: `name`, `description`, `dueDate`, `startDate`, `dueTimestamp`, `startTimestamp` or `id`."}},"required":["kind","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"organization","description":"The part's type."},"field":{"type":"string","enum":["name","id"],"description":"Which detail of the organization: `name` or `id`."}},"required":["kind","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"system","description":"The part's type."},"field":{"type":"string","const":"today","description":"Today's date, in the organization's time zone."}},"required":["kind","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"step","description":"The part's type."},"stepName":{"type":"string","minLength":1,"description":"The name of an earlier step."},"field":{"type":"string","minLength":1,"description":"The name of that step's output."}},"required":["kind","stepName","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"current_item","description":"The part's type."},"field":{"type":"string","minLength":1,"description":"A field of the current item, in a step that repeats for each item."}},"required":["kind","field"]}]}}]},"inputFields":{"minItems":1,"type":"array","items":{"$ref":"#/components/schemas/StepSetting_inputFieldsItem"},"description":"The data the AI reads, at least one entry. Each entry is `{ handle, name, type }` with where its value comes from: `value`, a reference as a pulled template file writes it (`\"${{ steps.intake.fields.notes }}\"`), or `source`, whose `kind` says where the value comes from: `literal` (fixed text), `step-output` (an output of an earlier step), `role-data` (a detail of the person in a role), `for-each-aggregate` (an output of a step inside a loop, one value for each round), `flow-input` (a flow field asked for at the start), `custom-field` (a custom user field), `organization` (your organization's name or id), `flow-metadata` (the flow's due date, start date, name or id) or `trigger` (the email that started the flow)."},"outputFields":{"description":"The data the AI produces. Later steps can reference each output.","type":"array","items":{"$ref":"#/components/schemas/StepSetting_outputFieldsItem"}},"humanReview":{"description":"Whether a member reviews the AI output before the flow continues. When `true`, also set `reviewers`: a step with review turned on and no reviewer can't be published. Defaults to `false`.","type":"boolean"},"reviewChat":{"description":"Whether reviewers can talk to the AI about its output and revise the draft in place. Applies only when `humanReview` is `true`. Approving still sends the draft on. Defaults to `false`.","type":"boolean"},"reviewSample":{"description":"With `humanReview` on, the reviewer checks `size` lines (from 1 to 500), each picked with the same chance, of the list output named by `outputKey`, instead of every line. The output is a `LIST`, or a CSV, XLSX or JSON file. On a new step, leave `reviewSample` out to check every line. On `update_step`, leave it out to keep the sample the step already has, and send `null` to check every line. When the step's automation agent sets `reviewSampleSize`, the review checks at least that many even if `reviewSample` is left out, and sending `null` or a smaller `size` is refused (`422 CHANGES_REFUSED`, `LOCKED_BY_AGENT`).","anyOf":[{"type":"object","properties":{"size":{"type":"integer","minimum":1,"maximum":500,"description":"How many lines the reviewer checks, from 1 to 500, each picked with the same chance."},"outputKey":{"type":"string","minLength":1,"maxLength":200,"description":"The name of the list output the lines come from: a `LIST` output, or a CSV, XLSX or JSON file output."}},"required":["size","outputKey"],"additionalProperties":false},{"type":"null"}]},"reviewers":{"$ref":"#/components/schemas/StepSetting_reviewers_2"},"model":{"description":"The AI model this step uses, instead of the default.","type":"string"},"preprocessing":{"description":"Preparation for scanned documents: a scan is converted to structured text before the AI reads it.","type":"object","properties":{"mode":{"default":"auto","description":"When scanned documents are prepared. `auto` prepares scanned documents only, `always` prepares every document, `never` sends documents as they are. Defaults to `auto`.","type":"string","enum":["auto","always","never"]}}},"extractionMode":{"description":"How a document is read. `standard` reads it in large sections and suits most documents. `high_accuracy` reads it in sections of up to 3 pages, for dense multi-page documents such as general ledgers or bank statements. Defaults to `standard`.","type":"string","enum":["standard","high_accuracy"]},"extractMethod":{"description":"Optional advanced extraction. `complex_documents` turns on advanced extraction, which also reads scanned documents. Extraction itself is always on.","type":"string","enum":["standard","complex_documents"]},"extractArithmeticCheck":{"description":"Whether the step checks that the extracted figures add up (a running balance, each journal's debits and credits). When on, a read whose figures do not add up pauses for a person to review.","type":"boolean"},"extractArithmeticVerification":{"description":"The earlier name of `extractArithmeticCheck`. Still read when `extractArithmeticCheck` is not set; new saves use `extractArithmeticCheck`.","type":"boolean"},"extractPack":{"$ref":"#/components/schemas/StepSetting_extractPack"},"extractVerificationCriteria":{"description":"Plain-language checks run as part of arithmetic verification. Up to 8. `journal_footing` checks that a ledger's debits equal its credits; `custom` is a check you write.","maxItems":8,"type":"array","items":{"$ref":"#/components/schemas/StepSetting_extractVerificationCriteriaItem"}},"extractDocumentAbout":{"description":"An optional note on how accounts appear in the file and which lines to ignore. Plain text, up to 4,000 characters. Used when arithmetic verification is on.","type":"string","maxLength":4000},"writeType":{"type":"string","enum":["email","message","document","report"],"description":"What kind of writing it is: `email`, `message`, `document` or `report`. It sets the credit cost."},"contentType":{"type":"string","description":"The kind of content to write. Defaults to `GENERAL`."},"tone":{"type":"string","description":"The tone of the writing. Defaults to `PROFESSIONAL`."},"audience":{"type":"string","description":"Who the writing is for."},"maxLength":{"anyOf":[{"type":"string"},{"type":"number"}],"description":"How long the writing should be."},"template":{"type":"string","description":"A structure for the writing to follow."}},"required":["actionType","inputFields"]},"blockOnFailure":{"type":"boolean","description":"Whether a failure stops the flow (\"Block the workflow if this step fails\"). `false` lets the flow continue past it; the failure is still recorded. Stops it when left out."}},"title":"AI Write settings","description":"The settings a `AI_WRITE` step is sent with, beside the shared ones in `StepSettings`. This is the schema `POST /v1/templates` and `POST /v1/templates/{id}/changes` check a step against: a setting not listed here is refused with `UNKNOWN_SETTING`.\n\nSome settings depend on your organization's plan. One your plan doesn't include is refused with `UNKNOWN_SETTING`.\n\n**Checked when you publish.** A save keeps a step that isn't finished; `POST /v1/templates/{id}/check` and publish name what is still missing:\n- AI step has no input fields configured.\n- AI step has no output fields configured.\n- Human review is on but no reviewer is assigned — pick who reviews the AI output, or turn off human review.\n\nA template read (`GET /v1/templates/{id}`) returns the step's settings as stored, in `StepConfig_AI_WRITE`.","x-moxo-step-type":"AI_WRITE"},"StepSettings_AI_AGENT":{"type":"object","properties":{"aiEscalation":{"$ref":"#/components/schemas/StepSetting_aiEscalation"},"visibleToAllAssignees":{"description":"The older form of `visibility.mode: \"ALL\"`. Use `visibility` instead.","type":"boolean"},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"},"agentId":{"description":"The id of the AI agent that runs this step: an existing agent, or one `POST /v1/agents` created.","type":"string"},"context":{"description":"What this step tells the agent. Can include references to earlier steps' values, such as `${{ steps.<step>.fields.<field> }}`. Text only: a file reference becomes the file's name here, not its content. To give the agent a file's content, use `aiAutomation.inputFields`.","type":"string"},"aiAutomation":{"description":"The step's context and file inputs for the agent. Optional. Prefer it to `context` in new templates.","type":"object","properties":{"stepContext":{"description":"What this step tells the agent; the same as `context`, and the preferred place for it. Can include references to text values only. Files go in `inputFields`.","type":"string"},"humanReview":{"description":"Whether a member reviews the agent's output before the step completes. Defaults to off. When `true`, `reviewers` is required: a step with review on and no reviewer can't be published, and would wait forever when it runs.","type":"boolean"},"reviewChat":{"description":"Whether reviewers can talk to the AI about its output and revise the draft in place. Applies only when `humanReview` is `true`. Approving still sends the draft on. Defaults to `false`.","type":"boolean"},"reviewSample":{"description":"With `humanReview` on, the reviewer checks `size` lines (from 1 to 500), each picked with the same chance, of the list output named by `outputKey`, instead of every line. The output is a `LIST`, or a CSV, XLSX or JSON file. On a new step, leave `reviewSample` out to check every line. On `update_step`, leave it out to keep the sample the step already has, and send `null` to check every line. When the step's automation agent sets `reviewSampleSize`, the review checks at least that many even if `reviewSample` is left out, and sending `null` or a smaller `size` is refused (`422 CHANGES_REFUSED`, `LOCKED_BY_AGENT`).","anyOf":[{"type":"object","properties":{"size":{"type":"integer","minimum":1,"maximum":500,"description":"How many lines the reviewer checks, from 1 to 500, each picked with the same chance."},"outputKey":{"type":"string","minLength":1,"maxLength":200,"description":"The name of the list output the lines come from: a `LIST` output, or a CSV, XLSX or JSON file output."}},"required":["size","outputKey"],"additionalProperties":false},{"type":"null"}]},"reviewers":{"description":"Who reviews the agent's output: an internal role, such as the flow's manager or approver. Required when `humanReview` is `true`.","type":"object","properties":{"participants":{"type":"array","items":{"$ref":"#/components/schemas/StepSetting_participantsItem"},"description":"The reviewers: AI agents, roles or named people."},"sequential":{"type":"boolean","description":"Whether the reviewers act one after another."},"completion":{"type":"object","properties":{"mode":{"type":"string","enum":["ANY_ONE","ALL"],"description":"`ANY_ONE`: one reviewer is enough. `ALL`: every reviewer must review."}},"required":["mode"],"description":"When the review is done."},"showToExternalAssignee":{"description":"Advisors only. `true` lets an assignee outside your organization read the recommendation (the call and its reasons), as advice from your organization. Off unless set.","type":"boolean"},"canEditAnswers":{"description":"Reviewers only, on a Form, PDF form or File request step. `true` lets the reviewer whose turn it is edit the submitted answers (on a File request, add and remove its files) during review, in the Moxo app, instead of sending them back. Off unless set.","type":"boolean"},"reviewItemsTogether":{"description":"Reviewers only, on a person's step inside a For each whose items run at the same time. `true` gives the reviewer one list and one notice for every item instead of one review per item; each item keeps its own run and review. With the loop's `syncStepsAcrossIterations` on, the reviewer approves every item at once (`approve_reviews_together`); off, each item is approved on its own. Publish refuses it in a Repeat while, on an \"Approve before it runs\" step, with no person or role reviewing, and in a loop that runs items one at a time. Off unless set.","type":"boolean"}},"required":["participants"]},"requiresApproval":{"description":"The agent's actions that need a person's approval in this flow, such as `{ \"send_email\": true }`. The agent pauses for approval before each one. Not read while `approvalScope` is `\"all\"`.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"boolean"}},"approvalScope":{"description":"`\"all\"`: the agent waits for a person's approval before every action it takes, including actions it gains later. `\"only\"`, or left out: only the actions in `requiresApproval`.","type":"string","enum":["all","only"]},"inputFields":{"description":"Where each of the agent's inputs gets its value: one entry for each input the agent declares, matched by name.","type":"array","items":{"type":"object","properties":{"fieldId":{"description":"A unique id for the input, such as `in_1`.","type":"string"},"name":{"type":"string","description":"One of the agent's input names, exactly as the agent declares it."},"type":{"type":"string","enum":["TEXT","NUMBER","DATE","BOOLEAN","FILE"],"description":"The input's type: `FILE` passes an uploaded file's content (from a File request step); `TEXT`, `NUMBER`, `DATE` and `BOOLEAN` pass a value, such as a form answer. When the agent declares its inputs, their declared types are used, so match them."},"value":{"anyOf":[{"type":"string","description":"Where the input's value comes from: a reference to a value from earlier in the flow. Required. For a `FILE` input, a File request step's files, such as `${{ steps.upload_documents.fields.uploaded_files }}`, which passes the files' content. For other types, the earlier step's field, such as `${{ steps.client_intake.fields.company_name }}`, which passes its value."},{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"literal","description":"Set to `literal`."},"expectedType":{"type":"string","description":"The type the value has, such as `TEXT`, `NUMBER`, `DATE`, `BOOLEAN` or `FILE`. An output read across a loop's rounds is a list, such as `LIST<TEXT>`."},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}],"description":"A fixed value. Its JSON type follows `expectedType`: a number for `NUMBER`, a boolean for `BOOLEAN` and text for everything else."}},"required":["kind","expectedType","value"]},{"$ref":"#/components/schemas/StepSetting_ref_2"},{"$ref":"#/components/schemas/StepSetting_ref_5"},{"type":"object","properties":{"kind":{"type":"string","const":"flow-input","description":"Set to `flow-input`."},"expectedType":{"type":"string","description":"The type the value has, such as `TEXT`, `NUMBER`, `DATE`, `BOOLEAN` or `FILE`. An output read across a loop's rounds is a list, such as `LIST<TEXT>`."},"inputId":{"type":"string","description":"The `key` of a flow field asked for when the flow starts, for example `client_name`. Not an id. Read from the start form's values."}},"required":["kind","expectedType","inputId"]},{"type":"object","properties":{"kind":{"type":"string","const":"custom-field","description":"Set to `custom-field`."},"expectedType":{"type":"string","description":"The type the value has, such as `TEXT`, `NUMBER`, `DATE`, `BOOLEAN` or `FILE`. An output read across a loop's rounds is a list, such as `LIST<TEXT>`."},"fieldId":{"type":"string","description":"For `custom-field`: the custom user field's id."}},"required":["kind","expectedType","fieldId"]},{"type":"object","properties":{"kind":{"type":"string","const":"organization","description":"Set to `organization`."},"expectedType":{"type":"string","const":"TEXT","description":"Set to `TEXT`."},"attribute":{"type":"string","enum":["name","id"],"description":"For `organization`: `name` or `id`. For `flow-metadata`: the flow's `duedate`, `startdate`, `name` or `id`."}},"required":["kind","expectedType","attribute"]},{"type":"object","properties":{"kind":{"type":"string","const":"flow-metadata","description":"Set to `flow-metadata`."},"expectedType":{"type":"string","description":"The type the value has, such as `TEXT`, `NUMBER`, `DATE`, `BOOLEAN` or `FILE`. An output read across a loop's rounds is a list, such as `LIST<TEXT>`."},"attribute":{"type":"string","enum":["duedate","startdate","name","id"],"description":"For `organization`: `name` or `id`. For `flow-metadata`: the flow's `duedate`, `startdate`, `name` or `id`."}},"required":["kind","expectedType","attribute"]},{"$ref":"#/components/schemas/StepSetting_ref_3"},{"$ref":"#/components/schemas/StepSetting_ref"}]},{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"literal","description":"Set to `literal`."},"value":{"type":"string","description":"Fixed text, such as a prompt, a caption or context that doesn't come from earlier steps."},"expectedType":{"type":"string","description":"The type the value has, such as `TEXT`, `NUMBER`, `DATE`, `BOOLEAN` or `FILE`. An output read across a loop's rounds is a list, such as `LIST<TEXT>`."}},"required":["kind","value"]},{"$ref":"#/components/schemas/StepSetting_value"},{"$ref":"#/components/schemas/StepSetting_value_4"},{"$ref":"#/components/schemas/StepSetting_value_2"},{"type":"object","properties":{"kind":{"type":"string","const":"flow-input","description":"Set to `flow-input`."},"inputId":{"type":"string","description":"The `key` of a flow field asked for when the flow starts, for example a customer email or an order ID. Read from the start form's values."},"expectedType":{"type":"string","description":"The type the value has, such as `TEXT`, `NUMBER`, `DATE`, `BOOLEAN` or `FILE`. An output read across a loop's rounds is a list, such as `LIST<TEXT>`."}},"required":["kind","inputId"]},{"type":"object","properties":{"kind":{"type":"string","const":"custom-field","description":"Set to `custom-field`."},"fieldId":{"type":"string","description":"The `fieldId` of an organization-level custom user field, for example account tier or region. Read from the person's saved value."},"expectedType":{"type":"string","description":"The type the value has, such as `TEXT`, `NUMBER`, `DATE`, `BOOLEAN` or `FILE`. An output read across a loop's rounds is a list, such as `LIST<TEXT>`."}},"required":["kind","fieldId"]},{"type":"object","properties":{"kind":{"type":"string","const":"organization","description":"Set to `organization`."},"attribute":{"type":"string","enum":["name","id"],"description":"Which detail of the organization to read: `name` (for example to personalize generated text) or `id` (for example for an outbound API call that needs it)."},"expectedType":{"type":"string","const":"TEXT","description":"Set to `TEXT`."}},"required":["kind","attribute"]},{"type":"object","properties":{"kind":{"type":"string","const":"flow-metadata","description":"Set to `flow-metadata`."},"attribute":{"type":"string","enum":["duedate","startdate","name","id"],"description":"Which detail of the flow to read: its due date, start date, name or id. For example, a prompt can use the flow's due date to summarize what is overdue."},"expectedType":{"type":"string","description":"The type the value has, such as `TEXT`, `NUMBER`, `DATE`, `BOOLEAN` or `FILE`. An output read across a loop's rounds is a list, such as `LIST<TEXT>`."}},"required":["kind","attribute"]},{"$ref":"#/components/schemas/StepSetting_value_3"}]}],"description":"Where the input's value comes from: a reference to a value from earlier in the flow. Accepts the reference as text or as a structured reference; the structured form is preferred, and text is converted to it on the next save."},"agentInputId":{"type":"string","description":"The agent's input this row fills, by its permanent id. Matched before `name`."}},"required":["name","type","value"]}},"writableFields":{"type":"array","items":{"type":"string","minLength":1},"description":"The flow fields the agent may change, by id or key. Leave it out to let it change any; an empty list lets it change none."}}},"blockOnFailure":{"type":"boolean","description":"Whether a failure stops the flow (\"Block the workflow if this step fails\"). `false` lets the flow continue past it; the failure is still recorded. Stops it when left out."}},"required":["agentId"],"title":"AI Agent settings","description":"The settings a `AI_AGENT` step is sent with, beside the shared ones in `StepSettings`. This is the schema `POST /v1/templates` and `POST /v1/templates/{id}/changes` check a step against: a setting not listed here is refused with `UNKNOWN_SETTING`.\n\nSome settings depend on your organization's plan. One your plan doesn't include is refused with `UNKNOWN_SETTING`.\n\n**Checked when you publish.** A save keeps a step that isn't finished; `POST /v1/templates/{id}/check` and publish name what is still missing:\n- AI agent step has no agent selected.\n- Human review is on but no reviewer is assigned — pick who reviews the AI output, or turn off human review.\n\nA template read (`GET /v1/templates/{id}`) returns the step's settings as stored, in `StepConfig_AI_AGENT`.","x-moxo-step-type":"AI_AGENT"},"StepSettings_SYSTEM_WEBHOOK":{"type":"object","properties":{"visibleToAllAssignees":{"description":"The older form of `visibility.mode: \"ALL\"`. Use `visibility` instead.","type":"boolean"},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"},"reviewers":{"$ref":"#/components/schemas/StepSetting_reviewers"},"systemWebhook":{"description":"The webhook settings. The step sends a `POST` with a standard Moxo event to the URL. Set `dataFromStepId` to include an earlier step's outputs, and `context` for more values. Set `connectionId` to sign the request in with a saved Secret. For other methods, other headers, a body of your own or to use the reply, use a `REST_API` step.","type":"object","properties":{"url":{"type":"string","description":"The address the webhook is sent to."},"dataFromStepId":{"description":"The `stepId` of an earlier step in the flow whose outputs are sent with the event, as `dataStep`. Leave it out to send no step data.","type":"string"},"context":{"description":"Extra values sent in the event's `context`, as key and value pairs. A value can reference values from earlier in the flow, such as `${{ steps.<step>.fields.<field> }}` or `${{ fields.<key> }}`.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"connectionId":{"description":"The id of a saved Secret to sign in with. When set, the Secret's credentials are added to the `POST`, and only for an address on the Secret's own host.","type":"string"},"payloadVersion":{"description":"Which body the POST carries. `2`, what a new action starts with: `event: \"webhook_step.fired\"`, `schemaVersion: 2`. `1`, what an action that names none sends: `event: \"step.completed\"`, `schemaVersion: 1`, the body it has always sent.","anyOf":[{"type":"number","const":1},{"type":"number","const":2}]}}},"approveBeforeRun":{"description":"Whether a person approves the values this step is about to use before it runs. Available on `REST_API`, `EXTERNAL_APP`, `MCP_SERVER`, `SYSTEM_EMAIL`, `SEND_ANNOUNCEMENT`, `SEND_TO_CONVERSATION`, `SYSTEM_WEBHOOK`, `DATA_TABLE_SAVE_RECORD`, `START_FLOW`, `SCHEDULE_FLOW`, `CODE`, `COLLECT_PAYMENT`, `DOCUSIGN` and `ADOBE_SIGN` steps. When `true`, the step pauses before it calls, sends, writes, starts or schedules anything, until someone approves. Set who approves in the step's `reviewers`: a step with approval on and no approver can't be published.","type":"boolean"},"approvalRejectMode":{"description":"What a rejection does, with `approveBeforeRun`. `skip` (the default) skips this step and the flow continues; `halt` stops the flow.","type":"string","enum":["skip","halt"]},"blockOnFailure":{"type":"boolean","description":"Whether a failure stops the flow (\"Block the workflow if this step fails\"). `false` lets the flow continue past it; the failure is still recorded. Stops it when left out."}},"title":"Webhook settings","description":"The settings a `SYSTEM_WEBHOOK` step is sent with, beside the shared ones in `StepSettings`. This is the schema `POST /v1/templates` and `POST /v1/templates/{id}/changes` check a step against: a setting not listed here is refused with `UNKNOWN_SETTING`.\n\nSome settings depend on your organization's plan. One your plan doesn't include is refused with `UNKNOWN_SETTING`.\n\n**Checked when you publish.** A save keeps a step that isn't finished; `POST /v1/templates/{id}/check` and publish name what is still missing:\n- Add the web address this step should call.\n- This step uses a value from an earlier step that no longer exists. Open it and pick an available value.\n- Approve-before-it-runs is on but no approver is assigned. Pick who approves, or turn it off.\n\nA template read (`GET /v1/templates/{id}`) returns the step's settings as stored, in `StepConfig_SYSTEM_WEBHOOK`.","x-moxo-step-type":"SYSTEM_WEBHOOK"},"StepSettings_SYSTEM_EMAIL":{"type":"object","properties":{"visibleToAllAssignees":{"description":"The older form of `visibility.mode: \"ALL\"`. Use `visibility` instead.","type":"boolean"},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"},"reviewers":{"$ref":"#/components/schemas/StepSetting_reviewers"},"systemEmail":{"description":"The email to send. Each recipient is text: an email address or a reference such as `${{ roles.client.email }}`. Attachments are typed references, checked when the template is saved; the subject and body are text that can include references to flow values.","type":"object","properties":{"to":{"description":"Who receives the email. Each entry is text: an email address, such as `ops@example.com`, or a reference to an address from the flow, such as `${{ roles.client.email }}` or `${{ steps.intake.fields.email }}`.","type":"array","items":{"type":"string","minLength":1,"description":"An email address, such as `support@example.com`, or a reference to an address from the flow, such as `${{ roles.client.email }}` or `${{ steps.intake.fields.email }}`."}},"cc":{"description":"Who receives a copy, written like `to`: email addresses or references such as `${{ roles.client.email }}`. They appear in the email's Cc line. Use it for people who should be informed but aren't the main recipient.","type":"array","items":{"type":"string","minLength":1,"description":"An email address, such as `support@example.com`, or a reference to an address from the flow, such as `${{ roles.client.email }}` or `${{ steps.intake.fields.email }}`."}},"replyTo":{"description":"Where replies go, written like `to`: an email address or a reference such as `${{ roles.account_manager.email }}`, which sends replies to the right person in each flow. Overrides the organization's default reply-to address for this step. Usually one address; a list is accepted.","type":"array","items":{"type":"string","minLength":1,"description":"An email address, such as `support@example.com`, or a reference to an address from the flow, such as `${{ roles.client.email }}` or `${{ steps.intake.fields.email }}`."}},"subject":{"description":"The email's subject: text that can include references to flow values, or a list of typed parts, such as `[{ \"kind\": \"text\", \"text\": \"Welcome \" }, { \"kind\": \"input\", \"key\": \"client_name\" }]`. Typed parts can only refer to roles, fields and steps the template has. Either form is saved as text.","anyOf":[{"type":"string"},{"type":"array","items":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"text","description":"The part's type."},"text":{"type":"string","description":"Fixed text."}},"required":["kind","text"]},{"type":"object","properties":{"kind":{"type":"string","const":"input","description":"The part's type."},"key":{"type":"string","minLength":1,"description":"The key of a start field the template declares."}},"required":["kind","key"]},{"type":"object","properties":{"kind":{"type":"string","const":"role","description":"The part's type."},"roleName":{"type":"string","minLength":1,"description":"A role's name."},"field":{"type":"string","enum":["name","email","phone","title"],"description":"Which of the role's details: `name`, `email`, `phone` or `title`."}},"required":["kind","roleName","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"flow","description":"The part's type."},"field":{"type":"string","enum":["name","description","dueDate","startDate","dueTimestamp","startTimestamp","id"],"description":"Which detail of the flow: `name`, `description`, `dueDate`, `startDate`, `dueTimestamp`, `startTimestamp` or `id`."}},"required":["kind","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"organization","description":"The part's type."},"field":{"type":"string","enum":["name","id"],"description":"Which detail of the organization: `name` or `id`."}},"required":["kind","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"system","description":"The part's type."},"field":{"type":"string","const":"today","description":"Today's date, in the organization's time zone."}},"required":["kind","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"step","description":"The part's type."},"stepName":{"type":"string","minLength":1,"description":"The name of an earlier step."},"field":{"type":"string","minLength":1,"description":"The name of that step's output."}},"required":["kind","stepName","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"current_item","description":"The part's type."},"field":{"type":"string","minLength":1,"description":"A field of the current item, in a step that repeats for each item."}},"required":["kind","field"]}]}}]},"body":{"description":"The email's body: text that can include references to flow values, or a list of typed parts: `{ \"kind\": \"text\", \"text\": \"...\" }` and references whose `kind` is `role`, `input`, `step`, `flow`, `organization` or `current_item`. Use typed parts when the body refers to earlier steps' results, people's details, flow fields, or organization or flow details: they are checked when the template is saved, so a reference can't go stale. Either form is saved as text.","anyOf":[{"type":"string"},{"type":"array","items":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"text","description":"The part's type."},"text":{"type":"string","description":"Fixed text."}},"required":["kind","text"]},{"type":"object","properties":{"kind":{"type":"string","const":"input","description":"The part's type."},"key":{"type":"string","minLength":1,"description":"The key of a start field the template declares."}},"required":["kind","key"]},{"type":"object","properties":{"kind":{"type":"string","const":"role","description":"The part's type."},"roleName":{"type":"string","minLength":1,"description":"A role's name."},"field":{"type":"string","enum":["name","email","phone","title"],"description":"Which of the role's details: `name`, `email`, `phone` or `title`."}},"required":["kind","roleName","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"flow","description":"The part's type."},"field":{"type":"string","enum":["name","description","dueDate","startDate","dueTimestamp","startTimestamp","id"],"description":"Which detail of the flow: `name`, `description`, `dueDate`, `startDate`, `dueTimestamp`, `startTimestamp` or `id`."}},"required":["kind","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"organization","description":"The part's type."},"field":{"type":"string","enum":["name","id"],"description":"Which detail of the organization: `name` or `id`."}},"required":["kind","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"system","description":"The part's type."},"field":{"type":"string","const":"today","description":"Today's date, in the organization's time zone."}},"required":["kind","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"step","description":"The part's type."},"stepName":{"type":"string","minLength":1,"description":"The name of an earlier step."},"field":{"type":"string","minLength":1,"description":"The name of that step's output."}},"required":["kind","stepName","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"current_item","description":"The part's type."},"field":{"type":"string","minLength":1,"description":"A field of the current item, in a step that repeats for each item."}},"required":["kind","field"]}]}}]},"attachments":{"description":"Files attached to the email.","type":"array","items":{"type":"object","properties":{"ref":{"anyOf":[{"oneOf":[{"$ref":"#/components/schemas/StepSetting_ref_4"},{"type":"object","properties":{"kind":{"type":"string","const":"role","description":"`role`: the reference points at a person on the flow. Set `roleName` and `field` too."},"roleName":{"type":"string","minLength":1,"description":"The role's name, exactly as it appears in the template's roles."},"field":{"type":"string","minLength":1,"description":"The person's detail: `name`, `email`, `phone` or `contactId`, or the key of a custom user field."}},"required":["kind","roleName","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"input","description":"`input`: the reference points at a flow field, whether or not it is asked for at the start. Set `key` too."},"key":{"type":"string","minLength":1,"description":"The flow field's key, not its label. Any of the template's flow fields works, not only those asked for at the start. `_start_link_email` is allowed only when the flow has a start link."}},"required":["kind","key"]},{"type":"object","properties":{"kind":{"type":"string","const":"organization","description":"`organization`: the reference points at the organization. Set `field` to `name` or `id` too."},"field":{"type":"string","minLength":1,"description":"The organization detail: `name` or `id`."}},"required":["kind","field"]}]},{"type":"string","minLength":1}],"description":"A file from an earlier step, preferably as a typed reference such as `{ \"kind\": \"step\", \"stepName\": \"File Request\", \"field\": \"Uploaded Files\" }`. A text reference to a file is also accepted. Role and organization references are refused, because they hold no file."},"kind":{"type":"string","enum":["file","link"],"description":"Whether the entry is a file or a web link. Only files are attached to the email; links are left out."}},"required":["ref"]}},"includeOrgLogo":{"description":"Whether to show the organization's logo, set in Branding, at the top of the email. Defaults to `false`, so the email starts with the body.","type":"boolean"}}},"approveBeforeRun":{"description":"Whether a person approves the values this step is about to use before it runs. Available on `REST_API`, `EXTERNAL_APP`, `MCP_SERVER`, `SYSTEM_EMAIL`, `SEND_ANNOUNCEMENT`, `SEND_TO_CONVERSATION`, `SYSTEM_WEBHOOK`, `DATA_TABLE_SAVE_RECORD`, `START_FLOW`, `SCHEDULE_FLOW`, `CODE`, `COLLECT_PAYMENT`, `DOCUSIGN` and `ADOBE_SIGN` steps. When `true`, the step pauses before it calls, sends, writes, starts or schedules anything, until someone approves. Set who approves in the step's `reviewers`: a step with approval on and no approver can't be published.","type":"boolean"},"approvalRejectMode":{"description":"What a rejection does, with `approveBeforeRun`. `skip` (the default) skips this step and the flow continues; `halt` stops the flow.","type":"string","enum":["skip","halt"]},"blockOnFailure":{"type":"boolean","description":"Whether a failure stops the flow (\"Block the workflow if this step fails\"). `false` lets the flow continue past it; the failure is still recorded. Stops it when left out."}},"title":"Send Email settings","description":"The settings a `SYSTEM_EMAIL` step is sent with, beside the shared ones in `StepSettings`. This is the schema `POST /v1/templates` and `POST /v1/templates/{id}/changes` check a step against: a setting not listed here is refused with `UNKNOWN_SETTING`.\n\nSome settings depend on your organization's plan. One your plan doesn't include is refused with `UNKNOWN_SETTING`.\n\n**Checked when you publish.** A save keeps a step that isn't finished; `POST /v1/templates/{id}/check` and publish name what is still missing:\n- Email step has no recipient.\n- This email uses a value from an earlier step that no longer exists. Open it and pick an available value.\n- Approve-before-it-runs is on but no approver is assigned. Pick who approves, or turn it off.\n\nA template read (`GET /v1/templates/{id}`) returns the step's settings as stored, in `StepConfig_SYSTEM_EMAIL`.","x-moxo-step-type":"SYSTEM_EMAIL"},"StepSettings_SEND_ANNOUNCEMENT":{"type":"object","properties":{"visibleToAllAssignees":{"description":"The older form of `visibility.mode: \"ALL\"`. Use `visibility` instead.","type":"boolean"},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"},"reviewers":{"$ref":"#/components/schemas/StepSetting_reviewers"},"sendAnnouncement":{"description":"Posts a one-way announcement to the Announcements channel of the flow's chat. By default, everyone sees it and is notified, and nobody can reply. `audienceRoleIds` narrows who is notified, for example so a client update doesn't email the tax preparer. The flow's chat must have an Announcements channel.","type":"object","properties":{"body":{"description":"The announcement. Either text with references, such as `Your kickoff is ${{ steps.schedule_kickoff.fields.date }}`, or a list of parts: `{ kind: \"text\", text }` and `{ kind: \"step\" | \"input\" | \"role\" | \"flow\" | \"organization\" | \"current_item\", ... }`. The list form is checked against the template, so use it when the text refers to earlier steps, start fields, roles, the flow or the organization. Saved as text.","anyOf":[{"type":"string"},{"type":"array","items":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"text","description":"The part's type."},"text":{"type":"string","description":"Fixed text."}},"required":["kind","text"]},{"type":"object","properties":{"kind":{"type":"string","const":"input","description":"The part's type."},"key":{"type":"string","minLength":1,"description":"The key of a start field the template declares."}},"required":["kind","key"]},{"type":"object","properties":{"kind":{"type":"string","const":"role","description":"The part's type."},"roleName":{"type":"string","minLength":1,"description":"A role's name."},"field":{"type":"string","enum":["name","email","phone","title"],"description":"Which of the role's details: `name`, `email`, `phone` or `title`."}},"required":["kind","roleName","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"flow","description":"The part's type."},"field":{"type":"string","enum":["name","description","dueDate","startDate","dueTimestamp","startTimestamp","id"],"description":"Which detail of the flow: `name`, `description`, `dueDate`, `startDate`, `dueTimestamp`, `startTimestamp` or `id`."}},"required":["kind","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"organization","description":"The part's type."},"field":{"type":"string","enum":["name","id"],"description":"Which detail of the organization: `name` or `id`."}},"required":["kind","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"system","description":"The part's type."},"field":{"type":"string","const":"today","description":"Today's date, in the organization's time zone."}},"required":["kind","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"step","description":"The part's type."},"stepName":{"type":"string","minLength":1,"description":"The name of an earlier step."},"field":{"type":"string","minLength":1,"description":"The name of that step's output."}},"required":["kind","stepName","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"current_item","description":"The part's type."},"field":{"type":"string","minLength":1,"description":"A field of the current item, in a step that repeats for each item."}},"required":["kind","field"]}]}}]},"audience":{"description":"Who the announcement is for. `everyone`, or omitted, reaches every participant (the default). `roles` reaches selected roles only, and with no role selected it reaches nobody. Publishing requires at least one role when it is `roles`.","type":"string","enum":["everyone","roles"]},"audienceRoleIds":{"description":"The template role ids the announcement reaches, from the flow's roles (for example Client). Empty or omitted reaches every participant, unless `audience` is `roles`, when an empty list reaches nobody. When set, only people in those roles are emailed and notified in the app; flow managers can still read the post in the flow, marked “Sent to …”, without an unread badge.","type":"array","items":{"type":"string","minLength":1}}}},"approveBeforeRun":{"description":"Whether a person approves the values this step is about to use before it runs. Available on `REST_API`, `EXTERNAL_APP`, `MCP_SERVER`, `SYSTEM_EMAIL`, `SEND_ANNOUNCEMENT`, `SEND_TO_CONVERSATION`, `SYSTEM_WEBHOOK`, `DATA_TABLE_SAVE_RECORD`, `START_FLOW`, `SCHEDULE_FLOW`, `CODE`, `COLLECT_PAYMENT`, `DOCUSIGN` and `ADOBE_SIGN` steps. When `true`, the step pauses before it calls, sends, writes, starts or schedules anything, until someone approves. Set who approves in the step's `reviewers`: a step with approval on and no approver can't be published.","type":"boolean"},"approvalRejectMode":{"description":"What a rejection does, with `approveBeforeRun`. `skip` (the default) skips this step and the flow continues; `halt` stops the flow.","type":"string","enum":["skip","halt"]},"blockOnFailure":{"type":"boolean","description":"Whether a failure stops the flow (\"Block the workflow if this step fails\"). `false` lets the flow continue past it; the failure is still recorded. Stops it when left out."}},"title":"Send Announcement settings","description":"The settings a `SEND_ANNOUNCEMENT` step is sent with, beside the shared ones in `StepSettings`. This is the schema `POST /v1/templates` and `POST /v1/templates/{id}/changes` check a step against: a setting not listed here is refused with `UNKNOWN_SETTING`.\n\nSome settings depend on your organization's plan. One your plan doesn't include is refused with `UNKNOWN_SETTING`.\n\n**Checked when you publish.** A save keeps a step that isn't finished; `POST /v1/templates/{id}/check` and publish name what is still missing:\n- Add the announcement message this step should post.\n- Pick at least one role for this announcement, or choose All participants.\n- This announcement uses a value from an earlier step that no longer exists. Open it and pick an available value.\n- Approve-before-it-runs is on but no approver is assigned. Pick who approves, or turn it off.\n\nA template read (`GET /v1/templates/{id}`) returns the step's settings as stored, in `StepConfig_SEND_ANNOUNCEMENT`.","x-moxo-step-type":"SEND_ANNOUNCEMENT"},"StepSettings_SEND_TO_CONVERSATION":{"type":"object","properties":{"visibleToAllAssignees":{"description":"The older form of `visibility.mode: \"ALL\"`. Use `visibility` instead.","type":"boolean"},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"},"reviewers":{"$ref":"#/components/schemas/StepSetting_reviewers"},"sendToConversation":{"description":"The settings of a Send to Conversation step, which acts in a Chat conversation people can reply in. This differs from Send announcement (a post inside the flow nobody can reply to), System email (a message to an address) and Conversation (an AI conversation with the assignee). A typical setup is one `create_conversation` step with role participants, then later steps whose `target` is `{ \"mode\": \"dynamic\", \"ref\": \"{<create step name> / Conversation ID}\" }`.","type":"object","properties":{"operation":{"description":"What the step does. `create_conversation` starts a new group conversation, which later steps act on through its `Conversation ID` output. `post_message` posts one message. `share_files` adds files to the conversation's Files list, which isn't the same as attaching them to a message. `request_action` posts one ask as a card, when your organization has in-conversation actions. `add_participants` adds people to a conversation that already exists.","type":"string","enum":["create_conversation","post_message","share_files","request_action","add_participants"]},"target":{"description":"The conversation to act on. Required for every operation except `create_conversation`, which takes none. Set it to `{ \"mode\": \"dynamic\", \"ref\": \"{<create step name> / Conversation ID}\" }`.","type":"object","properties":{"mode":{"description":"How the conversation is found. `dynamic` finds it when the step runs, from `ref`; use it for every step you create. `fixed` is a conversation a person pinned in the template builder; it can't be set through the API. A step that is already `fixed` runs only after a person in that conversation confirms its exact settings, so changing any of the step's settings needs that confirmation again.","type":"string","enum":["fixed","dynamic"]},"conversationId":{"description":"The conversation a person picked in Moxo, with `mode` `fixed`. Conversations are private to their participants, so there is no list to choose from. To act on a conversation from code, start one with a `create_conversation` step and point `ref` at it.","type":"string"},"ref":{"description":"In `dynamic` mode, the `Conversation ID` output of an earlier `create_conversation` step in this template, written as `{<that step's name> / Conversation ID}`, for example `{Start the client thread / Conversation ID}`. That is the only accepted value. There is no reference for the conversation a flow was started from; the only flow values are `Name`, `Due Date`, `Start Date` and `Id`.","type":"string"}}},"sender":{"description":"Who the message appears to be from. Leave out to post as the organization. For `request_action` it is the person the ask is made on behalf of, and must be a real person: the ask records who it is owed to, which sets the reminder wording, who can cancel it and who gets the response-time credit.","type":"object","properties":{"mode":{"description":"Who the message is posted as. `organization` (the default) posts as the organization, labeled with its name; participants never see the flow or template name. `participant` posts as a named internal person from the conversation's participants, never an external user.","type":"string","enum":["organization","participant"]},"person":{"description":"The person who posts in `participant` mode, and the required creator for `create_conversation` and `request_action`: `{ \"type\": \"ROLE\", \"roleId\": \"<role>\" }` or `{ \"type\": \"USER\", \"userId\": \"<user id>\" }`. It must be an internal person who is in the conversation, such as an advisor or preparer role, never an external user. If that person can't post when the step runs, `post_message` and `share_files` post as the organization and record the substitution; `create_conversation` and `request_action` fail, because each needs a person.","oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"ROLE","description":"A role in the template. The person is whoever holds the role in each flow, so one template works for every flow."},"roleId":{"type":"string","minLength":1,"description":"The role: the `handle` of a role added in the same request, or the name of a role the template already has. It is resolved to the flow's role id when the step runs."}},"required":["type","roleId"]},{"type":"object","properties":{"type":{"type":"string","const":"USER","description":"One specific person, the same in every flow. Suits a named colleague, not an external user, who differs from flow to flow."},"userId":{"type":"string","minLength":1,"description":"The person's user id (`usr_…`)."}},"required":["type","userId"]}]},"organizationLabel":{"description":"In `organization` mode, the name the message is signed with when a team name is clearer than the organization's, such as `Provisioning` or `Billing`. Plain text, up to 60 characters, with no flow value references. Leave out to sign with the organization's name, the default. Don't use a flow or template name: participants don't see those.","type":"string","maxLength":60}}},"create":{"description":"The new conversation's settings. `create_conversation` only.","type":"object","properties":{"name":{"description":"The conversation's name. Can include flow value references, for example `${{ fields.client_name }}: ${{ fields.property_address }}`. Leave out to name it after the people in it, as Chat does.","type":"string"},"participants":{"description":"Who is in the conversation. Use role references, so each flow fills them with whoever holds the role. Use a user reference only for a named colleague.","type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"ROLE","description":"A role in the template. The person is whoever holds the role in each flow, so one template works for every flow."},"roleId":{"type":"string","minLength":1,"description":"The role: the `handle` of a role added in the same request, or the name of a role the template already has. It is resolved to the flow's role id when the step runs."}},"required":["type","roleId"]},{"type":"object","properties":{"type":{"type":"string","const":"USER","description":"One specific person, the same in every flow. Suits a named colleague, not an external user, who differs from flow to flow."},"userId":{"type":"string","minLength":1,"description":"The person's user id (`usr_…`)."}},"required":["type","userId"]}]}},"managers":{"description":"Who can rename the conversation, add people and archive it. At least one is required, and every manager must be an internal person. The creator always manages the conversation and must be internal too, so a conversation can't be all external people.","type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"ROLE","description":"A role in the template. The person is whoever holds the role in each flow, so one template works for every flow."},"roleId":{"type":"string","minLength":1,"description":"The role: the `handle` of a role added in the same request, or the name of a role the template already has. It is resolved to the flow's role id when the step runs."}},"required":["type","roleId"]},{"type":"object","properties":{"type":{"type":"string","const":"USER","description":"One specific person, the same in every flow. Suits a named colleague, not an external user, who differs from flow to flow."},"userId":{"type":"string","minLength":1,"description":"The person's user id (`usr_…`)."}},"required":["type","userId"]}]}},"showParticipantListToExternal":{"description":"Whether external people see the full participant list (names only, never email addresses). Defaults to `false`.","type":"boolean"},"firstMessage":{"description":"An optional first message, posted by the same step. Can include flow value references. People without a Moxo account get an email with a link when it is posted.","anyOf":[{"type":"string"},{"type":"array","items":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"text","description":"The part's type."},"text":{"type":"string","description":"Fixed text."}},"required":["kind","text"]},{"type":"object","properties":{"kind":{"type":"string","const":"input","description":"The part's type."},"key":{"type":"string","minLength":1,"description":"The key of a start field the template declares."}},"required":["kind","key"]},{"type":"object","properties":{"kind":{"type":"string","const":"role","description":"The part's type."},"roleName":{"type":"string","minLength":1,"description":"A role's name."},"field":{"type":"string","enum":["name","email","phone","title"],"description":"Which of the role's details: `name`, `email`, `phone` or `title`."}},"required":["kind","roleName","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"flow","description":"The part's type."},"field":{"type":"string","enum":["name","description","dueDate","startDate","dueTimestamp","startTimestamp","id"],"description":"Which detail of the flow: `name`, `description`, `dueDate`, `startDate`, `dueTimestamp`, `startTimestamp` or `id`."}},"required":["kind","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"organization","description":"The part's type."},"field":{"type":"string","enum":["name","id"],"description":"Which detail of the organization: `name` or `id`."}},"required":["kind","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"system","description":"The part's type."},"field":{"type":"string","const":"today","description":"Today's date, in the organization's time zone."}},"required":["kind","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"step","description":"The part's type."},"stepName":{"type":"string","minLength":1,"description":"The name of an earlier step."},"field":{"type":"string","minLength":1,"description":"The name of that step's output."}},"required":["kind","stepName","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"current_item","description":"The part's type."},"field":{"type":"string","minLength":1,"description":"A field of the current item, in a step that repeats for each item."}},"required":["kind","field"]}]}}]}}},"message":{"description":"The message to post. `post_message` only.","type":"object","properties":{"body":{"description":"The message. A string with flow value references, or a structured token list, which suits a message that refers to earlier steps' outputs, inputs, role details or organization and flow details. Everyone in the conversation sees it and is notified, as if a person had typed it.","anyOf":[{"type":"string"},{"type":"array","items":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"text","description":"The part's type."},"text":{"type":"string","description":"Fixed text."}},"required":["kind","text"]},{"type":"object","properties":{"kind":{"type":"string","const":"input","description":"The part's type."},"key":{"type":"string","minLength":1,"description":"The key of a start field the template declares."}},"required":["kind","key"]},{"type":"object","properties":{"kind":{"type":"string","const":"role","description":"The part's type."},"roleName":{"type":"string","minLength":1,"description":"A role's name."},"field":{"type":"string","enum":["name","email","phone","title"],"description":"Which of the role's details: `name`, `email`, `phone` or `title`."}},"required":["kind","roleName","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"flow","description":"The part's type."},"field":{"type":"string","enum":["name","description","dueDate","startDate","dueTimestamp","startTimestamp","id"],"description":"Which detail of the flow: `name`, `description`, `dueDate`, `startDate`, `dueTimestamp`, `startTimestamp` or `id`."}},"required":["kind","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"organization","description":"The part's type."},"field":{"type":"string","enum":["name","id"],"description":"Which detail of the organization: `name` or `id`."}},"required":["kind","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"system","description":"The part's type."},"field":{"type":"string","const":"today","description":"Today's date, in the organization's time zone."}},"required":["kind","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"step","description":"The part's type."},"stepName":{"type":"string","minLength":1,"description":"The name of an earlier step."},"field":{"type":"string","minLength":1,"description":"The name of that step's output."}},"required":["kind","stepName","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"current_item","description":"The part's type."},"field":{"type":"string","minLength":1,"description":"A field of the current item, in a step that repeats for each item."}},"required":["kind","field"]}]}}]},"attachments":{"description":"Files attached to the message. To put files in the conversation's Files list instead, use `share_files`.","type":"array","items":{"type":"object","properties":{"kind":{"description":"`reference` when `ref` is a reference to a flow value.","type":"string","enum":["upload","reference"]},"ref":{"anyOf":[{"type":"string","minLength":1},{"oneOf":[{"$ref":"#/components/schemas/StepSetting_ref_4"},{"type":"object","properties":{"kind":{"type":"string","const":"role","description":"`role`: the reference points at a person on the flow. Set `roleName` and `field` too."},"roleName":{"type":"string","minLength":1,"description":"The role's name, exactly as it appears in the template's roles."},"field":{"type":"string","minLength":1,"description":"The person's detail: `name`, `email`, `phone` or `contactId`, or the key of a custom user field."}},"required":["kind","roleName","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"input","description":"`input`: the reference points at a flow field, whether or not it is asked for at the start. Set `key` too."},"key":{"type":"string","minLength":1,"description":"The flow field's key, not its label. Any of the template's flow fields works, not only those asked for at the start. `_start_link_email` is allowed only when the flow has a start link."}},"required":["kind","key"]},{"type":"object","properties":{"kind":{"type":"string","const":"organization","description":"`organization`: the reference points at the organization. Set `field` to `name` or `id` too."},"field":{"type":"string","minLength":1,"description":"The organization detail: `name` or `id`."}},"required":["kind","field"]}]},{"type":"string","minLength":1}],"description":"A file output of an earlier step, preferably as `{ \"kind\": \"step\", \"stepName\": \"File Request\", \"field\": \"Uploaded Files\" }`. A flow value reference string is also accepted. Role and organization references are refused, since they hold no file."}},"required":["ref"]}}}},"files":{"description":"The files to share. `share_files` only.","type":"object","properties":{"refs":{"description":"The files to share. They are copied into the conversation, so the conversation's copy is separate from the original.","type":"array","items":{"type":"object","properties":{"kind":{"description":"`reference` when `ref` is a reference to a flow value.","type":"string","enum":["upload","reference"]},"ref":{"anyOf":[{"type":"string","minLength":1},{"oneOf":[{"$ref":"#/components/schemas/StepSetting_ref_4"},{"type":"object","properties":{"kind":{"type":"string","const":"role","description":"`role`: the reference points at a person on the flow. Set `roleName` and `field` too."},"roleName":{"type":"string","minLength":1,"description":"The role's name, exactly as it appears in the template's roles."},"field":{"type":"string","minLength":1,"description":"The person's detail: `name`, `email`, `phone` or `contactId`, or the key of a custom user field."}},"required":["kind","roleName","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"input","description":"`input`: the reference points at a flow field, whether or not it is asked for at the start. Set `key` too."},"key":{"type":"string","minLength":1,"description":"The flow field's key, not its label. Any of the template's flow fields works, not only those asked for at the start. `_start_link_email` is allowed only when the flow has a start link."}},"required":["kind","key"]},{"type":"object","properties":{"kind":{"type":"string","const":"organization","description":"`organization`: the reference points at the organization. Set `field` to `name` or `id` too."},"field":{"type":"string","minLength":1,"description":"The organization detail: `name` or `id`."}},"required":["kind","field"]}]},{"type":"string","minLength":1}],"description":"A file output of an earlier step, preferably as `{ \"kind\": \"step\", \"stepName\": \"E-signature\", \"field\": \"Signed Document\" }`. Role and organization references are refused, since they hold no file."}},"required":["ref"]}},"folderName":{"description":"A folder to put the files in, created if it doesn't exist. Can include flow value references, for example `${{ fields.tax_year }} Tax Return`. Leave out to put them at the top of the Files list.","type":"string"},"announce":{"description":"Whether to also post a message so people notice the files. Defaults to `true`.","type":"boolean"},"announceMessage":{"description":"The message posted with the files when `announce` is on. Can include flow value references. Required whenever `announce` is on, which it is unless set to `false`: publishing refuses a share with no message, and the step fails if the message is blank when it runs.","anyOf":[{"type":"string"},{"type":"array","items":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"text","description":"The part's type."},"text":{"type":"string","description":"Fixed text."}},"required":["kind","text"]},{"type":"object","properties":{"kind":{"type":"string","const":"input","description":"The part's type."},"key":{"type":"string","minLength":1,"description":"The key of a start field the template declares."}},"required":["kind","key"]},{"type":"object","properties":{"kind":{"type":"string","const":"role","description":"The part's type."},"roleName":{"type":"string","minLength":1,"description":"A role's name."},"field":{"type":"string","enum":["name","email","phone","title"],"description":"Which of the role's details: `name`, `email`, `phone` or `title`."}},"required":["kind","roleName","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"flow","description":"The part's type."},"field":{"type":"string","enum":["name","description","dueDate","startDate","dueTimestamp","startTimestamp","id"],"description":"Which detail of the flow: `name`, `description`, `dueDate`, `startDate`, `dueTimestamp`, `startTimestamp` or `id`."}},"required":["kind","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"organization","description":"The part's type."},"field":{"type":"string","enum":["name","id"],"description":"Which detail of the organization: `name` or `id`."}},"required":["kind","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"system","description":"The part's type."},"field":{"type":"string","const":"today","description":"Today's date, in the organization's time zone."}},"required":["kind","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"step","description":"The part's type."},"stepName":{"type":"string","minLength":1,"description":"The name of an earlier step."},"field":{"type":"string","minLength":1,"description":"The name of that step's output."}},"required":["kind","stepName","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"current_item","description":"The part's type."},"field":{"type":"string","minLength":1,"description":"A field of the current item, in a step that repeats for each item."}},"required":["kind","field"]}]}}]}}},"fileNames":{"description":"Read-only. Maps the storage key of each file uploaded in the template builder to its original file name, so the step can show the name again. Send it back unchanged when you change the step.","type":"object","propertyNames":{"type":"string","minLength":1},"additionalProperties":{"type":"string"}},"action":{"description":"The ask to post. `request_action` only. The flow doesn't wait for the answer: it posts the ask and moves on. To hold the flow until the work is done, use a step for that work in the flow instead.","type":"object","properties":{"source":{"description":"What kind of ask to post. `todo` (do something) and `file_request` (send a document) are described completely by a title and a description. `template` uses a saved action from the organization's Action templates, which is where asks with a document, a form, options or signatures live. An inline e-signature, form, approval or poll isn't available here.","type":"string","enum":["template","todo","file_request"]},"templateId":{"description":"With `source: \"template\"`, the id of the saved action template. Leave it unset from the API: a person picks the saved action in the step's settings, and publishing asks for it until they do.","type":"string","minLength":1},"title":{"description":"With `source` `todo` or `file_request`, what the person is asked to do, for example `Photo ID and proof of address`. Can include flow value references. Leave out with `source: \"template\"`: a saved template has its own title.","type":"string"},"description":{"description":"With `source` `todo` or `file_request`, optional detail. Can include flow value references.","type":"string"},"assignees":{"description":"Who is asked. Each entry's `person` is a role reference (usual) or a user reference. Everyone named must already be in the conversation; add them first with an `add_participants` step. With `todo` or `file_request` they share one ask rather than getting one each.","type":"array","items":{"type":"object","properties":{"seatRoleId":{"description":"The person's part in the saved action (its named recipient). Required only when the saved action gives each person their own part, such as a signature or a one-at-a-time ask; leave out otherwise.","type":"string","minLength":1},"person":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"ROLE","description":"A role in the template. The person is whoever holds the role in each flow, so one template works for every flow."},"roleId":{"type":"string","minLength":1,"description":"The role: the `handle` of a role added in the same request, or the name of a role the template already has. It is resolved to the flow's role id when the step runs."}},"required":["type","roleId"]},{"type":"object","properties":{"type":{"type":"string","const":"USER","description":"One specific person, the same in every flow. Suits a named colleague, not an external user, who differs from flow to flow."},"userId":{"type":"string","minLength":1,"description":"The person's user id (`usr_…`)."}},"required":["type","userId"]}],"description":"The person asked: `{ \"type\": \"ROLE\", \"roleId\" }` or `{ \"type\": \"USER\", \"userId\" }`."}},"required":["person"]}},"dueInDays":{"description":"When the ask is due, in whole days after this step runs. Leave out for no due date.","type":"integer","minimum":0,"maximum":365}}},"addPeople":{"description":"The people to add. `add_participants` only. Adding someone who is already there has no effect, and someone who was removed is added back rather than duplicated. A step can't remove participants.","type":"object","properties":{"people":{"description":"Who to add. Usually role references, such as a role an earlier Assign role step filled.","type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"ROLE","description":"A role in the template. The person is whoever holds the role in each flow, so one template works for every flow."},"roleId":{"type":"string","minLength":1,"description":"The role: the `handle` of a role added in the same request, or the name of a role the template already has. It is resolved to the flow's role id when the step runs."}},"required":["type","roleId"]},{"type":"object","properties":{"type":{"type":"string","const":"USER","description":"One specific person, the same in every flow. Suits a named colleague, not an external user, who differs from flow to flow."},"userId":{"type":"string","minLength":1,"description":"The person's user id (`usr_…`)."}},"required":["type","userId"]}]}},"asManagers":{"description":"Whether the people added can manage the conversation (rename it, add people, archive it). Defaults to `false`: they join as members, who can read and send. Applies to internal people only; an external person always joins as a member.","type":"boolean"}}}},"required":["operation"]},"approveBeforeRun":{"description":"Whether a person approves the values this step is about to use before it runs. Available on `REST_API`, `EXTERNAL_APP`, `MCP_SERVER`, `SYSTEM_EMAIL`, `SEND_ANNOUNCEMENT`, `SEND_TO_CONVERSATION`, `SYSTEM_WEBHOOK`, `DATA_TABLE_SAVE_RECORD`, `START_FLOW`, `SCHEDULE_FLOW`, `CODE`, `COLLECT_PAYMENT`, `DOCUSIGN` and `ADOBE_SIGN` steps. When `true`, the step pauses before it calls, sends, writes, starts or schedules anything, until someone approves. Set who approves in the step's `reviewers`: a step with approval on and no approver can't be published.","type":"boolean"},"approvalRejectMode":{"description":"What a rejection does, with `approveBeforeRun`. `skip` (the default) skips this step and the flow continues; `halt` stops the flow.","type":"string","enum":["skip","halt"]},"blockOnFailure":{"type":"boolean","description":"Whether a failure stops the flow (\"Block the workflow if this step fails\"). `false` lets the flow continue past it; the failure is still recorded. Stops it when left out."}},"title":"Send to Conversation settings","description":"The settings a `SEND_TO_CONVERSATION` step is sent with, beside the shared ones in `StepSettings`. This is the schema `POST /v1/templates` and `POST /v1/templates/{id}/changes` check a step against: a setting not listed here is refused with `UNKNOWN_SETTING`.\n\nSome settings depend on your organization's plan. One your plan doesn't include is refused with `UNKNOWN_SETTING`.\n\n**Checked when you publish.** A save keeps a step that isn't finished; `POST /v1/templates/{id}/check` and publish name what is still missing:\n- Choose what this step should do in the conversation.\n- Pick the conversation this step should act on, or point it at one an earlier step created.\n- Pick the conversation this step should act on.\n- Point this step at the conversation an earlier step created.\n- Choose who is in this conversation.\n- Choose who manages this conversation. They can rename it, add people and archive it later.\n- Write the message this step should post.\n- A message can attach at most 10 files. Remove some, or send the rest in another message.\n- Choose the files this step should share, from an earlier step.\n- A step can share at most 10 files. Remove some, or share the rest from another step.\n- Write the message to post with the files, or turn off “Also post a message”.\n- Choose what this step should ask for.\n- Choose the saved action this step should send.\n- Write what the person is being asked to do.\n- Write which document you are asking for.\n- Choose who should do this. They must already be in the conversation.\n- Choose a Creator for this action. They own it: reminders go out on their behalf and they can cancel it, so it needs a real person and cannot come from your organization.\n- Choose who starts this conversation. They become its owner, so it cannot be started by the organization.\n- Choose who to add to the conversation.\n- Choose who this appears to be from, or leave it as your organization.\n- This step uses a value from an earlier step that no longer exists. Open it and pick an available value.\n- Approve-before-it-runs is on but no approver is assigned. Pick who approves, or turn it off.\n\nA template read (`GET /v1/templates/{id}`) returns the step's settings as stored, in `StepConfig_SEND_TO_CONVERSATION`.","x-moxo-step-type":"SEND_TO_CONVERSATION"},"StepSettings_SYSTEM_UPDATE_FIELDS":{"type":"object","properties":{"visibleToAllAssignees":{"description":"The older form of `visibility.mode: \"ALL\"`. Use `visibility` instead.","type":"boolean"},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"},"systemUpdateFields":{"description":"The flow fields to write.","type":"object","properties":{"updates":{"description":"Flow field values, keyed by field key. For a list field, use the option's label. Moxo saves the field's id and the option's id. Use text for a text field and a list of text for a list field. A value can include references to flow values, such as `${{ steps.personal_information.fields.first_name }}`.","type":"object","propertyNames":{"type":"string","minLength":1},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}},"updateFileNames":{"description":"The original names of files uploaded into file fields, by field key, so Moxo can show them. Send it back unchanged when you change the step; don't set it yourself.","type":"object","propertyNames":{"type":"string","minLength":1},"additionalProperties":{"type":"string"}}}},"blockOnFailure":{"type":"boolean","description":"Whether a failure stops the flow (\"Block the workflow if this step fails\"). `false` lets the flow continue past it; the failure is still recorded. Stops it when left out."}},"title":"Update custom fields settings","description":"The settings a `SYSTEM_UPDATE_FIELDS` step is sent with, beside the shared ones in `StepSettings`. This is the schema `POST /v1/templates` and `POST /v1/templates/{id}/changes` check a step against: a setting not listed here is refused with `UNKNOWN_SETTING`.\n\nSome settings depend on your organization's plan. One your plan doesn't include is refused with `UNKNOWN_SETTING`.\n\n**Checked when you publish.** A save keeps a step that isn't finished; `POST /v1/templates/{id}/check` and publish name what is still missing:\n- Update custom fields step has no updates configured.\n\nA template read (`GET /v1/templates/{id}`) returns the step's settings as stored, in `StepConfig_SYSTEM_UPDATE_FIELDS`.","x-moxo-step-type":"SYSTEM_UPDATE_FIELDS"},"StepSettings_DATA_TABLE_LOOKUP_RECORD":{"type":"object","properties":{"visibleToAllAssignees":{"description":"The older form of `visibility.mode: \"ALL\"`. Use `visibility` instead.","type":"boolean"},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"},"reviewers":{"description":"Who picks when more than one record matches. People or roles in the organization. Required when the step asks someone to pick.","type":"object","properties":{"participants":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","const":"HUMAN","description":"A person or a role in the organization."},"userId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The person who picks, when one person is named."},"roleId":{"description":"The role that picks, when a role is named. An empty role waits until someone is assigned to it.","type":"string"},"participantId":{"description":"An id for this row in the builder. The flow does not read it.","type":"string"},"order":{"description":"Where this person or role sits in the list.","type":"number"},"personName":{"description":"The person's name, kept so the builder can show it.","type":"string"},"personEmail":{"description":"The person's email, kept so the builder can show it.","type":"string"}},"required":["type"]},"description":"Who picks. Name at least one person or role when the step asks someone to pick."},"sequential":{"description":"Whether the people pick one after another. A pick is not taken in turn, so this stays false.","type":"boolean"}},"required":["participants"]},"tableId":{"type":"string","format":"uuid","description":"The data table to look in, by its id or its name."},"match":{"anyOf":[{"$ref":"#/components/schemas/StepSetting_match"},{"$ref":"#/components/schemas/StepSetting_match_2"}],"description":"How to find the record: one column, `{ fieldId, value }`, for an exact match; or several conditions, `{ match: \"ALL\" | \"ANY\", conditions: [{ fieldId, op, value? }] }`. `fieldId` is a column's id or name. `value` is a fixed value or a reference to a value from earlier in the flow, in `conditions[].value` too; leave it out for `isEmpty` and `isNotEmpty`. Operators: `eq`, `neq`, `contains`, `isEmpty`, `isNotEmpty`, `gt`, `gte`, `lt`, `lte`, `in`, `notIn`. A Save a record step may use only `match: \"ALL\"` with `eq` on every condition, because that match identifies the row it adds when nothing matches. A Look up a record step may use `ALL` or `ANY` and any operator."},"onNoMatch":{"description":"What happens when no record matches: `fail` (the default) or `skip`.","type":"string","enum":["fail","skip"]},"onMultipleMatch":{"description":"When more than one record matches and the step returns one record: `first` uses the earliest row, `fail` stops the step, `ask` pauses and asks the people in `reviewers` to pick one. `ask` needs `reviewers` and `recordDisplay.labelFieldId`. Do not combine `ask` with returning every matching record.","type":"string","enum":["first","fail","ask"]},"recordDisplay":{"description":"How each matching record is shown when someone is asked to pick: one column names the record, and up to three more columns can be shown beside it.","type":"object","properties":{"labelFieldId":{"type":"string","format":"uuid","description":"The column used as each record's name when someone picks. Copy the column id from the Data Tables section."},"extraFieldIds":{"description":"Up to three more columns shown beside the name.","maxItems":3,"type":"array","items":{"type":"string","format":"uuid"}}},"required":["labelFieldId"]},"returnMode":{"default":"single","type":"string","enum":["single","all"],"description":"`single` returns the one matching record; `all` returns every match, as a list."},"returnLimit":{"type":"integer","exclusiveMinimum":0,"maximum":200,"description":"With `returnMode` `all`: the most records to return."},"returnAllColumns":{"type":"array","items":{"type":"string"},"description":"With `returnMode` `all`: the columns each returned record carries, by id."},"blockOnFailure":{"type":"boolean","description":"Whether a failure stops the flow (\"Block the workflow if this step fails\"). `false` lets the flow continue past it; the failure is still recorded. Stops it when left out."}},"required":["tableId","match"],"title":"Look up a record settings","description":"The settings a `DATA_TABLE_LOOKUP_RECORD` step is sent with, beside the shared ones in `StepSettings`. This is the schema `POST /v1/templates` and `POST /v1/templates/{id}/changes` check a step against: a setting not listed here is refused with `UNKNOWN_SETTING`.\n\nSome settings depend on your organization's plan. One your plan doesn't include is refused with `UNKNOWN_SETTING`.\n\n**Checked when you publish.** A save keeps a step that isn't finished; `POST /v1/templates/{id}/check` and publish name what is still missing:\n- Look up a record: choose a table.\n- Ask someone to pick is on, but nobody is chosen. Pick a person or a role, or choose another option.\n- Choose the column that names each record.\n- Show at most three more columns beside the name.\n- Look up a record: choose what to match on.\n\nA template read (`GET /v1/templates/{id}`) returns the step's settings as stored, in `StepConfig_DATA_TABLE_LOOKUP_RECORD`.","x-moxo-step-type":"DATA_TABLE_LOOKUP_RECORD"},"StepSettings_DATA_TABLE_SAVE_RECORD":{"type":"object","properties":{"visibleToAllAssignees":{"description":"The older form of `visibility.mode: \"ALL\"`. Use `visibility` instead.","type":"boolean"},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"},"reviewers":{"$ref":"#/components/schemas/StepSetting_reviewers"},"tableId":{"type":"string","format":"uuid","description":"The data table to save to, by its id or its name."},"match":{"anyOf":[{"$ref":"#/components/schemas/StepSetting_match"},{"$ref":"#/components/schemas/StepSetting_match_2"}],"description":"How to find the record: one column, `{ fieldId, value }`, for an exact match; or several conditions, `{ match: \"ALL\" | \"ANY\", conditions: [{ fieldId, op, value? }] }`. `fieldId` is a column's id or name. `value` is a fixed value or a reference to a value from earlier in the flow, in `conditions[].value` too; leave it out for `isEmpty` and `isNotEmpty`. Operators: `eq`, `neq`, `contains`, `isEmpty`, `isNotEmpty`, `gt`, `gte`, `lt`, `lte`, `in`, `notIn`. A Save a record step may use only `match: \"ALL\"` with `eq` on every condition, because that match identifies the row it adds when nothing matches. A Look up a record step may use `ALL` or `ANY` and any operator."},"set":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"},"description":"The columns to write, and their values."},"setActions":{"description":"For number columns, in Add or update mode only (`failIfExists` `false`): map a column that is in `set` to `increase` or `decrease` to add its `set` value to the row's current value, or subtract it, instead of replacing it. Use it for counts, stock and running totals. The amount is a number, 0 or more. A column left out is replaced. Not allowed on a column the step matches on.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string","enum":["increase","decrease"]}},"failIfExists":{"description":"The save mode. `false` (the default) is Add or update: find the matching row and write the values, or add a row when none matches. `true` is Add a new row: insert only, and stop if a duplicate exists.","type":"boolean"},"approveBeforeRun":{"description":"Whether a person approves the values this step is about to use before it runs. Available on `REST_API`, `EXTERNAL_APP`, `MCP_SERVER`, `SYSTEM_EMAIL`, `SEND_ANNOUNCEMENT`, `SEND_TO_CONVERSATION`, `SYSTEM_WEBHOOK`, `DATA_TABLE_SAVE_RECORD`, `START_FLOW`, `SCHEDULE_FLOW`, `CODE`, `COLLECT_PAYMENT`, `DOCUSIGN` and `ADOBE_SIGN` steps. When `true`, the step pauses before it calls, sends, writes, starts or schedules anything, until someone approves. Set who approves in the step's `reviewers`: a step with approval on and no approver can't be published.","type":"boolean"},"approvalRejectMode":{"description":"What a rejection does, with `approveBeforeRun`. `skip` (the default) skips this step and the flow continues; `halt` stops the flow.","type":"string","enum":["skip","halt"]},"blockOnFailure":{"type":"boolean","description":"Whether a failure stops the flow (\"Block the workflow if this step fails\"). `false` lets the flow continue past it; the failure is still recorded. Stops it when left out."}},"required":["tableId","match","set"],"title":"Save a record settings","description":"The settings a `DATA_TABLE_SAVE_RECORD` step is sent with, beside the shared ones in `StepSettings`. This is the schema `POST /v1/templates` and `POST /v1/templates/{id}/changes` check a step against: a setting not listed here is refused with `UNKNOWN_SETTING`.\n\nSome settings depend on your organization's plan. One your plan doesn't include is refused with `UNKNOWN_SETTING`.\n\n**Checked when you publish.** A save keeps a step that isn't finished; `POST /v1/templates/{id}/check` and publish name what is still missing:\n- Save a record: choose a table.\n- Save a record: choose what to match on.\n- Save a record: set at least one field.\n- Approve-before-it-runs is on but no approver is assigned. Pick who approves, or turn it off.\n\nA template read (`GET /v1/templates/{id}`) returns the step's settings as stored, in `StepConfig_DATA_TABLE_SAVE_RECORD`.","x-moxo-step-type":"DATA_TABLE_SAVE_RECORD"},"StepSettings_UPDATE_SPREADSHEET":{"type":"object","properties":{"visibleToAllAssignees":{"description":"The older form of `visibility.mode: \"ALL\"`. Use `visibility` instead.","type":"boolean"},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"},"mode":{"description":"`correct` (the default) updates an existing uploaded file; `populate` fills a standard template.","type":"string","enum":["correct","populate"]},"sourceFile":{"description":"In `correct` mode: a reference to the original uploaded spreadsheet, such as `${{ steps.upload_spreadsheet.fields.uploaded_files }}`. Changes are written to this file, keeping its formatting, tabs and column order.","type":"string"},"templateFile":{"description":"In `populate` mode: the standard template to fill, attached while building the template. Its other sheets and dropdowns are kept.","type":"string"},"correctedRows":{"description":"One reference to the rows to write: a table on an earlier form, or a list of records from an earlier step, such as extracted rows (for example `${{ steps.correct_rows.fields.records }}`). Each row is keyed by column label. In `correct` mode, rows are matched to the file's rows by row id or by `keyColumn`; in `populate` mode, they are written in order from `startRow`. Optional when `cellValues` fills the file on its own. Publish refuses single answers, a multi-select, or several references here (`LIST_SLOT_NOT_ROWS`); put single values in `cellValues`.","type":"string"},"cellValues":{"description":"Single values placed next to existing labels, in .xlsx files only. Optional. Each entry finds the cell whose text is `label` and writes `value` into the cell beside it (to the right by default), keeping that cell's format. A label that isn't found is reported, never guessed.","type":"array","items":{"type":"object","properties":{"label":{"type":"string","description":"The exact text of a label cell in the file, such as `Company`."},"direction":{"description":"Where the value goes, relative to the label cell. Defaults to `right`.","type":"string","enum":["right","below"]},"value":{"type":"string","description":"A reference to the value to write, such as `${{ org.name }}`."}},"required":["label","value"]}},"keyColumn":{"description":"In `correct` mode: the column label used to match rows to the original file's rows when a row has no id. Defaults to the first column.","type":"string"},"sheetName":{"description":"For .xlsx files: the worksheet to write. Defaults to the first sheet.","type":"string"},"startRow":{"description":"In `populate` mode: the row to start writing at, counting from 1, below the header. Defaults to 2.","type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"columns":{"type":"array","items":{"type":"object","properties":{"header":{"type":"string","minLength":1,"description":"The column's header in the spreadsheet."},"ref":{"type":"string","minLength":1,"description":"The value written into the column: a reference to a flow value."}},"required":["header","ref"]},"description":"The value each column gets, one entry per column, written row by row each time the step runs."},"keyColumnId":{"type":"string","description":"The column that identifies a row, by its id, when rows are matched and corrected."},"blockOnFailure":{"type":"boolean","description":"Whether a failure stops the flow (\"Block the workflow if this step fails\"). `false` lets the flow continue past it; the failure is still recorded. Stops it when left out."}},"title":"Update spreadsheet settings","description":"The settings a `UPDATE_SPREADSHEET` step is sent with, beside the shared ones in `StepSettings`. This is the schema `POST /v1/templates` and `POST /v1/templates/{id}/changes` check a step against: a setting not listed here is refused with `UNKNOWN_SETTING`.\n\nSome settings depend on your organization's plan. One your plan doesn't include is refused with `UNKNOWN_SETTING`.\n\n**Checked when you publish.** A save keeps a step that isn't finished; `POST /v1/templates/{id}/check` and publish name what is still missing:\n- Update spreadsheet: choose a list of rows to write, map values to columns, or map at least one value to a cell.\n- Update spreadsheet: use a list of rows or column mappings, not both — remove one of them.\n- Update spreadsheet: column mappings only work when filling a standard template — switch the step to fill a template, or remove the column mappings.\n- Update spreadsheet: every column mapping needs the header text of the template column it fills.\n- Update spreadsheet: every column mapping needs a value to fill the column with — pick one for each, or remove the empty ones.\n- Update spreadsheet: choose the original uploaded spreadsheet to correct.\n- Update spreadsheet: attach the standard template to fill.\n- Update spreadsheet: every mapped value needs the label of the cell to fill next to.\n- Update spreadsheet: every mapped value needs a value to write — pick the value for each cell, or remove the empty ones.\n- Update spreadsheet: placing single values next to labels only works with Excel (.xlsx) templates, not CSV. Remove the mapped values, or use an .xlsx template.\n\nA template read (`GET /v1/templates/{id}`) returns the step's settings as stored, in `StepConfig_UPDATE_SPREADSHEET`.","x-moxo-step-type":"UPDATE_SPREADSHEET"},"StepSettings_SYSTEM_UPDATE_FLOW_INFO":{"type":"object","properties":{"visibleToAllAssignees":{"description":"The older form of `visibility.mode: \"ALL\"`. Use `visibility` instead.","type":"boolean"},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"},"systemUpdateFlowInfo":{"description":"What to change on the flow when the step runs: its name, description or due date, and tags to set or clear. Every setting is optional. A value that is the same as the current one is not saved again.","type":"object","properties":{"flowName":{"description":"The flow's new name, as text that can include flow value references, such as `Onboarding for ${{ fields.customer_name }}`. When it comes out empty, the name is kept.","type":"string"},"flowDescription":{"description":"The flow's new description, as text that can include flow value references. When it comes out empty, the description is kept.","type":"string"},"dueAt":{"description":"The flow's new due date, as an ISO 8601 date and time, such as `2026-12-31T17:00:00Z`, or a flow value reference that gives one. A value that isn't a valid ISO 8601 date and time keeps the current due date.","type":"string"},"tags":{"description":"Tag groups to set or clear on the flow, one row per group. `pick` sets a tag by its id; `ddr` finds a tag by name or id when the step runs, and does nothing when that comes out empty; `clear` removes the group's tags. Leave out groups you aren't changing.","maxItems":25,"type":"array","items":{"type":"object","properties":{"groupId":{"type":"string","maxLength":80,"description":"The id of one of your organization's tag groups, including groups only admins can change. Use an id the organization has."},"mode":{"type":"string","enum":["pick","ddr","clear","text"],"description":"How `value` is read. `pick`: a tag id from the group. `ddr`: a flow value reference or a tag name, read when the step runs; an empty result doesn't clear the group. `text`: the short text for a Text group, or a flow value reference; one line, up to 80 characters. `clear`: removes the group's tags."},"value":{"description":"The value for this group: a tag id when `mode` is `pick`; a flow value reference or tag name when it is `ddr`; the short text, or a flow value reference, when it is `text`. Leave it out when `mode` is `clear`.","type":"string","maxLength":4000}},"required":["groupId","mode"]}}}},"blockOnFailure":{"type":"boolean","description":"Whether a failure stops the flow (\"Block the workflow if this step fails\"). `false` lets the flow continue past it; the failure is still recorded. Stops it when left out."}},"title":"Update flow info settings","description":"The settings a `SYSTEM_UPDATE_FLOW_INFO` step is sent with, beside the shared ones in `StepSettings`. This is the schema `POST /v1/templates` and `POST /v1/templates/{id}/changes` check a step against: a setting not listed here is refused with `UNKNOWN_SETTING`.\n\nSome settings depend on your organization's plan. One your plan doesn't include is refused with `UNKNOWN_SETTING`.\n\n**Checked when you publish.** A save keeps a step that isn't finished; `POST /v1/templates/{id}/check` and publish name what is still missing:\n- Choose what this step should update.\n\nA template read (`GET /v1/templates/{id}`) returns the step's settings as stored, in `StepConfig_SYSTEM_UPDATE_FLOW_INFO`.","x-moxo-step-type":"SYSTEM_UPDATE_FLOW_INFO"},"StepSettings_BUSINESS_RULE":{"type":"object","properties":{"visibleToAllAssignees":{"description":"The older form of `visibility.mode: \"ALL\"`. Use `visibility` instead.","type":"boolean"},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"},"businessRule":{"description":"The settings of a Business rule step: inputs (flow value references), then rules that set values when their conditions match. Conditions compare with an operator such as `eq`, `gt`, `gte`, `lt`, `lte`, `between`, `contains`, `in` or `isEmpty`. For `between`, set `value` (the lower bound) and `valueMax` (the upper bound).","type":"object","properties":{"inputs":{"description":"The input variables: each maps a flow value reference to a key the rule conditions use.","type":"array","items":{"type":"object","properties":{"key":{"type":"string","description":"The variable name the rule conditions use, for example `amount`."},"ref":{"anyOf":[{"oneOf":[{"$ref":"#/components/schemas/StepSetting_ref_4"},{"type":"object","properties":{"kind":{"type":"string","const":"role","description":"`role`: the reference points at a person on the flow. Set `roleName` and `field` too."},"roleName":{"type":"string","minLength":1,"description":"The role's name, exactly as it appears in the template's roles."},"field":{"type":"string","minLength":1,"description":"The person's detail: `name`, `email`, `phone` or `contactId`, or the key of a custom user field."}},"required":["kind","roleName","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"input","description":"`input`: the reference points at a flow field, whether or not it is asked for at the start. Set `key` too."},"key":{"type":"string","minLength":1,"description":"The flow field's key, not its label. Any of the template's flow fields works, not only those asked for at the start. `_start_link_email` is allowed only when the flow has a start link."}},"required":["kind","key"]},{"type":"object","properties":{"kind":{"type":"string","const":"organization","description":"`organization`: the reference points at the organization. Set `field` to `name` or `id` too."},"field":{"type":"string","minLength":1,"description":"The organization detail: `name` or `id`."}},"required":["kind","field"]}]},{"type":"string"}],"description":"The value to test, as a structured reference, such as `{ \"kind\": \"step\", \"stepName\": \"Intake Form\", \"field\": \"Amount\" }` or `{ \"kind\": \"input\", \"key\": \"amount\" }`, or as text, such as `${{ steps.intake_form.fields.amount }}`."}},"required":["key","ref"]}},"rules":{"description":"The rules, checked in order. The first that matches wins; mark one `isDefault` as the fallback. The step's outputs are every key the rules' `set` objects name.","type":"array","items":{"type":"object","properties":{"conditions":{"description":"The conditions, which must all match. Leave out or empty when `isDefault` is `true`.","type":"array","items":{"type":"object","properties":{"input":{"type":"string","description":"The input to test: one of the `inputs[].key` values."},"operator":{"type":"string","enum":["eq","neq","gt","gte","lt","lte","between","contains","startsWith","endsWith","in","notIn","isEmpty","isNotEmpty"],"description":"How to compare. One of `eq`, `neq`, `gt`, `gte`, `lt`, `lte`, `between`, `contains`, `startsWith`, `endsWith`, `in`, `notIn`, `isEmpty` or `isNotEmpty`."},"value":{"description":"The value to compare with; can include flow value references. Leave out for `isEmpty` and `isNotEmpty`. For `in` and `notIn`, a comma-separated list. For `between`, the lower bound (inclusive).","type":"string"},"valueMax":{"description":"The upper bound (inclusive). Required for `between`; ignored otherwise.","type":"string"}},"required":["input","operator"]}},"set":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"The outputs this rule sets when it matches, such as `{ \"riskLevel\": \"high\" }`."},"isDefault":{"description":"Whether this is the fallback rule, which matches when no earlier rule did.","type":"boolean"}},"required":["set"]}},"outputs":{"type":"array","items":{},"description":"The fields the rules set, taken from every rule's `set`."}}},"blockOnFailure":{"type":"boolean","description":"Whether a failure stops the flow (\"Block the workflow if this step fails\"). `false` lets the flow continue past it; the failure is still recorded. Stops it when left out."}},"title":"Business Rule settings","description":"The settings a `BUSINESS_RULE` step is sent with, beside the shared ones in `StepSettings`. This is the schema `POST /v1/templates` and `POST /v1/templates/{id}/changes` check a step against: a setting not listed here is refused with `UNKNOWN_SETTING`.\n\nSome settings depend on your organization's plan. One your plan doesn't include is refused with `UNKNOWN_SETTING`.\n\n**Checked when you publish.** A save keeps a step that isn't finished; `POST /v1/templates/{id}/check` and publish name what is still missing:\n- Add at least one rule.\n- Business rule has no outputs. Give each rule at least one value to set.\n\nA template read (`GET /v1/templates/{id}`) returns the step's settings as stored, in `StepConfig_BUSINESS_RULE`.","x-moxo-step-type":"BUSINESS_RULE"},"StepSettings_MATH":{"type":"object","properties":{"visibleToAllAssignees":{"description":"The older form of `visibility.mode: \"ALL\"`. Use `visibility` instead.","type":"boolean"},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"},"math":{"description":"The settings of a Calculate step: inputs (flow value references, each with a variable name), then formulas evaluated in order, then the results to make available to later steps.","type":"object","properties":{"inputs":{"description":"The input variables, each read from an earlier step through a flow value reference.","type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"The variable name used in formulas, for example `subtotal`."},"ref":{"anyOf":[{"oneOf":[{"$ref":"#/components/schemas/StepSetting_ref_4"},{"type":"object","properties":{"kind":{"type":"string","const":"role","description":"`role`: the reference points at a person on the flow. Set `roleName` and `field` too."},"roleName":{"type":"string","minLength":1,"description":"The role's name, exactly as it appears in the template's roles."},"field":{"type":"string","minLength":1,"description":"The person's detail: `name`, `email`, `phone` or `contactId`, or the key of a custom user field."}},"required":["kind","roleName","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"input","description":"`input`: the reference points at a flow field, whether or not it is asked for at the start. Set `key` too."},"key":{"type":"string","minLength":1,"description":"The flow field's key, not its label. Any of the template's flow fields works, not only those asked for at the start. `_start_link_email` is allowed only when the flow has a start link."}},"required":["kind","key"]},{"type":"object","properties":{"kind":{"type":"string","const":"organization","description":"`organization`: the reference points at the organization. Set `field` to `name` or `id` too."},"field":{"type":"string","minLength":1,"description":"The organization detail: `name` or `id`."}},"required":["kind","field"]}]},{"type":"string"}],"description":"The value, as a structured reference, such as `{ \"kind\": \"step\", \"stepName\": \"Intake Form\", \"field\": \"Subtotal\" }` or `{ \"kind\": \"input\", \"key\": \"subtotal\" }`, or as text, such as `${{ steps.intake_form.fields.subtotal }}`. The step reads it by its `name`: a code step as `input.<name>`."},"type":{"description":"How to read the value. `CURRENCY` removes currency symbols and commas; `PERCENTAGE` removes `%`.","type":"string","enum":["NUMBER","CURRENCY","PERCENTAGE"]},"default":{"description":"The value used when the reference has no value or isn't a number.","type":"number"}},"required":["name","ref"]}},"operations":{"description":"Named calculations, evaluated from top to bottom. Each can use the inputs and earlier calculations.","type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"The result's name, used by later calculations and outputs."},"formula":{"type":"string","description":"The formula, for example `subtotal * (discount / 100)`. Supports `+`, `-`, `*`, `/`, `%`, `round()`, `min()`, `max()`, `ceil()`, `floor()`, `abs()` and conditionals (`a > b ? a : b`)."},"format":{"description":"How the result is shown: `NUMBER`, `CURRENCY` or `PERCENTAGE`. It doesn't change the calculated number, and a `%` or `$` in the formula is not a format. May be absent on calculations created earlier.","type":"string","enum":["NUMBER","CURRENCY","PERCENTAGE"]}},"required":["name","formula"]}},"outputs":{"description":"The calculated values to make available to later steps.","type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"The name of a calculation or an input."}},"required":["name"]}},"onError":{"description":"What happens when a calculation fails or isn't a number. `FAIL`: the flow stops. `USE_DEFAULTS`: `0` is used instead and the flow continues.","type":"string","enum":["FAIL","USE_DEFAULTS"]}}},"blockOnFailure":{"type":"boolean","description":"Whether a failure stops the flow (\"Block the workflow if this step fails\"). `false` lets the flow continue past it; the failure is still recorded. Stops it when left out."}},"title":"Calculate settings","description":"The settings a `MATH` step is sent with, beside the shared ones in `StepSettings`. This is the schema `POST /v1/templates` and `POST /v1/templates/{id}/changes` check a step against: a setting not listed here is refused with `UNKNOWN_SETTING`.\n\nSome settings depend on your organization's plan. One your plan doesn't include is refused with `UNKNOWN_SETTING`.\n\n**Checked when you publish.** A save keeps a step that isn't finished; `POST /v1/templates/{id}/check` and publish name what is still missing:\n- Add at least one input value.\n- Add at least one calculation.\n\nA template read (`GET /v1/templates/{id}`) returns the step's settings as stored, in `StepConfig_MATH`.","x-moxo-step-type":"MATH"},"StepSettings_CODE":{"type":"object","properties":{"visibleToAllAssignees":{"description":"The older form of `visibility.mode: \"ALL\"`. Use `visibility` instead.","type":"boolean"},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"},"reviewers":{"$ref":"#/components/schemas/StepSetting_reviewers"},"code":{"description":"The code step's settings: its inputs (references to values from earlier in the flow, each with a variable name), the code to run and the returned values later steps can use.","type":"object","properties":{"inputs":{"description":"The input variables, each read from an earlier step through a flow value reference.","type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"The variable name the code reads the input as, for example `subtotal`."},"ref":{"anyOf":[{"oneOf":[{"$ref":"#/components/schemas/StepSetting_ref_4"},{"type":"object","properties":{"kind":{"type":"string","const":"role","description":"`role`: the reference points at a person on the flow. Set `roleName` and `field` too."},"roleName":{"type":"string","minLength":1,"description":"The role's name, exactly as it appears in the template's roles."},"field":{"type":"string","minLength":1,"description":"The person's detail: `name`, `email`, `phone` or `contactId`, or the key of a custom user field."}},"required":["kind","roleName","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"input","description":"`input`: the reference points at a flow field, whether or not it is asked for at the start. Set `key` too."},"key":{"type":"string","minLength":1,"description":"The flow field's key, not its label. Any of the template's flow fields works, not only those asked for at the start. `_start_link_email` is allowed only when the flow has a start link."}},"required":["kind","key"]},{"type":"object","properties":{"kind":{"type":"string","const":"organization","description":"`organization`: the reference points at the organization. Set `field` to `name` or `id` too."},"field":{"type":"string","minLength":1,"description":"The organization detail: `name` or `id`."}},"required":["kind","field"]}]},{"type":"string"}],"description":"The value, as a structured reference, such as `{ \"kind\": \"step\", \"stepName\": \"Intake Form\", \"field\": \"Subtotal\" }` or `{ \"kind\": \"input\", \"key\": \"subtotal\" }`, or as text, such as `${{ steps.intake_form.fields.subtotal }}`. The step reads it by its `name`: a code step as `input.<name>`."}},"required":["name","ref"]}},"code":{"description":"The code to run. Export a `handler(input, context)` function, read each input as `input.<name>`, and return an object whose keys are the declared outputs. Call connected apps only through `api.fetch(connectionId, { path, method, bodyType, body, headers })`, not `fetch`, `require` or `import`; `bodyType` is `\"json\"` (the default) or `\"form\"`. Credentials reach the code only through a connection, so don't write one into the code. `dates.today()`, `dates.parse()` and `dates.format()` use the organization's time zone (`context.orgTimezone`); `dates.utc` and `context.invokedAt` are in UTC.","type":"string"},"outputs":{"description":"The returned values later steps can use.","type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"The name of a value the code returns (a key of the returned object). Later steps can reference it."},"type":{"description":"The type of the returned value: `text`, `number`, `boolean`, `date`, `list` or `object`. Later steps' references are checked against it, and the returned value is checked when the code runs. Defaults to `text`. For a `list`, `itemFields` names the keys each item has, so a For each loop can reference `${{ current.item.<name> }}`.","type":"string","enum":["text","number","boolean","date","list","object"]},"itemFields":{"description":"For a `list` only: the keys the code returns on every item, each with a name and a type (`TEXT`, `NUMBER`, `DATE` or `BOOLEAN`), for example `[{ \"name\": \"product_code\", \"type\": \"TEXT\" }]`. Leave it out or empty to keep the list open: later steps can still reference `${{ current.item.<key> }}`. Names are exact (`product_code` and `product-code` differ). Don't use `Index`, `Number`, `Total` or `Value`: a For each loop uses them for the position in the list and for the whole item.","type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"A key the code returns on each list item. A For each loop references it as `${{ current.item.<name> }}`. A name that starts with `_` must match exactly, including case."},"type":{"type":"string","enum":["TEXT","NUMBER","DATE","BOOLEAN"],"description":"The key's type, checked when the code returns: `TEXT`, `NUMBER`, `DATE` or `BOOLEAN`."}},"required":["name","type"]}}},"required":["name"]}},"onError":{"description":"What happens when the code fails or returns an output of the wrong type. `USE_DEFAULTS` (the default): an output that failed, is missing or has the wrong type is `null`, and the flow continues. `FAIL`: the step fails and the flow stops there.","type":"string","enum":["FAIL","USE_DEFAULTS"]},"language":{"description":"The language of the code. JavaScript only.","type":"string","enum":["JAVASCRIPT"]},"timeoutMs":{"description":"The longest the code may run before it is stopped.","type":"number"},"memoryMb":{"description":"The most memory the code may use before it is stopped.","type":"number"},"maxOutputBytes":{"description":"The largest value the code may return. A larger value is cut short or refused.","type":"number"},"allowedConnectionIds":{"description":"The connection ids `api.fetch` may use. A connection id not in this list is refused.","type":"array","items":{"type":"string"}}}},"approveBeforeRun":{"description":"Whether a person approves the values this step is about to use before it runs. Available on `REST_API`, `EXTERNAL_APP`, `MCP_SERVER`, `SYSTEM_EMAIL`, `SEND_ANNOUNCEMENT`, `SEND_TO_CONVERSATION`, `SYSTEM_WEBHOOK`, `DATA_TABLE_SAVE_RECORD`, `START_FLOW`, `SCHEDULE_FLOW`, `CODE`, `COLLECT_PAYMENT`, `DOCUSIGN` and `ADOBE_SIGN` steps. When `true`, the step pauses before it calls, sends, writes, starts or schedules anything, until someone approves. Set who approves in the step's `reviewers`: a step with approval on and no approver can't be published.","type":"boolean"},"approvalRejectMode":{"description":"What a rejection does, with `approveBeforeRun`. `skip` (the default) skips this step and the flow continues; `halt` stops the flow.","type":"string","enum":["skip","halt"]},"blockOnFailure":{"type":"boolean","description":"Whether a failure stops the flow (\"Block the workflow if this step fails\"). `false` lets the flow continue past it; the failure is still recorded. Stops it when left out."}},"title":"Run code settings","description":"The settings a `CODE` step is sent with, beside the shared ones in `StepSettings`. This is the schema `POST /v1/templates` and `POST /v1/templates/{id}/changes` check a step against: a setting not listed here is refused with `UNKNOWN_SETTING`.\n\nSome settings depend on your organization's plan. One your plan doesn't include is refused with `UNKNOWN_SETTING`.\n\n**When the code runs.** Credentials, dates and `context`:\n\n- Credentials reach the code only through a connection (`api.fetch`). There\n  are no secrets inside the code. Never paste a credential into the code.\n- `context` carries `{ invokedAt, orgTimezone, utc, viewer, organization, portal }`.\n  `invokedAt` is an ISO timestamp in UTC. `orgTimezone` is the organization's\n  IANA time zone (for example `Asia/Singapore`), or `UTC` when the org has\n  not set one. `utc` is the string `\"UTC\"`.\n- `dates.today()`, `dates.parse()`, and `dates.format()` use\n  `context.orgTimezone`. A date-only value such as `\"2026-10-20\"` is the\n  start of that calendar day in the org zone. `\"9:00 AM\"` is that wall time\n  on today's org calendar day. `dates.utc` is the same helpers in UTC.\n  `dates.format(value, \"iso\")` is always a UTC ISO timestamp.\n- The sandbox process clock is not switched. `new Date()`, `getHours()`,\n  and `toISOString()` keep their existing meaning. Use `dates` when the\n  calendar day should follow the organization. Use `dates.utc` or an ISO\n  timestamp when you want UTC.\n\n**Checked when you publish.** A save keeps a step that isn't finished; `POST /v1/templates/{id}/check` and publish name what is still missing:\n- Add code to run.\n- Add at least one output.\n- Approve-before-it-runs is on but no approver is assigned. Pick who approves, or turn it off.\n\nA template read (`GET /v1/templates/{id}`) returns the step's settings as stored, in `StepConfig_CODE`.","x-moxo-step-type":"CODE"},"StepSettings_FORMAT":{"type":"object","properties":{"visibleToAllAssignees":{"description":"The older form of `visibility.mode: \"ALL\"`. Use `visibility` instead.","type":"boolean"},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"},"format":{"type":"object","properties":{"operation":{"type":"string","enum":["split_text","join_list","parse_json","to_json","map_values","default_if_empty","text_cleanup","name","phone","address","date","extract","list_cleanup","list_pick","pick_property","find_item","text_between","text_slice","strip_html","count","date_add","date_diff","number_format"],"description":"The operation. Text: `split_text` turns delimited text into a list; `join_list` combines `input` and `extraInputs` into one text, or one list with `combineAs` `list`; `text_cleanup` trims, changes case, finds and replaces, or shortens; `extract` finds the first email, URL or number; `text_between` returns the text after `betweenStart` and before `betweenEnd` (the end of the line when `betweenEnd` is empty); `text_slice` returns the first or last `sliceCount` characters, or `sliceCount` characters from `slicePosition` (such as the last 4 digits of an account number); `strip_html` returns plain text from HTML; `count` counts items, words, characters or lines. Values: `name` splits a full name; `phone` writes a number in international (+E.164) form; `address` splits an address, given as an object or on one line; `date` reformats a date or time. Lists: `list_cleanup` drops blanks and repeats, and can sort; `list_pick` gets the first, last or nth item. Records: `pick_property` reads one field of an object; `find_item` finds the record in a list whose field matches a value. Dates: `date_add` adds or subtracts `dateAmount` `dateUnit` (`business_days` skips weekends); `date_diff` returns the whole `dateUnit`s from `compareTo` (`now` or `compareValue`) to the input, positive when the input is later. Dates are read as ISO dates, MM/DD/YYYY or DD/MM/YYYY (`dateInput`), month names, times or Unix seconds. Numbers: `number_format` rounds a number or numeric text (`decimals`, `rounding`) and writes it in the `numberStyle` you choose: `number` (1,234.5), `percent` (25%), `money` in `currencyCode` ($1,234.50) or `plain` (1234.5); `money` also reads `{ amount, currency }`. Other: `map_values` replaces values from a table of `mappings`; `default_if_empty` uses a fallback when the value is blank; `parse_json` and `to_json` read and write JSON text. Use this step instead of a code step for any of these."},"input":{"anyOf":[{"oneOf":[{"$ref":"#/components/schemas/StepSetting_ref_4"},{"type":"object","properties":{"kind":{"type":"string","const":"role","description":"`role`: the reference points at a person on the flow. Set `roleName` and `field` too."},"roleName":{"type":"string","minLength":1,"description":"The role's name, exactly as it appears in the template's roles."},"field":{"type":"string","minLength":1,"description":"The person's detail: `name`, `email`, `phone` or `contactId`, or the key of a custom user field."}},"required":["kind","roleName","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"input","description":"`input`: the reference points at a flow field, whether or not it is asked for at the start. Set `key` too."},"key":{"type":"string","minLength":1,"description":"The flow field's key, not its label. Any of the template's flow fields works, not only those asked for at the start. `_start_link_email` is allowed only when the flow has a start link."}},"required":["kind","key"]},{"type":"object","properties":{"kind":{"type":"string","const":"organization","description":"`organization`: the reference points at the organization. Set `field` to `name` or `id` too."},"field":{"type":"string","minLength":1,"description":"The organization detail: `name` or `id`."}},"required":["kind","field"]}]},{"type":"string"}],"description":"The value to reshape, as a structured reference, such as `{ \"kind\": \"step\", \"stepName\": \"Intake\", \"field\": \"Tags\" }`, or as text, such as `${{ steps.intake.fields.tags }}`."},"matchMode":{"type":"string","enum":["exact","ignore_case","contains","starts_with"],"description":"For `find_item`: how the value is compared, `exact`, `ignore_case`, `contains` or `starts_with`."},"extractKind":{"type":"string","enum":["email","url","number"],"description":"For `extract`: what to find, an `email`, a `url` or a `number`."},"dateOutput":{"type":"string","enum":["date","date_time","time"],"description":"For `date`: what to write, the `date`, the `time` or both (`date_time`)."},"dateFormat":{"type":"string","enum":["yyyy_mm_dd","mm_dd_yyyy","dd_mm_yyyy","month_day_year","iso","readable_12h","readable_24h","hh_mm_24","hh_mm_12","unix_seconds"],"description":"For `date`: the output format, such as `YYYY-MM-DD`, `MM/DD/YYYY`, a readable date or time, or Unix seconds."},"timeZone":{"description":"For `date` and `date_diff`: a time zone name, such as `America/New_York`. Publishing fails on a time zone that doesn't exist. Omit it to keep the source time.","type":"string"},"decimals":{"description":"For `number_format`: decimal places, from 0 to 10. Money defaults to 2; other styles keep the number as it is.","type":"integer","minimum":0,"maximum":10},"currencyCode":{"description":"For `number_format` with `numberStyle` `money`: an ISO 4217 currency code, such as `USD` or `EUR`. It overrides the value's own currency; omit it to use that currency.","type":"string","pattern":"^[A-Z]{3}$"},"rounding":{"description":"For `number_format`: `nearest` (the default), `up` or `down`.","type":"string","enum":["nearest","up","down"]},"dateInput":{"description":"For `date`, `date_add` and `date_diff`: how to read a date with slashes, such as 03/04/2026. `auto` (the default) reads it day first when only day first is possible, and month first otherwise; `mdy` always reads month first; `dmy` always reads day first.","type":"string","enum":["auto","mdy","dmy"]},"dateAmount":{"description":"For `date_add`: how many `dateUnit` to add or subtract, as a whole number or a reference to a number from an earlier step. Publishing fails on a fixed value that isn't a whole number up to 36,600.","anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"anyOf":[{"oneOf":[{"$ref":"#/components/schemas/StepSetting_ref_4"},{"type":"object","properties":{"kind":{"type":"string","const":"role","description":"`role`: the reference points at a person on the flow. Set `roleName` and `field` too."},"roleName":{"type":"string","minLength":1,"description":"The role's name, exactly as it appears in the template's roles."},"field":{"type":"string","minLength":1,"description":"The person's detail: `name`, `email`, `phone` or `contactId`, or the key of a custom user field."}},"required":["kind","roleName","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"input","description":"`input`: the reference points at a flow field, whether or not it is asked for at the start. Set `key` too."},"key":{"type":"string","minLength":1,"description":"The flow field's key, not its label. Any of the template's flow fields works, not only those asked for at the start. `_start_link_email` is allowed only when the flow has a start link."}},"required":["kind","key"]},{"type":"object","properties":{"kind":{"type":"string","const":"organization","description":"`organization`: the reference points at the organization. Set `field` to `name` or `id` too."},"field":{"type":"string","minLength":1,"description":"The organization detail: `name` or `id`."}},"required":["kind","field"]}]},{"type":"string"}]}]},"dateUnit":{"description":"For `date_add` and `date_diff`: `minutes`, `hours`, `days` (the default), `business_days` (Monday to Friday), `weeks`, `months` or `years`.","type":"string","enum":["minutes","hours","days","business_days","weeks","months","years"]},"dateDirection":{"description":"For `date_add`: `add` (the default) or `subtract`.","type":"string","enum":["add","subtract"]},"compareTo":{"description":"For `date_diff`: `now` (the default) or `value`, which uses `compareValue`.","type":"string","enum":["now","value"]},"compareValue":{"description":"For `date_diff` with `compareTo` set to `value`: the other date, usually a reference to an earlier step.","anyOf":[{"oneOf":[{"$ref":"#/components/schemas/StepSetting_ref_4"},{"type":"object","properties":{"kind":{"type":"string","const":"role","description":"`role`: the reference points at a person on the flow. Set `roleName` and `field` too."},"roleName":{"type":"string","minLength":1,"description":"The role's name, exactly as it appears in the template's roles."},"field":{"type":"string","minLength":1,"description":"The person's detail: `name`, `email`, `phone` or `contactId`, or the key of a custom user field."}},"required":["kind","roleName","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"input","description":"`input`: the reference points at a flow field, whether or not it is asked for at the start. Set `key` too."},"key":{"type":"string","minLength":1,"description":"The flow field's key, not its label. Any of the template's flow fields works, not only those asked for at the start. `_start_link_email` is allowed only when the flow has a start link."}},"required":["kind","key"]},{"type":"object","properties":{"kind":{"type":"string","const":"organization","description":"`organization`: the reference points at the organization. Set `field` to `name` or `id` too."},"field":{"type":"string","minLength":1,"description":"The organization detail: `name` or `id`."}},"required":["kind","field"]}]},{"type":"string"}]},"numberStyle":{"description":"For `number_format`: `number` (1,234.5, the default), `percent` (0.25 becomes 25%), `money` ($1,234.50, in `currencyCode` or the value's own currency) or `plain` (1234.5).","type":"string","enum":["number","percent","money","plain"]},"betweenStart":{"description":"For `text_between`: the text immediately before the part to return, matched without regard to capitals. Empty starts at the beginning.","type":"string"},"betweenEnd":{"description":"For `text_between`: the text immediately after the part to return, matched without regard to capitals. Empty stops at the end of the line.","type":"string"},"slicePart":{"description":"For `text_slice`: `first` (the default), `last` or `position`.","type":"string","enum":["first","last","position"]},"sliceCount":{"description":"For `text_slice`: how many characters to keep. Required for `first` and `last`; with `position`, leave it out to keep the rest of the text.","anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}]},"slicePosition":{"description":"For `text_slice` with `slicePart` set to `position`: the character to start at, counting from 1. Defaults to 1.","anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}]},"countKind":{"description":"For `count`: `items` (the default), `words`, `characters` or `lines`.","type":"string","enum":["items","words","characters","lines"]},"eachItem":{"description":"For `phone`, `name`, `date` and `text_cleanup` only: apply the operation to each item of a list, and return a list.","type":"boolean"},"listUnique":{"type":"boolean","description":"For `list_cleanup`, and `join_list` with `combineAs` set to `list`: drops repeated items, without regard to capitals. Defaults to `true`."},"listSort":{"type":"boolean","description":"For `list_cleanup`, and `join_list` with `combineAs` set to `list`: sorts the items A to Z. Defaults to `false`."},"pickPosition":{"type":"string","enum":["first","last","number"],"description":"For `list_pick`: `first`, `last` or `number` (uses `pickIndex`)."},"pickIndex":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991,"description":"For `list_pick` with `pickPosition` set to `number`: the position of the item to return, counting from 1."},"propertyKey":{"type":"string","description":"For `pick_property`: the key of the field to return."},"propertyType":{"description":"For `pick_property`: the type later steps see for the value: `TEXT`, `EMAIL`, `PHONE`, `URL`, `NUMBER`, `DATE`, `BOOLEAN` or `JSON`. Omit it to decide by the field's name: `email` is `EMAIL`; `url`, `website` or `link` is `URL`; anything else is `TEXT`.","type":"string","enum":["TEXT","EMAIL","PHONE","URL","NUMBER","DATE","BOOLEAN","JSON"]},"findField":{"type":"string","description":"For `find_item`: the field to search on each item."},"findValue":{"anyOf":[{"oneOf":[{"$ref":"#/components/schemas/StepSetting_ref_4"},{"type":"object","properties":{"kind":{"type":"string","const":"role","description":"`role`: the reference points at a person on the flow. Set `roleName` and `field` too."},"roleName":{"type":"string","minLength":1,"description":"The role's name, exactly as it appears in the template's roles."},"field":{"type":"string","minLength":1,"description":"The person's detail: `name`, `email`, `phone` or `contactId`, or the key of a custom user field."}},"required":["kind","roleName","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"input","description":"`input`: the reference points at a flow field, whether or not it is asked for at the start. Set `key` too."},"key":{"type":"string","minLength":1,"description":"The flow field's key, not its label. Any of the template's flow fields works, not only those asked for at the start. `_start_link_email` is allowed only when the flow has a start link."}},"required":["kind","key"]},{"type":"object","properties":{"kind":{"type":"string","const":"organization","description":"`organization`: the reference points at the organization. Set `field` to `name` or `id` too."},"field":{"type":"string","minLength":1,"description":"The organization detail: `name` or `id`."}},"required":["kind","field"]}]},{"type":"string"}],"description":"For `find_item`: the value to look for, compared after trimming and without regard to capitals. Use a reference when the value comes from an earlier step."},"properties":{"description":"For `find_item`: the record's fields to output, each `{ name, key, type }`. `key` is the object's key, and the key later steps use. `type` is the type later steps see; when it is left out, a field named like an email or a URL keeps that type and any other is text.","type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"The label for this field, such as \"Email\"."},"key":{"type":"string","description":"The key to read from the object, which is also the field's key in references, such as `email`."},"type":{"description":"The type later steps see for this field: `TEXT`, `EMAIL`, `PHONE`, `URL`, `NUMBER`, `DATE`, `BOOLEAN` or `JSON`. Omit it to decide by the field's name: `email` is `EMAIL`; `url`, `website` or `link` is `URL`; anything else is `TEXT`.","type":"string","enum":["TEXT","EMAIL","PHONE","URL","NUMBER","DATE","BOOLEAN","JSON"]}},"required":["name","key"]}},"extraInputs":{"description":"For `join_list`: more values to combine after `input`.","type":"array","items":{"anyOf":[{"oneOf":[{"$ref":"#/components/schemas/StepSetting_ref_4"},{"type":"object","properties":{"kind":{"type":"string","const":"role","description":"`role`: the reference points at a person on the flow. Set `roleName` and `field` too."},"roleName":{"type":"string","minLength":1,"description":"The role's name, exactly as it appears in the template's roles."},"field":{"type":"string","minLength":1,"description":"The person's detail: `name`, `email`, `phone` or `contactId`, or the key of a custom user field."}},"required":["kind","roleName","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"input","description":"`input`: the reference points at a flow field, whether or not it is asked for at the start. Set `key` too."},"key":{"type":"string","minLength":1,"description":"The flow field's key, not its label. Any of the template's flow fields works, not only those asked for at the start. `_start_link_email` is allowed only when the flow has a start link."}},"required":["kind","key"]},{"type":"object","properties":{"kind":{"type":"string","const":"organization","description":"`organization`: the reference points at the organization. Set `field` to `name` or `id` too."},"field":{"type":"string","minLength":1,"description":"The organization detail: `name` or `id`."}},"required":["kind","field"]}]},{"type":"string"}]}},"combineAs":{"description":"For `join_list`: `text` (the default) or `list`.","type":"string","enum":["text","list"]},"separator":{"type":"string","enum":["comma","semicolon","newline","tab","space","custom"],"description":"What `split_text` splits on. `custom` uses `customSeparator`."},"customSeparator":{"type":"string","description":"The exact characters `split_text` splits on when `separator` is `custom`."},"trimItems":{"type":"boolean","description":"For `split_text`: trims spaces around each item. Defaults to `true`."},"dropEmpty":{"type":"boolean","description":"For `split_text`: drops empty items. Defaults to `true`."},"joinSeparator":{"type":"string","description":"For `join_list`: the text placed between items. Defaults to `\", \"`."},"mappings":{"description":"For `map_values`: the rows, at most 200. Each `from` must match exactly, once spaces at either end are removed.","maxItems":200,"type":"array","items":{"type":"object","properties":{"from":{"type":"string","description":"The value to match, exactly, after trimming, such as `in_progress`."},"to":{"type":"string","description":"The value written when `from` matches, such as `Active`."}},"required":["from","to"]}},"unmatched":{"type":"string","enum":["keep","default","fail"],"description":"For `map_values`, when no row matches: keep the original, use `unmatchedDefault`, or fail the step."},"unmatchedDefault":{"type":"string","description":"For `map_values`: the value used when `unmatched` is `default`."},"defaultValue":{"type":"string","description":"For `default_if_empty`: the value used when the input is blank."},"trim":{"type":"boolean","description":"For `text_cleanup`: trims the ends. Defaults to `true`."},"textCase":{"type":"string","enum":["none","upper","lower","title"],"description":"For `text_cleanup`: `none`, `upper`, `lower` or `title`."},"find":{"type":"string","description":"For `text_cleanup`: the exact text to replace. Empty means nothing is replaced."},"replaceWith":{"type":"string","description":"For `text_cleanup`: the replacement for every occurrence of `find`."},"truncateLength":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}],"description":"For `text_cleanup`: the most characters to keep. Omit it, or send `null`, to keep the whole value."},"truncateEllipsis":{"type":"boolean","description":"For `text_cleanup`: ends a shortened value with an ellipsis. Defaults to `true`."}},"required":["operation","input"],"description":"The Format data step's settings: one operation on one input. Later steps read the outcome as the step's `Result`."},"blockOnFailure":{"type":"boolean","description":"Whether a failure stops the flow (\"Block the workflow if this step fails\"). `false` lets the flow continue past it; the failure is still recorded. Stops it when left out."}},"required":["format"],"title":"Format data settings","description":"The settings a `FORMAT` step is sent with, beside the shared ones in `StepSettings`. This is the schema `POST /v1/templates` and `POST /v1/templates/{id}/changes` check a step against: a setting not listed here is refused with `UNKNOWN_SETTING`.\n\nSome settings depend on your organization's plan. One your plan doesn't include is refused with `UNKNOWN_SETTING`.\n\n**Checked when you publish.** A save keeps a step that isn't finished; `POST /v1/templates/{id}/check` and publish name what is still missing:\n- Choose a format operation.\n- Choose the value to format.\n- Add a separator to split on.\n- Add at least one value to map.\n- A map can have at most 200 rows.\n- Add the value to use when this is empty.\n- Add the value to use when nothing in the map matches.\n- Choose what to extract (email, URL, or number).\n- Choose what to output (date, time, or date and time).\n- Choose which item number to get.\n- Add how much time to add or subtract.\n- Choose the other date to compare with.\n- Add the field to return.\n- Add the field to search.\n- Add the value to search for.\n- Add at least one field to return.\n- Add the text that comes before or after the part you want.\n- Add how many characters to get.\n\nA template read (`GET /v1/templates/{id}`) returns the step's settings as stored, in `StepConfig_FORMAT`.","x-moxo-step-type":"FORMAT"},"StepSettings_REST_API":{"type":"object","properties":{"visibleToAllAssignees":{"description":"The older form of `visibility.mode: \"ALL\"`. Use `visibility` instead.","type":"boolean"},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"},"reviewers":{"$ref":"#/components/schemas/StepSetting_reviewers"},"restApi":{"description":"The API call. The address, headers and body can include references to flow values. To send files from earlier steps, use `bodyType` `multipart` with `formFields`.","type":"object","properties":{"url":{"description":"The URL to call. Can include references, such as `https://api.example.com/users/${{ steps.kickoff.fields.client_id }}`.","type":"string"},"method":{"type":"string","enum":["GET","POST","PUT","PATCH","DELETE"],"description":"The HTTP method: `GET`, `POST`, `PUT`, `PATCH` or `DELETE`."},"queryParams":{"description":"Query parameters added to the URL. Each value can include a reference, such as `{ \"country\": \"${{ steps.address_form.fields.country }}\" }`.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"headers":{"description":"The request's headers. Values can include references to flow values. Don't set `Content-Type` with `bodyType` `multipart`.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"body":{"description":"The request body, as an object or as text. It can include references to flow values. Not used with `bodyType` `multipart`: put the parts in `formFields`."},"bodyType":{"description":"`json` (the default) sends a JSON body. `multipart` sends multipart form data with files, for an API that takes uploads.","type":"string","enum":["json","multipart"]},"formFields":{"description":"Required with `bodyType` `multipart`. A text part is `{ name, kind: \"text\", value }`, where `value` can be JSON text or a reference to a flow value. A file part is `{ name, kind: \"file\", fileRef }`, where `fileRef` is a reference to an earlier step's uploaded files. One file can be sent under two names when the API asks for that.","type":"array","items":{"oneOf":[{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"The part's name, as the API expects it, such as `profile` or `file`."},"kind":{"type":"string","const":"text","description":"A text part: plain text or JSON text, which can include references."},"value":{"type":"string","description":"The text part's value, such as JSON text (`{\"class\":\"Document\"}`) or a reference such as `${{ steps.kickoff.fields.client_name }}`."}},"required":["name","kind","value"]},{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"The part's name, as the API expects it, such as `file` or `document`."},"kind":{"type":"string","const":"file","description":"A file part: sends a file from an earlier step."},"fileRef":{"type":"string","minLength":1,"description":"A reference to a file from an earlier step, such as `${{ steps.upload_contract.fields.uploaded_files }}`."}},"required":["name","kind","fileRef"]}]}},"auth":{"type":"object","properties":{"type":{"type":"string","enum":["none","bearer","basic"],"description":"`none`, `bearer` (a token in `token`) or `basic`."}},"description":"How the call signs in, when it doesn't use a saved Secret (`connectionId`)."},"responseItemFields":{"description":"When the reply is a list that a later For each loop goes through: the fields of each item, each with a name and a type, so the loop's steps can reference them. For a reply `{\"TASKS\": [{\"TaskName\": \"...\", \"TaskDescription\": \"...\"}]}`, send `[{ \"name\": \"TaskName\", \"type\": \"TEXT\" }, { \"name\": \"TaskDescription\", \"type\": \"TEXT\" }]`.","type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"The field's name in each item, exactly as the API returns it."},"type":{"type":"string","enum":["TEXT","NUMBER","DATE","BOOLEAN","CHOICE","OBJECT"],"description":"The field's type: `TEXT`, `NUMBER`, `DATE`, `BOOLEAN`, `CHOICE` or `OBJECT`."},"enumValues":{"type":"array","items":{"type":"string"},"description":"For `CHOICE`: the values it can take."},"fields":{"maxItems":50,"type":"array","items":{"$ref":"#/components/schemas/StepSetting_fieldsItem"},"description":"For `OBJECT`: the fields it holds, each with a `name` and a `type`."}},"required":["name","type"]}},"outputMappings":{"description":"The values to keep from the response, for later steps: where each one is in the response (`responseJsonPath`) and the name it is kept under (`outputKey`). The whole response body and the HTTP status are always available.","type":"array","items":{"type":"object","properties":{"responseJsonPath":{"type":"string","description":"Where the value is in the response, as a JSONPath from `$`, such as `$.accountStatus`, `$.data.customer.id` or `$.items[0].total`. When the value is at the top level under the name in `outputKey`, it can be left out."},"outputKey":{"type":"string","description":"The name the value is kept under, which later steps use to reference it, such as `accountStatus`."}},"required":["responseJsonPath","outputKey"]}},"response":{"description":"How the reply is read. Leave it out for JSON or text. `{ \"mode\": \"file\", \"acceptedTypes\": [\"pdf\"] }` saves a file reply, such as a PDF quote or an Excel export, which later steps can attach. `outputMappings` aren't used for a file.","type":"object","properties":{"mode":{"description":"`text` (the default) reads the response as JSON or text. `file` saves the response as one file, which later steps see as Response File.","type":"string","enum":["text","file"]},"acceptedTypes":{"description":"In `file` mode: the file types to accept. Presets: `pdf`, `images`, `word`, `excel`, `csv`, `zip` and `any`, or a MIME type such as `application/x-custom`. At least one is required in `file` mode.","type":"array","items":{"type":"string"}},"fileName":{"description":"In `file` mode: the saved file's name. Can include references to earlier steps. Leave it blank to use the name the API sends.","type":"string"},"maxSizeMb":{"description":"In `file` mode: the largest file to accept, in megabytes. Defaults to 25; at most 50.","type":"integer","minimum":1,"maximum":50},"sendAcceptHeader":{"description":"In `file` mode: sends an `Accept` header naming the accepted types. A header set in `headers` always takes precedence.","type":"boolean"},"continueOnError":{"description":"In `file` mode: when the API returns an error, completes the step with no file instead of failing, so a later step can branch on the status code.","type":"boolean"}}},"timeout":{"description":"How long to wait for the response, in milliseconds: 30000 by default, from 1000 to 600000.","type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"retryPolicy":{"description":"Retries for a call that can't connect or gets a `429` (after its `Retry-After`), and for one that times out, loses its connection after sending, or gets a `408` or `5xx` only when the call is safe to send again: `GET`, `HEAD`, `PUT`, `DELETE`, `OPTIONS`, or an `Idempotency-Key` header. Any other reply is the API's answer and is not retried.","type":"object","properties":{"maxRetries":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How many times to retry a failed call, 0 to 5."},"backoffMs":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"How long to wait before the first retry, in milliseconds, up to 60000. The wait doubles each time."}},"required":["maxRetries","backoffMs"],"additionalProperties":false},"connectionId":{"description":"The name of a saved Secret the call signs in with (`GET /v1/connections` lists them). Never a key or password.","type":"string"}}},"approveBeforeRun":{"description":"Whether a person approves the values this step is about to use before it runs. Available on `REST_API`, `EXTERNAL_APP`, `MCP_SERVER`, `SYSTEM_EMAIL`, `SEND_ANNOUNCEMENT`, `SEND_TO_CONVERSATION`, `SYSTEM_WEBHOOK`, `DATA_TABLE_SAVE_RECORD`, `START_FLOW`, `SCHEDULE_FLOW`, `CODE`, `COLLECT_PAYMENT`, `DOCUSIGN` and `ADOBE_SIGN` steps. When `true`, the step pauses before it calls, sends, writes, starts or schedules anything, until someone approves. Set who approves in the step's `reviewers`: a step with approval on and no approver can't be published.","type":"boolean"},"approvalRejectMode":{"description":"What a rejection does, with `approveBeforeRun`. `skip` (the default) skips this step and the flow continues; `halt` stops the flow.","type":"string","enum":["skip","halt"]},"blockOnFailure":{"type":"boolean","description":"Whether a failure stops the flow (\"Block the workflow if this step fails\"). `false` lets the flow continue past it; the failure is still recorded. Stops it when left out."}},"title":"REST API settings","description":"The settings a `REST_API` step is sent with, beside the shared ones in `StepSettings`. This is the schema `POST /v1/templates` and `POST /v1/templates/{id}/changes` check a step against: a setting not listed here is refused with `UNKNOWN_SETTING`.\n\nSome settings depend on your organization's plan. One your plan doesn't include is refused with `UNKNOWN_SETTING`.\n\n**Checked when you publish.** A save keeps a step that isn't finished; `POST /v1/templates/{id}/check` and publish name what is still missing:\n- Add the web address this step should call.\n- This step uses a value from an earlier step that no longer exists. Open it and pick an available value.\n- Form data needs at least one field. Add a text or file field, or switch back to JSON.\n- Choose at least one file type.\n- This step has an API key typed in directly, so it’s stored in plain text where anyone who can edit the template could read it. Add the request URL so it’s saved as a Secret automatically, or open the step’s Authentication to save it as a Secret — kept secure and hidden.\n- Approve-before-it-runs is on but no approver is assigned. Pick who approves, or turn it off.\n\nA template read (`GET /v1/templates/{id}`) returns the step's settings as stored, in `StepConfig_REST_API`.","x-moxo-step-type":"REST_API"},"StepSettings_MCP_SERVER":{"type":"object","properties":{"visibleToAllAssignees":{"description":"The older form of `visibility.mode: \"ALL\"`. Use `visibility` instead.","type":"boolean"},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"},"reviewers":{"$ref":"#/components/schemas/StepSetting_reviewers"},"mcpServer":{"description":"The settings of an MCP server step, which calls a tool on an MCP server.","type":"object","properties":{"serverUrl":{"type":"string","description":"The MCP server's address."},"toolName":{"type":"string","description":"The tool to call on the server."},"arguments":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"The tool's arguments, by name. Values can include references to flow values."},"auth":{"description":"How the step authenticates with the MCP server.","type":"object","properties":{"type":{"description":"The authentication type for the MCP server.","type":"string","enum":["NONE","BEARER","HEADER"]},"headerName":{"description":"With `HEADER` authentication, the header's name.","type":"string"}}},"outputMappings":{"type":"array","items":{"type":"object","properties":{"resultJsonPath":{"type":"string","description":"Where the value is in the tool's result, as a JSONPath from `$`, for example `$.summary` or `$.data.items[0].id`. When the value is at the top level under the same name as `outputKey`, it defaults to `$.<outputKey>`; set it when the value is nested or named differently."},"outputKey":{"type":"string","description":"The name the value is saved under, so later steps can refer to it as `${{ steps.<this step>.fields.<outputKey> }}`."}},"required":["resultJsonPath","outputKey"]},"description":"Values to keep from the tool's result, for later steps: each `{ resultJsonPath, outputKey }`."},"connectionId":{"type":"string","description":"The connection the step signs in with."},"timeout":{"type":"number","description":"How long to wait for the tool to answer, in milliseconds. Defaults to 30 seconds."}}},"outputMappings":{"type":"array","items":{"type":"object","properties":{"resultJsonPath":{"type":"string","description":"Where the value is in the tool's result, as a JSONPath from `$`, for example `$.summary` or `$.data.items[0].id`. When the value is at the top level under the same name as `outputKey`, it defaults to `$.<outputKey>`; set it when the value is nested or named differently."},"outputKey":{"type":"string","description":"The name the value is saved under, so later steps can refer to it as `${{ steps.<this step>.fields.<outputKey> }}`."}},"required":["resultJsonPath","outputKey"]},"description":"The older place for `mcpServer.outputMappings`. Send them under `mcpServer` instead."},"approveBeforeRun":{"description":"Whether a person approves the values this step is about to use before it runs. Available on `REST_API`, `EXTERNAL_APP`, `MCP_SERVER`, `SYSTEM_EMAIL`, `SEND_ANNOUNCEMENT`, `SEND_TO_CONVERSATION`, `SYSTEM_WEBHOOK`, `DATA_TABLE_SAVE_RECORD`, `START_FLOW`, `SCHEDULE_FLOW`, `CODE`, `COLLECT_PAYMENT`, `DOCUSIGN` and `ADOBE_SIGN` steps. When `true`, the step pauses before it calls, sends, writes, starts or schedules anything, until someone approves. Set who approves in the step's `reviewers`: a step with approval on and no approver can't be published.","type":"boolean"},"approvalRejectMode":{"description":"What a rejection does, with `approveBeforeRun`. `skip` (the default) skips this step and the flow continues; `halt` stops the flow.","type":"string","enum":["skip","halt"]},"blockOnFailure":{"type":"boolean","description":"Whether a failure stops the flow (\"Block the workflow if this step fails\"). `false` lets the flow continue past it; the failure is still recorded. Stops it when left out."}},"title":"MCP Server settings","description":"The settings a `MCP_SERVER` step is sent with, beside the shared ones in `StepSettings`. This is the schema `POST /v1/templates` and `POST /v1/templates/{id}/changes` check a step against: a setting not listed here is refused with `UNKNOWN_SETTING`.\n\nSome settings depend on your organization's plan. One your plan doesn't include is refused with `UNKNOWN_SETTING`.\n\n**Checked when you publish.** A save keeps a step that isn't finished; `POST /v1/templates/{id}/check` and publish name what is still missing:\n- MCP server step has no server URL.\n- Approve-before-it-runs is on but no approver is assigned. Pick who approves, or turn it off.\n\nA template read (`GET /v1/templates/{id}`) returns the step's settings as stored, in `StepConfig_MCP_SERVER`.","x-moxo-step-type":"MCP_SERVER"},"StepSettings_EXTERNAL_APP":{"type":"object","properties":{"visibleToAllAssignees":{"description":"The older form of `visibility.mode: \"ALL\"`. Use `visibility` instead.","type":"boolean"},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"},"reviewers":{"$ref":"#/components/schemas/StepSetting_reviewers"},"externalApp":{"description":"The app and the action this step runs in it.","type":"object","properties":{"appId":{"description":"The app's id in the catalog, such as `hubspot`, `salesforce` or `stripe`.","type":"string"},"appName":{"description":"The app's name, such as `HubSpot`.","type":"string"},"actionId":{"description":"The action's id within the app, such as `create_deal` or `send_message`.","type":"string"},"actionName":{"description":"The action's name, such as `Create Deal`.","type":"string"},"connectionMode":{"description":"How the connection is chosen. `fixed`: the connection in `connectionId`. `per_bundle`: from the connections given when the flow starts. `per_role`: the personal connection of the person assigned the role in `connectionRoleId`, chosen when the step runs; set `connectionRoleId` to one of the template's role ids and leave `connectionId` unset. `per_role` works only for apps that support personal accounts.","type":"string","enum":["fixed","per_bundle","per_role"]},"connectionId":{"description":"The id of the organization's connection to this app, set when someone connects an account. Only with `connectionMode` `fixed`.","type":"string"},"connectionRoleId":{"description":"With `connectionMode` `per_role`: the `roleId` (not the role name) of the role whose assignee's personal connection runs this step. One of the template's role ids.","type":"string"},"inputs":{"description":"The action's inputs, keyed by field id. A value can include references to flow values, such as `${{ steps.client_form.fields.client_name }}`. An input that takes a list of records, such as an invoice's line items, takes an object instead of text, with exactly one of: `source`, a list from an earlier step, with `columnMap` mapping the action's columns to the source's columns (columns with matching names can be left out), as in `{\"source\": \"${{ steps.extract_items.fields.items }}\", \"columnMap\": {\"description\": \"item_name\"}}`; or `rows`, the records themselves, as in `{\"rows\": [{\"description\": \"...\", \"quantity\": \"1\"}]}`, where each cell can hold references.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}}},"approveBeforeRun":{"description":"Whether a person approves the values this step is about to use before it runs. Available on `REST_API`, `EXTERNAL_APP`, `MCP_SERVER`, `SYSTEM_EMAIL`, `SEND_ANNOUNCEMENT`, `SEND_TO_CONVERSATION`, `SYSTEM_WEBHOOK`, `DATA_TABLE_SAVE_RECORD`, `START_FLOW`, `SCHEDULE_FLOW`, `CODE`, `COLLECT_PAYMENT`, `DOCUSIGN` and `ADOBE_SIGN` steps. When `true`, the step pauses before it calls, sends, writes, starts or schedules anything, until someone approves. Set who approves in the step's `reviewers`: a step with approval on and no approver can't be published.","type":"boolean"},"approvalRejectMode":{"description":"What a rejection does, with `approveBeforeRun`. `skip` (the default) skips this step and the flow continues; `halt` stops the flow.","type":"string","enum":["skip","halt"]},"blockOnFailure":{"type":"boolean","description":"Whether a failure stops the flow (\"Block the workflow if this step fails\"). `false` lets the flow continue past it; the failure is still recorded. Stops it when left out."}},"title":"External App settings","description":"The settings a `EXTERNAL_APP` step is sent with, beside the shared ones in `StepSettings`. This is the schema `POST /v1/templates` and `POST /v1/templates/{id}/changes` check a step against: a setting not listed here is refused with `UNKNOWN_SETTING`.\n\nSome settings depend on your organization's plan. One your plan doesn't include is refused with `UNKNOWN_SETTING`.\n\n**Checked when you publish.** A save keeps a step that isn't finished; `POST /v1/templates/{id}/check` and publish name what is still missing:\n- Select an external app.\n- Select an action.\n- Connect your account.\n- Choose whose connection to use — pick the role whose assigned person runs this step.\n- This step uses the role’s connection at run time — remove the pinned account (switch the connection mode to “A specific connection” if you meant to pin one).\n- Approve-before-it-runs is on but no approver is assigned. Pick who approves, or turn it off.\n\nA template read (`GET /v1/templates/{id}`) returns the step's settings as stored, in `StepConfig_EXTERNAL_APP`.","x-moxo-step-type":"EXTERNAL_APP"},"StepSettings_ASSIGN_ROLE":{"type":"object","properties":{"visibleToAllAssignees":{"description":"The older form of `visibility.mode: \"ALL\"`. Use `visibility` instead.","type":"boolean"},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"},"assignRole":{"description":"The roles to fill and who fills them, applied when the step runs. Each entry in `assignments` is `{ roleId, email, column?, reassignIfAssigned?, firstName?, lastName?, phone?, title? }`, applied on its own. `firstName`, `lastName`, `phone` and `title` are optional, apply only when a new person is created, and only to a single-person entry. `email` is one person (a fixed email or a reference to a value from earlier in the flow) or, to add a group to one role, a list: a fixed list of emails, or one reference that gives a list (a repeating group column, an AI step's list output or an API call step's list response). A list adds every person to the same role. Set `column` when the list reference is a whole repeating group and the emails are in one of its columns. A group role must allow several people (`cardinality: multi`), and its `roleOptions.completionMode` (any one, all or a majority) decides when its shared step is done. By default, a single-person entry changes nothing when its role already has someone; `reassignIfAssigned: true` replaces them instead, unless the role is tied to a signed e-signature step or a sent DocuSign envelope.","type":"object","properties":{"assignments":{"minItems":1,"type":"array","items":{"type":"object","properties":{"roleId":{"type":"string","description":"The role to fill. A template read returns its id, one of the role ids in `definition.roles`. A change names it by its name, its id, or the `handle` of a role added earlier in the same list (`StepSettings_ASSIGN_ROLE`). Use a role whose person isn't known when the flow starts, such as a signer chosen from the deal size. For a group, the role must allow several people (`cardinality: multi`)."},"fromAddedRoles":{"description":"The id of an earlier Add role step. This row then fills each role that step made with one person, taken from `column` of the role's own row of the list (by default the Add role step's email column). Set `roleId` to that step's setup role and `email` to its list. A role whose row has no email is left unfilled.","type":"string"},"email":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"Who to assign: one person, as a fixed email or a reference to a value from earlier in the flow (such as `${{ steps.intake.fields.manager_email }}`); or a list, to add a group to the role. A list usually comes from a repeating group column someone filled with emails, such as `${{ steps.collect_beneficiaries.fields.beneficiaries.email }}`; a fixed list of emails, an AI step's list output or an API call step's list response also work. A list adds every person to the same role. A person who isn't in your organization yet is added. A single-person entry changes nothing when the role already has someone, unless `reassignIfAssigned` is set; a list only adds people who aren't on the role yet, so running it again adds no one twice."},"listMode":{"description":"Which mode Moxo's template builder shows: `true` for \"A collected list of people\", `false` for \"One person\". It doesn't affect what the step does, which reads `email`.","type":"boolean"},"columnId":{"description":"The permanent id of `column`. Moxo sets it from `column` when the template is saved; don't send it.","type":"string"},"column":{"description":"The column that holds the emails, by name (not case-sensitive, for example `Email`). Needed only when a list reference names a whole repeating group, such as `${{ steps.collect_beneficiaries.fields.beneficiaries }}`, instead of one column. A column reference, such as `${{ steps.collect_beneficiaries.fields.beneficiaries.email }}`, needs no `column`. Leave it out for a list that is already flat (a fixed list, an AI step's list output or an API call step's list response).","type":"string"},"reassignIfAssigned":{"description":"Whether to replace the person already in the role. Single-person entries only. Defaults to `false`: the entry is skipped when the role already has someone. Refused for that entry when the role is tied to a signed e-signature step or a sent DocuSign envelope, which can't be moved to someone else. Ignored for a list, which always adds people.","type":"boolean"},"personaId":{"description":"The persona for a person this step creates. People who already exist keep theirs. When left out, new people get the organization's default external persona. For a list, every new person gets this persona. Must be a persona of your organization that can be assigned (see `personaMemberType`); an unknown id falls back to the default instead of failing the step.","type":"string"},"personaMemberType":{"description":"Which kind of persona `personaId` is. `internal` invites a new person as a member of your team, using the orchestrator portal, instead of as an external user. Owner and admin personas can't be used here.","type":"string","enum":["internal","external"]},"firstName":{"description":"The first name for a person this step creates: a fixed value or a reference to a value from earlier in the flow, such as `${{ steps.intake_form.fields.first_name }}`. Used only when the person is created; existing people are not renamed. Not used for a list.","type":"string"},"lastName":{"description":"The last name for a person this step creates: a fixed value or a flow value reference. Used only when the person is created; existing people are not renamed. Not used for a list.","type":"string"},"phone":{"description":"The phone number for a person this step creates: a fixed value or a flow value reference. Used only when the person is created; existing people's numbers are not changed. Not used for a list.","type":"string"},"title":{"description":"The job title for a person this step creates, matched to your organization's titles (added when it is new): a fixed value or a flow value reference. Used only when the person is created; existing people's titles are not changed. Not used for a list.","type":"string"},"customFields":{"description":"Custom user fields for the person, one flow value reference or fixed value per field key. A value replaces the saved one, for a new person and for someone who already exists. A blank value leaves the saved one unchanged. For a list, each field is its own column: one value is not copied to every person. A key that isn't a custom user field is skipped. A field your directory manages is left unchanged, and the person is still added. Name, phone, title and persona apply only when a person is created.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["roleId","email"],"additionalProperties":false},"description":"The role assignments, at least one. Each is applied on its own when the step runs, so one can succeed while another fails. Moxo shows them as \"role + email\" rows."}},"required":["assignments"],"additionalProperties":false},"blockOnFailure":{"type":"boolean","description":"Whether a failure stops the flow (\"Block the workflow if this step fails\"). `false` lets the flow continue past it; the failure is still recorded. Stops it when left out."}},"title":"Assign Role settings","description":"The settings a `ASSIGN_ROLE` step is sent with, beside the shared ones in `StepSettings`. This is the schema `POST /v1/templates` and `POST /v1/templates/{id}/changes` check a step against: a setting not listed here is refused with `UNKNOWN_SETTING`.\n\nSome settings depend on your organization's plan. One your plan doesn't include is refused with `UNKNOWN_SETTING`.\n\nA template read (`GET /v1/templates/{id}`) returns the step's settings as stored, in `StepConfig_ASSIGN_ROLE`.","x-moxo-step-type":"ASSIGN_ROLE"},"StepSettings_ADD_ROLE":{"type":"object","properties":{"visibleToAllAssignees":{"description":"The older form of `visibility.mode: \"ALL\"`. Use `visibility` instead.","type":"boolean"},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"},"addRole":{"description":"Makes one role per row of a list while the flow runs. Each role is named from `nameColumn`, gets the person in `emailColumn`, copies the settings of `setupRoleId`, and takes that role's place wherever it does, reviews or prepares a later action.","type":"object","properties":{"source":{"type":"string","description":"The list to read, as one reference: a table on an earlier form, the records of a Look up a record step, or a list output."},"nameColumn":{"type":"string","description":"The column whose value names each role, for example \"Entity name\". Leave it empty for a list of plain text."},"nameColumnId":{"description":"The permanent id of `nameColumn`. Set by the server when the template is saved; do not send it.","type":"string"},"emailColumn":{"description":"The column with each row's email. Leave it empty to fill the roles later with an Assign role step.","type":"string"},"emailColumnId":{"description":"The permanent id of `emailColumn`. Set by the server when the template is saved; do not send it.","type":"string"},"setupRoleId":{"type":"string","description":"The template role every created role copies its settings from. Put this role on who does, reviews or prepares the later actions the created roles should take. Nobody holds this role itself, so it is never filled at start or named in text."},"newPeopleAs":{"description":"How a person new to the organization joins: `external` (the default) or `internal`, a team member. Someone already in the organization keeps who they are.","type":"string","enum":["external","internal"]},"personaId":{"description":"The persona given to a person this step creates. Required when `newPeopleAs` is `internal`: an internal Orchestrator persona, never Owner or Admin. Omit it for external people to use the organization's default.","type":"string"},"oneRolePerPerson":{"description":"When true, rows with the same email share one role, named from the first row. Rows with no email stay one role each. Leave it out, or set it to false, for one role per row.","type":"boolean"}},"required":["source","nameColumn","setupRoleId"],"additionalProperties":false},"blockOnFailure":{"type":"boolean","description":"Whether a failure stops the flow (\"Block the workflow if this step fails\"). `false` lets the flow continue past it; the failure is still recorded. Stops it when left out."}},"title":"Add Role settings","description":"The settings a `ADD_ROLE` step is sent with, beside the shared ones in `StepSettings`. This is the schema `POST /v1/templates` and `POST /v1/templates/{id}/changes` check a step against: a setting not listed here is refused with `UNKNOWN_SETTING`.\n\nSome settings depend on your organization's plan. One your plan doesn't include is refused with `UNKNOWN_SETTING`.\n\n**Checked when you publish.** A save keeps a step that isn't finished; `POST /v1/templates/{id}/check` and publish name what is still missing:\n- Choose the list to make roles from.\n- Choose the role each new role is set up like.\n\nA template read (`GET /v1/templates/{id}`) returns the step's settings as stored, in `StepConfig_ADD_ROLE`.","x-moxo-step-type":"ADD_ROLE"},"StepSettings_UPDATE_USER":{"type":"object","properties":{"visibleToAllAssignees":{"description":"The older form of `visibility.mode: \"ALL\"`. Use `visibility` instead.","type":"boolean"},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"},"updateUser":{"description":"Who to update, and the name, personas, and custom user fields to write. `personRef` is a role, or an email or unique ID from earlier in the flow. A blank value leaves that field as it is. This step does not create a person or a field. Personas are only added.","type":"object","properties":{"personRef":{"description":"The one person this step updates: a role, or an email or unique ID from earlier in the flow. If more than one person is on that role when the step runs, the step fails and changes no one. Put the step in a For each to update each of them.","type":"string"},"name":{"description":"The person's name in your organization. Leave it out to keep the current name. A blank value leaves the name as it is.","type":"string"},"fields":{"description":"The existing custom user fields to update. The same field twice is refused. A blank value leaves that field as it is.","type":"array","items":{"type":"object","properties":{"fieldKey":{"type":"string","description":"The key of an existing custom user field. This step does not create fields."},"value":{"type":"string","description":"The value to write. Type it, or take it from an earlier step. A blank value leaves the field as it is."}},"required":["fieldKey","value"],"additionalProperties":false}},"personas":{"description":"Personas to add for this person. This step only adds. A persona the person already holds is left as is. An empty list changes no persona.","type":"array","items":{"type":"object","properties":{"personaId":{"type":"string","description":"The persona to add. An external persona, or an internal persona that is not an Orchestrator persona. Never your organization's Owner or Admin persona."}},"required":["personaId"],"additionalProperties":false}}},"additionalProperties":false},"blockOnFailure":{"type":"boolean","description":"Whether a failure stops the flow (\"Block the workflow if this step fails\"). `false` lets the flow continue past it; the failure is still recorded. Stops it when left out."}},"title":"Update user settings","description":"The settings a `UPDATE_USER` step is sent with, beside the shared ones in `StepSettings`. This is the schema `POST /v1/templates` and `POST /v1/templates/{id}/changes` check a step against: a setting not listed here is refused with `UNKNOWN_SETTING`.\n\nSome settings depend on your organization's plan. One your plan doesn't include is refused with `UNKNOWN_SETTING`.\n\n**Checked when you publish.** A save keeps a step that isn't finished; `POST /v1/templates/{id}/check` and publish name what is still missing:\n- Choose the person this step updates.\n\nA template read (`GET /v1/templates/{id}`) returns the step's settings as stored, in `StepConfig_UPDATE_USER`.","x-moxo-step-type":"UPDATE_USER"},"StepSettings_START_FLOW":{"type":"object","properties":{"visibleToAllAssignees":{"description":"The older form of `visibility.mode: \"ALL\"`. Use `visibility` instead.","type":"boolean"},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"},"reviewers":{"$ref":"#/components/schemas/StepSetting_reviewers"},"startFlow":{"description":"The start-a-flow settings. The step starts another flow and this flow continues at once.","type":"object","properties":{"targetTemplateId":{"description":"The id of the template to start a flow from.","type":"string"},"targetTemplateVersionId":{"description":"The version of that template the flow starts on. Set by Moxo when this template is published.","type":"string"},"flowNameTemplate":{"description":"Optional text for the new flow's name. Can include references to values from earlier in the flow.","type":"string","maxLength":200},"flowOwnerRef":{"description":"Optional reference to the email of the new flow's owner. When empty, the new flow has this flow's owner.","type":"string"},"inputMappings":{"type":"array","items":{"type":"object","properties":{"targetInputKey":{"type":"string","description":"The key of a start field on the new flow's template."},"parentRef":{"type":"string","description":"The value: a reference to a flow value, such as `${{ fields.client_name }}`, or fixed text."}},"required":["targetInputKey","parentRef"]},"description":"Values from this flow for the new flow's start fields, each `{ targetInputKey, parentRef }`."},"roleMappings":{"type":"array","items":{"type":"object","properties":{"targetRoleId":{"type":"string","description":"The role on the new flow's template, by its id."},"parentRef":{"type":"string","description":"The person: a reference to a flow value that gives an email or a user, such as `${{ roles.customer.email }}`."}},"required":["targetRoleId","parentRef"]},"description":"Who fills each role of the new flow, each `{ targetRoleId, parentRef }`."},"onUnresolvedRequired":{"type":"string","enum":["fail","start_anyway"],"description":"When a required start field's value is empty when the step runs: `fail` (the default) fails the step; `start_anyway` starts the flow with it empty."}}},"approveBeforeRun":{"description":"Whether a person approves the values this step is about to use before it runs. Available on `REST_API`, `EXTERNAL_APP`, `MCP_SERVER`, `SYSTEM_EMAIL`, `SEND_ANNOUNCEMENT`, `SEND_TO_CONVERSATION`, `SYSTEM_WEBHOOK`, `DATA_TABLE_SAVE_RECORD`, `START_FLOW`, `SCHEDULE_FLOW`, `CODE`, `COLLECT_PAYMENT`, `DOCUSIGN` and `ADOBE_SIGN` steps. When `true`, the step pauses before it calls, sends, writes, starts or schedules anything, until someone approves. Set who approves in the step's `reviewers`: a step with approval on and no approver can't be published.","type":"boolean"},"approvalRejectMode":{"description":"What a rejection does, with `approveBeforeRun`. `skip` (the default) skips this step and the flow continues; `halt` stops the flow.","type":"string","enum":["skip","halt"]},"blockOnFailure":{"type":"boolean","description":"Whether a failure stops the flow (\"Block the workflow if this step fails\"). `false` lets the flow continue past it; the failure is still recorded. Stops it when left out."}},"title":"Start a flow settings","description":"The settings a `START_FLOW` step is sent with, beside the shared ones in `StepSettings`. This is the schema `POST /v1/templates` and `POST /v1/templates/{id}/changes` check a step against: a setting not listed here is refused with `UNKNOWN_SETTING`.\n\nSome settings depend on your organization's plan. One your plan doesn't include is refused with `UNKNOWN_SETTING`.\n\n**Checked when you publish.** A save keeps a step that isn't finished; `POST /v1/templates/{id}/check` and publish name what is still missing:\n- Pick which flow to start.\n- Approve-before-it-runs is on but no approver is assigned. Pick who approves, or turn it off.\n\nA template read (`GET /v1/templates/{id}`) returns the step's settings as stored, in `StepConfig_START_FLOW`.","x-moxo-step-type":"START_FLOW"},"StepSettings_SCHEDULE_FLOW":{"type":"object","properties":{"visibleToAllAssignees":{"description":"The older form of `visibility.mode: \"ALL\"`. Use `visibility` instead.","type":"boolean"},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"},"reviewers":{"$ref":"#/components/schemas/StepSetting_reviewers"},"scheduleFlow":{"description":"Creates a schedule that starts another flow at a later date when this step runs.","type":"object","properties":{"targetTemplateId":{"description":"The id of the template to start.","type":"string"},"frequencyMode":{"description":"`once` or `recurring`, set when the template is built; it can't come from flow data. Defaults to `once`.","type":"string","enum":["once","recurring"]},"startDate":{"description":"A fixed start date (`YYYY-MM-DD`). For `once`.","type":"string"},"startDateRef":{"description":"A reference to a date field from earlier in the flow. For `once`.","type":"string"},"fireHour":{"description":"The hour it starts (0 to 23), in the schedule's time zone. Defaults to 9. For `once`.","type":"integer","minimum":0,"maximum":23},"fireMinute":{"description":"The minute it starts (0 to 59), in the schedule's time zone. Defaults to 0. For `once`.","type":"integer","minimum":0,"maximum":59},"kind":{"description":"How it repeats, for `recurring`.","type":"string","enum":["cron","weekdays_before_eom"]},"cronPattern":{"description":"A cron expression, when `kind` is `cron`.","type":"string"},"kindParams":{"description":"Settings for `kind` `weekdays_before_eom`.","type":"object","properties":{"n":{"type":"integer","minimum":0,"maximum":23,"description":"How many weekdays before the month's last weekday: `0` is the last weekday itself."},"hour":{"type":"integer","minimum":0,"maximum":23,"description":"The hour it starts, 0 to 23, in `timezone`."},"minute":{"type":"integer","minimum":0,"maximum":59,"description":"The minute it starts, 0 to 59."}},"required":["n","hour","minute"]},"timezone":{"type":"string","description":"The IANA time zone the schedule runs in, such as `America/New_York`."},"scheduleNameTemplate":{"type":"string","maxLength":200,"description":"The schedule's name, which can include references to flow values. Defaults to this flow's name and the scheduled flow's."},"roleMappings":{"type":"array","items":{"type":"object","properties":{"targetRoleId":{"type":"string","description":"The role on the scheduled flow's template, by its id."},"parentRef":{"type":"string","description":"The person: a reference to a flow value that gives an email or a user, such as `${{ roles.customer.email }}`."}},"required":["targetRoleId","parentRef"]},"description":"Who fills each role of the scheduled flow, each `{ targetRoleId, parentRef }`."},"inputMappings":{"type":"array","items":{"type":"object","properties":{"targetInputKey":{"type":"string","description":"The key of a start field on the scheduled flow's template."},"parentRef":{"type":"string","description":"The value: a reference to a flow value, such as `${{ fields.client_name }}`, or fixed text."}},"required":["targetInputKey","parentRef"]},"description":"Values from this flow for the scheduled flow's start fields, each `{ targetInputKey, parentRef }`."},"onUnresolvedRequired":{"type":"string","enum":["fail","start_anyway"],"description":"When a required start field's value is empty when the step runs: `fail` (the default) fails the step; `start_anyway` creates the schedule with it empty."}}},"approveBeforeRun":{"description":"Whether a person approves the values this step is about to use before it runs. Available on `REST_API`, `EXTERNAL_APP`, `MCP_SERVER`, `SYSTEM_EMAIL`, `SEND_ANNOUNCEMENT`, `SEND_TO_CONVERSATION`, `SYSTEM_WEBHOOK`, `DATA_TABLE_SAVE_RECORD`, `START_FLOW`, `SCHEDULE_FLOW`, `CODE`, `COLLECT_PAYMENT`, `DOCUSIGN` and `ADOBE_SIGN` steps. When `true`, the step pauses before it calls, sends, writes, starts or schedules anything, until someone approves. Set who approves in the step's `reviewers`: a step with approval on and no approver can't be published.","type":"boolean"},"approvalRejectMode":{"description":"What a rejection does, with `approveBeforeRun`. `skip` (the default) skips this step and the flow continues; `halt` stops the flow.","type":"string","enum":["skip","halt"]},"blockOnFailure":{"type":"boolean","description":"Whether a failure stops the flow (\"Block the workflow if this step fails\"). `false` lets the flow continue past it; the failure is still recorded. Stops it when left out."}},"title":"Schedule a flow settings","description":"The settings a `SCHEDULE_FLOW` step is sent with, beside the shared ones in `StepSettings`. This is the schema `POST /v1/templates` and `POST /v1/templates/{id}/changes` check a step against: a setting not listed here is refused with `UNKNOWN_SETTING`.\n\nSome settings depend on your organization's plan. One your plan doesn't include is refused with `UNKNOWN_SETTING`.\n\n**Checked when you publish.** A save keeps a step that isn't finished; `POST /v1/templates/{id}/check` and publish name what is still missing:\n- Pick which flow to schedule.\n- Approve-before-it-runs is on but no approver is assigned. Pick who approves, or turn it off.\n\nA template read (`GET /v1/templates/{id}`) returns the step's settings as stored, in `StepConfig_SCHEDULE_FLOW`.","x-moxo-step-type":"SCHEDULE_FLOW"},"StepSetting_aiAutomation":{"description":"The AI settings of the step: what the AI does, the data it receives and the outputs it produces.","type":"object","properties":{"agentId":{"description":"Not a setting of this step type: sending one is refused. To run an agent, use an AI agent step.","not":{}},"actionType":{"type":"string","enum":["CUSTOM_PROMPT","EXTRACT","SUMMARIZE","TRANSCRIBE","TRANSLATE","WRITE"],"description":"What the AI step does. Must match the step's type: `CUSTOM_PROMPT`, `EXTRACT`, `SUMMARIZE`, `TRANSCRIBE`, `TRANSLATE` or `WRITE`."},"prompt":{"description":"What the AI should do. On a Custom prompt step it is the main instruction; on the other AI steps it refines what the step already does. Plain text, which can include references to flow values, or a list of parts: `{ \"kind\": \"text\", \"text\": \"...\" }` and references.","anyOf":[{"type":"string"},{"type":"array","items":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"text","description":"The part's type."},"text":{"type":"string","description":"Fixed text."}},"required":["kind","text"]},{"type":"object","properties":{"kind":{"type":"string","const":"input","description":"The part's type."},"key":{"type":"string","minLength":1,"description":"The key of a start field the template declares."}},"required":["kind","key"]},{"type":"object","properties":{"kind":{"type":"string","const":"role","description":"The part's type."},"roleName":{"type":"string","minLength":1,"description":"A role's name."},"field":{"type":"string","enum":["name","email","phone","title"],"description":"Which of the role's details: `name`, `email`, `phone` or `title`."}},"required":["kind","roleName","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"flow","description":"The part's type."},"field":{"type":"string","enum":["name","description","dueDate","startDate","dueTimestamp","startTimestamp","id"],"description":"Which detail of the flow: `name`, `description`, `dueDate`, `startDate`, `dueTimestamp`, `startTimestamp` or `id`."}},"required":["kind","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"organization","description":"The part's type."},"field":{"type":"string","enum":["name","id"],"description":"Which detail of the organization: `name` or `id`."}},"required":["kind","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"system","description":"The part's type."},"field":{"type":"string","const":"today","description":"Today's date, in the organization's time zone."}},"required":["kind","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"step","description":"The part's type."},"stepName":{"type":"string","minLength":1,"description":"The name of an earlier step."},"field":{"type":"string","minLength":1,"description":"The name of that step's output."}},"required":["kind","stepName","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"current_item","description":"The part's type."},"field":{"type":"string","minLength":1,"description":"A field of the current item, in a step that repeats for each item."}},"required":["kind","field"]}]}}]},"inputFields":{"minItems":1,"type":"array","items":{"$ref":"#/components/schemas/StepSetting_inputFieldsItem"},"description":"The data the AI reads, at least one entry. Each entry is `{ handle, name, type }` with where its value comes from: `value`, a reference as a pulled template file writes it (`\"${{ steps.intake.fields.notes }}\"`), or `source`, whose `kind` says where the value comes from: `literal` (fixed text), `step-output` (an output of an earlier step), `role-data` (a detail of the person in a role), `for-each-aggregate` (an output of a step inside a loop, one value for each round), `flow-input` (a flow field asked for at the start), `custom-field` (a custom user field), `organization` (your organization's name or id), `flow-metadata` (the flow's due date, start date, name or id) or `trigger` (the email that started the flow)."},"outputFields":{"description":"The data the AI produces. Later steps can reference each output.","type":"array","items":{"$ref":"#/components/schemas/StepSetting_outputFieldsItem"}},"humanReview":{"description":"Whether a member reviews the AI output before the flow continues. When `true`, also set `reviewers`: a step with review turned on and no reviewer can't be published. Defaults to `false`.","type":"boolean"},"reviewChat":{"description":"Whether reviewers can talk to the AI about its output and revise the draft in place. Applies only when `humanReview` is `true`. Approving still sends the draft on. Defaults to `false`.","type":"boolean"},"reviewSample":{"description":"With `humanReview` on, the reviewer checks `size` lines (from 1 to 500), each picked with the same chance, of the list output named by `outputKey`, instead of every line. The output is a `LIST`, or a CSV, XLSX or JSON file. On a new step, leave `reviewSample` out to check every line. On `update_step`, leave it out to keep the sample the step already has, and send `null` to check every line. When the step's automation agent sets `reviewSampleSize`, the review checks at least that many even if `reviewSample` is left out, and sending `null` or a smaller `size` is refused (`422 CHANGES_REFUSED`, `LOCKED_BY_AGENT`).","anyOf":[{"type":"object","properties":{"size":{"type":"integer","minimum":1,"maximum":500,"description":"How many lines the reviewer checks, from 1 to 500, each picked with the same chance."},"outputKey":{"type":"string","minLength":1,"maxLength":200,"description":"The name of the list output the lines come from: a `LIST` output, or a CSV, XLSX or JSON file output."}},"required":["size","outputKey"],"additionalProperties":false},{"type":"null"}]},"reviewers":{"$ref":"#/components/schemas/StepSetting_reviewers_2"},"model":{"description":"The AI model this step uses, instead of the default.","type":"string"},"preprocessing":{"description":"Preparation for scanned documents: a scan is converted to structured text before the AI reads it.","type":"object","properties":{"mode":{"default":"auto","description":"When scanned documents are prepared. `auto` prepares scanned documents only, `always` prepares every document, `never` sends documents as they are. Defaults to `auto`.","type":"string","enum":["auto","always","never"]}}},"extractionMode":{"description":"How a document is read. `standard` reads it in large sections and suits most documents. `high_accuracy` reads it in sections of up to 3 pages, for dense multi-page documents such as general ledgers or bank statements. Defaults to `standard`.","type":"string","enum":["standard","high_accuracy"]},"extractMethod":{"description":"Optional advanced extraction. `complex_documents` turns on advanced extraction, which also reads scanned documents. Extraction itself is always on.","type":"string","enum":["standard","complex_documents"]},"extractArithmeticCheck":{"description":"Whether the step checks that the extracted figures add up (a running balance, each journal's debits and credits). When on, a read whose figures do not add up pauses for a person to review.","type":"boolean"},"extractArithmeticVerification":{"description":"The earlier name of `extractArithmeticCheck`. Still read when `extractArithmeticCheck` is not set; new saves use `extractArithmeticCheck`.","type":"boolean"},"extractPack":{"$ref":"#/components/schemas/StepSetting_extractPack"},"extractVerificationCriteria":{"description":"Plain-language checks run as part of arithmetic verification. Up to 8. `journal_footing` checks that a ledger's debits equal its credits; `custom` is a check you write.","maxItems":8,"type":"array","items":{"$ref":"#/components/schemas/StepSetting_extractVerificationCriteriaItem"}},"extractDocumentAbout":{"description":"An optional note on how accounts appear in the file and which lines to ignore. Plain text, up to 4,000 characters. Used when arithmetic verification is on.","type":"string","maxLength":4000}},"required":["actionType","inputFields"]},"StepSetting_inputFieldsItem":{"type":"object","properties":{"handle":{"type":"string","description":"A name you choose for this input, such as `company_name` or `doc_url`: lowercase, and unique among this step's inputs."},"name":{"type":"string","minLength":1,"description":"The input's display name, for example `Client Name` or `Document URL`."},"type":{"type":"string","enum":["TEXT","NUMBER","DATE","BOOLEAN","FILE"],"description":"The input's data type."},"required":{"description":"Whether the step needs this input to run. Leave it out to keep the input required: the step fails when the source produced no value. Set `false` only when the source is on a path or an optional step that may not run, and the AI can do its work without it; the step then runs with the input blank.","type":"boolean"},"source":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"literal","description":"Set to `literal`."},"value":{"type":"string","description":"Fixed text, such as a prompt, a caption or context that doesn't come from earlier steps."}},"required":["kind","value"]},{"type":"object","properties":{"kind":{"type":"string","const":"step-output","description":"Set to `step-output`."},"stepId":{"type":"string","description":"The earlier step that produces the value: its id, or the `handle` of a step added earlier in the same list. It must come before this step in the flow."},"field":{"type":"string","description":"The output's display name on that step, for example `Country` or `Decision`. On a form step it is the field's `label`; on an AI step, the output's `name`; on a file request step, `Uploaded Files`. Not the handle and not the step's name."}},"required":["kind","stepId","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"role-data","description":"Set to `role-data`."},"roleId":{"type":"string","description":"The role whose person to read: its name, its id, or the `handle` of a role added earlier in the same list."},"field":{"type":"string","enum":["name","email","phone","title"],"description":"Which detail of the assigned person to read. `title` is their job title from the organization's title list, and is blank when they haven't set one."}},"required":["kind","roleId","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"for-each-aggregate","description":"Set to `for-each-aggregate`."},"loopStepId":{"type":"string","description":"The For each (or other loop) step whose rounds produced the output: its id, or the `handle` of a step added earlier in the same list."},"bodyStepId":{"type":"string","description":"The handle of a step inside the loop named by `loopStepId`. A step outside that loop is refused."},"field":{"type":"string","description":"The output's name on that step, for example `Decision`. The value is the list of that output's values, one per pass of the loop."}},"required":["kind","loopStepId","bodyStepId","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"flow-input","description":"Set to `flow-input`."},"inputId":{"type":"string","description":"The `key` of a flow field asked for when the flow starts, for example a customer email or an order ID. Read from the start form's values."}},"required":["kind","inputId"]},{"type":"object","properties":{"kind":{"type":"string","const":"custom-field","description":"Set to `custom-field`."},"fieldId":{"type":"string","description":"The `fieldId` of an organization-level custom user field, for example account tier or region. Read from the person's saved value."}},"required":["kind","fieldId"]},{"type":"object","properties":{"kind":{"type":"string","const":"organization","description":"Set to `organization`."},"attribute":{"type":"string","enum":["name","id"],"description":"Which detail of the organization to read: `name` (for example to personalize generated text) or `id` (for example for an outbound API call that needs it)."}},"required":["kind","attribute"]},{"type":"object","properties":{"kind":{"type":"string","const":"flow-metadata","description":"Set to `flow-metadata`."},"attribute":{"type":"string","enum":["duedate","startdate","name","id"],"description":"Which detail of the flow to read: its due date, start date, name or id. For example, a prompt can use the flow's due date to summarize what is overdue."}},"required":["kind","attribute"]},{"$ref":"#/components/schemas/StepSetting_value_3"}],"description":"Where this input's value comes from. Set `kind`, then the settings that kind takes. For fixed text, send `{ \"kind\": \"literal\", \"value\": \"...\" }`. A step inside a For each loop is read from outside the loop only with `for-each-aggregate`."},"fieldId":{"description":"The input's id, as the template read shows it. Leave it out on a new input.","type":"string"},"value":{"description":"Where this input's value comes from, written as a reference, as a pulled template file shows it: `\"${{ steps.intake.fields.notes }}\"`. Send this or `source`, not both.","anyOf":[{"type":"string","description":"A reference to a value from an earlier step: a file upload step's files, `${{ steps.upload_documents.fields.uploaded_files }}`; a form field, `${{ steps.client_intake.fields.company_name }}`; an AI step's output, `${{ steps.ai_financial_summary.fields.financial_summary }}`. Required."},{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"literal","description":"Set to `literal`."},"expectedType":{"type":"string","description":"The type the value has, such as `TEXT`, `NUMBER`, `DATE`, `BOOLEAN` or `FILE`. An output read across a loop's rounds is a list, such as `LIST<TEXT>`."},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}],"description":"A fixed value. Its JSON type follows `expectedType`: a number for `NUMBER`, a boolean for `BOOLEAN` and text for everything else."}},"required":["kind","expectedType","value"]},{"$ref":"#/components/schemas/StepSetting_ref_2"},{"$ref":"#/components/schemas/StepSetting_ref_5"},{"type":"object","properties":{"kind":{"type":"string","const":"flow-input","description":"Set to `flow-input`."},"expectedType":{"type":"string","description":"The type the value has, such as `TEXT`, `NUMBER`, `DATE`, `BOOLEAN` or `FILE`. An output read across a loop's rounds is a list, such as `LIST<TEXT>`."},"inputId":{"type":"string","description":"The `key` of a flow field asked for when the flow starts, for example `client_name`. Not an id. Read from the start form's values."}},"required":["kind","expectedType","inputId"]},{"type":"object","properties":{"kind":{"type":"string","const":"custom-field","description":"Set to `custom-field`."},"expectedType":{"type":"string","description":"The type the value has, such as `TEXT`, `NUMBER`, `DATE`, `BOOLEAN` or `FILE`. An output read across a loop's rounds is a list, such as `LIST<TEXT>`."},"fieldId":{"type":"string","description":"For `custom-field`: the custom user field's id."}},"required":["kind","expectedType","fieldId"]},{"type":"object","properties":{"kind":{"type":"string","const":"organization","description":"Set to `organization`."},"expectedType":{"type":"string","const":"TEXT","description":"Set to `TEXT`."},"attribute":{"type":"string","enum":["name","id"],"description":"For `organization`: `name` or `id`. For `flow-metadata`: the flow's `duedate`, `startdate`, `name` or `id`."}},"required":["kind","expectedType","attribute"]},{"type":"object","properties":{"kind":{"type":"string","const":"flow-metadata","description":"Set to `flow-metadata`."},"expectedType":{"type":"string","description":"The type the value has, such as `TEXT`, `NUMBER`, `DATE`, `BOOLEAN` or `FILE`. An output read across a loop's rounds is a list, such as `LIST<TEXT>`."},"attribute":{"type":"string","enum":["duedate","startdate","name","id"],"description":"For `organization`: `name` or `id`. For `flow-metadata`: the flow's `duedate`, `startdate`, `name` or `id`."}},"required":["kind","expectedType","attribute"]},{"$ref":"#/components/schemas/StepSetting_ref_3"},{"$ref":"#/components/schemas/StepSetting_ref"}]},{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"literal","description":"Set to `literal`."},"value":{"type":"string","description":"Fixed text, such as a prompt, a caption or context that doesn't come from earlier steps."},"expectedType":{"type":"string","description":"The type the value has, such as `TEXT`, `NUMBER`, `DATE`, `BOOLEAN` or `FILE`. An output read across a loop's rounds is a list, such as `LIST<TEXT>`."}},"required":["kind","value"]},{"$ref":"#/components/schemas/StepSetting_value"},{"$ref":"#/components/schemas/StepSetting_value_4"},{"$ref":"#/components/schemas/StepSetting_value_2"},{"type":"object","properties":{"kind":{"type":"string","const":"flow-input","description":"Set to `flow-input`."},"inputId":{"type":"string","description":"The `key` of a flow field asked for when the flow starts, for example a customer email or an order ID. Read from the start form's values."},"expectedType":{"type":"string","description":"The type the value has, such as `TEXT`, `NUMBER`, `DATE`, `BOOLEAN` or `FILE`. An output read across a loop's rounds is a list, such as `LIST<TEXT>`."}},"required":["kind","inputId"]},{"type":"object","properties":{"kind":{"type":"string","const":"custom-field","description":"Set to `custom-field`."},"fieldId":{"type":"string","description":"The `fieldId` of an organization-level custom user field, for example account tier or region. Read from the person's saved value."},"expectedType":{"type":"string","description":"The type the value has, such as `TEXT`, `NUMBER`, `DATE`, `BOOLEAN` or `FILE`. An output read across a loop's rounds is a list, such as `LIST<TEXT>`."}},"required":["kind","fieldId"]},{"type":"object","properties":{"kind":{"type":"string","const":"organization","description":"Set to `organization`."},"attribute":{"type":"string","enum":["name","id"],"description":"Which detail of the organization to read: `name` (for example to personalize generated text) or `id` (for example for an outbound API call that needs it)."},"expectedType":{"type":"string","const":"TEXT","description":"Set to `TEXT`."}},"required":["kind","attribute"]},{"type":"object","properties":{"kind":{"type":"string","const":"flow-metadata","description":"Set to `flow-metadata`."},"attribute":{"type":"string","enum":["duedate","startdate","name","id"],"description":"Which detail of the flow to read: its due date, start date, name or id. For example, a prompt can use the flow's due date to summarize what is overdue."},"expectedType":{"type":"string","description":"The type the value has, such as `TEXT`, `NUMBER`, `DATE`, `BOOLEAN` or `FILE`. An output read across a loop's rounds is a list, such as `LIST<TEXT>`."}},"required":["kind","attribute"]},{"$ref":"#/components/schemas/StepSetting_value_3"}]}]}},"required":["name","type"]},"StepSettings_DOCUMENT_COLLABORATION_documentsItem":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,39}$","description":"A short id for the document, unique in the step: lowercase letters, digits, `-` or `_` (for example `sow` or `msa`)."},"name":{"description":"The document's name as people see it, for example `Statement of work`.","type":"string","minLength":1,"maxLength":120},"ref":{"description":"A file document's starting file: a reference to an earlier step's file output, for example `${{ steps.upload_draft_sow.fields.uploaded_files }}`. Leave out for a Moxo document, or when a person preparing the step (`preparers.participants: [{ type: \"HUMAN\", roleId }]`) uploads it when the flow runs. An AI preparer can't provide a file.","type":"string"},"moxo":{"description":"Set for a Moxo document, written in Moxo rather than uploaded as a file. Not together with `ref`.","type":"object","properties":{"markdown":{"description":"The starting text, in Markdown: `#` to `###` headings, paragraphs, `-`, `1.` and `- [ ]` lists, bold, italic, links, and flow data as `${{ steps.<step>.fields.<field> }}`. A heading can name its section id: `## Pricing {#pricing}`.","type":"string","maxLength":100000}}},"fill":{"description":"For a Word template uploaded to this step only: fills its `{{placeholders}}` from flow data when the step starts.","type":"object","properties":{"slots":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"},"description":"Every `{{placeholder}}` in the uploaded Word template, each mapped to a reference to the flow data that fills it (`\"\"` when nothing fits yet)."},"slotTables":{"description":"Placeholders the person preparing version 1 picks from a column of a Data Table, by placeholder name, instead of from flow data.","type":"object","propertyNames":{"type":"string","pattern":"^[A-Za-z_][A-Za-z0-9_]{0,79}$"},"additionalProperties":{"$ref":"#/components/schemas/StepSetting_slotTables"}},"dropdowns":{"description":"The Word template's drop-down controls (tagged moxo:<key>), each to the Data Table column its choices come from.","type":"object","propertyNames":{"type":"string","pattern":"^dd_[a-z0-9]{6,32}$"},"additionalProperties":{"$ref":"#/components/schemas/StepSetting_slotTables"}}},"required":["slots"]},"fileName":{"type":"string","maxLength":500,"description":"The uploaded document's name, as shown on the step."},"sheetDropdowns":{"description":"Only on an uploaded Excel file: dropdowns whose choices come from a column of a Data Table, by key (dd_ and a short id). The list goes into the workbook as an Excel list, so it works in Excel and in Moxo.","type":"object","propertyNames":{"type":"string","pattern":"^dd_[a-z0-9]{6,32}$"},"additionalProperties":{"type":"object","properties":{"tableId":{"type":"string","minLength":1,"maxLength":64,"description":"The id of the Data Table the choices come from."},"columnKey":{"type":"string","minLength":1,"maxLength":100,"description":"The key of the table's column whose values are the choices. Every row's value is offered, or only the rows `rowFilter` keeps."},"label":{"default":"","description":"What the choice is called where a person picks it. Empty: the column's name.","type":"string","maxLength":300},"rowFilter":{"maxItems":10,"type":"array","items":{"$ref":"#/components/schemas/StepSetting_rowFilterItem"},"description":"Only rows where every condition holds are offered. Leave it out to offer every row. The columns it checks choose rows on the server and are never shown to the people picking."},"sheet":{"type":"string","minLength":1,"maxLength":100,"description":"The name of the worksheet the dropdown is on."},"range":{"type":"string","minLength":1,"maxLength":40,"description":"The cells that get the dropdown, as an Excel range (for example C6:C10)."},"strict":{"default":true,"description":"true: a cell takes only one of the choices. false: other text is allowed too, with a warning.","type":"boolean"}},"required":["tableId","columnKey","sheet","range"]}}},"required":["key"]},"StepSetting_outputFieldsItem":{"type":"object","properties":{"handle":{"type":"string","description":"A name you choose for this output, such as `summary` or `extracted_total`: lowercase, and unique among this step's outputs."},"name":{"type":"string","minLength":1,"description":"The output's display name, for example `Summary` or `Extracted Data`."},"type":{"description":"The output's data type. `CHOICE` limits the value to a fixed set: set `enumValues`; a later Decision step can branch on it. `OBJECT` is a nested record: set `fields`; later steps can reference each value inside it. `FILE` is a file the AI produces: CSV, XLSX or JSON for tables, TXT, DOCX or PDF for text. `LIST` is a list of records: set `itemFields`, so a `FOR_EACH` step can reference `${{ current.item.<field> }}`.","type":"string","enum":["TEXT","NUMBER","DATE","BOOLEAN","CHOICE","OBJECT","FILE","LIST"]},"fileFormat":{"description":"The file format. Required when `type` is `FILE`. For tables: CSV, XLSX or JSON. For text: TXT, DOCX or PDF.","type":"string","enum":["TXT","CSV","JSON","XLSX","DOCX","PDF","PPTX"]},"source":{"description":"Whether a number output is checked against documents (\"Check against documents\" in the app). For a number output only; refused on any other type. `judgment` (the default when omitted): not checked. The value is proved as before, unless the AI marks it as its own assessment, such as a risk score. `inputs`: checked. The value must be read from the step's inputs or worked out from them, a judged mark is ignored, and a value Moxo cannot trace waits for a person.","type":"string","enum":["inputs","judgment"]},"deliverAsPdf":{"description":"For a DOCX output only. When `true`, the Word file is kept and a PDF copy is saved too. Later steps see the PDF as `<output name> PDF`, so no other output can use that name.","type":"boolean"},"itemFields":{"description":"The fields each item in the list has, for example date, amount and merchant. Required when `type` is `LIST`. Inside a `FOR_EACH` over the list, each is referenced as `${{ current.item.<field> }}`.","type":"array","items":{"$ref":"#/components/schemas/StepSetting_itemFieldsItem"}},"enumValues":{"description":"The allowed values, for example `[\"Approved\", \"Rejected\", \"Needs review\"]`. Required when `type` is `CHOICE`. The output is always exactly one of them.","type":"array","items":{"type":"string"}},"fields":{"description":"The record's fields. Required when `type` is `OBJECT`. Later steps reference each value as `${{ steps.<step>.fields.<output>.<field> }}`.","type":"array","items":{"$ref":"#/components/schemas/StepSetting_itemFieldsItem"}},"style":{"description":"Optional style settings for a PDF or DOCX output. Settings left out come from the agent, the organization or Moxo's defaults.","type":"object","properties":{"accentColor":{"type":"string","description":"The accent color, as a hex color such as `#1a2b3c`."},"fontFamily":{"type":"string","description":"The font for the document's text."}}},"fieldId":{"description":"The output's id, unique in the step, for example `out_1`.","type":"string"},"description":{"type":"string","description":"What this output holds. The AI reads it when it fills in the output."},"templateFile":{"type":"string","description":"A Word, Excel or PowerPoint template this file output fills in, instead of building the file from scratch."}},"required":["handle","name","type"]},"StepSetting_reviewers":{"description":"Who checks the submission before the step completes: AI agents, people or both. An AI reviewer with no `agentId` uses your organization's default reviewer agent. With `approveBeforeRun` on, these are the people who approve the step before it runs, and they must be people.","type":"object","properties":{"participants":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["AI","HUMAN"],"description":"`AI` for an AI agent, `HUMAN` for a person."},"roleHandle":{"description":"For a person: the reviewing role, by its name, its id, or the `handle` of a role added earlier in the same list.","type":"string"},"roleId":{"description":"The older form of `roleHandle`: the role's id.","type":"string"},"agentId":{"description":"The id of one of your organization's AI agents. Leave it out to use the organization's default.","type":"string"},"prompt":{"description":"What the AI reviewer checks on this step, including when to approve and when to send back, such as \"Send back if a required field is missing or the amount is over the approved budget.\" With an `agentId`, it adds to the agent's own checks.","type":"string"},"inputs":{"description":"Values the AI reviewer weighs beside the submission, each `{ name, value }`: fixed text or a reference to a flow value, such as `${{ steps.budget.fields.approved_budget }}`. The submission itself is always available; use `inputs` for values from other steps to compare it with.","type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"The name the AI sees this value under."},"value":{"type":"string","description":"Fixed text, or a reference to a flow value, such as `${{ steps.intake.fields.company_name }}`."},"type":{"type":"string","enum":["TEXT","FILE"],"description":"`TEXT` (the default) or `FILE`, for a file the AI reads."}},"required":["name","value"]}},"sendBackReply":{"description":"What the person who submitted reads when the work is sent back. `outcome_with_reason` (the default): what to fix, each reason on its field. `outcome_only`: only that it needs another look, with no reasons or marked fields. Used only when `agentId` is left out.","type":"string","enum":["outcome_with_reason","outcome_only"]},"howToExplain":{"description":"How a send-back is worded, such as \"Be friendly. Point them to ap@acme.com.\" Used only with `sendBackReply` `outcome_with_reason`, and when `agentId` is left out.","type":"string","maxLength":2000},"privateNotesGuidance":{"description":"What else the AI should note for the sender, in private notes. Private notes are read only by the sender (in Human + AI actions) or the flow's managers, never by the assignee. Used only when `agentId` is left out: an agent keeps its own.","type":"string","maxLength":2000},"contactId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"An external user named on the seat, by the `usr_` id the template read shows. `null` follows the read, as for `userId`."},"userId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"A person named on the seat, by the `usr_` id the template read shows. `null` where the read showed `null` (someone with no id here) keeps the saved person; `null` where it showed an id takes them off the seat."},"criteria":{"type":"string","description":"For an AI reviewer: what to check. Read before `prompt`."},"context":{"type":"string","description":"An older home of the AI participant's step context, still read. Set `prompt` instead."},"participantId":{"type":"string","description":"The participant's id on the step. Keep it when sending the seat back; leave it out for a new participant."},"order":{"type":"number","description":"The participant's place in the seat, from 0, when they act one after another."}},"required":["type"]},"description":"The reviewers: AI agents or roles, each with optional instructions and values to weigh."},"sequential":{"type":"boolean","description":"Whether the reviewers act one after another."},"completion":{"type":"object","properties":{"mode":{"type":"string","enum":["ANY_ONE","ALL"],"description":"`ANY_ONE`: one participant finishing is enough. `ALL`: every participant finishes."}},"required":["mode"],"description":"When the seat is done."},"showToExternalAssignee":{"description":"Advisors only. `true` lets an assignee outside your organization read the recommendation (the call and its reasons), as advice from your organization. Off unless set.","type":"boolean"},"canEditAnswers":{"description":"Reviewers only, on a Form, PDF form or File request step. `true` lets the reviewer whose turn it is edit the submitted answers (on a File request, add and remove its files) during review, in the Moxo app, instead of sending them back. Off unless set.","type":"boolean"},"reviewItemsTogether":{"description":"Reviewers only, on a person's step inside a For each whose items run at the same time. `true` gives the reviewer one list and one notice for every item instead of one review per item; each item keeps its own run and review. With the loop's `syncStepsAcrossIterations` on, the reviewer approves every item at once (`approve_reviews_together`); off, each item is approved on its own. Publish refuses it in a Repeat while, on an \"Approve before it runs\" step, with no person or role reviewing, and in a loop that runs items one at a time. Off unless set.","type":"boolean"}},"required":["participants"]},"StepSetting_preparers":{"description":"Who prepares the step before the assignee acts: AI agents, people or both. On a step that collects data, a preparer fills in answers; on other steps, it can update the description, attachments and instructions. An AI preparer with no `agentId` uses your organization's default preparer agent.","type":"object","properties":{"participants":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["AI","HUMAN"],"description":"`AI` for an AI agent, `HUMAN` for a person."},"roleHandle":{"description":"For a person: the role that prepares, by its name, its id, or the `handle` of a role added earlier in the same list.","type":"string"},"roleId":{"description":"The older form of `roleHandle`: the role's id.","type":"string"},"agentId":{"description":"The id of one of your organization's AI agents. Leave it out to use the organization's default.","type":"string"},"prompt":{"description":"Instructions for this step, such as \"Match the applicant's tone and leave contact details blank when they aren't known.\"","type":"string"},"privateNotesGuidance":{"description":"What else the AI should note for the sender, in private notes. Private notes are read only by the sender (in Human + AI actions) or the flow's managers, never by the assignee. Used only when `agentId` is left out: an agent keeps its own.","type":"string","maxLength":2000},"inputs":{"description":"Values the AI preparer can see, each `{ name, value }`. `value` is fixed text or a reference to a flow value, such as `${{ steps.income_form.fields.total_income }}`, `${{ fields.company_name }}` or `${{ roles.customer.email }}`. Prefer `inputs` to references written into `prompt`: each input is read on its own and reported when it can't be read. An AI preparer with no inputs and no prompt fills in nothing.","type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"The name the AI sees this value under."},"value":{"type":"string","description":"Fixed text, or a reference to a flow value, such as `${{ steps.intake.fields.company_name }}`."},"type":{"type":"string","enum":["TEXT","FILE"],"description":"`TEXT` (the default) or `FILE`, for a file the AI reads."}},"required":["name","value"]}},"contactId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"An external user named on the seat, by the `usr_` id the template read shows. `null` follows the read, as for `userId`."},"userId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"A person named on the seat, by the `usr_` id the template read shows. `null` where the read showed `null` (someone with no id here) keeps the saved person; `null` where it showed an id takes them off the seat."},"criteria":{"type":"string","description":"For an AI reviewer: what to check. Read before `prompt`."},"context":{"type":"string","description":"An older home of the AI participant's step context, still read. Set `prompt` instead."},"sendBackReply":{"type":"string","enum":["outcome_with_reason","outcome_only"],"description":"When the AI sends work back and no agent is named: what the reply says, `outcome_with_reason` or `outcome_only`."},"howToExplain":{"type":"string","maxLength":2000,"description":"When the AI sends work back and no agent is named: how it explains what to fix."},"participantId":{"type":"string","description":"The participant's id on the step. Keep it when sending the seat back; leave it out for a new participant."},"order":{"type":"number","description":"The participant's place in the seat, from 0, when they act one after another."}},"required":["type"]},"description":"The preparers: AI agents or roles, each with optional instructions and values to see."},"sequential":{"description":"Whether the preparers act one after another.","type":"boolean"},"completion":{"type":"object","properties":{"mode":{"type":"string","enum":["ANY_ONE","ALL"],"description":"`ANY_ONE`: one participant finishing is enough. `ALL`: every participant finishes."}},"required":["mode"],"description":"When the seat is done."},"showToExternalAssignee":{"description":"Advisors only. `true` lets an assignee outside your organization read the recommendation (the call and its reasons), as advice from your organization. Off unless set.","type":"boolean"},"canEditAnswers":{"description":"Reviewers only, on a Form, PDF form or File request step. `true` lets the reviewer whose turn it is edit the submitted answers (on a File request, add and remove its files) during review, in the Moxo app, instead of sending them back. Off unless set.","type":"boolean"},"reviewItemsTogether":{"description":"Reviewers only, on a person's step inside a For each whose items run at the same time. `true` gives the reviewer one list and one notice for every item instead of one review per item; each item keeps its own run and review. With the loop's `syncStepsAcrossIterations` on, the reviewer approves every item at once (`approve_reviews_together`); off, each item is approved on its own. Publish refuses it in a Repeat while, on an \"Approve before it runs\" step, with no person or role reviewing, and in a loop that runs items one at a time. Off unless set.","type":"boolean"}},"required":["participants"]},"StepSetting_advisors":{"description":"An AI recommendation the assignee sees before they act. AI agents only. An advisor with no `agentId` uses your organization's default advisor agent.","type":"object","properties":{"participants":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["AI"],"description":"Always `AI`: advisors are AI agents only."},"agentId":{"description":"The id of one of your organization's AI agents. Leave it out to use the organization's default.","type":"string"},"prompt":{"description":"Instructions for the advice on this step, such as \"Weight cash flow over revenue when assessing risk.\"","type":"string"},"privateNotesGuidance":{"description":"What else the AI should note for the sender, in private notes. Private notes are read only by the sender (in Human + AI actions) or the flow's managers, never by the assignee. Used only when `agentId` is left out: an agent keeps its own.","type":"string","maxLength":2000},"inputs":{"description":"Values the AI advisor can see, each `{ name, value }`: fixed text or a reference to a flow value, such as `${{ steps.risk_check.fields.risk_score }}` or `${{ fields.region }}`. Prefer `inputs` to references written into `prompt`. An advisor with no inputs and no prompt bases its recommendation on the step's name alone.","type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"The name the AI sees this value under."},"value":{"type":"string","description":"Fixed text, or a reference to a flow value, such as `${{ steps.intake.fields.company_name }}`."},"type":{"type":"string","enum":["TEXT","FILE"],"description":"`TEXT` (the default) or `FILE`, for a file the AI reads."}},"required":["name","value"]}},"roleId":{"type":"string","description":"For a person: the role that takes this seat, by its id."},"contactId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"An external user named on the seat, by the `usr_` id the template read shows. `null` follows the read, as for `userId`."},"userId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"A person named on the seat, by the `usr_` id the template read shows. `null` where the read showed `null` (someone with no id here) keeps the saved person; `null` where it showed an id takes them off the seat."},"criteria":{"type":"string","description":"For an AI reviewer: what to check. Read before `prompt`."},"context":{"anyOf":[{"type":"string"},{"type":"string"}],"description":"An older home of the AI participant's step context, still read. Set `prompt` instead."},"sendBackReply":{"type":"string","enum":["outcome_with_reason","outcome_only"],"description":"When the AI sends work back and no agent is named: what the reply says, `outcome_with_reason` or `outcome_only`."},"howToExplain":{"type":"string","maxLength":2000,"description":"When the AI sends work back and no agent is named: how it explains what to fix."},"participantId":{"type":"string","description":"The participant's id on the step. Keep it when sending the seat back; leave it out for a new participant."},"order":{"type":"number","description":"The participant's place in the seat, from 0, when they act one after another."}},"required":["type"]},"description":"The advisors: AI agents, each with optional instructions and values to see."},"sequential":{"description":"Whether the advisors act one after another.","type":"boolean"},"completion":{"type":"object","properties":{"mode":{"type":"string","enum":["ANY_ONE","ALL"],"description":"`ANY_ONE`: one participant finishing is enough. `ALL`: every participant finishes."}},"required":["mode"],"description":"When the seat is done."},"showToExternalAssignee":{"anyOf":[{"type":"boolean"},{"type":"boolean"}],"description":"Advisors only. `true`: an assignee outside your organization may read the recommendation, as advice from your organization."},"canEditAnswers":{"description":"Reviewers only, on a Form, PDF form or File request step. `true` lets the reviewer whose turn it is edit the submitted answers (on a File request, add and remove its files) during review, in the Moxo app, instead of sending them back. Off unless set.","type":"boolean"},"reviewItemsTogether":{"description":"Reviewers only, on a person's step inside a For each whose items run at the same time. `true` gives the reviewer one list and one notice for every item instead of one review per item; each item keeps its own run and review. With the loop's `syncStepsAcrossIterations` on, the reviewer approves every item at once (`approve_reviews_together`); off, each item is approved on its own. Publish refuses it in a Repeat while, on an \"Approve before it runs\" step, with no person or role reviewing, and in a loop that runs items one at a time. Off unless set.","type":"boolean"}},"required":["participants"]},"StepSetting_advisors_2":{"description":"An AI recommendation the assignee sees before they act. AI agents only. An advisor with no `agentId` uses your organization's default advisor agent.","type":"object","properties":{"participants":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["AI"],"description":"Always `AI`: advisors are AI agents only."},"agentId":{"description":"The id of one of your organization's AI agents. Leave it out to use the organization's default.","type":"string"},"prompt":{"description":"Instructions for the advice on this step, such as \"Weight cash flow over revenue when assessing risk.\"","type":"string"},"privateNotesGuidance":{"description":"What else the AI should note for the sender, in private notes. Private notes are read only by the sender (in Human + AI actions) or the flow's managers, never by the assignee. Used only when `agentId` is left out: an agent keeps its own.","type":"string","maxLength":2000},"inputs":{"description":"Values the AI advisor can see, each `{ name, value }`: fixed text or a reference to a flow value, such as `${{ steps.risk_check.fields.risk_score }}` or `${{ fields.region }}`. Prefer `inputs` to references written into `prompt`. An advisor with no inputs and no prompt bases its recommendation on the step's name alone.","type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"The name the AI sees this value under."},"value":{"type":"string","description":"Fixed text, or a reference to a flow value, such as `${{ steps.intake.fields.company_name }}`."},"type":{"type":"string","enum":["TEXT","FILE"],"description":"`TEXT` (the default) or `FILE`, for a file the AI reads."}},"required":["name","value"]}},"roleId":{"type":"string","description":"For a person: the role that takes this seat, by its id."},"contactId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"An external user named on the seat, by the `usr_` id the template read shows. `null` follows the read, as for `userId`."},"userId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"A person named on the seat, by the `usr_` id the template read shows. `null` where the read showed `null` (someone with no id here) keeps the saved person; `null` where it showed an id takes them off the seat."},"criteria":{"type":"string","description":"For an AI reviewer: what to check. Read before `prompt`."},"context":{"type":"string","description":"An older home of the AI participant's step context, still read. Set `prompt` instead."},"sendBackReply":{"type":"string","enum":["outcome_with_reason","outcome_only"],"description":"When the AI sends work back and no agent is named: what the reply says, `outcome_with_reason` or `outcome_only`."},"howToExplain":{"type":"string","maxLength":2000,"description":"When the AI sends work back and no agent is named: how it explains what to fix."},"participantId":{"type":"string","description":"The participant's id on the step. Keep it when sending the seat back; leave it out for a new participant."},"order":{"type":"number","description":"The participant's place in the seat, from 0, when they act one after another."}},"required":["type"]},"description":"The advisors: AI agents, each with optional instructions and values to see."},"sequential":{"description":"Whether the advisors act one after another.","type":"boolean"},"completion":{"type":"object","properties":{"mode":{"type":"string","enum":["ANY_ONE","ALL"],"description":"`ANY_ONE`: one participant finishing is enough. `ALL`: every participant finishes."}},"required":["mode"],"description":"When the seat is done."},"showToExternalAssignee":{"anyOf":[{"type":"boolean"},{"type":"boolean"}],"description":"Advisors only. `true`: an assignee outside your organization may read the recommendation, as advice from your organization."},"canEditAnswers":{"description":"Reviewers only, on a Form, PDF form or File request step. `true` lets the reviewer whose turn it is edit the submitted answers (on a File request, add and remove its files) during review, in the Moxo app, instead of sending them back. Off unless set.","type":"boolean"},"reviewItemsTogether":{"description":"Reviewers only, on a person's step inside a For each whose items run at the same time. `true` gives the reviewer one list and one notice for every item instead of one review per item; each item keeps its own run and review. With the loop's `syncStepsAcrossIterations` on, the reviewer approves every item at once (`approve_reviews_together`); off, each item is approved on its own. Publish refuses it in a Repeat while, on an \"Approve before it runs\" step, with no person or role reviewing, and in a loop that runs items one at a time. Off unless set.","type":"boolean"}},"required":["participants"]},"StepSetting_reviewers_2":{"description":"Who reviews the AI output: an internal role, such as a manager or approver. Required when `humanReview` is `true`.","type":"object","properties":{"participants":{"type":"array","items":{"$ref":"#/components/schemas/StepSetting_participantsItem"},"description":"The reviewers: AI agents, roles or named people."},"sequential":{"type":"boolean","description":"Whether the reviewers act one after another."},"completion":{"type":"object","properties":{"mode":{"type":"string","enum":["ANY_ONE","ALL"],"description":"`ANY_ONE`: one reviewer is enough. `ALL`: every reviewer must review."}},"required":["mode"],"description":"When the review is done."},"showToExternalAssignee":{"description":"Advisors only. `true` lets an assignee outside your organization read the recommendation (the call and its reasons), as advice from your organization. Off unless set.","type":"boolean"},"canEditAnswers":{"description":"Reviewers only, on a Form, PDF form or File request step. `true` lets the reviewer whose turn it is edit the submitted answers (on a File request, add and remove its files) during review, in the Moxo app, instead of sending them back. Off unless set.","type":"boolean"},"reviewItemsTogether":{"description":"Reviewers only, on a person's step inside a For each whose items run at the same time. `true` gives the reviewer one list and one notice for every item instead of one review per item; each item keeps its own run and review. With the loop's `syncStepsAcrossIterations` on, the reviewer approves every item at once (`approve_reviews_together`); off, each item is approved on its own. Publish refuses it in a Repeat while, on an \"Approve before it runs\" step, with no person or role reviewing, and in a loop that runs items one at a time. Off unless set.","type":"boolean"}},"required":["participants"]},"StepSetting_conditionsItem":{"type":"object","properties":{"source":{"description":"Where the condition reads its value. `form`, or omitted: a field in this form. `ddr`: a value from earlier in the flow, such as an earlier step's answer, a start field or a role's details.","type":"string","enum":["form","ddr"]},"fieldKey":{"description":"The field in this form to test, by its field id. Required for a condition on this form, which is the default. Leave it out when `source` is `ddr`, where `ref` names the value instead.","type":"string"},"ref":{"description":"The value to test when `source` is `ddr`: a reference to a value from earlier in the flow, such as `${{ steps.intake.fields.segment }}`. Required for that source.","type":"string"},"operator":{"description":"How to compare the value. One of `equals`, `not_equals`, `contains`, `not_contains`, `greater_than`, `less_than`, `greater_than_or_equal`, `less_than_or_equal`, `starts_with`, `ends_with`, `is_empty`, `is_not_empty`, `in` or `not_in`.","type":"string","enum":["equals","not_equals","contains","not_contains","greater_than","less_than","greater_than_or_equal","less_than_or_equal","starts_with","ends_with","is_empty","is_not_empty","in","not_in"]},"value":{"type":"string","description":"The value to compare with."},"valueRef":{"description":"The value to compare against, from earlier in the flow, such as `${{ steps.intake.fields.tier }}`. When set, the rule uses that value instead of `value`. A reference that is missing or empty does not match.","type":"string"},"relativeValue":{"type":"object","properties":{"anchor":{"type":"string","const":"today","description":"The date the offset counts from. Only `today` is supported: the date is worked out again each time the rule runs, so it never goes out of date."},"direction":{"type":"string","enum":["before","after"],"description":"Whether the compared date is before or after the anchor. With `offset` and `unit`, `before`, `3` and `years` mean three years before today."},"offset":{"type":"integer","minimum":0,"maximum":1000,"description":"How many units from the anchor: a whole number from 0 to 1000."},"unit":{"type":"string","enum":["days","weeks","months","years"],"description":"The unit of the offset: `days`, `weeks`, `months` or `years`."}},"required":["anchor","direction","offset","unit"],"description":"For a date: compare with a date relative to another, `{ anchor, direction, offset, unit }`, such as 30 days after today."},"columnId":{"description":"For a rule on a Look up a record field in this form: the id of a column of the record it picks, from the field's `config.source.columns`. The rule then compares that column instead of the whole record. For an option column, `value` is the option id. When several records are picked, `equals` matches when any of them matches. A timestamp column, and a lookup with no columns, take only `is_empty` and `is_not_empty`.","type":"string"}},"required":["operator"]},"StepSetting_match":{"type":"object","properties":{"match":{"type":"string","enum":["ALL","ANY"],"description":"How the conditions combine: `ALL`, every condition must hold, or `ANY`, at least one must."},"conditions":{"maxItems":25,"type":"array","items":{"$ref":"#/components/schemas/StepSetting_conditionsItem_2"},"description":"The conditions, each `{ fieldId, op, value }`: a column, a comparison and the value to compare with."},"fieldId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"The column to match exactly, by id or name."},"value":{"type":"string","description":"The value to compare: a fixed value or a reference to a value from earlier in the flow, such as `${{ steps.intake_form.fields.email }}`, filled in before the search."}},"required":["match","conditions"],"description":"A filter on data table records: `match` and a list of `conditions`."},"StepSettings_DOCUMENT_COLLABORATION_insertFrom":{"description":"A column of a Data Table people insert from while editing. Leave it out when there is none.","type":"object","properties":{"tableId":{"type":"string","minLength":1,"maxLength":64,"description":"The id of the Data Table the choices come from."},"columnKey":{"type":"string","minLength":1,"maxLength":100,"description":"The key of the table's column whose values are the choices. Every row's value is offered, or only the rows `rowFilter` keeps."},"label":{"default":"","description":"What the choice is called where a person picks it. Empty: the column's name.","type":"string","maxLength":300},"rowFilter":{"maxItems":10,"type":"array","items":{"$ref":"#/components/schemas/StepSetting_rowFilterItem"},"description":"Only rows where every condition holds are offered. Leave it out to offer every row. The columns it checks choose rows on the server and are never shown to the people picking."}},"required":["tableId","columnKey"]},"StepSetting_slotTables":{"type":"object","properties":{"tableId":{"type":"string","minLength":1,"maxLength":64,"description":"The id of the Data Table the choices come from."},"columnKey":{"type":"string","minLength":1,"maxLength":100,"description":"The key of the table's column whose values are the choices. Every row's value is offered, or only the rows `rowFilter` keeps."},"label":{"default":"","description":"What the choice is called where a person picks it. Empty: the column's name.","type":"string","maxLength":300},"rowFilter":{"maxItems":10,"type":"array","items":{"$ref":"#/components/schemas/StepSetting_rowFilterItem"},"description":"Only rows where every condition holds are offered. Leave it out to offer every row. The columns it checks choose rows on the server and are never shown to the people picking."}},"required":["tableId","columnKey"]},"StepSetting_participantsItem":{"type":"object","properties":{"type":{"type":"string","enum":["AI","HUMAN"],"description":"`AI` for an AI agent, `HUMAN` for a person."},"roleId":{"type":"string","description":"For a person: the reviewing role, by its name, its id, or the `handle` of a role added earlier in the same list."},"contactId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"An external user who reviews, by their user id."},"userId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Someone on your team who reviews, by their user id."},"agentId":{"type":"string","description":"For an AI reviewer: the agent's id. Leave it out for your organization's default reviewer agent."},"prompt":{"type":"string","description":"What the AI reviewer checks on this step. With an `agentId`, it adds to the agent's own checks."},"criteria":{"type":"string","description":"What the AI reviewer checks the output against."},"context":{"type":"string","description":"Background the AI reviewer should know about this step."},"privateNotesGuidance":{"type":"string","maxLength":2000,"description":"What else the AI should note in private notes, which only the flow's managers read. Used only when `agentId` is left out."},"sendBackReply":{"type":"string","enum":["outcome_with_reason","outcome_only"],"description":"`outcome_with_reason` (the default): the reasons are shown with the send-back. `outcome_only`: only that it needs another look."},"howToExplain":{"type":"string","maxLength":2000,"description":"How a send-back is worded, such as \"Be friendly.\" Used only with `sendBackReply` `outcome_with_reason`, and when `agentId` is left out."},"inputs":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"The name the AI sees this value under."},"value":{"type":"string","description":"Fixed text, or a reference to a flow value, such as `${{ steps.intake.fields.company_name }}`."},"type":{"type":"string","enum":["TEXT","FILE"],"description":"`TEXT` (the default) or `FILE`, for a file the AI reads."}},"required":["name","value"]},"description":"Values the AI reviewer weighs beside the output, each `{ name, value }`."}},"required":["type"],"additionalProperties":{}},"StepSetting_match_2":{"type":"object","properties":{"fieldId":{"type":"string","format":"uuid","description":"The column to match exactly, by id or name."},"value":{"type":"string","description":"The value to compare: a fixed value or a reference to a value from earlier in the flow, such as `${{ steps.intake_form.fields.email }}`, filled in before the search."},"match":{"type":"string","enum":["ALL","ANY"],"description":"How the conditions combine: `ALL`, every condition must hold, or `ANY`, at least one must."},"conditions":{"maxItems":25,"type":"array","items":{"$ref":"#/components/schemas/StepSetting_conditionsItem_2"},"description":"The conditions, each `{ fieldId, op, value }`: a column, a comparison and the value to compare with."}},"required":["fieldId","value"]},"StepSetting_itemFieldsItem":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"The field's name. Later steps reference it by this name."},"type":{"type":"string","enum":["TEXT","NUMBER","DATE","BOOLEAN","CHOICE","OBJECT"],"description":"The field's type: `TEXT`, `NUMBER`, `DATE`, `BOOLEAN`, `CHOICE` or `OBJECT`."},"enumValues":{"type":"array","items":{"type":"string"},"description":"For `CHOICE`: the values it can take."},"fields":{"maxItems":50,"type":"array","items":{"$ref":"#/components/schemas/StepSetting_fieldsItem"},"description":"For `OBJECT`: the fields it holds, each with a `name` and a `type`."}},"required":["name","type"]},"StepSetting_conditionsItem_2":{"type":"object","properties":{"fieldId":{"type":"string","minLength":1,"description":"The id of a column in the data table (a UUID), as the data table's columns list it; not a column name or label. An unknown or archived id never matches: in a `match: \"ALL\"` filter, the whole filter then matches no records; in a `match: \"ANY\"` filter, that condition is ignored unless every condition is unknown or archived."},"op":{"type":"string","enum":["eq","neq","contains","isEmpty","isNotEmpty","gt","gte","lt","lte","in","notIn"],"description":"How to compare. Text columns: `eq`, `neq`, `contains`, `in`, `notIn`, `isEmpty`, `isNotEmpty`. Number and date columns also take `gt`, `gte`, `lt` and `lte`. Only `in` and `notIn` take a list of values (or one value, treated as a list of one), up to 100; an empty list matches nothing. Every other operator takes one value."},"value":{"description":"The value to compare with. Leave it out for `isEmpty` and `isNotEmpty`. A list of values (up to 100) is only for `in` and `notIn`; any other operator takes one value and refuses a list. For a single-select column, send the option's id, not its label. Can be a fixed value or a reference to a value from earlier in the flow, such as `${{ fields.selected_series }}`, filled in when the step runs.","anyOf":[{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},{"maxItems":100,"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}]}},"required":["fieldId","op"]},"StepSetting_rowFilterItem":{"type":"object","properties":{"columnKey":{"type":"string","minLength":1,"maxLength":100,"description":"The key of the table's column the condition checks. It chooses rows only; people picking never see it."},"op":{"type":"string","enum":["is","is_not","contains","not_contains","is_empty","is_not_empty"],"description":"`is` / `is_not`: the whole cell is (is not) one of the values. `contains` / `not_contains`: the cell has (has none of) the values as a whole word or phrase. `is_empty` / `is_not_empty` take no values. Case is ignored."},"values":{"default":[],"description":"The values to compare with. The condition holds when the cell matches any of them (for `is_not` and `not_contains`: none of them). Leave it empty for `is_empty` and `is_not_empty`.","maxItems":20,"type":"array","items":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"text","description":"`text`: a value typed in the setup."},"text":{"type":"string","minLength":1,"maxLength":500,"description":"The text to compare with, as typed (case is ignored)."}},"required":["kind","text"]},{"type":"object","properties":{"kind":{"type":"string","const":"flow","description":"`flow`: a piece of the flow's data, read when the step runs."},"token":{"type":"string","minLength":3,"maxLength":500,"description":"A reference to the flow's data (for example `{Intake form / Centre}`), read when the step runs."}},"required":["kind","token"]}]}}},"required":["columnKey","op"]},"StepSettings_DOCUMENT_COLLABORATION_sections":{"type":"object","properties":{"editorRoleIds":{"type":"array","items":{"anyOf":[{"type":"string","minLength":1},{"type":"string","minLength":1}]},"description":"The roles that may edit sections, by id."},"items":{"type":"array","items":{"type":"object","properties":{"sectionId":{"anyOf":[{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,39}$"},{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,39}$","description":"The section id of a heading in the first document's starting text (`## Pricing {#pricing}` has the id `pricing`)."}],"description":"The section's id."},"ownerRoleId":{"anyOf":[{"type":"string","minLength":1},{"type":"string","minLength":1,"description":"The role that writes this section; one of the step's assignees."}],"description":"The role that owns the section, by id."},"dueAfterDays":{"anyOf":[{"type":"integer","minimum":1,"maximum":90},{"type":"integer","minimum":1,"maximum":90}],"description":"How many days after the step starts the section is due."}},"required":["sectionId","ownerRoleId"]},"description":"The sections, each `{ sectionId, ownerRoleId, dueAfterDays }`: a heading of the document, the role that writes it, and how many days after the step starts it is due."},"hideOtherSections":{"anyOf":[{"type":"boolean"},{"type":"boolean"}],"description":"Whether each person sees only their own sections."}},"required":["editorRoleIds","items"],"description":"The document's sections, each with its owner."},"StepSettings_DOCUMENT_COLLABORATION_sidesItem":{"type":"object","properties":{"id":{"anyOf":[{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,39}$"},{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,39}$","description":"A short id for the side, unique in the step (for example `firm` or `client`)."}],"description":"A short id for the side, unique in the step (for example `firm` or `client`)."},"name":{"anyOf":[{"type":"string","minLength":1,"maxLength":60},{"type":"string","minLength":1,"maxLength":60,"description":"The side's name as people see it, for example `Our team` or `Client`. Up to 60 characters."}],"description":"The side's name as people see it, for example `Our team` or `Client`. Up to 60 characters."},"roleIds":{"type":"array","items":{"anyOf":[{"type":"string","minLength":1},{"type":"string","minLength":1}]},"description":"The roles on this side (role handles or names from the template's roles), 1 to 10. A role is on exactly one side, and the step's `assignees` lists exactly the roles of every side, in side order."},"readyToSend":{"anyOf":[{"type":"string","enum":["ANY_ONE","ALL","IN_ORDER"]},{"type":"string","enum":["ANY_ONE","ALL","IN_ORDER"]}],"description":"Who can act for the side. Leave out for `ANY_ONE`: anyone on the side can send or approve for it. `ALL`: everyone on the side must approve before it goes back. `IN_ORDER`: the side's people go one after another."}},"required":["id","name","roleIds"]},"StepSetting_format":{"type":"object","properties":{"type":{"type":"string","const":"number","description":"Set to `number`."},"min":{"description":"The smallest number accepted, inclusive. Taken from the PDF's own range check on upload, or set in the field editor.","type":"number"},"max":{"description":"The largest number accepted, inclusive. Taken from the PDF's own range check on upload, or set in the field editor.","type":"number"},"customMessage":{"description":"The message shown when a number is out of range, instead of the standard one. Set in the field editor; an upload never fills it in.","type":"string","maxLength":500},"filledGroup":{"description":"A limit on the total of several number fields. Every field in the group has the same `id` and `sumMax`, and the filled values must add up to `sumMax` or less; empty values aren't counted. Set in the field editor, or taken from the PDF on upload when its own validation states the numbers.","type":"object","properties":{"id":{"type":"string","minLength":1,"description":"The group's name, the same on every field in it. When the group came from the PDF on upload, it is the PDF's own function name."},"sumMax":{"type":"number","description":"The largest total the group's filled values may add up to, inclusive. The same on every field in the group."}},"required":["id","sumMax"]}},"required":["type"]},"StepSetting_ref":{"type":"object","properties":{"kind":{"type":"string","const":"for-each-aggregate","description":"Set to `for-each-aggregate`."},"expectedType":{"type":"string","description":"The type the value has, such as `TEXT`, `NUMBER`, `DATE`, `BOOLEAN` or `FILE`. An output read across a loop's rounds is a list, such as `LIST<TEXT>`."},"loopStepId":{"type":"string","description":"For `for-each-aggregate`: the loop step, by its id or the `handle` of a step added earlier in the same list."},"bodyStepId":{"type":"string","description":"For `for-each-aggregate`: the step inside the loop whose output to read, by its id or the `handle` of a step added earlier in the same list."},"field":{"type":"string","description":"The output's key on that step. On a form step it is the question's key (`fieldId`); a label is accepted and stored as that key, and a label two questions share is refused at publish. On an AI step, the output's `name`; on an e-signature or PDF form step, the step type's output name. Not the handle."}},"required":["kind","expectedType","loopStepId","bodyStepId","field"]},"StepSetting_value":{"type":"object","properties":{"kind":{"type":"string","const":"step-output","description":"Set to `step-output`."},"stepId":{"type":"string","description":"The earlier step that produces the value: its id, or the `handle` of a step added earlier in the same list. It must come before this step in the flow."},"field":{"type":"string","description":"The output's display name on that step, for example `Country` or `Decision`. On a form step it is the field's `label`; on an AI step, the output's `name`; on a file request step, `Uploaded Files`. Not the handle and not the step's name."},"expectedType":{"type":"string","description":"The type the value has, such as `TEXT`, `NUMBER`, `DATE`, `BOOLEAN` or `FILE`. An output read across a loop's rounds is a list, such as `LIST<TEXT>`."},"channel":{"description":"Which part of the step to read. `field` (the default) reads an output; `meta` reads completion details, such as who completed the step and when. Not used for a value collected across a loop.","type":"string","enum":["field","meta"]}},"required":["kind","stepId","field"]},"StepSetting_ref_2":{"type":"object","properties":{"kind":{"type":"string","const":"step-output","description":"Set to `step-output`."},"expectedType":{"type":"string","description":"The type the value has, such as `TEXT`, `NUMBER`, `DATE`, `BOOLEAN` or `FILE`. An output read across a loop's rounds is a list, such as `LIST<TEXT>`."},"stepId":{"type":"string","description":"The id of the step that produces the value."},"field":{"type":"string","description":"The output's key on that step. On a form step it is the question's key (`fieldId`); a label is accepted and stored as that key, and a label two questions share is refused at publish. On an AI step, the output's `name`; on an e-signature or PDF form step, the step type's output name. Not the handle."},"channel":{"description":"Which part of the step to read. `field` (the default) reads an output; `meta` reads completion details, such as who completed the step and when. Not used for a value collected across a loop.","type":"string","enum":["field","meta"]}},"required":["kind","expectedType","stepId","field"]},"StepSetting_fieldsItem":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"The field's name. Later steps reference it by this name."},"type":{"type":"string","enum":["TEXT","NUMBER","DATE","BOOLEAN","CHOICE","OBJECT"],"description":"The field's type: `TEXT`, `NUMBER`, `DATE`, `BOOLEAN`, `CHOICE` or `OBJECT`."},"enumValues":{"type":"array","items":{"type":"string"},"description":"For `CHOICE`: the values it can take."},"fields":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"The field's name. Later steps reference it by this name."},"type":{"type":"string","enum":["TEXT","NUMBER","DATE","BOOLEAN","CHOICE","OBJECT"],"description":"The field's type: `TEXT`, `NUMBER`, `DATE`, `BOOLEAN`, `CHOICE` or `OBJECT`."},"enumValues":{"type":"array","items":{"type":"string"},"description":"For `CHOICE`: the values it can take."}},"required":["name","type"]},"description":"For `OBJECT`: the fields it holds, each with a `name` and a `type`."}},"required":["name","type"]},"StepSetting_extractPack":{"description":"The document types a multi-file extraction expects. The step pauses unless each required type matches exactly one uploaded file. Set by Moxo, not in the step editor.","type":"object","properties":{"requiredTypes":{"maxItems":12,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"The document type's id, for example `invoice`, `purchase_order` or `receipt`. Lowercase with underscores, unique among the types."},"label":{"type":"string","minLength":1,"description":"The document type's display name, for example `Invoice`, `Purchase order` or `Receipt`."},"hints":{"description":"Optional file names or file types that identify a file of this type, for example `invoice`, `inv` or `po`.","type":"array","items":{"type":"string"}}},"required":["id","label"]},"description":"The document types this multi-file extraction must include, up to 12. Each type must match exactly one uploaded file, or the step pauses."}},"required":["requiredTypes"]},"StepSetting_closeAtDue":{"type":"object","properties":{"hour":{"default":17,"description":"The hour (0 to 23) the step closes on its due day. Defaults to 17 (5 PM).","type":"integer","minimum":0,"maximum":23},"minute":{"default":0,"description":"The minute (0 to 59) the step closes on its due day.","type":"integer","minimum":0,"maximum":59},"timezone":{"description":"The IANA time zone `hour` and `minute` are read in, such as `Europe/London`. Left out, the organization's time zone is used.","type":"string","minLength":1},"allowChangesAfterSubmit":{"default":false,"description":"When true, Submit keeps the step open: the person can change what they sent until the close, and the close completes the step.","type":"boolean"}},"description":"Close at the due date: the step closes by itself at its due date with what was saved. A due date set as a day closes on that day at `hour`:`minute` in `timezone`; a due date set in minutes or hours closes at that moment. Left out, the step stays open past its due date."},"StepSetting_extractVerificationCriteriaItem":{"type":"object","properties":{"id":{"type":"string","description":"The check's id: a short slug such as `journal-footing` or `check-2`."},"kind":{"type":"string","enum":["journal_footing","custom"],"description":"The kind of check. `journal_footing` checks that a ledger's debits equal its credits. `custom` is a check written in plain language."},"statement":{"type":"string","description":"In plain language, what must be true before the extraction completes. For example: \"Each journal's debits must equal its credits exactly.\""},"check":{"description":"The check that runs for this row, once confirmed for its words. A `journal_footing` row runs `journal.debits_equal_credits`. Send it back as a read returns it.","type":"string"},"confirmedStatement":{"description":"The words the check was confirmed for. A row whose words changed since then runs no check until it is confirmed again, and publishing refuses it.","type":"string"}},"required":["id","kind","statement"]},"StepSetting_ref_3":{"type":"object","properties":{"kind":{"type":"string","const":"for-each-item","description":"Set to `for-each-item`."},"expectedType":{"type":"string","description":"The type the value has, such as `TEXT`, `NUMBER`, `DATE`, `BOOLEAN` or `FILE`. An output read across a loop's rounds is a list, such as `LIST<TEXT>`."},"selector":{"type":"string","enum":["item","index","number","total"],"description":"What to read from the current pass of a loop. `item` reads a column of the current row; `index` (starting at 0), `number` (starting at 1) and `total` are the loop's counters."},"itemFieldId":{"description":"The column's id, for `item`. Preferred over `itemField`, because it still works after the column is renamed.","type":"string"},"itemField":{"description":"The column's label, for `item` when the list has no column ids. A label stops working when the column is renamed.","type":"string"}},"required":["kind","expectedType","selector"]},"StepSetting_ref_4":{"type":"object","properties":{"kind":{"type":"string","const":"step","description":"`step`: the reference points at an earlier step. Set `stepName` and `field` too."},"stepName":{"type":"string","minLength":1,"description":"The referenced step's name, exactly as it appears in the template."},"field":{"type":"string","minLength":1,"description":"The label or key of the field in the referenced step's results."},"subId":{"description":"The column's id in a repeating group. Leave it out to refer to the whole field.","type":"string","minLength":1},"sub":{"description":"The column's label in a repeating group. Use `subId` instead when you can.","type":"string","minLength":1},"rowIndex":{"description":"The row in a repeating group, counted from 0. Leave it out to refer to every row of the column.","type":"integer","minimum":0,"maximum":9007199254740991}},"required":["kind","stepName","field"]},"StepSetting_value_2":{"type":"object","properties":{"kind":{"type":"string","const":"for-each-aggregate","description":"Set to `for-each-aggregate`."},"loopStepId":{"type":"string","description":"The For each (or other loop) step whose rounds produced the output: its id, or the `handle` of a step added earlier in the same list."},"bodyStepId":{"type":"string","description":"The handle of a step inside the loop named by `loopStepId`. A step outside that loop is refused."},"field":{"type":"string","description":"The output's name on that step, for example `Decision`. The value is the list of that output's values, one per pass of the loop."},"expectedType":{"type":"string","description":"The type the value has, such as `TEXT`, `NUMBER`, `DATE`, `BOOLEAN` or `FILE`. An output read across a loop's rounds is a list, such as `LIST<TEXT>`."}},"required":["kind","loopStepId","bodyStepId","field"]},"StepSetting_ref_5":{"type":"object","properties":{"kind":{"type":"string","const":"role-data","description":"Set to `role-data`."},"expectedType":{"type":"string","const":"TEXT","description":"Set to `TEXT`."},"roleId":{"type":"string","description":"For `role-data`: the role whose person to read, by its name, its id, or the `handle` of a role added earlier in the same list."},"field":{"type":"string","enum":["name","email","phone","title"],"description":"The output's key on that step. On a form step it is the question's key (`fieldId`); a label is accepted and stored as that key, and a label two questions share is refused at publish. On an AI step, the output's `name`; on an e-signature or PDF form step, the step type's output name. Not the handle."}},"required":["kind","expectedType","roleId","field"]},"StepSetting_aiEscalation":{"description":"Who this step's AI escalations go to, when it differs from the template's AI escalations setting (`settings.aiEscalations`). Leave it out to follow the template, so a later change to the template reaches this step too.","type":"object","properties":{"roleId":{"description":"A role on this template that manages the flow (`roles[].roleId`). A role that does not manage the flow is passed over, and the template's setting is asked.","anyOf":[{"type":"string","minLength":1,"maxLength":80},{"type":"null"}]},"deskId":{"description":"A team desk instead of a role: the hand-off waits in the desk's queue until someone on it claims it. Set `roleId` or `deskId`, never both.","anyOf":[{"type":"string","minLength":1,"maxLength":80},{"type":"null"}]}},"additionalProperties":false},"StepSetting_attachmentsItem":{"type":"object","properties":{"kind":{"type":"string","const":"link","description":"Set to `link`."},"url":{"type":"string","minLength":1,"maxLength":2048,"description":"An absolute `http` or `https` address, or a reference to a value from earlier in the flow, filled in when the step runs."},"title":{"description":"A short label for the link. Defaults to the address.","type":"string","maxLength":200},"description":{"description":"Optional text shown on hover, cut to about 140 characters.","type":"string","maxLength":1000},"ref":{"type":"string","description":"A file from an earlier step, as a reference such as `${{ steps.upload_contract.fields.uploaded_files }}`, or an uploaded file's id."}},"required":["kind","url"]},"StepSetting_value_3":{"type":"object","properties":{"kind":{"type":"string","const":"trigger","description":"Set to `trigger`."},"triggerKind":{"type":"string","const":"email","description":"What started the flow. Only `email` is supported: a flow started by an email it received."},"property":{"type":"string","enum":["subject","from","fromName","to","bodyText","bodyHtml","attachments","receivedAt","messageId"],"description":"Which part of the email that started the flow to read. `attachments` is the email's attached files, for a file input such as a document a customer emailed in. `subject`, `from`, `fromName`, `to`, `bodyText`, `bodyHtml`, `receivedAt` and `messageId` are text."}},"required":["kind","triggerKind","property"]},"StepSetting_widgetPositionsItem":{"type":"object","properties":{"page":{"type":"number","description":"The page the box is on, from 1."},"x":{"type":"number","description":"The box's left edge, in points from the left of the page."},"y":{"type":"number","description":"The box's top edge, in points from the top of the page."},"width":{"type":"number","description":"The box's width, in points."},"height":{"type":"number","description":"The box's height, in points."},"optionValue":{"type":"string","description":"For a choice: the value this box stands for."},"pdfFieldName":{"type":"string","description":"The name of the PDF's own form field for the box."}},"required":["page","x","y","width","height","optionValue"]},"StepSetting_value_4":{"type":"object","properties":{"kind":{"type":"string","const":"role-data","description":"Set to `role-data`."},"roleId":{"type":"string","description":"The role whose person to read: its name, its id, or the `handle` of a role added earlier in the same list."},"field":{"type":"string","enum":["name","email","phone","title"],"description":"Which detail of the assigned person to read. `title` is their job title from the organization's title list, and is blank when they haven't set one."},"expectedType":{"type":"string","const":"TEXT","description":"Set to `TEXT`."}},"required":["kind","roleId","field"]},"NewStep_FORM":{"type":"object","title":"New Form step","required":["handle","type","config"],"properties":{"handle":{"type":"string","minLength":1,"description":"A name you choose, unique in this list, so later changes in the same list can use it where an id goes. The response maps it to its new id in `ids`."},"type":{"type":"string","enum":["FORM"],"description":"The step type."},"config":{"description":"The step's settings: the shared ones (`StepSettings`) and the `FORM` step's own (`StepSettings_FORM`). Any other setting is refused with `UNKNOWN_SETTING`.","allOf":[{"$ref":"#/components/schemas/StepSettings"},{"$ref":"#/components/schemas/StepSettings_FORM"}],"unevaluatedProperties":false}},"example":{"handle":"new_form","type":"FORM","config":{"name":"Client Intake","assignees":["Client"],"formFields":[{"handle":"client_name","label":"Full Name","type":"TEXT_SINGLE_LINE","required":true},{"handle":"is_us_citizen","label":"US Citizen","type":"YES_NO","required":true}],"description":"What this Form action is for."}}},"NewStep_QUESTIONNAIRE":{"type":"object","title":"New Questionnaire step","required":["handle","type","config"],"properties":{"handle":{"type":"string","minLength":1,"description":"A name you choose, unique in this list, so later changes in the same list can use it where an id goes. The response maps it to its new id in `ids`."},"type":{"type":"string","enum":["QUESTIONNAIRE"],"description":"The step type."},"config":{"description":"The step's settings: the shared ones (`StepSettings`) and the `QUESTIONNAIRE` step's own (`StepSettings_QUESTIONNAIRE`). Any other setting is refused with `UNKNOWN_SETTING`.","allOf":[{"$ref":"#/components/schemas/StepSettings"},{"$ref":"#/components/schemas/StepSettings_QUESTIONNAIRE"}],"unevaluatedProperties":false}},"example":{"handle":"new_questionnaire","type":"QUESTIONNAIRE","config":{"name":"Upgrade interest","description":"The customer says whether they want to upgrade.","assignees":["Customer"],"questionnaire":{"questions":[{"questionId":"upgrade","question":"Are you interested in upgrading your plan?","answerType":"YES_NO","required":true}]}}}},"NewStep_POLL":{"type":"object","title":"New Poll step","required":["handle","type","config"],"properties":{"handle":{"type":"string","minLength":1,"description":"A name you choose, unique in this list, so later changes in the same list can use it where an id goes. The response maps it to its new id in `ids`."},"type":{"type":"string","enum":["POLL"],"description":"The step type."},"config":{"description":"The step's settings: the shared ones (`StepSettings`) and the `POLL` step's own (`StepSettings_POLL`). Any other setting is refused with `UNKNOWN_SETTING`.","allOf":[{"$ref":"#/components/schemas/StepSettings"},{"$ref":"#/components/schemas/StepSettings_POLL"}],"unevaluatedProperties":false}},"example":{"handle":"new_poll","type":"POLL","config":{"name":"Pick a vendor","description":"The team votes on the vendor to proceed with.","assignees":["Operations"],"poll":{"questions":[{"question":"Which vendor should we proceed with?","options":[{"label":"Acme"},{"label":"Globex"}]}],"close":{"mode":"ALL_RESPONDED"}}}}},"NewStep_FILE_REQUEST":{"type":"object","title":"New File Request step","required":["handle","type","config"],"properties":{"handle":{"type":"string","minLength":1,"description":"A name you choose, unique in this list, so later changes in the same list can use it where an id goes. The response maps it to its new id in `ids`."},"type":{"type":"string","enum":["FILE_REQUEST"],"description":"The step type."},"config":{"description":"The step's settings: the shared ones (`StepSettings`) and the `FILE_REQUEST` step's own (`StepSettings_FILE_REQUEST`). Any other setting is refused with `UNKNOWN_SETTING`.","allOf":[{"$ref":"#/components/schemas/StepSettings"},{"$ref":"#/components/schemas/StepSettings_FILE_REQUEST"}],"unevaluatedProperties":false}},"example":{"handle":"new_file_request","type":"FILE_REQUEST","config":{"name":"Upload your ID","description":"The customer uploads both sides of a government ID.","assignees":["Customer"],"fileRequest":{"maxFiles":2,"maxFileSizeMB":25,"allowedTypes":["application/pdf","image/jpeg","image/png"],"instructions":"Upload both sides of your government-issued ID."}}}},"NewStep_TODO":{"type":"object","title":"New To-Do step","required":["handle","type","config"],"properties":{"handle":{"type":"string","minLength":1,"description":"A name you choose, unique in this list, so later changes in the same list can use it where an id goes. The response maps it to its new id in `ids`."},"type":{"type":"string","enum":["TODO"],"description":"The step type."},"config":{"description":"The step's settings: the shared ones (`StepSettings`) and the `TODO` step's own (`StepSettings_TODO`). Any other setting is refused with `UNKNOWN_SETTING`.","allOf":[{"$ref":"#/components/schemas/StepSettings"},{"$ref":"#/components/schemas/StepSettings_TODO"}],"unevaluatedProperties":false}},"example":{"handle":"new_todo","type":"TODO","config":{"name":"Send the welcome pack","description":"Operations posts the welcome pack.","assignees":["Operations"]}}},"NewStep_CHECKLIST":{"type":"object","title":"New Checklist step","required":["handle","type","config"],"properties":{"handle":{"type":"string","minLength":1,"description":"A name you choose, unique in this list, so later changes in the same list can use it where an id goes. The response maps it to its new id in `ids`."},"type":{"type":"string","enum":["CHECKLIST"],"description":"The step type."},"config":{"description":"The step's settings: the shared ones (`StepSettings`) and the `CHECKLIST` step's own (`StepSettings_CHECKLIST`). Any other setting is refused with `UNKNOWN_SETTING`.","allOf":[{"$ref":"#/components/schemas/StepSettings"},{"$ref":"#/components/schemas/StepSettings_CHECKLIST"}],"unevaluatedProperties":false}},"example":{"handle":"new_checklist","type":"CHECKLIST","config":{"assignees":["ops"],"checklist":{"items":[{"label":"Verify ID documents"},{"label":"Run sanctions screening"},{"label":"Confirm bank details"}]},"name":"Checklist","description":"What this Checklist action is for."}}},"NewStep_APPROVAL":{"type":"object","title":"New Approval step","required":["handle","type","config"],"properties":{"handle":{"type":"string","minLength":1,"description":"A name you choose, unique in this list, so later changes in the same list can use it where an id goes. The response maps it to its new id in `ids`."},"type":{"type":"string","enum":["APPROVAL"],"description":"The step type."},"config":{"description":"The step's settings: the shared ones (`StepSettings`) and the `APPROVAL` step's own (`StepSettings_APPROVAL`). Any other setting is refused with `UNKNOWN_SETTING`.","allOf":[{"$ref":"#/components/schemas/StepSettings"},{"$ref":"#/components/schemas/StepSettings_APPROVAL"}],"unevaluatedProperties":false}},"example":{"handle":"new_approval","type":"APPROVAL","config":{"name":"Approve the request","description":"A manager approves or rejects the request.","assignees":["Manager"]}}},"NewStep_ACKNOWLEDGEMENT":{"type":"object","title":"New Acknowledgement step","required":["handle","type","config"],"properties":{"handle":{"type":"string","minLength":1,"description":"A name you choose, unique in this list, so later changes in the same list can use it where an id goes. The response maps it to its new id in `ids`."},"type":{"type":"string","enum":["ACKNOWLEDGEMENT"],"description":"The step type."},"config":{"description":"The step's settings: the shared ones (`StepSettings`) and the `ACKNOWLEDGEMENT` step's own (`StepSettings_ACKNOWLEDGEMENT`). Any other setting is refused with `UNKNOWN_SETTING`.","allOf":[{"$ref":"#/components/schemas/StepSettings"},{"$ref":"#/components/schemas/StepSettings_ACKNOWLEDGEMENT"}],"unevaluatedProperties":false}},"example":{"handle":"new_acknowledgement","type":"ACKNOWLEDGEMENT","config":{"name":"Read the handbook","description":"The employee confirms they read the handbook.","assignees":["Employee"],"attachments":[{"kind":"link","url":"https://example.com/handbook.pdf","title":"Employee handbook"}]}}},"NewStep_WATCH_VIDEO":{"type":"object","title":"New Watch video step","required":["handle","type","config"],"properties":{"handle":{"type":"string","minLength":1,"description":"A name you choose, unique in this list, so later changes in the same list can use it where an id goes. The response maps it to its new id in `ids`."},"type":{"type":"string","enum":["WATCH_VIDEO"],"description":"The step type."},"config":{"description":"The step's settings: the shared ones (`StepSettings`) and the `WATCH_VIDEO` step's own (`StepSettings_WATCH_VIDEO`). Any other setting is refused with `UNKNOWN_SETTING`.","allOf":[{"$ref":"#/components/schemas/StepSettings"},{"$ref":"#/components/schemas/StepSettings_WATCH_VIDEO"}],"unevaluatedProperties":false}},"example":{"handle":"new_watch_video","type":"WATCH_VIDEO","config":{"name":"Watch the safety briefing","description":"The new hire watches the safety briefing to the end.","assignees":["New hire"],"video":{"durationSec":60}}}},"NewStep_PACKET":{"type":"object","title":"New Packet step","required":["handle","type","config"],"properties":{"handle":{"type":"string","minLength":1,"description":"A name you choose, unique in this list, so later changes in the same list can use it where an id goes. The response maps it to its new id in `ids`."},"type":{"type":"string","enum":["PACKET"],"description":"The step type."},"config":{"description":"The step's settings: the shared ones (`StepSettings`) and the `PACKET` step's own (`StepSettings_PACKET`). Any other setting is refused with `UNKNOWN_SETTING`.","allOf":[{"$ref":"#/components/schemas/StepSettings"},{"$ref":"#/components/schemas/StepSettings_PACKET"}],"unevaluatedProperties":false}},"example":{"handle":"new_packet","type":"PACKET","config":{"name":"Vendor setup","description":"The vendor gives their details, uploads their W-9 and agrees to the code of conduct, in one visit.","assignees":["Vendor"],"asks":[{"handle":"company_details","type":"FORM","config":{"name":"Company details","description":"The vendor gives their company name and tax ID.","formFields":[{"handle":"company_name","label":"Company name","type":"TEXT_SINGLE_LINE","required":true},{"handle":"tax_id","label":"Tax ID","type":"TEXT_SINGLE_LINE","required":true}]}},{"handle":"w9","type":"FILE_REQUEST","config":{"name":"W-9","description":"The vendor uploads their signed W-9.","fileRequest":{"maxFiles":1}}},{"handle":"code_of_conduct","type":"ACKNOWLEDGEMENT","config":{"name":"Supplier code of conduct","description":"The vendor agrees to the supplier code of conduct."}}],"packet":{"pages":[{"title":"Your company","items":[{"kind":"ask","askId":"company_details"},{"kind":"ask","askId":"w9"}],"buttons":[{"label":"Continue","primary":true,"goTo":{"kind":"next"}}]},{"title":"Our terms","items":[{"kind":"ask","askId":"code_of_conduct"}],"buttons":[{"label":"Submit","primary":true,"goTo":{"kind":"finish","outcomeHandle":"submitted"}}]}],"outcomes":[{"handle":"submitted","label":"Submitted","needsAsks":true}]}}}},"NewStep_DOCUMENT_REVIEW":{"type":"object","title":"New Document Review step","required":["handle","type","config"],"properties":{"handle":{"type":"string","minLength":1,"description":"A name you choose, unique in this list, so later changes in the same list can use it where an id goes. The response maps it to its new id in `ids`."},"type":{"type":"string","enum":["DOCUMENT_REVIEW"],"description":"The step type."},"config":{"description":"The step's settings: the shared ones (`StepSettings`) and the `DOCUMENT_REVIEW` step's own (`StepSettings_DOCUMENT_REVIEW`). Any other setting is refused with `UNKNOWN_SETTING`.","allOf":[{"$ref":"#/components/schemas/StepSettings"},{"$ref":"#/components/schemas/StepSettings_DOCUMENT_REVIEW"}],"unevaluatedProperties":false}},"example":{"handle":"new_document_review","type":"DOCUMENT_REVIEW","config":{"name":"Review the specification","description":"The project lead reviews the specification document.","assignees":["Project lead"]}}},"NewStep_DOCUMENT_COLLABORATION":{"type":"object","title":"New Document Collaboration step","required":["handle","type","config"],"properties":{"handle":{"type":"string","minLength":1,"description":"A name you choose, unique in this list, so later changes in the same list can use it where an id goes. The response maps it to its new id in `ids`."},"type":{"type":"string","enum":["DOCUMENT_COLLABORATION"],"description":"The step type."},"config":{"description":"The step's settings: the shared ones (`StepSettings`) and the `DOCUMENT_COLLABORATION` step's own (`StepSettings_DOCUMENT_COLLABORATION`). Any other setting is refused with `UNKNOWN_SETTING`.","allOf":[{"$ref":"#/components/schemas/StepSettings"},{"$ref":"#/components/schemas/StepSettings_DOCUMENT_COLLABORATION"}],"unevaluatedProperties":false}},"example":{"handle":"new_document_collaboration","type":"DOCUMENT_COLLABORATION","config":{"name":"Agree the contract","description":"Our legal team and the vendor take turns on the contract until both approve.","assignees":["Legal","Vendor"],"collaboration":{"mode":"take_turns","documents":[{"key":"msa","name":"Master services agreement","moxo":{"markdown":"# Master services agreement\n\nThe terms go here."}}],"sides":[{"id":"firm","name":"Our team","roleIds":["legal"]},{"id":"vendor","name":"Vendor","roleIds":["vendor"]}],"firstTurnSideId":"firm"}}}},"NewStep_PREPARE_DOCUMENT_BY_PERSON":{"type":"object","title":"New Prepare document step","required":["handle","type","config"],"properties":{"handle":{"type":"string","minLength":1,"description":"A name you choose, unique in this list, so later changes in the same list can use it where an id goes. The response maps it to its new id in `ids`."},"type":{"type":"string","enum":["PREPARE_DOCUMENT_BY_PERSON"],"description":"The step type."},"config":{"description":"The step's settings: the shared ones (`StepSettings`) and the `PREPARE_DOCUMENT_BY_PERSON` step's own (`StepSettings_PREPARE_DOCUMENT_BY_PERSON`). Any other setting is refused with `UNKNOWN_SETTING`.","allOf":[{"$ref":"#/components/schemas/StepSettings"},{"$ref":"#/components/schemas/StepSettings_PREPARE_DOCUMENT_BY_PERSON"}],"unevaluatedProperties":false}},"example":{"handle":"new_prepare_document_by_person","type":"PREPARE_DOCUMENT_BY_PERSON","config":{"assignees":["SalesRep"],"prepareDocument":{"fileName":"Area Development Agreement"},"name":"Prepare document","description":"What this Prepare document action is for."}}},"NewStep_ESIGN":{"type":"object","title":"New E-Signature step","required":["handle","type","config"],"properties":{"handle":{"type":"string","minLength":1,"description":"A name you choose, unique in this list, so later changes in the same list can use it where an id goes. The response maps it to its new id in `ids`."},"type":{"type":"string","enum":["ESIGN"],"description":"The step type."},"config":{"description":"The step's settings: the shared ones (`StepSettings`) and the `ESIGN` step's own (`StepSettings_ESIGN`). Any other setting is refused with `UNKNOWN_SETTING`.","allOf":[{"$ref":"#/components/schemas/StepSettings"},{"$ref":"#/components/schemas/StepSettings_ESIGN"}],"unevaluatedProperties":false}},"example":{"handle":"new_esign","type":"ESIGN","config":{"name":"Sign the engagement letter","description":"The customer signs. Upload the document to this action, then set it with update_step `fields.document.ref`.","assignees":["Customer"],"esign":{"documentName":"Engagement letter","signers":["Customer"],"signingOrder":"SEQUENTIAL"}}}},"NewStep_DOCUSIGN":{"type":"object","title":"New DocuSign step","required":["handle","type","config"],"properties":{"handle":{"type":"string","minLength":1,"description":"A name you choose, unique in this list, so later changes in the same list can use it where an id goes. The response maps it to its new id in `ids`."},"type":{"type":"string","enum":["DOCUSIGN"],"description":"The step type."},"config":{"description":"The step's settings: the shared ones (`StepSettings`) and the `DOCUSIGN` step's own (`StepSettings_DOCUSIGN`). Any other setting is refused with `UNKNOWN_SETTING`.","allOf":[{"$ref":"#/components/schemas/StepSettings"},{"$ref":"#/components/schemas/StepSettings_DOCUSIGN"}],"unevaluatedProperties":false}},"example":{"handle":"new_docusign","type":"DOCUSIGN","config":{"name":"Sign the onboarding packet","description":"Sends a DocuSign template for signature.","docusign":{"mode":"template","connectionId":"<DocuSign account id from get_build_context (connections)>","templateId":"<DocuSign template id from your DocuSign account>","roleMapping":[{"docusignRoleName":"Signer 1","moxoRoleId":"customer"}],"emailSubject":"Please sign your onboarding packet"}}}},"NewStep_ADOBE_SIGN":{"type":"object","title":"New Adobe Acrobat Sign step","required":["handle","type","config"],"properties":{"handle":{"type":"string","minLength":1,"description":"A name you choose, unique in this list, so later changes in the same list can use it where an id goes. The response maps it to its new id in `ids`."},"type":{"type":"string","enum":["ADOBE_SIGN"],"description":"The step type."},"config":{"description":"The step's settings: the shared ones (`StepSettings`) and the `ADOBE_SIGN` step's own (`StepSettings_ADOBE_SIGN`). Any other setting is refused with `UNKNOWN_SETTING`.","allOf":[{"$ref":"#/components/schemas/StepSettings"},{"$ref":"#/components/schemas/StepSettings_ADOBE_SIGN"}],"unevaluatedProperties":false}},"example":{"handle":"new_adobe_sign","type":"ADOBE_SIGN","config":{"name":"Sign the agreement","description":"Sends an Adobe Sign library document for signature.","adobeSign":{"connectionId":"<Adobe Sign account id from get_build_context (connections)>","libraryDocumentId":"<library document id from your Adobe Sign account>","signers":[{"label":"Signer 1","moxoRoleId":"customer","order":1}],"agreementName":"Please sign your onboarding agreement"}}}},"NewStep_JOTFORM":{"type":"object","title":"New Jotform step","required":["handle","type","config"],"properties":{"handle":{"type":"string","minLength":1,"description":"A name you choose, unique in this list, so later changes in the same list can use it where an id goes. The response maps it to its new id in `ids`."},"type":{"type":"string","enum":["JOTFORM"],"description":"The step type."},"config":{"description":"The step's settings: the shared ones (`StepSettings`) and the `JOTFORM` step's own (`StepSettings_JOTFORM`). Any other setting is refused with `UNKNOWN_SETTING`.","allOf":[{"$ref":"#/components/schemas/StepSettings"},{"$ref":"#/components/schemas/StepSettings_JOTFORM"}],"unevaluatedProperties":false}},"example":{"handle":"new_jotform","type":"JOTFORM","config":{"name":"Complete the questionnaire","description":"The customer fills in a Jotform form.","assignees":["Customer"],"jotform":{"connectionId":"<Jotform account id from get_build_context (connections)>","formId":"240000000000000"}}}},"NewStep_IDENTITY_VERIFICATION":{"type":"object","title":"New Identity verification step","required":["handle","type","config"],"properties":{"handle":{"type":"string","minLength":1,"description":"A name you choose, unique in this list, so later changes in the same list can use it where an id goes. The response maps it to its new id in `ids`."},"type":{"type":"string","enum":["IDENTITY_VERIFICATION"],"description":"The step type."},"config":{"description":"The step's settings: the shared ones (`StepSettings`) and the `IDENTITY_VERIFICATION` step's own (`StepSettings_IDENTITY_VERIFICATION`). Any other setting is refused with `UNKNOWN_SETTING`.","allOf":[{"$ref":"#/components/schemas/StepSettings"},{"$ref":"#/components/schemas/StepSettings_IDENTITY_VERIFICATION"}],"unevaluatedProperties":false}},"example":{"handle":"new_identity_verification","type":"IDENTITY_VERIFICATION","config":{"name":"Verify your identity","description":"The customer verifies their identity with a document and a selfie.","assignees":["Customer"],"identityVerification":{"provider":"yoti","connectionId":"<identity provider account id from get_build_context (connections)>","checks":"DOCUMENT_FACE_MATCH_LIVENESS","maxAttempts":3}}}},"NewStep_COLLECT_PAYMENT":{"type":"object","title":"New Collect Payment step","required":["handle","type","config"],"properties":{"handle":{"type":"string","minLength":1,"description":"A name you choose, unique in this list, so later changes in the same list can use it where an id goes. The response maps it to its new id in `ids`."},"type":{"type":"string","enum":["COLLECT_PAYMENT"],"description":"The step type."},"config":{"description":"The step's settings: the shared ones (`StepSettings`) and the `COLLECT_PAYMENT` step's own (`StepSettings_COLLECT_PAYMENT`). Any other setting is refused with `UNKNOWN_SETTING`.","allOf":[{"$ref":"#/components/schemas/StepSettings"},{"$ref":"#/components/schemas/StepSettings_COLLECT_PAYMENT"}],"unevaluatedProperties":false}},"example":{"handle":"new_collect_payment","type":"COLLECT_PAYMENT","config":{"name":"Pay the onboarding fee","description":"The customer pays the onboarding fee by card.","assignees":["Customer"],"payment":{"provider":"stripe","mode":"new_checkout","connectionId":"<Stripe account id from get_build_context>","amount":250,"currency":"USD","description":"Onboarding fee"}}}},"NewStep_DECISION":{"type":"object","title":"New Decision step","required":["handle","type","config"],"properties":{"handle":{"type":"string","minLength":1,"description":"A name you choose, unique in this list, so later changes in the same list can use it where an id goes. The response maps it to its new id in `ids`."},"type":{"type":"string","enum":["DECISION"],"description":"The step type."},"config":{"description":"The step's settings: the shared ones (`StepSettings`) and the `DECISION` step's own (`StepSettings_DECISION`). Any other setting is refused with `UNKNOWN_SETTING`.","allOf":[{"$ref":"#/components/schemas/StepSettings"},{"$ref":"#/components/schemas/StepSettings_DECISION"}],"unevaluatedProperties":false}},"example":{"handle":"new_decision","type":"DECISION","config":{"name":"Proceed or hold","description":"A reviewer decides whether the application goes ahead.","assignees":["Reviewer"],"outcomes":[{"handle":"proceed","label":"Proceed","steps":[]},{"handle":"hold","label":"Hold for more information","steps":[]}]}}},"NewStep_CUSTOM_ACTION":{"type":"object","title":"New Custom Action step","required":["handle","type","config"],"properties":{"handle":{"type":"string","minLength":1,"description":"A name you choose, unique in this list, so later changes in the same list can use it where an id goes. The response maps it to its new id in `ids`."},"type":{"type":"string","enum":["CUSTOM_ACTION"],"description":"The step type."},"config":{"description":"The step's settings: the shared ones (`StepSettings`) and the `CUSTOM_ACTION` step's own (`StepSettings_CUSTOM_ACTION`). Any other setting is refused with `UNKNOWN_SETTING`.","allOf":[{"$ref":"#/components/schemas/StepSettings"},{"$ref":"#/components/schemas/StepSettings_CUSTOM_ACTION"}],"unevaluatedProperties":false}},"example":{"handle":"new_custom_action","type":"CUSTOM_ACTION","config":{"name":"Homes for this weekend","description":"The buyers say whether they want to see homes on Saturday. A person builds and approves the page in the builder.","assignees":["Customer"],"actionConfig":{"brief":"Show the three homes we picked and ask whether the buyers want to see them on Saturday, and which times work.","outputs":[{"id":"see_saturday","label":"See homes on Saturday","type":"boolean","required":true},{"id":"times","label":"Times that work","type":"multi_select","required":false,"options":["Saturday morning","Saturday afternoon"]}]}}}},"NewStep_CONVERSATION":{"type":"object","title":"New Goal step","required":["handle","type","config"],"properties":{"handle":{"type":"string","minLength":1,"description":"A name you choose, unique in this list, so later changes in the same list can use it where an id goes. The response maps it to its new id in `ids`."},"type":{"type":"string","enum":["CONVERSATION"],"description":"The step type."},"config":{"description":"The step's settings: the shared ones (`StepSettings`) and the `CONVERSATION` step's own (`StepSettings_CONVERSATION`). Any other setting is refused with `UNKNOWN_SETTING`.","allOf":[{"$ref":"#/components/schemas/StepSettings"},{"$ref":"#/components/schemas/StepSettings_CONVERSATION"}],"unevaluatedProperties":false}},"example":{"handle":"new_conversation","type":"CONVERSATION","config":{"name":"Talk through the goals","description":"The customer talks through their goals for the year.","assignees":["Customer"],"conversation":{"agent":{"objective":"Find out the customer's three main goals for the year and their budget."}}}}},"NewStep_WEB_APP":{"type":"object","title":"New Web App step","required":["handle","type","config"],"properties":{"handle":{"type":"string","minLength":1,"description":"A name you choose, unique in this list, so later changes in the same list can use it where an id goes. The response maps it to its new id in `ids`."},"type":{"type":"string","enum":["WEB_APP"],"description":"The step type."},"config":{"description":"The step's settings: the shared ones (`StepSettings`) and the `WEB_APP` step's own (`StepSettings_WEB_APP`). Any other setting is refused with `UNKNOWN_SETTING`.","allOf":[{"$ref":"#/components/schemas/StepSettings"},{"$ref":"#/components/schemas/StepSettings_WEB_APP"}],"unevaluatedProperties":false}},"example":{"handle":"new_web_app","type":"WEB_APP","config":{"name":"Book a call","description":"The customer books a call in an outside scheduler.","assignees":["Customer"],"webAppConfig":{"url":"https://cal.example.com/intro","method":"GET","completionMode":"MANUAL","buttonLabel":"I have booked"}}}},"NewStep_PREPARE_DOCUMENT":{"type":"object","title":"New Prepare document step","required":["handle","type","config"],"properties":{"handle":{"type":"string","minLength":1,"description":"A name you choose, unique in this list, so later changes in the same list can use it where an id goes. The response maps it to its new id in `ids`."},"type":{"type":"string","enum":["PREPARE_DOCUMENT"],"description":"The step type."},"config":{"description":"The step's settings: the shared ones (`StepSettings`) and the `PREPARE_DOCUMENT` step's own (`StepSettings_PREPARE_DOCUMENT`). Any other setting is refused with `UNKNOWN_SETTING`.","allOf":[{"$ref":"#/components/schemas/StepSettings"},{"$ref":"#/components/schemas/StepSettings_PREPARE_DOCUMENT"}],"unevaluatedProperties":false}},"example":{"handle":"new_prepare_document","type":"PREPARE_DOCUMENT","config":{"name":"Prepare the authorization form","description":"Fills the direct deposit form from earlier answers. Upload the PDF to this action in the builder.","prepareDocument":{"fileName":"Direct deposit authorization"}}}},"NewStep_PDF_FORM":{"type":"object","title":"New PDF Form step","required":["handle","type","config"],"properties":{"handle":{"type":"string","minLength":1,"description":"A name you choose, unique in this list, so later changes in the same list can use it where an id goes. The response maps it to its new id in `ids`."},"type":{"type":"string","enum":["PDF_FORM"],"description":"The step type."},"config":{"description":"The step's settings: the shared ones (`StepSettings`) and the `PDF_FORM` step's own (`StepSettings_PDF_FORM`). Any other setting is refused with `UNKNOWN_SETTING`.","allOf":[{"$ref":"#/components/schemas/StepSettings"},{"$ref":"#/components/schemas/StepSettings_PDF_FORM"}],"unevaluatedProperties":false}},"example":{"handle":"new_pdf_form","type":"PDF_FORM","config":{"name":"Fill in the W-9","description":"The customer fills in the W-9. Upload the PDF to this action in the builder.","assignees":["Customer"],"pdfForm":{"fileName":"W-9.pdf"}}}},"NewStep_TIME_BOOKING":{"type":"object","title":"New Time Booking step","required":["handle","type","config"],"properties":{"handle":{"type":"string","minLength":1,"description":"A name you choose, unique in this list, so later changes in the same list can use it where an id goes. The response maps it to its new id in `ids`."},"type":{"type":"string","enum":["TIME_BOOKING"],"description":"The step type."},"config":{"description":"The step's settings: the shared ones (`StepSettings`) and the `TIME_BOOKING` step's own (`StepSettings_TIME_BOOKING`). Any other setting is refused with `UNKNOWN_SETTING`.","allOf":[{"$ref":"#/components/schemas/StepSettings"},{"$ref":"#/components/schemas/StepSettings_TIME_BOOKING"}],"unevaluatedProperties":false}},"example":{"handle":"new_time_booking","type":"TIME_BOOKING","config":{"name":"Book your discovery call","description":"The customer books a call with their sales rep.","assignees":["Customer"],"booking":{"calendarProvider":"GOOGLE_CALENDAR","meetingType":"GOOGLE_MEET","hostRoleId":"Sales rep","duration":30,"meetingTitle":"Discovery call with ${{ fields.company }}"}}}},"NewStep_SINGLE_CHOICE_BRANCH":{"type":"object","title":"New Single Choice Branch (If/Else) step","required":["handle","type","config"],"properties":{"handle":{"type":"string","minLength":1,"description":"A name you choose, unique in this list, so later changes in the same list can use it where an id goes. The response maps it to its new id in `ids`."},"type":{"type":"string","enum":["SINGLE_CHOICE_BRANCH"],"description":"The step type."},"config":{"description":"The step's settings: the shared ones (`StepSettings`) and the `SINGLE_CHOICE_BRANCH` step's own (`StepSettings_SINGLE_CHOICE_BRANCH`). Any other setting is refused with `UNKNOWN_SETTING`.","allOf":[{"$ref":"#/components/schemas/StepSettings"},{"$ref":"#/components/schemas/StepSettings_SINGLE_CHOICE_BRANCH"}],"unevaluatedProperties":false}},"example":{"handle":"new_single_choice_branch","type":"SINGLE_CHOICE_BRANCH","config":{"name":"Route by country","description":"US residents get the US checks; everyone else the international ones.","paths":[{"handle":"us","label":"US resident","condition":{"type":"EQUALS","left":{"kind":"flow-input","inputId":"country","expectedType":"TEXT"},"right":{"kind":"literal","expectedType":"TEXT","value":"US"}},"steps":[]},{"handle":"other","label":"Everyone else","condition":{"type":"ELSE"},"steps":[]}]}}},"NewStep_MULTI_CHOICE_BRANCH":{"type":"object","title":"New Multi Choice Branch step","required":["handle","type","config"],"properties":{"handle":{"type":"string","minLength":1,"description":"A name you choose, unique in this list, so later changes in the same list can use it where an id goes. The response maps it to its new id in `ids`."},"type":{"type":"string","enum":["MULTI_CHOICE_BRANCH"],"description":"The step type."},"config":{"description":"The step's settings: the shared ones (`StepSettings`) and the `MULTI_CHOICE_BRANCH` step's own (`StepSettings_MULTI_CHOICE_BRANCH`). Any other setting is refused with `UNKNOWN_SETTING`.","allOf":[{"$ref":"#/components/schemas/StepSettings"},{"$ref":"#/components/schemas/StepSettings_MULTI_CHOICE_BRANCH"}],"unevaluatedProperties":false}},"example":{"handle":"new_multi_choice_branch","type":"MULTI_CHOICE_BRANCH","config":{"name":"Send for the reviews it needs","description":"Every path whose condition holds runs.","paths":[{"handle":"legal","label":"Legal review","condition":{"type":"EQUALS","left":{"kind":"flow-input","inputId":"needs_legal","expectedType":"BOOLEAN"},"right":{"kind":"literal","expectedType":"BOOLEAN","value":true}},"steps":[]},{"handle":"security","label":"Security review","condition":{"type":"EQUALS","left":{"kind":"flow-input","inputId":"needs_security","expectedType":"BOOLEAN"},"right":{"kind":"literal","expectedType":"BOOLEAN","value":true}},"steps":[]}]}}},"NewStep_PARALLEL_BRANCH":{"type":"object","title":"New Parallel Branch step","required":["handle","type","config"],"properties":{"handle":{"type":"string","minLength":1,"description":"A name you choose, unique in this list, so later changes in the same list can use it where an id goes. The response maps it to its new id in `ids`."},"type":{"type":"string","enum":["PARALLEL_BRANCH"],"description":"The step type."},"config":{"description":"The step's settings: the shared ones (`StepSettings`) and the `PARALLEL_BRANCH` step's own (`StepSettings_PARALLEL_BRANCH`). Any other setting is refused with `UNKNOWN_SETTING`.","allOf":[{"$ref":"#/components/schemas/StepSettings"},{"$ref":"#/components/schemas/StepSettings_PARALLEL_BRANCH"}],"unevaluatedProperties":false}},"example":{"handle":"new_parallel_branch","type":"PARALLEL_BRANCH","config":{"name":"Collect documents and answers","description":"Both paths run at the same time.","paths":[{"handle":"documents","label":"Documents","steps":[{"handle":"upload_contract","type":"FILE_REQUEST","config":{"name":"Upload the contract","description":"The customer uploads the signed contract.","assignees":["Customer"],"fileRequest":{"maxFiles":1}}}]},{"handle":"answers","label":"Answers","steps":[{"handle":"check_details","type":"TODO","config":{"name":"Check the details","description":"Operations checks the customer details.","assignees":["Operations"]}}]}]}}},"NewStep_JUMP":{"type":"object","title":"New Jump step","required":["handle","type","config"],"properties":{"handle":{"type":"string","minLength":1,"description":"A name you choose, unique in this list, so later changes in the same list can use it where an id goes. The response maps it to its new id in `ids`."},"type":{"type":"string","enum":["JUMP"],"description":"The step type."},"config":{"description":"The step's settings: the shared ones (`StepSettings`) and the `JUMP` step's own (`StepSettings_JUMP`). Any other setting is refused with `UNKNOWN_SETTING`.","allOf":[{"$ref":"#/components/schemas/StepSettings"},{"$ref":"#/components/schemas/StepSettings_JUMP"}],"unevaluatedProperties":false}},"example":{"handle":"new_jump","type":"JUMP","config":{"name":"Back to the draft","description":"Sends the flow back to prepare the draft again.","targetHandle":"draft"}}},"NewStep_TERMINATE":{"type":"object","title":"New Terminate step","required":["handle","type","config"],"properties":{"handle":{"type":"string","minLength":1,"description":"A name you choose, unique in this list, so later changes in the same list can use it where an id goes. The response maps it to its new id in `ids`."},"type":{"type":"string","enum":["TERMINATE"],"description":"The step type."},"config":{"description":"The step's settings: the shared ones (`StepSettings`) and the `TERMINATE` step's own (`StepSettings_TERMINATE`). Any other setting is refused with `UNKNOWN_SETTING`.","allOf":[{"$ref":"#/components/schemas/StepSettings"},{"$ref":"#/components/schemas/StepSettings_TERMINATE"}],"unevaluatedProperties":false}},"example":{"handle":"new_terminate","type":"TERMINATE","config":{"name":"End the flow","description":"Ends the flow when the applicant is not eligible."}}},"NewStep_WAIT":{"type":"object","title":"New Wait step","required":["handle","type","config"],"properties":{"handle":{"type":"string","minLength":1,"description":"A name you choose, unique in this list, so later changes in the same list can use it where an id goes. The response maps it to its new id in `ids`."},"type":{"type":"string","enum":["WAIT"],"description":"The step type."},"config":{"description":"The step's settings: the shared ones (`StepSettings`) and the `WAIT` step's own (`StepSettings_WAIT`). Any other setting is refused with `UNKNOWN_SETTING`.","allOf":[{"$ref":"#/components/schemas/StepSettings"},{"$ref":"#/components/schemas/StepSettings_WAIT"}],"unevaluatedProperties":false}},"example":{"handle":"new_wait","type":"WAIT","config":{"waitFor":{"type":"DURATION","duration":{"value":2,"unit":"DAYS"}},"name":"Wait","description":"What this Wait action is for."}}},"NewStep_FOR_EACH":{"type":"object","title":"New For Each (Loop) step","required":["handle","type","config"],"properties":{"handle":{"type":"string","minLength":1,"description":"A name you choose, unique in this list, so later changes in the same list can use it where an id goes. The response maps it to its new id in `ids`."},"type":{"type":"string","enum":["FOR_EACH"],"description":"The step type."},"config":{"description":"The step's settings: the shared ones (`StepSettings`) and the `FOR_EACH` step's own (`StepSettings_FOR_EACH`). Any other setting is refused with `UNKNOWN_SETTING`.","allOf":[{"$ref":"#/components/schemas/StepSettings"},{"$ref":"#/components/schemas/StepSettings_FOR_EACH"}],"unevaluatedProperties":false}},"example":{"handle":"new_for_each","type":"FOR_EACH","config":{"name":"Visit each site","description":"Runs the visit three times, once per site.","dataSource":{"type":"COUNT","count":3},"steps":[{"handle":"visit","type":"TODO","config":{"name":"Visit the site","description":"Operations visits the site.","assignees":["Operations"]}}]}}},"NewStep_REPEAT_WHILE":{"type":"object","title":"New Repeat while step","required":["handle","type","config"],"properties":{"handle":{"type":"string","minLength":1,"description":"A name you choose, unique in this list, so later changes in the same list can use it where an id goes. The response maps it to its new id in `ids`."},"type":{"type":"string","enum":["REPEAT_WHILE"],"description":"The step type."},"config":{"description":"The step's settings: the shared ones (`StepSettings`) and the `REPEAT_WHILE` step's own (`StepSettings_REPEAT_WHILE`). Any other setting is refused with `UNKNOWN_SETTING`.","allOf":[{"$ref":"#/components/schemas/StepSettings"},{"$ref":"#/components/schemas/StepSettings_REPEAT_WHILE"}],"unevaluatedProperties":false}},"example":{"handle":"new_repeat_while","type":"REPEAT_WHILE","config":{"name":"Up to three revisions","description":"Repeats the review while changes are needed, at most three times.","steps":[{"handle":"review_draft","type":"DECISION","config":{"name":"Review the draft","description":"A manager approves the draft or asks for changes.","assignees":["Manager"],"outcomes":[{"handle":"approved","label":"Approved","steps":[]},{"handle":"changes","label":"Changes needed","steps":[]}]}}],"conditions":[{"type":"EQUALS","left":"${{ steps.review_draft.fields.decision }}","right":"Changes needed"}],"maxIterations":3}}},"NewStep_SUB_FLOW":{"type":"object","title":"New Sub Flow step","required":["handle","type","config"],"properties":{"handle":{"type":"string","minLength":1,"description":"A name you choose, unique in this list, so later changes in the same list can use it where an id goes. The response maps it to its new id in `ids`."},"type":{"type":"string","enum":["SUB_FLOW"],"description":"The step type."},"config":{"description":"The step's settings: the shared ones (`StepSettings`) and the `SUB_FLOW` step's own (`StepSettings_SUB_FLOW`). Any other setting is refused with `UNKNOWN_SETTING`.","allOf":[{"$ref":"#/components/schemas/StepSettings"},{"$ref":"#/components/schemas/StepSettings_SUB_FLOW"}],"unevaluatedProperties":false}},"example":{"handle":"new_sub_flow","type":"SUB_FLOW","config":{"name":"Run the KYC check","description":"Starts the KYC template as a sub-flow.","subFlow":{"flowTemplateId":"<template id from get_build_context (subFlowTemplates)>"}}}},"NewStep_BUILDING_BLOCK":{"type":"object","title":"New Building block step","required":["handle","type","config"],"properties":{"handle":{"type":"string","minLength":1,"description":"A name you choose, unique in this list, so later changes in the same list can use it where an id goes. The response maps it to its new id in `ids`."},"type":{"type":"string","enum":["BUILDING_BLOCK"],"description":"The step type."},"config":{"description":"The step's settings: the shared ones (`StepSettings`) and the `BUILDING_BLOCK` step's own (`StepSettings_BUILDING_BLOCK`). Any other setting is refused with `UNKNOWN_SETTING`.","allOf":[{"$ref":"#/components/schemas/StepSettings"},{"$ref":"#/components/schemas/StepSettings_BUILDING_BLOCK"}],"unevaluatedProperties":false}},"example":{"handle":"new_building_block","type":"BUILDING_BLOCK","config":{"name":"Standard ID check","description":"Adds the organization's ID-check building block here.","buildingBlock":{"blockTemplateId":"<building block template id from get_build_context (subFlowTemplates)>"}}}},"NewStep_AI_CUSTOM_PROMPT":{"type":"object","title":"New AI Custom Prompt step","required":["handle","type","config"],"properties":{"handle":{"type":"string","minLength":1,"description":"A name you choose, unique in this list, so later changes in the same list can use it where an id goes. The response maps it to its new id in `ids`."},"type":{"type":"string","enum":["AI_CUSTOM_PROMPT"],"description":"The step type."},"config":{"description":"The step's settings: the shared ones (`StepSettings`) and the `AI_CUSTOM_PROMPT` step's own (`StepSettings_AI_CUSTOM_PROMPT`). Any other setting is refused with `UNKNOWN_SETTING`.","allOf":[{"$ref":"#/components/schemas/StepSettings"},{"$ref":"#/components/schemas/StepSettings_AI_CUSTOM_PROMPT"}],"unevaluatedProperties":false}},"example":{"handle":"new_ai_custom_prompt","type":"AI_CUSTOM_PROMPT","config":{"name":"Classify the customer","description":"AI sorts the customer into a size tier from their notes.","aiAutomation":{"actionType":"CUSTOM_PROMPT","prompt":"Classify this customer as SMB, MID_MARKET or ENTERPRISE. Return only the label.","inputFields":[{"handle":"notes","name":"Notes","type":"TEXT","source":{"kind":"step-output","stepId":"intake_form","field":"Notes"}}],"outputFields":[{"handle":"tier","name":"Tier","type":"TEXT"}]}}}},"NewStep_AI_EXTRACT":{"type":"object","title":"New AI Extract step","required":["handle","type","config"],"properties":{"handle":{"type":"string","minLength":1,"description":"A name you choose, unique in this list, so later changes in the same list can use it where an id goes. The response maps it to its new id in `ids`."},"type":{"type":"string","enum":["AI_EXTRACT"],"description":"The step type."},"config":{"description":"The step's settings: the shared ones (`StepSettings`) and the `AI_EXTRACT` step's own (`StepSettings_AI_EXTRACT`). Any other setting is refused with `UNKNOWN_SETTING`.","allOf":[{"$ref":"#/components/schemas/StepSettings"},{"$ref":"#/components/schemas/StepSettings_AI_EXTRACT"}],"unevaluatedProperties":false}},"example":{"handle":"new_ai_extract","type":"AI_EXTRACT","config":{"name":"Read the invoice","description":"AI reads the invoice number, total and due date.","aiAutomation":{"actionType":"EXTRACT","inputFields":[{"handle":"invoice","name":"Invoice","type":"FILE","source":{"kind":"step-output","stepId":"upload_invoice","field":"Uploaded Files"}}],"outputFields":[{"handle":"invoice_number","name":"Invoice number","type":"TEXT"},{"handle":"total","name":"Total","type":"NUMBER"},{"handle":"due_date","name":"Due date","type":"DATE"}]}}}},"NewStep_AI_SUMMARIZE":{"type":"object","title":"New AI Summarize step","required":["handle","type","config"],"properties":{"handle":{"type":"string","minLength":1,"description":"A name you choose, unique in this list, so later changes in the same list can use it where an id goes. The response maps it to its new id in `ids`."},"type":{"type":"string","enum":["AI_SUMMARIZE"],"description":"The step type."},"config":{"description":"The step's settings: the shared ones (`StepSettings`) and the `AI_SUMMARIZE` step's own (`StepSettings_AI_SUMMARIZE`). Any other setting is refused with `UNKNOWN_SETTING`.","allOf":[{"$ref":"#/components/schemas/StepSettings"},{"$ref":"#/components/schemas/StepSettings_AI_SUMMARIZE"}],"unevaluatedProperties":false}},"example":{"handle":"new_ai_summarize","type":"AI_SUMMARIZE","config":{"name":"Summarize the intake","description":"AI summarizes the customer's notes for the team.","aiAutomation":{"actionType":"SUMMARIZE","inputFields":[{"handle":"notes","name":"Notes","type":"TEXT","source":{"kind":"step-output","stepId":"intake_form","field":"Notes"}}]}}}},"NewStep_AI_TRANSCRIBE":{"type":"object","title":"New AI Transcribe step","required":["handle","type","config"],"properties":{"handle":{"type":"string","minLength":1,"description":"A name you choose, unique in this list, so later changes in the same list can use it where an id goes. The response maps it to its new id in `ids`."},"type":{"type":"string","enum":["AI_TRANSCRIBE"],"description":"The step type."},"config":{"description":"The step's settings: the shared ones (`StepSettings`) and the `AI_TRANSCRIBE` step's own (`StepSettings_AI_TRANSCRIBE`). Any other setting is refused with `UNKNOWN_SETTING`.","allOf":[{"$ref":"#/components/schemas/StepSettings"},{"$ref":"#/components/schemas/StepSettings_AI_TRANSCRIBE"}],"unevaluatedProperties":false}},"example":{"handle":"new_ai_transcribe","type":"AI_TRANSCRIBE","config":{"name":"Transcribe the call","description":"AI writes out the recorded call.","aiAutomation":{"actionType":"TRANSCRIBE","inputFields":[{"handle":"recording","name":"Recording","type":"FILE","source":{"kind":"step-output","stepId":"upload_call","field":"Uploaded Files"}}]}}}},"NewStep_AI_TRANSLATE":{"type":"object","title":"New AI Translate step","required":["handle","type","config"],"properties":{"handle":{"type":"string","minLength":1,"description":"A name you choose, unique in this list, so later changes in the same list can use it where an id goes. The response maps it to its new id in `ids`."},"type":{"type":"string","enum":["AI_TRANSLATE"],"description":"The step type."},"config":{"description":"The step's settings: the shared ones (`StepSettings`) and the `AI_TRANSLATE` step's own (`StepSettings_AI_TRANSLATE`). Any other setting is refused with `UNKNOWN_SETTING`.","allOf":[{"$ref":"#/components/schemas/StepSettings"},{"$ref":"#/components/schemas/StepSettings_AI_TRANSLATE"}],"unevaluatedProperties":false}},"example":{"handle":"new_ai_translate","type":"AI_TRANSLATE","config":{"name":"Translate the notes","description":"AI translates the customer's notes into Spanish.","aiAutomation":{"actionType":"TRANSLATE","prompt":"Translate into Spanish.","inputFields":[{"handle":"notes","name":"Notes","type":"TEXT","source":{"kind":"step-output","stepId":"intake_form","field":"Notes"}}]}}}},"NewStep_AI_WRITE":{"type":"object","title":"New AI Write step","required":["handle","type","config"],"properties":{"handle":{"type":"string","minLength":1,"description":"A name you choose, unique in this list, so later changes in the same list can use it where an id goes. The response maps it to its new id in `ids`."},"type":{"type":"string","enum":["AI_WRITE"],"description":"The step type."},"config":{"description":"The step's settings: the shared ones (`StepSettings`) and the `AI_WRITE` step's own (`StepSettings_AI_WRITE`). Any other setting is refused with `UNKNOWN_SETTING`.","allOf":[{"$ref":"#/components/schemas/StepSettings"},{"$ref":"#/components/schemas/StepSettings_AI_WRITE"}],"unevaluatedProperties":false}},"example":{"handle":"new_ai_write","type":"AI_WRITE","config":{"name":"Draft the welcome email","description":"AI drafts a short, friendly welcome email.","aiAutomation":{"actionType":"WRITE","prompt":"Write a short, friendly welcome email for a new customer that introduces their advisor and the next three onboarding steps.","inputFields":[{"handle":"notes","name":"Notes","type":"TEXT","source":{"kind":"step-output","stepId":"intake_form","field":"Notes"}}]}}}},"NewStep_AI_AGENT":{"type":"object","title":"New AI Agent step","required":["handle","type","config"],"properties":{"handle":{"type":"string","minLength":1,"description":"A name you choose, unique in this list, so later changes in the same list can use it where an id goes. The response maps it to its new id in `ids`."},"type":{"type":"string","enum":["AI_AGENT"],"description":"The step type."},"config":{"description":"The step's settings: the shared ones (`StepSettings`) and the `AI_AGENT` step's own (`StepSettings_AI_AGENT`). Any other setting is refused with `UNKNOWN_SETTING`.","allOf":[{"$ref":"#/components/schemas/StepSettings"},{"$ref":"#/components/schemas/StepSettings_AI_AGENT"}],"unevaluatedProperties":false}},"example":{"handle":"new_ai_agent","type":"AI_AGENT","config":{"name":"Research the company","description":"Runs one of this organization's agents.","agentId":"<agent id from get_build_context (agents)>"}}},"NewStep_SYSTEM_WEBHOOK":{"type":"object","title":"New Webhook step","required":["handle","type","config"],"properties":{"handle":{"type":"string","minLength":1,"description":"A name you choose, unique in this list, so later changes in the same list can use it where an id goes. The response maps it to its new id in `ids`."},"type":{"type":"string","enum":["SYSTEM_WEBHOOK"],"description":"The step type."},"config":{"description":"The step's settings: the shared ones (`StepSettings`) and the `SYSTEM_WEBHOOK` step's own (`StepSettings_SYSTEM_WEBHOOK`). Any other setting is refused with `UNKNOWN_SETTING`.","allOf":[{"$ref":"#/components/schemas/StepSettings"},{"$ref":"#/components/schemas/StepSettings_SYSTEM_WEBHOOK"}],"unevaluatedProperties":false}},"example":{"handle":"new_system_webhook","type":"SYSTEM_WEBHOOK","config":{"name":"Tell the CRM","description":"Posts the new account to an outside system.","systemWebhook":{"url":"https://hooks.example.com/moxo","context":{"stage":"qualified","account":"${{ fields.company_name }}"}}}}},"NewStep_SYSTEM_EMAIL":{"type":"object","title":"New Send Email step","required":["handle","type","config"],"properties":{"handle":{"type":"string","minLength":1,"description":"A name you choose, unique in this list, so later changes in the same list can use it where an id goes. The response maps it to its new id in `ids`."},"type":{"type":"string","enum":["SYSTEM_EMAIL"],"description":"The step type."},"config":{"description":"The step's settings: the shared ones (`StepSettings`) and the `SYSTEM_EMAIL` step's own (`StepSettings_SYSTEM_EMAIL`). Any other setting is refused with `UNKNOWN_SETTING`.","allOf":[{"$ref":"#/components/schemas/StepSettings"},{"$ref":"#/components/schemas/StepSettings_SYSTEM_EMAIL"}],"unevaluatedProperties":false}},"example":{"handle":"new_system_email","type":"SYSTEM_EMAIL","config":{"name":"Send the welcome email","description":"Emails the customer when the flow starts.","systemEmail":{"to":["${{ roles.customer.email }}"],"subject":"Welcome, ${{ fields.company_name }}","body":"Thanks ${{ roles.customer.name }}. Your onboarding has started."}}}},"NewStep_SEND_ANNOUNCEMENT":{"type":"object","title":"New Send Announcement step","required":["handle","type","config"],"properties":{"handle":{"type":"string","minLength":1,"description":"A name you choose, unique in this list, so later changes in the same list can use it where an id goes. The response maps it to its new id in `ids`."},"type":{"type":"string","enum":["SEND_ANNOUNCEMENT"],"description":"The step type."},"config":{"description":"The step's settings: the shared ones (`StepSettings`) and the `SEND_ANNOUNCEMENT` step's own (`StepSettings_SEND_ANNOUNCEMENT`). Any other setting is refused with `UNKNOWN_SETTING`.","allOf":[{"$ref":"#/components/schemas/StepSettings"},{"$ref":"#/components/schemas/StepSettings_SEND_ANNOUNCEMENT"}],"unevaluatedProperties":false}},"example":{"handle":"new_send_announcement","type":"SEND_ANNOUNCEMENT","config":{"name":"Announce the kickoff","description":"Posts a one-way update to everyone on the flow.","sendAnnouncement":{"body":"Your onboarding has started. We will be in touch within two working days."}}}},"NewStep_SEND_TO_CONVERSATION":{"type":"object","title":"New Send to Conversation step","required":["handle","type","config"],"properties":{"handle":{"type":"string","minLength":1,"description":"A name you choose, unique in this list, so later changes in the same list can use it where an id goes. The response maps it to its new id in `ids`."},"type":{"type":"string","enum":["SEND_TO_CONVERSATION"],"description":"The step type."},"config":{"description":"The step's settings: the shared ones (`StepSettings`) and the `SEND_TO_CONVERSATION` step's own (`StepSettings_SEND_TO_CONVERSATION`). Any other setting is refused with `UNKNOWN_SETTING`.","allOf":[{"$ref":"#/components/schemas/StepSettings"},{"$ref":"#/components/schemas/StepSettings_SEND_TO_CONVERSATION"}],"unevaluatedProperties":false}},"example":{"handle":"new_send_to_conversation","type":"SEND_TO_CONVERSATION","config":{"name":"Open the customer conversation","description":"The advisor starts a conversation with the customer.","sendToConversation":{"operation":"create_conversation","sender":{"mode":"participant","person":{"type":"ROLE","roleId":"advisor"}},"create":{"name":"Customer onboarding","participants":[{"type":"ROLE","roleId":"customer"},{"type":"ROLE","roleId":"advisor"}],"managers":[{"type":"ROLE","roleId":"advisor"}],"firstMessage":"Welcome! Ask us anything here."}}}}},"NewStep_SYSTEM_UPDATE_FIELDS":{"type":"object","title":"New Update custom fields step","required":["handle","type","config"],"properties":{"handle":{"type":"string","minLength":1,"description":"A name you choose, unique in this list, so later changes in the same list can use it where an id goes. The response maps it to its new id in `ids`."},"type":{"type":"string","enum":["SYSTEM_UPDATE_FIELDS"],"description":"The step type."},"config":{"description":"The step's settings: the shared ones (`StepSettings`) and the `SYSTEM_UPDATE_FIELDS` step's own (`StepSettings_SYSTEM_UPDATE_FIELDS`). Any other setting is refused with `UNKNOWN_SETTING`.","allOf":[{"$ref":"#/components/schemas/StepSettings"},{"$ref":"#/components/schemas/StepSettings_SYSTEM_UPDATE_FIELDS"}],"unevaluatedProperties":false}},"example":{"handle":"new_system_update_fields","type":"SYSTEM_UPDATE_FIELDS","config":{"name":"Mark as high priority","description":"Sets the flow's priority field.","systemUpdateFields":{"updates":{"priority":"High"}}}}},"NewStep_DATA_TABLE_LOOKUP_RECORD":{"type":"object","title":"New Look up a record step","required":["handle","type","config"],"properties":{"handle":{"type":"string","minLength":1,"description":"A name you choose, unique in this list, so later changes in the same list can use it where an id goes. The response maps it to its new id in `ids`."},"type":{"type":"string","enum":["DATA_TABLE_LOOKUP_RECORD"],"description":"The step type."},"config":{"description":"The step's settings: the shared ones (`StepSettings`) and the `DATA_TABLE_LOOKUP_RECORD` step's own (`StepSettings_DATA_TABLE_LOOKUP_RECORD`). Any other setting is refused with `UNKNOWN_SETTING`.","allOf":[{"$ref":"#/components/schemas/StepSettings"},{"$ref":"#/components/schemas/StepSettings_DATA_TABLE_LOOKUP_RECORD"}],"unevaluatedProperties":false}},"example":{"handle":"new_data_table_lookup_record","type":"DATA_TABLE_LOOKUP_RECORD","config":{"name":"Find the vendor","description":"Looks the vendor up in the Vendors table by email.","tableId":"<data table id from get_build_context (dataTables)>","match":{"fieldId":"<column id from get_build_context (dataTables[].columns[].id)>","value":"${{ steps.intake_form.fields.vendor_email }}"},"onNoMatch":"fail"}}},"NewStep_DATA_TABLE_SAVE_RECORD":{"type":"object","title":"New Save a record step","required":["handle","type","config"],"properties":{"handle":{"type":"string","minLength":1,"description":"A name you choose, unique in this list, so later changes in the same list can use it where an id goes. The response maps it to its new id in `ids`."},"type":{"type":"string","enum":["DATA_TABLE_SAVE_RECORD"],"description":"The step type."},"config":{"description":"The step's settings: the shared ones (`StepSettings`) and the `DATA_TABLE_SAVE_RECORD` step's own (`StepSettings_DATA_TABLE_SAVE_RECORD`). Any other setting is refused with `UNKNOWN_SETTING`.","allOf":[{"$ref":"#/components/schemas/StepSettings"},{"$ref":"#/components/schemas/StepSettings_DATA_TABLE_SAVE_RECORD"}],"unevaluatedProperties":false}},"example":{"handle":"new_data_table_save_record","type":"DATA_TABLE_SAVE_RECORD","config":{"name":"Save the vendor","description":"Adds or updates the vendor in the Vendors table.","tableId":"<data table id from get_build_context (dataTables)>","match":{"fieldId":"<column id from get_build_context (dataTables[].columns[].id)>","value":"${{ steps.intake_form.fields.vendor_email }}"},"set":{"Status":"active"},"failIfExists":false}}},"NewStep_UPDATE_SPREADSHEET":{"type":"object","title":"New Update spreadsheet step","required":["handle","type","config"],"properties":{"handle":{"type":"string","minLength":1,"description":"A name you choose, unique in this list, so later changes in the same list can use it where an id goes. The response maps it to its new id in `ids`."},"type":{"type":"string","enum":["UPDATE_SPREADSHEET"],"description":"The step type."},"config":{"description":"The step's settings: the shared ones (`StepSettings`) and the `UPDATE_SPREADSHEET` step's own (`StepSettings_UPDATE_SPREADSHEET`). Any other setting is refused with `UNKNOWN_SETTING`.","allOf":[{"$ref":"#/components/schemas/StepSettings"},{"$ref":"#/components/schemas/StepSettings_UPDATE_SPREADSHEET"}],"unevaluatedProperties":false}},"example":{"handle":"new_update_spreadsheet","type":"UPDATE_SPREADSHEET","config":{"name":"Fill in the workbook","description":"Writes the customer's name into the workbook. Upload the workbook to this action in the builder.","mode":"populate","cellValues":[{"label":"Customer","direction":"right","value":"${{ fields.customer_name }}"}]}}},"NewStep_SYSTEM_UPDATE_FLOW_INFO":{"type":"object","title":"New Update flow info step","required":["handle","type","config"],"properties":{"handle":{"type":"string","minLength":1,"description":"A name you choose, unique in this list, so later changes in the same list can use it where an id goes. The response maps it to its new id in `ids`."},"type":{"type":"string","enum":["SYSTEM_UPDATE_FLOW_INFO"],"description":"The step type."},"config":{"description":"The step's settings: the shared ones (`StepSettings`) and the `SYSTEM_UPDATE_FLOW_INFO` step's own (`StepSettings_SYSTEM_UPDATE_FLOW_INFO`). Any other setting is refused with `UNKNOWN_SETTING`.","allOf":[{"$ref":"#/components/schemas/StepSettings"},{"$ref":"#/components/schemas/StepSettings_SYSTEM_UPDATE_FLOW_INFO"}],"unevaluatedProperties":false}},"example":{"handle":"new_system_update_flow_info","type":"SYSTEM_UPDATE_FLOW_INFO","config":{"name":"Name the flow","description":"Names the flow after the customer.","systemUpdateFlowInfo":{"flowName":"Onboarding: ${{ fields.customer_name }}"}}}},"NewStep_BUSINESS_RULE":{"type":"object","title":"New Business Rule step","required":["handle","type","config"],"properties":{"handle":{"type":"string","minLength":1,"description":"A name you choose, unique in this list, so later changes in the same list can use it where an id goes. The response maps it to its new id in `ids`."},"type":{"type":"string","enum":["BUSINESS_RULE"],"description":"The step type."},"config":{"description":"The step's settings: the shared ones (`StepSettings`) and the `BUSINESS_RULE` step's own (`StepSettings_BUSINESS_RULE`). Any other setting is refused with `UNKNOWN_SETTING`.","allOf":[{"$ref":"#/components/schemas/StepSettings"},{"$ref":"#/components/schemas/StepSettings_BUSINESS_RULE"}],"unevaluatedProperties":false}},"example":{"handle":"new_business_rule","type":"BUSINESS_RULE","config":{"name":"Set the tier","description":"Picks the account tier from the deal amount.","businessRule":{"inputs":[{"key":"amount","ref":{"kind":"step","stepName":"Intake form","field":"Deal amount"}}],"rules":[{"conditions":[{"input":"amount","operator":"gte","value":"50000"}],"set":{"tier":"ENTERPRISE"}},{"conditions":[{"input":"amount","operator":"gte","value":"10000"}],"set":{"tier":"MID_MARKET"}},{"isDefault":true,"set":{"tier":"SMB"}}]}}}},"NewStep_MATH":{"type":"object","title":"New Calculate step","required":["handle","type","config"],"properties":{"handle":{"type":"string","minLength":1,"description":"A name you choose, unique in this list, so later changes in the same list can use it where an id goes. The response maps it to its new id in `ids`."},"type":{"type":"string","enum":["MATH"],"description":"The step type."},"config":{"description":"The step's settings: the shared ones (`StepSettings`) and the `MATH` step's own (`StepSettings_MATH`). Any other setting is refused with `UNKNOWN_SETTING`.","allOf":[{"$ref":"#/components/schemas/StepSettings"},{"$ref":"#/components/schemas/StepSettings_MATH"}],"unevaluatedProperties":false}},"example":{"handle":"new_math","type":"MATH","config":{"name":"Work out the total","description":"Adds tax to the amount.","math":{"inputs":[{"name":"subtotal","ref":"${{ steps.intake_form.fields.amount }}","type":"NUMBER"},{"name":"taxRate","ref":"${{ fields.tax_rate }}","type":"NUMBER","default":0}],"operations":[{"name":"tax","formula":"subtotal * (taxRate / 100)"},{"name":"total","formula":"subtotal + tax"}],"outputs":[{"name":"tax"},{"name":"total"}]}}}},"NewStep_CODE":{"type":"object","title":"New Run code step","required":["handle","type","config"],"properties":{"handle":{"type":"string","minLength":1,"description":"A name you choose, unique in this list, so later changes in the same list can use it where an id goes. The response maps it to its new id in `ids`."},"type":{"type":"string","enum":["CODE"],"description":"The step type."},"config":{"description":"The step's settings: the shared ones (`StepSettings`) and the `CODE` step's own (`StepSettings_CODE`). Any other setting is refused with `UNKNOWN_SETTING`.","allOf":[{"$ref":"#/components/schemas/StepSettings"},{"$ref":"#/components/schemas/StepSettings_CODE"}],"unevaluatedProperties":false}},"example":{"handle":"new_code","type":"CODE","config":{"name":"Add the fee","description":"Adds a 2% processing fee to the amount.","code":{"inputs":[{"name":"amount","ref":{"kind":"step","stepName":"Intake form","field":"Amount"}}],"code":"export async function handler(input) {\n  return { total: Math.round(input.amount * 1.02 * 100) / 100 };\n}","outputs":[{"name":"total","type":"number"}]}}}},"NewStep_FORMAT":{"type":"object","title":"New Format data step","required":["handle","type","config"],"properties":{"handle":{"type":"string","minLength":1,"description":"A name you choose, unique in this list, so later changes in the same list can use it where an id goes. The response maps it to its new id in `ids`."},"type":{"type":"string","enum":["FORMAT"],"description":"The step type."},"config":{"description":"The step's settings: the shared ones (`StepSettings`) and the `FORMAT` step's own (`StepSettings_FORMAT`). Any other setting is refused with `UNKNOWN_SETTING`.","allOf":[{"$ref":"#/components/schemas/StepSettings"},{"$ref":"#/components/schemas/StepSettings_FORMAT"}],"unevaluatedProperties":false}},"example":{"handle":"new_format","type":"FORMAT","config":{"name":"Split the name","description":"Splits the full name into first and last name.","format":{"operation":"name","input":{"kind":"input","key":"full_name"}}}}},"NewStep_REST_API":{"type":"object","title":"New REST API step","required":["handle","type","config"],"properties":{"handle":{"type":"string","minLength":1,"description":"A name you choose, unique in this list, so later changes in the same list can use it where an id goes. The response maps it to its new id in `ids`."},"type":{"type":"string","enum":["REST_API"],"description":"The step type."},"config":{"description":"The step's settings: the shared ones (`StepSettings`) and the `REST_API` step's own (`StepSettings_REST_API`). Any other setting is refused with `UNKNOWN_SETTING`.","allOf":[{"$ref":"#/components/schemas/StepSettings"},{"$ref":"#/components/schemas/StepSettings_REST_API"}],"unevaluatedProperties":false}},"example":{"handle":"new_rest_api","type":"REST_API","config":{"name":"Look up the customer","description":"Reads the customer's tier from the CRM.","restApi":{"url":"https://api.example.com/customers/${{ fields.customer_id }}","method":"GET","connectionId":"<Secret name from get_build_context (secrets)>","outputMappings":[{"responseJsonPath":"$.data.tier","outputKey":"customer_tier"}]}}}},"NewStep_MCP_SERVER":{"type":"object","title":"New MCP Server step","required":["handle","type","config"],"properties":{"handle":{"type":"string","minLength":1,"description":"A name you choose, unique in this list, so later changes in the same list can use it where an id goes. The response maps it to its new id in `ids`."},"type":{"type":"string","enum":["MCP_SERVER"],"description":"The step type."},"config":{"description":"The step's settings: the shared ones (`StepSettings`) and the `MCP_SERVER` step's own (`StepSettings_MCP_SERVER`). Any other setting is refused with `UNKNOWN_SETTING`.","allOf":[{"$ref":"#/components/schemas/StepSettings"},{"$ref":"#/components/schemas/StepSettings_MCP_SERVER"}],"unevaluatedProperties":false}},"example":{"handle":"new_mcp_server","type":"MCP_SERVER","config":{"name":"Search the knowledge base","description":"Calls a tool on an MCP server.","mcpServer":{"serverUrl":"https://mcp.example.com","toolName":"search","arguments":{"query":"${{ fields.query }}","limit":"10"}}}}},"NewStep_EXTERNAL_APP":{"type":"object","title":"New External App step","required":["handle","type","config"],"properties":{"handle":{"type":"string","minLength":1,"description":"A name you choose, unique in this list, so later changes in the same list can use it where an id goes. The response maps it to its new id in `ids`."},"type":{"type":"string","enum":["EXTERNAL_APP"],"description":"The step type."},"config":{"description":"The step's settings: the shared ones (`StepSettings`) and the `EXTERNAL_APP` step's own (`StepSettings_EXTERNAL_APP`). Any other setting is refused with `UNKNOWN_SETTING`.","allOf":[{"$ref":"#/components/schemas/StepSettings"},{"$ref":"#/components/schemas/StepSettings_EXTERNAL_APP"}],"unevaluatedProperties":false}},"example":{"handle":"new_external_app","type":"EXTERNAL_APP","config":{"name":"Create the deal","description":"Creates a deal in HubSpot.","externalApp":{"appId":"hubspot","actionId":"create_deal","connectionId":"<HubSpot account name from get_build_context (connections)>","inputs":{"dealName":"${{ steps.intake_form.fields.company_name }}","amount":"${{ steps.intake_form.fields.deal_value }}","stage":"qualifiedtobuy"}}}}},"NewStep_ASSIGN_ROLE":{"type":"object","title":"New Assign Role step","required":["handle","type","config"],"properties":{"handle":{"type":"string","minLength":1,"description":"A name you choose, unique in this list, so later changes in the same list can use it where an id goes. The response maps it to its new id in `ids`."},"type":{"type":"string","enum":["ASSIGN_ROLE"],"description":"The step type."},"config":{"description":"The step's settings: the shared ones (`StepSettings`) and the `ASSIGN_ROLE` step's own (`StepSettings_ASSIGN_ROLE`). Any other setting is refused with `UNKNOWN_SETTING`.","allOf":[{"$ref":"#/components/schemas/StepSettings"},{"$ref":"#/components/schemas/StepSettings_ASSIGN_ROLE"}],"unevaluatedProperties":false}},"example":{"handle":"new_assign_role","type":"ASSIGN_ROLE","config":{"name":"Assign the account manager","description":"Puts the person named on the intake form in the Account manager role.","assignRole":{"assignments":[{"roleId":"account_manager","email":"${{ steps.intake_form.fields.manager_email }}"}]}}}},"NewStep_ADD_ROLE":{"type":"object","title":"New Add Role step","required":["handle","type","config"],"properties":{"handle":{"type":"string","minLength":1,"description":"A name you choose, unique in this list, so later changes in the same list can use it where an id goes. The response maps it to its new id in `ids`."},"type":{"type":"string","enum":["ADD_ROLE"],"description":"The step type."},"config":{"description":"The step's settings: the shared ones (`StepSettings`) and the `ADD_ROLE` step's own (`StepSettings_ADD_ROLE`). Any other setting is refused with `UNKNOWN_SETTING`.","allOf":[{"$ref":"#/components/schemas/StepSettings"},{"$ref":"#/components/schemas/StepSettings_ADD_ROLE"}],"unevaluatedProperties":false}},"example":{"handle":"new_add_role","type":"ADD_ROLE","config":{"name":"Add a role per entity","description":"Makes one Entity contact role per row of the list, named from the row, with the row's contact on it.","addRole":{"source":"${{ steps.intake_form.fields.entities }}","nameColumn":"Entity name","emailColumn":"Contact email","setupRoleId":"entity_contact","newPeopleAs":"external"}}}},"NewStep_UPDATE_USER":{"type":"object","title":"New Update user step","required":["handle","type","config"],"properties":{"handle":{"type":"string","minLength":1,"description":"A name you choose, unique in this list, so later changes in the same list can use it where an id goes. The response maps it to its new id in `ids`."},"type":{"type":"string","enum":["UPDATE_USER"],"description":"The step type."},"config":{"description":"The step's settings: the shared ones (`StepSettings`) and the `UPDATE_USER` step's own (`StepSettings_UPDATE_USER`). Any other setting is refused with `UNKNOWN_SETTING`.","allOf":[{"$ref":"#/components/schemas/StepSettings"},{"$ref":"#/components/schemas/StepSettings_UPDATE_USER"}],"unevaluatedProperties":false}},"example":{"handle":"new_update_user","type":"UPDATE_USER","config":{"name":"Set the client name","description":"Writes the preferred name from the intake form onto the client.","updateUser":{"personRef":"${{ roles.client.email }}","name":"${{ steps.intake_form.fields.preferred_name }}"}}}},"NewStep_START_FLOW":{"type":"object","title":"New Start a flow step","required":["handle","type","config"],"properties":{"handle":{"type":"string","minLength":1,"description":"A name you choose, unique in this list, so later changes in the same list can use it where an id goes. The response maps it to its new id in `ids`."},"type":{"type":"string","enum":["START_FLOW"],"description":"The step type."},"config":{"description":"The step's settings: the shared ones (`StepSettings`) and the `START_FLOW` step's own (`StepSettings_START_FLOW`). Any other setting is refused with `UNKNOWN_SETTING`.","allOf":[{"$ref":"#/components/schemas/StepSettings"},{"$ref":"#/components/schemas/StepSettings_START_FLOW"}],"unevaluatedProperties":false}},"example":{"handle":"new_start_flow","type":"START_FLOW","config":{"name":"Start the KYC flow","description":"Starts another template's flow and carries on.","startFlow":{"targetTemplateId":"<template id from get_build_context (subFlowTemplates)>"}}}},"NewStep_SCHEDULE_FLOW":{"type":"object","title":"New Schedule a flow step","required":["handle","type","config"],"properties":{"handle":{"type":"string","minLength":1,"description":"A name you choose, unique in this list, so later changes in the same list can use it where an id goes. The response maps it to its new id in `ids`."},"type":{"type":"string","enum":["SCHEDULE_FLOW"],"description":"The step type."},"config":{"description":"The step's settings: the shared ones (`StepSettings`) and the `SCHEDULE_FLOW` step's own (`StepSettings_SCHEDULE_FLOW`). Any other setting is refused with `UNKNOWN_SETTING`.","allOf":[{"$ref":"#/components/schemas/StepSettings"},{"$ref":"#/components/schemas/StepSettings_SCHEDULE_FLOW"}],"unevaluatedProperties":false}},"example":{"handle":"new_schedule_flow","type":"SCHEDULE_FLOW","config":{"name":"Schedule the annual review","description":"Schedules another template's flow for a later date.","scheduleFlow":{"targetTemplateId":"<template id from get_build_context (subFlowTemplates)>","frequencyMode":"once","startDate":"2027-01-15"}}}},"StepConfig_FORM":{"type":"object","properties":{"formSource":{"type":"object","properties":{"kind":{"type":"string","enum":["authored","endpoint"],"description":"`authored`: the questions in `formFields`. `endpoint`: the questions come from your system, the first time the assignee opens the form."},"request":{"type":"object","properties":{"url":{"type":"string","description":"Your endpoint's https:// address. May hold references, filled in when the form is first opened."},"method":{"type":"string","enum":["GET","POST"],"description":"GET or POST. A GET sends no body."},"queryParams":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"},"description":"Query parameters added to the address, by name. Values may hold references."},"headers":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"},"description":"Request headers, by name. Values may hold references. Moxo always sends Accept: application/json."},"body":{"description":"The JSON body, as an object or as JSON text. References inside its strings are filled in when the request is sent."},"connectionId":{"type":"string","description":"The saved Secret the request signs in with. When set, inline sign-in is ignored."},"auth":{"type":"object","properties":{"type":{"type":"string","enum":["none","bearer","basic"],"description":"Inline sign-in: none, a Bearer token, or Basic."},"token":{"type":"string","description":"The Bearer token. Publishing refuses a literal token: save it as a Secret."},"username":{"type":"string","description":"The Basic sign-in user name."},"password":{"type":"string","description":"The Basic sign-in password. Publishing refuses a literal password: save it as a Secret."}},"description":"Inline sign-in, when no saved Secret is set."}},"description":"The request Moxo sends to your endpoint for `endpoint`. The reply is a Moxo form (developers.moxo.com/docs/schemas/form.v1.json)."}},"required":["kind"],"description":"Where this form's questions come from. Omit for the questions in `formFields`. `{ kind: `endpoint`, request }` loads them from your own system the first time the assignee opens the form; the reply is a Moxo form (developers.moxo.com/docs/schemas/form.v1.json)."},"formFields":{"description":"The fields the form collects.","$ref":"#/components/schemas/StepConfig_FORM_formFields"},"fieldAssignment":{"type":"string","enum":["per-role"],"description":"Set to `per-role` to assign each field to one of the step's roles, whose assignee fills it in."},"hideOtherRoleFields":{"type":"boolean","description":"When `true` and `fieldAssignment` is `per-role`, each person sees only the fields assigned to their own roles. When `false` or omitted, everyone sees the whole form, and other roles' fields are read-only."},"display":{"type":"string","enum":["standard","focused","on-step"],"description":"How the form is shown to the person answering. `standard` (the default) shows the whole form on one scrolling page; `focused` shows one section per screen, which suits a long form answered on a phone; `on-step` (Fill in right on the step) shows the questions right on the action in a web browser, so the person answers and submits without opening the form first. `on-step` applies only to a form with no `PAGE_BREAK`, `TABLE`, `REPEATING_GROUP` or `MATRIX` field; any other form opens on its own screen. It changes only the presentation, never the questions or their order."},"autoFolder":{"type":"string","description":"A folder in the flow's Files panel for the files the assignee attaches to `FILE_UPLOAD` fields. It also receives the submission's PDF and CSV, unless `exportFolder` names a different folder. A plain name is used as written. The name can include a value from earlier in the flow. An empty value is left out, and the text around it stays. If nothing is left, the file stays unfiled."},"exportFolder":{"type":"string","description":"A folder in the flow's Files panel for the submission's PDF and CSV, kept apart from the files the assignee attached. Omit it to keep them with the attachments. A plain name is used as written. The name can include a value from earlier in the flow. An empty value is left out, and the text around it stays. If nothing is left, the file stays unfiled."},"formPdfOptions":{"type":"object","properties":{"leaveOutBlankAnswers":{"type":"boolean","description":"When `true`, a field with no answer is left out of the PDF and the Word export instead of printing a dash. `false` and `0` count as answers."},"leaveOutLayoutFields":{"type":"boolean","description":"When `true`, every `HEADING`, `PARAGRAPH` and `IMAGE` field is left out of the PDF and the Word export. Fields that take an answer, and page breaks, stay."}},"description":"What the PDF of a submitted form leaves out. Applies to the stored PDF, its preview and the Word export, for the whole form. Omit it, or set both values to `false`, for the full PDF. The CSV is not affected."},"attachments":{"description":"Reference material shown on the step: files, web links or both. A web link (`{ kind: \"link\", url }`) is a page the assignee should open. Its `url` can be a fixed `https://` address or a reference to a value from earlier in the flow, such as `${{ steps.look_up_portal_link.fields.latest_url }}`, so a running flow always links to the latest address.","$ref":"#/components/schemas/StepConfigPart_attachments"},"assist":{"description":"Assignee Assist on this form. `{ enabled: true }` lets the person filling in the form ask for help while they work. Omit it, or send `{ enabled: false }`, to leave Assist off.","$ref":"#/components/schemas/StepConfigPart_assist"},"guidedFill":{"type":"object","properties":{"enabled":{"type":"boolean","description":"Allows guided fill on this form. `true` lets the participant complete the form from the chat, with the form beside it. `false`, or no object, keeps the form manual only."},"defaultMode":{"type":"string","enum":["guided","manual"],"default":"guided","description":"Where the form opens when guided fill is allowed: `guided` opens the chat, `manual` opens the form. Defaults to `guided`. The participant can switch."}},"required":["enabled"],"description":"Guided fill on this form. `{ enabled: true }` lets the participant complete the form from the chat, with the form beside it. Omit it to keep the form manual only. Separate from `assist`."},"closeAtDue":{"type":"object","properties":{"hour":{"type":"integer","minimum":0,"maximum":23,"default":17,"description":"The hour (0 to 23) the step closes on its due day. Defaults to 17 (5 PM)."},"minute":{"type":"integer","minimum":0,"maximum":59,"default":0,"description":"The minute (0 to 59) the step closes on its due day."},"timezone":{"type":"string","minLength":1,"description":"The IANA time zone `hour` and `minute` are read in, such as `Europe/London`. Left out, the organization's time zone is used."},"allowChangesAfterSubmit":{"type":"boolean","default":false,"description":"When true, Submit keeps the step open: the person can change what they sent until the close, and the close completes the step."}},"description":"Close at the due date: the step closes by itself at its due date with what was saved. A due date set as a day closes on that day at `hour`:`minute` in `timezone`; a due date set in minutes or hours closes at that moment. Left out, the step stays open past its due date."},"preparers":{"anyOf":[{"type":"object","properties":{"participants":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["AI","HUMAN"]},"roleId":{"type":"string","description":"For a person: the role that takes this seat, by its id."},"contactId":{"type":"string","description":"An external user named on the seat, by the `usr_` id the template read shows. `null` follows the read, as for `userId`."},"userId":{"type":"string","description":"A person named on the seat, by the `usr_` id the template read shows. `null` where the read showed `null` (someone with no id here) keeps the saved person; `null` where it showed an id takes them off the seat."},"agentId":{"type":"string"},"prompt":{"type":"string","description":"The AI participant's step context: instructions for this step only."},"criteria":{"type":"string","description":"For an AI reviewer: what to check. Read before `prompt`."},"context":{"type":"string","description":"An older home of the AI participant's step context, still read. Set `prompt` instead."},"privateNotesGuidance":{"type":"string","maxLength":2000,"description":"When no agent is named: what the AI notes privately for the flow's managers."},"sendBackReply":{"type":"string","enum":["outcome_with_reason","outcome_only"],"description":"When the AI sends work back and no agent is named: what the reply says, `outcome_with_reason` or `outcome_only`."},"howToExplain":{"type":"string","maxLength":2000,"description":"When the AI sends work back and no agent is named: how it explains what to fix."},"inputs":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"value":{"type":"string"},"type":{"type":"string","enum":["TEXT","FILE"]}},"required":["name","value"]}},"participantId":{"type":"string","description":"The participant's id on the step. Keep it when sending the seat back; leave it out for a new participant."},"order":{"type":"number","description":"The participant's place in the seat, from 0, when they act one after another."},"aiConfig":{}},"required":["type"],"additionalProperties":{}}},"sequential":{"type":"boolean"},"completion":{"type":"object","properties":{"mode":{"type":"string","enum":["ANY_ONE","ALL"],"description":"`ANY_ONE`: one participant finishing is enough. `ALL`: every participant finishes."}},"required":["mode"],"description":"When the seat is done."},"showToExternalAssignee":{"description":"Advisors only. `true` lets an assignee outside your organization read the recommendation (the call and its reasons), as advice from your organization. Off unless set.","type":"boolean"},"canEditAnswers":{"description":"Reviewers only, on a Form, PDF form or File request step. `true` lets the reviewer whose turn it is edit the submitted answers (on a File request, add and remove its files) during review, in the Moxo app, instead of sending them back. Off unless set.","type":"boolean"},"reviewItemsTogether":{"description":"Reviewers only, on a person's step inside a For each whose items run at the same time. `true` gives the reviewer one list and one notice for every item instead of one review per item; each item keeps its own run and review. With the loop's `syncStepsAcrossIterations` on, the reviewer approves every item at once (`approve_reviews_together`); off, each item is approved on its own. Publish refuses it in a Repeat while, on an \"Approve before it runs\" step, with no person or role reviewing, and in a loop that runs items one at a time. Off unless set.","type":"boolean"}},"required":["participants"]},{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["AI","HUMAN"]},"roleId":{"type":"string"},"contactId":{"type":"string"},"userId":{"type":"string"},"agentId":{"type":"string"},"prompt":{"type":"string"},"criteria":{"type":"string"},"context":{"type":"string"},"privateNotesGuidance":{"type":"string","maxLength":2000},"sendBackReply":{"type":"string","enum":["outcome_with_reason","outcome_only"]},"howToExplain":{"type":"string","maxLength":2000},"inputs":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"value":{"type":"string"},"type":{"type":"string","enum":["TEXT","FILE"]}},"required":["name","value"]}},"ruleKinds":{"maxItems":80,"type":"array","items":{"type":"object","properties":{"rule":{"type":"string","minLength":1,"maxLength":2000},"kind":{"type":"string","enum":["fact","data_match","coverage","visual","judgment"]},"compare":{"type":"object","properties":{"check":{"type":"string","enum":["compare.money_equal","compare.date_after","compare.names_equal","certificate.insured_name_matches","certificate.limit_at_least","kyc.id_name_matches","kyc.birth_date_matches","kyc.dated_within_three_months"]},"against":{"type":"string","enum":["today","value","input"]},"value":{"type":"string","minLength":1,"maxLength":500},"input":{"type":"string","minLength":1,"maxLength":200}},"required":["check","against"]},"document":{"type":"string","minLength":1,"maxLength":200},"sum":{"type":"object","properties":{"fields":{"minItems":2,"maxItems":60,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}}},"required":["fields"]}},"required":["rule","kind"]}},"participantId":{"type":"string"},"order":{"type":"number"},"aiConfig":{}},"required":["type"],"additionalProperties":{}}}]},"reviewers":{"anyOf":[{"type":"object","properties":{"participants":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["AI","HUMAN"]},"roleId":{"type":"string","description":"For a person: the role that takes this seat, by its id."},"contactId":{"type":"string","description":"An external user named on the seat, by the `usr_` id the template read shows. `null` follows the read, as for `userId`."},"userId":{"type":"string","description":"A person named on the seat, by the `usr_` id the template read shows. `null` where the read showed `null` (someone with no id here) keeps the saved person; `null` where it showed an id takes them off the seat."},"agentId":{"type":"string"},"prompt":{"type":"string","description":"The AI participant's step context: instructions for this step only."},"criteria":{"type":"string","description":"For an AI reviewer: what to check. Read before `prompt`."},"context":{"type":"string","description":"An older home of the AI participant's step context, still read. Set `prompt` instead."},"privateNotesGuidance":{"type":"string","maxLength":2000,"description":"When no agent is named: what the AI notes privately for the flow's managers."},"sendBackReply":{"type":"string","enum":["outcome_with_reason","outcome_only"],"description":"When the AI sends work back and no agent is named: what the reply says, `outcome_with_reason` or `outcome_only`."},"howToExplain":{"type":"string","maxLength":2000,"description":"When the AI sends work back and no agent is named: how it explains what to fix."},"inputs":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"value":{"type":"string"},"type":{"type":"string","enum":["TEXT","FILE"]}},"required":["name","value"]}},"participantId":{"type":"string","description":"The participant's id on the step. Keep it when sending the seat back; leave it out for a new participant."},"order":{"type":"number","description":"The participant's place in the seat, from 0, when they act one after another."},"aiConfig":{}},"required":["type"],"additionalProperties":{}}},"sequential":{"type":"boolean"},"completion":{"type":"object","properties":{"mode":{"type":"string","enum":["ANY_ONE","ALL"],"description":"`ANY_ONE`: one participant finishing is enough. `ALL`: every participant finishes."}},"required":["mode"],"description":"When the seat is done."},"showToExternalAssignee":{"description":"Advisors only. `true` lets an assignee outside your organization read the recommendation (the call and its reasons), as advice from your organization. Off unless set.","type":"boolean"},"canEditAnswers":{"description":"Reviewers only, on a Form, PDF form or File request step. `true` lets the reviewer whose turn it is edit the submitted answers (on a File request, add and remove its files) during review, in the Moxo app, instead of sending them back. Off unless set.","type":"boolean"},"reviewItemsTogether":{"description":"Reviewers only, on a person's step inside a For each whose items run at the same time. `true` gives the reviewer one list and one notice for every item instead of one review per item; each item keeps its own run and review. With the loop's `syncStepsAcrossIterations` on, the reviewer approves every item at once (`approve_reviews_together`); off, each item is approved on its own. Publish refuses it in a Repeat while, on an \"Approve before it runs\" step, with no person or role reviewing, and in a loop that runs items one at a time. Off unless set.","type":"boolean"}},"required":["participants"]},{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["AI","HUMAN"]},"roleId":{"type":"string"},"contactId":{"type":"string"},"userId":{"type":"string"},"agentId":{"type":"string"},"prompt":{"type":"string"},"criteria":{"type":"string"},"context":{"type":"string"},"privateNotesGuidance":{"type":"string","maxLength":2000},"sendBackReply":{"type":"string","enum":["outcome_with_reason","outcome_only"]},"howToExplain":{"type":"string","maxLength":2000},"inputs":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"value":{"type":"string"},"type":{"type":"string","enum":["TEXT","FILE"]}},"required":["name","value"]}},"ruleKinds":{"maxItems":80,"type":"array","items":{"type":"object","properties":{"rule":{"type":"string","minLength":1,"maxLength":2000},"kind":{"type":"string","enum":["fact","data_match","coverage","visual","judgment"]},"compare":{"type":"object","properties":{"check":{"type":"string","enum":["compare.money_equal","compare.date_after","compare.names_equal","certificate.insured_name_matches","certificate.limit_at_least","kyc.id_name_matches","kyc.birth_date_matches","kyc.dated_within_three_months"]},"against":{"type":"string","enum":["today","value","input"]},"value":{"type":"string","minLength":1,"maxLength":500},"input":{"type":"string","minLength":1,"maxLength":200}},"required":["check","against"]},"document":{"type":"string","minLength":1,"maxLength":200},"sum":{"type":"object","properties":{"fields":{"minItems":2,"maxItems":60,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}}},"required":["fields"]}},"required":["rule","kind"]}},"participantId":{"type":"string"},"order":{"type":"number"},"aiConfig":{}},"required":["type"],"additionalProperties":{}}}]},"aiEscalation":{"type":"object","properties":{"roleId":{"anyOf":[{"type":"string","minLength":1,"maxLength":80},{"type":"null"}]},"deskId":{"description":"A team desk instead of a role: the hand-off waits in the desk's queue until someone on it claims it. Set `roleId` or `deskId`, never both.","anyOf":[{"type":"string","minLength":1,"maxLength":80},{"type":"null"}]}},"additionalProperties":false},"visibleToAllAssignees":{"type":"boolean"},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"},"options":{"description":"Switches for the files attached to this step. A type takes only the ones its step settings show.","type":"object","properties":{"preventDownload":{"description":"Prevent download: people can open the files attached to this step to read them, but can't download them. Needs view-only attachments switched on for your organization.","type":"boolean"}}}},"title":"Form","description":"Collects information through a form.\n\nThe settings a template read (`GET /v1/templates/{id}`) returns for this type, as stored. The shared settings (due date, reminders, visibility, monitors) can appear alongside them. To set them in a change, send `StepSettings_FORM`: where this shape holds an id, a change can name a role, field or step by its name or handle.\n\n**Offered by plan:** available when the organization's plan includes `form`.","x-moxo-step-type":"FORM","x-moxo-category":"HUMAN_ACTION","x-moxo-plan-feature":"form"},"StepConfig_FORM_formFields":{"type":"array","items":{"type":"object","properties":{"fieldId":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","enum":["TEXT_SINGLE_LINE","TEXT_MULTI_LINE","SINGLE_SELECT","MULTI_SELECT","DROPDOWN","DYNAMIC_DROPDOWN","DATA_TABLE_LOOKUP","FILE_UPLOAD","DATE","NUMBER","EMAIL","PHONE","CURRENCY","CALCULATED","NAME","ADDRESS","SIGNATURE","YES_NO","RATING","NPS","SCALE","MATRIX","RANKING","URL","TIME","HIDDEN","AUTO_NUMBER","COUNTRY_SELECT","REPEATING_GROUP","HEADING","PARAGRAPH","IMAGE","VIDEO","PAGE_BREAK","LINE_SEPARATOR","FIELD_GROUP","TABLE"]},"required":{"type":"boolean"},"readOnly":{"type":"boolean"},"options":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"value":{"type":"string"}},"required":["label","value"]},{"type":"string"}]}},"placeholder":{"type":"string"},"helpText":{"type":"string"},"context":{"type":"string","maxLength":500},"defaultValue":{"type":"string"},"integrationKey":{"type":"string","maxLength":64,"pattern":"^[a-zA-Z0-9_-]+$","description":"The key this field's value has in outgoing integration payloads, instead of the generated key. Optional."},"width":{"type":"string","enum":["full","half"]},"validation":{"type":"object","properties":{"minLength":{"type":"number"},"maxLength":{"type":"number"},"min":{"type":"number"},"max":{"type":"number"},"precision":{"type":"integer","minimum":0,"maximum":9007199254740991},"pattern":{"type":"string"},"customMessage":{"type":"string"},"minDateFromFieldId":{"type":"string"},"maxDateFromFieldId":{"type":"string"},"defaultToCurrentDate":{"type":"boolean"},"futureDatesOnly":{"type":"boolean"},"pastDatesOnly":{"type":"boolean"},"allowedDaysOfMonth":{"minItems":1,"type":"array","items":{"anyOf":[{"type":"number","const":1},{"type":"number","const":15}]}},"allowLastDayOfMonth":{"type":"boolean"}}},"conditionalLogic":{"$ref":"#/components/schemas/StepConfig_FORM_conditionalLogic"},"config":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"allowMultiple":{"type":"boolean","description":"Data table lookup fields only. When `true`, the assignee can pick more than one record, and the value is a JSON array of `{ recordId, label, summary }`. When `false` or omitted, the value is a single record object."},"subFields":{"$ref":"#/components/schemas/StepConfig_FORM_subFields"},"minRows":{"type":"number"},"maxRows":{"type":"number"},"minRowsRef":{"type":"string"},"maxRowsRef":{"type":"string"},"validateCells":{"type":"boolean"},"itemLabel":{"type":"string","maxLength":40},"itemLabelPlural":{"type":"string","maxLength":40},"repeatingGroupLayout":{"type":"string","enum":["table","cards"]},"allowDuplicateRows":{"type":"boolean","description":"For a repeating group: `true` shows a Duplicate last button beside Add, in the table and in cards. It copies the last row's answers the person can edit. File uploads are left out, read-only and hidden columns start from their defaults, and calculated columns are worked out again. The new row is added at the end. Leave it out to hide the button."},"frozenColumnCount":{"type":"integer","minimum":0,"maximum":3},"repeatingGroupLabelColumnId":{"type":"string","maxLength":80},"summaries":{"maxItems":40,"type":"array","items":{"$ref":"#/components/schemas/StepConfig_FORM_summariesItem"}},"prefillFromInput":{"type":"string","maxLength":80,"description":"Repeating group fields only. The id or key of a repeating group asked for when the flow starts, whose rows fill this field. Saved as the field id. The field is read-only."},"assignedRoleId":{"type":"string","description":"With per-role field assignment: the `roleId` of the role that fills in this field."},"assignedRoleIds":{"type":"array","items":{"type":"string"},"description":"With per-role field assignment: the `roleId`s of the roles that fill in this field, when two or more do. Use instead of `assignedRoleId`."},"assignedToEveryone":{"type":"boolean","const":true,"description":"With per-role field assignment: `true` when everyone assigned to the action fills in this field. Takes precedence over `assignedRoleIds` and `assignedRoleId`."},"groupId":{"type":"string"},"dependsOn":{"type":"object","properties":{"fieldId":{"type":"string"},"mapping":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["fieldId","mapping"]},"groupTitle":{"type":"string","description":"A field group's heading, shown on each copy when the group repeats."},"key":{"type":"string","description":"An older id for the field: its answers are saved under it when the field has no `fieldId`."},"autoFillFrom":{"type":"object","properties":{"sourceFieldId":{"type":"string"},"column":{"type":"string"},"columnFieldId":{"type":"string"}},"description":"Fills this field from a column of the record someone picked in a `DATA_TABLE_LOOKUP` field on the same form."},"defaultFromDDR":{"type":"string","description":"Fills a `FILE_UPLOAD` field with the files that started the flow, such as the attachments of the email that started it."},"repeatFrom":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Repeats this group of fields once for each row of a table field on the same form."},"collapsible":{"type":"boolean","description":"Lets people filling the form open and close this `FIELD_GROUP` by its heading. A group that can collapse needs a `label`."},"startCollapsed":{"type":"boolean","description":"With `collapsible` on, the group starts closed when the form opens. A closed group still opens on submit when a required field inside it is empty."},"sensitive":{"type":"boolean","description":"Keeps the answers private in reports: reports show only how many people answered."}},"required":["type"]}},"StepConfigPart_attachments":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"ref":{"type":"string","description":"A file from an earlier step, as a reference such as `${{ steps.upload_contract.fields.uploaded_files }}`, or an uploaded file's id."}},"required":["ref"]},{"type":"object","properties":{"kind":{"type":"string","const":"link"},"url":{"type":"string","minLength":1,"maxLength":2048,"description":"An absolute `http` or `https` address, or a reference to a value from earlier in the flow, filled in when the step runs."},"title":{"type":"string","maxLength":200,"description":"A short label for the link. Defaults to the address."},"description":{"type":"string","maxLength":1000,"description":"Optional text shown on hover, cut to about 140 characters."},"ref":{"type":"string","description":"A file from an earlier step, as a reference such as `${{ steps.upload_contract.fields.uploaded_files }}`, or an uploaded file's id."}},"required":["kind","url"]},{"type":"object","properties":{"kind":{"type":"string","const":"file"},"ref":{"type":"string","description":"A file: an uploaded file's id, or a reference to a file from an earlier step."},"name":{"type":"string","minLength":1,"maxLength":255,"description":"The file's name as shown on the step."}},"required":["kind","ref"]}]}},"StepConfigPart_assist":{"type":"object","properties":{"enabled":{"type":"boolean","description":"Turns on Assignee Assist for this step. `true` opens a helper panel where the person working on the step can ask questions and, on a form, get help filling it in. `false`, or no `assist` object, leaves Assist off."},"agentId":{"type":"string"},"grantedPriorFields":{"maxItems":25,"type":"array","items":{"type":"string","minLength":1}},"whatToKnow":{"type":"string","maxLength":4000,"description":"Facts and contacts Assist may share with the person asked, such as office hours or who to call. Up to 4,000 characters."},"answerStyle":{"type":"string","maxLength":2000,"description":"How Assist answers: tone, length and what to avoid. Ignored when `agentId` picks an agent. Up to 2,000 characters."},"faqFiles":{"maxItems":5,"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"description":"Up to 5 file ids Assist reads and may quote from. The person asked can't see or open them."},"summarizeQuestions":{"type":"boolean","description":"`true` adds a summary of what people asked Assist to the managers' Private notes. It uses AI credits. Off when omitted."},"privateNotesGuidance":{"type":"string","maxLength":2000,"description":"What to include in the Private notes summary of people's questions. Used only when `summarizeQuestions` is `true`. Assist never reads it in chat. Up to 2,000 characters."},"disclaimer":{"type":"string","maxLength":300,"description":"The note shown under the Assist chat box. Assist never reads it. Leave it out to show the default note. Up to 300 characters."}},"required":["enabled"]},"StepConfig_FORM_conditionalLogic":{"type":"object","properties":{"action":{"type":"string","enum":["show","hide"],"description":"Whether the field is shown or hidden when the conditions match. `show`: shown only when they match. `hide`: hidden when they match."},"logicType":{"type":"string","enum":["all","any"],"description":"How the conditions combine. `all`: every condition must match. `any`: at least one must match."},"conditions":{"type":"array","items":{"type":"object","properties":{"source":{"type":"string","enum":["form","ddr"],"description":"Where the condition reads its value. `form`, or omitted: a field in this form. `ddr`: a value from earlier in the flow, such as an earlier step's answer, a start field or a role's details."},"fieldKey":{"type":"string","description":"The field in this form to test, by its field id. Required for a condition on this form, which is the default. Leave it out when `source` is `ddr`, where `ref` names the value instead."},"ref":{"type":"string","description":"The value to test when `source` is `ddr`: a reference to a value from earlier in the flow, such as `${{ steps.intake.fields.segment }}`. Required for that source."},"operator":{"type":"string","enum":["equals","not_equals","contains","not_contains","greater_than","less_than","greater_than_or_equal","less_than_or_equal","starts_with","ends_with","is_empty","is_not_empty","in","not_in"],"description":"How to compare the value. One of `equals`, `not_equals`, `contains`, `not_contains`, `greater_than`, `less_than`, `greater_than_or_equal`, `less_than_or_equal`, `starts_with`, `ends_with`, `is_empty`, `is_not_empty`, `in` or `not_in`."},"value":{"type":"string"},"valueRef":{"type":"string","description":"The value to compare against, from earlier in the flow, such as `${{ steps.intake.fields.tier }}`. When set, the rule uses that value instead of `value`. A reference that is missing or empty does not match."},"relativeValue":{"$ref":"#/components/schemas/StepConfigPart_relativeValue"},"columnId":{"type":"string","description":"For a rule on a Look up a record field in this form: the id of a column of the record it picks, from the field's `config.source.columns`. The rule then compares that column instead of the whole record. For an option column, `value` is the option id. When several records are picked, `equals` matches when any of them matches. A timestamp column, and a lookup with no columns, take only `is_empty` and `is_not_empty`."}},"required":["operator"]},"description":"The conditions that decide whether the field is shown. Each one tests another field in this form (`fieldKey`) or a value from earlier in the flow (`source: \"ddr\"` with `ref`)."}},"required":["action","conditions"]},"StepConfig_FORM_subFields":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","enum":["TEXT_SINGLE_LINE","TEXT_MULTI_LINE","DROPDOWN","MULTI_SELECT","NUMBER","DATE","EMAIL","URL","TIME","PHONE","CURRENCY","COUNTRY_SELECT","DATA_TABLE_LOOKUP","FILE_UPLOAD","DYNAMIC_DROPDOWN"]},"required":{"type":"boolean"},"readOnly":{"type":"boolean"},"hidden":{"type":"boolean"},"options":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string","description":"What a cell stores when this option is picked. Usually the same as `label`."},"label":{"type":"string","description":"The option's visible text, such as \"In progress\" or \"Done\"."},"color":{"type":"string","description":"A badge color for a status-style option, such as `green`, `amber` or `red`. Omit it for a plain dropdown option."}},"required":["value","label"]}},"placeholder":{"type":"string"},"widthChars":{"type":"integer","minimum":8,"maximum":60,"description":"The column's width in the form table, in characters. Applies to `TEXT_SINGLE_LINE`, `TEXT_MULTI_LINE`, `NUMBER` and `URL` columns; `DROPDOWN`, `DATE`, `EMAIL`, `TIME`, `PHONE`, `CURRENCY` and `COUNTRY_SELECT` columns size to their content. From 8 to 60; without it, the width fits the content. Ignored when `widthMode` is `auto`."},"widthMode":{"type":"string","enum":["fixed","auto"],"description":"How a text, number or URL column is sized. `auto` fits the longest cell with no character limit, so long comments stay readable (the table scrolls if needed). `fixed`, or omitted, uses `widthChars` (8 to 60) when it is set, and otherwise a width that fits the content."},"defaultValue":{"type":"string","description":"The value a new row of the form table starts with. Not allowed on file columns. Can include references to values from earlier in the flow."},"displayFormat":{"type":"string","enum":["locale","MDY","DMY","YMD"],"description":"Date columns only. How the date is shown; the value is always saved as `YYYY-MM-DD`."},"format":{"type":"string","enum":["text","ssn","zip","phone","email","number","date"]},"validation":{"$ref":"#/components/schemas/StepConfig_FORM_validation"},"showTotal":{"type":"boolean"},"config":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"rowFormula":{"type":"object","properties":{"formula":{"type":"string","maxLength":500},"inputs":{"maxItems":10,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","maxLength":40,"pattern":"^[A-Za-z0-9_-]+$"},"ref":{"type":"string","maxLength":500},"resolvedValue":{"type":"number"}},"required":["id","ref"]}},"emptyAsZero":{"type":"boolean"}},"required":["formula"]},"autoFillFrom":{"type":"object","properties":{"sourceFieldId":{"type":"string"},"column":{"type":"string"},"columnFieldId":{"type":"string"}},"description":"Fills this column from the record picked in a `DATA_TABLE_LOOKUP` column in the same row."},"calculateFrom":{"type":"object","properties":{"leftFieldId":{"type":"string"},"op":{"type":"string","enum":["multiply","divide","add","subtract"]},"right":{}},"description":"Works out a number column from other columns in the same row."}},"required":["key","label","type"]}},"StepConfig_FORM_summariesItem":{"type":"object","properties":{"id":{"type":"string","maxLength":80,"pattern":"^sum_[A-Za-z0-9][A-Za-z0-9_-]*$","description":"The total's id: `sum_<uuid>` or `sum_<column id>_<aggregate>`. The value is saved under this key, so it never matches another answer's key."},"name":{"type":"string","maxLength":120},"columnId":{"type":"string","minLength":1,"maxLength":80,"description":"The id or key of the column, from `subFields[]`, whose footer shows the value."},"row":{"type":"string","maxLength":60},"calc":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","const":"aggregate","description":"`aggregate`: one calculation down one column."},"aggregate":{"type":"string","enum":["sum","avg","min","max","count"],"description":"`sum`, `avg`, `min` or `max` of a `NUMBER` or `CURRENCY` column, or `count` of any column."}},"required":["kind","aggregate"]},{"type":"object","properties":{"kind":{"type":"string","const":"formula","description":"`formula`: arithmetic over this table's totals."},"formula":{"type":"string","minLength":1,"maxLength":500,"description":"The formula: `{{column:<table field id>:<column id>}}` for a column's sum (add `:avg`, `:min`, `:max` or `:count` for another total), numbers, `+ - * /` and brackets."},"format":{"type":"string","enum":["NUMBER","CURRENCY","PERCENTAGE"]},"decimals":{"type":"integer","minimum":0,"maximum":6}},"required":["kind","formula"]}]}},"required":["columnId","calc"]},"StepConfigPart_relativeValue":{"type":"object","properties":{"anchor":{"type":"string","const":"today","description":"The date the offset counts from. Only `today` is supported: the date is worked out again each time the rule runs, so it never goes out of date."},"direction":{"type":"string","enum":["before","after"],"description":"Whether the compared date is before or after the anchor. With `offset` and `unit`, `before`, `3` and `years` mean three years before today."},"offset":{"type":"integer","minimum":0,"maximum":1000,"description":"How many units from the anchor: a whole number from 0 to 1000."},"unit":{"type":"string","enum":["days","weeks","months","years"],"description":"The unit of the offset: `days`, `weeks`, `months` or `years`."}},"required":["anchor","direction","offset","unit"]},"StepConfig_FORM_validation":{"type":"object","properties":{"minLength":{"type":"number"},"maxLength":{"type":"number"},"min":{"type":"number"},"max":{"type":"number"},"precision":{"type":"integer","minimum":0,"maximum":9007199254740991},"pattern":{"type":"string"},"customMessage":{"type":"string"},"minDateFromFieldId":{"type":"string"},"maxDateFromFieldId":{"type":"string"},"defaultToCurrentDate":{"type":"boolean"},"futureDatesOnly":{"type":"boolean"},"pastDatesOnly":{"type":"boolean"},"allowedDaysOfMonth":{"minItems":1,"type":"array","items":{"anyOf":[{"type":"number","const":1},{"type":"number","const":15}]}},"allowLastDayOfMonth":{"type":"boolean"}}},"StepConfig_QUESTIONNAIRE":{"type":"object","properties":{"questionnaire":{"description":"The questions to ask.","$ref":"#/components/schemas/StepConfig_QUESTIONNAIRE_questionnaire"},"review":{"type":"object","properties":{"required":{"type":"boolean","description":"`true` seats the `reviewer` role, so the answers are reviewed before the questionnaire completes. `false` is accepted only when the step has no reviewers; on a step that has reviewers it is refused (`QUESTIONNAIRE_REVIEW_OFF_WITH_REVIEWERS`): remove them with the step's `reviewers` setting."},"reviewer":{"anyOf":[{"type":"string"},{"type":"object","properties":{"mode":{"type":"string","const":"PLACEHOLDER"},"roleId":{"type":"string"},"placeholderId":{"type":"string"},"fromCurrentItem":{"type":"object","properties":{"emailColumn":{"type":"string"},"emailColumnId":{"type":"string"}},"additionalProperties":false}},"required":["mode","roleId"]}],"description":"The role, by name, that reviews the answers. Required when `required` is `true`. Saving the template seats that role as the step's reviewer."}},"required":["required"],"description":"Whether someone checks the answers before the step completes. Optional."},"exportFolder":{"type":"string","description":"A folder in the Files panel that the generated submission PDF and CSV are put in. A questionnaire collects no files, so this is the only thing it can file. A plain name is used as written. The name can include a value from earlier in the flow. An empty value is left out, and the text around it stays. If nothing is left, the file stays unfiled."},"attachments":{"description":"Reference material shown on the step: files, web links or both. A web link (`{ kind: \"link\", url }`) is a page the assignee should open. Its `url` can be a fixed `https://` address or a reference to a value from earlier in the flow, such as `${{ steps.look_up_portal_link.fields.latest_url }}`, so a running flow always links to the latest address.","$ref":"#/components/schemas/StepConfigPart_attachments"},"advisors":{"description":"An AI advisor that shows a recommendation before the assignee acts. Optional. For Approval, Decision, To-do and Questionnaire steps.","$ref":"#/components/schemas/StepConfigPart_advisors"},"preparers":{"anyOf":[{"type":"object","properties":{"participants":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["AI","HUMAN"]},"roleId":{"type":"string","description":"For a person: the role that takes this seat, by its id."},"contactId":{"type":"string","description":"An external user named on the seat, by the `usr_` id the template read shows. `null` follows the read, as for `userId`."},"userId":{"type":"string","description":"A person named on the seat, by the `usr_` id the template read shows. `null` where the read showed `null` (someone with no id here) keeps the saved person; `null` where it showed an id takes them off the seat."},"agentId":{"type":"string"},"prompt":{"type":"string","description":"The AI participant's step context: instructions for this step only."},"criteria":{"type":"string","description":"For an AI reviewer: what to check. Read before `prompt`."},"context":{"type":"string","description":"An older home of the AI participant's step context, still read. Set `prompt` instead."},"privateNotesGuidance":{"type":"string","maxLength":2000,"description":"When no agent is named: what the AI notes privately for the flow's managers."},"sendBackReply":{"type":"string","enum":["outcome_with_reason","outcome_only"],"description":"When the AI sends work back and no agent is named: what the reply says, `outcome_with_reason` or `outcome_only`."},"howToExplain":{"type":"string","maxLength":2000,"description":"When the AI sends work back and no agent is named: how it explains what to fix."},"inputs":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"value":{"type":"string"},"type":{"type":"string","enum":["TEXT","FILE"]}},"required":["name","value"]}},"participantId":{"type":"string","description":"The participant's id on the step. Keep it when sending the seat back; leave it out for a new participant."},"order":{"type":"number","description":"The participant's place in the seat, from 0, when they act one after another."},"aiConfig":{}},"required":["type"],"additionalProperties":{}}},"sequential":{"type":"boolean"},"completion":{"type":"object","properties":{"mode":{"type":"string","enum":["ANY_ONE","ALL"],"description":"`ANY_ONE`: one participant finishing is enough. `ALL`: every participant finishes."}},"required":["mode"],"description":"When the seat is done."},"showToExternalAssignee":{"description":"Advisors only. `true` lets an assignee outside your organization read the recommendation (the call and its reasons), as advice from your organization. Off unless set.","type":"boolean"},"canEditAnswers":{"description":"Reviewers only, on a Form, PDF form or File request step. `true` lets the reviewer whose turn it is edit the submitted answers (on a File request, add and remove its files) during review, in the Moxo app, instead of sending them back. Off unless set.","type":"boolean"},"reviewItemsTogether":{"description":"Reviewers only, on a person's step inside a For each whose items run at the same time. `true` gives the reviewer one list and one notice for every item instead of one review per item; each item keeps its own run and review. With the loop's `syncStepsAcrossIterations` on, the reviewer approves every item at once (`approve_reviews_together`); off, each item is approved on its own. Publish refuses it in a Repeat while, on an \"Approve before it runs\" step, with no person or role reviewing, and in a loop that runs items one at a time. Off unless set.","type":"boolean"}},"required":["participants"]},{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["AI","HUMAN"]},"roleId":{"type":"string"},"contactId":{"type":"string"},"userId":{"type":"string"},"agentId":{"type":"string"},"prompt":{"type":"string"},"criteria":{"type":"string"},"context":{"type":"string"},"privateNotesGuidance":{"type":"string","maxLength":2000},"sendBackReply":{"type":"string","enum":["outcome_with_reason","outcome_only"]},"howToExplain":{"type":"string","maxLength":2000},"inputs":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"value":{"type":"string"},"type":{"type":"string","enum":["TEXT","FILE"]}},"required":["name","value"]}},"ruleKinds":{"maxItems":80,"type":"array","items":{"type":"object","properties":{"rule":{"type":"string","minLength":1,"maxLength":2000},"kind":{"type":"string","enum":["fact","data_match","coverage","visual","judgment"]},"compare":{"type":"object","properties":{"check":{"type":"string","enum":["compare.money_equal","compare.date_after","compare.names_equal","certificate.insured_name_matches","certificate.limit_at_least","kyc.id_name_matches","kyc.birth_date_matches","kyc.dated_within_three_months"]},"against":{"type":"string","enum":["today","value","input"]},"value":{"type":"string","minLength":1,"maxLength":500},"input":{"type":"string","minLength":1,"maxLength":200}},"required":["check","against"]},"document":{"type":"string","minLength":1,"maxLength":200},"sum":{"type":"object","properties":{"fields":{"minItems":2,"maxItems":60,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}}},"required":["fields"]}},"required":["rule","kind"]}},"participantId":{"type":"string"},"order":{"type":"number"},"aiConfig":{}},"required":["type"],"additionalProperties":{}}}]},"reviewers":{"anyOf":[{"type":"object","properties":{"participants":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["AI","HUMAN"]},"roleId":{"type":"string","description":"For a person: the role that takes this seat, by its id."},"contactId":{"type":"string","description":"An external user named on the seat, by the `usr_` id the template read shows. `null` follows the read, as for `userId`."},"userId":{"type":"string","description":"A person named on the seat, by the `usr_` id the template read shows. `null` where the read showed `null` (someone with no id here) keeps the saved person; `null` where it showed an id takes them off the seat."},"agentId":{"type":"string"},"prompt":{"type":"string","description":"The AI participant's step context: instructions for this step only."},"criteria":{"type":"string","description":"For an AI reviewer: what to check. Read before `prompt`."},"context":{"type":"string","description":"An older home of the AI participant's step context, still read. Set `prompt` instead."},"privateNotesGuidance":{"type":"string","maxLength":2000,"description":"When no agent is named: what the AI notes privately for the flow's managers."},"sendBackReply":{"type":"string","enum":["outcome_with_reason","outcome_only"],"description":"When the AI sends work back and no agent is named: what the reply says, `outcome_with_reason` or `outcome_only`."},"howToExplain":{"type":"string","maxLength":2000,"description":"When the AI sends work back and no agent is named: how it explains what to fix."},"inputs":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"value":{"type":"string"},"type":{"type":"string","enum":["TEXT","FILE"]}},"required":["name","value"]}},"participantId":{"type":"string","description":"The participant's id on the step. Keep it when sending the seat back; leave it out for a new participant."},"order":{"type":"number","description":"The participant's place in the seat, from 0, when they act one after another."},"aiConfig":{}},"required":["type"],"additionalProperties":{}}},"sequential":{"type":"boolean"},"completion":{"type":"object","properties":{"mode":{"type":"string","enum":["ANY_ONE","ALL"],"description":"`ANY_ONE`: one participant finishing is enough. `ALL`: every participant finishes."}},"required":["mode"],"description":"When the seat is done."},"showToExternalAssignee":{"description":"Advisors only. `true` lets an assignee outside your organization read the recommendation (the call and its reasons), as advice from your organization. Off unless set.","type":"boolean"},"canEditAnswers":{"description":"Reviewers only, on a Form, PDF form or File request step. `true` lets the reviewer whose turn it is edit the submitted answers (on a File request, add and remove its files) during review, in the Moxo app, instead of sending them back. Off unless set.","type":"boolean"},"reviewItemsTogether":{"description":"Reviewers only, on a person's step inside a For each whose items run at the same time. `true` gives the reviewer one list and one notice for every item instead of one review per item; each item keeps its own run and review. With the loop's `syncStepsAcrossIterations` on, the reviewer approves every item at once (`approve_reviews_together`); off, each item is approved on its own. Publish refuses it in a Repeat while, on an \"Approve before it runs\" step, with no person or role reviewing, and in a loop that runs items one at a time. Off unless set.","type":"boolean"}},"required":["participants"]},{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["AI","HUMAN"]},"roleId":{"type":"string"},"contactId":{"type":"string"},"userId":{"type":"string"},"agentId":{"type":"string"},"prompt":{"type":"string"},"criteria":{"type":"string"},"context":{"type":"string"},"privateNotesGuidance":{"type":"string","maxLength":2000},"sendBackReply":{"type":"string","enum":["outcome_with_reason","outcome_only"]},"howToExplain":{"type":"string","maxLength":2000},"inputs":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"value":{"type":"string"},"type":{"type":"string","enum":["TEXT","FILE"]}},"required":["name","value"]}},"ruleKinds":{"maxItems":80,"type":"array","items":{"type":"object","properties":{"rule":{"type":"string","minLength":1,"maxLength":2000},"kind":{"type":"string","enum":["fact","data_match","coverage","visual","judgment"]},"compare":{"type":"object","properties":{"check":{"type":"string","enum":["compare.money_equal","compare.date_after","compare.names_equal","certificate.insured_name_matches","certificate.limit_at_least","kyc.id_name_matches","kyc.birth_date_matches","kyc.dated_within_three_months"]},"against":{"type":"string","enum":["today","value","input"]},"value":{"type":"string","minLength":1,"maxLength":500},"input":{"type":"string","minLength":1,"maxLength":200}},"required":["check","against"]},"document":{"type":"string","minLength":1,"maxLength":200},"sum":{"type":"object","properties":{"fields":{"minItems":2,"maxItems":60,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}}},"required":["fields"]}},"required":["rule","kind"]}},"participantId":{"type":"string"},"order":{"type":"number"},"aiConfig":{}},"required":["type"],"additionalProperties":{}}}]},"aiEscalation":{"type":"object","properties":{"roleId":{"anyOf":[{"type":"string","minLength":1,"maxLength":80},{"type":"null"}]},"deskId":{"description":"A team desk instead of a role: the hand-off waits in the desk's queue until someone on it claims it. Set `roleId` or `deskId`, never both.","anyOf":[{"type":"string","minLength":1,"maxLength":80},{"type":"null"}]}},"additionalProperties":false},"visibleToAllAssignees":{"type":"boolean"},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"},"options":{"description":"Switches for the files attached to this step. A type takes only the ones its step settings show.","type":"object","properties":{"preventDownload":{"description":"Prevent download: people can open the files attached to this step to read them, but can't download them. Needs view-only attachments switched on for your organization.","type":"boolean"}}}},"title":"Questionnaire","description":"Asks one or a few quick questions.\n\nThe settings a template read (`GET /v1/templates/{id}`) returns for this type, as stored. The shared settings (due date, reminders, visibility, monitors) can appear alongside them. To set them in a change, send `StepSettings_QUESTIONNAIRE`: where this shape holds an id, a change can name a role, field or step by its name or handle.\n\n**Offered by plan:** available when the organization's plan includes `questionnaire`.","x-moxo-step-type":"QUESTIONNAIRE","x-moxo-category":"HUMAN_ACTION","x-moxo-plan-feature":"questionnaire"},"StepConfig_QUESTIONNAIRE_questionnaire":{"type":"object","properties":{"questions":{"type":"array","items":{"type":"object","properties":{"questionId":{"type":"string"},"question":{"type":"string"},"answerType":{"type":"string","enum":["SINGLE_SELECT","MULTI_SELECT","TEXT","YES_NO","DATE","TIME"]},"options":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string","description":"What an answer stores when this option is picked. Usually the same as `label`."},"label":{"type":"string","description":"The text people see."}},"required":["value","label"]}},"required":{"type":"boolean"}},"required":["question","answerType"]}}},"required":["questions"]},"StepConfigPart_advisors":{"type":"object","properties":{"participants":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","const":"AI","description":"The advisor's type. Always `AI`."},"agentId":{"type":"string","description":"The id of one of your organization's AI agents. Leave it out to use the organization's default."},"context":{"type":"string","description":"What the advisor considers for this step, for example `Consider the budget from ${{ steps.budget_review.fields.approved_amount }}`."},"inputs":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"value":{"type":"string"},"type":{"type":"string","enum":["TEXT","FILE"]}},"required":["name","value"]},"description":"The values the advisor can see, each a reference to a value from earlier in the flow or a fixed value, filled in when the step runs. When left out, the references in `context` are used instead."},"roleId":{"type":"string","description":"For a person: the role that takes this seat, by its id."},"contactId":{"type":"string","description":"An external user named on the seat, by the `usr_` id the template read shows. `null` follows the read, as for `userId`."},"userId":{"type":"string","description":"A person named on the seat, by the `usr_` id the template read shows. `null` where the read showed `null` (someone with no id here) keeps the saved person; `null` where it showed an id takes them off the seat."},"prompt":{"type":"string","description":"The AI participant's step context: instructions for this step only."},"criteria":{"type":"string","description":"For an AI reviewer: what to check. Read before `prompt`."},"privateNotesGuidance":{"type":"string","maxLength":2000,"description":"When no agent is named: what the AI notes privately for the flow's managers."},"sendBackReply":{"type":"string","enum":["outcome_with_reason","outcome_only"],"description":"When the AI sends work back and no agent is named: what the reply says, `outcome_with_reason` or `outcome_only`."},"howToExplain":{"type":"string","maxLength":2000,"description":"When the AI sends work back and no agent is named: how it explains what to fix."},"participantId":{"type":"string","description":"The participant's id on the step. Keep it when sending the seat back; leave it out for a new participant."},"order":{"type":"number","description":"The participant's place in the seat, from 0, when they act one after another."},"aiConfig":{}},"required":["type"]}},"sequential":{"type":"boolean"},"completion":{"type":"object","properties":{"mode":{"type":"string","enum":["ANY_ONE","ALL"],"description":"`ANY_ONE`: one participant finishing is enough. `ALL`: every participant finishes."}},"required":["mode"],"description":"When the seat is done."},"showToExternalAssignee":{"anyOf":[{"type":"boolean"},{"type":"boolean"}],"description":"Advisors only. `true`: an assignee outside your organization may read the recommendation, as advice from your organization."},"canEditAnswers":{"description":"Reviewers only, on a Form, PDF form or File request step. `true` lets the reviewer whose turn it is edit the submitted answers (on a File request, add and remove its files) during review, in the Moxo app, instead of sending them back. Off unless set.","type":"boolean"},"reviewItemsTogether":{"description":"Reviewers only, on a person's step inside a For each whose items run at the same time. `true` gives the reviewer one list and one notice for every item instead of one review per item; each item keeps its own run and review. With the loop's `syncStepsAcrossIterations` on, the reviewer approves every item at once (`approve_reviews_together`); off, each item is approved on its own. Publish refuses it in a Repeat while, on an \"Approve before it runs\" step, with no person or role reviewing, and in a loop that runs items one at a time. Off unless set.","type":"boolean"}},"required":["participants"]},"StepConfig_POLL":{"type":"object","properties":{"poll":{"description":"The settings of a Poll step, a group vote. Each of `questions[]` has a closed set of at least two `options[]`; per question, `allowMultiple` allows several choices and `allowOther` adds a free-text answer. Each option is `{ value, label }`: a vote names the option by its `value` (left out, by its place: `o1`, `o2`, …). `closeOnMajorityValue` (single-choice questions only) closes the poll early when the option with that value has more than half of the assignees' votes. `hideVoterNames` makes the results anonymous. `resultsVisibility` sets who sees the tally: `MANAGER_ONLY` (the default), `LIVE` or `AFTER_CLOSE`. A poll closes once everyone has voted; `close.mode` sets what happens until then: `ALL_RESPONDED` (keep waiting), `MANUAL` (a flow manager closes it) or `DEADLINE` (it closes at the step's due date, so set `due` too).","$ref":"#/components/schemas/StepConfig_POLL_poll"},"attachments":{"description":"Reference material shown on the step: files, web links or both. A web link (`{ kind: \"link\", url }`) is a page the assignee should open. Its `url` can be a fixed `https://` address or a reference to a value from earlier in the flow, such as `${{ steps.look_up_portal_link.fields.latest_url }}`, so a running flow always links to the latest address.","$ref":"#/components/schemas/StepConfigPart_attachments"},"advisors":{"description":"An AI advisor that shows a recommendation before the assignee acts. Optional. For Approval, Decision, To-do and Questionnaire steps.","$ref":"#/components/schemas/StepConfig_POLL_advisors"},"preparers":{"anyOf":[{"type":"object","properties":{"participants":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["AI","HUMAN"]},"roleId":{"type":"string","description":"For a person: the role that takes this seat, by its id."},"contactId":{"type":"string","description":"An external user named on the seat, by the `usr_` id the template read shows. `null` follows the read, as for `userId`."},"userId":{"type":"string","description":"A person named on the seat, by the `usr_` id the template read shows. `null` where the read showed `null` (someone with no id here) keeps the saved person; `null` where it showed an id takes them off the seat."},"agentId":{"type":"string"},"prompt":{"type":"string","description":"The AI participant's step context: instructions for this step only."},"criteria":{"type":"string","description":"For an AI reviewer: what to check. Read before `prompt`."},"context":{"type":"string","description":"An older home of the AI participant's step context, still read. Set `prompt` instead."},"privateNotesGuidance":{"type":"string","maxLength":2000,"description":"When no agent is named: what the AI notes privately for the flow's managers."},"sendBackReply":{"type":"string","enum":["outcome_with_reason","outcome_only"],"description":"When the AI sends work back and no agent is named: what the reply says, `outcome_with_reason` or `outcome_only`."},"howToExplain":{"type":"string","maxLength":2000,"description":"When the AI sends work back and no agent is named: how it explains what to fix."},"inputs":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"value":{"type":"string"},"type":{"type":"string","enum":["TEXT","FILE"]}},"required":["name","value"]}},"participantId":{"type":"string","description":"The participant's id on the step. Keep it when sending the seat back; leave it out for a new participant."},"order":{"type":"number","description":"The participant's place in the seat, from 0, when they act one after another."},"aiConfig":{}},"required":["type"],"additionalProperties":{}}},"sequential":{"type":"boolean"},"completion":{"type":"object","properties":{"mode":{"type":"string","enum":["ANY_ONE","ALL"],"description":"`ANY_ONE`: one participant finishing is enough. `ALL`: every participant finishes."}},"required":["mode"],"description":"When the seat is done."},"showToExternalAssignee":{"description":"Advisors only. `true` lets an assignee outside your organization read the recommendation (the call and its reasons), as advice from your organization. Off unless set.","type":"boolean"},"canEditAnswers":{"description":"Reviewers only, on a Form, PDF form or File request step. `true` lets the reviewer whose turn it is edit the submitted answers (on a File request, add and remove its files) during review, in the Moxo app, instead of sending them back. Off unless set.","type":"boolean"},"reviewItemsTogether":{"description":"Reviewers only, on a person's step inside a For each whose items run at the same time. `true` gives the reviewer one list and one notice for every item instead of one review per item; each item keeps its own run and review. With the loop's `syncStepsAcrossIterations` on, the reviewer approves every item at once (`approve_reviews_together`); off, each item is approved on its own. Publish refuses it in a Repeat while, on an \"Approve before it runs\" step, with no person or role reviewing, and in a loop that runs items one at a time. Off unless set.","type":"boolean"}},"required":["participants"]},{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["AI","HUMAN"]},"roleId":{"type":"string"},"contactId":{"type":"string"},"userId":{"type":"string"},"agentId":{"type":"string"},"prompt":{"type":"string"},"criteria":{"type":"string"},"context":{"type":"string"},"privateNotesGuidance":{"type":"string","maxLength":2000},"sendBackReply":{"type":"string","enum":["outcome_with_reason","outcome_only"]},"howToExplain":{"type":"string","maxLength":2000},"inputs":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"value":{"type":"string"},"type":{"type":"string","enum":["TEXT","FILE"]}},"required":["name","value"]}},"ruleKinds":{"maxItems":80,"type":"array","items":{"type":"object","properties":{"rule":{"type":"string","minLength":1,"maxLength":2000},"kind":{"type":"string","enum":["fact","data_match","coverage","visual","judgment"]},"compare":{"type":"object","properties":{"check":{"type":"string","enum":["compare.money_equal","compare.date_after","compare.names_equal","certificate.insured_name_matches","certificate.limit_at_least","kyc.id_name_matches","kyc.birth_date_matches","kyc.dated_within_three_months"]},"against":{"type":"string","enum":["today","value","input"]},"value":{"type":"string","minLength":1,"maxLength":500},"input":{"type":"string","minLength":1,"maxLength":200}},"required":["check","against"]},"document":{"type":"string","minLength":1,"maxLength":200},"sum":{"type":"object","properties":{"fields":{"minItems":2,"maxItems":60,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}}},"required":["fields"]}},"required":["rule","kind"]}},"participantId":{"type":"string"},"order":{"type":"number"},"aiConfig":{}},"required":["type"],"additionalProperties":{}}}]},"visibleToAllAssignees":{"type":"boolean"},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"},"options":{"description":"Switches for the files attached to this step. A type takes only the ones its step settings show.","type":"object","properties":{"preventDownload":{"description":"Prevent download: people can open the files attached to this step to read them, but can't download them. Needs view-only attachments switched on for your organization.","type":"boolean"}}}},"title":"Poll","description":"Collects votes from a group on one or more questions and shows the tallied results.\n\nThe settings a template read (`GET /v1/templates/{id}`) returns for this type, as stored. The shared settings (due date, reminders, visibility, monitors) can appear alongside them. To set them in a change, send `StepSettings_POLL`: where this shape holds an id, a change can name a role, field or step by its name or handle.\n\n**Offered by plan:** available when the organization's plan includes `poll`.","x-moxo-step-type":"POLL","x-moxo-category":"HUMAN_ACTION","x-moxo-plan-feature":"poll"},"StepConfig_POLL_poll":{"type":"object","properties":{"questions":{"type":"array","items":{"type":"object","properties":{"questionId":{"type":"string"},"question":{"type":"string","minLength":1},"options":{"minItems":2,"type":"array","items":{"type":"object","properties":{"value":{"type":"string"},"label":{"type":"string","minLength":1}},"required":["label"]}},"allowMultiple":{"type":"boolean"},"allowOther":{"type":"boolean"},"closeOnMajorityValue":{"type":"string","minLength":1}},"required":["question","options"]}},"hideVoterNames":{"type":"boolean"},"resultsVisibility":{"type":"string","enum":["MANAGER_ONLY","LIVE","AFTER_CLOSE"]},"close":{"type":"object","properties":{"mode":{"type":"string","enum":["ALL_RESPONDED","MANUAL","DEADLINE"]}},"required":["mode"]}},"required":["questions","close"]},"StepConfig_POLL_advisors":{"type":"object","properties":{"participants":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","const":"AI","description":"The advisor's type. Always `AI`."},"agentId":{"type":"string","description":"The id of one of your organization's AI agents. Leave it out to use the organization's default."},"context":{"type":"string","description":"What the advisor considers for this step, for example `Consider the budget from ${{ steps.budget_review.fields.approved_amount }}`."},"inputs":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"value":{"type":"string"},"type":{"type":"string","enum":["TEXT","FILE"]}},"required":["name","value"]},"description":"The values the advisor can see, each a reference to a value from earlier in the flow or a fixed value, filled in when the step runs. When left out, the references in `context` are used instead."}},"required":["type"]}},"sequential":{"type":"boolean"}},"required":["participants"]},"StepConfig_FILE_REQUEST":{"type":"object","properties":{"fileRequest":{"description":"The upload settings.","$ref":"#/components/schemas/StepConfig_FILE_REQUEST_fileRequest"},"reviewer":{"type":"string","description":"The role, by name, of the person who checks the uploaded files before the step completes. Saving the template seats that role as the step's reviewer."},"aiRename":{"type":"object","properties":{"enabled":{"type":"boolean","default":false,"description":"Whether uploaded files are renamed when the step completes. `mode: \"ai\"` names each file from its content and uses AI credits; `mode: \"pattern\"` builds names from flow values without credits. Defaults to `false`."},"mode":{"type":"string","enum":["ai","pattern"],"default":"ai","description":"How files are renamed. `ai` (the default): AI reads each file and suggests a name; flow values in the hint are filled in first, and a file whose value is missing keeps its name. `pattern`: names are built from `nameTemplate`; a file whose value is missing keeps its name; no AI credits are used. Either way, the file type is the upload's extension."},"additionalPrompt":{"type":"string","maxLength":2000,"description":"A hint for AI renaming, which can include flow values, for example `{Client legal name}-Invoice, BAS, or Payroll Summary-{Financial year}`. Used only when `mode` is `ai`. A file whose value is missing keeps its name."},"nameTemplate":{"type":"string","maxLength":500,"description":"The naming pattern, with flow value references, for example `${{ fields.xero_code }}-${{ thisFile.fileType }}-${{ fields.financial_year }}`. Used only when `mode` is `pattern`. A file whose reference can't be filled keeps its name. The file type is the upload's extension (such as `pdf` or `xlsx`), or a type from its MIME type."}},"description":"Renames the uploaded files when the step completes. `mode: \"ai\"` names each file from its content, with an optional hint in `additionalPrompt`, and uses AI credits. `mode: \"pattern\"` builds names from `nameTemplate` and flow values, without credits. Renaming happens as the step completes, so later steps see the new names."},"attachments":{"description":"Reference material shown on the step: files, web links or both. A web link (`{ kind: \"link\", url }`) is a page the assignee should open. Its `url` can be a fixed `https://` address or a reference to a value from earlier in the flow, such as `${{ steps.look_up_portal_link.fields.latest_url }}`, so a running flow always links to the latest address.","$ref":"#/components/schemas/StepConfigPart_attachments"},"assist":{"description":"Whether the uploader can ask the assistant for help while they work. `{ \"enabled\": true }` turns it on. Leave it out, or send `{ \"enabled\": false }`, to keep it off.","$ref":"#/components/schemas/StepConfigPart_assist"},"closeAtDue":{"type":"object","properties":{"hour":{"type":"integer","minimum":0,"maximum":23,"default":17,"description":"The hour (0 to 23) the step closes on its due day. Defaults to 17 (5 PM)."},"minute":{"type":"integer","minimum":0,"maximum":59,"default":0,"description":"The minute (0 to 59) the step closes on its due day."},"timezone":{"type":"string","minLength":1,"description":"The IANA time zone `hour` and `minute` are read in, such as `Europe/London`. Left out, the organization's time zone is used."},"allowChangesAfterSubmit":{"type":"boolean","default":false,"description":"When true, Submit keeps the step open: the person can change what they sent until the close, and the close completes the step."}},"description":"Close at the due date: the step closes by itself at its due date with what was saved. A due date set as a day closes on that day at `hour`:`minute` in `timezone`; a due date set in minutes or hours closes at that moment. Left out, the step stays open past its due date."},"preparers":{"anyOf":[{"type":"object","properties":{"participants":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["AI","HUMAN"]},"roleId":{"type":"string","description":"For a person: the role that takes this seat, by its id."},"contactId":{"type":"string","description":"An external user named on the seat, by the `usr_` id the template read shows. `null` follows the read, as for `userId`."},"userId":{"type":"string","description":"A person named on the seat, by the `usr_` id the template read shows. `null` where the read showed `null` (someone with no id here) keeps the saved person; `null` where it showed an id takes them off the seat."},"agentId":{"type":"string"},"prompt":{"type":"string","description":"The AI participant's step context: instructions for this step only."},"criteria":{"type":"string","description":"For an AI reviewer: what to check. Read before `prompt`."},"context":{"type":"string","description":"An older home of the AI participant's step context, still read. Set `prompt` instead."},"privateNotesGuidance":{"type":"string","maxLength":2000,"description":"When no agent is named: what the AI notes privately for the flow's managers."},"sendBackReply":{"type":"string","enum":["outcome_with_reason","outcome_only"],"description":"When the AI sends work back and no agent is named: what the reply says, `outcome_with_reason` or `outcome_only`."},"howToExplain":{"type":"string","maxLength":2000,"description":"When the AI sends work back and no agent is named: how it explains what to fix."},"inputs":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"value":{"type":"string"},"type":{"type":"string","enum":["TEXT","FILE"]}},"required":["name","value"]}},"participantId":{"type":"string","description":"The participant's id on the step. Keep it when sending the seat back; leave it out for a new participant."},"order":{"type":"number","description":"The participant's place in the seat, from 0, when they act one after another."},"aiConfig":{}},"required":["type"],"additionalProperties":{}}},"sequential":{"type":"boolean"},"completion":{"type":"object","properties":{"mode":{"type":"string","enum":["ANY_ONE","ALL"],"description":"`ANY_ONE`: one participant finishing is enough. `ALL`: every participant finishes."}},"required":["mode"],"description":"When the seat is done."},"showToExternalAssignee":{"description":"Advisors only. `true` lets an assignee outside your organization read the recommendation (the call and its reasons), as advice from your organization. Off unless set.","type":"boolean"},"canEditAnswers":{"description":"Reviewers only, on a Form, PDF form or File request step. `true` lets the reviewer whose turn it is edit the submitted answers (on a File request, add and remove its files) during review, in the Moxo app, instead of sending them back. Off unless set.","type":"boolean"},"reviewItemsTogether":{"description":"Reviewers only, on a person's step inside a For each whose items run at the same time. `true` gives the reviewer one list and one notice for every item instead of one review per item; each item keeps its own run and review. With the loop's `syncStepsAcrossIterations` on, the reviewer approves every item at once (`approve_reviews_together`); off, each item is approved on its own. Publish refuses it in a Repeat while, on an \"Approve before it runs\" step, with no person or role reviewing, and in a loop that runs items one at a time. Off unless set.","type":"boolean"}},"required":["participants"]},{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["AI","HUMAN"]},"roleId":{"type":"string"},"contactId":{"type":"string"},"userId":{"type":"string"},"agentId":{"type":"string"},"prompt":{"type":"string"},"criteria":{"type":"string"},"context":{"type":"string"},"privateNotesGuidance":{"type":"string","maxLength":2000},"sendBackReply":{"type":"string","enum":["outcome_with_reason","outcome_only"]},"howToExplain":{"type":"string","maxLength":2000},"inputs":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"value":{"type":"string"},"type":{"type":"string","enum":["TEXT","FILE"]}},"required":["name","value"]}},"ruleKinds":{"maxItems":80,"type":"array","items":{"type":"object","properties":{"rule":{"type":"string","minLength":1,"maxLength":2000},"kind":{"type":"string","enum":["fact","data_match","coverage","visual","judgment"]},"compare":{"type":"object","properties":{"check":{"type":"string","enum":["compare.money_equal","compare.date_after","compare.names_equal","certificate.insured_name_matches","certificate.limit_at_least","kyc.id_name_matches","kyc.birth_date_matches","kyc.dated_within_three_months"]},"against":{"type":"string","enum":["today","value","input"]},"value":{"type":"string","minLength":1,"maxLength":500},"input":{"type":"string","minLength":1,"maxLength":200}},"required":["check","against"]},"document":{"type":"string","minLength":1,"maxLength":200},"sum":{"type":"object","properties":{"fields":{"minItems":2,"maxItems":60,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}}},"required":["fields"]}},"required":["rule","kind"]}},"participantId":{"type":"string"},"order":{"type":"number"},"aiConfig":{}},"required":["type"],"additionalProperties":{}}}]},"reviewers":{"anyOf":[{"type":"object","properties":{"participants":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["AI","HUMAN"]},"roleId":{"type":"string","description":"For a person: the role that takes this seat, by its id."},"contactId":{"type":"string","description":"An external user named on the seat, by the `usr_` id the template read shows. `null` follows the read, as for `userId`."},"userId":{"type":"string","description":"A person named on the seat, by the `usr_` id the template read shows. `null` where the read showed `null` (someone with no id here) keeps the saved person; `null` where it showed an id takes them off the seat."},"agentId":{"type":"string"},"prompt":{"type":"string","description":"The AI participant's step context: instructions for this step only."},"criteria":{"type":"string","description":"For an AI reviewer: what to check. Read before `prompt`."},"context":{"type":"string","description":"An older home of the AI participant's step context, still read. Set `prompt` instead."},"privateNotesGuidance":{"type":"string","maxLength":2000,"description":"When no agent is named: what the AI notes privately for the flow's managers."},"sendBackReply":{"type":"string","enum":["outcome_with_reason","outcome_only"],"description":"When the AI sends work back and no agent is named: what the reply says, `outcome_with_reason` or `outcome_only`."},"howToExplain":{"type":"string","maxLength":2000,"description":"When the AI sends work back and no agent is named: how it explains what to fix."},"inputs":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"value":{"type":"string"},"type":{"type":"string","enum":["TEXT","FILE"]}},"required":["name","value"]}},"participantId":{"type":"string","description":"The participant's id on the step. Keep it when sending the seat back; leave it out for a new participant."},"order":{"type":"number","description":"The participant's place in the seat, from 0, when they act one after another."},"aiConfig":{}},"required":["type"],"additionalProperties":{}}},"sequential":{"type":"boolean"},"completion":{"type":"object","properties":{"mode":{"type":"string","enum":["ANY_ONE","ALL"],"description":"`ANY_ONE`: one participant finishing is enough. `ALL`: every participant finishes."}},"required":["mode"],"description":"When the seat is done."},"showToExternalAssignee":{"description":"Advisors only. `true` lets an assignee outside your organization read the recommendation (the call and its reasons), as advice from your organization. Off unless set.","type":"boolean"},"canEditAnswers":{"description":"Reviewers only, on a Form, PDF form or File request step. `true` lets the reviewer whose turn it is edit the submitted answers (on a File request, add and remove its files) during review, in the Moxo app, instead of sending them back. Off unless set.","type":"boolean"},"reviewItemsTogether":{"description":"Reviewers only, on a person's step inside a For each whose items run at the same time. `true` gives the reviewer one list and one notice for every item instead of one review per item; each item keeps its own run and review. With the loop's `syncStepsAcrossIterations` on, the reviewer approves every item at once (`approve_reviews_together`); off, each item is approved on its own. Publish refuses it in a Repeat while, on an \"Approve before it runs\" step, with no person or role reviewing, and in a loop that runs items one at a time. Off unless set.","type":"boolean"}},"required":["participants"]},{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["AI","HUMAN"]},"roleId":{"type":"string"},"contactId":{"type":"string"},"userId":{"type":"string"},"agentId":{"type":"string"},"prompt":{"type":"string"},"criteria":{"type":"string"},"context":{"type":"string"},"privateNotesGuidance":{"type":"string","maxLength":2000},"sendBackReply":{"type":"string","enum":["outcome_with_reason","outcome_only"]},"howToExplain":{"type":"string","maxLength":2000},"inputs":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"value":{"type":"string"},"type":{"type":"string","enum":["TEXT","FILE"]}},"required":["name","value"]}},"ruleKinds":{"maxItems":80,"type":"array","items":{"type":"object","properties":{"rule":{"type":"string","minLength":1,"maxLength":2000},"kind":{"type":"string","enum":["fact","data_match","coverage","visual","judgment"]},"compare":{"type":"object","properties":{"check":{"type":"string","enum":["compare.money_equal","compare.date_after","compare.names_equal","certificate.insured_name_matches","certificate.limit_at_least","kyc.id_name_matches","kyc.birth_date_matches","kyc.dated_within_three_months"]},"against":{"type":"string","enum":["today","value","input"]},"value":{"type":"string","minLength":1,"maxLength":500},"input":{"type":"string","minLength":1,"maxLength":200}},"required":["check","against"]},"document":{"type":"string","minLength":1,"maxLength":200},"sum":{"type":"object","properties":{"fields":{"minItems":2,"maxItems":60,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}}},"required":["fields"]}},"required":["rule","kind"]}},"participantId":{"type":"string"},"order":{"type":"number"},"aiConfig":{}},"required":["type"],"additionalProperties":{}}}]},"applyRetentionPolicy":{"type":"boolean","description":"Whether the organization's file deletion policy applies to the files uploaded here, when it covers only the steps that ask for it."},"retentionSelection":{"oneOf":[{"type":"object","properties":{"mode":{"type":"string","const":"inherit"}},"required":["mode"]},{"type":"object","properties":{"mode":{"type":"string","const":"keep"}},"required":["mode"]},{"type":"object","properties":{"mode":{"type":"string","const":"rule"},"ruleId":{"type":"string","minLength":1,"description":"The retention rule. Required when the choice is a named rule."}},"required":["mode","ruleId"]}],"description":"The retention choice for new uploads: the organization policy, an exemption, or a named rule. A named rule must include its rule."},"aiEscalation":{"type":"object","properties":{"roleId":{"anyOf":[{"type":"string","minLength":1,"maxLength":80},{"type":"null"}]},"deskId":{"description":"A team desk instead of a role: the hand-off waits in the desk's queue until someone on it claims it. Set `roleId` or `deskId`, never both.","anyOf":[{"type":"string","minLength":1,"maxLength":80},{"type":"null"}]}},"additionalProperties":false},"visibleToAllAssignees":{"type":"boolean"},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"},"options":{"description":"Switches for the files attached to this step. A type takes only the ones its step settings show.","type":"object","properties":{"preventDownload":{"description":"Prevent download: people can open the files attached to this step to read them, but can't download them. Needs view-only attachments switched on for your organization.","type":"boolean"}}}},"title":"File Request","description":"Asks the assignees to upload files or documents.\n\nThe settings a template read (`GET /v1/templates/{id}`) returns for this type, as stored. The shared settings (due date, reminders, visibility, monitors) can appear alongside them. To set them in a change, send `StepSettings_FILE_REQUEST`: where this shape holds an id, a change can name a role, field or step by its name or handle.\n\n**Offered by plan:** available when the organization's plan includes `fileRequest`.","x-moxo-step-type":"FILE_REQUEST","x-moxo-category":"HUMAN_ACTION","x-moxo-plan-feature":"fileRequest"},"StepConfig_FILE_REQUEST_fileRequest":{"type":"object","properties":{"maxFiles":{"type":"integer","minimum":1,"maximum":50,"description":"The most files one step accepts, 1 to 50."},"maxFileSizeMB":{"type":"integer","minimum":1,"maximum":100,"description":"The largest file accepted, in megabytes, 1 to 100. Defaults to 100."},"allowedTypes":{"type":"array","items":{"type":"string"}},"instructions":{"type":"string"},"autoFolder":{"type":"string","description":"One folder in the Files panel that uploaded files are put in. A plain name is used as written. A slash with no spaces stays in the name. Several folders are `folderPath`, not this field. The name can include a value from earlier in the flow. An empty value is left out, and the text around it stays. If nothing is left, the file stays unfiled."},"folderPath":{"minItems":2,"maxItems":3,"type":"array","items":{"type":"string","minLength":1,"maxLength":255},"description":"Nested folders for uploaded files, from the parent down, at most 3. Use this when the files should land in more than one folder. A single folder stays in `autoFolder`. Each entry is one folder name and can include a value from earlier in the flow, filled in on its own. A slash inside that value stays in that one folder. A folder that already exists under its parent is used again. Do not send a fourth entry."}}},"StepConfig_TODO":{"type":"object","properties":{"preparers":{"anyOf":[{"type":"object","properties":{"participants":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["AI","HUMAN"]},"roleId":{"type":"string","description":"For a person: the role that takes this seat, by its id."},"contactId":{"type":"string","description":"An external user named on the seat, by the `usr_` id the template read shows. `null` follows the read, as for `userId`."},"userId":{"type":"string","description":"A person named on the seat, by the `usr_` id the template read shows. `null` where the read showed `null` (someone with no id here) keeps the saved person; `null` where it showed an id takes them off the seat."},"agentId":{"type":"string"},"prompt":{"type":"string","description":"The AI participant's step context: instructions for this step only."},"criteria":{"type":"string","description":"For an AI reviewer: what to check. Read before `prompt`."},"context":{"type":"string","description":"An older home of the AI participant's step context, still read. Set `prompt` instead."},"privateNotesGuidance":{"type":"string","maxLength":2000,"description":"When no agent is named: what the AI notes privately for the flow's managers."},"sendBackReply":{"type":"string","enum":["outcome_with_reason","outcome_only"],"description":"When the AI sends work back and no agent is named: what the reply says, `outcome_with_reason` or `outcome_only`."},"howToExplain":{"type":"string","maxLength":2000,"description":"When the AI sends work back and no agent is named: how it explains what to fix."},"inputs":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"value":{"type":"string"},"type":{"type":"string","enum":["TEXT","FILE"]}},"required":["name","value"]}},"participantId":{"type":"string","description":"The participant's id on the step. Keep it when sending the seat back; leave it out for a new participant."},"order":{"type":"number","description":"The participant's place in the seat, from 0, when they act one after another."},"aiConfig":{}},"required":["type"],"additionalProperties":{}}},"sequential":{"type":"boolean"},"completion":{"type":"object","properties":{"mode":{"type":"string","enum":["ANY_ONE","ALL"],"description":"`ANY_ONE`: one participant finishing is enough. `ALL`: every participant finishes."}},"required":["mode"],"description":"When the seat is done."},"showToExternalAssignee":{"description":"Advisors only. `true` lets an assignee outside your organization read the recommendation (the call and its reasons), as advice from your organization. Off unless set.","type":"boolean"},"canEditAnswers":{"description":"Reviewers only, on a Form, PDF form or File request step. `true` lets the reviewer whose turn it is edit the submitted answers (on a File request, add and remove its files) during review, in the Moxo app, instead of sending them back. Off unless set.","type":"boolean"},"reviewItemsTogether":{"description":"Reviewers only, on a person's step inside a For each whose items run at the same time. `true` gives the reviewer one list and one notice for every item instead of one review per item; each item keeps its own run and review. With the loop's `syncStepsAcrossIterations` on, the reviewer approves every item at once (`approve_reviews_together`); off, each item is approved on its own. Publish refuses it in a Repeat while, on an \"Approve before it runs\" step, with no person or role reviewing, and in a loop that runs items one at a time. Off unless set.","type":"boolean"}},"required":["participants"]},{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["AI","HUMAN"]},"roleId":{"type":"string"},"contactId":{"type":"string"},"userId":{"type":"string"},"agentId":{"type":"string"},"prompt":{"type":"string"},"criteria":{"type":"string"},"context":{"type":"string"},"privateNotesGuidance":{"type":"string","maxLength":2000},"sendBackReply":{"type":"string","enum":["outcome_with_reason","outcome_only"]},"howToExplain":{"type":"string","maxLength":2000},"inputs":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"value":{"type":"string"},"type":{"type":"string","enum":["TEXT","FILE"]}},"required":["name","value"]}},"ruleKinds":{"maxItems":80,"type":"array","items":{"type":"object","properties":{"rule":{"type":"string","minLength":1,"maxLength":2000},"kind":{"type":"string","enum":["fact","data_match","coverage","visual","judgment"]},"compare":{"type":"object","properties":{"check":{"type":"string","enum":["compare.money_equal","compare.date_after","compare.names_equal","certificate.insured_name_matches","certificate.limit_at_least","kyc.id_name_matches","kyc.birth_date_matches","kyc.dated_within_three_months"]},"against":{"type":"string","enum":["today","value","input"]},"value":{"type":"string","minLength":1,"maxLength":500},"input":{"type":"string","minLength":1,"maxLength":200}},"required":["check","against"]},"document":{"type":"string","minLength":1,"maxLength":200},"sum":{"type":"object","properties":{"fields":{"minItems":2,"maxItems":60,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}}},"required":["fields"]}},"required":["rule","kind"]}},"participantId":{"type":"string"},"order":{"type":"number"},"aiConfig":{}},"required":["type"],"additionalProperties":{}}}]},"advisors":{"anyOf":[{"type":"object","properties":{"participants":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["AI","HUMAN"]},"roleId":{"type":"string","description":"For a person: the role that takes this seat, by its id."},"contactId":{"type":"string","description":"An external user named on the seat, by the `usr_` id the template read shows. `null` follows the read, as for `userId`."},"userId":{"type":"string","description":"A person named on the seat, by the `usr_` id the template read shows. `null` where the read showed `null` (someone with no id here) keeps the saved person; `null` where it showed an id takes them off the seat."},"agentId":{"type":"string"},"prompt":{"type":"string","description":"The AI participant's step context: instructions for this step only."},"criteria":{"type":"string","description":"For an AI reviewer: what to check. Read before `prompt`."},"context":{"type":"string","description":"An older home of the AI participant's step context, still read. Set `prompt` instead."},"privateNotesGuidance":{"type":"string","maxLength":2000,"description":"When no agent is named: what the AI notes privately for the flow's managers."},"sendBackReply":{"type":"string","enum":["outcome_with_reason","outcome_only"],"description":"When the AI sends work back and no agent is named: what the reply says, `outcome_with_reason` or `outcome_only`."},"howToExplain":{"type":"string","maxLength":2000,"description":"When the AI sends work back and no agent is named: how it explains what to fix."},"inputs":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"value":{"type":"string"},"type":{"type":"string","enum":["TEXT","FILE"]}},"required":["name","value"]}},"participantId":{"type":"string","description":"The participant's id on the step. Keep it when sending the seat back; leave it out for a new participant."},"order":{"type":"number","description":"The participant's place in the seat, from 0, when they act one after another."},"aiConfig":{}},"required":["type"],"additionalProperties":{}}},"sequential":{"anyOf":[{"type":"boolean"},{"type":"boolean"}]},"completion":{"type":"object","properties":{"mode":{"type":"string","enum":["ANY_ONE","ALL"],"description":"`ANY_ONE`: one participant finishing is enough. `ALL`: every participant finishes."}},"required":["mode"],"description":"When the seat is done."},"showToExternalAssignee":{"anyOf":[{"type":"boolean"},{"type":"boolean"}],"description":"Advisors only. `true`: an assignee outside your organization may read the recommendation, as advice from your organization."},"canEditAnswers":{"description":"Reviewers only, on a Form, PDF form or File request step. `true` lets the reviewer whose turn it is edit the submitted answers (on a File request, add and remove its files) during review, in the Moxo app, instead of sending them back. Off unless set.","type":"boolean"},"reviewItemsTogether":{"description":"Reviewers only, on a person's step inside a For each whose items run at the same time. `true` gives the reviewer one list and one notice for every item instead of one review per item; each item keeps its own run and review. With the loop's `syncStepsAcrossIterations` on, the reviewer approves every item at once (`approve_reviews_together`); off, each item is approved on its own. Publish refuses it in a Repeat while, on an \"Approve before it runs\" step, with no person or role reviewing, and in a loop that runs items one at a time. Off unless set.","type":"boolean"}},"required":["participants"]},{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["AI","HUMAN"]},"roleId":{"type":"string"},"contactId":{"type":"string"},"userId":{"type":"string"},"agentId":{"type":"string"},"prompt":{"type":"string"},"criteria":{"type":"string"},"context":{"type":"string"},"privateNotesGuidance":{"type":"string","maxLength":2000},"sendBackReply":{"type":"string","enum":["outcome_with_reason","outcome_only"]},"howToExplain":{"type":"string","maxLength":2000},"inputs":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"value":{"type":"string"},"type":{"type":"string","enum":["TEXT","FILE"]}},"required":["name","value"]}},"ruleKinds":{"maxItems":80,"type":"array","items":{"type":"object","properties":{"rule":{"type":"string","minLength":1,"maxLength":2000},"kind":{"type":"string","enum":["fact","data_match","coverage","visual","judgment"]},"compare":{"type":"object","properties":{"check":{"type":"string","enum":["compare.money_equal","compare.date_after","compare.names_equal","certificate.insured_name_matches","certificate.limit_at_least","kyc.id_name_matches","kyc.birth_date_matches","kyc.dated_within_three_months"]},"against":{"type":"string","enum":["today","value","input"]},"value":{"type":"string","minLength":1,"maxLength":500},"input":{"type":"string","minLength":1,"maxLength":200}},"required":["check","against"]},"document":{"type":"string","minLength":1,"maxLength":200},"sum":{"type":"object","properties":{"fields":{"minItems":2,"maxItems":60,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}}},"required":["fields"]}},"required":["rule","kind"]}},"participantId":{"type":"string"},"order":{"type":"number"},"aiConfig":{}},"required":["type"],"additionalProperties":{}}}]},"attachments":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"file"},"ref":{"type":"string","description":"A file: an uploaded file's id, or a reference to a file from an earlier step."},"name":{"type":"string","minLength":1,"maxLength":255,"description":"The file's name as shown on the step."}},"required":["kind","ref"]},{"type":"object","properties":{"kind":{"type":"string","const":"link"},"url":{"type":"string","minLength":1,"maxLength":2048,"description":"An absolute `http` or `https` address, or a reference to a value from earlier in the flow, filled in when the step runs."},"title":{"description":"A short label for the link. Defaults to the address.","type":"string","maxLength":200},"description":{"description":"Optional text shown on hover, cut to about 140 characters.","type":"string","maxLength":1000}},"required":["kind","url"]}]}},"visibleToAllAssignees":{"type":"boolean"},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"},"options":{"description":"Switches for the files attached to this step. A type takes only the ones its step settings show.","type":"object","properties":{"preventDownload":{"description":"Prevent download: people can open the files attached to this step to read them, but can't download them. Needs view-only attachments switched on for your organization.","type":"boolean"}}}},"title":"To-Do","description":"A task for someone to complete and mark as done.\n\nThe settings a template read (`GET /v1/templates/{id}`) returns for this type, as stored. The shared settings (due date, reminders, visibility, monitors) can appear alongside them. To set them in a change, send `StepSettings_TODO`: where this shape holds an id, a change can name a role, field or step by its name or handle.\n\n**Offered by plan:** available when the organization's plan includes `todo`.","x-moxo-step-type":"TODO","x-moxo-category":"HUMAN_ACTION","x-moxo-plan-feature":"todo"},"StepConfig_CHECKLIST":{"type":"object","properties":{"checklist":{"type":"object","properties":{"itemAssignment":{"type":"string","enum":["per-role"],"description":"With `per-role`, each item belongs to one role, or to anyone on the step, and each person submits their own part. Use it with `completion` set to `ALL`, so the step waits for every role."},"hideOtherRoleItems":{"type":"boolean","description":"With `true`, when `itemAssignment` is `per-role`, each person sees only their own items and the items anyone can do. Left out or `false`, everyone sees the whole list, with other roles' items read-only."},"items":{"minItems":1,"maxItems":500,"type":"array","items":{"$ref":"#/components/schemas/StepConfig_CHECKLIST_itemsItem"},"description":"The items to complete, 1 to 500. Each has a label and an optional description."},"completionStatuses":{"minItems":1,"type":"array","items":{"type":"string","enum":["NOT_STARTED","DONE","SKIPPED"]},"default":["DONE","SKIPPED"],"description":"The item statuses that let the assignee complete the step. Defaults to `[\"DONE\", \"SKIPPED\"]`. Use `[\"DONE\"]` to forbid skipping, for example in a compliance review. It can't hold only `NOT_STARTED`, which would complete the step at once."}},"required":["items"],"description":"The items assignees work through, marking each one Done or Skipped."},"attachments":{"description":"Reference material shown on the step: files, web links or both. A web link (`{ kind: \"link\", url }`) is a page the assignee should open. Its `url` can be a fixed `https://` address or a reference to a value from earlier in the flow, such as `${{ steps.look_up_portal_link.fields.latest_url }}`, so a running flow always links to the latest address.","$ref":"#/components/schemas/StepConfig_CHECKLIST_attachments"},"preparers":{"anyOf":[{"type":"object","properties":{"participants":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["AI","HUMAN"]},"roleId":{"type":"string","description":"For a person: the role that takes this seat, by its id."},"contactId":{"type":"string","description":"An external user named on the seat, by the `usr_` id the template read shows. `null` follows the read, as for `userId`."},"userId":{"type":"string","description":"A person named on the seat, by the `usr_` id the template read shows. `null` where the read showed `null` (someone with no id here) keeps the saved person; `null` where it showed an id takes them off the seat."},"agentId":{"type":"string"},"prompt":{"type":"string","description":"The AI participant's step context: instructions for this step only."},"criteria":{"type":"string","description":"For an AI reviewer: what to check. Read before `prompt`."},"context":{"type":"string","description":"An older home of the AI participant's step context, still read. Set `prompt` instead."},"privateNotesGuidance":{"type":"string","maxLength":2000,"description":"When no agent is named: what the AI notes privately for the flow's managers."},"sendBackReply":{"type":"string","enum":["outcome_with_reason","outcome_only"],"description":"When the AI sends work back and no agent is named: what the reply says, `outcome_with_reason` or `outcome_only`."},"howToExplain":{"type":"string","maxLength":2000,"description":"When the AI sends work back and no agent is named: how it explains what to fix."},"inputs":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"value":{"type":"string"},"type":{"type":"string","enum":["TEXT","FILE"]}},"required":["name","value"]}},"participantId":{"type":"string","description":"The participant's id on the step. Keep it when sending the seat back; leave it out for a new participant."},"order":{"type":"number","description":"The participant's place in the seat, from 0, when they act one after another."},"aiConfig":{}},"required":["type"],"additionalProperties":{}}},"sequential":{"type":"boolean"},"completion":{"type":"object","properties":{"mode":{"type":"string","enum":["ANY_ONE","ALL"],"description":"`ANY_ONE`: one participant finishing is enough. `ALL`: every participant finishes."}},"required":["mode"],"description":"When the seat is done."},"showToExternalAssignee":{"description":"Advisors only. `true` lets an assignee outside your organization read the recommendation (the call and its reasons), as advice from your organization. Off unless set.","type":"boolean"},"canEditAnswers":{"description":"Reviewers only, on a Form, PDF form or File request step. `true` lets the reviewer whose turn it is edit the submitted answers (on a File request, add and remove its files) during review, in the Moxo app, instead of sending them back. Off unless set.","type":"boolean"},"reviewItemsTogether":{"description":"Reviewers only, on a person's step inside a For each whose items run at the same time. `true` gives the reviewer one list and one notice for every item instead of one review per item; each item keeps its own run and review. With the loop's `syncStepsAcrossIterations` on, the reviewer approves every item at once (`approve_reviews_together`); off, each item is approved on its own. Publish refuses it in a Repeat while, on an \"Approve before it runs\" step, with no person or role reviewing, and in a loop that runs items one at a time. Off unless set.","type":"boolean"}},"required":["participants"]},{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["AI","HUMAN"]},"roleId":{"type":"string"},"contactId":{"type":"string"},"userId":{"type":"string"},"agentId":{"type":"string"},"prompt":{"type":"string"},"criteria":{"type":"string"},"context":{"type":"string"},"privateNotesGuidance":{"type":"string","maxLength":2000},"sendBackReply":{"type":"string","enum":["outcome_with_reason","outcome_only"]},"howToExplain":{"type":"string","maxLength":2000},"inputs":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"value":{"type":"string"},"type":{"type":"string","enum":["TEXT","FILE"]}},"required":["name","value"]}},"ruleKinds":{"maxItems":80,"type":"array","items":{"type":"object","properties":{"rule":{"type":"string","minLength":1,"maxLength":2000},"kind":{"type":"string","enum":["fact","data_match","coverage","visual","judgment"]},"compare":{"type":"object","properties":{"check":{"type":"string","enum":["compare.money_equal","compare.date_after","compare.names_equal","certificate.insured_name_matches","certificate.limit_at_least","kyc.id_name_matches","kyc.birth_date_matches","kyc.dated_within_three_months"]},"against":{"type":"string","enum":["today","value","input"]},"value":{"type":"string","minLength":1,"maxLength":500},"input":{"type":"string","minLength":1,"maxLength":200}},"required":["check","against"]},"document":{"type":"string","minLength":1,"maxLength":200},"sum":{"type":"object","properties":{"fields":{"minItems":2,"maxItems":60,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}}},"required":["fields"]}},"required":["rule","kind"]}},"participantId":{"type":"string"},"order":{"type":"number"},"aiConfig":{}},"required":["type"],"additionalProperties":{}}}]},"visibleToAllAssignees":{"type":"boolean"},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"}},"required":["checklist"],"title":"Checklist","description":"A list of items for someone to work through, with a status for each item.\n\nThe settings a template read (`GET /v1/templates/{id}`) returns for this type, as stored. The shared settings (due date, reminders, visibility, monitors) can appear alongside them. To set them in a change, send `StepSettings_CHECKLIST`: where this shape holds an id, a change can name a role, field or step by its name or handle.\n\n**Coming soon:** can't be added to a template.\n\n**Offered by plan:** available when the organization's plan includes `checklist`.","x-moxo-step-type":"CHECKLIST","x-moxo-category":"HUMAN_ACTION","x-moxo-plan-feature":"checklist","x-moxo-coming-soon":true},"StepConfig_CHECKLIST_itemsItem":{"type":"object","properties":{"itemId":{"type":"string"},"label":{"type":"string"},"description":{"type":"string"},"assignedRoleId":{"type":"string","description":"The `roleId` of the role that does this item."},"shared":{"type":"boolean","const":true,"description":"Anyone on the step can do this item."},"linkedStepId":{"type":"string","description":"The id of an earlier action this item follows. The item is done when that action is done, and not needed when that action is skipped or not on the path taken. The item keeps its own label. Leave it out for an item someone marks."}},"required":["label"]},"StepConfig_CHECKLIST_attachments":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"ref":{"type":"string","description":"A file from an earlier step, as a reference such as `${{ steps.upload_contract.fields.uploaded_files }}`, or an uploaded file's id."}},"required":["ref"]},{"type":"object","properties":{"kind":{"type":"string","const":"link"},"url":{"type":"string","minLength":1,"maxLength":2048,"description":"An absolute `http` or `https` address, or a reference to a value from earlier in the flow, filled in when the step runs."},"title":{"type":"string","maxLength":200,"description":"A short label for the link. Defaults to the address."},"description":{"type":"string","maxLength":1000,"description":"Optional text shown on hover, cut to about 140 characters."}},"required":["kind","url"]}]}},"StepConfig_APPROVAL":{"type":"object","properties":{"onReject":{"type":"object","properties":{"action":{"type":"string","enum":["revise_and_resubmit","approver_decides","rejection_steps","end_flow"]},"reopenStepIds":{"type":"array","items":{"type":"string"}},"allowedStepIds":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"reworkStyle":{"type":"string","enum":["reopen_selected","rerun_from_step"]},"restartFromStepId":{"type":"string"}},"required":["action"],"description":"What happens when the approver rejects. `approver_decides` (the default): the approver picks which earlier steps to send back. `revise_and_resubmit`: reopens the earlier steps in `reopenStepIds`. `rejection_steps`: runs the steps in `rejectBranch`. `end_flow`: ends the flow. With `revise_and_resubmit`, `reworkStyle` `rerun_from_step` goes back to `restartFromStepId` (an earlier person's step on the main path, or an earlier step in the same single-choice path, decision outcome, parallel path, for-each round or multi-choice path), runs every step after it in that path again, automations included, and then asks for the approval again. The chosen branch stays chosen. Use it when automations between the reworked steps and the approval need to run again on the revised data. Without `reworkStyle`, the steps are only reopened."},"approveBranch":{"type":"object","properties":{"steps":{"type":"array","items":{"type":"object","properties":{},"additionalProperties":{}},"description":"Steps that run after approval, before the main path continues."},"milestones":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"stepIds":{"type":"array","items":{"type":"string"}},"dueDate":{"type":"object","properties":{"type":{"type":"string","const":"RELATIVE"},"value":{"type":"number"},"unit":{"type":"string","enum":["HOURS","DAYS","WEEKS"]}},"required":["type","value","unit"]}},"required":["id","name","stepIds"]}}},"required":["steps"],"description":"Steps that run when the step is approved, paired with `rejectBranch` when `onReject.action` is `rejection_steps` or `end_flow`. Optional."},"rejectBranch":{"description":"Steps that run when the step is rejected and `onReject.action` is `rejection_steps` or `end_flow`. Optional.","$ref":"#/components/schemas/StepConfig_APPROVAL_rejectBranch"},"attachments":{"description":"Reference material shown on the step: files, web links or both. A web link (`{ kind: \"link\", url }`) is a page the assignee should open. Its `url` can be a fixed `https://` address or a reference to a value from earlier in the flow, such as `${{ steps.look_up_portal_link.fields.latest_url }}`, so a running flow always links to the latest address.","$ref":"#/components/schemas/StepConfigPart_attachments"},"advisors":{"description":"An AI advisor that shows a recommendation before the assignee acts. Optional. For Approval, Decision, To-do and Questionnaire steps.","$ref":"#/components/schemas/StepConfigPart_advisors"},"preparers":{"anyOf":[{"type":"object","properties":{"participants":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["AI","HUMAN"]},"roleId":{"type":"string","description":"For a person: the role that takes this seat, by its id."},"contactId":{"type":"string","description":"An external user named on the seat, by the `usr_` id the template read shows. `null` follows the read, as for `userId`."},"userId":{"type":"string","description":"A person named on the seat, by the `usr_` id the template read shows. `null` where the read showed `null` (someone with no id here) keeps the saved person; `null` where it showed an id takes them off the seat."},"agentId":{"type":"string"},"prompt":{"type":"string","description":"The AI participant's step context: instructions for this step only."},"criteria":{"type":"string","description":"For an AI reviewer: what to check. Read before `prompt`."},"context":{"type":"string","description":"An older home of the AI participant's step context, still read. Set `prompt` instead."},"privateNotesGuidance":{"type":"string","maxLength":2000,"description":"When no agent is named: what the AI notes privately for the flow's managers."},"sendBackReply":{"type":"string","enum":["outcome_with_reason","outcome_only"],"description":"When the AI sends work back and no agent is named: what the reply says, `outcome_with_reason` or `outcome_only`."},"howToExplain":{"type":"string","maxLength":2000,"description":"When the AI sends work back and no agent is named: how it explains what to fix."},"inputs":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"value":{"type":"string"},"type":{"type":"string","enum":["TEXT","FILE"]}},"required":["name","value"]}},"participantId":{"type":"string","description":"The participant's id on the step. Keep it when sending the seat back; leave it out for a new participant."},"order":{"type":"number","description":"The participant's place in the seat, from 0, when they act one after another."},"aiConfig":{}},"required":["type"],"additionalProperties":{}}},"sequential":{"type":"boolean"},"completion":{"type":"object","properties":{"mode":{"type":"string","enum":["ANY_ONE","ALL"],"description":"`ANY_ONE`: one participant finishing is enough. `ALL`: every participant finishes."}},"required":["mode"],"description":"When the seat is done."},"showToExternalAssignee":{"description":"Advisors only. `true` lets an assignee outside your organization read the recommendation (the call and its reasons), as advice from your organization. Off unless set.","type":"boolean"},"canEditAnswers":{"description":"Reviewers only, on a Form, PDF form or File request step. `true` lets the reviewer whose turn it is edit the submitted answers (on a File request, add and remove its files) during review, in the Moxo app, instead of sending them back. Off unless set.","type":"boolean"},"reviewItemsTogether":{"description":"Reviewers only, on a person's step inside a For each whose items run at the same time. `true` gives the reviewer one list and one notice for every item instead of one review per item; each item keeps its own run and review. With the loop's `syncStepsAcrossIterations` on, the reviewer approves every item at once (`approve_reviews_together`); off, each item is approved on its own. Publish refuses it in a Repeat while, on an \"Approve before it runs\" step, with no person or role reviewing, and in a loop that runs items one at a time. Off unless set.","type":"boolean"}},"required":["participants"]},{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["AI","HUMAN"]},"roleId":{"type":"string"},"contactId":{"type":"string"},"userId":{"type":"string"},"agentId":{"type":"string"},"prompt":{"type":"string"},"criteria":{"type":"string"},"context":{"type":"string"},"privateNotesGuidance":{"type":"string","maxLength":2000},"sendBackReply":{"type":"string","enum":["outcome_with_reason","outcome_only"]},"howToExplain":{"type":"string","maxLength":2000},"inputs":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"value":{"type":"string"},"type":{"type":"string","enum":["TEXT","FILE"]}},"required":["name","value"]}},"ruleKinds":{"maxItems":80,"type":"array","items":{"type":"object","properties":{"rule":{"type":"string","minLength":1,"maxLength":2000},"kind":{"type":"string","enum":["fact","data_match","coverage","visual","judgment"]},"compare":{"type":"object","properties":{"check":{"type":"string","enum":["compare.money_equal","compare.date_after","compare.names_equal","certificate.insured_name_matches","certificate.limit_at_least","kyc.id_name_matches","kyc.birth_date_matches","kyc.dated_within_three_months"]},"against":{"type":"string","enum":["today","value","input"]},"value":{"type":"string","minLength":1,"maxLength":500},"input":{"type":"string","minLength":1,"maxLength":200}},"required":["check","against"]},"document":{"type":"string","minLength":1,"maxLength":200},"sum":{"type":"object","properties":{"fields":{"minItems":2,"maxItems":60,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}}},"required":["fields"]}},"required":["rule","kind"]}},"participantId":{"type":"string"},"order":{"type":"number"},"aiConfig":{}},"required":["type"],"additionalProperties":{}}}]},"approval":{"type":"object","properties":{"assigneeOrder":{"type":"string","enum":["SEQUENTIAL","PARALLEL"]}},"required":["assigneeOrder"]},"visibleToAllAssignees":{"type":"boolean"},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"},"options":{"description":"Switches for the files attached to this step. A type takes only the ones its step settings show.","type":"object","properties":{"preventDownload":{"description":"Prevent download: people can open the files attached to this step to read them, but can't download them. Needs view-only attachments switched on for your organization.","type":"boolean"},"watermarkOnView":{"description":"Watermark: each person sees the PDFs attached to this step stamped with their name. Needs document watermarking switched on for your organization.","type":"boolean"}}}},"title":"Approval","description":"Asks one or more assignees to approve.\n\nThe settings a template read (`GET /v1/templates/{id}`) returns for this type, as stored. The shared settings (due date, reminders, visibility, monitors) can appear alongside them. To set them in a change, send `StepSettings_APPROVAL`: where this shape holds an id, a change can name a role, field or step by its name or handle.\n\n**Offered by plan:** available when the organization's plan includes `approval`.","x-moxo-step-type":"APPROVAL","x-moxo-category":"HUMAN_ACTION","x-moxo-plan-feature":"approval"},"StepConfig_APPROVAL_rejectBranch":{"type":"object","properties":{"steps":{"type":"array","items":{"type":"object","properties":{},"additionalProperties":{}},"description":"Steps that run when the approval is rejected."},"milestones":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"stepIds":{"type":"array","items":{"type":"string"}},"dueDate":{"type":"object","properties":{"type":{"type":"string","const":"RELATIVE"},"value":{"type":"number"},"unit":{"type":"string","enum":["HOURS","DAYS","WEEKS"]}},"required":["type","value","unit"]}},"required":["id","name","stepIds"]}}},"required":["steps"]},"StepConfig_ACKNOWLEDGEMENT":{"type":"object","properties":{"attachments":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"file"},"ref":{"type":"string","description":"A file: an uploaded file's id, or a reference to a file from an earlier step."},"name":{"type":"string","minLength":1,"maxLength":255,"description":"The file's name as shown on the step."}},"required":["kind","ref"]},{"type":"object","properties":{"kind":{"type":"string","const":"link"},"url":{"type":"string","minLength":1,"maxLength":2048,"description":"An absolute `http` or `https` address, or a reference to a value from earlier in the flow, filled in when the step runs."},"title":{"description":"A short label for the link. Defaults to the address.","type":"string","maxLength":200},"description":{"description":"Optional text shown on hover, cut to about 140 characters.","type":"string","maxLength":1000}},"required":["kind","url"]}]}},"preparers":{"anyOf":[{"type":"object","properties":{"participants":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["AI","HUMAN"]},"roleId":{"type":"string","description":"For a person: the role that takes this seat, by its id."},"contactId":{"type":"string","description":"An external user named on the seat, by the `usr_` id the template read shows. `null` follows the read, as for `userId`."},"userId":{"type":"string","description":"A person named on the seat, by the `usr_` id the template read shows. `null` where the read showed `null` (someone with no id here) keeps the saved person; `null` where it showed an id takes them off the seat."},"agentId":{"type":"string"},"prompt":{"type":"string","description":"The AI participant's step context: instructions for this step only."},"criteria":{"type":"string","description":"For an AI reviewer: what to check. Read before `prompt`."},"context":{"type":"string","description":"An older home of the AI participant's step context, still read. Set `prompt` instead."},"privateNotesGuidance":{"type":"string","maxLength":2000,"description":"When no agent is named: what the AI notes privately for the flow's managers."},"sendBackReply":{"type":"string","enum":["outcome_with_reason","outcome_only"],"description":"When the AI sends work back and no agent is named: what the reply says, `outcome_with_reason` or `outcome_only`."},"howToExplain":{"type":"string","maxLength":2000,"description":"When the AI sends work back and no agent is named: how it explains what to fix."},"inputs":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"value":{"type":"string"},"type":{"type":"string","enum":["TEXT","FILE"]}},"required":["name","value"]}},"participantId":{"type":"string","description":"The participant's id on the step. Keep it when sending the seat back; leave it out for a new participant."},"order":{"type":"number","description":"The participant's place in the seat, from 0, when they act one after another."},"aiConfig":{}},"required":["type"],"additionalProperties":{}}},"sequential":{"type":"boolean"},"completion":{"type":"object","properties":{"mode":{"type":"string","enum":["ANY_ONE","ALL"],"description":"`ANY_ONE`: one participant finishing is enough. `ALL`: every participant finishes."}},"required":["mode"],"description":"When the seat is done."},"showToExternalAssignee":{"description":"Advisors only. `true` lets an assignee outside your organization read the recommendation (the call and its reasons), as advice from your organization. Off unless set.","type":"boolean"},"canEditAnswers":{"description":"Reviewers only, on a Form, PDF form or File request step. `true` lets the reviewer whose turn it is edit the submitted answers (on a File request, add and remove its files) during review, in the Moxo app, instead of sending them back. Off unless set.","type":"boolean"},"reviewItemsTogether":{"description":"Reviewers only, on a person's step inside a For each whose items run at the same time. `true` gives the reviewer one list and one notice for every item instead of one review per item; each item keeps its own run and review. With the loop's `syncStepsAcrossIterations` on, the reviewer approves every item at once (`approve_reviews_together`); off, each item is approved on its own. Publish refuses it in a Repeat while, on an \"Approve before it runs\" step, with no person or role reviewing, and in a loop that runs items one at a time. Off unless set.","type":"boolean"}},"required":["participants"]},{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["AI","HUMAN"]},"roleId":{"type":"string"},"contactId":{"type":"string"},"userId":{"type":"string"},"agentId":{"type":"string"},"prompt":{"type":"string"},"criteria":{"type":"string"},"context":{"type":"string"},"privateNotesGuidance":{"type":"string","maxLength":2000},"sendBackReply":{"type":"string","enum":["outcome_with_reason","outcome_only"]},"howToExplain":{"type":"string","maxLength":2000},"inputs":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"value":{"type":"string"},"type":{"type":"string","enum":["TEXT","FILE"]}},"required":["name","value"]}},"ruleKinds":{"maxItems":80,"type":"array","items":{"type":"object","properties":{"rule":{"type":"string","minLength":1,"maxLength":2000},"kind":{"type":"string","enum":["fact","data_match","coverage","visual","judgment"]},"compare":{"type":"object","properties":{"check":{"type":"string","enum":["compare.money_equal","compare.date_after","compare.names_equal","certificate.insured_name_matches","certificate.limit_at_least","kyc.id_name_matches","kyc.birth_date_matches","kyc.dated_within_three_months"]},"against":{"type":"string","enum":["today","value","input"]},"value":{"type":"string","minLength":1,"maxLength":500},"input":{"type":"string","minLength":1,"maxLength":200}},"required":["check","against"]},"document":{"type":"string","minLength":1,"maxLength":200},"sum":{"type":"object","properties":{"fields":{"minItems":2,"maxItems":60,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}}},"required":["fields"]}},"required":["rule","kind"]}},"participantId":{"type":"string"},"order":{"type":"number"},"aiConfig":{}},"required":["type"],"additionalProperties":{}}}]},"visibleToAllAssignees":{"type":"boolean"},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"},"options":{"description":"Switches for the files attached to this step. A type takes only the ones its step settings show.","type":"object","properties":{"preventDownload":{"description":"Prevent download: people can open the files attached to this step to read them, but can't download them. Needs view-only attachments switched on for your organization.","type":"boolean"},"watermarkOnView":{"description":"Watermark: each person sees the PDFs attached to this step stamped with their name. Needs document watermarking switched on for your organization.","type":"boolean"},"requireAttachmentReview":{"description":"The person must open each attached file before they can acknowledge.","type":"boolean"},"buttonLabel":{"description":"The words on the acknowledge button, at most 60 characters. Leave it out and the button says I Acknowledge.","type":"string","maxLength":60}}}},"title":"Acknowledgement","description":"Asks someone to confirm they have read or understood something.\n\nThe settings a template read (`GET /v1/templates/{id}`) returns for this type, as stored. The shared settings (due date, reminders, visibility, monitors) can appear alongside them. To set them in a change, send `StepSettings_ACKNOWLEDGEMENT`: where this shape holds an id, a change can name a role, field or step by its name or handle.\n\n**Offered by plan:** available when the organization's plan includes `acknowledgement`.","x-moxo-step-type":"ACKNOWLEDGEMENT","x-moxo-category":"HUMAN_ACTION","x-moxo-plan-feature":"acknowledgement"},"StepConfig_WATCH_VIDEO":{"type":"object","properties":{"video":{"description":"The video, its poster and captions, and how watching it is required.","$ref":"#/components/schemas/StepConfig_WATCH_VIDEO_video"},"visibleToAllAssignees":{"type":"boolean"},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"}},"title":"Watch video","description":"Asks someone to watch one uploaded video. Flow managers see how far each person has watched, and by default the action can't be completed until the video is watched to the end.\n\nThe settings a template read (`GET /v1/templates/{id}`) returns for this type, as stored. The shared settings (due date, reminders, visibility, monitors) can appear alongside them. To set them in a change, send `StepSettings_WATCH_VIDEO`: where this shape holds an id, a change can name a role, field or step by its name or handle.\n\n**Offered by plan:** available when the organization's plan includes `watchVideoAction`.","x-moxo-step-type":"WATCH_VIDEO","x-moxo-category":"HUMAN_ACTION","x-moxo-plan-feature":"watchVideoAction"},"StepConfig_WATCH_VIDEO_video":{"type":"object","properties":{"file":{"type":"object","properties":{"fileId":{"type":"string","minLength":1,"description":"Id of a file uploaded to this step."},"name":{"type":"string","maxLength":500,"description":"The file name to show, as uploaded."}},"required":["fileId"],"description":"The video to watch: a `video/mp4` or `video/webm` file uploaded to this step, up to 250 MB. Required before the template can be published."},"poster":{"type":"object","properties":{"fileId":{"type":"string","minLength":1,"description":"Id of a file uploaded to this step."},"name":{"type":"string","maxLength":500,"description":"The file name to show, as uploaded."}},"required":["fileId"],"description":"A still image shown before the video plays, uploaded to this step."},"captions":{"type":"object","properties":{"fileId":{"type":"string","minLength":1,"description":"Id of a file uploaded to this step."},"name":{"type":"string","maxLength":500,"description":"The file name to show, as uploaded."}},"required":["fileId"],"description":"Captions for the video: a WebVTT file uploaded to this step."},"durationSec":{"type":"number","exclusiveMinimum":0,"maximum":86400,"description":"The video's length in seconds. Watched means watched to within 2 seconds of this."},"requireFullWatch":{"type":"boolean","description":"true (the default when left out): the action cannot be completed, skipped or force-completed until each person has watched the video to the end, with no skipping ahead. false: progress is still recorded but does not hold the action."},"confirmText":{"type":"string","maxLength":200,"description":"A sentence each person ticks after watching, at most 200 characters. Left out: no confirmation is asked."},"allowDownload":{"type":"boolean","description":"true lets people download the video. Left out or false: the video can only be played."}}},"StepConfig_PACKET":{"type":"object","properties":{"asks":{"type":"array","items":{"type":"object","properties":{},"additionalProperties":{}},"description":"The asks: steps of type `FORM`, `FILE_REQUEST`, `ACKNOWLEDGEMENT` or `ESIGN`, each with its own settings and no people of its own (the packet's people do every ask). Each sits on exactly one page."},"packet":{"type":"object","properties":{"pages":{"type":"array","items":{"$ref":"#/components/schemas/StepConfig_PACKET_pagesItem"},"description":"The pages, in the order they are shown."},"outcomes":{"maxItems":6,"type":"array","items":{"type":"object","properties":{"outcomeId":{"type":"string","minLength":1,"description":"The outcome's id. A finishing button names it."},"label":{"type":"string","maxLength":40,"description":"The outcome's name, which is the packet's `outcome` output when it finishes this way (\"Submitted\", \"Withdrawn\")."},"needsAsks":{"type":"boolean","description":"`true`: finishing needs every required ask on a shown page done. `false`: an early end, and the asks left are skipped."}},"required":["outcomeId","label","needsAsks"]},"description":"How the packet can finish. At least one outcome needs the asks (`needsAsks: true`, such as Submitted)."}},"required":["pages","outcomes"],"description":"The pages, their buttons and the outcomes. A page item of kind `ask` names an ask by its `stepId`."},"assist":{"description":"Assist for the person doing the packet: one switch covers every ask. `{ \"enabled\": true }` lets them ask for help on each ask, and get help filling in a form ask. Leave it out, or send `{ \"enabled\": false }`, to keep it off. An ask never has its own.","$ref":"#/components/schemas/StepConfigPart_assist"},"preparers":{"anyOf":[{"type":"object","properties":{"participants":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["AI","HUMAN"]},"roleId":{"type":"string","description":"For a person: the role that takes this seat, by its id."},"contactId":{"type":"string","description":"An external user named on the seat, by the `usr_` id the template read shows. `null` follows the read, as for `userId`."},"userId":{"type":"string","description":"A person named on the seat, by the `usr_` id the template read shows. `null` where the read showed `null` (someone with no id here) keeps the saved person; `null` where it showed an id takes them off the seat."},"agentId":{"type":"string"},"prompt":{"type":"string","description":"The AI participant's step context: instructions for this step only."},"criteria":{"type":"string","description":"For an AI reviewer: what to check. Read before `prompt`."},"context":{"type":"string","description":"An older home of the AI participant's step context, still read. Set `prompt` instead."},"privateNotesGuidance":{"type":"string","maxLength":2000,"description":"When no agent is named: what the AI notes privately for the flow's managers."},"sendBackReply":{"type":"string","enum":["outcome_with_reason","outcome_only"],"description":"When the AI sends work back and no agent is named: what the reply says, `outcome_with_reason` or `outcome_only`."},"howToExplain":{"type":"string","maxLength":2000,"description":"When the AI sends work back and no agent is named: how it explains what to fix."},"inputs":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"value":{"type":"string"},"type":{"type":"string","enum":["TEXT","FILE"]}},"required":["name","value"]}},"participantId":{"type":"string","description":"The participant's id on the step. Keep it when sending the seat back; leave it out for a new participant."},"order":{"type":"number","description":"The participant's place in the seat, from 0, when they act one after another."},"aiConfig":{}},"required":["type"],"additionalProperties":{}}},"sequential":{"type":"boolean"},"completion":{"type":"object","properties":{"mode":{"type":"string","enum":["ANY_ONE","ALL"],"description":"`ANY_ONE`: one participant finishing is enough. `ALL`: every participant finishes."}},"required":["mode"],"description":"When the seat is done."},"showToExternalAssignee":{"description":"Advisors only. `true` lets an assignee outside your organization read the recommendation (the call and its reasons), as advice from your organization. Off unless set.","type":"boolean"},"canEditAnswers":{"description":"Reviewers only, on a Form, PDF form or File request step. `true` lets the reviewer whose turn it is edit the submitted answers (on a File request, add and remove its files) during review, in the Moxo app, instead of sending them back. Off unless set.","type":"boolean"},"reviewItemsTogether":{"description":"Reviewers only, on a person's step inside a For each whose items run at the same time. `true` gives the reviewer one list and one notice for every item instead of one review per item; each item keeps its own run and review. With the loop's `syncStepsAcrossIterations` on, the reviewer approves every item at once (`approve_reviews_together`); off, each item is approved on its own. Publish refuses it in a Repeat while, on an \"Approve before it runs\" step, with no person or role reviewing, and in a loop that runs items one at a time. Off unless set.","type":"boolean"}},"required":["participants"]},{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["AI","HUMAN"]},"roleId":{"type":"string"},"contactId":{"type":"string"},"userId":{"type":"string"},"agentId":{"type":"string"},"prompt":{"type":"string"},"criteria":{"type":"string"},"context":{"type":"string"},"privateNotesGuidance":{"type":"string","maxLength":2000},"sendBackReply":{"type":"string","enum":["outcome_with_reason","outcome_only"]},"howToExplain":{"type":"string","maxLength":2000},"inputs":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"value":{"type":"string"},"type":{"type":"string","enum":["TEXT","FILE"]}},"required":["name","value"]}},"ruleKinds":{"maxItems":80,"type":"array","items":{"type":"object","properties":{"rule":{"type":"string","minLength":1,"maxLength":2000},"kind":{"type":"string","enum":["fact","data_match","coverage","visual","judgment"]},"compare":{"type":"object","properties":{"check":{"type":"string","enum":["compare.money_equal","compare.date_after","compare.names_equal","certificate.insured_name_matches","certificate.limit_at_least","kyc.id_name_matches","kyc.birth_date_matches","kyc.dated_within_three_months"]},"against":{"type":"string","enum":["today","value","input"]},"value":{"type":"string","minLength":1,"maxLength":500},"input":{"type":"string","minLength":1,"maxLength":200}},"required":["check","against"]},"document":{"type":"string","minLength":1,"maxLength":200},"sum":{"type":"object","properties":{"fields":{"minItems":2,"maxItems":60,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}}},"required":["fields"]}},"required":["rule","kind"]}},"participantId":{"type":"string"},"order":{"type":"number"},"aiConfig":{}},"required":["type"],"additionalProperties":{}}}]},"reviewers":{"anyOf":[{"type":"object","properties":{"participants":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["AI","HUMAN"]},"roleId":{"type":"string","description":"For a person: the role that takes this seat, by its id."},"contactId":{"type":"string","description":"An external user named on the seat, by the `usr_` id the template read shows. `null` follows the read, as for `userId`."},"userId":{"type":"string","description":"A person named on the seat, by the `usr_` id the template read shows. `null` where the read showed `null` (someone with no id here) keeps the saved person; `null` where it showed an id takes them off the seat."},"agentId":{"type":"string"},"prompt":{"type":"string","description":"The AI participant's step context: instructions for this step only."},"criteria":{"type":"string","description":"For an AI reviewer: what to check. Read before `prompt`."},"context":{"type":"string","description":"An older home of the AI participant's step context, still read. Set `prompt` instead."},"privateNotesGuidance":{"type":"string","maxLength":2000,"description":"When no agent is named: what the AI notes privately for the flow's managers."},"sendBackReply":{"type":"string","enum":["outcome_with_reason","outcome_only"],"description":"When the AI sends work back and no agent is named: what the reply says, `outcome_with_reason` or `outcome_only`."},"howToExplain":{"type":"string","maxLength":2000,"description":"When the AI sends work back and no agent is named: how it explains what to fix."},"inputs":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"value":{"type":"string"},"type":{"type":"string","enum":["TEXT","FILE"]}},"required":["name","value"]}},"participantId":{"type":"string","description":"The participant's id on the step. Keep it when sending the seat back; leave it out for a new participant."},"order":{"type":"number","description":"The participant's place in the seat, from 0, when they act one after another."},"aiConfig":{}},"required":["type"],"additionalProperties":{}}},"sequential":{"type":"boolean"},"completion":{"type":"object","properties":{"mode":{"type":"string","enum":["ANY_ONE","ALL"],"description":"`ANY_ONE`: one participant finishing is enough. `ALL`: every participant finishes."}},"required":["mode"],"description":"When the seat is done."},"showToExternalAssignee":{"description":"Advisors only. `true` lets an assignee outside your organization read the recommendation (the call and its reasons), as advice from your organization. Off unless set.","type":"boolean"},"canEditAnswers":{"description":"Reviewers only, on a Form, PDF form or File request step. `true` lets the reviewer whose turn it is edit the submitted answers (on a File request, add and remove its files) during review, in the Moxo app, instead of sending them back. Off unless set.","type":"boolean"},"reviewItemsTogether":{"description":"Reviewers only, on a person's step inside a For each whose items run at the same time. `true` gives the reviewer one list and one notice for every item instead of one review per item; each item keeps its own run and review. With the loop's `syncStepsAcrossIterations` on, the reviewer approves every item at once (`approve_reviews_together`); off, each item is approved on its own. Publish refuses it in a Repeat while, on an \"Approve before it runs\" step, with no person or role reviewing, and in a loop that runs items one at a time. Off unless set.","type":"boolean"}},"required":["participants"]},{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["AI","HUMAN"]},"roleId":{"type":"string"},"contactId":{"type":"string"},"userId":{"type":"string"},"agentId":{"type":"string"},"prompt":{"type":"string"},"criteria":{"type":"string"},"context":{"type":"string"},"privateNotesGuidance":{"type":"string","maxLength":2000},"sendBackReply":{"type":"string","enum":["outcome_with_reason","outcome_only"]},"howToExplain":{"type":"string","maxLength":2000},"inputs":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"value":{"type":"string"},"type":{"type":"string","enum":["TEXT","FILE"]}},"required":["name","value"]}},"ruleKinds":{"maxItems":80,"type":"array","items":{"type":"object","properties":{"rule":{"type":"string","minLength":1,"maxLength":2000},"kind":{"type":"string","enum":["fact","data_match","coverage","visual","judgment"]},"compare":{"type":"object","properties":{"check":{"type":"string","enum":["compare.money_equal","compare.date_after","compare.names_equal","certificate.insured_name_matches","certificate.limit_at_least","kyc.id_name_matches","kyc.birth_date_matches","kyc.dated_within_three_months"]},"against":{"type":"string","enum":["today","value","input"]},"value":{"type":"string","minLength":1,"maxLength":500},"input":{"type":"string","minLength":1,"maxLength":200}},"required":["check","against"]},"document":{"type":"string","minLength":1,"maxLength":200},"sum":{"type":"object","properties":{"fields":{"minItems":2,"maxItems":60,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}}},"required":["fields"]}},"required":["rule","kind"]}},"participantId":{"type":"string"},"order":{"type":"number"},"aiConfig":{}},"required":["type"],"additionalProperties":{}}}]},"attachments":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"file"},"ref":{"type":"string","description":"A file: an uploaded file's id, or a reference to a file from an earlier step."},"name":{"type":"string","minLength":1,"maxLength":255,"description":"The file's name as shown on the step."}},"required":["kind","ref"]},{"type":"object","properties":{"kind":{"type":"string","const":"link"},"url":{"type":"string","minLength":1,"maxLength":2048,"description":"An absolute `http` or `https` address, or a reference to a value from earlier in the flow, filled in when the step runs."},"title":{"description":"A short label for the link. Defaults to the address.","type":"string","maxLength":200},"description":{"description":"Optional text shown on hover, cut to about 140 characters.","type":"string","maxLength":1000}},"required":["kind","url"]}]}},"aiEscalation":{"type":"object","properties":{"roleId":{"anyOf":[{"type":"string","minLength":1,"maxLength":80},{"type":"null"}]},"deskId":{"description":"A team desk instead of a role: the hand-off waits in the desk's queue until someone on it claims it. Set `roleId` or `deskId`, never both.","anyOf":[{"type":"string","minLength":1,"maxLength":80},{"type":"null"}]}},"additionalProperties":false},"visibleToAllAssignees":{"type":"boolean"},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"}},"title":"Packet","description":"Asks one person for several kinds of things at once (details, files, an agreement, a signature) on a few pages with their own buttons. One email, one review; a send back reopens only what is wrong.\n\nThe settings a template read (`GET /v1/templates/{id}`) returns for this type, as stored. The shared settings (due date, reminders, visibility, monitors) can appear alongside them. To set them in a change, send `StepSettings_PACKET`: where this shape holds an id, a change can name a role, field or step by its name or handle.\n\n**Offered by plan:** available when the organization's plan includes `packetAction`.","x-moxo-step-type":"PACKET","x-moxo-category":"HUMAN_ACTION","x-moxo-plan-feature":"packetAction"},"StepConfig_PACKET_pagesItem":{"type":"object","properties":{"pageId":{"type":"string","minLength":1,"description":"The page's id."},"title":{"type":"string","maxLength":80,"description":"The page title the person sees."},"items":{"maxItems":30,"type":"array","items":{"$ref":"#/components/schemas/StepConfig_PACKET_itemsItem"},"description":"What the page holds, in order: asks, words and files to read."},"buttons":{"type":"array","items":{"$ref":"#/components/schemas/StepConfig_PACKET_buttonsItem"},"description":"The page's buttons: up to 4, one of them main."},"back":{"type":"boolean","description":"Whether the page shows a Back button. The first page shown never does. Default `true`."},"showWhen":{"description":"Shows the page only when earlier answers match, with the conditions a branch path uses. Not allowed on the first page.","$ref":"#/components/schemas/StepConfig_PACKET_showWhen"}},"required":["pageId","title","items","buttons"]},"StepConfig_PACKET_itemsItem":{"oneOf":[{"type":"object","properties":{"itemId":{"type":"string","minLength":1,"description":"The item's id on its page."},"kind":{"type":"string","const":"ask","description":"One of the asks."},"askId":{"type":"string","minLength":1,"description":"The `stepId` of one of this packet's `asks`."}},"required":["itemId","kind","askId"]},{"type":"object","properties":{"itemId":{"type":"string","minLength":1,"description":"The item's id on its page."},"kind":{"type":"string","const":"text","description":"Words on the page."},"text":{"type":"string","description":"Words on the page. May hold references to earlier answers, such as `${{ steps.company_details.fields.company_name }}`."}},"required":["itemId","kind","text"]},{"type":"object","properties":{"itemId":{"type":"string","minLength":1,"description":"The item's id on its page."},"kind":{"type":"string","const":"file","description":"A file to read."},"attachmentId":{"type":"string","description":"The id of one of this step's own attachments, for the person to read."}},"required":["itemId","kind","attachmentId"]}]},"StepConfig_PACKET_buttonsItem":{"type":"object","properties":{"buttonId":{"type":"string","minLength":1,"description":"The button's id on its page."},"label":{"type":"string","maxLength":40,"description":"The words on the button, a few words (\"Continue\", \"Submit\")."},"primary":{"type":"boolean","description":"Whether this is the page's one main button."},"goTo":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"next","description":"Goes to the next page shown."}},"required":["kind"]},{"type":"object","properties":{"kind":{"type":"string","const":"page","description":"Goes to a chosen page."},"pageId":{"type":"string","minLength":1,"description":"The `pageId` of the page to go to."}},"required":["kind","pageId"]},{"type":"object","properties":{"kind":{"type":"string","const":"finish","description":"Finishes the packet with an outcome."},"outcomeId":{"type":"string","minLength":1,"description":"The `outcomeId` of the outcome to finish with."}},"required":["kind","outcomeId"]}],"description":"Where the button goes: `next` (the next page shown), `page` (a chosen page) or `finish` (finish the packet with an outcome)."}},"required":["buttonId","label","goTo"]},"StepConfig_PACKET_showWhen":{"type":"object","properties":{"conditions":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"EQUALS"},"left":{"$ref":"#/components/schemas/StepConfigPart_left"},"right":{"$ref":"#/components/schemas/StepConfigPart_left"}},"required":["type","left","right"]},{"type":"object","properties":{"type":{"type":"string","const":"NOT_EQUALS"},"left":{"$ref":"#/components/schemas/StepConfigPart_left"},"right":{"$ref":"#/components/schemas/StepConfigPart_left"}},"required":["type","left","right"]},{"type":"object","properties":{"type":{"type":"string","const":"CONTAINS"},"left":{"$ref":"#/components/schemas/StepConfigPart_left"},"right":{"$ref":"#/components/schemas/StepConfigPart_left"}},"required":["type","left","right"]},{"type":"object","properties":{"type":{"type":"string","const":"NOT_CONTAINS"},"left":{"$ref":"#/components/schemas/StepConfigPart_left"},"right":{"$ref":"#/components/schemas/StepConfigPart_left"}},"required":["type","left","right"]},{"type":"object","properties":{"type":{"type":"string","const":"ARRAY_CONTAINS"},"left":{"$ref":"#/components/schemas/StepConfigPart_left"},"right":{"$ref":"#/components/schemas/StepConfigPart_left"}},"required":["type","left","right"]},{"type":"object","properties":{"type":{"type":"string","const":"STARTS_WITH"},"left":{"$ref":"#/components/schemas/StepConfigPart_left"},"right":{"$ref":"#/components/schemas/StepConfigPart_left"}},"required":["type","left","right"]},{"type":"object","properties":{"type":{"type":"string","const":"ENDS_WITH"},"left":{"$ref":"#/components/schemas/StepConfigPart_left"},"right":{"$ref":"#/components/schemas/StepConfigPart_left"}},"required":["type","left","right"]},{"type":"object","properties":{"type":{"type":"string","const":"GREATER_THAN"},"left":{"$ref":"#/components/schemas/StepConfigPart_left"},"right":{"$ref":"#/components/schemas/StepConfigPart_left"}},"required":["type","left","right"]},{"type":"object","properties":{"type":{"type":"string","const":"LESS_THAN"},"left":{"$ref":"#/components/schemas/StepConfigPart_left"},"right":{"$ref":"#/components/schemas/StepConfigPart_left"}},"required":["type","left","right"]},{"type":"object","properties":{"type":{"type":"string","const":"GREATER_THAN_OR_EQUAL"},"left":{"$ref":"#/components/schemas/StepConfigPart_left"},"right":{"$ref":"#/components/schemas/StepConfigPart_left"}},"required":["type","left","right"]},{"type":"object","properties":{"type":{"type":"string","const":"LESS_THAN_OR_EQUAL"},"left":{"$ref":"#/components/schemas/StepConfigPart_left"},"right":{"$ref":"#/components/schemas/StepConfigPart_left"}},"required":["type","left","right"]},{"type":"object","properties":{"type":{"type":"string","const":"IN"},"left":{"$ref":"#/components/schemas/StepConfigPart_left"},"right":{"$ref":"#/components/schemas/StepConfigPart_left"}},"required":["type","left","right"]},{"type":"object","properties":{"type":{"type":"string","const":"NOT_IN"},"left":{"$ref":"#/components/schemas/StepConfigPart_left"},"right":{"$ref":"#/components/schemas/StepConfigPart_left"}},"required":["type","left","right"]},{"type":"object","properties":{"type":{"type":"string","const":"IS_EMPTY"},"left":{"$ref":"#/components/schemas/StepConfigPart_left"}},"required":["type","left"]},{"type":"object","properties":{"type":{"type":"string","const":"NOT_EMPTY"},"left":{"$ref":"#/components/schemas/StepConfigPart_left"}},"required":["type","left"]},{"type":"object","properties":{"type":{"type":"string","const":"ELSE"}},"required":["type"]}]}},"conditionLogic":{"type":"string","enum":["ALL","ANY"]}},"required":["conditions"]},"StepConfigPart_left":{"anyOf":[{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"literal"},"expectedType":{"type":"string"},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}],"description":"A fixed value. Its JSON type follows `expectedType`: a number for `NUMBER`, a boolean for `BOOLEAN` and text for everything else."}},"required":["kind","expectedType","value"]},{"type":"object","properties":{"kind":{"type":"string","const":"step-output"},"expectedType":{"type":"string"},"stepId":{"type":"string","description":"The id of the step that produces the value."},"field":{"type":"string","description":"The output's key on that step. On a form step it is the question's key (`fieldId`); a label is accepted and stored as that key, and a label two questions share is refused at publish. On an AI step, the output's `name`; on an e-signature or PDF form step, the step type's output name. Not the handle."},"channel":{"type":"string","enum":["field","meta"],"description":"Which part of the step to read. `field` (the default) reads an output; `meta` reads completion details, such as who completed the step and when. Not used for a value collected across a loop."}},"required":["kind","expectedType","stepId","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"role-data"},"expectedType":{"type":"string","const":"TEXT"},"roleId":{"type":"string"},"field":{"type":"string","enum":["name","email","phone","title"]}},"required":["kind","expectedType","roleId","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"flow-input"},"expectedType":{"type":"string"},"inputId":{"type":"string","description":"The `key` of a flow field asked for when the flow starts, for example `client_name`. Not an id. Read from the start form's values."}},"required":["kind","expectedType","inputId"]},{"type":"object","properties":{"kind":{"type":"string","const":"custom-field"},"expectedType":{"type":"string"},"fieldId":{"type":"string"}},"required":["kind","expectedType","fieldId"]},{"type":"object","properties":{"kind":{"type":"string","const":"organization"},"expectedType":{"type":"string","const":"TEXT"},"attribute":{"type":"string","enum":["name","id"]}},"required":["kind","expectedType","attribute"]},{"type":"object","properties":{"kind":{"type":"string","const":"flow-metadata"},"expectedType":{"type":"string"},"attribute":{"type":"string","enum":["duedate","startdate","name","id"]}},"required":["kind","expectedType","attribute"]},{"type":"object","properties":{"kind":{"type":"string","const":"for-each-item"},"expectedType":{"type":"string"},"selector":{"type":"string","enum":["item","index","number","total"],"description":"What to read from the current pass of a loop. `item` reads a column of the current row; `index` (starting at 0), `number` (starting at 1) and `total` are the loop's counters."},"itemFieldId":{"type":"string","description":"The column's id, for `item`. Preferred over `itemField`, because it still works after the column is renamed."},"itemField":{"type":"string","description":"The column's label, for `item` when the list has no column ids. A label stops working when the column is renamed."}},"required":["kind","expectedType","selector"]},{"type":"object","properties":{"kind":{"type":"string","const":"for-each-aggregate"},"expectedType":{"type":"string"},"loopStepId":{"type":"string"},"bodyStepId":{"type":"string"},"field":{"type":"string"}},"required":["kind","expectedType","loopStepId","bodyStepId","field"]}]},{"type":"string"},{"type":"object","properties":{"kind":{"type":"string","const":"for-each-item"},"expectedType":{"type":"string"},"selector":{"type":"string","enum":["item","index","number","total"],"description":"What to read from the current pass of a loop. `item` reads a column of the current row; `index` (starting at 0), `number` (starting at 1) and `total` are the loop's counters."},"itemFieldId":{"description":"The column's id, for `item`. Preferred over `itemField`, because it still works after the column is renamed.","type":"string"},"itemField":{"description":"The column's label, for `item` when the list has no column ids. A label stops working when the column is renamed.","type":"string"}},"required":["kind","expectedType","selector"]}]},"StepConfig_DOCUMENT_REVIEW":{"type":"object","properties":{"document":{"type":"object","properties":{"ref":{"type":"string"}},"required":["ref"]},"preparers":{"anyOf":[{"type":"object","properties":{"participants":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["AI","HUMAN"]},"roleId":{"type":"string","description":"For a person: the role that takes this seat, by its id."},"contactId":{"type":"string","description":"An external user named on the seat, by the `usr_` id the template read shows. `null` follows the read, as for `userId`."},"userId":{"type":"string","description":"A person named on the seat, by the `usr_` id the template read shows. `null` where the read showed `null` (someone with no id here) keeps the saved person; `null` where it showed an id takes them off the seat."},"agentId":{"type":"string"},"prompt":{"type":"string","description":"The AI participant's step context: instructions for this step only."},"criteria":{"type":"string","description":"For an AI reviewer: what to check. Read before `prompt`."},"context":{"type":"string","description":"An older home of the AI participant's step context, still read. Set `prompt` instead."},"privateNotesGuidance":{"type":"string","maxLength":2000,"description":"When no agent is named: what the AI notes privately for the flow's managers."},"sendBackReply":{"type":"string","enum":["outcome_with_reason","outcome_only"],"description":"When the AI sends work back and no agent is named: what the reply says, `outcome_with_reason` or `outcome_only`."},"howToExplain":{"type":"string","maxLength":2000,"description":"When the AI sends work back and no agent is named: how it explains what to fix."},"inputs":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"value":{"type":"string"},"type":{"type":"string","enum":["TEXT","FILE"]}},"required":["name","value"]}},"participantId":{"type":"string","description":"The participant's id on the step. Keep it when sending the seat back; leave it out for a new participant."},"order":{"type":"number","description":"The participant's place in the seat, from 0, when they act one after another."},"aiConfig":{}},"required":["type"],"additionalProperties":{}}},"sequential":{"type":"boolean"},"completion":{"type":"object","properties":{"mode":{"type":"string","enum":["ANY_ONE","ALL"],"description":"`ANY_ONE`: one participant finishing is enough. `ALL`: every participant finishes."}},"required":["mode"],"description":"When the seat is done."},"showToExternalAssignee":{"description":"Advisors only. `true` lets an assignee outside your organization read the recommendation (the call and its reasons), as advice from your organization. Off unless set.","type":"boolean"},"canEditAnswers":{"description":"Reviewers only, on a Form, PDF form or File request step. `true` lets the reviewer whose turn it is edit the submitted answers (on a File request, add and remove its files) during review, in the Moxo app, instead of sending them back. Off unless set.","type":"boolean"},"reviewItemsTogether":{"description":"Reviewers only, on a person's step inside a For each whose items run at the same time. `true` gives the reviewer one list and one notice for every item instead of one review per item; each item keeps its own run and review. With the loop's `syncStepsAcrossIterations` on, the reviewer approves every item at once (`approve_reviews_together`); off, each item is approved on its own. Publish refuses it in a Repeat while, on an \"Approve before it runs\" step, with no person or role reviewing, and in a loop that runs items one at a time. Off unless set.","type":"boolean"}},"required":["participants"]},{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["AI","HUMAN"]},"roleId":{"type":"string"},"contactId":{"type":"string"},"userId":{"type":"string"},"agentId":{"type":"string"},"prompt":{"type":"string"},"criteria":{"type":"string"},"context":{"type":"string"},"privateNotesGuidance":{"type":"string","maxLength":2000},"sendBackReply":{"type":"string","enum":["outcome_with_reason","outcome_only"]},"howToExplain":{"type":"string","maxLength":2000},"inputs":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"value":{"type":"string"},"type":{"type":"string","enum":["TEXT","FILE"]}},"required":["name","value"]}},"ruleKinds":{"maxItems":80,"type":"array","items":{"type":"object","properties":{"rule":{"type":"string","minLength":1,"maxLength":2000},"kind":{"type":"string","enum":["fact","data_match","coverage","visual","judgment"]},"compare":{"type":"object","properties":{"check":{"type":"string","enum":["compare.money_equal","compare.date_after","compare.names_equal","certificate.insured_name_matches","certificate.limit_at_least","kyc.id_name_matches","kyc.birth_date_matches","kyc.dated_within_three_months"]},"against":{"type":"string","enum":["today","value","input"]},"value":{"type":"string","minLength":1,"maxLength":500},"input":{"type":"string","minLength":1,"maxLength":200}},"required":["check","against"]},"document":{"type":"string","minLength":1,"maxLength":200},"sum":{"type":"object","properties":{"fields":{"minItems":2,"maxItems":60,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}}},"required":["fields"]}},"required":["rule","kind"]}},"participantId":{"type":"string"},"order":{"type":"number"},"aiConfig":{}},"required":["type"],"additionalProperties":{}}}]},"visibleToAllAssignees":{"type":"boolean"},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"},"options":{"description":"Switches for the files attached to this step. A type takes only the ones its step settings show.","type":"object","properties":{"preventDownload":{"description":"Prevent download: people can open the files attached to this step to read them, but can't download them. Needs view-only attachments switched on for your organization.","type":"boolean"},"watermarkOnView":{"description":"Watermark: each person sees the PDFs attached to this step stamped with their name. Needs document watermarking switched on for your organization.","type":"boolean"}}}},"title":"Document Review","description":"Has reviewers mark up a document with pinned comments and highlighted areas, then produces a reviewed copy with all their feedback.\n\nThe settings a template read (`GET /v1/templates/{id}`) returns for this type, as stored. The shared settings (due date, reminders, visibility, monitors) can appear alongside them. To set them in a change, send `StepSettings_DOCUMENT_REVIEW`: where this shape holds an id, a change can name a role, field or step by its name or handle.\n\n**Offered by plan:** available when the organization's plan includes `documentReview`.","x-moxo-step-type":"DOCUMENT_REVIEW","x-moxo-category":"HUMAN_ACTION","x-moxo-plan-feature":"documentReview"},"StepConfig_DOCUMENT_COLLABORATION":{"type":"object","properties":{"collaboration":{"description":"How people work on the documents. Required when you add the step. When you change an existing step, send only the keys you change. A `sides` or `documents` list you send replaces the whole list, so list every side (keeping each id) and every document (with its starting text).","$ref":"#/components/schemas/StepConfig_DOCUMENT_COLLABORATION_collaboration"},"preparers":{"anyOf":[{"type":"object","properties":{"participants":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["AI","HUMAN"]},"roleId":{"type":"string","description":"For a person: the role that takes this seat, by its id."},"contactId":{"type":"string","description":"An external user named on the seat, by the `usr_` id the template read shows. `null` follows the read, as for `userId`."},"userId":{"type":"string","description":"A person named on the seat, by the `usr_` id the template read shows. `null` where the read showed `null` (someone with no id here) keeps the saved person; `null` where it showed an id takes them off the seat."},"agentId":{"type":"string"},"prompt":{"type":"string","description":"The AI participant's step context: instructions for this step only."},"criteria":{"type":"string","description":"For an AI reviewer: what to check. Read before `prompt`."},"context":{"type":"string","description":"An older home of the AI participant's step context, still read. Set `prompt` instead."},"privateNotesGuidance":{"type":"string","maxLength":2000,"description":"When no agent is named: what the AI notes privately for the flow's managers."},"sendBackReply":{"type":"string","enum":["outcome_with_reason","outcome_only"],"description":"When the AI sends work back and no agent is named: what the reply says, `outcome_with_reason` or `outcome_only`."},"howToExplain":{"type":"string","maxLength":2000,"description":"When the AI sends work back and no agent is named: how it explains what to fix."},"inputs":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"value":{"type":"string"},"type":{"type":"string","enum":["TEXT","FILE"]}},"required":["name","value"]}},"participantId":{"type":"string","description":"The participant's id on the step. Keep it when sending the seat back; leave it out for a new participant."},"order":{"type":"number","description":"The participant's place in the seat, from 0, when they act one after another."},"aiConfig":{}},"required":["type"],"additionalProperties":{}}},"sequential":{"type":"boolean"},"completion":{"type":"object","properties":{"mode":{"type":"string","enum":["ANY_ONE","ALL"],"description":"`ANY_ONE`: one participant finishing is enough. `ALL`: every participant finishes."}},"required":["mode"],"description":"When the seat is done."},"showToExternalAssignee":{"description":"Advisors only. `true` lets an assignee outside your organization read the recommendation (the call and its reasons), as advice from your organization. Off unless set.","type":"boolean"},"canEditAnswers":{"description":"Reviewers only, on a Form, PDF form or File request step. `true` lets the reviewer whose turn it is edit the submitted answers (on a File request, add and remove its files) during review, in the Moxo app, instead of sending them back. Off unless set.","type":"boolean"},"reviewItemsTogether":{"description":"Reviewers only, on a person's step inside a For each whose items run at the same time. `true` gives the reviewer one list and one notice for every item instead of one review per item; each item keeps its own run and review. With the loop's `syncStepsAcrossIterations` on, the reviewer approves every item at once (`approve_reviews_together`); off, each item is approved on its own. Publish refuses it in a Repeat while, on an \"Approve before it runs\" step, with no person or role reviewing, and in a loop that runs items one at a time. Off unless set.","type":"boolean"}},"required":["participants"]},{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["AI","HUMAN"]},"roleId":{"type":"string"},"contactId":{"type":"string"},"userId":{"type":"string"},"agentId":{"type":"string"},"prompt":{"type":"string"},"criteria":{"type":"string"},"context":{"type":"string"},"privateNotesGuidance":{"type":"string","maxLength":2000},"sendBackReply":{"type":"string","enum":["outcome_with_reason","outcome_only"]},"howToExplain":{"type":"string","maxLength":2000},"inputs":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"value":{"type":"string"},"type":{"type":"string","enum":["TEXT","FILE"]}},"required":["name","value"]}},"ruleKinds":{"maxItems":80,"type":"array","items":{"type":"object","properties":{"rule":{"type":"string","minLength":1,"maxLength":2000},"kind":{"type":"string","enum":["fact","data_match","coverage","visual","judgment"]},"compare":{"type":"object","properties":{"check":{"type":"string","enum":["compare.money_equal","compare.date_after","compare.names_equal","certificate.insured_name_matches","certificate.limit_at_least","kyc.id_name_matches","kyc.birth_date_matches","kyc.dated_within_three_months"]},"against":{"type":"string","enum":["today","value","input"]},"value":{"type":"string","minLength":1,"maxLength":500},"input":{"type":"string","minLength":1,"maxLength":200}},"required":["check","against"]},"document":{"type":"string","minLength":1,"maxLength":200},"sum":{"type":"object","properties":{"fields":{"minItems":2,"maxItems":60,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}}},"required":["fields"]}},"required":["rule","kind"]}},"participantId":{"type":"string"},"order":{"type":"number"},"aiConfig":{}},"required":["type"],"additionalProperties":{}}}]},"assist":{"type":"object","properties":{"enabled":{"type":"boolean","description":"Turns on Assignee Assist for this step. `true` opens a helper panel where the person working on the step can ask questions and, on a form, get help filling it in. `false`, or no `assist` object, leaves Assist off."},"agentId":{"type":"string"},"grantedPriorFields":{"maxItems":25,"type":"array","items":{"type":"string","minLength":1}},"whatToKnow":{"description":"Facts and contacts Assist may share with the person asked, such as office hours or who to call. Up to 4,000 characters.","type":"string","maxLength":4000},"answerStyle":{"description":"How Assist answers: tone, length and what to avoid. Ignored when `agentId` picks an agent. Up to 2,000 characters.","type":"string","maxLength":2000},"faqFiles":{"description":"Up to 5 file ids Assist reads and may quote from. The person asked can't see or open them.","maxItems":5,"type":"array","items":{"type":"string","minLength":1,"maxLength":128}},"summarizeQuestions":{"description":"`true` adds a summary of what people asked Assist to the managers' Private notes. It uses AI credits. Off when omitted.","type":"boolean"},"privateNotesGuidance":{"description":"What to include in the Private notes summary of people's questions. Used only when `summarizeQuestions` is `true`. Assist never reads it in chat. Up to 2,000 characters.","type":"string","maxLength":2000},"disclaimer":{"description":"The note shown under the Assist chat box. Assist never reads it. Leave it out to show the default note. Up to 300 characters.","type":"string","maxLength":300}},"required":["enabled"],"description":"Assist on this collaboration: whether the people working on it can ask the AI for help."},"visibleToAllAssignees":{"type":"boolean"},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"},"options":{"description":"Switches for the files attached to this step. A type takes only the ones its step settings show.","type":"object","properties":{"watermarkOnView":{"description":"Watermark: each person sees the PDFs attached to this step stamped with their name. Needs document watermarking switched on for your organization.","type":"boolean"}}}},"title":"Document Collaboration","description":"People work on a document, or a package of documents, in one of three modes. Edit together: the step's assignees write documents in Moxo together, live, optionally each owning a section, until everyone approves the same text. Take turns: two or more separate parties (sides), such as a firm and its client, pass edited versions back and forth, Word redlining included, until every side approves the same version. Comment only: the step's assignees read and comment without editing, each marks the documents reviewed, and the step ends with a reviewed copy carrying every comment.\n\nThe settings a template read (`GET /v1/templates/{id}`) returns for this type, as stored. The shared settings (due date, reminders, visibility, monitors) can appear alongside them. To set them in a change, send `StepSettings_DOCUMENT_COLLABORATION`: where this shape holds an id, a change can name a role, field or step by its name or handle.\n\n**Offered by plan:** available when the organization's plan includes `documentCollaborationStep`.","x-moxo-step-type":"DOCUMENT_COLLABORATION","x-moxo-category":"HUMAN_ACTION","x-moxo-plan-feature":"documentCollaborationStep"},"StepConfig_DOCUMENT_COLLABORATION_collaboration":{"oneOf":[{"type":"object","properties":{"mode":{"type":"string","const":"take_turns","description":"`take_turns`: the sides pass the documents back and forth until every side approves the same version."},"documents":{"minItems":1,"maxItems":10,"type":"array","items":{"$ref":"#/components/schemas/StepConfig_DOCUMENT_COLLABORATION_documentsItem"},"description":"The documents, agreed together as one package. 1 to 10."},"sides":{"minItems":2,"maxItems":6,"type":"array","items":{"$ref":"#/components/schemas/StepConfig_DOCUMENT_COLLABORATION_sidesItem"},"description":"The sides that take turns, in turn order, starting with the side that drafts version 1. 2 to 6, usually two: your organization and the other party. With two sides, the second side takes the first turn, on version 1 sent by the first; with three or more, the first side goes first. Each side is a separate party, or a team taking its own pass in a relay; people on one team are never split into sides."},"firstPass":{"type":"string","enum":["IN_ORDER","OPEN"],"description":"How the first round runs. Leave out for `IN_ORDER`: each side takes one pass, in side order, before approvals open (a relay such as legal, then finance, then the client). `OPEN`: any side may send first."},"firstTurnSideId":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,39}$","description":"The id of the side that goes first. Leave out for the default: the second side when there are two, otherwise the first. With two sides, list the side that drafts version 1 first: when the second side goes first, version 1 counts as sent by the first side; when the first side goes first, version 1 counts as sent by nobody. To have the first side approve version 1 before the other side sees it, use the step's preparation instead."},"versionOneFromSideId":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,39}$","description":"The id of the side version 1 counts as sent by (that side has approved it). Leave out with two sides taking turns in order: it follows from who goes first. With three or more sides, or an `OPEN` first round, set it only when that side drafted version 1. Must differ from the side that goes first."},"turnDueHours":{"type":"integer","minimum":1,"maximum":1440,"description":"Hours each side has for its turn, 1 to 1440, for example `72` for three days. Leave out for no time limit per turn."},"acceptEmailReplies":{"type":"boolean","description":"Whether people can reply to the turn email with their edited document instead of uploading it in Moxo. Defaults to off."},"insertFrom":{"description":"A column of a Data Table people insert from while editing. Leave it out when there is none.","type":"object","properties":{"tableId":{"type":"string","minLength":1,"maxLength":64,"description":"The id of the Data Table the choices come from."},"columnKey":{"type":"string","minLength":1,"maxLength":100,"description":"The key of the table's column whose values are the choices. Every row's value is offered, or only the rows `rowFilter` keeps."},"label":{"default":"","description":"What the choice is called where a person picks it. Empty: the column's name.","type":"string","maxLength":300},"rowFilter":{"maxItems":10,"type":"array","items":{"type":"object","properties":{"columnKey":{"type":"string","minLength":1,"maxLength":100,"description":"The key of the table's column the condition checks. It chooses rows only; people picking never see it."},"op":{"type":"string","enum":["is","is_not","contains","not_contains","is_empty","is_not_empty"],"description":"`is` / `is_not`: the whole cell is (is not) one of the values. `contains` / `not_contains`: the cell has (has none of) the values as a whole word or phrase. `is_empty` / `is_not_empty` take no values. Case is ignored."},"values":{"default":[],"description":"The values to compare with. The condition holds when the cell matches any of them (for `is_not` and `not_contains`: none of them). Leave it empty for `is_empty` and `is_not_empty`.","maxItems":20,"type":"array","items":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"text","description":"`text`: a value typed in the setup."},"text":{"type":"string","minLength":1,"maxLength":500,"description":"The text to compare with, as typed (case is ignored)."}},"required":["kind","text"]},{"type":"object","properties":{"kind":{"type":"string","const":"flow","description":"`flow`: a piece of the flow's data, read when the step runs."},"token":{"type":"string","minLength":3,"maxLength":500,"description":"A reference to the flow's data (for example `{Intake form / Centre}`), read when the step runs."}},"required":["kind","token"]}]}}},"required":["columnKey","op"]},"description":"Only rows where every condition holds are offered. Leave it out to offer every row. The columns it checks choose rows on the server and are never shown to the people picking."}},"required":["tableId","columnKey"]},"completion":{"anyOf":[{"type":"string","enum":["ONE","MAJORITY","ALL","SEQUENTIAL"]},{"type":"string","enum":["ONE","MAJORITY","ALL"]}],"description":"When the collaboration is done."},"sections":{"type":"object","properties":{"editorRoleIds":{"type":"array","items":{"anyOf":[{"type":"string","minLength":1},{"type":"string","minLength":1}]},"description":"The roles that may edit sections, by id."},"items":{"type":"array","items":{"type":"object","properties":{"sectionId":{"anyOf":[{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,39}$"},{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,39}$","description":"The section id of a heading in the first document's starting text (`## Pricing {#pricing}` has the id `pricing`)."}],"description":"The section's id."},"ownerRoleId":{"anyOf":[{"type":"string","minLength":1},{"type":"string","minLength":1,"description":"The role that writes this section; one of the step's assignees."}],"description":"The role that owns the section, by id."},"dueAfterDays":{"anyOf":[{"type":"integer","minimum":1,"maximum":90},{"type":"integer","minimum":1,"maximum":90}],"description":"How many days after the step starts the section is due."}},"required":["sectionId","ownerRoleId"]}},"hideOtherSections":{"anyOf":[{"type":"boolean"},{"type":"boolean"}],"description":"Whether each person sees only their own sections."}},"required":["editorRoleIds","items"],"description":"The document's sections, each with its owner."}},"required":["mode","documents","sides"]},{"type":"object","properties":{"mode":{"type":"string","const":"edit_together","description":"`edit_together`: the step's assignees write the Moxo documents together, live, then approve the same text."},"documents":{"minItems":1,"maxItems":10,"type":"array","items":{"$ref":"#/components/schemas/StepConfig_DOCUMENT_COLLABORATION_documentsItem"},"description":"The Moxo documents, each with `moxo`. 1 to 10. Files can't be edited together."},"completion":{"type":"string","enum":["ONE","MAJORITY","ALL","SEQUENTIAL"],"description":"When the step is done. Leave out for `ALL`: everyone approves the same text. `ONE`: anyone. `MAJORITY`: more than half."},"sections":{"type":"object","properties":{"editorRoleIds":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"string","minLength":1},"description":"Roles that can edit every section and ask for approval when the sections are done. 1 to 10."},"items":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"object","properties":{"sectionId":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,39}$","description":"The section id of a heading in the first document's starting text (`## Pricing {#pricing}` has the id `pricing`)."},"ownerRoleId":{"type":"string","minLength":1,"description":"The role that writes this section; one of the step's assignees."},"dueAfterDays":{"type":"integer","minimum":1,"maximum":90,"description":"When the section is due, in days after the step starts."}},"required":["sectionId","ownerRoleId"]}},"hideOtherSections":{"type":"boolean","description":"When `true`, people read only the start and their own sections until the editor asks for approval."}},"required":["editorRoleIds","items"],"description":"The sections, when each person or team writes their own part, such as each department writing its section."},"sides":{"type":"array","items":{"type":"object","properties":{"id":{"anyOf":[{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,39}$"},{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,39}$","description":"A short id for the side, unique in the step (for example `firm` or `client`)."}]},"name":{"anyOf":[{"type":"string","minLength":1,"maxLength":60},{"type":"string","minLength":1,"maxLength":60,"description":"The side's name as people see it, for example `Our team` or `Client`. Up to 60 characters."}]},"roleIds":{"type":"array","items":{"anyOf":[{"type":"string","minLength":1},{"type":"string","minLength":1}]}},"readyToSend":{"anyOf":[{"type":"string","enum":["ANY_ONE","ALL","IN_ORDER"]},{"type":"string","enum":["ANY_ONE","ALL","IN_ORDER"]}]}},"required":["id","name","roleIds"]}},"firstPass":{"anyOf":[{"type":"string","enum":["IN_ORDER","OPEN"]},{"type":"string","enum":["IN_ORDER","OPEN"]}]},"firstTurnSideId":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,39}$"},"versionOneFromSideId":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,39}$"},"turnDueHours":{"anyOf":[{"type":"integer","minimum":1,"maximum":1440},{"type":"integer","minimum":1,"maximum":1440}]},"acceptEmailReplies":{"anyOf":[{"type":"boolean"},{"type":"boolean"}]},"insertFrom":{"description":"A column of a Data Table people insert from while editing. Leave it out when there is none.","type":"object","properties":{"tableId":{"type":"string","minLength":1,"maxLength":64,"description":"The id of the Data Table the choices come from."},"columnKey":{"type":"string","minLength":1,"maxLength":100,"description":"The key of the table's column whose values are the choices. Every row's value is offered, or only the rows `rowFilter` keeps."},"label":{"default":"","description":"What the choice is called where a person picks it. Empty: the column's name.","type":"string","maxLength":300},"rowFilter":{"maxItems":10,"type":"array","items":{"type":"object","properties":{"columnKey":{"type":"string","minLength":1,"maxLength":100,"description":"The key of the table's column the condition checks. It chooses rows only; people picking never see it."},"op":{"type":"string","enum":["is","is_not","contains","not_contains","is_empty","is_not_empty"],"description":"`is` / `is_not`: the whole cell is (is not) one of the values. `contains` / `not_contains`: the cell has (has none of) the values as a whole word or phrase. `is_empty` / `is_not_empty` take no values. Case is ignored."},"values":{"default":[],"description":"The values to compare with. The condition holds when the cell matches any of them (for `is_not` and `not_contains`: none of them). Leave it empty for `is_empty` and `is_not_empty`.","maxItems":20,"type":"array","items":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"text","description":"`text`: a value typed in the setup."},"text":{"type":"string","minLength":1,"maxLength":500,"description":"The text to compare with, as typed (case is ignored)."}},"required":["kind","text"]},{"type":"object","properties":{"kind":{"type":"string","const":"flow","description":"`flow`: a piece of the flow's data, read when the step runs."},"token":{"type":"string","minLength":3,"maxLength":500,"description":"A reference to the flow's data (for example `{Intake form / Centre}`), read when the step runs."}},"required":["kind","token"]}]}}},"required":["columnKey","op"]},"description":"Only rows where every condition holds are offered. Leave it out to offer every row. The columns it checks choose rows on the server and are never shown to the people picking."}},"required":["tableId","columnKey"]}},"required":["mode","documents"]},{"type":"object","properties":{"mode":{"type":"string","const":"comment_only","description":"`comment_only`: the step's assignees review the documents and comment on them; nobody edits. Each marks them reviewed, and the step ends with a reviewed copy carrying every comment."},"documents":{"minItems":1,"maxItems":10,"type":"array","items":{"$ref":"#/components/schemas/StepConfig_DOCUMENT_COLLABORATION_documentsItem"},"description":"The documents to review, 1 to 10: files of any accepted kind (Word, PDF, images, PowerPoint, Excel) or Moxo documents."},"completion":{"type":"string","enum":["ONE","MAJORITY","ALL","SEQUENTIAL"],"description":"When the step is done. Leave out for `ALL`: everyone reviews. `ONE`: anyone. `MAJORITY`: more than half. `SEQUENTIAL`: one at a time, in the order of the step's assignees, such as the client first, then Legal."},"sides":{"type":"array","items":{"type":"object","properties":{"id":{"anyOf":[{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,39}$"},{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,39}$","description":"A short id for the side, unique in the step (for example `firm` or `client`)."}]},"name":{"anyOf":[{"type":"string","minLength":1,"maxLength":60},{"type":"string","minLength":1,"maxLength":60,"description":"The side's name as people see it, for example `Our team` or `Client`. Up to 60 characters."}]},"roleIds":{"type":"array","items":{"anyOf":[{"type":"string","minLength":1},{"type":"string","minLength":1}]}},"readyToSend":{"anyOf":[{"type":"string","enum":["ANY_ONE","ALL","IN_ORDER"]},{"type":"string","enum":["ANY_ONE","ALL","IN_ORDER"]}]}},"required":["id","name","roleIds"]}},"firstPass":{"anyOf":[{"type":"string","enum":["IN_ORDER","OPEN"]},{"type":"string","enum":["IN_ORDER","OPEN"]}]},"firstTurnSideId":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,39}$"},"versionOneFromSideId":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,39}$"},"turnDueHours":{"anyOf":[{"type":"integer","minimum":1,"maximum":1440},{"type":"integer","minimum":1,"maximum":1440}]},"acceptEmailReplies":{"anyOf":[{"type":"boolean"},{"type":"boolean"}]},"insertFrom":{"description":"A column of a Data Table people insert from while editing. Leave it out when there is none.","type":"object","properties":{"tableId":{"type":"string","minLength":1,"maxLength":64,"description":"The id of the Data Table the choices come from."},"columnKey":{"type":"string","minLength":1,"maxLength":100,"description":"The key of the table's column whose values are the choices. Every row's value is offered, or only the rows `rowFilter` keeps."},"label":{"default":"","description":"What the choice is called where a person picks it. Empty: the column's name.","type":"string","maxLength":300},"rowFilter":{"maxItems":10,"type":"array","items":{"type":"object","properties":{"columnKey":{"type":"string","minLength":1,"maxLength":100,"description":"The key of the table's column the condition checks. It chooses rows only; people picking never see it."},"op":{"type":"string","enum":["is","is_not","contains","not_contains","is_empty","is_not_empty"],"description":"`is` / `is_not`: the whole cell is (is not) one of the values. `contains` / `not_contains`: the cell has (has none of) the values as a whole word or phrase. `is_empty` / `is_not_empty` take no values. Case is ignored."},"values":{"default":[],"description":"The values to compare with. The condition holds when the cell matches any of them (for `is_not` and `not_contains`: none of them). Leave it empty for `is_empty` and `is_not_empty`.","maxItems":20,"type":"array","items":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"text","description":"`text`: a value typed in the setup."},"text":{"type":"string","minLength":1,"maxLength":500,"description":"The text to compare with, as typed (case is ignored)."}},"required":["kind","text"]},{"type":"object","properties":{"kind":{"type":"string","const":"flow","description":"`flow`: a piece of the flow's data, read when the step runs."},"token":{"type":"string","minLength":3,"maxLength":500,"description":"A reference to the flow's data (for example `{Intake form / Centre}`), read when the step runs."}},"required":["kind","token"]}]}}},"required":["columnKey","op"]},"description":"Only rows where every condition holds are offered. Leave it out to offer every row. The columns it checks choose rows on the server and are never shown to the people picking."}},"required":["tableId","columnKey"]},"sections":{"type":"object","properties":{"editorRoleIds":{"type":"array","items":{"anyOf":[{"type":"string","minLength":1},{"type":"string","minLength":1}]},"description":"The roles that may edit sections, by id."},"items":{"type":"array","items":{"type":"object","properties":{"sectionId":{"anyOf":[{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,39}$"},{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,39}$","description":"The section id of a heading in the first document's starting text (`## Pricing {#pricing}` has the id `pricing`)."}],"description":"The section's id."},"ownerRoleId":{"anyOf":[{"type":"string","minLength":1},{"type":"string","minLength":1,"description":"The role that writes this section; one of the step's assignees."}],"description":"The role that owns the section, by id."},"dueAfterDays":{"anyOf":[{"type":"integer","minimum":1,"maximum":90},{"type":"integer","minimum":1,"maximum":90}],"description":"How many days after the step starts the section is due."}},"required":["sectionId","ownerRoleId"]}},"hideOtherSections":{"anyOf":[{"type":"boolean"},{"type":"boolean"}],"description":"Whether each person sees only their own sections."}},"required":["editorRoleIds","items"],"description":"The document's sections, each with its owner."}},"required":["mode","documents"]}]},"StepConfig_DOCUMENT_COLLABORATION_documentsItem":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,39}$","description":"A short id for the document, unique in the step: lowercase letters, digits, `-` or `_` (for example `sow` or `msa`)."},"name":{"type":"string","minLength":1,"maxLength":120,"description":"The document's name as people see it, for example `Statement of work`."},"ref":{"type":"string","description":"A file document's starting file: a reference to an earlier step's file output, for example `${{ steps.upload_draft_sow.fields.uploaded_files }}`. Leave out for a Moxo document, or when a person preparing the step (`preparers.participants: [{ type: \"HUMAN\", roleId }]`) uploads it when the flow runs. An AI preparer can't provide a file."},"moxo":{"type":"object","properties":{"markdown":{"type":"string","maxLength":100000,"description":"The starting text, in Markdown: `#` to `###` headings, paragraphs, `-`, `1.` and `- [ ]` lists, bold, italic, links, and flow data as `${{ steps.<step>.fields.<field> }}`. A heading can name its section id: `## Pricing {#pricing}`."},"seed":{"type":"object","properties":{"type":{"type":"string","const":"doc"},"content":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}}},"required":["type","content"],"additionalProperties":{}}},"description":"Set for a Moxo document, written in Moxo rather than uploaded as a file. Not together with `ref`."},"fill":{"description":"For a Word template uploaded to this step only: fills its `{{placeholders}}` from flow data when the step starts.","$ref":"#/components/schemas/StepConfig_DOCUMENT_COLLABORATION_fill"},"fileName":{"type":"string","maxLength":500,"description":"The uploaded document's name, as shown on the step."},"sheetDropdowns":{"description":"Only on an uploaded Excel file: dropdowns whose choices come from a column of a Data Table, by key (dd_ and a short id). The list goes into the workbook as an Excel list, so it works in Excel and in Moxo.","type":"object","propertyNames":{"type":"string","pattern":"^dd_[a-z0-9]{6,32}$"},"additionalProperties":{"type":"object","properties":{"tableId":{"type":"string","minLength":1,"maxLength":64,"description":"The id of the Data Table the choices come from."},"columnKey":{"type":"string","minLength":1,"maxLength":100,"description":"The key of the table's column whose values are the choices. Every row's value is offered, or only the rows `rowFilter` keeps."},"label":{"default":"","description":"What the choice is called where a person picks it. Empty: the column's name.","type":"string","maxLength":300},"rowFilter":{"maxItems":10,"type":"array","items":{"type":"object","properties":{"columnKey":{"type":"string","minLength":1,"maxLength":100,"description":"The key of the table's column the condition checks. It chooses rows only; people picking never see it."},"op":{"type":"string","enum":["is","is_not","contains","not_contains","is_empty","is_not_empty"],"description":"`is` / `is_not`: the whole cell is (is not) one of the values. `contains` / `not_contains`: the cell has (has none of) the values as a whole word or phrase. `is_empty` / `is_not_empty` take no values. Case is ignored."},"values":{"default":[],"description":"The values to compare with. The condition holds when the cell matches any of them (for `is_not` and `not_contains`: none of them). Leave it empty for `is_empty` and `is_not_empty`.","maxItems":20,"type":"array","items":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"text","description":"`text`: a value typed in the setup."},"text":{"type":"string","minLength":1,"maxLength":500,"description":"The text to compare with, as typed (case is ignored)."}},"required":["kind","text"]},{"type":"object","properties":{"kind":{"type":"string","const":"flow","description":"`flow`: a piece of the flow's data, read when the step runs."},"token":{"type":"string","minLength":3,"maxLength":500,"description":"A reference to the flow's data (for example `{Intake form / Centre}`), read when the step runs."}},"required":["kind","token"]}]}}},"required":["columnKey","op"]},"description":"Only rows where every condition holds are offered. Leave it out to offer every row. The columns it checks choose rows on the server and are never shown to the people picking."},"sheet":{"type":"string","minLength":1,"maxLength":100,"description":"The name of the worksheet the dropdown is on."},"range":{"type":"string","minLength":1,"maxLength":40,"description":"The cells that get the dropdown, as an Excel range (for example C6:C10)."},"strict":{"default":true,"description":"true: a cell takes only one of the choices. false: other text is allowed too, with a warning.","type":"boolean"}},"required":["tableId","columnKey","sheet","range"]}}},"required":["key"]},"StepConfig_DOCUMENT_COLLABORATION_sidesItem":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,39}$","description":"A short id for the side, unique in the step (for example `firm` or `client`)."},"name":{"type":"string","minLength":1,"maxLength":60,"description":"The side's name as people see it, for example `Our team` or `Client`. Up to 60 characters."},"roleIds":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"string","minLength":1},"description":"The roles on this side (role handles or names from the template's roles), 1 to 10. A role is on exactly one side, and the step's `assignees` lists exactly the roles of every side, in side order."},"readyToSend":{"type":"string","enum":["ANY_ONE","ALL","IN_ORDER"],"description":"Who can act for the side. Leave out for `ANY_ONE`: anyone on the side can send or approve for it. `ALL`: everyone on the side must approve before it goes back. `IN_ORDER`: the side's people go one after another."}},"required":["id","name","roleIds"]},"StepConfig_DOCUMENT_COLLABORATION_fill":{"type":"object","properties":{"slots":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"},"description":"Every `{{placeholder}}` in the uploaded Word template, each mapped to a reference to the flow data that fills it (`\"\"` when nothing fits yet)."},"slotTables":{"description":"Placeholders the person preparing version 1 picks from a column of a Data Table, by placeholder name, instead of from flow data.","type":"object","propertyNames":{"type":"string","pattern":"^[A-Za-z_][A-Za-z0-9_]{0,79}$"},"additionalProperties":{"type":"object","properties":{"tableId":{"type":"string","minLength":1,"maxLength":64,"description":"The id of the Data Table the choices come from."},"columnKey":{"type":"string","minLength":1,"maxLength":100,"description":"The key of the table's column whose values are the choices. Every row's value is offered, or only the rows `rowFilter` keeps."},"label":{"default":"","description":"What the choice is called where a person picks it. Empty: the column's name.","type":"string","maxLength":300},"rowFilter":{"maxItems":10,"type":"array","items":{"type":"object","properties":{"columnKey":{"type":"string","minLength":1,"maxLength":100,"description":"The key of the table's column the condition checks. It chooses rows only; people picking never see it."},"op":{"type":"string","enum":["is","is_not","contains","not_contains","is_empty","is_not_empty"],"description":"`is` / `is_not`: the whole cell is (is not) one of the values. `contains` / `not_contains`: the cell has (has none of) the values as a whole word or phrase. `is_empty` / `is_not_empty` take no values. Case is ignored."},"values":{"default":[],"description":"The values to compare with. The condition holds when the cell matches any of them (for `is_not` and `not_contains`: none of them). Leave it empty for `is_empty` and `is_not_empty`.","maxItems":20,"type":"array","items":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"text","description":"`text`: a value typed in the setup."},"text":{"type":"string","minLength":1,"maxLength":500,"description":"The text to compare with, as typed (case is ignored)."}},"required":["kind","text"]},{"type":"object","properties":{"kind":{"type":"string","const":"flow","description":"`flow`: a piece of the flow's data, read when the step runs."},"token":{"type":"string","minLength":3,"maxLength":500,"description":"A reference to the flow's data (for example `{Intake form / Centre}`), read when the step runs."}},"required":["kind","token"]}]}}},"required":["columnKey","op"]},"description":"Only rows where every condition holds are offered. Leave it out to offer every row. The columns it checks choose rows on the server and are never shown to the people picking."}},"required":["tableId","columnKey"]}},"dropdowns":{"description":"The Word template's drop-down controls (tagged moxo:<key>), each to the Data Table column its choices come from.","type":"object","propertyNames":{"type":"string","pattern":"^dd_[a-z0-9]{6,32}$"},"additionalProperties":{"type":"object","properties":{"tableId":{"type":"string","minLength":1,"maxLength":64,"description":"The id of the Data Table the choices come from."},"columnKey":{"type":"string","minLength":1,"maxLength":100,"description":"The key of the table's column whose values are the choices. Every row's value is offered, or only the rows `rowFilter` keeps."},"label":{"default":"","description":"What the choice is called where a person picks it. Empty: the column's name.","type":"string","maxLength":300},"rowFilter":{"maxItems":10,"type":"array","items":{"type":"object","properties":{"columnKey":{"type":"string","minLength":1,"maxLength":100,"description":"The key of the table's column the condition checks. It chooses rows only; people picking never see it."},"op":{"type":"string","enum":["is","is_not","contains","not_contains","is_empty","is_not_empty"],"description":"`is` / `is_not`: the whole cell is (is not) one of the values. `contains` / `not_contains`: the cell has (has none of) the values as a whole word or phrase. `is_empty` / `is_not_empty` take no values. Case is ignored."},"values":{"default":[],"description":"The values to compare with. The condition holds when the cell matches any of them (for `is_not` and `not_contains`: none of them). Leave it empty for `is_empty` and `is_not_empty`.","maxItems":20,"type":"array","items":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"text","description":"`text`: a value typed in the setup."},"text":{"type":"string","minLength":1,"maxLength":500,"description":"The text to compare with, as typed (case is ignored)."}},"required":["kind","text"]},{"type":"object","properties":{"kind":{"type":"string","const":"flow","description":"`flow`: a piece of the flow's data, read when the step runs."},"token":{"type":"string","minLength":3,"maxLength":500,"description":"A reference to the flow's data (for example `{Intake form / Centre}`), read when the step runs."}},"required":["kind","token"]}]}}},"required":["columnKey","op"]},"description":"Only rows where every condition holds are offered. Leave it out to offer every row. The columns it checks choose rows on the server and are never shown to the people picking."}},"required":["tableId","columnKey"]}}},"required":["slots"]},"StepConfig_PREPARE_DOCUMENT_BY_PERSON":{"type":"object","properties":{"prepareDocument":{"type":"object","properties":{"wordTemplate":{"type":"object","properties":{"ref":{"type":"string","description":"The `fileId` of the Word file (.docx) uploaded to the step. Set when the file is uploaded."},"fileName":{"type":"string","description":"The Word file's name, as it was uploaded."},"fill":{"type":"object","properties":{"slots":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"},"description":"Each `{{placeholder}}` in the Word file, by name, with the reference to the value that fills it, for example `${{ steps.intake_form.fields.client_name }}`. An empty string leaves it unfilled."}},"required":["slots"],"description":"How the file's placeholders are filled: `slots` maps each `{{placeholder}}` name to the reference that fills it, or `\"\"` for one nobody maps."}},"required":["fill"],"description":"The Word template (.docx) the assignee edits once it is filled. Set when the Word file is uploaded to the step; leave it out when you create the step."},"fileName":{"type":"string","description":"The name of the generated files, without extension, for example `Area Development Agreement`."}},"description":"The prepare-document settings: the Word template filled with values from the flow when the step starts, which the assignee edits and submits. Its outputs are the prepared document as a PDF and as a Word file."},"preparers":{"anyOf":[{"type":"object","properties":{"participants":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["AI","HUMAN"]},"roleId":{"type":"string","description":"For a person: the role that takes this seat, by its id."},"contactId":{"type":"string","description":"An external user named on the seat, by the `usr_` id the template read shows. `null` follows the read, as for `userId`."},"userId":{"type":"string","description":"A person named on the seat, by the `usr_` id the template read shows. `null` where the read showed `null` (someone with no id here) keeps the saved person; `null` where it showed an id takes them off the seat."},"agentId":{"type":"string"},"prompt":{"type":"string","description":"The AI participant's step context: instructions for this step only."},"criteria":{"type":"string","description":"For an AI reviewer: what to check. Read before `prompt`."},"context":{"type":"string","description":"An older home of the AI participant's step context, still read. Set `prompt` instead."},"privateNotesGuidance":{"type":"string","maxLength":2000,"description":"When no agent is named: what the AI notes privately for the flow's managers."},"sendBackReply":{"type":"string","enum":["outcome_with_reason","outcome_only"],"description":"When the AI sends work back and no agent is named: what the reply says, `outcome_with_reason` or `outcome_only`."},"howToExplain":{"type":"string","maxLength":2000,"description":"When the AI sends work back and no agent is named: how it explains what to fix."},"inputs":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"value":{"type":"string"},"type":{"type":"string","enum":["TEXT","FILE"]}},"required":["name","value"]}},"participantId":{"type":"string","description":"The participant's id on the step. Keep it when sending the seat back; leave it out for a new participant."},"order":{"type":"number","description":"The participant's place in the seat, from 0, when they act one after another."},"aiConfig":{}},"required":["type"],"additionalProperties":{}}},"sequential":{"type":"boolean"},"completion":{"type":"object","properties":{"mode":{"type":"string","enum":["ANY_ONE","ALL"],"description":"`ANY_ONE`: one participant finishing is enough. `ALL`: every participant finishes."}},"required":["mode"],"description":"When the seat is done."},"showToExternalAssignee":{"description":"Advisors only. `true` lets an assignee outside your organization read the recommendation (the call and its reasons), as advice from your organization. Off unless set.","type":"boolean"},"canEditAnswers":{"description":"Reviewers only, on a Form, PDF form or File request step. `true` lets the reviewer whose turn it is edit the submitted answers (on a File request, add and remove its files) during review, in the Moxo app, instead of sending them back. Off unless set.","type":"boolean"},"reviewItemsTogether":{"description":"Reviewers only, on a person's step inside a For each whose items run at the same time. `true` gives the reviewer one list and one notice for every item instead of one review per item; each item keeps its own run and review. With the loop's `syncStepsAcrossIterations` on, the reviewer approves every item at once (`approve_reviews_together`); off, each item is approved on its own. Publish refuses it in a Repeat while, on an \"Approve before it runs\" step, with no person or role reviewing, and in a loop that runs items one at a time. Off unless set.","type":"boolean"}},"required":["participants"]},{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["AI","HUMAN"]},"roleId":{"type":"string"},"contactId":{"type":"string"},"userId":{"type":"string"},"agentId":{"type":"string"},"prompt":{"type":"string"},"criteria":{"type":"string"},"context":{"type":"string"},"privateNotesGuidance":{"type":"string","maxLength":2000},"sendBackReply":{"type":"string","enum":["outcome_with_reason","outcome_only"]},"howToExplain":{"type":"string","maxLength":2000},"inputs":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"value":{"type":"string"},"type":{"type":"string","enum":["TEXT","FILE"]}},"required":["name","value"]}},"ruleKinds":{"maxItems":80,"type":"array","items":{"type":"object","properties":{"rule":{"type":"string","minLength":1,"maxLength":2000},"kind":{"type":"string","enum":["fact","data_match","coverage","visual","judgment"]},"compare":{"type":"object","properties":{"check":{"type":"string","enum":["compare.money_equal","compare.date_after","compare.names_equal","certificate.insured_name_matches","certificate.limit_at_least","kyc.id_name_matches","kyc.birth_date_matches","kyc.dated_within_three_months"]},"against":{"type":"string","enum":["today","value","input"]},"value":{"type":"string","minLength":1,"maxLength":500},"input":{"type":"string","minLength":1,"maxLength":200}},"required":["check","against"]},"document":{"type":"string","minLength":1,"maxLength":200},"sum":{"type":"object","properties":{"fields":{"minItems":2,"maxItems":60,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}}},"required":["fields"]}},"required":["rule","kind"]}},"participantId":{"type":"string"},"order":{"type":"number"},"aiConfig":{}},"required":["type"],"additionalProperties":{}}}]},"advisors":{"anyOf":[{"type":"object","properties":{"participants":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["AI","HUMAN"]},"roleId":{"type":"string","description":"For a person: the role that takes this seat, by its id."},"contactId":{"type":"string","description":"An external user named on the seat, by the `usr_` id the template read shows. `null` follows the read, as for `userId`."},"userId":{"type":"string","description":"A person named on the seat, by the `usr_` id the template read shows. `null` where the read showed `null` (someone with no id here) keeps the saved person; `null` where it showed an id takes them off the seat."},"agentId":{"type":"string"},"prompt":{"type":"string","description":"The AI participant's step context: instructions for this step only."},"criteria":{"type":"string","description":"For an AI reviewer: what to check. Read before `prompt`."},"context":{"type":"string","description":"An older home of the AI participant's step context, still read. Set `prompt` instead."},"privateNotesGuidance":{"type":"string","maxLength":2000,"description":"When no agent is named: what the AI notes privately for the flow's managers."},"sendBackReply":{"type":"string","enum":["outcome_with_reason","outcome_only"],"description":"When the AI sends work back and no agent is named: what the reply says, `outcome_with_reason` or `outcome_only`."},"howToExplain":{"type":"string","maxLength":2000,"description":"When the AI sends work back and no agent is named: how it explains what to fix."},"inputs":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"value":{"type":"string"},"type":{"type":"string","enum":["TEXT","FILE"]}},"required":["name","value"]}},"participantId":{"type":"string","description":"The participant's id on the step. Keep it when sending the seat back; leave it out for a new participant."},"order":{"type":"number","description":"The participant's place in the seat, from 0, when they act one after another."},"aiConfig":{}},"required":["type"],"additionalProperties":{}}},"sequential":{"anyOf":[{"type":"boolean"},{"type":"boolean"}]},"completion":{"type":"object","properties":{"mode":{"type":"string","enum":["ANY_ONE","ALL"],"description":"`ANY_ONE`: one participant finishing is enough. `ALL`: every participant finishes."}},"required":["mode"],"description":"When the seat is done."},"showToExternalAssignee":{"anyOf":[{"type":"boolean"},{"type":"boolean"}],"description":"Advisors only. `true`: an assignee outside your organization may read the recommendation, as advice from your organization."},"canEditAnswers":{"description":"Reviewers only, on a Form, PDF form or File request step. `true` lets the reviewer whose turn it is edit the submitted answers (on a File request, add and remove its files) during review, in the Moxo app, instead of sending them back. Off unless set.","type":"boolean"},"reviewItemsTogether":{"description":"Reviewers only, on a person's step inside a For each whose items run at the same time. `true` gives the reviewer one list and one notice for every item instead of one review per item; each item keeps its own run and review. With the loop's `syncStepsAcrossIterations` on, the reviewer approves every item at once (`approve_reviews_together`); off, each item is approved on its own. Publish refuses it in a Repeat while, on an \"Approve before it runs\" step, with no person or role reviewing, and in a loop that runs items one at a time. Off unless set.","type":"boolean"}},"required":["participants"]},{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["AI","HUMAN"]},"roleId":{"type":"string"},"contactId":{"type":"string"},"userId":{"type":"string"},"agentId":{"type":"string"},"prompt":{"type":"string"},"criteria":{"type":"string"},"context":{"type":"string"},"privateNotesGuidance":{"type":"string","maxLength":2000},"sendBackReply":{"type":"string","enum":["outcome_with_reason","outcome_only"]},"howToExplain":{"type":"string","maxLength":2000},"inputs":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"value":{"type":"string"},"type":{"type":"string","enum":["TEXT","FILE"]}},"required":["name","value"]}},"ruleKinds":{"maxItems":80,"type":"array","items":{"type":"object","properties":{"rule":{"type":"string","minLength":1,"maxLength":2000},"kind":{"type":"string","enum":["fact","data_match","coverage","visual","judgment"]},"compare":{"type":"object","properties":{"check":{"type":"string","enum":["compare.money_equal","compare.date_after","compare.names_equal","certificate.insured_name_matches","certificate.limit_at_least","kyc.id_name_matches","kyc.birth_date_matches","kyc.dated_within_three_months"]},"against":{"type":"string","enum":["today","value","input"]},"value":{"type":"string","minLength":1,"maxLength":500},"input":{"type":"string","minLength":1,"maxLength":200}},"required":["check","against"]},"document":{"type":"string","minLength":1,"maxLength":200},"sum":{"type":"object","properties":{"fields":{"minItems":2,"maxItems":60,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}}},"required":["fields"]}},"required":["rule","kind"]}},"participantId":{"type":"string"},"order":{"type":"number"},"aiConfig":{}},"required":["type"],"additionalProperties":{}}}]},"reviewers":{"anyOf":[{"type":"object","properties":{"participants":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["AI","HUMAN"]},"roleId":{"type":"string","description":"For a person: the role that takes this seat, by its id."},"contactId":{"type":"string","description":"An external user named on the seat, by the `usr_` id the template read shows. `null` follows the read, as for `userId`."},"userId":{"type":"string","description":"A person named on the seat, by the `usr_` id the template read shows. `null` where the read showed `null` (someone with no id here) keeps the saved person; `null` where it showed an id takes them off the seat."},"agentId":{"type":"string"},"prompt":{"type":"string","description":"The AI participant's step context: instructions for this step only."},"criteria":{"type":"string","description":"For an AI reviewer: what to check. Read before `prompt`."},"context":{"type":"string","description":"An older home of the AI participant's step context, still read. Set `prompt` instead."},"privateNotesGuidance":{"type":"string","maxLength":2000,"description":"When no agent is named: what the AI notes privately for the flow's managers."},"sendBackReply":{"type":"string","enum":["outcome_with_reason","outcome_only"],"description":"When the AI sends work back and no agent is named: what the reply says, `outcome_with_reason` or `outcome_only`."},"howToExplain":{"type":"string","maxLength":2000,"description":"When the AI sends work back and no agent is named: how it explains what to fix."},"inputs":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"value":{"type":"string"},"type":{"type":"string","enum":["TEXT","FILE"]}},"required":["name","value"]}},"participantId":{"type":"string","description":"The participant's id on the step. Keep it when sending the seat back; leave it out for a new participant."},"order":{"type":"number","description":"The participant's place in the seat, from 0, when they act one after another."},"aiConfig":{}},"required":["type"],"additionalProperties":{}}},"sequential":{"type":"boolean"},"completion":{"type":"object","properties":{"mode":{"type":"string","enum":["ANY_ONE","ALL"],"description":"`ANY_ONE`: one participant finishing is enough. `ALL`: every participant finishes."}},"required":["mode"],"description":"When the seat is done."},"showToExternalAssignee":{"description":"Advisors only. `true` lets an assignee outside your organization read the recommendation (the call and its reasons), as advice from your organization. Off unless set.","type":"boolean"},"canEditAnswers":{"description":"Reviewers only, on a Form, PDF form or File request step. `true` lets the reviewer whose turn it is edit the submitted answers (on a File request, add and remove its files) during review, in the Moxo app, instead of sending them back. Off unless set.","type":"boolean"},"reviewItemsTogether":{"description":"Reviewers only, on a person's step inside a For each whose items run at the same time. `true` gives the reviewer one list and one notice for every item instead of one review per item; each item keeps its own run and review. With the loop's `syncStepsAcrossIterations` on, the reviewer approves every item at once (`approve_reviews_together`); off, each item is approved on its own. Publish refuses it in a Repeat while, on an \"Approve before it runs\" step, with no person or role reviewing, and in a loop that runs items one at a time. Off unless set.","type":"boolean"}},"required":["participants"]},{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["AI","HUMAN"]},"roleId":{"type":"string"},"contactId":{"type":"string"},"userId":{"type":"string"},"agentId":{"type":"string"},"prompt":{"type":"string"},"criteria":{"type":"string"},"context":{"type":"string"},"privateNotesGuidance":{"type":"string","maxLength":2000},"sendBackReply":{"type":"string","enum":["outcome_with_reason","outcome_only"]},"howToExplain":{"type":"string","maxLength":2000},"inputs":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"value":{"type":"string"},"type":{"type":"string","enum":["TEXT","FILE"]}},"required":["name","value"]}},"ruleKinds":{"maxItems":80,"type":"array","items":{"type":"object","properties":{"rule":{"type":"string","minLength":1,"maxLength":2000},"kind":{"type":"string","enum":["fact","data_match","coverage","visual","judgment"]},"compare":{"type":"object","properties":{"check":{"type":"string","enum":["compare.money_equal","compare.date_after","compare.names_equal","certificate.insured_name_matches","certificate.limit_at_least","kyc.id_name_matches","kyc.birth_date_matches","kyc.dated_within_three_months"]},"against":{"type":"string","enum":["today","value","input"]},"value":{"type":"string","minLength":1,"maxLength":500},"input":{"type":"string","minLength":1,"maxLength":200}},"required":["check","against"]},"document":{"type":"string","minLength":1,"maxLength":200},"sum":{"type":"object","properties":{"fields":{"minItems":2,"maxItems":60,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}}},"required":["fields"]}},"required":["rule","kind"]}},"participantId":{"type":"string"},"order":{"type":"number"},"aiConfig":{}},"required":["type"],"additionalProperties":{}}}]},"aiEscalation":{"type":"object","properties":{"roleId":{"anyOf":[{"type":"string","minLength":1,"maxLength":80},{"type":"null"}]},"deskId":{"description":"A team desk instead of a role: the hand-off waits in the desk's queue until someone on it claims it. Set `roleId` or `deskId`, never both.","anyOf":[{"type":"string","minLength":1,"maxLength":80},{"type":"null"}]}},"additionalProperties":false},"visibleToAllAssignees":{"type":"boolean"},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"}},"title":"Prepare document","description":"Fills a Word template with values from the flow, then the assignee edits the document and submits it. Later steps can use the prepared document as a PDF and as a Word file.\n\nThe settings a template read (`GET /v1/templates/{id}`) returns for this type, as stored. The shared settings (due date, reminders, visibility, monitors) can appear alongside them. To set them in a change, send `StepSettings_PREPARE_DOCUMENT_BY_PERSON`: where this shape holds an id, a change can name a role, field or step by its name or handle.\n\n**Offered by plan:** available when the organization's plan includes `prepareDocumentByPerson`.","x-moxo-step-type":"PREPARE_DOCUMENT_BY_PERSON","x-moxo-category":"HUMAN_ACTION","x-moxo-plan-feature":"prepareDocumentByPerson"},"StepConfig_ESIGN":{"type":"object","properties":{"esign":{"description":"The e-signature settings.","$ref":"#/components/schemas/StepConfig_ESIGN_esign"},"document":{"description":"The PDF to sign. Set `ref` to the `fileId` of the PDF uploaded to the step (`POST /v1/templates/{id}/steps/{stepId}/attachments/upload-init` with `slotKind: \"document\"`), or to a reference to an earlier step that produces a file. A stored file's address typed in is refused with `STORAGE_KEY_NOT_ACCEPTED`.","$ref":"#/components/schemas/StepConfig_ESIGN_document"},"fields":{"description":"The fields found in the PDF, each with the `roleId` of the signer who fills it. Every field needs a `roleId`.","$ref":"#/components/schemas/StepConfig_ESIGN_fields"},"attachments":{"description":"Reference material shown on the step: files, web links or both. A web link (`{ kind: \"link\", url }`) is a page the assignee should open. Its `url` can be a fixed `https://` address or a reference to a value from earlier in the flow, such as `${{ steps.look_up_portal_link.fields.latest_url }}`, so a running flow always links to the latest address.","$ref":"#/components/schemas/StepConfigPart_attachments"},"assist":{"description":"Assignee Assist for the signer. `{ \"enabled\": true }` lets the signer ask for help while they work. Leave it out, or send `{ \"enabled\": false }`, to keep Assist off.","$ref":"#/components/schemas/StepConfigPart_assist"},"documentRef":{"anyOf":[{"type":"string"},{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"literal"},"expectedType":{"type":"string"},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}],"description":"A fixed value. Its JSON type follows `expectedType`: a number for `NUMBER`, a boolean for `BOOLEAN` and text for everything else."}},"required":["kind","expectedType","value"]},{"type":"object","properties":{"kind":{"type":"string","const":"step-output"},"expectedType":{"type":"string"},"stepId":{"type":"string","description":"The id of the step that produces the value."},"field":{"type":"string","description":"The output's key on that step. On a form step it is the question's key (`fieldId`); a label is accepted and stored as that key, and a label two questions share is refused at publish. On an AI step, the output's `name`; on an e-signature or PDF form step, the step type's output name. Not the handle."},"channel":{"description":"Which part of the step to read. `field` (the default) reads an output; `meta` reads completion details, such as who completed the step and when. Not used for a value collected across a loop.","type":"string","enum":["field","meta"]}},"required":["kind","expectedType","stepId","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"role-data"},"expectedType":{"type":"string","const":"TEXT"},"roleId":{"type":"string"},"field":{"type":"string","enum":["name","email","phone","title"]}},"required":["kind","expectedType","roleId","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"flow-input"},"expectedType":{"type":"string"},"inputId":{"type":"string","description":"The `key` of a flow field asked for when the flow starts, for example `client_name`. Not an id. Read from the start form's values."}},"required":["kind","expectedType","inputId"]},{"type":"object","properties":{"kind":{"type":"string","const":"custom-field"},"expectedType":{"type":"string"},"fieldId":{"type":"string"}},"required":["kind","expectedType","fieldId"]},{"type":"object","properties":{"kind":{"type":"string","const":"organization"},"expectedType":{"type":"string","const":"TEXT"},"attribute":{"type":"string","enum":["name","id"]}},"required":["kind","expectedType","attribute"]},{"type":"object","properties":{"kind":{"type":"string","const":"flow-metadata"},"expectedType":{"type":"string"},"attribute":{"type":"string","enum":["duedate","startdate","name","id"]}},"required":["kind","expectedType","attribute"]},{"type":"object","properties":{"kind":{"type":"string","const":"for-each-item"},"expectedType":{"type":"string"},"selector":{"type":"string","enum":["item","index","number","total"],"description":"What to read from the current pass of a loop. `item` reads a column of the current row; `index` (starting at 0), `number` (starting at 1) and `total` are the loop's counters."},"itemFieldId":{"description":"The column's id, for `item`. Preferred over `itemField`, because it still works after the column is renamed.","type":"string"},"itemField":{"description":"The column's label, for `item` when the list has no column ids. A label stops working when the column is renamed.","type":"string"}},"required":["kind","expectedType","selector"]},{"type":"object","properties":{"kind":{"type":"string","const":"for-each-aggregate"},"expectedType":{"type":"string"},"loopStepId":{"type":"string"},"bodyStepId":{"type":"string"},"field":{"type":"string"}},"required":["kind","expectedType","loopStepId","bodyStepId","field"]}]}],"description":"The document to sign, on steps saved before `document` existed: a file id or a reference to an earlier step's file. Other steps use `document`."},"preparers":{"anyOf":[{"type":"object","properties":{"participants":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["AI","HUMAN"]},"roleId":{"type":"string","description":"For a person: the role that takes this seat, by its id."},"contactId":{"type":"string","description":"An external user named on the seat, by the `usr_` id the template read shows. `null` follows the read, as for `userId`."},"userId":{"type":"string","description":"A person named on the seat, by the `usr_` id the template read shows. `null` where the read showed `null` (someone with no id here) keeps the saved person; `null` where it showed an id takes them off the seat."},"agentId":{"type":"string"},"prompt":{"type":"string","description":"The AI participant's step context: instructions for this step only."},"criteria":{"type":"string","description":"For an AI reviewer: what to check. Read before `prompt`."},"context":{"type":"string","description":"An older home of the AI participant's step context, still read. Set `prompt` instead."},"privateNotesGuidance":{"type":"string","maxLength":2000,"description":"When no agent is named: what the AI notes privately for the flow's managers."},"sendBackReply":{"type":"string","enum":["outcome_with_reason","outcome_only"],"description":"When the AI sends work back and no agent is named: what the reply says, `outcome_with_reason` or `outcome_only`."},"howToExplain":{"type":"string","maxLength":2000,"description":"When the AI sends work back and no agent is named: how it explains what to fix."},"inputs":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"value":{"type":"string"},"type":{"type":"string","enum":["TEXT","FILE"]}},"required":["name","value"]}},"participantId":{"type":"string","description":"The participant's id on the step. Keep it when sending the seat back; leave it out for a new participant."},"order":{"type":"number","description":"The participant's place in the seat, from 0, when they act one after another."},"aiConfig":{}},"required":["type"],"additionalProperties":{}}},"sequential":{"type":"boolean"},"completion":{"type":"object","properties":{"mode":{"type":"string","enum":["ANY_ONE","ALL"],"description":"`ANY_ONE`: one participant finishing is enough. `ALL`: every participant finishes."}},"required":["mode"],"description":"When the seat is done."},"showToExternalAssignee":{"description":"Advisors only. `true` lets an assignee outside your organization read the recommendation (the call and its reasons), as advice from your organization. Off unless set.","type":"boolean"},"canEditAnswers":{"description":"Reviewers only, on a Form, PDF form or File request step. `true` lets the reviewer whose turn it is edit the submitted answers (on a File request, add and remove its files) during review, in the Moxo app, instead of sending them back. Off unless set.","type":"boolean"},"reviewItemsTogether":{"description":"Reviewers only, on a person's step inside a For each whose items run at the same time. `true` gives the reviewer one list and one notice for every item instead of one review per item; each item keeps its own run and review. With the loop's `syncStepsAcrossIterations` on, the reviewer approves every item at once (`approve_reviews_together`); off, each item is approved on its own. Publish refuses it in a Repeat while, on an \"Approve before it runs\" step, with no person or role reviewing, and in a loop that runs items one at a time. Off unless set.","type":"boolean"}},"required":["participants"]},{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["AI","HUMAN"]},"roleId":{"type":"string"},"contactId":{"type":"string"},"userId":{"type":"string"},"agentId":{"type":"string"},"prompt":{"type":"string"},"criteria":{"type":"string"},"context":{"type":"string"},"privateNotesGuidance":{"type":"string","maxLength":2000},"sendBackReply":{"type":"string","enum":["outcome_with_reason","outcome_only"]},"howToExplain":{"type":"string","maxLength":2000},"inputs":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"value":{"type":"string"},"type":{"type":"string","enum":["TEXT","FILE"]}},"required":["name","value"]}},"ruleKinds":{"maxItems":80,"type":"array","items":{"type":"object","properties":{"rule":{"type":"string","minLength":1,"maxLength":2000},"kind":{"type":"string","enum":["fact","data_match","coverage","visual","judgment"]},"compare":{"type":"object","properties":{"check":{"type":"string","enum":["compare.money_equal","compare.date_after","compare.names_equal","certificate.insured_name_matches","certificate.limit_at_least","kyc.id_name_matches","kyc.birth_date_matches","kyc.dated_within_three_months"]},"against":{"type":"string","enum":["today","value","input"]},"value":{"type":"string","minLength":1,"maxLength":500},"input":{"type":"string","minLength":1,"maxLength":200}},"required":["check","against"]},"document":{"type":"string","minLength":1,"maxLength":200},"sum":{"type":"object","properties":{"fields":{"minItems":2,"maxItems":60,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}}},"required":["fields"]}},"required":["rule","kind"]}},"participantId":{"type":"string"},"order":{"type":"number"},"aiConfig":{}},"required":["type"],"additionalProperties":{}}}]},"reviewers":{"anyOf":[{"type":"object","properties":{"participants":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["AI","HUMAN"]},"roleId":{"type":"string","description":"For a person: the role that takes this seat, by its id."},"contactId":{"type":"string","description":"An external user named on the seat, by the `usr_` id the template read shows. `null` follows the read, as for `userId`."},"userId":{"type":"string","description":"A person named on the seat, by the `usr_` id the template read shows. `null` where the read showed `null` (someone with no id here) keeps the saved person; `null` where it showed an id takes them off the seat."},"agentId":{"type":"string"},"prompt":{"type":"string","description":"The AI participant's step context: instructions for this step only."},"criteria":{"type":"string","description":"For an AI reviewer: what to check. Read before `prompt`."},"context":{"type":"string","description":"An older home of the AI participant's step context, still read. Set `prompt` instead."},"privateNotesGuidance":{"type":"string","maxLength":2000,"description":"When no agent is named: what the AI notes privately for the flow's managers."},"sendBackReply":{"type":"string","enum":["outcome_with_reason","outcome_only"],"description":"When the AI sends work back and no agent is named: what the reply says, `outcome_with_reason` or `outcome_only`."},"howToExplain":{"type":"string","maxLength":2000,"description":"When the AI sends work back and no agent is named: how it explains what to fix."},"inputs":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"value":{"type":"string"},"type":{"type":"string","enum":["TEXT","FILE"]}},"required":["name","value"]}},"participantId":{"type":"string","description":"The participant's id on the step. Keep it when sending the seat back; leave it out for a new participant."},"order":{"type":"number","description":"The participant's place in the seat, from 0, when they act one after another."},"aiConfig":{}},"required":["type"],"additionalProperties":{}}},"sequential":{"type":"boolean"},"completion":{"type":"object","properties":{"mode":{"type":"string","enum":["ANY_ONE","ALL"],"description":"`ANY_ONE`: one participant finishing is enough. `ALL`: every participant finishes."}},"required":["mode"],"description":"When the seat is done."},"showToExternalAssignee":{"description":"Advisors only. `true` lets an assignee outside your organization read the recommendation (the call and its reasons), as advice from your organization. Off unless set.","type":"boolean"},"canEditAnswers":{"description":"Reviewers only, on a Form, PDF form or File request step. `true` lets the reviewer whose turn it is edit the submitted answers (on a File request, add and remove its files) during review, in the Moxo app, instead of sending them back. Off unless set.","type":"boolean"},"reviewItemsTogether":{"description":"Reviewers only, on a person's step inside a For each whose items run at the same time. `true` gives the reviewer one list and one notice for every item instead of one review per item; each item keeps its own run and review. With the loop's `syncStepsAcrossIterations` on, the reviewer approves every item at once (`approve_reviews_together`); off, each item is approved on its own. Publish refuses it in a Repeat while, on an \"Approve before it runs\" step, with no person or role reviewing, and in a loop that runs items one at a time. Off unless set.","type":"boolean"}},"required":["participants"]},{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["AI","HUMAN"]},"roleId":{"type":"string"},"contactId":{"type":"string"},"userId":{"type":"string"},"agentId":{"type":"string"},"prompt":{"type":"string"},"criteria":{"type":"string"},"context":{"type":"string"},"privateNotesGuidance":{"type":"string","maxLength":2000},"sendBackReply":{"type":"string","enum":["outcome_with_reason","outcome_only"]},"howToExplain":{"type":"string","maxLength":2000},"inputs":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"value":{"type":"string"},"type":{"type":"string","enum":["TEXT","FILE"]}},"required":["name","value"]}},"ruleKinds":{"maxItems":80,"type":"array","items":{"type":"object","properties":{"rule":{"type":"string","minLength":1,"maxLength":2000},"kind":{"type":"string","enum":["fact","data_match","coverage","visual","judgment"]},"compare":{"type":"object","properties":{"check":{"type":"string","enum":["compare.money_equal","compare.date_after","compare.names_equal","certificate.insured_name_matches","certificate.limit_at_least","kyc.id_name_matches","kyc.birth_date_matches","kyc.dated_within_three_months"]},"against":{"type":"string","enum":["today","value","input"]},"value":{"type":"string","minLength":1,"maxLength":500},"input":{"type":"string","minLength":1,"maxLength":200}},"required":["check","against"]},"document":{"type":"string","minLength":1,"maxLength":200},"sum":{"type":"object","properties":{"fields":{"minItems":2,"maxItems":60,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}}},"required":["fields"]}},"required":["rule","kind"]}},"participantId":{"type":"string"},"order":{"type":"number"},"aiConfig":{}},"required":["type"],"additionalProperties":{}}}]},"aiEscalation":{"type":"object","properties":{"roleId":{"anyOf":[{"type":"string","minLength":1,"maxLength":80},{"type":"null"}]},"deskId":{"description":"A team desk instead of a role: the hand-off waits in the desk's queue until someone on it claims it. Set `roleId` or `deskId`, never both.","anyOf":[{"type":"string","minLength":1,"maxLength":80},{"type":"null"}]}},"additionalProperties":false},"visibleToAllAssignees":{"type":"boolean"},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"},"options":{"description":"Switches for the files attached to this step. A type takes only the ones its step settings show.","type":"object","properties":{"preventDownload":{"description":"Prevent download: people can open the files attached to this step to read them, but can't download them. Needs view-only attachments switched on for your organization.","type":"boolean"}}}},"title":"E-Signature","description":"Collects electronic signatures on a document.\n\nThe settings a template read (`GET /v1/templates/{id}`) returns for this type, as stored. The shared settings (due date, reminders, visibility, monitors) can appear alongside them. To set them in a change, send `StepSettings_ESIGN`: where this shape holds an id, a change can name a role, field or step by its name or handle.\n\n**Offered by plan:** available when the organization's plan includes `esign`.","x-moxo-step-type":"ESIGN","x-moxo-category":"HUMAN_ACTION","x-moxo-plan-feature":"esign"},"StepConfig_ESIGN_esign":{"type":"object","properties":{"documentName":{"type":"string"},"documentDescription":{"type":"string"},"signingOrder":{"type":"string","enum":["SEQUENTIAL","PARALLEL"]},"defaultFontSize":{"type":"number","minimum":8,"maximum":36,"description":"The font size, in points from 8 to 36, for values typed into the document when a field doesn't set its own. Leave it empty to fit each value to its field."},"signers":{"type":"array","items":{}},"autoFolder":{"type":"string","description":"The folder in the Files panel where the signed PDF and its certificate of completion are saved. A plain name is used as written. The name can include a value from earlier in the flow. An empty value is left out, and the text around it stays. If nothing is left, the file stays unfiled."},"autoDetectSignerRoleId":{"type":"string","description":"The signer role given to every field found automatically in the PDF. Cleared when the document is removed."},"requireSmsVerification":{"type":"boolean","description":"When `true`, each signer enters a one-time code sent by text message to their phone number before they can sign. The check is recorded on the certificate of completion. Available when the organization's plan includes text messaging."},"sampleDocumentRef":{"type":"string"},"sourceDocumentLocked":{"type":"boolean","description":"When `true`, the person preparing the step can check the signers and signing fields but can't replace the PDF, so a later e-signature step that signs this step's signed document can have its fields placed in advance. Set it only when the step has an attached document and a person prepares it. It can't be changed after a flow starts."},"placeFieldsFromSampleLabels":{"type":"boolean","description":"When `true`, each signing field follows the label it was placed beside if that label moves to another page. When omitted, the field stays on its page number."},"optionalSignerRoleIds":{"type":"array","items":{"type":"string"}},"provider":{"type":"string","description":"Who runs the signing. `NATIVE` is Moxo's own signing."},"appearance":{"type":"object","properties":{"mode":{"type":"string","enum":["inherit","custom"]},"font":{"type":"string","enum":["HELVETICA","TIMES","COURIER"]},"colorHex":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"}},"required":["mode"],"description":"The font and ink color of the text typed into the signed document."}}},"StepConfig_ESIGN_document":{"type":"object","properties":{"ref":{"anyOf":[{"type":"string","description":"The `fileId` of the PDF uploaded to the step, or a reference to an earlier step's file, such as `${{ steps.file_request.fields.uploaded_files }}`. Resolves to the PDF to sign when the step runs."},{"$ref":"#/components/schemas/StepConfigPart_ref"},{"type":"object","properties":{"kind":{"type":"string","const":"for-each-item"},"expectedType":{"type":"string"},"selector":{"type":"string","enum":["item","index","number","total"],"description":"What to read from the current pass of a loop. `item` reads a column of the current row; `index` (starting at 0), `number` (starting at 1) and `total` are the loop's counters."},"itemFieldId":{"description":"The column's id, for `item`. Preferred over `itemField`, because it still works after the column is renamed.","type":"string"},"itemField":{"description":"The column's label, for `item` when the list has no column ids. A label stops working when the column is renamed.","type":"string"}},"required":["kind","expectedType","selector"]}],"description":"The PDF: the `fileId` of the PDF uploaded to the step, or a structured reference to an earlier step's file."}},"required":["ref"]},"StepConfig_ESIGN_fields":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["signature","initials","stamp","date_signed","full_name","text","checkbox","dropdown","radio","multi_select"]},"roleId":{"type":"string"},"required":{"default":true,"type":"boolean"},"page":{"type":"integer","minimum":1,"maximum":9007199254740991},"x":{"type":"number","minimum":0,"maximum":100},"y":{"type":"number","minimum":0,"maximum":100},"width":{"type":"number","minimum":0.1,"maximum":100},"height":{"type":"number","minimum":0.1,"maximum":100},"defaultValue":{"type":"string"},"placeholder":{"type":"string"},"label":{"type":"string"},"context":{"type":"string","maxLength":500},"locked":{"type":"boolean"},"forceCurrentDate":{"type":"boolean"},"onlyFutureDates":{"type":"boolean"},"maxLength":{"type":"integer","minimum":1,"maximum":9007199254740991},"options":{"type":"array","items":{"type":"string"}},"checkboxGroup":{"type":"string"},"format":{"$ref":"#/components/schemas/StepConfig_ESIGN_format"},"fontSize":{"type":"number","minimum":8,"maximum":36},"fontColor":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"pdfFieldName":{"type":"string"},"origin":{"type":"string","enum":["acroform","anchor","custom"]},"widgetPositions":{"type":"array","items":{"type":"object","properties":{"page":{"type":"number"},"x":{"type":"number"},"y":{"type":"number"},"width":{"type":"number"},"height":{"type":"number"},"optionValue":{"type":"string"}},"required":["page","x","y","width","height","optionValue"]}},"readOnly":{"type":"boolean"},"signatureLine":{"type":"boolean"},"labelAnchor":{"type":"object","properties":{"text":{"type":"string","minLength":1,"maxLength":40,"description":"The printed label this field follows, such as `By:`."},"nearby":{"type":"string","minLength":1,"maxLength":200,"description":"The line of text above that label, when one is close enough to tell two copies apart."},"occurrence":{"type":"integer","minimum":1,"maximum":20,"description":"Which copy of the label this field follows. The first copy is 1."},"occurrenceCount":{"type":"integer","minimum":1,"maximum":20,"description":"How many copies of that label, with the same line above, the sample had."},"dx":{"type":"number","minimum":-2000,"maximum":2000,"description":"How far the field sits to the right of the label, in points. A negative number sits to its left."},"dy":{"type":"number","minimum":-2000,"maximum":2000,"description":"How far the field sits below the label, in points. A negative number sits above it."}},"required":["text","occurrence","occurrenceCount","dx","dy"],"description":"Where this field sits relative to a printed label on the sample. Recorded when fields are placed from the sample's labels. Absent when the field stays on its page number."},"defaultValueSource":{"type":"string","enum":["builder","ddr","ai","person"]},"defaultValueFrom":{"type":"string","maxLength":300},"fieldId":{"type":"string","description":"The field's id in the shared document-field form."},"kind":{"type":"string","description":"The field's kind in the shared document-field form, for example a signature or a date."}},"required":["id","type","roleId","page","x","y","width","height"]}},"StepConfigPart_ref":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"literal"},"expectedType":{"type":"string"},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}],"description":"A fixed value. Its JSON type follows `expectedType`: a number for `NUMBER`, a boolean for `BOOLEAN` and text for everything else."}},"required":["kind","expectedType","value"]},{"type":"object","properties":{"kind":{"type":"string","const":"step-output"},"expectedType":{"type":"string"},"stepId":{"type":"string","description":"The id of the step that produces the value."},"field":{"type":"string","description":"The output's key on that step. On a form step it is the question's key (`fieldId`); a label is accepted and stored as that key, and a label two questions share is refused at publish. On an AI step, the output's `name`; on an e-signature or PDF form step, the step type's output name. Not the handle."},"channel":{"type":"string","enum":["field","meta"],"description":"Which part of the step to read. `field` (the default) reads an output; `meta` reads completion details, such as who completed the step and when. Not used for a value collected across a loop."}},"required":["kind","expectedType","stepId","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"role-data"},"expectedType":{"type":"string","const":"TEXT"},"roleId":{"type":"string"},"field":{"type":"string","enum":["name","email","phone","title"]}},"required":["kind","expectedType","roleId","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"flow-input"},"expectedType":{"type":"string"},"inputId":{"type":"string","description":"The `key` of a flow field asked for when the flow starts, for example `client_name`. Not an id. Read from the start form's values."}},"required":["kind","expectedType","inputId"]},{"type":"object","properties":{"kind":{"type":"string","const":"custom-field"},"expectedType":{"type":"string"},"fieldId":{"type":"string"}},"required":["kind","expectedType","fieldId"]},{"type":"object","properties":{"kind":{"type":"string","const":"organization"},"expectedType":{"type":"string","const":"TEXT"},"attribute":{"type":"string","enum":["name","id"]}},"required":["kind","expectedType","attribute"]},{"type":"object","properties":{"kind":{"type":"string","const":"flow-metadata"},"expectedType":{"type":"string"},"attribute":{"type":"string","enum":["duedate","startdate","name","id"]}},"required":["kind","expectedType","attribute"]},{"type":"object","properties":{"kind":{"type":"string","const":"for-each-item"},"expectedType":{"type":"string"},"selector":{"type":"string","enum":["item","index","number","total"],"description":"What to read from the current pass of a loop. `item` reads a column of the current row; `index` (starting at 0), `number` (starting at 1) and `total` are the loop's counters."},"itemFieldId":{"type":"string","description":"The column's id, for `item`. Preferred over `itemField`, because it still works after the column is renamed."},"itemField":{"type":"string","description":"The column's label, for `item` when the list has no column ids. A label stops working when the column is renamed."}},"required":["kind","expectedType","selector"]},{"type":"object","properties":{"kind":{"type":"string","const":"for-each-aggregate"},"expectedType":{"type":"string"},"loopStepId":{"type":"string"},"bodyStepId":{"type":"string"},"field":{"type":"string"}},"required":["kind","expectedType","loopStepId","bodyStepId","field"]}]},"StepConfig_ESIGN_format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"text"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"number"},"min":{"type":"number","description":"The smallest number accepted, inclusive. Taken from the PDF's own range check on upload, or set in the field editor."},"max":{"type":"number","description":"The largest number accepted, inclusive. Taken from the PDF's own range check on upload, or set in the field editor."},"customMessage":{"type":"string","maxLength":500,"description":"The message shown when a number is out of range, instead of the standard one. Set in the field editor; an upload never fills it in."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"phone"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"email"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"zip"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"ssn"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"date"},"defaultToCurrentDate":{"type":"boolean"},"futureDatesOnly":{"type":"boolean"},"pastDatesOnly":{"type":"boolean"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"custom"},"regex":{"type":"string","minLength":1,"maxLength":500}},"required":["type","regex"]},{"type":"object","properties":{"type":{"type":"string","const":"number"},"min":{"description":"The smallest number accepted, inclusive. Taken from the PDF's own range check on upload, or set in the field editor.","type":"number"},"max":{"description":"The largest number accepted, inclusive. Taken from the PDF's own range check on upload, or set in the field editor.","type":"number"},"customMessage":{"description":"The message shown when a number is out of range, instead of the standard one. Set in the field editor; an upload never fills it in.","type":"string","maxLength":500}},"required":["type"]}]},"StepConfig_DOCUSIGN":{"type":"object","properties":{"docusign":{"type":"object","properties":{"connectionId":{"type":"string","description":"The id of the DocuSign connection the step sends with. An organization admin sets it in the step's settings in Moxo."},"mode":{"type":"string","enum":["template","document","multi_template"],"description":"`template` (the default) sends an existing DocuSign template. `document` uploads a PDF and places fields by anchor text. `multi_template` sends several DocuSign templates in one envelope."},"templateId":{"type":"string","description":"The DocuSign template id. Required when `mode` is `template`."},"templateName":{"type":"string","description":"The selected DocuSign template's name, for display only."},"document":{"type":"object","properties":{"ref":{"type":"string","description":"The key of a PDF uploaded while building the template, set when the upload finishes."},"ddrRef":{"type":"string","description":"A file from an earlier step, as a reference such as `${{ steps.file_request.fields.uploaded_files }}`. Resolved in each flow when the step starts."}},"description":"The PDF to send. Required when `mode` is `document`. Send exactly one of `ref` or `ddrRef`."},"roleMapping":{"type":"array","items":{"type":"object","properties":{"docusignRoleName":{"type":"string","description":"The DocuSign template role's name, such as `Buyer`. In `document` mode, use the Moxo role's name."},"moxoRoleId":{"type":"string","description":"The id of the Moxo template role that signs as this DocuSign role."},"anchors":{"description":"The fields this role's recipient signs, initials or dates, placed by anchor text. Required in `document` mode.","$ref":"#/components/schemas/StepConfig_DOCUSIGN_anchors"}},"required":["docusignRoleName","moxoRoleId"]},"description":"In `template` mode, maps each DocuSign template role to a Moxo role. In `document` mode, each entry also has `anchors[]`, which say where DocuSign places the fields."},"emailSubject":{"anyOf":[{"type":"string"},{"type":"array","items":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"text","description":"The part's type."},"text":{"type":"string","description":"Fixed text."}},"required":["kind","text"]},{"type":"object","properties":{"kind":{"type":"string","const":"input","description":"The part's type."},"key":{"type":"string","minLength":1,"description":"The key of a start field the template declares."}},"required":["kind","key"]},{"type":"object","properties":{"kind":{"type":"string","const":"role","description":"The part's type."},"roleName":{"type":"string","minLength":1,"description":"A role's name."},"field":{"type":"string","enum":["name","email","phone","title"],"description":"Which of the role's details: `name`, `email`, `phone` or `title`."}},"required":["kind","roleName","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"flow","description":"The part's type."},"field":{"type":"string","enum":["name","description","dueDate","startDate","dueTimestamp","startTimestamp","id"],"description":"Which detail of the flow: `name`, `description`, `dueDate`, `startDate`, `dueTimestamp`, `startTimestamp` or `id`."}},"required":["kind","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"organization","description":"The part's type."},"field":{"type":"string","enum":["name","id"],"description":"Which detail of the organization: `name` or `id`."}},"required":["kind","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"system","description":"The part's type."},"field":{"type":"string","const":"today","description":"Today's date, in the organization's time zone."}},"required":["kind","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"step","description":"The part's type."},"stepName":{"type":"string","minLength":1,"description":"The name of an earlier step."},"field":{"type":"string","minLength":1,"description":"The name of that step's output."}},"required":["kind","stepName","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"current_item","description":"The part's type."},"field":{"type":"string","minLength":1,"description":"A field of the current item, in a step that repeats for each item."}},"required":["kind","field"]}]}}],"description":"The envelope's email subject. Either text with references such as `${{ roles.customer.name }}`, or a list of parts, such as `[{ kind: \"text\", text: \"Sign your \" }, { kind: \"role\", roleName: \"Customer\", field: \"name\" }, { kind: \"text\", text: \" agreement\" }]`. The list form is checked: it can name only roles and fields the template has. Saved as text."},"emailBody":{"description":"The envelope's email body. Either text with references to values from earlier in the flow, or a list of parts: `{ kind: \"text\", text }` and `{ kind: \"role\" | \"input\" | \"step\" | \"flow\" | \"organization\" | \"current_item\", ... }`. Saved as text.","$ref":"#/components/schemas/StepConfigPart_emailBody"},"ccRecipients":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"The copy recipient's name. Can include references to values from earlier in the flow."},"email":{"type":"string","description":"The copy recipient's email address. Can include references to values from earlier in the flow."}},"required":["name","email"]},"description":"People who get a copy of the envelope by email but don't sign."},"multiTemplate":{"type":"object","properties":{"templates":{"oneOf":[{"type":"object","properties":{"source":{"type":"string","const":"picked"},"items":{"minItems":1,"maxItems":5,"type":"array","items":{"type":"object","properties":{"templateId":{"type":"string","minLength":1},"templateName":{"type":"string"}},"required":["templateId"]}}},"required":["source","items"]},{"type":"object","properties":{"source":{"type":"string","const":"data"},"value":{"type":"string","minLength":1}},"required":["source","value"]}]},"fillFields":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"tabLabel":{"type":"string","minLength":1},"value":{"type":"string"}},"required":["tabLabel","value"]}}},"required":["templates"],"description":"The templates to send, in envelope order, or text naming them from flow data. Required when `mode` is `multi_template`."},"fillFields":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"tabLabel":{"type":"string","minLength":1},"value":{"type":"string"}},"required":["tabLabel","value"]}},"optionalSignerRoleIds":{"type":"array","items":{"type":"string"}},"documentName":{"type":"string","description":"The name of the uploaded document, shown in the template builder."}},"required":["connectionId","roleMapping"],"description":"The DocuSign settings. `mode` is `template`, `document` or `multi_template` (several templates in one envelope)."},"approveBeforeRun":{"type":"boolean","description":"Whether a person approves what this step is about to send before it creates the payment page, envelope or agreement. When `true`, the step waits when it starts until someone approves; nothing reaches the payment or signing provider before that, and the payer or signer sees that it is being prepared. Set who approves in the step's `reviewers`: a step with approval on and no approver can't be published."},"approvalRejectMode":{"type":"string","enum":["skip","halt"],"description":"What a rejection does, with `approveBeforeRun`. `halt` (the default for this step) stops the flow and nothing is sent; `skip` skips this step and the flow continues."},"reviewers":{"anyOf":[{"type":"object","properties":{"participants":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["AI","HUMAN"]},"roleId":{"type":"string","description":"For a person: the role that takes this seat, by its id."},"contactId":{"type":"string","description":"An external user named on the seat, by the `usr_` id the template read shows. `null` follows the read, as for `userId`."},"userId":{"type":"string","description":"A person named on the seat, by the `usr_` id the template read shows. `null` where the read showed `null` (someone with no id here) keeps the saved person; `null` where it showed an id takes them off the seat."},"agentId":{"type":"string"},"prompt":{"type":"string","description":"The AI participant's step context: instructions for this step only."},"criteria":{"type":"string","description":"For an AI reviewer: what to check. Read before `prompt`."},"context":{"type":"string","description":"An older home of the AI participant's step context, still read. Set `prompt` instead."},"privateNotesGuidance":{"type":"string","maxLength":2000,"description":"When no agent is named: what the AI notes privately for the flow's managers."},"sendBackReply":{"type":"string","enum":["outcome_with_reason","outcome_only"],"description":"When the AI sends work back and no agent is named: what the reply says, `outcome_with_reason` or `outcome_only`."},"howToExplain":{"type":"string","maxLength":2000,"description":"When the AI sends work back and no agent is named: how it explains what to fix."},"inputs":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"value":{"type":"string"},"type":{"type":"string","enum":["TEXT","FILE"]}},"required":["name","value"]}},"participantId":{"type":"string","description":"The participant's id on the step. Keep it when sending the seat back; leave it out for a new participant."},"order":{"type":"number","description":"The participant's place in the seat, from 0, when they act one after another."},"aiConfig":{}},"required":["type"],"additionalProperties":{}}},"sequential":{"type":"boolean"},"completion":{"type":"object","properties":{"mode":{"type":"string","enum":["ANY_ONE","ALL"],"description":"`ANY_ONE`: one participant finishing is enough. `ALL`: every participant finishes."}},"required":["mode"],"description":"When the seat is done."},"showToExternalAssignee":{"description":"Advisors only. `true` lets an assignee outside your organization read the recommendation (the call and its reasons), as advice from your organization. Off unless set.","type":"boolean"},"canEditAnswers":{"description":"Reviewers only, on a Form, PDF form or File request step. `true` lets the reviewer whose turn it is edit the submitted answers (on a File request, add and remove its files) during review, in the Moxo app, instead of sending them back. Off unless set.","type":"boolean"},"reviewItemsTogether":{"description":"Reviewers only, on a person's step inside a For each whose items run at the same time. `true` gives the reviewer one list and one notice for every item instead of one review per item; each item keeps its own run and review. With the loop's `syncStepsAcrossIterations` on, the reviewer approves every item at once (`approve_reviews_together`); off, each item is approved on its own. Publish refuses it in a Repeat while, on an \"Approve before it runs\" step, with no person or role reviewing, and in a loop that runs items one at a time. Off unless set.","type":"boolean"}},"required":["participants"]},{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["AI","HUMAN"]},"roleId":{"type":"string"},"contactId":{"type":"string"},"userId":{"type":"string"},"agentId":{"type":"string"},"prompt":{"type":"string"},"criteria":{"type":"string"},"context":{"type":"string"},"privateNotesGuidance":{"type":"string","maxLength":2000},"sendBackReply":{"type":"string","enum":["outcome_with_reason","outcome_only"]},"howToExplain":{"type":"string","maxLength":2000},"inputs":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"value":{"type":"string"},"type":{"type":"string","enum":["TEXT","FILE"]}},"required":["name","value"]}},"ruleKinds":{"maxItems":80,"type":"array","items":{"type":"object","properties":{"rule":{"type":"string","minLength":1,"maxLength":2000},"kind":{"type":"string","enum":["fact","data_match","coverage","visual","judgment"]},"compare":{"type":"object","properties":{"check":{"type":"string","enum":["compare.money_equal","compare.date_after","compare.names_equal","certificate.insured_name_matches","certificate.limit_at_least","kyc.id_name_matches","kyc.birth_date_matches","kyc.dated_within_three_months"]},"against":{"type":"string","enum":["today","value","input"]},"value":{"type":"string","minLength":1,"maxLength":500},"input":{"type":"string","minLength":1,"maxLength":200}},"required":["check","against"]},"document":{"type":"string","minLength":1,"maxLength":200},"sum":{"type":"object","properties":{"fields":{"minItems":2,"maxItems":60,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}}},"required":["fields"]}},"required":["rule","kind"]}},"participantId":{"type":"string"},"order":{"type":"number"},"aiConfig":{}},"required":["type"],"additionalProperties":{}}}]},"aiEscalation":{"type":"object","properties":{"roleId":{"anyOf":[{"type":"string","minLength":1,"maxLength":80},{"type":"null"}]},"deskId":{"description":"A team desk instead of a role: the hand-off waits in the desk's queue until someone on it claims it. Set `roleId` or `deskId`, never both.","anyOf":[{"type":"string","minLength":1,"maxLength":80},{"type":"null"}]}},"additionalProperties":false},"visibleToAllAssignees":{"type":"boolean"},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"}},"required":["docusign"],"title":"DocuSign","description":"Sends a DocuSign envelope for embedded signing, from a DocuSign template or from an uploaded PDF with anchor text.\n\nThe settings a template read (`GET /v1/templates/{id}`) returns for this type, as stored. The shared settings (due date, reminders, visibility, monitors) can appear alongside them. To set them in a change, send `StepSettings_DOCUSIGN`: where this shape holds an id, a change can name a role, field or step by its name or handle.\n\n**Offered by plan:** available when the organization's plan includes `docusignStep`.","x-moxo-step-type":"DOCUSIGN","x-moxo-category":"HUMAN_ACTION","x-moxo-plan-feature":"docusignStep"},"StepConfig_DOCUSIGN_anchors":{"type":"array","items":{"type":"object","properties":{"anchorString":{"type":"string","minLength":1,"description":"The exact text DocuSign looks for in the PDF, matching capitals by default. Can't be empty: DocuSign refuses an envelope with an empty anchor."},"type":{"type":"string","enum":["signHereTabs","initialHereTabs","dateSignedTabs","fullNameTabs","textTabs","dateTabs","numberTabs"],"description":"The field type: `signHereTabs` (signature), `initialHereTabs` (initials), `dateSignedTabs` (date signed), `fullNameTabs` (full name), `textTabs` (text), `dateTabs` (date) or `numberTabs` (number)."},"xOffset":{"type":"number","description":"Horizontal distance from the anchor text, in inches. Positive moves right."},"yOffset":{"type":"number","description":"Vertical distance from the anchor text, in inches. Positive moves down."}},"required":["anchorString","type"]}},"StepConfigPart_emailBody":{"anyOf":[{"type":"string"},{"type":"array","items":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"text","description":"The part's type."},"text":{"type":"string","description":"Fixed text."}},"required":["kind","text"]},{"type":"object","properties":{"kind":{"type":"string","const":"input","description":"The part's type."},"key":{"type":"string","minLength":1,"description":"The key of a start field the template declares."}},"required":["kind","key"]},{"type":"object","properties":{"kind":{"type":"string","const":"role","description":"The part's type."},"roleName":{"type":"string","minLength":1,"description":"A role's name."},"field":{"type":"string","enum":["name","email","phone","title"],"description":"Which of the role's details: `name`, `email`, `phone` or `title`."}},"required":["kind","roleName","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"flow","description":"The part's type."},"field":{"type":"string","enum":["name","description","dueDate","startDate","dueTimestamp","startTimestamp","id"],"description":"Which detail of the flow: `name`, `description`, `dueDate`, `startDate`, `dueTimestamp`, `startTimestamp` or `id`."}},"required":["kind","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"organization","description":"The part's type."},"field":{"type":"string","enum":["name","id"],"description":"Which detail of the organization: `name` or `id`."}},"required":["kind","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"system","description":"The part's type."},"field":{"type":"string","const":"today","description":"Today's date, in the organization's time zone."}},"required":["kind","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"step","description":"The part's type."},"stepName":{"type":"string","minLength":1,"description":"The name of an earlier step."},"field":{"type":"string","minLength":1,"description":"The name of that step's output."}},"required":["kind","stepName","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"current_item","description":"The part's type."},"field":{"type":"string","minLength":1,"description":"A field of the current item, in a step that repeats for each item."}},"required":["kind","field"]}]}}]},"StepConfig_ADOBE_SIGN":{"type":"object","properties":{"adobeSign":{"type":"object","properties":{"connectionId":{"type":"string","default":"","description":"The id of the Adobe Acrobat Sign connection. An organization admin chooses it in the step editor. It may be left out while the step is being built; the step can't be published until it is chosen."},"mode":{"type":"string","enum":["template","document"],"description":"What is sent. `template` sends a library document saved in Acrobat Sign. `document` sends an uploaded PDF, or a file from an earlier step, and places signing fields at marker text. Defaults to `template`."},"libraryDocumentId":{"type":"string","description":"The Acrobat Sign library document id (what Acrobat Sign calls a template). Required when `mode` is `template`. Set when an admin chooses the document in the step editor."},"libraryDocumentName":{"type":"string","description":"The library document's name, for display only."},"document":{"type":"object","properties":{"ref":{"type":"string","description":"The `fileId` of a PDF uploaded to the step while editing the template."},"ddrRef":{"type":"string","description":"A reference to a PDF file produced by an earlier step."}},"description":"The PDF to send. Required when `mode` is `document`. Set exactly one of `ref` or `ddrRef`."},"documentName":{"type":"string","description":"The uploaded PDF's name, for display only."},"signers":{"type":"array","items":{"$ref":"#/components/schemas/StepConfig_ADOBE_SIGN_signersItem"},"description":"The signers, in order. Acrobat Sign matches signers by position. With a library document, the order matches each role to the document's field group. With a PDF, each signer also has `anchors` for the signing fields to place."},"agreementName":{"anyOf":[{"type":"string"},{"type":"array","items":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"text","description":"The part's type."},"text":{"type":"string","description":"Fixed text."}},"required":["kind","text"]},{"type":"object","properties":{"kind":{"type":"string","const":"input","description":"The part's type."},"key":{"type":"string","minLength":1,"description":"The key of a start field the template declares."}},"required":["kind","key"]},{"type":"object","properties":{"kind":{"type":"string","const":"role","description":"The part's type."},"roleName":{"type":"string","minLength":1,"description":"A role's name."},"field":{"type":"string","enum":["name","email","phone","title"],"description":"Which of the role's details: `name`, `email`, `phone` or `title`."}},"required":["kind","roleName","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"flow","description":"The part's type."},"field":{"type":"string","enum":["name","description","dueDate","startDate","dueTimestamp","startTimestamp","id"],"description":"Which detail of the flow: `name`, `description`, `dueDate`, `startDate`, `dueTimestamp`, `startTimestamp` or `id`."}},"required":["kind","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"organization","description":"The part's type."},"field":{"type":"string","enum":["name","id"],"description":"Which detail of the organization: `name` or `id`."}},"required":["kind","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"system","description":"The part's type."},"field":{"type":"string","const":"today","description":"Today's date, in the organization's time zone."}},"required":["kind","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"step","description":"The part's type."},"stepName":{"type":"string","minLength":1,"description":"The name of an earlier step."},"field":{"type":"string","minLength":1,"description":"The name of that step's output."}},"required":["kind","stepName","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"current_item","description":"The part's type."},"field":{"type":"string","minLength":1,"description":"A field of the current item, in a step that repeats for each item."}},"required":["kind","field"]}]}}],"description":"The agreement's name, which recipients see as the email subject; Acrobat Sign has one name and message, not a subject and body. Accepts text with references such as `${{ roles.customer.name }}`, or a list of tokens (preferred)."},"message":{"description":"The message shown to participants with the agreement. Accepts text with references to values from earlier in the flow, or a list of tokens (preferred).","$ref":"#/components/schemas/StepConfigPart_emailBody"},"ccRecipients":{"type":"array","items":{"type":"object","properties":{"email":{"type":"string","description":"The copy recipient's email address. Can include references to values from earlier in the flow."}},"required":["email"]},"description":"People who get a copy of the agreement by email but don't sign. Adobe takes an email address only, with no name. They get no email while `sendAdobeEmails` is false."},"sendAdobeEmails":{"type":"boolean","description":"Whether Adobe Acrobat Sign emails the signers. `false`, the default for a new step, means signers get only Moxo's email and sign inside their action. `true` keeps Adobe's own invitation, reminder and signed-copy emails. A step saved without it behaves as `true`."}},"required":["signers"],"description":"The Adobe Acrobat Sign settings: a library document or a PDF for this flow, with ordered signers matched to the template's roles. For a PDF, signing fields are placed at marker text in the document."},"approveBeforeRun":{"type":"boolean","description":"Whether a person approves what this step is about to send before it creates the payment page, envelope or agreement. When `true`, the step waits when it starts until someone approves; nothing reaches the payment or signing provider before that, and the payer or signer sees that it is being prepared. Set who approves in the step's `reviewers`: a step with approval on and no approver can't be published."},"approvalRejectMode":{"type":"string","enum":["skip","halt"],"description":"What a rejection does, with `approveBeforeRun`. `halt` (the default for this step) stops the flow and nothing is sent; `skip` skips this step and the flow continues."},"reviewers":{"anyOf":[{"type":"object","properties":{"participants":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["AI","HUMAN"]},"roleId":{"type":"string","description":"For a person: the role that takes this seat, by its id."},"contactId":{"type":"string","description":"An external user named on the seat, by the `usr_` id the template read shows. `null` follows the read, as for `userId`."},"userId":{"type":"string","description":"A person named on the seat, by the `usr_` id the template read shows. `null` where the read showed `null` (someone with no id here) keeps the saved person; `null` where it showed an id takes them off the seat."},"agentId":{"type":"string"},"prompt":{"type":"string","description":"The AI participant's step context: instructions for this step only."},"criteria":{"type":"string","description":"For an AI reviewer: what to check. Read before `prompt`."},"context":{"type":"string","description":"An older home of the AI participant's step context, still read. Set `prompt` instead."},"privateNotesGuidance":{"type":"string","maxLength":2000,"description":"When no agent is named: what the AI notes privately for the flow's managers."},"sendBackReply":{"type":"string","enum":["outcome_with_reason","outcome_only"],"description":"When the AI sends work back and no agent is named: what the reply says, `outcome_with_reason` or `outcome_only`."},"howToExplain":{"type":"string","maxLength":2000,"description":"When the AI sends work back and no agent is named: how it explains what to fix."},"inputs":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"value":{"type":"string"},"type":{"type":"string","enum":["TEXT","FILE"]}},"required":["name","value"]}},"participantId":{"type":"string","description":"The participant's id on the step. Keep it when sending the seat back; leave it out for a new participant."},"order":{"type":"number","description":"The participant's place in the seat, from 0, when they act one after another."},"aiConfig":{}},"required":["type"],"additionalProperties":{}}},"sequential":{"type":"boolean"},"completion":{"type":"object","properties":{"mode":{"type":"string","enum":["ANY_ONE","ALL"],"description":"`ANY_ONE`: one participant finishing is enough. `ALL`: every participant finishes."}},"required":["mode"],"description":"When the seat is done."},"showToExternalAssignee":{"description":"Advisors only. `true` lets an assignee outside your organization read the recommendation (the call and its reasons), as advice from your organization. Off unless set.","type":"boolean"},"canEditAnswers":{"description":"Reviewers only, on a Form, PDF form or File request step. `true` lets the reviewer whose turn it is edit the submitted answers (on a File request, add and remove its files) during review, in the Moxo app, instead of sending them back. Off unless set.","type":"boolean"},"reviewItemsTogether":{"description":"Reviewers only, on a person's step inside a For each whose items run at the same time. `true` gives the reviewer one list and one notice for every item instead of one review per item; each item keeps its own run and review. With the loop's `syncStepsAcrossIterations` on, the reviewer approves every item at once (`approve_reviews_together`); off, each item is approved on its own. Publish refuses it in a Repeat while, on an \"Approve before it runs\" step, with no person or role reviewing, and in a loop that runs items one at a time. Off unless set.","type":"boolean"}},"required":["participants"]},{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["AI","HUMAN"]},"roleId":{"type":"string"},"contactId":{"type":"string"},"userId":{"type":"string"},"agentId":{"type":"string"},"prompt":{"type":"string"},"criteria":{"type":"string"},"context":{"type":"string"},"privateNotesGuidance":{"type":"string","maxLength":2000},"sendBackReply":{"type":"string","enum":["outcome_with_reason","outcome_only"]},"howToExplain":{"type":"string","maxLength":2000},"inputs":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"value":{"type":"string"},"type":{"type":"string","enum":["TEXT","FILE"]}},"required":["name","value"]}},"ruleKinds":{"maxItems":80,"type":"array","items":{"type":"object","properties":{"rule":{"type":"string","minLength":1,"maxLength":2000},"kind":{"type":"string","enum":["fact","data_match","coverage","visual","judgment"]},"compare":{"type":"object","properties":{"check":{"type":"string","enum":["compare.money_equal","compare.date_after","compare.names_equal","certificate.insured_name_matches","certificate.limit_at_least","kyc.id_name_matches","kyc.birth_date_matches","kyc.dated_within_three_months"]},"against":{"type":"string","enum":["today","value","input"]},"value":{"type":"string","minLength":1,"maxLength":500},"input":{"type":"string","minLength":1,"maxLength":200}},"required":["check","against"]},"document":{"type":"string","minLength":1,"maxLength":200},"sum":{"type":"object","properties":{"fields":{"minItems":2,"maxItems":60,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}}},"required":["fields"]}},"required":["rule","kind"]}},"participantId":{"type":"string"},"order":{"type":"number"},"aiConfig":{}},"required":["type"],"additionalProperties":{}}}]},"aiEscalation":{"type":"object","properties":{"roleId":{"anyOf":[{"type":"string","minLength":1,"maxLength":80},{"type":"null"}]},"deskId":{"description":"A team desk instead of a role: the hand-off waits in the desk's queue until someone on it claims it. Set `roleId` or `deskId`, never both.","anyOf":[{"type":"string","minLength":1,"maxLength":80},{"type":"null"}]}},"additionalProperties":false},"visibleToAllAssignees":{"type":"boolean"},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"},"preparers":{"anyOf":[{"anyOf":[{"type":"object","properties":{"participants":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["AI","HUMAN"]},"roleId":{"type":"string","description":"For a person: the role that takes this seat, by its id."},"contactId":{"type":"string","description":"An external user named on the seat, by the `usr_` id the template read shows. `null` follows the read, as for `userId`."},"userId":{"type":"string","description":"A person named on the seat, by the `usr_` id the template read shows. `null` where the read showed `null` (someone with no id here) keeps the saved person; `null` where it showed an id takes them off the seat."},"agentId":{"type":"string"},"prompt":{"type":"string","description":"The AI participant's step context: instructions for this step only."},"criteria":{"type":"string","description":"For an AI reviewer: what to check. Read before `prompt`."},"context":{"type":"string","description":"An older home of the AI participant's step context, still read. Set `prompt` instead."},"privateNotesGuidance":{"type":"string","maxLength":2000,"description":"When no agent is named: what the AI notes privately for the flow's managers."},"sendBackReply":{"type":"string","enum":["outcome_with_reason","outcome_only"],"description":"When the AI sends work back and no agent is named: what the reply says, `outcome_with_reason` or `outcome_only`."},"howToExplain":{"type":"string","maxLength":2000,"description":"When the AI sends work back and no agent is named: how it explains what to fix."},"inputs":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"value":{"type":"string"},"type":{"type":"string","enum":["TEXT","FILE"]}},"required":["name","value"]}}},"required":["type"],"additionalProperties":{}}},"sequential":{"type":"boolean"},"completion":{"type":"object","properties":{"mode":{"type":"string","enum":["ANY_ONE","ALL"],"description":"`ANY_ONE`: one participant finishing is enough. `ALL`: every participant finishes."}},"required":["mode"],"description":"When the seat is done."},"showToExternalAssignee":{"description":"Advisors only. `true` lets an assignee outside your organization read the recommendation (the call and its reasons), as advice from your organization. Off unless set.","type":"boolean"},"canEditAnswers":{"description":"Reviewers only, on a Form, PDF form or File request step. `true` lets the reviewer whose turn it is edit the submitted answers (on a File request, add and remove its files) during review, in the Moxo app, instead of sending them back. Off unless set.","type":"boolean"},"reviewItemsTogether":{"description":"Reviewers only, on a person's step inside a For each whose items run at the same time. `true` gives the reviewer one list and one notice for every item instead of one review per item; each item keeps its own run and review. With the loop's `syncStepsAcrossIterations` on, the reviewer approves every item at once (`approve_reviews_together`); off, each item is approved on its own. Publish refuses it in a Repeat while, on an \"Approve before it runs\" step, with no person or role reviewing, and in a loop that runs items one at a time. Off unless set.","type":"boolean"}},"required":["participants"]},{"type":"object","properties":{"participants":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["AI","HUMAN"]},"roleId":{"type":"string","description":"For a person: the role that takes this seat, by its id."},"contactId":{"type":"string","description":"An external user named on the seat, by the `usr_` id the template read shows. `null` follows the read, as for `userId`."},"userId":{"type":"string","description":"A person named on the seat, by the `usr_` id the template read shows. `null` where the read showed `null` (someone with no id here) keeps the saved person; `null` where it showed an id takes them off the seat."},"agentId":{"type":"string"},"prompt":{"type":"string","description":"The AI participant's step context: instructions for this step only."},"criteria":{"type":"string","description":"For an AI reviewer: what to check. Read before `prompt`."},"context":{"type":"string","description":"An older home of the AI participant's step context, still read. Set `prompt` instead."},"privateNotesGuidance":{"type":"string","maxLength":2000,"description":"When no agent is named: what the AI notes privately for the flow's managers."},"sendBackReply":{"type":"string","enum":["outcome_with_reason","outcome_only"],"description":"When the AI sends work back and no agent is named: what the reply says, `outcome_with_reason` or `outcome_only`."},"howToExplain":{"type":"string","maxLength":2000,"description":"When the AI sends work back and no agent is named: how it explains what to fix."},"inputs":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"value":{"type":"string"},"type":{"type":"string","enum":["TEXT","FILE"]}},"required":["name","value"]}},"participantId":{"type":"string","description":"The participant's id on the step. Keep it when sending the seat back; leave it out for a new participant."},"order":{"type":"number","description":"The participant's place in the seat, from 0, when they act one after another."},"aiConfig":{}},"required":["type"],"additionalProperties":{}}}},"required":["participants"]}]},{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["AI","HUMAN"]},"roleId":{"type":"string"},"contactId":{"type":"string"},"userId":{"type":"string"},"agentId":{"type":"string"},"prompt":{"type":"string"},"criteria":{"type":"string"},"context":{"type":"string"},"privateNotesGuidance":{"type":"string","maxLength":2000},"sendBackReply":{"type":"string","enum":["outcome_with_reason","outcome_only"]},"howToExplain":{"type":"string","maxLength":2000},"inputs":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"value":{"type":"string"},"type":{"type":"string","enum":["TEXT","FILE"]}},"required":["name","value"]}},"ruleKinds":{"maxItems":80,"type":"array","items":{"type":"object","properties":{"rule":{"type":"string","minLength":1,"maxLength":2000},"kind":{"type":"string","enum":["fact","data_match","coverage","visual","judgment"]},"compare":{"type":"object","properties":{"check":{"type":"string","enum":["compare.money_equal","compare.date_after","compare.names_equal","certificate.insured_name_matches","certificate.limit_at_least","kyc.id_name_matches","kyc.birth_date_matches","kyc.dated_within_three_months"]},"against":{"type":"string","enum":["today","value","input"]},"value":{"type":"string","minLength":1,"maxLength":500},"input":{"type":"string","minLength":1,"maxLength":200}},"required":["check","against"]},"document":{"type":"string","minLength":1,"maxLength":200},"sum":{"type":"object","properties":{"fields":{"minItems":2,"maxItems":60,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}}},"required":["fields"]}},"required":["rule","kind"]}},"participantId":{"type":"string"},"order":{"type":"number"},"aiConfig":{}},"required":["type"],"additionalProperties":{}}}]}},"required":["adobeSign"],"title":"Adobe Acrobat Sign","description":"Sends an Adobe Acrobat Sign template or a PDF for signing inside Moxo.\n\nThe settings a template read (`GET /v1/templates/{id}`) returns for this type, as stored. The shared settings (due date, reminders, visibility, monitors) can appear alongside them. To set them in a change, send `StepSettings_ADOBE_SIGN`: where this shape holds an id, a change can name a role, field or step by its name or handle.\n\n**Offered by plan:** available when the organization's plan includes `adobeSignStep`.","x-moxo-step-type":"ADOBE_SIGN","x-moxo-category":"HUMAN_ACTION","x-moxo-plan-feature":"adobeSignStep"},"StepConfig_ADOBE_SIGN_signersItem":{"type":"object","properties":{"label":{"type":"string","description":"A display name for this signer, such as `Signer 1` or `Client`. Not sent to Adobe."},"moxoRoleId":{"type":"string","description":"The id of the template role that signs in this position."},"order":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The signing position, starting at 1 with no gaps. Signers with the same number sign at the same time; ascending numbers sign one after another."},"role":{"type":"string","enum":["SIGNER","APPROVER","ACCEPTOR","FORM_FILLER"],"description":"The signer's Adobe participant role. Defaults to `SIGNER`; other roles approve or acknowledge instead of signing."},"authenticationMethod":{"type":"string","enum":["NONE","EMAIL_OTP"],"description":"An optional identity check Adobe runs in the signing session, such as `EMAIL_OTP`."},"anchors":{"description":"Where this signer's fields go, with `mode` set to `document`. Optional: signature fields already in the PDF are used when they cover this signer. Needed when the step runs only if they don't.","$ref":"#/components/schemas/StepConfig_ADOBE_SIGN_anchors"}},"required":["label","moxoRoleId","order"]},"StepConfig_ADOBE_SIGN_anchors":{"type":"array","items":{"type":"object","properties":{"anchorText":{"type":"string","description":"Text in the PDF that marks where the field goes, such as `SIGN_HERE_1`. Leave it empty when the PDF already has signature fields for this signer, or when the file comes from an earlier step and isn't available yet."},"type":{"type":"string","enum":["SIGNATURE","INITIALS","DATE_SIGNED"],"description":"The field Adobe places at the marker."},"xOffset":{"type":"number","description":"The horizontal offset from the marker, in points. Positive moves right."},"yOffset":{"type":"number","description":"The vertical offset from the marker, in points. Positive moves down."}},"required":["anchorText","type"]}},"StepConfig_JOTFORM":{"type":"object","properties":{"jotform":{"type":"object","properties":{"connectionId":{"type":"string","description":"The id of the Jotform connection. An organization admin chooses it in the step editor."},"formId":{"type":"string","description":"The id of the Jotform form the assignee fills. Chosen in the step editor."},"formTitle":{"type":"string","description":"The form's title, for display only."},"openMode":{"type":"string","enum":["inside_moxo","new_tab"],"description":"How the form opens. `inside_moxo` (the default) shows it in a window inside Moxo; `new_tab` opens it in a new browser tab."}},"required":["connectionId","formId"],"description":"The Jotform settings: the form to fill and the connection that owns it. The person who fills it is the step's assignee. The step completes when Jotform reports the submission."},"visibleToAllAssignees":{"type":"boolean"},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"}},"required":["jotform"],"title":"Jotform","description":"Collects a Jotform submission in a flow. The step completes when the assignee submits the form.\n\nThe settings a template read (`GET /v1/templates/{id}`) returns for this type, as stored. The shared settings (due date, reminders, visibility, monitors) can appear alongside them. To set them in a change, send `StepSettings_JOTFORM`: where this shape holds an id, a change can name a role, field or step by its name or handle.\n\n**Offered by plan:** available when the organization's plan includes `jotformStep`.","x-moxo-step-type":"JOTFORM","x-moxo-category":"HUMAN_ACTION","x-moxo-plan-feature":"jotformStep"},"StepConfig_IDENTITY_VERIFICATION":{"type":"object","properties":{"identityVerification":{"type":"object","properties":{"provider":{"type":"string","enum":["yoti","sumsub","didit"],"description":"The provider that runs the check: `yoti`, `sumsub` when the organization has Sumsub verification turned on, or `didit` when it has Didit verification turned on."},"connectionId":{"type":"string","description":"The id of the provider's connection. An admin sets it in the step's settings in Moxo."},"checks":{"type":"string","enum":["DOCUMENT","DOCUMENT_FACE_MATCH","DOCUMENT_LIVENESS","DOCUMENT_FACE_MATCH_LIVENESS"],"description":"The checks the person must pass. The document's authenticity is always checked. `DOCUMENT`: the ID document only. `DOCUMENT_FACE_MATCH`: the document and a selfie matched to its photo. `DOCUMENT_LIVENESS`: the document and a check that the person is present. `DOCUMENT_FACE_MATCH_LIVENESS` (the default): all three, the usual KYC set."},"captureMethod":{"type":"string","enum":["CAMERA_AND_UPLOAD","CAMERA"],"description":"`CAMERA_AND_UPLOAD` (the default) lets the person upload pictures of the document; `CAMERA` requires a live capture."},"maxAttempts":{"type":"integer","minimum":1,"maximum":10,"description":"How many finished sessions without approval the person gets before the step completes with `overall_status` `FAILED`. Defaults to 3. A rejected attempt sends the step back to the person with the reason. A result the provider couldn't confirm (`CONSIDER`) goes to the step's reviewers, who approve it or send it back; with no reviewers, it counts as an attempt without approval."},"sumsub":{"description":"Sumsub settings, used only when `provider` is `sumsub`. `checks`, `captureMethod`, `maxAttempts` and reviewers don't apply: the Sumsub level decides what is checked, and Sumsub handles resubmission and manual review.","$ref":"#/components/schemas/StepConfig_IDENTITY_VERIFICATION_sumsub"},"didit":{"description":"Didit settings, used only when `provider` is `didit`. `checks`, `captureMethod`, `maxAttempts` and reviewers don't apply: the Didit workflow decides what is checked, and Didit handles resubmission and manual review.","$ref":"#/components/schemas/StepConfig_IDENTITY_VERIFICATION_didit"}},"required":["provider","connectionId"],"description":"Which provider and connection run the check, which checks to ask for, and how many attempts the person gets. The step has exactly one assignee: the person being verified. It completes when the provider approves, or with `overall_status` `FAILED` once the attempts run out, and a condition can branch on either. Add reviewers when a person should decide results the provider couldn't confirm."},"reviewers":{"anyOf":[{"type":"object","properties":{"participants":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["AI","HUMAN"]},"roleId":{"type":"string","description":"For a person: the role that takes this seat, by its id."},"contactId":{"type":"string","description":"An external user named on the seat, by the `usr_` id the template read shows. `null` follows the read, as for `userId`."},"userId":{"type":"string","description":"A person named on the seat, by the `usr_` id the template read shows. `null` where the read showed `null` (someone with no id here) keeps the saved person; `null` where it showed an id takes them off the seat."},"agentId":{"type":"string"},"prompt":{"type":"string","description":"The AI participant's step context: instructions for this step only."},"criteria":{"type":"string","description":"For an AI reviewer: what to check. Read before `prompt`."},"context":{"type":"string","description":"An older home of the AI participant's step context, still read. Set `prompt` instead."},"privateNotesGuidance":{"type":"string","maxLength":2000,"description":"When no agent is named: what the AI notes privately for the flow's managers."},"sendBackReply":{"type":"string","enum":["outcome_with_reason","outcome_only"],"description":"When the AI sends work back and no agent is named: what the reply says, `outcome_with_reason` or `outcome_only`."},"howToExplain":{"type":"string","maxLength":2000,"description":"When the AI sends work back and no agent is named: how it explains what to fix."},"inputs":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"value":{"type":"string"},"type":{"type":"string","enum":["TEXT","FILE"]}},"required":["name","value"]}},"participantId":{"type":"string","description":"The participant's id on the step. Keep it when sending the seat back; leave it out for a new participant."},"order":{"type":"number","description":"The participant's place in the seat, from 0, when they act one after another."},"aiConfig":{}},"required":["type"],"additionalProperties":{}}},"sequential":{"type":"boolean"},"completion":{"type":"object","properties":{"mode":{"type":"string","enum":["ANY_ONE","ALL"],"description":"`ANY_ONE`: one participant finishing is enough. `ALL`: every participant finishes."}},"required":["mode"],"description":"When the seat is done."},"showToExternalAssignee":{"description":"Advisors only. `true` lets an assignee outside your organization read the recommendation (the call and its reasons), as advice from your organization. Off unless set.","type":"boolean"},"canEditAnswers":{"description":"Reviewers only, on a Form, PDF form or File request step. `true` lets the reviewer whose turn it is edit the submitted answers (on a File request, add and remove its files) during review, in the Moxo app, instead of sending them back. Off unless set.","type":"boolean"},"reviewItemsTogether":{"description":"Reviewers only, on a person's step inside a For each whose items run at the same time. `true` gives the reviewer one list and one notice for every item instead of one review per item; each item keeps its own run and review. With the loop's `syncStepsAcrossIterations` on, the reviewer approves every item at once (`approve_reviews_together`); off, each item is approved on its own. Publish refuses it in a Repeat while, on an \"Approve before it runs\" step, with no person or role reviewing, and in a loop that runs items one at a time. Off unless set.","type":"boolean"}},"required":["participants"]},{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["AI","HUMAN"]},"roleId":{"type":"string"},"contactId":{"type":"string"},"userId":{"type":"string"},"agentId":{"type":"string"},"prompt":{"type":"string"},"criteria":{"type":"string"},"context":{"type":"string"},"privateNotesGuidance":{"type":"string","maxLength":2000},"sendBackReply":{"type":"string","enum":["outcome_with_reason","outcome_only"]},"howToExplain":{"type":"string","maxLength":2000},"inputs":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"value":{"type":"string"},"type":{"type":"string","enum":["TEXT","FILE"]}},"required":["name","value"]}},"ruleKinds":{"maxItems":80,"type":"array","items":{"type":"object","properties":{"rule":{"type":"string","minLength":1,"maxLength":2000},"kind":{"type":"string","enum":["fact","data_match","coverage","visual","judgment"]},"compare":{"type":"object","properties":{"check":{"type":"string","enum":["compare.money_equal","compare.date_after","compare.names_equal","certificate.insured_name_matches","certificate.limit_at_least","kyc.id_name_matches","kyc.birth_date_matches","kyc.dated_within_three_months"]},"against":{"type":"string","enum":["today","value","input"]},"value":{"type":"string","minLength":1,"maxLength":500},"input":{"type":"string","minLength":1,"maxLength":200}},"required":["check","against"]},"document":{"type":"string","minLength":1,"maxLength":200},"sum":{"type":"object","properties":{"fields":{"minItems":2,"maxItems":60,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}}},"required":["fields"]}},"required":["rule","kind"]}},"participantId":{"type":"string"},"order":{"type":"number"},"aiConfig":{}},"required":["type"],"additionalProperties":{}}}]},"aiEscalation":{"type":"object","properties":{"roleId":{"anyOf":[{"type":"string","minLength":1,"maxLength":80},{"type":"null"}]},"deskId":{"description":"A team desk instead of a role: the hand-off waits in the desk's queue until someone on it claims it. Set `roleId` or `deskId`, never both.","anyOf":[{"type":"string","minLength":1,"maxLength":80},{"type":"null"}]}},"additionalProperties":false},"visibleToAllAssignees":{"type":"boolean"},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"}},"required":["identityVerification"],"title":"Identity verification","description":"Verifies a person's identity with a government ID, a face match and a liveness check. The step completes when the provider approves, or completes as failed once the attempts run out.\n\nThe settings a template read (`GET /v1/templates/{id}`) returns for this type, as stored. The shared settings (due date, reminders, visibility, monitors) can appear alongside them. To set them in a change, send `StepSettings_IDENTITY_VERIFICATION`: where this shape holds an id, a change can name a role, field or step by its name or handle.\n\n**Offered by plan:** available when the organization's plan includes `identityVerificationStep`.","x-moxo-step-type":"IDENTITY_VERIFICATION","x-moxo-category":"HUMAN_ACTION","x-moxo-plan-feature":"identityVerificationStep"},"StepConfig_IDENTITY_VERIFICATION_sumsub":{"type":"object","properties":{"externalUserId":{"type":"string","maxLength":512,"description":"Your own id for the person in Sumsub, up to 512 characters, usually a value from an earlier step such as a CRM id. Required unless `applicantId` is set."},"applicantId":{"type":"string","maxLength":512,"description":"An existing Sumsub applicant id from an earlier step, up to 64 characters. When set, it is used instead of `externalUserId`."},"applicantType":{"type":"string","enum":["individual","company"],"description":"`individual` (the default) verifies a person; `company` verifies a business."},"companyName":{"type":"string","maxLength":256,"description":"The company's name, for a new company applicant."},"companyCountry":{"type":"string","description":"The country of a new company applicant, as an ISO 3166-1 alpha-3 code such as `GBR`."},"levelName":{"type":"string","maxLength":256,"description":"The Sumsub verification level's name, exactly as it appears in your Sumsub dashboard. Required for Sumsub."},"isWorkflow":{"type":"boolean","description":"`true` when the level is a Sumsub workflow: the step then finishes when the workflow completes, instead of on the applicant review."},"resetStepEnabled":{"type":"boolean","description":"`true` to reset one Sumsub step each time the person opens verification."},"resetStep":{"type":"string","enum":["APPLICANT_DATA","IDENTITY","IDENTITY2","IDENTITY3","IDENTITY4","SELFIE","SELFIE2","PROOF_OF_RESIDENCE","PROOF_OF_RESIDENCE2","PAYMENT_METHODS","QUESTIONNAIRE","PHONE_VERIFICATION","EMAIL_VERIFICATION","E_KYC","COMPANY_DATA","COMPANY_DOCUMENTS"],"description":"The Sumsub step to reset when `resetStepEnabled` is `true`."},"buttonText":{"type":"string","maxLength":60,"description":"The text on the person's button. Defaults to `Start Verification`."},"openMode":{"type":"string","enum":["inside_moxo","new_tab"],"description":"`inside_moxo` (the default) opens Sumsub in a window inside Moxo on a computer; `new_tab` always opens a new tab. Phones always use a new tab."}}},"StepConfig_IDENTITY_VERIFICATION_didit":{"type":"object","properties":{"workflowId":{"type":"string","maxLength":64,"description":"The id of a workflow published in your Didit account. Chosen from a list in the step's settings in Moxo."},"workflowLabel":{"type":"string","maxLength":120,"description":"Didit's name for the chosen workflow, for display only."},"buttonText":{"type":"string","maxLength":60,"description":"The text on the person's button. Defaults to `Verify identity`."},"openMode":{"type":"string","enum":["inside_moxo","new_tab"],"description":"`inside_moxo` (the default) opens Didit in a window inside Moxo on a computer; `new_tab` always opens a new tab. Phones always use a new tab."}}},"StepConfig_COLLECT_PAYMENT":{"type":"object","properties":{"payment":{"type":"object","properties":{"connectionId":{"type":"string","description":"The id of the Stripe or QuickBooks connection. An organization admin sets it in the step's settings."},"provider":{"type":"string","enum":["stripe","quickbooks"],"description":"The payment provider. `stripe` supports all three modes. `quickbooks` supports `pay_invoice` and `payment_link`."},"mode":{"type":"string","enum":["pay_invoice","new_checkout","payment_link"],"description":"How the assignee pays. `pay_invoice`: pays an invoice created earlier in the flow, usually by a Stripe or QuickBooks create-invoice step; takes `invoiceId`. `new_checkout`: a one-off Stripe Checkout created when the step starts, for an amount that isn't on an earlier invoice; takes `amount`, `currency` and `description`; Stripe only. `payment_link`: a new Stripe Payment Link each time the step starts, for a link the payer can copy; takes `amount`, `currency` and `description`; Stripe only."},"invoiceId":{"type":"string","description":"The provider's invoice id, usually as a flow value reference such as `${{ steps.create_invoice.fields.invoice_id }}`. Required for `pay_invoice`. A literal id is also accepted, for testing."},"amount":{"anyOf":[{"type":"number"},{"type":"string"}],"description":"The amount the payer owes, in major units (`2450` is $2,450). A number or a flow value reference. Required for `new_checkout` and `payment_link`."},"currency":{"type":"string","minLength":1,"description":"An ISO 4217 currency code (such as `USD`, `EUR` or `GBP`) or a flow value reference such as `${{ steps.order_details.fields.currency }}`. Required for `new_checkout` and `payment_link`. Whether the provider accepts the currency is checked when the step starts."},"description":{"description":"The line item label the payer sees on the Stripe Checkout or Payment Link page. Can include flow value references.","$ref":"#/components/schemas/StepConfigPart_emailBody"},"customerEmail":{"type":"string"},"existingLinkUrl":{"type":"string","format":"uri"}},"required":["connectionId","provider","mode"],"description":"The payment settings of a Collect payment step. Three modes: `pay_invoice`, `new_checkout` and `payment_link`."},"allowMarkAsPaid":{"type":"boolean","description":"Whether the assignee sees an \"Already paid this another way?\" link, which completes the step with a required reason. The step is marked complete and recorded in the audit trail, but nothing is reconciled in Stripe or QuickBooks. Defaults to `true`; set `false` where payment must be confirmed by the provider."},"approveBeforeRun":{"type":"boolean","description":"Whether a person approves what this step is about to send before it creates the payment page, envelope or agreement. When `true`, the step waits when it starts until someone approves; nothing reaches the payment or signing provider before that, and the payer or signer sees that it is being prepared. Set who approves in the step's `reviewers`: a step with approval on and no approver can't be published."},"approvalRejectMode":{"type":"string","enum":["skip","halt"],"description":"What a rejection does, with `approveBeforeRun`. `halt` (the default for this step) stops the flow and nothing is sent; `skip` skips this step and the flow continues."},"reviewers":{"anyOf":[{"type":"object","properties":{"participants":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["AI","HUMAN"]},"roleId":{"type":"string","description":"For a person: the role that takes this seat, by its id."},"contactId":{"type":"string","description":"An external user named on the seat, by the `usr_` id the template read shows. `null` follows the read, as for `userId`."},"userId":{"type":"string","description":"A person named on the seat, by the `usr_` id the template read shows. `null` where the read showed `null` (someone with no id here) keeps the saved person; `null` where it showed an id takes them off the seat."},"agentId":{"type":"string"},"prompt":{"type":"string","description":"The AI participant's step context: instructions for this step only."},"criteria":{"type":"string","description":"For an AI reviewer: what to check. Read before `prompt`."},"context":{"type":"string","description":"An older home of the AI participant's step context, still read. Set `prompt` instead."},"privateNotesGuidance":{"type":"string","maxLength":2000,"description":"When no agent is named: what the AI notes privately for the flow's managers."},"sendBackReply":{"type":"string","enum":["outcome_with_reason","outcome_only"],"description":"When the AI sends work back and no agent is named: what the reply says, `outcome_with_reason` or `outcome_only`."},"howToExplain":{"type":"string","maxLength":2000,"description":"When the AI sends work back and no agent is named: how it explains what to fix."},"inputs":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"value":{"type":"string"},"type":{"type":"string","enum":["TEXT","FILE"]}},"required":["name","value"]}},"participantId":{"type":"string","description":"The participant's id on the step. Keep it when sending the seat back; leave it out for a new participant."},"order":{"type":"number","description":"The participant's place in the seat, from 0, when they act one after another."},"aiConfig":{}},"required":["type"],"additionalProperties":{}}},"sequential":{"type":"boolean"},"completion":{"type":"object","properties":{"mode":{"type":"string","enum":["ANY_ONE","ALL"],"description":"`ANY_ONE`: one participant finishing is enough. `ALL`: every participant finishes."}},"required":["mode"],"description":"When the seat is done."},"showToExternalAssignee":{"description":"Advisors only. `true` lets an assignee outside your organization read the recommendation (the call and its reasons), as advice from your organization. Off unless set.","type":"boolean"},"canEditAnswers":{"description":"Reviewers only, on a Form, PDF form or File request step. `true` lets the reviewer whose turn it is edit the submitted answers (on a File request, add and remove its files) during review, in the Moxo app, instead of sending them back. Off unless set.","type":"boolean"},"reviewItemsTogether":{"description":"Reviewers only, on a person's step inside a For each whose items run at the same time. `true` gives the reviewer one list and one notice for every item instead of one review per item; each item keeps its own run and review. With the loop's `syncStepsAcrossIterations` on, the reviewer approves every item at once (`approve_reviews_together`); off, each item is approved on its own. Publish refuses it in a Repeat while, on an \"Approve before it runs\" step, with no person or role reviewing, and in a loop that runs items one at a time. Off unless set.","type":"boolean"}},"required":["participants"]},{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["AI","HUMAN"]},"roleId":{"type":"string"},"contactId":{"type":"string"},"userId":{"type":"string"},"agentId":{"type":"string"},"prompt":{"type":"string"},"criteria":{"type":"string"},"context":{"type":"string"},"privateNotesGuidance":{"type":"string","maxLength":2000},"sendBackReply":{"type":"string","enum":["outcome_with_reason","outcome_only"]},"howToExplain":{"type":"string","maxLength":2000},"inputs":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"value":{"type":"string"},"type":{"type":"string","enum":["TEXT","FILE"]}},"required":["name","value"]}},"ruleKinds":{"maxItems":80,"type":"array","items":{"type":"object","properties":{"rule":{"type":"string","minLength":1,"maxLength":2000},"kind":{"type":"string","enum":["fact","data_match","coverage","visual","judgment"]},"compare":{"type":"object","properties":{"check":{"type":"string","enum":["compare.money_equal","compare.date_after","compare.names_equal","certificate.insured_name_matches","certificate.limit_at_least","kyc.id_name_matches","kyc.birth_date_matches","kyc.dated_within_three_months"]},"against":{"type":"string","enum":["today","value","input"]},"value":{"type":"string","minLength":1,"maxLength":500},"input":{"type":"string","minLength":1,"maxLength":200}},"required":["check","against"]},"document":{"type":"string","minLength":1,"maxLength":200},"sum":{"type":"object","properties":{"fields":{"minItems":2,"maxItems":60,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}}},"required":["fields"]}},"required":["rule","kind"]}},"participantId":{"type":"string"},"order":{"type":"number"},"aiConfig":{}},"required":["type"],"additionalProperties":{}}}]},"aiEscalation":{"type":"object","properties":{"roleId":{"anyOf":[{"type":"string","minLength":1,"maxLength":80},{"type":"null"}]},"deskId":{"description":"A team desk instead of a role: the hand-off waits in the desk's queue until someone on it claims it. Set `roleId` or `deskId`, never both.","anyOf":[{"type":"string","minLength":1,"maxLength":80},{"type":"null"}]}},"additionalProperties":false},"visibleToAllAssignees":{"type":"boolean"},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"}},"required":["payment"],"title":"Collect Payment","description":"Lets the assignee pay through your connected Stripe or QuickBooks account: by paying an invoice, completing a one-off checkout or following a payment link.\n\nThe settings a template read (`GET /v1/templates/{id}`) returns for this type, as stored. The shared settings (due date, reminders, visibility, monitors) can appear alongside them. To set them in a change, send `StepSettings_COLLECT_PAYMENT`: where this shape holds an id, a change can name a role, field or step by its name or handle.\n\n**Offered by plan:** available when the organization's plan includes `paymentStep`.","x-moxo-step-type":"COLLECT_PAYMENT","x-moxo-category":"HUMAN_ACTION","x-moxo-plan-feature":"paymentStep"},"StepConfig_DECISION":{"type":"object","properties":{"attachments":{"description":"Reference material shown on the step: files, web links or both. A web link (`{ kind: \"link\", url }`) is a page the assignee should open. Its `url` can be a fixed `https://` address or a reference to a value from earlier in the flow, such as `${{ steps.look_up_portal_link.fields.latest_url }}`, so a running flow always links to the latest address.","$ref":"#/components/schemas/StepConfigPart_attachments"},"advisors":{"description":"An AI advisor that shows a recommendation before the assignee acts. Optional. For Approval, Decision, To-do and Questionnaire steps.","$ref":"#/components/schemas/StepConfigPart_advisors"},"outcomes":{"type":"array","items":{"type":"object","properties":{"style":{"type":"string","description":"How the option's button looks to the person deciding: `primary`, `secondary`, `positive` or `negative`."}}}},"preparers":{"anyOf":[{"type":"object","properties":{"participants":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["AI","HUMAN"]},"roleId":{"type":"string","description":"For a person: the role that takes this seat, by its id."},"contactId":{"type":"string","description":"An external user named on the seat, by the `usr_` id the template read shows. `null` follows the read, as for `userId`."},"userId":{"type":"string","description":"A person named on the seat, by the `usr_` id the template read shows. `null` where the read showed `null` (someone with no id here) keeps the saved person; `null` where it showed an id takes them off the seat."},"agentId":{"type":"string"},"prompt":{"type":"string","description":"The AI participant's step context: instructions for this step only."},"criteria":{"type":"string","description":"For an AI reviewer: what to check. Read before `prompt`."},"context":{"type":"string","description":"An older home of the AI participant's step context, still read. Set `prompt` instead."},"privateNotesGuidance":{"type":"string","maxLength":2000,"description":"When no agent is named: what the AI notes privately for the flow's managers."},"sendBackReply":{"type":"string","enum":["outcome_with_reason","outcome_only"],"description":"When the AI sends work back and no agent is named: what the reply says, `outcome_with_reason` or `outcome_only`."},"howToExplain":{"type":"string","maxLength":2000,"description":"When the AI sends work back and no agent is named: how it explains what to fix."},"inputs":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"value":{"type":"string"},"type":{"type":"string","enum":["TEXT","FILE"]}},"required":["name","value"]}},"participantId":{"type":"string","description":"The participant's id on the step. Keep it when sending the seat back; leave it out for a new participant."},"order":{"type":"number","description":"The participant's place in the seat, from 0, when they act one after another."},"aiConfig":{}},"required":["type"],"additionalProperties":{}}},"sequential":{"type":"boolean"},"completion":{"type":"object","properties":{"mode":{"type":"string","enum":["ANY_ONE","ALL"],"description":"`ANY_ONE`: one participant finishing is enough. `ALL`: every participant finishes."}},"required":["mode"],"description":"When the seat is done."},"showToExternalAssignee":{"description":"Advisors only. `true` lets an assignee outside your organization read the recommendation (the call and its reasons), as advice from your organization. Off unless set.","type":"boolean"},"canEditAnswers":{"description":"Reviewers only, on a Form, PDF form or File request step. `true` lets the reviewer whose turn it is edit the submitted answers (on a File request, add and remove its files) during review, in the Moxo app, instead of sending them back. Off unless set.","type":"boolean"},"reviewItemsTogether":{"description":"Reviewers only, on a person's step inside a For each whose items run at the same time. `true` gives the reviewer one list and one notice for every item instead of one review per item; each item keeps its own run and review. With the loop's `syncStepsAcrossIterations` on, the reviewer approves every item at once (`approve_reviews_together`); off, each item is approved on its own. Publish refuses it in a Repeat while, on an \"Approve before it runs\" step, with no person or role reviewing, and in a loop that runs items one at a time. Off unless set.","type":"boolean"}},"required":["participants"]},{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["AI","HUMAN"]},"roleId":{"type":"string"},"contactId":{"type":"string"},"userId":{"type":"string"},"agentId":{"type":"string"},"prompt":{"type":"string"},"criteria":{"type":"string"},"context":{"type":"string"},"privateNotesGuidance":{"type":"string","maxLength":2000},"sendBackReply":{"type":"string","enum":["outcome_with_reason","outcome_only"]},"howToExplain":{"type":"string","maxLength":2000},"inputs":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"value":{"type":"string"},"type":{"type":"string","enum":["TEXT","FILE"]}},"required":["name","value"]}},"ruleKinds":{"maxItems":80,"type":"array","items":{"type":"object","properties":{"rule":{"type":"string","minLength":1,"maxLength":2000},"kind":{"type":"string","enum":["fact","data_match","coverage","visual","judgment"]},"compare":{"type":"object","properties":{"check":{"type":"string","enum":["compare.money_equal","compare.date_after","compare.names_equal","certificate.insured_name_matches","certificate.limit_at_least","kyc.id_name_matches","kyc.birth_date_matches","kyc.dated_within_three_months"]},"against":{"type":"string","enum":["today","value","input"]},"value":{"type":"string","minLength":1,"maxLength":500},"input":{"type":"string","minLength":1,"maxLength":200}},"required":["check","against"]},"document":{"type":"string","minLength":1,"maxLength":200},"sum":{"type":"object","properties":{"fields":{"minItems":2,"maxItems":60,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}}},"required":["fields"]}},"required":["rule","kind"]}},"participantId":{"type":"string"},"order":{"type":"number"},"aiConfig":{}},"required":["type"],"additionalProperties":{}}}]},"decision":{"type":"object","properties":{"completion":{"type":"object","properties":{"mode":{"type":"string","const":"ONE"}},"required":["mode"]},"assigneeOrder":{"type":"string","const":"PARALLEL"}},"required":["completion"]},"visibleToAllAssignees":{"type":"boolean"},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"},"options":{"description":"Switches for the files attached to this step. A type takes only the ones its step settings show.","type":"object","properties":{"preventDownload":{"description":"Prevent download: people can open the files attached to this step to read them, but can't download them. Needs view-only attachments switched on for your organization.","type":"boolean"}}}},"title":"Decision","description":"One assignee chooses an outcome, and the flow takes that outcome's path.\n\nThe settings a template read (`GET /v1/templates/{id}`) returns for this type, as stored. The shared settings (due date, reminders, visibility, monitors) can appear alongside them. To set them in a change, send `StepSettings_DECISION`: where this shape holds an id, a change can name a role, field or step by its name or handle.\n\n**Offered by plan:** available when the organization's plan includes `decision`.","x-moxo-step-type":"DECISION","x-moxo-category":"HUMAN_ACTION","x-moxo-plan-feature":"decision"},"StepConfig_CUSTOM_ACTION":{"type":"object","properties":{"actionConfig":{"type":"object","properties":{"brief":{"description":"What the page shows and asks, in plain words. Can include values from earlier in the flow.","$ref":"#/components/schemas/StepConfigPart_emailBody"},"briefFiles":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","const":"file","description":"Always `file`."},"ref":{"type":"string","description":"A file: an uploaded file's id, or a reference to a file from an earlier step."},"name":{"type":"string","minLength":1,"maxLength":255,"description":"The file's name, as people see it."}},"required":["kind","ref"]},"description":"Files the page is built from: uploaded files, or files from earlier steps."},"briefUrls":{"type":"array","items":{"type":"string","format":"uri"},"description":"Web pages the page is built from."},"outputs":{"minItems":1,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[A-Za-z][A-Za-z0-9_-]{0,63}$","description":"The answer's id, unique in the step. A new id is lower case letters, digits and underscores, starting with a letter. An id already saved, including one with capitals or hyphens, is kept. Later steps refer to the answer by it."},"label":{"type":"string","minLength":1,"description":"The answer's name, as people see it."},"type":{"type":"string","enum":["text","number","boolean","date","time","select","multi_select"],"description":"The kind of answer: `text`, `number`, `boolean`, `date`, `time`, `select` or `multi_select`."},"required":{"type":"boolean","default":true,"description":"Whether the person must give this answer. Defaults to `true`."},"options":{"type":"array","items":{"type":"string","minLength":1},"description":"The choices of a `select` or `multi_select` answer: at least two, all different, none containing `|`."},"description":{"type":"string","description":"Help text that says what the answer is for."},"items":{"oneOf":[{"type":"object","properties":{"source":{"type":"string","const":"field","description":"`field`: one item per row of a list from earlier in the flow."},"ref":{"type":"string","minLength":1,"maxLength":500,"description":"The list from an earlier step the items come from: a table, a data table lookup or a file field."}},"required":["source","ref"]}],"description":"Set for an answer given once per item, such as one per listing. The items are known when the run starts."}},"required":["id","label","type"]},"description":"The answers the page collects, at least one. Each is available to later steps as `${{ steps.<step>.fields.<output> }}`. An answer given once per item is a list."}},"required":["brief","outputs"],"description":"The settings of a Custom action step: what its page is built from, and the answers it collects."},"preparers":{"anyOf":[{"type":"object","properties":{"participants":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["AI","HUMAN"]},"roleId":{"type":"string","description":"For a person: the role that takes this seat, by its id."},"contactId":{"type":"string","description":"An external user named on the seat, by the `usr_` id the template read shows. `null` follows the read, as for `userId`."},"userId":{"type":"string","description":"A person named on the seat, by the `usr_` id the template read shows. `null` where the read showed `null` (someone with no id here) keeps the saved person; `null` where it showed an id takes them off the seat."},"agentId":{"type":"string"},"prompt":{"type":"string","description":"The AI participant's step context: instructions for this step only."},"criteria":{"type":"string","description":"For an AI reviewer: what to check. Read before `prompt`."},"context":{"type":"string","description":"An older home of the AI participant's step context, still read. Set `prompt` instead."},"privateNotesGuidance":{"type":"string","maxLength":2000,"description":"When no agent is named: what the AI notes privately for the flow's managers."},"sendBackReply":{"type":"string","enum":["outcome_with_reason","outcome_only"],"description":"When the AI sends work back and no agent is named: what the reply says, `outcome_with_reason` or `outcome_only`."},"howToExplain":{"type":"string","maxLength":2000,"description":"When the AI sends work back and no agent is named: how it explains what to fix."},"inputs":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"value":{"type":"string"},"type":{"type":"string","enum":["TEXT","FILE"]}},"required":["name","value"]}},"participantId":{"type":"string","description":"The participant's id on the step. Keep it when sending the seat back; leave it out for a new participant."},"order":{"type":"number","description":"The participant's place in the seat, from 0, when they act one after another."},"aiConfig":{}},"required":["type"],"additionalProperties":{}}},"sequential":{"type":"boolean"},"completion":{"type":"object","properties":{"mode":{"type":"string","enum":["ANY_ONE","ALL"],"description":"`ANY_ONE`: one participant finishing is enough. `ALL`: every participant finishes."}},"required":["mode"],"description":"When the seat is done."},"showToExternalAssignee":{"description":"Advisors only. `true` lets an assignee outside your organization read the recommendation (the call and its reasons), as advice from your organization. Off unless set.","type":"boolean"},"canEditAnswers":{"description":"Reviewers only, on a Form, PDF form or File request step. `true` lets the reviewer whose turn it is edit the submitted answers (on a File request, add and remove its files) during review, in the Moxo app, instead of sending them back. Off unless set.","type":"boolean"},"reviewItemsTogether":{"description":"Reviewers only, on a person's step inside a For each whose items run at the same time. `true` gives the reviewer one list and one notice for every item instead of one review per item; each item keeps its own run and review. With the loop's `syncStepsAcrossIterations` on, the reviewer approves every item at once (`approve_reviews_together`); off, each item is approved on its own. Publish refuses it in a Repeat while, on an \"Approve before it runs\" step, with no person or role reviewing, and in a loop that runs items one at a time. Off unless set.","type":"boolean"}},"required":["participants"]},{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["AI","HUMAN"]},"roleId":{"type":"string"},"contactId":{"type":"string"},"userId":{"type":"string"},"agentId":{"type":"string"},"prompt":{"type":"string"},"criteria":{"type":"string"},"context":{"type":"string"},"privateNotesGuidance":{"type":"string","maxLength":2000},"sendBackReply":{"type":"string","enum":["outcome_with_reason","outcome_only"]},"howToExplain":{"type":"string","maxLength":2000},"inputs":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"value":{"type":"string"},"type":{"type":"string","enum":["TEXT","FILE"]}},"required":["name","value"]}},"ruleKinds":{"maxItems":80,"type":"array","items":{"type":"object","properties":{"rule":{"type":"string","minLength":1,"maxLength":2000},"kind":{"type":"string","enum":["fact","data_match","coverage","visual","judgment"]},"compare":{"type":"object","properties":{"check":{"type":"string","enum":["compare.money_equal","compare.date_after","compare.names_equal","certificate.insured_name_matches","certificate.limit_at_least","kyc.id_name_matches","kyc.birth_date_matches","kyc.dated_within_three_months"]},"against":{"type":"string","enum":["today","value","input"]},"value":{"type":"string","minLength":1,"maxLength":500},"input":{"type":"string","minLength":1,"maxLength":200}},"required":["check","against"]},"document":{"type":"string","minLength":1,"maxLength":200},"sum":{"type":"object","properties":{"fields":{"minItems":2,"maxItems":60,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}}},"required":["fields"]}},"required":["rule","kind"]}},"participantId":{"type":"string"},"order":{"type":"number"},"aiConfig":{}},"required":["type"],"additionalProperties":{}}}]},"visibleToAllAssignees":{"type":"boolean"},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"}},"required":["actionConfig"],"title":"Custom Action","description":"Shows the assignee a page built for this step from a brief, and collects the answers the step declares. Not available yet: a template with this step can't be published.\n\nThe settings a template read (`GET /v1/templates/{id}`) returns for this type, as stored. The shared settings (due date, reminders, visibility, monitors) can appear alongside them. To set them in a change, send `StepSettings_CUSTOM_ACTION`: where this shape holds an id, a change can name a role, field or step by its name or handle.\n\n**Offered by plan:** available when the organization's plan includes `customAction`.","x-moxo-step-type":"CUSTOM_ACTION","x-moxo-category":"HUMAN_ACTION","x-moxo-plan-feature":"customAction"},"StepConfig_CONVERSATION":{"type":"object","properties":{"conversation":{"description":"The AI agent that runs this step. In a Goal step, the agent is the step.","$ref":"#/components/schemas/StepConfig_CONVERSATION_conversation"},"visibleToAllAssignees":{"type":"boolean"},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"}},"title":"Goal","description":"An AI agent works with the assignee in a chat to reach a set outcome, such as an intake, a discovery call or an interview. It collects structured results, uses knowledge files and can include several assignees in a group chat.\n\nThe settings a template read (`GET /v1/templates/{id}`) returns for this type, as stored. The shared settings (due date, reminders, visibility, monitors) can appear alongside them. To set them in a change, send `StepSettings_CONVERSATION`: where this shape holds an id, a change can name a role, field or step by its name or handle.\n\n**Offered by plan:** available when the organization's plan includes `conversation`.","x-moxo-step-type":"CONVERSATION","x-moxo-category":"HUMAN_ACTION","x-moxo-plan-feature":"conversation"},"StepConfig_CONVERSATION_conversation":{"type":"object","properties":{"agent":{"type":"object","properties":{"objective":{"description":"What the assignee should accomplish in the conversation: text, or a list of typed parts when it includes references to flow values.","$ref":"#/components/schemas/StepConfigPart_emailBody"},"outputs":{"description":"The results the conversation collects or works out. Later steps can refer to each one. Declare every result a later step uses: a reference to a result that isn't declared breaks the template. Leave it empty only for a standalone Goal step whose results aren't decided yet; the step's setup chat suggests them.","$ref":"#/components/schemas/StepConfig_CONVERSATION_outputs"},"knowledge":{"type":"array","items":{"type":"object","properties":{"fileId":{"type":"string"},"name":{"type":"string"},"sizeBytes":{"type":"number"},"uploadedAt":{"type":"string"}},"required":["fileId","name"]},"description":"Knowledge files the agent uses while it runs. The assignee never sees them."},"sensitiveZones":{"type":"array","items":{"type":"string"},"description":"Topics the agent avoids pressing on."},"persona":{"type":"string","description":"The agent's tone, voice and style."},"behaviorRules":{"type":"array","items":{"type":"string"},"description":"Rules the agent follows, in free text."},"escalation":{"description":"Brings a flow manager into the chat when the AI can't reach the goal.","type":"object","properties":{"enabled":{"default":false,"description":"Whether a person can be brought in at all. With `false`, the assignee can't ask for one and the AI can't bring one in.","type":"boolean"},"to":{"type":"object","properties":{"kind":{"type":"string","enum":["role","team_desk"],"description":"Who is brought in: `role`, the people in a role that manages the flow, or `team_desk`, whoever is on duty at a team desk."},"id":{"type":"string","description":"The role's id (`kind` `role`) or the team desk's id (`kind` `team_desk`). It must be able to manage the flow."}},"required":["kind","id"],"description":"Who is brought in."},"allowAssigneeRequest":{"default":true,"description":"Whether the assignee can ask for a person from the chat. The AI also brings one in when the assignee asks in their own words.","type":"boolean"},"autoTriggers":{"type":"object","properties":{"stuckAfterTurns":{"description":"Bring in a person after the AI has asked about the same required answer this many times without progress.","type":"integer","minimum":1,"maximum":9007199254740991},"onSensitiveZone":{"description":"Bring in a person when the conversation reaches a topic marked as sensitive.","type":"boolean"}},"description":"When a person is brought in without being asked."}}}},"required":["objective"],"description":"The agent that leads the conversation. Set `objective`, and set `outputs` when the step collects named results or later steps use the answers. Knowledge, persona and rules are usually set up in the step's settings in Moxo."}},"required":["agent"]},"StepConfig_CONVERSATION_outputs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The output's unique id, used as its key in references."},"label":{"type":"string","description":"The output's name, as people see it."},"type":{"type":"string","enum":["text","number","boolean","date","select","file","list"]},"kind":{"type":"string","enum":["collected","computed"],"default":"collected","description":"`collected`: the agent asks the assignee for it. `computed`: the agent works it out from the conversation, such as a risk tier from an overview of assets. Defaults to `collected`."},"required":{"default":true,"type":"boolean"},"options":{"type":"array","items":{"type":"string"},"description":"The allowed choices, for a `select` output."},"description":{"type":"string"}},"required":["id","label","type"]}},"StepConfig_WEB_APP":{"type":"object","properties":{"webAppConfig":{"description":"The web app settings.","$ref":"#/components/schemas/StepConfig_WEB_APP_webAppConfig"},"preparers":{"anyOf":[{"type":"object","properties":{"participants":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["AI","HUMAN"]},"roleId":{"type":"string","description":"For a person: the role that takes this seat, by its id."},"contactId":{"type":"string","description":"An external user named on the seat, by the `usr_` id the template read shows. `null` follows the read, as for `userId`."},"userId":{"type":"string","description":"A person named on the seat, by the `usr_` id the template read shows. `null` where the read showed `null` (someone with no id here) keeps the saved person; `null` where it showed an id takes them off the seat."},"agentId":{"type":"string"},"prompt":{"type":"string","description":"The AI participant's step context: instructions for this step only."},"criteria":{"type":"string","description":"For an AI reviewer: what to check. Read before `prompt`."},"context":{"type":"string","description":"An older home of the AI participant's step context, still read. Set `prompt` instead."},"privateNotesGuidance":{"type":"string","maxLength":2000,"description":"When no agent is named: what the AI notes privately for the flow's managers."},"sendBackReply":{"type":"string","enum":["outcome_with_reason","outcome_only"],"description":"When the AI sends work back and no agent is named: what the reply says, `outcome_with_reason` or `outcome_only`."},"howToExplain":{"type":"string","maxLength":2000,"description":"When the AI sends work back and no agent is named: how it explains what to fix."},"inputs":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"value":{"type":"string"},"type":{"type":"string","enum":["TEXT","FILE"]}},"required":["name","value"]}},"participantId":{"type":"string","description":"The participant's id on the step. Keep it when sending the seat back; leave it out for a new participant."},"order":{"type":"number","description":"The participant's place in the seat, from 0, when they act one after another."},"aiConfig":{}},"required":["type"],"additionalProperties":{}}},"sequential":{"type":"boolean"},"completion":{"type":"object","properties":{"mode":{"type":"string","enum":["ANY_ONE","ALL"],"description":"`ANY_ONE`: one participant finishing is enough. `ALL`: every participant finishes."}},"required":["mode"],"description":"When the seat is done."},"showToExternalAssignee":{"description":"Advisors only. `true` lets an assignee outside your organization read the recommendation (the call and its reasons), as advice from your organization. Off unless set.","type":"boolean"},"canEditAnswers":{"description":"Reviewers only, on a Form, PDF form or File request step. `true` lets the reviewer whose turn it is edit the submitted answers (on a File request, add and remove its files) during review, in the Moxo app, instead of sending them back. Off unless set.","type":"boolean"},"reviewItemsTogether":{"description":"Reviewers only, on a person's step inside a For each whose items run at the same time. `true` gives the reviewer one list and one notice for every item instead of one review per item; each item keeps its own run and review. With the loop's `syncStepsAcrossIterations` on, the reviewer approves every item at once (`approve_reviews_together`); off, each item is approved on its own. Publish refuses it in a Repeat while, on an \"Approve before it runs\" step, with no person or role reviewing, and in a loop that runs items one at a time. Off unless set.","type":"boolean"}},"required":["participants"]},{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["AI","HUMAN"]},"roleId":{"type":"string"},"contactId":{"type":"string"},"userId":{"type":"string"},"agentId":{"type":"string"},"prompt":{"type":"string"},"criteria":{"type":"string"},"context":{"type":"string"},"privateNotesGuidance":{"type":"string","maxLength":2000},"sendBackReply":{"type":"string","enum":["outcome_with_reason","outcome_only"]},"howToExplain":{"type":"string","maxLength":2000},"inputs":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"value":{"type":"string"},"type":{"type":"string","enum":["TEXT","FILE"]}},"required":["name","value"]}},"ruleKinds":{"maxItems":80,"type":"array","items":{"type":"object","properties":{"rule":{"type":"string","minLength":1,"maxLength":2000},"kind":{"type":"string","enum":["fact","data_match","coverage","visual","judgment"]},"compare":{"type":"object","properties":{"check":{"type":"string","enum":["compare.money_equal","compare.date_after","compare.names_equal","certificate.insured_name_matches","certificate.limit_at_least","kyc.id_name_matches","kyc.birth_date_matches","kyc.dated_within_three_months"]},"against":{"type":"string","enum":["today","value","input"]},"value":{"type":"string","minLength":1,"maxLength":500},"input":{"type":"string","minLength":1,"maxLength":200}},"required":["check","against"]},"document":{"type":"string","minLength":1,"maxLength":200},"sum":{"type":"object","properties":{"fields":{"minItems":2,"maxItems":60,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}}},"required":["fields"]}},"required":["rule","kind"]}},"participantId":{"type":"string"},"order":{"type":"number"},"aiConfig":{}},"required":["type"],"additionalProperties":{}}}]},"visibleToAllAssignees":{"type":"boolean"},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"}},"title":"Web App","description":"Opens an outside web application as a step of the flow.\n\nThe settings a template read (`GET /v1/templates/{id}`) returns for this type, as stored. The shared settings (due date, reminders, visibility, monitors) can appear alongside them. To set them in a change, send `StepSettings_WEB_APP`: where this shape holds an id, a change can name a role, field or step by its name or handle.\n\n**Offered by plan:** available when the organization's plan includes `webApp`.","x-moxo-step-type":"WEB_APP","x-moxo-category":"HUMAN_ACTION","x-moxo-plan-feature":"webApp"},"StepConfig_WEB_APP_webAppConfig":{"type":"object","properties":{"source":{"default":"hosted","type":"string","enum":["hosted","upload"],"description":"Where the page comes from: a hosted URL (the default) or an uploaded HTML file."},"htmlFile":{"type":"object","properties":{"fileId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"The uploaded HTML file's id."},"fileName":{"type":"string","minLength":1,"description":"The file's original name."},"sizeBytes":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"The file's size in bytes."}},"required":["fileId","fileName"],"description":"The uploaded HTML file, when `source` is `upload`."},"keepCompletedFile":{"type":"boolean","description":"When `true`, a PDF of the completed page is saved on the step, so later steps can reference it."},"answerFields":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":200},"description":"The names of the uploaded page's form fields. Each becomes an answer later steps can reference. Set when the file is added."},"url":{"type":"string","description":"The web app's URL. Required unless `source` is `upload`. Can include references to values from earlier in the flow, for example `https://app.example.com/form?id=${{ fields.client_id }}`."},"method":{"default":"GET","type":"string","enum":["GET","POST"],"description":"The HTTP method used to open the URL."},"parameters":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"value":{"type":"string","description":"The parameter's value. Can include references to values from earlier in the flow."}},"required":["key","value"]},"description":"Query parameters added to the URL."},"completionMode":{"type":"string","enum":["MANUAL","WEBHOOK"],"default":"MANUAL","description":"How a hosted page's step completes. `MANUAL`: the assignee selects Mark Complete. `WEBHOOK`: the outside system confirms with a callback. Defaults to `MANUAL`. An uploaded page (`source: upload`) is finished by its assignee's own Submit and ignores this setting; a change through this API saves it without one."},"buttonLabel":{"default":"Open Application","type":"string","description":"The label of the button that opens the web app."},"openInsideMoxo":{"type":"boolean","description":"When `true`, the web app opens in a window inside Moxo on desktop instead of a new tab. On mobile, and with `POST`, it still opens outside Moxo."},"modalWidthPct":{"type":"number","minimum":40,"maximum":100,"description":"The window's width, as a percent of the browser window. Defaults to 90."},"modalHeightPct":{"type":"number","minimum":40,"maximum":100,"description":"The window's height, as a percent of the browser window. Defaults to 85."},"manualCompletedBy":{"default":"assignee","type":"string","enum":["assignee","member"],"description":"With manual completion: who confirms the page is done, `assignee` or `member` (a member of your team)."},"webhookAuth":{"anyOf":[{"type":"object","properties":{"connectionId":{"type":"string"}},"required":["connectionId"],"additionalProperties":false},{"type":"object","properties":{"username":{"type":"string","minLength":1},"password":{"type":"string","minLength":1}},"required":["username","password"]}]}}},"StepConfig_PREPARE_DOCUMENT":{"type":"object","properties":{"prepareDocument":{"description":"The prepare-document settings: the PDF whose form fields, or the Word template whose placeholders, are filled with values from the flow when the step runs. The filled PDF can be used by a later file request, email or e-signature step.","$ref":"#/components/schemas/StepConfig_PREPARE_DOCUMENT_prepareDocument"},"visibleToAllAssignees":{"type":"boolean"},"blockOnFailure":{"type":"boolean","description":"Whether a failure stops the flow (\"Block the workflow if this step fails\"). `false` lets the flow continue past it; the failure is still recorded. Stops it when left out."},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"}},"title":"Prepare document","description":"Fills an uploaded PDF's form fields, or a Word template's placeholders, with values from the flow, with no assignee, and makes the filled document a file later steps can use, such as a file request, an email or an e-signature step. Each field or placeholder takes a value from an earlier step, a flow field or a connected app such as Salesforce; a PDF field with no value stays blank, for example a signature signed by hand after download. A Word template also gives the filled Word file.\n\nThe settings a template read (`GET /v1/templates/{id}`) returns for this type, as stored. The shared settings (due date, reminders, visibility, monitors) can appear alongside them. To set them in a change, send `StepSettings_PREPARE_DOCUMENT`: where this shape holds an id, a change can name a role, field or step by its name or handle.\n\n**Offered by plan:** available when the organization's plan includes `prepareDocument`.","x-moxo-step-type":"PREPARE_DOCUMENT","x-moxo-category":"AUTOMATION","x-moxo-plan-feature":"prepareDocument"},"StepConfig_PREPARE_DOCUMENT_prepareDocument":{"type":"object","properties":{"documentRef":{"description":"The PDF to fill: the `fileId` of the PDF uploaded to the step, or a reference to an earlier step's file.","$ref":"#/components/schemas/StepConfig_PREPARE_DOCUMENT_documentRef"},"fileName":{"type":"string","description":"The name of the generated file, without extension, for example `Direct Deposit Authorization`."},"fields":{"description":"The PDF's form fields, each with the value that fills it. Filled in by the field editor after the PDF is uploaded.","$ref":"#/components/schemas/StepConfig_PREPARE_DOCUMENT_fields"},"defaultFontSize":{"type":"number","exclusiveMinimum":0},"appearance":{"type":"object","properties":{"mode":{"type":"string","enum":["inherit","custom"]},"font":{"type":"string","enum":["HELVETICA","TIMES","COURIER"]},"colorHex":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"}},"required":["mode"]},"wordTemplate":{"type":"object","properties":{"ref":{"type":"string","description":"The `fileId` of the Word file (.docx) uploaded to the step. Set when the file is uploaded."},"fileName":{"type":"string","description":"The Word file's name, as it was uploaded."},"fill":{"type":"object","properties":{"slots":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"},"description":"Each `{{placeholder}}` in the Word file, by name, with the reference to the value that fills it, for example `${{ steps.intake_form.fields.client_name }}`. An empty string leaves it unfilled."}},"required":["slots"],"description":"How the file's placeholders are filled: `slots` maps each `{{placeholder}}` name to the reference that fills it, or `\"\"` for one nobody maps."}},"required":["fill"],"description":"A Word template (.docx) to fill instead of a PDF: each of its `{{placeholders}}` is filled with a value from the flow. Set when the Word file is uploaded to the step. On this step every placeholder needs a value, because nobody fills one in."}}},"StepConfig_PREPARE_DOCUMENT_documentRef":{"anyOf":[{"type":"string"},{"type":"object","properties":{"kind":{"type":"string","const":"literal"},"expectedType":{"type":"string"},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}],"description":"A fixed value. Its JSON type follows `expectedType`: a number for `NUMBER`, a boolean for `BOOLEAN` and text for everything else."}},"required":["kind","expectedType","value"]},{"type":"object","properties":{"kind":{"type":"string","const":"step-output"},"expectedType":{"type":"string"},"stepId":{"type":"string","description":"The id of the step that produces the value."},"field":{"type":"string","description":"The output's key on that step. On a form step it is the question's key (`fieldId`); a label is accepted and stored as that key, and a label two questions share is refused at publish. On an AI step, the output's `name`; on an e-signature or PDF form step, the step type's output name. Not the handle."},"channel":{"description":"Which part of the step to read. `field` (the default) reads an output; `meta` reads completion details, such as who completed the step and when. Not used for a value collected across a loop.","type":"string","enum":["field","meta"]}},"required":["kind","expectedType","stepId","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"role-data"},"expectedType":{"type":"string","const":"TEXT"},"roleId":{"type":"string"},"field":{"type":"string","enum":["name","email","phone","title"]}},"required":["kind","expectedType","roleId","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"flow-input"},"expectedType":{"type":"string"},"inputId":{"type":"string","description":"The `key` of a flow field asked for when the flow starts, for example `client_name`. Not an id. Read from the start form's values."}},"required":["kind","expectedType","inputId"]},{"type":"object","properties":{"kind":{"type":"string","const":"custom-field"},"expectedType":{"type":"string"},"fieldId":{"type":"string"}},"required":["kind","expectedType","fieldId"]},{"type":"object","properties":{"kind":{"type":"string","const":"organization"},"expectedType":{"type":"string","const":"TEXT"},"attribute":{"type":"string","enum":["name","id"]}},"required":["kind","expectedType","attribute"]},{"type":"object","properties":{"kind":{"type":"string","const":"flow-metadata"},"expectedType":{"type":"string"},"attribute":{"type":"string","enum":["duedate","startdate","name","id"]}},"required":["kind","expectedType","attribute"]},{"type":"object","properties":{"kind":{"type":"string","const":"for-each-item"},"expectedType":{"type":"string"},"selector":{"type":"string","enum":["item","index","number","total"],"description":"What to read from the current pass of a loop. `item` reads a column of the current row; `index` (starting at 0), `number` (starting at 1) and `total` are the loop's counters."},"itemFieldId":{"description":"The column's id, for `item`. Preferred over `itemField`, because it still works after the column is renamed.","type":"string"},"itemField":{"description":"The column's label, for `item` when the list has no column ids. A label stops working when the column is renamed.","type":"string"}},"required":["kind","expectedType","selector"]},{"type":"object","properties":{"kind":{"type":"string","const":"for-each-aggregate"},"expectedType":{"type":"string"},"loopStepId":{"type":"string"},"bodyStepId":{"type":"string"},"field":{"type":"string"}},"required":["kind","expectedType","loopStepId","bodyStepId","field"]}]},"StepConfig_PREPARE_DOCUMENT_fields":{"type":"array","items":{"type":"object","properties":{"pdfFieldName":{"type":"string"},"label":{"type":"string"},"fieldType":{"type":"string","enum":["text","checkbox","dropdown","radio","signature","multi_select"]},"defaultValue":{"type":"string","description":"The fixed value written when the reference has no value."},"options":{"type":"array","items":{"type":"string"}},"dataRef":{"type":"string","description":"The reference to the value that fills this field, for example `${{ fields.employee_name }}`. Leave it empty to keep the field blank, for example a signature signed by hand after download."},"maxLength":{"type":"number"},"format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"text"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"number"},"min":{"type":"number","description":"The smallest number accepted, inclusive. Taken from the PDF's own range check on upload, or set in the field editor."},"max":{"type":"number","description":"The largest number accepted, inclusive. Taken from the PDF's own range check on upload, or set in the field editor."},"customMessage":{"type":"string","maxLength":500,"description":"The message shown when a number is out of range, instead of the standard one. Set in the field editor; an upload never fills it in."},"filledGroup":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"The group's name, the same on every field in it. When the group came from the PDF on upload, it is the PDF's own function name."},"sumMax":{"type":"number","description":"The largest total the group's filled values may add up to, inclusive. The same on every field in the group."}},"required":["id","sumMax"],"description":"A limit on the total of several number fields. Every field in the group has the same `id` and `sumMax`, and the filled values must add up to `sumMax` or less; empty values aren't counted. Set in the field editor, or taken from the PDF on upload when its own validation states the numbers."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"phone"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"email"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"zip"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"ssn"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"date"},"defaultToCurrentDate":{"type":"boolean"},"futureDatesOnly":{"type":"boolean"},"pastDatesOnly":{"type":"boolean"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"custom"},"regex":{"type":"string","minLength":1,"maxLength":500}},"required":["type","regex"]},{"type":"object","properties":{"type":{"type":"string","const":"number"},"min":{"description":"The smallest number accepted, inclusive. Taken from the PDF's own range check on upload, or set in the field editor.","type":"number"},"max":{"description":"The largest number accepted, inclusive. Taken from the PDF's own range check on upload, or set in the field editor.","type":"number"},"customMessage":{"description":"The message shown when a number is out of range, instead of the standard one. Set in the field editor; an upload never fills it in.","type":"string","maxLength":500},"filledGroup":{"description":"A limit on the total of several number fields. Every field in the group has the same `id` and `sumMax`, and the filled values must add up to `sumMax` or less; empty values aren't counted. Set in the field editor, or taken from the PDF on upload when its own validation states the numbers.","type":"object","properties":{"id":{"type":"string","minLength":1,"description":"The group's name, the same on every field in it. When the group came from the PDF on upload, it is the PDF's own function name."},"sumMax":{"type":"number","description":"The largest total the group's filled values may add up to, inclusive. The same on every field in the group."}},"required":["id","sumMax"]}},"required":["type"]}]},"page":{"type":"number"},"x":{"type":"number"},"y":{"type":"number"},"width":{"type":"number"},"height":{"type":"number"},"origin":{"type":"string","enum":["acroform","anchor","custom"]},"fieldId":{"type":"string","description":"The field's id. Keep it when sending the list back."},"context":{"type":"string","maxLength":500,"description":"A note for the AI that fills the field in: what the field asks for."},"required":{"type":"boolean","description":"Whether the field must be filled in."},"readOnly":{"type":"boolean","description":"Whether the field is shown but can't be changed."},"defaultValueSource":{"type":"string","enum":["builder","ddr","ai","person"],"description":"Where the field's starting value comes from."},"defaultValueFrom":{"type":"string","maxLength":300,"description":"The value the field starts with, as a reference to a flow value."},"placeholder":{"type":"string","description":"A hint shown in the empty field."},"multiline":{"type":"boolean","description":"Whether the field takes several lines of text."},"fontSize":{"type":"number","exclusiveMinimum":0,"description":"The size of the text written into the field, in points. Leave it out to use the form's size."},"widgetPositions":{"type":"array","items":{"type":"object","properties":{"page":{"type":"number","description":"The page the box is on, from 1."},"x":{"type":"number","description":"The box's left edge, in points from the left of the page."},"y":{"type":"number","description":"The box's top edge, in points from the top of the page."},"width":{"type":"number","description":"The box's width, in points."},"height":{"type":"number","description":"The box's height, in points."},"optionValue":{"type":"string","description":"For a choice: the value this box stands for."},"pdfFieldName":{"type":"string","description":"The name of the PDF's own form field for the box."}},"required":["page","x","y","width","height","optionValue"]},"description":"Where the field's boxes are on the document: one entry per box, such as one per choice of a radio group."},"assignedRoleId":{"type":"string","description":"The role that fills the field in, by its id."},"conditionalLogic":{"type":"object","properties":{"action":{"description":"Whether the field is shown or hidden when the conditions match. `show`: shown only when they match. `hide`: hidden when they match.","type":"string","enum":["show","hide"]},"logicType":{"description":"How the conditions combine. `all`: every condition must match. `any`: at least one must match.","type":"string","enum":["all","any"]},"conditions":{"type":"array","items":{"type":"object","properties":{"source":{"description":"Where the condition reads its value. `form`, or omitted: a field in this form. `ddr`: a value from earlier in the flow, such as an earlier step's answer, a start field or a role's details.","type":"string","enum":["form","ddr"]},"fieldKey":{"description":"The field in this form to test, by its field id. Required for a condition on this form, which is the default. Leave it out when `source` is `ddr`, where `ref` names the value instead.","type":"string"},"ref":{"description":"The value to test when `source` is `ddr`: a reference to a value from earlier in the flow, such as `${{ steps.intake.fields.segment }}`. Required for that source.","type":"string"},"operator":{"description":"How to compare the value. One of `equals`, `not_equals`, `contains`, `not_contains`, `greater_than`, `less_than`, `greater_than_or_equal`, `less_than_or_equal`, `starts_with`, `ends_with`, `is_empty`, `is_not_empty`, `in` or `not_in`.","type":"string","enum":["equals","not_equals","contains","not_contains","greater_than","less_than","greater_than_or_equal","less_than_or_equal","starts_with","ends_with","is_empty","is_not_empty","in","not_in"]},"value":{"type":"string","description":"The value the other field is compared with."},"valueRef":{"description":"The value to compare against, from earlier in the flow, such as `${{ steps.intake.fields.tier }}`. When set, the rule uses that value instead of `value`. A reference that is missing or empty does not match.","type":"string"},"relativeValue":{"type":"object","properties":{"anchor":{"type":"string","const":"today","description":"The date the offset counts from. Only `today` is supported: the date is worked out again each time the rule runs, so it never goes out of date."},"direction":{"type":"string","enum":["before","after"],"description":"Whether the compared date is before or after the anchor. With `offset` and `unit`, `before`, `3` and `years` mean three years before today."},"offset":{"type":"integer","minimum":0,"maximum":1000,"description":"How many units from the anchor: a whole number from 0 to 1000."},"unit":{"type":"string","enum":["days","weeks","months","years"],"description":"The unit of the offset: `days`, `weeks`, `months` or `years`."}},"required":["anchor","direction","offset","unit"],"description":"A value relative to today the other field is compared with, for a date."},"columnId":{"description":"For a rule on a Look up a record field in this form: the id of a column of the record it picks, from the field's `config.source.columns`. The rule then compares that column instead of the whole record. For an option column, `value` is the option id. When several records are picked, `equals` matches when any of them matches. A timestamp column, and a lookup with no columns, take only `is_empty` and `is_not_empty`.","type":"string"}},"required":["operator"]},"description":"The conditions that decide whether the field is shown. Each one tests another field in this form (`fieldKey`) or a value from earlier in the flow (`source: \"ddr\"` with `ref`)."}},"required":["action","logicType","conditions"],"description":"When the field is shown: the rules on other fields' values."},"initiallyHidden":{"type":"boolean","const":true}},"required":["pdfFieldName","label"]}},"StepConfig_PDF_FORM":{"type":"object","properties":{"guidedFill":{"type":"object","properties":{"enabled":{"type":"boolean","description":"Allows guided fill on this form. `true` lets the participant complete the form from the chat, with the form beside it. `false`, or no object, keeps the form manual only."},"defaultMode":{"type":"string","enum":["guided","manual"],"default":"guided","description":"Where the form opens when guided fill is allowed: `guided` opens the chat, `manual` opens the form. Defaults to `guided`. The participant can switch."}},"required":["enabled"],"description":"Guided fill on this PDF form. `{ enabled: true }` lets the participant complete it from the chat, with the PDF beside it. Omit it to keep the form manual only. Separate from `assist`."},"pdfForm":{"description":"The fillable PDF's settings.","$ref":"#/components/schemas/StepConfig_PDF_FORM_pdfForm"},"attachments":{"description":"Reference material shown on the step: files, web links or both. A web link (`{ kind: \"link\", url }`) is a page the assignee should open. Its `url` can be a fixed `https://` address or a reference to a value from earlier in the flow, such as `${{ steps.look_up_portal_link.fields.latest_url }}`, so a running flow always links to the latest address.","$ref":"#/components/schemas/StepConfigPart_attachments"},"preparers":{"anyOf":[{"type":"object","properties":{"participants":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["AI","HUMAN"]},"roleId":{"type":"string","description":"For a person: the role that takes this seat, by its id."},"contactId":{"type":"string","description":"An external user named on the seat, by the `usr_` id the template read shows. `null` follows the read, as for `userId`."},"userId":{"type":"string","description":"A person named on the seat, by the `usr_` id the template read shows. `null` where the read showed `null` (someone with no id here) keeps the saved person; `null` where it showed an id takes them off the seat."},"agentId":{"type":"string"},"prompt":{"type":"string","description":"The AI participant's step context: instructions for this step only."},"criteria":{"type":"string","description":"For an AI reviewer: what to check. Read before `prompt`."},"context":{"type":"string","description":"An older home of the AI participant's step context, still read. Set `prompt` instead."},"privateNotesGuidance":{"type":"string","maxLength":2000,"description":"When no agent is named: what the AI notes privately for the flow's managers."},"sendBackReply":{"type":"string","enum":["outcome_with_reason","outcome_only"],"description":"When the AI sends work back and no agent is named: what the reply says, `outcome_with_reason` or `outcome_only`."},"howToExplain":{"type":"string","maxLength":2000,"description":"When the AI sends work back and no agent is named: how it explains what to fix."},"inputs":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"value":{"type":"string"},"type":{"type":"string","enum":["TEXT","FILE"]}},"required":["name","value"]}},"participantId":{"type":"string","description":"The participant's id on the step. Keep it when sending the seat back; leave it out for a new participant."},"order":{"type":"number","description":"The participant's place in the seat, from 0, when they act one after another."},"aiConfig":{}},"required":["type"],"additionalProperties":{}}},"sequential":{"type":"boolean"},"completion":{"type":"object","properties":{"mode":{"type":"string","enum":["ANY_ONE","ALL"],"description":"`ANY_ONE`: one participant finishing is enough. `ALL`: every participant finishes."}},"required":["mode"],"description":"When the seat is done."},"showToExternalAssignee":{"description":"Advisors only. `true` lets an assignee outside your organization read the recommendation (the call and its reasons), as advice from your organization. Off unless set.","type":"boolean"},"canEditAnswers":{"description":"Reviewers only, on a Form, PDF form or File request step. `true` lets the reviewer whose turn it is edit the submitted answers (on a File request, add and remove its files) during review, in the Moxo app, instead of sending them back. Off unless set.","type":"boolean"},"reviewItemsTogether":{"description":"Reviewers only, on a person's step inside a For each whose items run at the same time. `true` gives the reviewer one list and one notice for every item instead of one review per item; each item keeps its own run and review. With the loop's `syncStepsAcrossIterations` on, the reviewer approves every item at once (`approve_reviews_together`); off, each item is approved on its own. Publish refuses it in a Repeat while, on an \"Approve before it runs\" step, with no person or role reviewing, and in a loop that runs items one at a time. Off unless set.","type":"boolean"}},"required":["participants"]},{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["AI","HUMAN"]},"roleId":{"type":"string"},"contactId":{"type":"string"},"userId":{"type":"string"},"agentId":{"type":"string"},"prompt":{"type":"string"},"criteria":{"type":"string"},"context":{"type":"string"},"privateNotesGuidance":{"type":"string","maxLength":2000},"sendBackReply":{"type":"string","enum":["outcome_with_reason","outcome_only"]},"howToExplain":{"type":"string","maxLength":2000},"inputs":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"value":{"type":"string"},"type":{"type":"string","enum":["TEXT","FILE"]}},"required":["name","value"]}},"ruleKinds":{"maxItems":80,"type":"array","items":{"type":"object","properties":{"rule":{"type":"string","minLength":1,"maxLength":2000},"kind":{"type":"string","enum":["fact","data_match","coverage","visual","judgment"]},"compare":{"type":"object","properties":{"check":{"type":"string","enum":["compare.money_equal","compare.date_after","compare.names_equal","certificate.insured_name_matches","certificate.limit_at_least","kyc.id_name_matches","kyc.birth_date_matches","kyc.dated_within_three_months"]},"against":{"type":"string","enum":["today","value","input"]},"value":{"type":"string","minLength":1,"maxLength":500},"input":{"type":"string","minLength":1,"maxLength":200}},"required":["check","against"]},"document":{"type":"string","minLength":1,"maxLength":200},"sum":{"type":"object","properties":{"fields":{"minItems":2,"maxItems":60,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}}},"required":["fields"]}},"required":["rule","kind"]}},"participantId":{"type":"string"},"order":{"type":"number"},"aiConfig":{}},"required":["type"],"additionalProperties":{}}}]},"reviewers":{"anyOf":[{"type":"object","properties":{"participants":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["AI","HUMAN"]},"roleId":{"type":"string","description":"For a person: the role that takes this seat, by its id."},"contactId":{"type":"string","description":"An external user named on the seat, by the `usr_` id the template read shows. `null` follows the read, as for `userId`."},"userId":{"type":"string","description":"A person named on the seat, by the `usr_` id the template read shows. `null` where the read showed `null` (someone with no id here) keeps the saved person; `null` where it showed an id takes them off the seat."},"agentId":{"type":"string"},"prompt":{"type":"string","description":"The AI participant's step context: instructions for this step only."},"criteria":{"type":"string","description":"For an AI reviewer: what to check. Read before `prompt`."},"context":{"type":"string","description":"An older home of the AI participant's step context, still read. Set `prompt` instead."},"privateNotesGuidance":{"type":"string","maxLength":2000,"description":"When no agent is named: what the AI notes privately for the flow's managers."},"sendBackReply":{"type":"string","enum":["outcome_with_reason","outcome_only"],"description":"When the AI sends work back and no agent is named: what the reply says, `outcome_with_reason` or `outcome_only`."},"howToExplain":{"type":"string","maxLength":2000,"description":"When the AI sends work back and no agent is named: how it explains what to fix."},"inputs":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"value":{"type":"string"},"type":{"type":"string","enum":["TEXT","FILE"]}},"required":["name","value"]}},"participantId":{"type":"string","description":"The participant's id on the step. Keep it when sending the seat back; leave it out for a new participant."},"order":{"type":"number","description":"The participant's place in the seat, from 0, when they act one after another."},"aiConfig":{}},"required":["type"],"additionalProperties":{}}},"sequential":{"type":"boolean"},"completion":{"type":"object","properties":{"mode":{"type":"string","enum":["ANY_ONE","ALL"],"description":"`ANY_ONE`: one participant finishing is enough. `ALL`: every participant finishes."}},"required":["mode"],"description":"When the seat is done."},"showToExternalAssignee":{"description":"Advisors only. `true` lets an assignee outside your organization read the recommendation (the call and its reasons), as advice from your organization. Off unless set.","type":"boolean"},"canEditAnswers":{"description":"Reviewers only, on a Form, PDF form or File request step. `true` lets the reviewer whose turn it is edit the submitted answers (on a File request, add and remove its files) during review, in the Moxo app, instead of sending them back. Off unless set.","type":"boolean"},"reviewItemsTogether":{"description":"Reviewers only, on a person's step inside a For each whose items run at the same time. `true` gives the reviewer one list and one notice for every item instead of one review per item; each item keeps its own run and review. With the loop's `syncStepsAcrossIterations` on, the reviewer approves every item at once (`approve_reviews_together`); off, each item is approved on its own. Publish refuses it in a Repeat while, on an \"Approve before it runs\" step, with no person or role reviewing, and in a loop that runs items one at a time. Off unless set.","type":"boolean"}},"required":["participants"]},{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["AI","HUMAN"]},"roleId":{"type":"string"},"contactId":{"type":"string"},"userId":{"type":"string"},"agentId":{"type":"string"},"prompt":{"type":"string"},"criteria":{"type":"string"},"context":{"type":"string"},"privateNotesGuidance":{"type":"string","maxLength":2000},"sendBackReply":{"type":"string","enum":["outcome_with_reason","outcome_only"]},"howToExplain":{"type":"string","maxLength":2000},"inputs":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"value":{"type":"string"},"type":{"type":"string","enum":["TEXT","FILE"]}},"required":["name","value"]}},"ruleKinds":{"maxItems":80,"type":"array","items":{"type":"object","properties":{"rule":{"type":"string","minLength":1,"maxLength":2000},"kind":{"type":"string","enum":["fact","data_match","coverage","visual","judgment"]},"compare":{"type":"object","properties":{"check":{"type":"string","enum":["compare.money_equal","compare.date_after","compare.names_equal","certificate.insured_name_matches","certificate.limit_at_least","kyc.id_name_matches","kyc.birth_date_matches","kyc.dated_within_three_months"]},"against":{"type":"string","enum":["today","value","input"]},"value":{"type":"string","minLength":1,"maxLength":500},"input":{"type":"string","minLength":1,"maxLength":200}},"required":["check","against"]},"document":{"type":"string","minLength":1,"maxLength":200},"sum":{"type":"object","properties":{"fields":{"minItems":2,"maxItems":60,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}}},"required":["fields"]}},"required":["rule","kind"]}},"participantId":{"type":"string"},"order":{"type":"number"},"aiConfig":{}},"required":["type"],"additionalProperties":{}}}]},"aiEscalation":{"type":"object","properties":{"roleId":{"anyOf":[{"type":"string","minLength":1,"maxLength":80},{"type":"null"}]},"deskId":{"description":"A team desk instead of a role: the hand-off waits in the desk's queue until someone on it claims it. Set `roleId` or `deskId`, never both.","anyOf":[{"type":"string","minLength":1,"maxLength":80},{"type":"null"}]}},"additionalProperties":false},"visibleToAllAssignees":{"type":"boolean"},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"}},"title":"PDF Form","description":"Fills a PDF template with flow data, and can collect signatures or entries from people.\n\nThe settings a template read (`GET /v1/templates/{id}`) returns for this type, as stored. The shared settings (due date, reminders, visibility, monitors) can appear alongside them. To set them in a change, send `StepSettings_PDF_FORM`: where this shape holds an id, a change can name a role, field or step by its name or handle.\n\n**Offered by plan:** available when the organization's plan includes `pdfForm`.","x-moxo-step-type":"PDF_FORM","x-moxo-category":"HUMAN_ACTION","x-moxo-plan-feature":"pdfForm"},"StepConfig_PDF_FORM_pdfForm":{"type":"object","properties":{"fileName":{"type":"string","description":"The PDF's original file name, used when it is downloaded."},"fields":{"type":"array","items":{"type":"object","properties":{"pdfFieldName":{"type":"string"},"label":{"type":"string"},"fieldType":{"type":"string","enum":["text","checkbox","dropdown","radio","signature","multi_select"]},"required":{"type":"boolean"},"readOnly":{"type":"boolean"},"defaultValue":{"type":"string"},"options":{"type":"array","items":{"type":"string"}},"dataRef":{"type":"string","description":"A reference to a value from earlier in the flow that fills in this field in advance."},"assignedRoleId":{"type":"string","description":"With per-role field assignment: the id of the role that fills in this field."},"maxLength":{"type":"number"},"format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"text"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"number"},"min":{"type":"number","description":"The smallest number accepted, inclusive. Taken from the PDF's own range check on upload, or set in the field editor."},"max":{"type":"number","description":"The largest number accepted, inclusive. Taken from the PDF's own range check on upload, or set in the field editor."},"customMessage":{"type":"string","maxLength":500,"description":"The message shown when a number is out of range, instead of the standard one. Set in the field editor; an upload never fills it in."},"filledGroup":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"The group's name, the same on every field in it. When the group came from the PDF on upload, it is the PDF's own function name."},"sumMax":{"type":"number","description":"The largest total the group's filled values may add up to, inclusive. The same on every field in the group."}},"required":["id","sumMax"],"description":"A limit on the total of several number fields. Every field in the group has the same `id` and `sumMax`, and the filled values must add up to `sumMax` or less; empty values aren't counted. Set in the field editor, or taken from the PDF on upload when its own validation states the numbers."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"phone"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"email"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"zip"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"ssn"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"date"},"defaultToCurrentDate":{"type":"boolean"},"futureDatesOnly":{"type":"boolean"},"pastDatesOnly":{"type":"boolean"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"custom"},"regex":{"type":"string","minLength":1,"maxLength":500}},"required":["type","regex"]},{"type":"object","properties":{"type":{"type":"string","const":"number"},"min":{"description":"The smallest number accepted, inclusive. Taken from the PDF's own range check on upload, or set in the field editor.","type":"number"},"max":{"description":"The largest number accepted, inclusive. Taken from the PDF's own range check on upload, or set in the field editor.","type":"number"},"customMessage":{"description":"The message shown when a number is out of range, instead of the standard one. Set in the field editor; an upload never fills it in.","type":"string","maxLength":500},"filledGroup":{"description":"A limit on the total of several number fields. Every field in the group has the same `id` and `sumMax`, and the filled values must add up to `sumMax` or less; empty values aren't counted. Set in the field editor, or taken from the PDF on upload when its own validation states the numbers.","type":"object","properties":{"id":{"type":"string","minLength":1,"description":"The group's name, the same on every field in it. When the group came from the PDF on upload, it is the PDF's own function name."},"sumMax":{"type":"number","description":"The largest total the group's filled values may add up to, inclusive. The same on every field in the group."}},"required":["id","sumMax"]}},"required":["type"]}]},"page":{"type":"number"},"x":{"type":"number"},"y":{"type":"number"},"width":{"type":"number"},"height":{"type":"number"},"origin":{"type":"string","enum":["acroform","anchor","custom"],"description":"Where the field came from: `acroform` (one of the PDF's own form fields), `anchor` (found automatically by AI) or `custom` (added in the template builder)."},"conditionalLogic":{"description":"When the field is shown or hidden, with the same rules as a form field: `{ action: \"show\" | \"hide\", logicType: \"all\" | \"any\", conditions: [...] }`. Rules the PDF already has are imported with it.","$ref":"#/components/schemas/StepConfig_PDF_FORM_conditionalLogic"},"initiallyHidden":{"type":"boolean","const":true,"description":"The PDF hides this field when it opens, and none of the field's own rules shows it. Keep the value read from the PDF; leave it out otherwise, and on a field that has its own rule."},"fieldId":{"type":"string","description":"The field's id. Keep it when sending the list back."},"context":{"type":"string","maxLength":500,"description":"A note for the AI that fills the field in: what the field asks for."},"defaultValueSource":{"type":"string","enum":["builder","ddr","ai","person"],"description":"Where the field's starting value comes from."},"defaultValueFrom":{"type":"string","maxLength":300,"description":"The value the field starts with, as a reference to a flow value."},"placeholder":{"type":"string","description":"A hint shown in the empty field."},"multiline":{"type":"boolean","description":"Whether the field takes several lines of text."},"fontSize":{"type":"number","exclusiveMinimum":0,"description":"The size of the text written into the field, in points. Leave it out to use the form's size."},"widgetPositions":{"type":"array","items":{"type":"object","properties":{"page":{"type":"number","description":"The page the box is on, from 1."},"x":{"type":"number","description":"The box's left edge, in points from the left of the page."},"y":{"type":"number","description":"The box's top edge, in points from the top of the page."},"width":{"type":"number","description":"The box's width, in points."},"height":{"type":"number","description":"The box's height, in points."},"optionValue":{"type":"string","description":"For a choice: the value this box stands for."},"pdfFieldName":{"type":"string","description":"The name of the PDF's own form field for the box."}},"required":["page","x","y","width","height","optionValue"]},"description":"Where the field's boxes are on the document: one entry per box, such as one per choice of a radio group."}},"required":["pdfFieldName","label"]}},"autoFolder":{"type":"string","description":"A folder in the flow's Files panel for the filled PDF. A plain name is used as written. The name can include a value from earlier in the flow. An empty value is left out, and the text around it stays. If nothing is left, the file stays unfiled."},"documentRef":{"anyOf":[{"type":"string"},{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"literal"},"expectedType":{"type":"string"},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}],"description":"A fixed value. Its JSON type follows `expectedType`: a number for `NUMBER`, a boolean for `BOOLEAN` and text for everything else."}},"required":["kind","expectedType","value"]},{"type":"object","properties":{"kind":{"type":"string","const":"step-output"},"expectedType":{"type":"string"},"stepId":{"type":"string","description":"The id of the step that produces the value."},"field":{"type":"string","description":"The output's key on that step. On a form step it is the question's key (`fieldId`); a label is accepted and stored as that key, and a label two questions share is refused at publish. On an AI step, the output's `name`; on an e-signature or PDF form step, the step type's output name. Not the handle."},"channel":{"description":"Which part of the step to read. `field` (the default) reads an output; `meta` reads completion details, such as who completed the step and when. Not used for a value collected across a loop.","type":"string","enum":["field","meta"]}},"required":["kind","expectedType","stepId","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"role-data"},"expectedType":{"type":"string","const":"TEXT"},"roleId":{"type":"string"},"field":{"type":"string","enum":["name","email","phone","title"]}},"required":["kind","expectedType","roleId","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"flow-input"},"expectedType":{"type":"string"},"inputId":{"type":"string","description":"The `key` of a flow field asked for when the flow starts, for example `client_name`. Not an id. Read from the start form's values."}},"required":["kind","expectedType","inputId"]},{"type":"object","properties":{"kind":{"type":"string","const":"custom-field"},"expectedType":{"type":"string"},"fieldId":{"type":"string"}},"required":["kind","expectedType","fieldId"]},{"type":"object","properties":{"kind":{"type":"string","const":"organization"},"expectedType":{"type":"string","const":"TEXT"},"attribute":{"type":"string","enum":["name","id"]}},"required":["kind","expectedType","attribute"]},{"type":"object","properties":{"kind":{"type":"string","const":"flow-metadata"},"expectedType":{"type":"string"},"attribute":{"type":"string","enum":["duedate","startdate","name","id"]}},"required":["kind","expectedType","attribute"]},{"type":"object","properties":{"kind":{"type":"string","const":"for-each-item"},"expectedType":{"type":"string"},"selector":{"type":"string","enum":["item","index","number","total"],"description":"What to read from the current pass of a loop. `item` reads a column of the current row; `index` (starting at 0), `number` (starting at 1) and `total` are the loop's counters."},"itemFieldId":{"description":"The column's id, for `item`. Preferred over `itemField`, because it still works after the column is renamed.","type":"string"},"itemField":{"description":"The column's label, for `item` when the list has no column ids. A label stops working when the column is renamed.","type":"string"}},"required":["kind","expectedType","selector"]},{"type":"object","properties":{"kind":{"type":"string","const":"for-each-aggregate"},"expectedType":{"type":"string"},"loopStepId":{"type":"string"},"bodyStepId":{"type":"string"},"field":{"type":"string"}},"required":["kind","expectedType","loopStepId","bodyStepId","field"]}]}]},"defaultFontSize":{"type":"number","exclusiveMinimum":0,"description":"The size of the text written into the form, in points."},"appearance":{"type":"object","properties":{"mode":{"type":"string","enum":["inherit","custom"],"description":"`inherit` uses the document's own style; `custom` uses `font` and `colorHex`."},"font":{"type":"string","enum":["HELVETICA","TIMES","COURIER"],"description":"With `mode` `custom`: `HELVETICA`, `TIMES` or `COURIER`."},"colorHex":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$","description":"With `mode` `custom`: the ink color, such as `#1F3A5F`."}},"required":["mode"],"description":"The style of the text written into the document."},"requireOptionalConfirmation":{"type":"boolean","description":"Whether the person is asked to confirm before leaving optional fields empty."},"textOverflow":{"type":"string","enum":["shrink","keep"],"description":"What happens to an answer longer than its box: `shrink` prints it smaller until it fits (the default), `keep` keeps the text size and cuts off the end."}}},"StepConfig_PDF_FORM_conditionalLogic":{"type":"object","properties":{"action":{"type":"string","enum":["show","hide"],"description":"Whether the field is shown or hidden when the conditions match. `show`: shown only when they match. `hide`: hidden when they match."},"logicType":{"type":"string","enum":["all","any"],"description":"How the conditions combine. `all`: every condition must match. `any`: at least one must match."},"conditions":{"type":"array","items":{"type":"object","properties":{"source":{"type":"string","enum":["form","ddr"],"description":"Where the condition reads its value. `form`, or omitted: a field in this form. `ddr`: a value from earlier in the flow, such as an earlier step's answer, a start field or a role's details."},"fieldKey":{"type":"string","description":"The field in this form to test, by its field id. Required for a condition on this form, which is the default. Leave it out when `source` is `ddr`, where `ref` names the value instead."},"ref":{"type":"string","description":"The value to test when `source` is `ddr`: a reference to a value from earlier in the flow, such as `${{ steps.intake.fields.segment }}`. Required for that source."},"operator":{"type":"string","enum":["equals","not_equals","contains","not_contains","greater_than","less_than","greater_than_or_equal","less_than_or_equal","starts_with","ends_with","is_empty","is_not_empty","in","not_in"],"description":"How to compare the value. One of `equals`, `not_equals`, `contains`, `not_contains`, `greater_than`, `less_than`, `greater_than_or_equal`, `less_than_or_equal`, `starts_with`, `ends_with`, `is_empty`, `is_not_empty`, `in` or `not_in`."},"value":{"type":"string"},"valueRef":{"type":"string","description":"The value to compare against, from earlier in the flow, such as `${{ steps.intake.fields.tier }}`. When set, the rule uses that value instead of `value`. A reference that is missing or empty does not match."},"relativeValue":{"$ref":"#/components/schemas/StepConfigPart_relativeValue"},"columnId":{"type":"string","description":"For a rule on a Look up a record field in this form: the id of a column of the record it picks, from the field's `config.source.columns`. The rule then compares that column instead of the whole record. For an option column, `value` is the option id. When several records are picked, `equals` matches when any of them matches. A timestamp column, and a lookup with no columns, take only `is_empty` and `is_not_empty`."}},"required":["operator"]},"description":"The conditions that decide whether the field is shown. Each one tests another field in this form (`fieldKey`) or a value from earlier in the flow (`source: \"ddr\"` with `ref`)."}},"required":["action","logicType","conditions"]},"StepConfig_TIME_BOOKING":{"type":"object","properties":{"booking":{"type":"object","properties":{"providerKind":{"type":"string","enum":["calendar","scheduler","manual"]},"availability":{"type":"object","properties":{"timezone":{"type":"string","minLength":1},"bookableHours":{"type":"boolean","const":true},"weeklyWindows":{"minItems":1,"type":"array","items":{"type":"object","properties":{"dayOfWeek":{"type":"integer","minimum":0,"maximum":6},"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["dayOfWeek","start","end"]}},"dateOverrides":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"The day, as `YYYY-MM-DD`."},"blocked":{"type":"boolean","description":"Whether the day can't be booked at all."},"windows":{"type":"array","items":{"type":"object","properties":{"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$","description":"When the hours start, as `HH:MM`."},"end":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$","description":"When the hours end, as `HH:MM`."}},"required":["start","end"]},"description":"The hours that can be booked that day."}},"required":["date"]},"description":"Days whose hours differ from the weekly hours."}},"required":["timezone","weeklyWindows"]},"calendarProvider":{"type":"string","enum":["GOOGLE_CALENDAR","OUTLOOK_CALENDAR"]},"meetingType":{"type":"string","enum":["GOOGLE_MEET","TEAMS","ZOOM","OFFLINE","PHONE","MEETING_LINK","MOXO_MEET"]},"alsoOffer":{"type":"string","enum":["GOOGLE_MEET","TEAMS","ZOOM","OFFLINE","MOXO_MEET"]},"duration":{"default":30,"type":"integer","minimum":15,"maximum":480,"multipleOf":5},"startIntervalMinutes":{"description":"How far apart the times a person can book start: 15, 30 or 60 minutes. Leave it out and a new time starts as often as the meeting is long.","anyOf":[{"type":"number","const":15},{"type":"number","const":30},{"type":"number","const":60}]},"bookingBufferDays":{"default":0,"type":"integer","minimum":0,"maximum":365},"timeDisplay":{"type":"string","enum":["auto","hour12","hour24"]},"extraReminder":{"type":"object","properties":{"enabled":{"type":"boolean","description":"Whether the extra reminder is sent. Defaults to `false`."},"hoursBefore":{"type":"integer","minimum":1,"maximum":24,"description":"How many hours before the meeting the extra reminder goes: a whole number from 1 to 24. Defaults to 24."},"recipients":{"type":"object","properties":{"booker":{"type":"boolean","description":"Whether the person who books the meeting gets it. Defaults to `false`."},"additionalParticipants":{"type":"boolean","description":"Whether the step's additional participants get it. Defaults to `true`."}},"description":"Who gets the extra reminder. The host never does. With `enabled` `true`, pick at least one, or publishing is refused."}},"description":"One more reminder before the meeting, on top of the reminder always sent 10 minutes before. Leave it out for none. Only with the meeting reminders beta on for your organization, and not with `providerKind` `scheduler`."},"participants":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["ROLE","CONTACT","USER"]},"roleId":{"type":"string"},"contactId":{"type":"string"},"userId":{"type":"string"},"email":{"type":"string"}},"required":["type"]}},"hostRoleId":{"type":"string"},"hostRoleIds":{"type":"array","items":{"type":"string"}},"bookWith":{"type":"string","enum":["any","all"]},"tieBreak":{"type":"string","enum":["priority","balance"]},"balanceWindow":{"type":"string","enum":["today","week"]},"hostPriorityUserIds":{"type":"array","items":{"type":"string"}},"meetingTitle":{"type":"string"},"agenda":{"type":"string"},"location":{"type":"string"},"pickPlaceAtBooking":{"type":"boolean"},"offeredBranchIds":{"maxItems":500,"type":"array","items":{"type":"string","minLength":1,"maxLength":256},"description":"On a Time Booking action sent from a conversation: the Microsoft 365 room lists (branches), by id, a person choosing to meet in person may pick from. Leave it out to offer every branch. Ignored on a template: a flow started from a template always offers every branch."},"bookerCanCancel":{"type":"boolean"},"bookerCanReschedule":{"type":"boolean"},"onMeetingCanceled":{"type":"string","enum":["continue","end_flow"]},"meetingLinkUrl":{"type":"string","maxLength":2048},"meetingLinkAudience":{"default":"booker_only","type":"string","enum":["everyone_invited","booker_only"]},"meetingLinkHostNote":{"type":"string","maxLength":2000},"schedulerProvider":{"type":"string","enum":["zoom","calendly"],"description":"With `providerKind` `scheduler`: the scheduling app, `zoom` or `calendly`."},"connectionId":{"type":"string","description":"With `providerKind` `scheduler`: the host's account in that app, by its id or name."},"scheduleId":{"type":"string","description":"With `providerKind` `scheduler`: the schedule or event type in that app the person books."},"scheduleName":{"type":"string","description":"The schedule's name, as shown on the step."},"durationMinutes":{"type":"number","description":"How long the meeting is, in minutes, as shown on the step."},"meetingPurpose":{"type":"string","description":"A short note on what the meeting is for, passed on to the scheduling app. Can include flow values."}}},"visibleToAllAssignees":{"type":"boolean"},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"}},"title":"Time Booking","description":"Lets an assignee pick a meeting time from an internal user's calendar.\n\nThe settings a template read (`GET /v1/templates/{id}`) returns for this type, as stored. The shared settings (due date, reminders, visibility, monitors) can appear alongside them. To set them in a change, send `StepSettings_TIME_BOOKING`: where this shape holds an id, a change can name a role, field or step by its name or handle.\n\n**Offered by plan:** available when the organization's plan includes `timeBooking`.","x-moxo-step-type":"TIME_BOOKING","x-moxo-category":"HUMAN_ACTION","x-moxo-plan-feature":"timeBooking"},"StepConfig_SINGLE_CHOICE_BRANCH":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"paths":{"minItems":2,"maxItems":50,"type":"array","items":{"type":"object","properties":{"pathId":{"type":"string"},"label":{"type":"string"},"condition":{"$ref":"#/components/schemas/StepConfigPart_condition"},"conditions":{"maxItems":20,"type":"array","items":{"$ref":"#/components/schemas/StepConfigPart_condition"}},"conditionLogic":{"type":"string","enum":["ALL","ANY"]},"steps":{"type":"array","items":{}},"milestones":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"stepIds":{"type":"array","items":{"type":"string"}},"dueDate":{"type":"object","properties":{"type":{"type":"string","const":"RELATIVE"},"value":{"type":"number"},"unit":{"type":"string","enum":["HOURS","DAYS","WEEKS"]}},"required":["type","value","unit"]}},"required":["id","name","stepIds"]}},"isDefault":{"type":"boolean","description":"The path taken when no other path's condition matches."}},"required":["pathId","label","steps"]}},"skipSequentialOrder":{"type":"boolean"},"visibleToAllAssignees":{"type":"boolean"},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"}},"required":["paths"],"title":"Single Choice Branch (If/Else)","description":"Branches the flow into paths where exactly one runs, chosen by conditions.\n\nThe settings a template read (`GET /v1/templates/{id}`) returns for this type, as stored. The shared settings (due date, reminders, visibility, monitors) can appear alongside them. To set them in a change, send `StepSettings_SINGLE_CHOICE_BRANCH`: where this shape holds an id, a change can name a role, field or step by its name or handle.\n\n**Offered by plan:** available when the organization's plan includes `singleChoiceBranch`.","x-moxo-step-type":"SINGLE_CHOICE_BRANCH","x-moxo-category":"CONTROL","x-moxo-plan-feature":"singleChoiceBranch"},"StepConfigPart_condition":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"EQUALS"},"left":{"$ref":"#/components/schemas/StepConfigPart_left"},"right":{"$ref":"#/components/schemas/StepConfigPart_left"}},"required":["type","left","right"]},{"type":"object","properties":{"type":{"type":"string","const":"NOT_EQUALS"},"left":{"$ref":"#/components/schemas/StepConfigPart_left"},"right":{"$ref":"#/components/schemas/StepConfigPart_left"}},"required":["type","left","right"]},{"type":"object","properties":{"type":{"type":"string","const":"CONTAINS"},"left":{"$ref":"#/components/schemas/StepConfigPart_left"},"right":{"$ref":"#/components/schemas/StepConfigPart_left"}},"required":["type","left","right"]},{"type":"object","properties":{"type":{"type":"string","const":"NOT_CONTAINS"},"left":{"$ref":"#/components/schemas/StepConfigPart_left"},"right":{"$ref":"#/components/schemas/StepConfigPart_left"}},"required":["type","left","right"]},{"type":"object","properties":{"type":{"type":"string","const":"ARRAY_CONTAINS"},"left":{"$ref":"#/components/schemas/StepConfigPart_left"},"right":{"$ref":"#/components/schemas/StepConfigPart_left"}},"required":["type","left","right"]},{"type":"object","properties":{"type":{"type":"string","const":"STARTS_WITH"},"left":{"$ref":"#/components/schemas/StepConfigPart_left"},"right":{"$ref":"#/components/schemas/StepConfigPart_left"}},"required":["type","left","right"]},{"type":"object","properties":{"type":{"type":"string","const":"ENDS_WITH"},"left":{"$ref":"#/components/schemas/StepConfigPart_left"},"right":{"$ref":"#/components/schemas/StepConfigPart_left"}},"required":["type","left","right"]},{"type":"object","properties":{"type":{"type":"string","const":"GREATER_THAN"},"left":{"$ref":"#/components/schemas/StepConfigPart_left"},"right":{"$ref":"#/components/schemas/StepConfigPart_left"}},"required":["type","left","right"]},{"type":"object","properties":{"type":{"type":"string","const":"LESS_THAN"},"left":{"$ref":"#/components/schemas/StepConfigPart_left"},"right":{"$ref":"#/components/schemas/StepConfigPart_left"}},"required":["type","left","right"]},{"type":"object","properties":{"type":{"type":"string","const":"GREATER_THAN_OR_EQUAL"},"left":{"$ref":"#/components/schemas/StepConfigPart_left"},"right":{"$ref":"#/components/schemas/StepConfigPart_left"}},"required":["type","left","right"]},{"type":"object","properties":{"type":{"type":"string","const":"LESS_THAN_OR_EQUAL"},"left":{"$ref":"#/components/schemas/StepConfigPart_left"},"right":{"$ref":"#/components/schemas/StepConfigPart_left"}},"required":["type","left","right"]},{"type":"object","properties":{"type":{"type":"string","const":"IN"},"left":{"$ref":"#/components/schemas/StepConfigPart_left"},"right":{"$ref":"#/components/schemas/StepConfigPart_left"}},"required":["type","left","right"]},{"type":"object","properties":{"type":{"type":"string","const":"NOT_IN"},"left":{"$ref":"#/components/schemas/StepConfigPart_left"},"right":{"$ref":"#/components/schemas/StepConfigPart_left"}},"required":["type","left","right"]},{"type":"object","properties":{"type":{"type":"string","const":"IS_EMPTY"},"left":{"$ref":"#/components/schemas/StepConfigPart_left"}},"required":["type","left"]},{"type":"object","properties":{"type":{"type":"string","const":"NOT_EMPTY"},"left":{"$ref":"#/components/schemas/StepConfigPart_left"}},"required":["type","left"]},{"type":"object","properties":{"type":{"type":"string","const":"ELSE"}},"required":["type"]}]},"StepConfig_MULTI_CHOICE_BRANCH":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"paths":{"minItems":2,"maxItems":50,"type":"array","items":{"type":"object","properties":{"pathId":{"type":"string"},"label":{"type":"string"},"condition":{"$ref":"#/components/schemas/StepConfigPart_condition"},"conditions":{"maxItems":20,"type":"array","items":{"$ref":"#/components/schemas/StepConfigPart_condition"}},"conditionLogic":{"type":"string","enum":["ALL","ANY"]},"steps":{"type":"array","items":{}},"milestones":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"stepIds":{"type":"array","items":{"type":"string"}},"dueDate":{"type":"object","properties":{"type":{"type":"string","const":"RELATIVE"},"value":{"type":"number"},"unit":{"type":"string","enum":["HOURS","DAYS","WEEKS"]}},"required":["type","value","unit"]}},"required":["id","name","stepIds"]}},"isDefault":{"type":"boolean","description":"The path taken when no other path's condition matches."}},"required":["pathId","label","steps"]}},"visibleToAllAssignees":{"type":"boolean"},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"}},"required":["paths"],"title":"Multi Choice Branch","description":"Checks several conditions and runs every path whose condition is true.\n\nThe settings a template read (`GET /v1/templates/{id}`) returns for this type, as stored. The shared settings (due date, reminders, visibility, monitors) can appear alongside them. To set them in a change, send `StepSettings_MULTI_CHOICE_BRANCH`: where this shape holds an id, a change can name a role, field or step by its name or handle.\n\n**Offered by plan:** available when the organization's plan includes `multiChoiceBranch`.","x-moxo-step-type":"MULTI_CHOICE_BRANCH","x-moxo-category":"CONTROL","x-moxo-plan-feature":"multiChoiceBranch"},"StepConfig_PARALLEL_BRANCH":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"paths":{"minItems":2,"maxItems":10,"type":"array","items":{"$ref":"#/components/schemas/StepConfig_PARALLEL_BRANCH_pathsItem"}},"visibleToAllAssignees":{"type":"boolean"},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"}},"required":["paths"],"title":"Parallel Branch","description":"Runs several paths at the same time and waits for all of them to finish before continuing.\n\nThe settings a template read (`GET /v1/templates/{id}`) returns for this type, as stored. The shared settings (due date, reminders, visibility, monitors) can appear alongside them. To set them in a change, send `StepSettings_PARALLEL_BRANCH`: where this shape holds an id, a change can name a role, field or step by its name or handle.\n\n**Offered by plan:** available when the organization's plan includes `parallelBranch`.","x-moxo-step-type":"PARALLEL_BRANCH","x-moxo-category":"CONTROL","x-moxo-plan-feature":"parallelBranch"},"StepConfig_PARALLEL_BRANCH_pathsItem":{"type":"object","properties":{"pathId":{"type":"string"},"label":{"type":"string"},"steps":{"type":"array","items":{}},"milestones":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"stepIds":{"type":"array","items":{"type":"string"}},"dueDate":{"type":"object","properties":{"type":{"type":"string","const":"RELATIVE"},"value":{"type":"number"},"unit":{"type":"string","enum":["HOURS","DAYS","WEEKS"]}},"required":["type","value","unit"]}},"required":["id","name","stepIds"]}}},"required":["pathId","label","steps"]},"StepConfig_JUMP":{"type":"object","properties":{"targetStepId":{"type":"string"},"preserveData":{"type":"boolean"},"visibleToAllAssignees":{"type":"boolean"},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"}},"title":"Jump","description":"Moves the flow to another step, for example back to an earlier step for a revision, or ahead past steps that only other paths need. A jump inside a parallel path, a loop or a multi-choice path stays within that path.\n\nThe settings a template read (`GET /v1/templates/{id}`) returns for this type, as stored. The shared settings (due date, reminders, visibility, monitors) can appear alongside them. To set them in a change, send `StepSettings_JUMP`: where this shape holds an id, a change can name a role, field or step by its name or handle.\n\n**Offered by plan:** available when the organization's plan includes `jump`.","x-moxo-step-type":"JUMP","x-moxo-category":"CONTROL","x-moxo-plan-feature":"jump"},"StepConfig_TERMINATE":{"type":"object","properties":{"terminateStatus":{"type":"string","enum":["COMPLETED","CANCELLED"],"description":"The flow's final status: `COMPLETED` or `CANCELLED`."},"terminateReason":{"type":"string","description":"The short reason shown when the flow ends."},"visibleToAllAssignees":{"type":"boolean"},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"}},"title":"Terminate","description":"Ends the flow with a set status, completed or canceled.\n\nThe settings a template read (`GET /v1/templates/{id}`) returns for this type, as stored. The shared settings (due date, reminders, visibility, monitors) can appear alongside them. To set them in a change, send `StepSettings_TERMINATE`: where this shape holds an id, a change can name a role, field or step by its name or handle.\n\n**Offered by plan:** available when the organization's plan includes `terminate`.","x-moxo-step-type":"TERMINATE","x-moxo-category":"CONTROL","x-moxo-plan-feature":"terminate"},"StepConfig_WAIT":{"type":"object","properties":{"notifications":{"$ref":"#/components/schemas/StepConfig_WAIT_notifications"},"waitFor":{"description":"What the step waits for.","$ref":"#/components/schemas/StepConfig_WAIT_waitFor"},"visibleToAllAssignees":{"type":"boolean"},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"}},"title":"Wait","description":"Pauses the flow: for a length of time, until a date, until a sub-flow finishes, until another system calls back, until your own system picks up and finishes a task, or until a record in a connected app or a data table matches a condition.\n\nThe settings a template read (`GET /v1/templates/{id}`) returns for this type, as stored. The shared settings (due date, reminders, visibility, monitors) can appear alongside them. To set them in a change, send `StepSettings_WAIT`: where this shape holds an id, a change can name a role, field or step by its name or handle.\n\n**Offered by plan:** available when the organization's plan includes `wait`.","x-moxo-step-type":"WAIT","x-moxo-category":"CONTROL","x-moxo-plan-feature":"wait"},"StepConfig_WAIT_notifications":{"type":"object","properties":{"enabled":{"type":"boolean"},"roleIds":{"type":"array","items":{"type":"string"}},"subject":{"type":"string"},"body":{"type":"string"},"onStart":{"type":"boolean"},"repeat":{"anyOf":[{"type":"object","properties":{"every":{"type":"number"},"unit":{"type":"string","enum":["HOURS","DAYS"]},"upTo":{"type":"number"}},"required":["every","unit","upTo"]},{"type":"null"}]},"beforeEnd":{"anyOf":[{"type":"object","properties":{"value":{"type":"number"},"unit":{"type":"string","enum":["HOURS","DAYS"]}},"required":["value","unit"]},{"type":"null"}]}},"required":["enabled"]},"StepConfig_WAIT_waitFor":{"type":"object","properties":{"type":{"$ref":"#/components/schemas/StepConfig_WAIT_type"},"duration":{"type":"object","properties":{"value":{"type":"number","minimum":1,"description":"How many units to wait, 1 or more."},"unit":{"type":"string","enum":["MINUTES","HOURS","DAYS"],"description":"The unit: `MINUTES`, `HOURS` or `DAYS` (calendar days). Business days and other units are not supported."}},"required":["value","unit"],"description":"How long to wait. Used when `type` is `DURATION`."},"date":{"type":"string","description":"The date to wait until, used when `type` is `DATE`: an ISO 8601 date, or a reference to a value from earlier in the flow, such as `${{ steps.plan_dates.fields.target_date }}`."},"subFlowStepId":{"type":"string","description":"The id of the Sub-flow step to wait for. Used when `type` is `SUB_FLOW_COMPLETION`."},"childStepIds":{"type":"array","items":{"type":"string"},"description":"Specific steps of the child flow to wait for, by step id. Used when `type` is `SUB_FLOW_COMPLETION`. When empty or left out, the step waits for the whole child flow. When set, it moves on once these steps are completed or skipped, as `completionMode` says."},"completionMode":{"type":"string","enum":["ALL","ANY"],"description":"How many of the steps in `childStepIds` must finish: `ALL`, every listed step, or `ANY`, the first one to finish. Defaults to `ALL`."},"outputVariables":{"$ref":"#/components/schemas/StepConfig_WAIT_outputVariables"},"webhookUrl":{"type":"string","description":"The URL Moxo posts to when the step starts, used when `type` is `EXTERNAL_APP_EVENT`. The request includes the callback URL that resumes the flow. Can include flow value references."},"webhookHeaders":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"},"description":"HTTP headers to send with that request, such as `Authorization`. Used when `type` is `EXTERNAL_APP_EVENT`. Optional. Values can include flow value references."},"externalTask":{"description":"The task your own system picks up, used when `type` is `EXTERNAL_TASK` (shown in Moxo as \"Your system picks up a task\"): the task name your system claims with an organization API key, the values from earlier steps it receives, how long a claim is held and how many tries it gets. Required for `EXTERNAL_TASK`. Moxo never calls your system and creates no callback URL.","$ref":"#/components/schemas/StepConfig_WAIT_externalTask"},"condition":{"type":"object","properties":{},"additionalProperties":{},"description":"The condition to wait for, used when `type` is `CONDITION_RECHECK`. It has the same shape as a Business rule step's condition and is checked against the flow's values each time."},"recheckIntervalMinutes":{"type":"integer","minimum":5,"maximum":1440,"description":"How often the condition is checked, in minutes, when `type` is `CONDITION_RECHECK`. 5 to 1440. Defaults to 60."},"expectedResolveBy":{"description":"How long the wait is expected to take, used when `type` is `EXTERNAL_APP_EVENT` or `SUB_FLOW_COMPLETION`. Optional. While the step is inside this window, it is not flagged as stalled.","$ref":"#/components/schemas/StepConfig_WAIT_expectedResolveBy"},"connectedApp":{"description":"The connected app record to watch, used when `type` is `CONNECTED_APP_EVENT`: the app, the account, the event, the record and the condition.","$ref":"#/components/schemas/StepConfig_WAIT_connectedApp"},"dataTableWait":{"type":"object","properties":{"tableId":{"type":"string","minLength":1,"description":"The data table whose row is watched."},"rowMatch":{"type":"object","properties":{"match":{"type":"string","enum":["ALL","ANY"],"description":"How the conditions combine: `ALL`, every condition must hold, or `ANY`, at least one must."},"conditions":{"maxItems":25,"type":"array","items":{"$ref":"#/components/schemas/StepConfigPart_conditionsItem"}}},"required":["match","conditions"],"description":"Which row to watch. When several rows match, the earliest created one is used."},"valueMatch":{"type":"object","properties":{"match":{"type":"string","enum":["ALL","ANY"],"description":"How the conditions combine: `ALL`, every condition must hold, or `ANY`, at least one must."},"conditions":{"maxItems":25,"type":"array","items":{"$ref":"#/components/schemas/StepConfigPart_conditionsItem"}}},"required":["match","conditions"],"description":"The condition the row must meet for the wait to end."}},"required":["tableId","rowMatch","valueMatch"],"description":"The data table row to watch and the value that ends the wait, used when `type` is `DATA_TABLE_VALUE`."},"meetingTranscript":{"description":"The Time Booking step this wait follows, which of the host's recordings to read, and what happens when no transcript arrives. Used when `type` is `MEETING_TRANSCRIPT`.","$ref":"#/components/schemas/StepConfig_WAIT_meetingTranscript"},"app":{"type":"string","description":"With `type` `EXTERNAL_APP_EVENT`: the app the event comes from."},"event":{"type":"string","description":"With `type` `EXTERNAL_APP_EVENT`: the event to wait for."}},"required":["type"]},"StepConfig_WAIT_type":{"type":"string","enum":["DURATION","DATE","SUB_FLOW_COMPLETION","EXTERNAL_APP_EVENT","EXTERNAL_TASK","CONDITION_RECHECK","CONNECTED_APP_EVENT","DATA_TABLE_VALUE","MEETING_TRANSCRIPT"],"description":"What the step waits for. One of: `DURATION`, a number of minutes, hours or calendar days (another unit, or business days, is saved as the closest of those three); `DATE`, until a date; `SUB_FLOW_COMPLETION`, until a sub-flow step finishes; `EXTERNAL_APP_EVENT`, until another system calls the step's callback URL (Moxo can notify that system when the step starts); `EXTERNAL_TASK`, until your own system claims the task with an organization API key, does the work and completes or fails it, for systems that can't accept calls from Moxo; `CONDITION_RECHECK`, until a condition is true, checked on a schedule; `CONNECTED_APP_EVENT`, until a record in a connected app (for example a HubSpot deal) matches a condition; `DATA_TABLE_VALUE`, until a data table row reaches a value, checked on a schedule; `MEETING_TRANSCRIPT`, until the transcript of one Time Booking step is in. A meeting-transcript wait is set up in Moxo."},"StepConfig_WAIT_outputVariables":{"type":"array","items":{"$ref":"#/components/schemas/StepConfig_WAIT_outputVariablesItem"},"description":"Values to take from what ended the wait and save as this step's outputs, so later steps can use them. Used when `type` is `EXTERNAL_APP_EVENT`, `EXTERNAL_TASK` or `CONNECTED_APP_EVENT`. `key` is the output name later steps read; `ref` is the path to the value in the source: the whole JSON body that was posted for `EXTERNAL_APP_EVENT` (for example `data.analyst.email`), the `values` your system sent when it completed the task for `EXTERNAL_TASK` (for example `verified`), or the connected app's record for `CONNECTED_APP_EVENT` (for example `amount`). `CONNECTED_APP_EVENT` outputs are set up in the step editor in Moxo."},"StepConfig_WAIT_externalTask":{"type":"object","properties":{"taskName":{"type":"string","description":"The task name your system claims, for example `verify-account`. Letters, numbers and dashes, up to 64 characters. Required."},"inputs":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","description":"The name your system reads this value under, for example `account_id`. Starts with a letter, followed by letters, numbers or underscores."},"value":{"type":"string","description":"Where the value comes from: a reference to an earlier step's answer, such as `${{ steps.enter_account_id.fields.account_id }}`, or a fixed value. Filled in when the task opens."}},"required":["key","value"]},"description":"The values your system receives, each from an earlier step and each with a key. Only these values are sent; nothing else from the flow is shared."},"lockMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"How long a claimed task is held for your system before it goes back to the queue, in minutes. 1 to 60. Defaults to 15."},"maxTries":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"How many tries your system gets before the step fails. 1 to 10. Defaults to 3. A flow manager can then retry the step."}},"required":["taskName"]},"StepConfig_WAIT_expectedResolveBy":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","const":"duration"},"value":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"unit":{"type":"string","enum":["MINUTES","HOURS","DAYS"],"description":"The unit: `MINUTES`, `HOURS` or `DAYS` (calendar days). Business days and other units are not supported."},"dateRef":{"anyOf":[{"type":"string","minLength":1,"description":"A date (ISO 8601) or a reference to a date in the flow, such as `${{ fields.target_date }}`."},{"type":"string","minLength":1}]}},"required":["kind","value","unit"]},{"type":"object","properties":{"kind":{"type":"string","const":"absolute"},"dateRef":{"type":"string","minLength":1},"value":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}]},"unit":{"anyOf":[{"type":"string","enum":["MINUTES","HOURS","DAYS"]},{"type":"string","enum":["MINUTES","HOURS","DAYS"],"description":"The unit: `MINUTES`, `HOURS` or `DAYS` (calendar days). Business days and other units are not supported."}]}},"required":["kind","dateRef"]}]},"StepConfig_WAIT_connectedApp":{"type":"object","properties":{"provider":{"type":"string","minLength":1,"description":"The app, for example `hubspot`."},"connectionId":{"type":"string","minLength":1,"description":"The id of the connected app account the step uses, chosen when the template is built."},"event":{"type":"string","minLength":1,"description":"The app's event, for example `deal.stage.change`."},"recordIdRef":{"type":"string","minLength":1,"description":"The id of the record to watch: a reference to a value from earlier in the flow, such as `${{ trigger.deal.hs_object_id }}` or `${{ fields.deal_id }}`, or a fixed id. Read once, when the step starts. Not used by events that identify their record in more than one way; those use `recordIdRefs`."},"recordIdRefs":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"},"description":"For events that identify their record in more than one way (for example Sumsub's \"Applicant is flagged\", by `applicantId` or `externalUserId`): one flow value reference or fixed value for each way, at least one filled. They are tried in that order at each check."},"recheckMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"How often to check, in minutes, for events that let you choose. For Sumsub: a multiple of 5, from 5 to 1440."},"stopAfterDays":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"A time limit in whole days, for events that have one. For Sumsub: 1 to 30. When it passes, the step fails as timed out."},"resource":{"type":"object","properties":{},"additionalProperties":{},"description":"The kind of record to watch, for events that apply to more than one kind. HubSpot's `record.field.changed` needs `{ sobject: 'deals' | 'tickets' | 'companies' | 'contacts' }`: the record type whose property is watched."},"condition":{"type":"object","properties":{},"additionalProperties":{},"description":"A filter on the watched record's fields. Optional. When empty or left out, the step moves on at any event on the record."},"conditionSummary":{"type":"string","description":"A readable summary of the condition, such as \"Stage is Closed Won\", using the app's own labels. Shown in Moxo only; it doesn't affect the wait."}},"required":["provider","connectionId","event"]},"StepConfigPart_conditionsItem":{"type":"object","properties":{"fieldId":{"type":"string","minLength":1,"description":"The id of a column in the data table (a UUID), as the data table's columns list it; not a column name or label. An unknown or archived id never matches: in a `match: \"ALL\"` filter, the whole filter then matches no records; in a `match: \"ANY\"` filter, that condition is ignored unless every condition is unknown or archived."},"op":{"type":"string","enum":["eq","neq","contains","isEmpty","isNotEmpty","gt","gte","lt","lte","in","notIn"],"description":"How to compare. Text columns: `eq`, `neq`, `contains`, `in`, `notIn`, `isEmpty`, `isNotEmpty`. Number and date columns also take `gt`, `gte`, `lt` and `lte`. Only `in` and `notIn` take a list of values (or one value, treated as a list of one), up to 100; an empty list matches nothing. Every other operator takes one value."},"value":{"anyOf":[{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},{"maxItems":100,"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}],"description":"The value to compare with. Leave it out for `isEmpty` and `isNotEmpty`. A list of values (up to 100) is only for `in` and `notIn`; any other operator takes one value and refuses a list. For a single-select column, send the option's id, not its label. Can be a fixed value or a reference to a value from earlier in the flow, such as `${{ fields.selected_series }}`, filled in when the step runs."}},"required":["fieldId","op"]},"StepConfig_WAIT_meetingTranscript":{"type":"object","properties":{"timeBookingStepId":{"type":"string","minLength":1,"description":"The Time Booking step whose current booking this wait follows."},"recorders":{"minItems":1,"type":"array","items":{"type":"string","enum":["google_meet","fathom","granola","moxo"]},"description":"Which of the host's recordings to read: `google_meet`, `fathom`, `granola` or `moxo`. Google Calendar and Outlook are calendars, not recordings. At least one."},"noTranscript":{"type":"object","properties":{"value":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"How long after the meeting ends before that action, as a whole number of 1 or more."},"unit":{"type":"string","enum":["MINUTES","HOURS","DAYS"],"description":"The unit: `MINUTES`, `HOURS` or `DAYS`."},"action":{"type":"string","enum":["KEEP_WAITING","COMPLETE"],"description":"What to do when no transcript arrives in time. `KEEP_WAITING` tells the flow manager and the step stays open. `COMPLETE` ends the wait and its outputs are empty."}},"required":["value","unit","action"],"description":"How long to wait after the meeting ends, and whether to keep waiting or complete the step."}},"required":["timeBookingStepId","recorders","noTranscript"]},"StepConfig_WAIT_outputVariablesItem":{"type":"object","properties":{"key":{"type":"string","minLength":1,"description":"The name the value is saved under. Later steps read it as `${{ steps.<this wait step>.fields.<key> }}`. Use a short name such as `analystEmail`. `webhookPayload` and `callbackUrl` are reserved."},"ref":{"type":"string","minLength":1,"description":"Where the value is in the source, as a path. For `EXTERNAL_APP_EVENT` the path starts at the whole posted JSON body; don't skip a `data` wrapper (for example `data.analyst.email`, `status`, `$.data.risk.score`). For `CONNECTED_APP_EVENT` the path uses the app's own field names on the watched record, with no wrapper (for example `amount`, `dealstage`, `Owner.Name`). For `EXTERNAL_TASK` the path uses the names in the `values` your system sent with complete (for example `verified`, `notes`, `result.score`). A list item can be named by index either way: `line_items.0.sku` and `line_items[0].sku` are the same."}},"required":["key","ref"]},"StepConfig_FOR_EACH":{"type":"object","properties":{"dataSource":{"description":"Where the items come from, which sets how many times the loop runs.","$ref":"#/components/schemas/StepConfig_FOR_EACH_dataSource"},"steps":{"type":"array","items":{"type":"object","properties":{},"additionalProperties":{}},"description":"The steps to repeat. They run once for each item."},"executionMode":{"type":"string","enum":["PARALLEL","SEQUENTIAL"],"description":"How the items run: `PARALLEL`, all at once (the default), or `SEQUENTIAL`, one at a time, in order."},"iterationLabel":{"type":"string","description":"The name each item shows: plain text, such as `Entity`, or a reference to the item's data, such as `${{ current.item.fieldName }}`."},"maxIterations":{"type":"number","description":"The most items the loop runs. Defaults to 50; up to 400."},"iterationStaggerSeconds":{"type":"number","description":"Seconds between the start of each item in `PARALLEL` mode, so item `i` starts at `i` times this value instead of all at once. Use it when the repeated steps call another system with a rate limit. Up to 300. Defaults to 0: every item starts at once. Ignored in `SEQUENTIAL` mode."},"syncStepsAcrossIterations":{"type":"boolean","description":"When `true`, every item finishes a step before any item starts the next one. Defaults to `false`: each item moves through the steps on its own. Applies in both modes; while it is on, `iterationStaggerSeconds` is ignored, so notifications for a step people work on go out together."},"visibleToAllAssignees":{"type":"boolean"},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"}},"title":"For Each (Loop)","description":"Repeats a group of steps once for each item, with the number of items decided when the flow runs.\n\nThe settings a template read (`GET /v1/templates/{id}`) returns for this type, as stored. The shared settings (due date, reminders, visibility, monitors) can appear alongside them. To set them in a change, send `StepSettings_FOR_EACH`: where this shape holds an id, a change can name a role, field or step by its name or handle.\n\n**Offered by plan:** available when the organization's plan includes `forEach`.","x-moxo-step-type":"FOR_EACH","x-moxo-category":"CONTROL","x-moxo-plan-feature":"forEach"},"StepConfig_FOR_EACH_dataSource":{"type":"object","properties":{"type":{"$ref":"#/components/schemas/StepConfig_FOR_EACH_type"},"count":{"anyOf":[{"type":"number"},{"type":"string"}],"description":"How many times to repeat, used when `type` is `COUNT`: a number, or a reference to a number field, such as `${{ fields.entity_count }}` or `${{ steps.entity_form.fields.count }}`."},"stepRef":{"type":"string","description":"The name of the step that holds the data, such as `Entity List Form`. Used when `type` is `LIST`, and for `COUNT` when its reference names a step."},"stepId":{"type":"string","description":"The Add role step whose roles this loop repeats, when `scope` is `addedByStep`."},"fieldRef":{"type":"string","description":"The list to repeat over, used when `type` is `LIST`: a reference to a list field, such as `${{ steps.entity_list_form.fields.entity_list }}`."},"itemsPath":{"type":"string","description":"Where the list is inside the referenced value, as a dot path, when that value is a JSON object that wraps the list. Used when `type` is `LIST`. For example, an API call step's response `{\"TASKS\": [...]}` needs `TASKS`, and `{\"data\": {\"items\": [...]}}` needs `data.items`. Object keys only; no list indexes. Leave it out when the value is already a list, or when the object holds exactly one list, which is found automatically."},"tableId":{"type":"string","description":"The id of the data table to repeat over, used when `type` is `DATA_TABLE`."},"filter":{"type":"object","properties":{"match":{"type":"string","enum":["ALL","ANY"],"description":"How the conditions combine: `ALL`, every condition must hold, or `ANY`, at least one must."},"conditions":{"maxItems":25,"type":"array","items":{"$ref":"#/components/schemas/StepConfigPart_conditionsItem"}}},"required":["match","conditions"],"description":"Which records to repeat over, used when `type` is `DATA_TABLE`: `{ match: \"ALL\" | \"ANY\", conditions: [{ fieldId, op, value? }] }`. Optional; leave it out to use every record."},"columnTypes":{"type":"array","items":{"type":"string"},"description":"Each column's field type, in the same order as columns, used when `type` is `DATA_TABLE`. `email` is the type used to pick the person on the row."},"fileRef":{"type":"string","description":"The uploaded spreadsheet, used when `type` is `SPREADSHEET`: a reference to an earlier File request step's files, such as `${{ steps.upload_dec_form.fields.uploaded_files }}`."},"sheetName":{"type":"string","description":"The worksheet to read, by name, used when `type` is `SPREADSHEET`. Leave it out to use the first sheet."},"sheetIndex":{"type":"number","description":"The worksheet to read, by position (the first is 0), used when `type` is `SPREADSHEET` and `sheetName` is left out."},"dataStartRow":{"type":"number","description":"The first row to repeat over, counting from 1, used when `type` is `SPREADSHEET`. Rows above it are skipped. Defaults to 2."},"headerRow":{"type":"number","description":"The row that holds the column headers, counting from 1, used when `type` is `SPREADSHEET`. Optional. Defaults to the row directly above `dataStartRow`; set it only when the headers and the data are not next to each other."},"columns":{"type":"array","items":{"anyOf":[{"type":"string","minLength":1},{"type":"object","properties":{"header":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","enum":["TEXT","NUMBER","DATE","BOOLEAN"]}},"required":["header","name"]}]},"description":"The columns each item carries. For `DATA_TABLE`: column names. For `SPREADSHEET`: `{ header, name, type }` objects."},"scope":{"type":"string","enum":["all","addedByStep","specific"],"description":"Which roles an Each role loop repeats. `all`: every role in the flow, including internal roles. `addedByStep`: the roles one Add role step made. `specific`: the roles named in `roleIds`."},"roleIds":{"type":"array","items":{"type":"string"},"description":"The roles to repeat, when `scope` is `specific`. A role that was deleted is skipped. The loop runs in the flow's role order."}},"required":["type"]},"StepConfig_FOR_EACH_type":{"type":"string","enum":["COUNT","LIST","DATA_TABLE","SPREADSHEET","ROLES"],"description":"How the items are found. `COUNT`: repeat a number of times; `count` is a number or a reference to a value from earlier in the flow that holds a number. `LIST`: one item for each entry in a list from an earlier step (a repeating section, a multi-select, uploaded files, an API call or AI list, or a JSON array). `DATA_TABLE`: one item for each record in a data table, optionally filtered. `SPREADSHEET`: one item for each row of an uploaded spreadsheet. `ROLES`: one item for each role, seated with only that role. `scope` is `all` (every role, including internal roles), `addedByStep` (the roles one Add role step made) or `specific` (chosen roles)."},"StepConfig_REPEAT_WHILE":{"type":"object","properties":{"steps":{"type":"array","items":{"type":"object","properties":{},"additionalProperties":{}},"description":"The steps to repeat. They run once per round; the first round always runs."},"conditions":{"maxItems":20,"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"EQUALS"},"left":{"$ref":"#/components/schemas/StepConfigPart_left"},"right":{"$ref":"#/components/schemas/StepConfigPart_left"}},"required":["type","left","right"]},{"type":"object","properties":{"type":{"type":"string","const":"NOT_EQUALS"},"left":{"$ref":"#/components/schemas/StepConfigPart_left"},"right":{"$ref":"#/components/schemas/StepConfigPart_left"}},"required":["type","left","right"]},{"type":"object","properties":{"type":{"type":"string","const":"CONTAINS"},"left":{"$ref":"#/components/schemas/StepConfigPart_left"},"right":{"$ref":"#/components/schemas/StepConfigPart_left"}},"required":["type","left","right"]},{"type":"object","properties":{"type":{"type":"string","const":"NOT_CONTAINS"},"left":{"$ref":"#/components/schemas/StepConfigPart_left"},"right":{"$ref":"#/components/schemas/StepConfigPart_left"}},"required":["type","left","right"]},{"type":"object","properties":{"type":{"type":"string","const":"ARRAY_CONTAINS"},"left":{"$ref":"#/components/schemas/StepConfigPart_left"},"right":{"$ref":"#/components/schemas/StepConfigPart_left"}},"required":["type","left","right"]},{"type":"object","properties":{"type":{"type":"string","const":"STARTS_WITH"},"left":{"$ref":"#/components/schemas/StepConfigPart_left"},"right":{"$ref":"#/components/schemas/StepConfigPart_left"}},"required":["type","left","right"]},{"type":"object","properties":{"type":{"type":"string","const":"ENDS_WITH"},"left":{"$ref":"#/components/schemas/StepConfigPart_left"},"right":{"$ref":"#/components/schemas/StepConfigPart_left"}},"required":["type","left","right"]},{"type":"object","properties":{"type":{"type":"string","const":"GREATER_THAN"},"left":{"$ref":"#/components/schemas/StepConfigPart_left"},"right":{"$ref":"#/components/schemas/StepConfigPart_left"}},"required":["type","left","right"]},{"type":"object","properties":{"type":{"type":"string","const":"LESS_THAN"},"left":{"$ref":"#/components/schemas/StepConfigPart_left"},"right":{"$ref":"#/components/schemas/StepConfigPart_left"}},"required":["type","left","right"]},{"type":"object","properties":{"type":{"type":"string","const":"GREATER_THAN_OR_EQUAL"},"left":{"$ref":"#/components/schemas/StepConfigPart_left"},"right":{"$ref":"#/components/schemas/StepConfigPart_left"}},"required":["type","left","right"]},{"type":"object","properties":{"type":{"type":"string","const":"LESS_THAN_OR_EQUAL"},"left":{"$ref":"#/components/schemas/StepConfigPart_left"},"right":{"$ref":"#/components/schemas/StepConfigPart_left"}},"required":["type","left","right"]},{"type":"object","properties":{"type":{"type":"string","const":"IN"},"left":{"$ref":"#/components/schemas/StepConfigPart_left"},"right":{"$ref":"#/components/schemas/StepConfigPart_left"}},"required":["type","left","right"]},{"type":"object","properties":{"type":{"type":"string","const":"NOT_IN"},"left":{"$ref":"#/components/schemas/StepConfigPart_left"},"right":{"$ref":"#/components/schemas/StepConfigPart_left"}},"required":["type","left","right"]},{"type":"object","properties":{"type":{"type":"string","const":"IS_EMPTY"},"left":{"$ref":"#/components/schemas/StepConfigPart_left"}},"required":["type","left"]},{"type":"object","properties":{"type":{"type":"string","const":"NOT_EMPTY"},"left":{"$ref":"#/components/schemas/StepConfigPart_left"}},"required":["type","left"]},{"type":"object","properties":{"type":{"type":"string","const":"ELSE"}},"required":["type"]}]},"description":"The conditions checked after each round. While they hold, another round starts. An `ELSE` condition is not allowed."},"conditionLogic":{"type":"string","enum":["ALL","ANY"],"description":"How `conditions` combine: `ALL`, every condition must hold (the default), or `ANY`, one is enough."},"maxIterations":{"type":"integer","minimum":1,"maximum":400,"description":"The most rounds the loop runs. Defaults to 50; up to 400. After that many rounds the flow moves on, even if the condition still holds."},"visibleToAllAssignees":{"type":"boolean"},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"}},"title":"Repeat while","description":"Repeats a group of steps until a condition says to stop, when the number of rounds isn't known in advance.\n\nThe settings a template read (`GET /v1/templates/{id}`) returns for this type, as stored. The shared settings (due date, reminders, visibility, monitors) can appear alongside them. To set them in a change, send `StepSettings_REPEAT_WHILE`: where this shape holds an id, a change can name a role, field or step by its name or handle.\n\n**Offered by plan:** available when the organization's plan includes `repeatWhile`.","x-moxo-step-type":"REPEAT_WHILE","x-moxo-category":"CONTROL","x-moxo-plan-feature":"repeatWhile"},"StepConfig_SUB_FLOW":{"type":"object","properties":{"subFlow":{"description":"The settings of a Sub-flow step, which starts a child flow.","$ref":"#/components/schemas/StepConfig_SUB_FLOW_subFlow"},"outputMappings":{"type":"array","items":{"type":"object","properties":{"subFlowOutputRef":{"type":"string"},"parentOutputKey":{"type":"string"}}},"description":"Which of the child flow's outputs this step passes on, and under which key."},"visibleToAllAssignees":{"type":"boolean"},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"}},"title":"Sub Flow","description":"Starts another flow as a child flow, optionally passing it data and waiting for it to finish.\n\nThe settings a template read (`GET /v1/templates/{id}`) returns for this type, as stored. The shared settings (due date, reminders, visibility, monitors) can appear alongside them. To set them in a change, send `StepSettings_SUB_FLOW`: where this shape holds an id, a change can name a role, field or step by its name or handle.\n\n**Offered by plan:** available when the organization's plan includes `subFlows`.","x-moxo-step-type":"SUB_FLOW","x-moxo-category":"CONTROL","x-moxo-plan-feature":"subFlows"},"StepConfig_SUB_FLOW_subFlow":{"type":"object","properties":{"flowTemplateId":{"type":"string","description":"The id of the template the child flow starts from."},"flowTemplateVersionId":{"type":"string","description":"Read-only. The child template's published version, fixed when this template is published."},"flowNameTemplate":{"type":"string","maxLength":200,"description":"Text that names the child flow, which can include flow value references, for example `Site validation: ${{ current.item.name }}` inside a loop. When empty, the child template's own naming rule is used, then its name."},"assigneeMappings":{"type":"array","items":{"type":"object","properties":{"parentRoleId":{"type":"string"},"childRoleId":{"type":"string"},"currentItem":{"type":"object","properties":{"emailColumn":{"type":"string","description":"The label of the loop column that holds the person's email."},"emailColumnId":{"type":"string","description":"The id of that column, so renaming the column doesn't break the mapping."}}},"person":{"type":"object","properties":{"userId":{"type":"string","minLength":1}},"required":["userId"]}},"required":["childRoleId"]},"description":"Which of the child flow's roles each role of this flow fills, by `roleId`."},"inputMappings":{"description":"Values from this flow passed into the child flow's start fields.","$ref":"#/components/schemas/StepConfig_SUB_FLOW_inputMappings"},"outputMappings":{"type":"array","items":{"type":"object","properties":{"subFlowOutputRef":{"type":"string","description":"A reference to one of the child flow's outputs, written `StepName / FieldName` without braces."},"parentOutputKey":{"type":"string","description":"The key the value is saved under on this step's outputs. Later steps read it as `${{ steps.<sub-flow step>.fields.<parentOutputKey> }}`."},"valueShape":{}},"required":["subFlowOutputRef","parentOutputKey"]},"description":"Values from the finished child flow saved on this step's outputs, for later steps to use."},"variableMappings":{"type":"array","items":{"type":"object","properties":{"parentKey":{"type":"string","description":"Replaced by `inputMappings` and `outputMappings`; use those instead."},"childKey":{"type":"string","description":"Replaced by `inputMappings` and `outputMappings`; use those instead."}},"required":["parentKey","childKey"]},"description":"Replaced by `inputMappings` and `outputMappings`; use those instead."},"waitForCompletion":{"type":"boolean","description":"Deprecated: use `continuation.mode`. `waitForCompletion: false` is the same as `continuation.mode: \"child_flow_started\"`. Still accepted and honored on existing templates, where `false` wins over any `continuation.mode`."},"continuation":{"description":"When this Sub-flow step counts as complete.","$ref":"#/components/schemas/StepConfig_SUB_FLOW_continuation"}}},"StepConfig_SUB_FLOW_inputMappings":{"type":"array","items":{"type":"object","properties":{"parentRef":{"anyOf":[{"type":"string","description":"A reference to a value in this flow, for example `${{ fields.client_name }}` or `${{ steps.address_form.fields.country }}`."},{"$ref":"#/components/schemas/StepConfigPart_ref"},{"type":"object","properties":{"kind":{"type":"string","const":"for-each-item"},"expectedType":{"type":"string"},"selector":{"type":"string","enum":["item","index","number","total"],"description":"What to read from the current pass of a loop. `item` reads a column of the current row; `index` (starting at 0), `number` (starting at 1) and `total` are the loop's counters."},"itemFieldId":{"description":"The column's id, for `item`. Preferred over `itemField`, because it still works after the column is renamed.","type":"string"},"itemField":{"description":"The column's label, for `item` when the list has no column ids. A label stops working when the column is renamed.","type":"string"}},"required":["kind","expectedType","selector"]}],"description":"A reference to a value in this flow, preferably as a structured reference. A text reference is also accepted and is converted the next time the template is saved."},"subFlowField":{"type":"string","description":"The start field key on the child template that receives the value."}},"required":["parentRef","subFlowField"]}},"StepConfig_SUB_FLOW_continuation":{"type":"object","properties":{"mode":{"type":"string","enum":["child_flow_complete","specific_child_steps","child_flow_started"],"description":"When this step moves on. `child_flow_complete` (the default): when the whole child flow finishes. `specific_child_steps`: as soon as the steps in `childStepIds` finish, per `completionMode`, for when this flow needs data only from the first few child steps. `child_flow_started`: as soon as the child flow starts, without waiting. The child keeps running on its own and its `outputMappings` still arrive on this step later, so later steps that read them may run first; add a Wait with type `SUB_FLOW_COMPLETION` to wait for them."},"childStepIds":{"type":"array","items":{"type":"string"},"description":"With `specific_child_steps`, the child flow's step ids that must finish (completed or skipped) before this step moves on. They must come from the child template's published version."},"completionMode":{"type":"string","enum":["ALL","ANY"],"description":"With `specific_child_steps`: `ALL` waits for every listed step, `ANY` moves on when the first one finishes. Defaults to `ALL`."}}},"StepConfig_BUILDING_BLOCK":{"type":"object","properties":{"buildingBlock":{"description":"The template to include in this flow, added when the flow starts.","$ref":"#/components/schemas/StepConfig_BUILDING_BLOCK_buildingBlock"},"visibleToAllAssignees":{"type":"boolean"},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"}},"title":"Building block","description":"Reuses another template as a building block: its steps run as part of this flow. Edit the building block once and every flow that uses it picks up the change.\n\nThe settings a template read (`GET /v1/templates/{id}`) returns for this type, as stored. The shared settings (due date, reminders, visibility, monitors) can appear alongside them. To set them in a change, send `StepSettings_BUILDING_BLOCK`: where this shape holds an id, a change can name a role, field or step by its name or handle.\n\n**Offered by plan:** available when the organization's plan includes `buildingBlocks`.","x-moxo-step-type":"BUILDING_BLOCK","x-moxo-category":"CONTROL","x-moxo-plan-feature":"buildingBlocks"},"StepConfig_BUILDING_BLOCK_buildingBlock":{"type":"object","properties":{"blockTemplateId":{"type":"string","description":"The id of the building block's template."},"blockTemplateVersionId":{"type":"string","description":"A specific version of the building block to include. Without it, the block's latest published version is used when the flow starts."},"inputBindings":{"type":"array","items":{"type":"object","properties":{"blockInputFieldId":{"type":"string","description":"The id of an input field on the building block's template: the block input being filled."},"parentRef":{"type":"string","description":"A reference to a value in this flow that fills the block input, such as `${{ fields.vault_address }}` or `${{ steps.collect_vault_config.fields.address }}`. It replaces the block's own references when the flow starts."}},"required":["blockInputFieldId","parentRef"]},"description":"Values from this flow for the building block's input fields, as references to flow values. Block inputs left unfilled are asked for on this template's start form."},"roleBindings":{"type":"array","items":{"type":"object","properties":{"blockRoleId":{"type":"string","description":"The `roleId` of a role on the building block's template."},"mode":{"type":"string","enum":["alias","promote","current_item"],"description":"`alias`: maps the block role onto an existing role in this template, whose assignee does the block's steps. `promote`: adds the block role to this template as a new role. `current_item`: assigns the block's steps for this role to the current person of the enclosing For each, the same way a step assigned to \"The current person\" works; valid only when this step is inside a For each."},"hostRoleId":{"type":"string","description":"The `roleId` of the existing role this block role maps onto. Required when `mode` is `alias`."},"emailColumn":{"type":"string","description":"With `mode` `current_item`: the name of the column in the enclosing loop's list that holds the current person's email. Optional; without it, the email column is picked automatically."},"emailColumnId":{"type":"string","description":"The email column's permanent id. Moxo sets it from `emailColumn` when the template is saved; don't set it."}},"required":["blockRoleId","mode"]},"description":"How each of the building block's roles maps onto this template: onto an existing role (`alias`) or as a new role (`promote`)."},"exposedOutputs":{"type":"array","items":{"type":"object","properties":{"exposedKey":{"type":"string","description":"The key later steps in this template use for this output, in snake case. It stays the same when the block's own output is renamed."},"exposedName":{"type":"string","description":"The output's name, shown when choosing a value to refer to."},"type":{"type":"string","description":"The output's type, such as `TEXT`, `NUMBER`, `DATE`, `BOOLEAN` or `FILE`."},"valueShape":{}},"required":["exposedKey","exposedName","type"]},"description":"A copy of the outputs the building block exposes, taken when it was connected. Later steps refer to them as `${{ steps.<block step>.fields.<output> }}`."},"blockName":{"type":"string","description":"A copy of the building block's name, shown on the collapsed block."},"stepCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"A copy of the building block's number of steps, shown as \"N steps\" on the collapsed block."}}},"StepConfig_AI_CUSTOM_PROMPT":{"type":"object","properties":{"aiAutomation":{"description":"The AI settings of the step: what the AI does, the data it receives and the outputs it produces.","$ref":"#/components/schemas/StepConfigPart_aiAutomation"},"aiEscalation":{"type":"object","properties":{"roleId":{"anyOf":[{"type":"string","minLength":1,"maxLength":80},{"type":"null"}]},"deskId":{"description":"A team desk instead of a role: the hand-off waits in the desk's queue until someone on it claims it. Set `roleId` or `deskId`, never both.","anyOf":[{"type":"string","minLength":1,"maxLength":80},{"type":"null"}]}},"additionalProperties":false},"visibleToAllAssignees":{"type":"boolean"},"blockOnFailure":{"type":"boolean","description":"Whether a failure stops the flow (\"Block the workflow if this step fails\"). `false` lets the flow continue past it; the failure is still recorded. Stops it when left out."},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"}},"title":"AI Custom Prompt","description":"Runs an AI prompt you write to analyze, transform or generate content.\n\nThe settings a template read (`GET /v1/templates/{id}`) returns for this type, as stored. The shared settings (due date, reminders, visibility, monitors) can appear alongside them. To set them in a change, send `StepSettings_AI_CUSTOM_PROMPT`: where this shape holds an id, a change can name a role, field or step by its name or handle.\n\n**Offered by plan:** available when the organization's plan includes `aiCustomPrompt`.","x-moxo-step-type":"AI_CUSTOM_PROMPT","x-moxo-category":"AUTOMATION","x-moxo-plan-feature":"aiCustomPrompt"},"StepConfigPart_aiAutomation":{"type":"object","properties":{"agentId":{"not":{},"description":"Not accepted on AI utility steps. To run an automation AI agent as a step, use an `AI_AGENT` step and set its `config.agentId`."},"actionType":{"type":"string","enum":["CUSTOM_PROMPT","EXTRACT","SUMMARIZE","TRANSCRIBE","TRANSLATE","WRITE"]},"prompt":{"description":"The instructions for the AI. On a custom prompt step this is the main instruction; on other AI steps, such as extract or summarize, it refines the default behavior. Accepts plain text or a list of tokens; use the token list when the prompt includes references to values from earlier in the flow.","$ref":"#/components/schemas/StepConfigPart_emailBody"},"inputFields":{"description":"The data the AI receives. Include at least one input that references a value from an earlier step; without inputs the step fails.","$ref":"#/components/schemas/StepConfigPart_inputFields"},"outputFields":{"description":"The data the AI produces. Later steps can reference each output.","$ref":"#/components/schemas/StepConfigPart_outputFields"},"humanReview":{"type":"boolean","description":"Whether a member reviews the AI output before the flow continues. When `true`, also set `reviewers`: a step with review turned on and no reviewer can't be published. Defaults to `false`."},"reviewChat":{"type":"boolean","description":"Whether reviewers can talk to the AI about its output and revise the draft in place. Applies only when `humanReview` is `true`. Approving still sends the draft on. Defaults to `false`."},"reviewSample":{"anyOf":[{"type":"object","properties":{"size":{"type":"integer","minimum":1,"maximum":500,"description":"How many lines the reviewer checks, from 1 to 500, each picked with the same chance."},"outputKey":{"type":"string","minLength":1,"maxLength":200,"description":"The name of the list output the lines come from: a `LIST` output, or a CSV, XLSX or JSON file output."}},"required":["size","outputKey"],"additionalProperties":false},{"type":"null"}],"description":"With `humanReview` on, the reviewer checks `size` lines (from 1 to 500), each picked with the same chance, of the list output named by `outputKey`, instead of every line. The output is a `LIST`, or a CSV, XLSX or JSON file. On a new step, leave `reviewSample` out to check every line. On `update_step`, leave it out to keep the sample the step already has, and send `null` to check every line. When the step's automation agent sets `reviewSampleSize`, the review checks at least that many even if `reviewSample` is left out, and sending `null` or a smaller `size` is refused (`422 CHANGES_REFUSED`, `LOCKED_BY_AGENT`)."},"reviewers":{"description":"Who reviews the AI output: an internal role, such as a manager or approver. Required when `humanReview` is `true`.","$ref":"#/components/schemas/StepConfigPart_reviewers"},"model":{"type":"string","description":"The AI model for this step. When not set, the step uses the model of the organization's AI connection, or the step type's default: Claude Opus for extract and Claude Sonnet for the others."},"preprocessing":{"type":"object","properties":{"mode":{"type":"string","enum":["auto","always","never"],"default":"auto","description":"When scanned documents are prepared. `auto` prepares scanned documents only, `always` prepares every document, `never` sends documents as they are. Defaults to `auto`."}},"description":"Preparation for scanned documents: a scan is converted to structured text before the AI reads it."},"extractionMode":{"type":"string","enum":["standard","high_accuracy"],"description":"How a document is read. `standard` reads it in large sections and suits most documents. `high_accuracy` reads it in sections of up to 3 pages, for dense multi-page documents such as general ledgers or bank statements. Defaults to `standard`."},"extractMethod":{"type":"string","enum":["standard","complex_documents"],"description":"Optional advanced extraction. `complex_documents` turns on advanced extraction, which also reads scanned documents. Extraction itself is always on."},"extractArithmeticCheck":{"type":"boolean","description":"Whether the step checks that the extracted figures add up (a running balance, each journal's debits and credits). When on, a read whose figures do not add up pauses for a person to review."},"extractArithmeticVerification":{"type":"boolean","description":"The earlier name of `extractArithmeticCheck`. Still read when `extractArithmeticCheck` is not set; new saves use `extractArithmeticCheck`."},"extractPack":{"type":"object","properties":{"requiredTypes":{"maxItems":12,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"The document type's id, for example `invoice`, `purchase_order` or `receipt`. Lowercase with underscores, unique among the types."},"label":{"type":"string","minLength":1,"description":"The document type's display name, for example `Invoice`, `Purchase order` or `Receipt`."},"hints":{"type":"array","items":{"type":"string"},"description":"Optional file names or file types that identify a file of this type, for example `invoice`, `inv` or `po`."}},"required":["id","label"]},"description":"The document types this multi-file extraction must include, up to 12. Each type must match exactly one uploaded file, or the step pauses."}},"required":["requiredTypes"],"description":"The document types a multi-file extraction expects. The step pauses unless each required type matches exactly one uploaded file. Set by Moxo, not in the step editor."},"extractVerificationCriteria":{"maxItems":8,"type":"array","items":{"$ref":"#/components/schemas/StepConfigPart_extractVerificationCriteriaItem"},"description":"Plain-language checks run as part of arithmetic verification. Up to 8. `journal_footing` checks that a ledger's debits equal its credits; `custom` is a check you write."},"extractDocumentAbout":{"type":"string","maxLength":4000,"description":"An optional note on how accounts appear in the file and which lines to ignore. Plain text, up to 4,000 characters. Used when arithmetic verification is on."}},"required":["actionType"]},"StepConfigPart_inputFields":{"type":"array","items":{"type":"object","properties":{"fieldId":{"type":"string","description":"The input's id, unique in the step, for example `in_1`."},"name":{"type":"string","minLength":1,"description":"The input's display name, for example `Client Name` or `Document URL`."},"type":{"type":"string","enum":["TEXT","NUMBER","DATE","BOOLEAN","FILE"],"description":"The input's data type."},"required":{"type":"boolean","description":"Whether the step needs this input to run. Leave it out to keep the input required: the step fails when the source produced no value. Set `false` only when the source is on a path or an optional step that may not run, and the AI can do its work without it; the step then runs with the input blank."},"value":{"anyOf":[{"type":"string","description":"A reference to a value from an earlier step: a file upload step's files, `${{ steps.upload_documents.fields.uploaded_files }}`; a form field, `${{ steps.client_intake.fields.company_name }}`; an AI step's output, `${{ steps.ai_financial_summary.fields.financial_summary }}`. Required."},{"$ref":"#/components/schemas/StepConfigPart_ref"},{"$ref":"#/components/schemas/StepConfigPart_value_2"},{"type":"object","properties":{"kind":{"type":"string","const":"for-each-item"},"expectedType":{"type":"string"},"selector":{"type":"string","enum":["item","index","number","total"],"description":"What to read from the current pass of a loop. `item` reads a column of the current row; `index` (starting at 0), `number` (starting at 1) and `total` are the loop's counters."},"itemFieldId":{"description":"The column's id, for `item`. Preferred over `itemField`, because it still works after the column is renamed.","type":"string"},"itemField":{"description":"The column's label, for `item` when the list has no column ids. A label stops working when the column is renamed.","type":"string"}},"required":["kind","expectedType","selector"]}],"description":"Where the input's value comes from: a reference to a value from earlier in the flow. Accepts the reference as text or as a structured reference; the structured form is preferred, and text is converted to it on the next save."}},"required":["name","type","value"]}},"StepConfigPart_outputFields":{"type":"array","items":{"type":"object","properties":{"fieldId":{"type":"string","description":"The output's id, unique in the step, for example `out_1`."},"name":{"type":"string","minLength":1,"description":"The output's display name, for example `Summary` or `Extracted Data`."},"type":{"type":"string","enum":["TEXT","NUMBER","DATE","BOOLEAN","CHOICE","OBJECT","FILE","LIST","EMAIL","PHONE","URL"],"description":"The output's data type. `CHOICE` limits the value to a fixed set: set `enumValues`; a later Decision step can branch on it. `OBJECT` is a nested record: set `fields`; later steps can reference each value inside it. `FILE` is a file the AI produces: CSV, XLSX or JSON for tables, TXT, DOCX or PDF for text. `LIST` is a list of records: set `itemFields`, so a `FOR_EACH` step can reference `${{ current.item.<field> }}`."},"fileFormat":{"type":"string","enum":["TXT","CSV","JSON","XLSX","DOCX","PDF","PPTX"],"description":"The file format. Required when `type` is `FILE`. For tables: CSV, XLSX or JSON. For text: TXT, DOCX or PDF."},"source":{"type":"string","enum":["inputs","judgment"],"description":"Whether a number output is checked against documents (\"Check against documents\" in the app). For a number output only; refused on any other type. `judgment` (the default when omitted): not checked. The value is proved as before, unless the AI marks it as its own assessment, such as a risk score. `inputs`: checked. The value must be read from the step's inputs or worked out from them, a judged mark is ignored, and a value Moxo cannot trace waits for a person."},"deliverAsPdf":{"type":"boolean","description":"For a DOCX output only. When `true`, the Word file is kept and a PDF copy is saved too. Later steps see the PDF as `<output name> PDF`, so no other output can use that name."},"itemFields":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"type":{"type":"string","enum":["TEXT","NUMBER","DATE","BOOLEAN","CHOICE","OBJECT"]},"enumValues":{"type":"array","items":{"type":"string"}},"fields":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"type":{"type":"string","enum":["TEXT","NUMBER","DATE","BOOLEAN","CHOICE","OBJECT"]},"enumValues":{"type":"array","items":{"type":"string"}},"fields":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"type":{"type":"string","enum":["TEXT","NUMBER","DATE","BOOLEAN","CHOICE","OBJECT"]},"enumValues":{"type":"array","items":{"type":"string"}}},"required":["name","type"]}}},"required":["name","type"]}}},"required":["name","type"]},"description":"The fields each item in the list has, for example date, amount and merchant. Required when `type` is `LIST`. Inside a `FOR_EACH` over the list, each is referenced as `${{ current.item.<field> }}`."},"enumValues":{"type":"array","items":{"type":"string"},"description":"The allowed values, for example `[\"Approved\", \"Rejected\", \"Needs review\"]`. Required when `type` is `CHOICE`. The output is always exactly one of them."},"fields":{"description":"The record's fields. Required when `type` is `OBJECT`. Later steps reference each value as `${{ steps.<step>.fields.<output>.<field> }}`.","$ref":"#/components/schemas/StepConfigPart_fields"},"style":{"type":"object","properties":{"accentColor":{"type":"string"},"fontFamily":{"type":"string"}},"description":"Optional style settings for a PDF or DOCX output. Settings left out come from the agent, the organization or Moxo's defaults."},"description":{"type":"string","description":"What this output holds. The AI reads it when it fills in the output."},"templateFile":{"type":"string","description":"A Word, Excel or PowerPoint template this file output fills in, instead of building the file from scratch."}},"required":["name"]}},"StepConfigPart_reviewers":{"type":"object","properties":{"participants":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["AI","HUMAN"]},"roleId":{"type":"string"},"contactId":{"type":"string"},"userId":{"type":"string"},"agentId":{"type":"string"},"prompt":{"type":"string"},"criteria":{"type":"string"},"context":{"type":"string"},"privateNotesGuidance":{"type":"string","maxLength":2000},"sendBackReply":{"type":"string","enum":["outcome_with_reason","outcome_only"]},"howToExplain":{"type":"string","maxLength":2000},"inputs":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"value":{"type":"string"},"type":{"type":"string","enum":["TEXT","FILE"]}},"required":["name","value"]}},"ruleKinds":{"maxItems":80,"type":"array","items":{"type":"object","properties":{"rule":{"type":"string","minLength":1,"maxLength":2000},"kind":{"type":"string","enum":["fact","data_match","coverage","visual","judgment"]},"compare":{"type":"object","properties":{"check":{"type":"string","enum":["compare.money_equal","compare.date_after","compare.names_equal","certificate.insured_name_matches","certificate.limit_at_least","kyc.id_name_matches","kyc.birth_date_matches","kyc.dated_within_three_months"]},"against":{"type":"string","enum":["today","value","input"]},"value":{"type":"string","minLength":1,"maxLength":500},"input":{"type":"string","minLength":1,"maxLength":200}},"required":["check","against"]},"document":{"type":"string","minLength":1,"maxLength":200},"sum":{"type":"object","properties":{"fields":{"minItems":2,"maxItems":60,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}}},"required":["fields"]}},"required":["rule","kind"]}}},"required":["type"],"additionalProperties":{}}},"sequential":{"type":"boolean"},"completion":{"type":"object","properties":{"mode":{"type":"string","enum":["ANY_ONE","ALL"]}},"required":["mode"]},"showToExternalAssignee":{"type":"boolean","description":"Advisors only. `true` lets an assignee outside your organization read the recommendation (the call and its reasons), as advice from your organization. Off unless set."},"canEditAnswers":{"type":"boolean","description":"Reviewers only, on a Form, PDF form or File request step. `true` lets the reviewer whose turn it is edit the submitted answers (on a File request, add and remove its files) during review, in the Moxo app, instead of sending them back. Off unless set."},"reviewItemsTogether":{"type":"boolean","description":"Reviewers only, on a person's step inside a For each whose items run at the same time. `true` gives the reviewer one list and one notice for every item instead of one review per item; each item keeps its own run and review. With the loop's `syncStepsAcrossIterations` on, the reviewer approves every item at once (`approve_reviews_together`); off, each item is approved on its own. Publish refuses it in a Repeat while, on an \"Approve before it runs\" step, with no person or role reviewing, and in a loop that runs items one at a time. Off unless set."}},"required":["participants"]},"StepConfigPart_extractVerificationCriteriaItem":{"type":"object","properties":{"id":{"type":"string","description":"The check's id: a short slug such as `journal-footing` or `check-2`."},"kind":{"type":"string","enum":["journal_footing","custom"],"description":"The kind of check. `journal_footing` checks that a ledger's debits equal its credits. `custom` is a check written in plain language."},"statement":{"type":"string","description":"In plain language, what must be true before the extraction completes. For example: \"Each journal's debits must equal its credits exactly.\""},"check":{"type":"string","description":"The check that runs for this row, once confirmed for its words. A `journal_footing` row runs `journal.debits_equal_credits`. Send it back as a read returns it."},"confirmedStatement":{"type":"string","description":"The words the check was confirmed for. A row whose words changed since then runs no check until it is confirmed again, and publishing refuses it."}},"required":["id","kind","statement"]},"StepConfigPart_value_2":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"literal"},"value":{"type":"string","description":"Fixed text, such as a prompt, a caption or context that doesn't come from earlier steps."},"expectedType":{"type":"string"}},"required":["kind","value"]},{"type":"object","properties":{"kind":{"type":"string","const":"step-output"},"stepId":{"type":"string","description":"The handle of the earlier step that produces the value, for example `intake_form`. Must be a step that comes earlier in the same template."},"field":{"type":"string","description":"The output's display name on that step, for example `Country` or `Decision`. On a form step it is the field's `label`; on an AI step, the output's `name`; on a file request step, `Uploaded Files`. Not the handle and not the step's name."},"expectedType":{"type":"string"},"channel":{"description":"Which part of the step to read. `field` (the default) reads an output; `meta` reads completion details, such as who completed the step and when. Not used for a value collected across a loop.","type":"string","enum":["field","meta"]}},"required":["kind","stepId","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"role-data"},"roleId":{"type":"string","description":"The handle of a role in this template, for example `client` or `manager`."},"field":{"type":"string","enum":["name","email","phone","title"],"description":"Which detail of the assigned person to read. `title` is their job title from the organization's title list, and is blank when they haven't set one."},"expectedType":{"type":"string","const":"TEXT"}},"required":["kind","roleId","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"for-each-aggregate"},"loopStepId":{"type":"string","description":"The handle of the loop step, such as a `FOR_EACH`, whose passes produced the value. Must be a loop step."},"bodyStepId":{"type":"string","description":"The handle of a step inside the loop named by `loopStepId`. A step outside that loop is refused."},"field":{"type":"string","description":"The output's name on that step, for example `Decision`. The value is the list of that output's values, one per pass of the loop."},"expectedType":{"type":"string"}},"required":["kind","loopStepId","bodyStepId","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"flow-input"},"inputId":{"type":"string","description":"The `key` of a flow field asked for when the flow starts, for example a customer email or an order ID. Read from the start form's values."},"expectedType":{"type":"string"}},"required":["kind","inputId"]},{"type":"object","properties":{"kind":{"type":"string","const":"custom-field"},"fieldId":{"type":"string","description":"The `fieldId` of an organization-level custom user field, for example account tier or region. Read from the person's saved value."},"expectedType":{"type":"string"}},"required":["kind","fieldId"]},{"type":"object","properties":{"kind":{"type":"string","const":"organization"},"attribute":{"type":"string","enum":["name","id"],"description":"Which detail of the organization to read: `name` (for example to personalize generated text) or `id` (for example for an outbound API call that needs it)."},"expectedType":{"type":"string","const":"TEXT"}},"required":["kind","attribute"]},{"type":"object","properties":{"kind":{"type":"string","const":"flow-metadata"},"attribute":{"type":"string","enum":["duedate","startdate","name","id"],"description":"Which detail of the flow to read: its due date, start date, name or id. For example, a prompt can use the flow's due date to summarize what is overdue."},"expectedType":{"type":"string"}},"required":["kind","attribute"]},{"type":"object","properties":{"kind":{"type":"string","const":"trigger"},"triggerKind":{"type":"string","const":"email","description":"Where the value comes from. Only `email` is supported: the email that started the flow. Valid only when the template starts from an email, so the template's start modes must include `EMAIL`."},"property":{"type":"string","enum":["subject","from","fromName","to","bodyText","bodyHtml","attachments","receivedAt","messageId"],"description":"Which part of the email that started the flow to read. `attachments` is the email's attached files, for a file input such as a document a customer emailed in. `subject`, `from`, `fromName`, `to`, `bodyText`, `bodyHtml`, `receivedAt` and `messageId` are text."}},"required":["kind","triggerKind","property"]}]},"StepConfigPart_fields":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"type":{"type":"string","enum":["TEXT","NUMBER","DATE","BOOLEAN","CHOICE","OBJECT"]},"enumValues":{"type":"array","items":{"type":"string"}},"fields":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"type":{"type":"string","enum":["TEXT","NUMBER","DATE","BOOLEAN","CHOICE","OBJECT"]},"enumValues":{"type":"array","items":{"type":"string"}},"fields":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"type":{"type":"string","enum":["TEXT","NUMBER","DATE","BOOLEAN","CHOICE","OBJECT"]},"enumValues":{"type":"array","items":{"type":"string"}}},"required":["name","type"]}}},"required":["name","type"]}}},"required":["name","type"]}},"StepConfig_AI_EXTRACT":{"type":"object","properties":{"aiAutomation":{"description":"The AI settings of the step: what the AI does, the data it receives and the outputs it produces.","$ref":"#/components/schemas/StepConfigPart_aiAutomation"},"aiEscalation":{"type":"object","properties":{"roleId":{"anyOf":[{"type":"string","minLength":1,"maxLength":80},{"type":"null"}]},"deskId":{"description":"A team desk instead of a role: the hand-off waits in the desk's queue until someone on it claims it. Set `roleId` or `deskId`, never both.","anyOf":[{"type":"string","minLength":1,"maxLength":80},{"type":"null"}]}},"additionalProperties":false},"visibleToAllAssignees":{"type":"boolean"},"blockOnFailure":{"type":"boolean","description":"Whether a failure stops the flow (\"Block the workflow if this step fails\"). `false` lets the flow continue past it; the failure is still recorded. Stops it when left out."},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"}},"title":"AI Extract","description":"Extracts structured data from documents, forms or text with AI.\n\nThe settings a template read (`GET /v1/templates/{id}`) returns for this type, as stored. The shared settings (due date, reminders, visibility, monitors) can appear alongside them. To set them in a change, send `StepSettings_AI_EXTRACT`: where this shape holds an id, a change can name a role, field or step by its name or handle.\n\n**Offered by plan:** available when the organization's plan includes `aiExtract`.","x-moxo-step-type":"AI_EXTRACT","x-moxo-category":"AUTOMATION","x-moxo-plan-feature":"aiExtract"},"StepConfig_AI_SUMMARIZE":{"type":"object","properties":{"aiAutomation":{"description":"The AI settings of the step: what the AI does, the data it receives and the outputs it produces.","$ref":"#/components/schemas/StepConfig_AI_SUMMARIZE_aiAutomation"},"aiEscalation":{"type":"object","properties":{"roleId":{"anyOf":[{"type":"string","minLength":1,"maxLength":80},{"type":"null"}]},"deskId":{"description":"A team desk instead of a role: the hand-off waits in the desk's queue until someone on it claims it. Set `roleId` or `deskId`, never both.","anyOf":[{"type":"string","minLength":1,"maxLength":80},{"type":"null"}]}},"additionalProperties":false},"visibleToAllAssignees":{"type":"boolean"},"blockOnFailure":{"type":"boolean","description":"Whether a failure stops the flow (\"Block the workflow if this step fails\"). `false` lets the flow continue past it; the failure is still recorded. Stops it when left out."},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"}},"title":"AI Summarize","description":"Summarizes documents, form answers, conversations or other content with AI.\n\nThe settings a template read (`GET /v1/templates/{id}`) returns for this type, as stored. The shared settings (due date, reminders, visibility, monitors) can appear alongside them. To set them in a change, send `StepSettings_AI_SUMMARIZE`: where this shape holds an id, a change can name a role, field or step by its name or handle.\n\n**Offered by plan:** available when the organization's plan includes `aiSummarize`.","x-moxo-step-type":"AI_SUMMARIZE","x-moxo-category":"AUTOMATION","x-moxo-plan-feature":"aiSummarize"},"StepConfig_AI_SUMMARIZE_aiAutomation":{"type":"object","properties":{"agentId":{"not":{},"description":"Not accepted on AI utility steps. To run an automation AI agent as a step, use an `AI_AGENT` step and set its `config.agentId`."},"actionType":{"type":"string","enum":["CUSTOM_PROMPT","EXTRACT","SUMMARIZE","TRANSCRIBE","TRANSLATE","WRITE"]},"prompt":{"description":"The instructions for the AI. On a custom prompt step this is the main instruction; on other AI steps, such as extract or summarize, it refines the default behavior. Accepts plain text or a list of tokens; use the token list when the prompt includes references to values from earlier in the flow.","$ref":"#/components/schemas/StepConfigPart_emailBody"},"inputFields":{"description":"The data the AI receives. Include at least one input that references a value from an earlier step; without inputs the step fails.","$ref":"#/components/schemas/StepConfigPart_inputFields"},"outputFields":{"description":"The data the AI produces. Later steps can reference each output.","$ref":"#/components/schemas/StepConfigPart_outputFields"},"humanReview":{"type":"boolean","description":"Whether a member reviews the AI output before the flow continues. When `true`, also set `reviewers`: a step with review turned on and no reviewer can't be published. Defaults to `false`."},"reviewChat":{"type":"boolean","description":"Whether reviewers can talk to the AI about its output and revise the draft in place. Applies only when `humanReview` is `true`. Approving still sends the draft on. Defaults to `false`."},"reviewSample":{"anyOf":[{"type":"object","properties":{"size":{"type":"integer","minimum":1,"maximum":500,"description":"How many lines the reviewer checks, from 1 to 500, each picked with the same chance."},"outputKey":{"type":"string","minLength":1,"maxLength":200,"description":"The name of the list output the lines come from: a `LIST` output, or a CSV, XLSX or JSON file output."}},"required":["size","outputKey"],"additionalProperties":false},{"type":"null"}],"description":"With `humanReview` on, the reviewer checks `size` lines (from 1 to 500), each picked with the same chance, of the list output named by `outputKey`, instead of every line. The output is a `LIST`, or a CSV, XLSX or JSON file. On a new step, leave `reviewSample` out to check every line. On `update_step`, leave it out to keep the sample the step already has, and send `null` to check every line. When the step's automation agent sets `reviewSampleSize`, the review checks at least that many even if `reviewSample` is left out, and sending `null` or a smaller `size` is refused (`422 CHANGES_REFUSED`, `LOCKED_BY_AGENT`)."},"reviewers":{"description":"Who reviews the AI output: an internal role, such as a manager or approver. Required when `humanReview` is `true`.","$ref":"#/components/schemas/StepConfigPart_reviewers"},"model":{"type":"string","description":"The AI model for this step. When not set, the step uses the model of the organization's AI connection, or the step type's default: Claude Opus for extract and Claude Sonnet for the others."},"preprocessing":{"type":"object","properties":{"mode":{"type":"string","enum":["auto","always","never"],"default":"auto","description":"When scanned documents are prepared. `auto` prepares scanned documents only, `always` prepares every document, `never` sends documents as they are. Defaults to `auto`."}},"description":"Preparation for scanned documents: a scan is converted to structured text before the AI reads it."},"extractionMode":{"type":"string","enum":["standard","high_accuracy"],"description":"How a document is read. `standard` reads it in large sections and suits most documents. `high_accuracy` reads it in sections of up to 3 pages, for dense multi-page documents such as general ledgers or bank statements. Defaults to `standard`."},"extractMethod":{"type":"string","enum":["standard","complex_documents"],"description":"Optional advanced extraction. `complex_documents` turns on advanced extraction, which also reads scanned documents. Extraction itself is always on."},"extractArithmeticCheck":{"type":"boolean","description":"Whether the step checks that the extracted figures add up (a running balance, each journal's debits and credits). When on, a read whose figures do not add up pauses for a person to review."},"extractArithmeticVerification":{"type":"boolean","description":"The earlier name of `extractArithmeticCheck`. Still read when `extractArithmeticCheck` is not set; new saves use `extractArithmeticCheck`."},"extractPack":{"type":"object","properties":{"requiredTypes":{"maxItems":12,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"The document type's id, for example `invoice`, `purchase_order` or `receipt`. Lowercase with underscores, unique among the types."},"label":{"type":"string","minLength":1,"description":"The document type's display name, for example `Invoice`, `Purchase order` or `Receipt`."},"hints":{"type":"array","items":{"type":"string"},"description":"Optional file names or file types that identify a file of this type, for example `invoice`, `inv` or `po`."}},"required":["id","label"]},"description":"The document types this multi-file extraction must include, up to 12. Each type must match exactly one uploaded file, or the step pauses."}},"required":["requiredTypes"],"description":"The document types a multi-file extraction expects. The step pauses unless each required type matches exactly one uploaded file. Set by Moxo, not in the step editor."},"extractVerificationCriteria":{"maxItems":8,"type":"array","items":{"$ref":"#/components/schemas/StepConfigPart_extractVerificationCriteriaItem"},"description":"Plain-language checks run as part of arithmetic verification. Up to 8. `journal_footing` checks that a ledger's debits equal its credits; `custom` is a check you write."},"extractDocumentAbout":{"type":"string","maxLength":4000,"description":"An optional note on how accounts appear in the file and which lines to ignore. Plain text, up to 4,000 characters. Used when arithmetic verification is on."},"summaryFormat":{"type":"string","description":"The shape of the summary, for example bullet points or a paragraph."},"maxLength":{"anyOf":[{"type":"string"},{"type":"number"}],"description":"How long the summary should be."},"focusAreas":{"type":"array","items":{"type":"string"},"description":"What the summary should focus on."}},"required":["actionType"]},"StepConfig_AI_TRANSCRIBE":{"type":"object","properties":{"aiAutomation":{"description":"The AI settings of the step: what the AI does, the data it receives and the outputs it produces.","$ref":"#/components/schemas/StepConfig_AI_TRANSCRIBE_aiAutomation"},"aiEscalation":{"type":"object","properties":{"roleId":{"anyOf":[{"type":"string","minLength":1,"maxLength":80},{"type":"null"}]},"deskId":{"description":"A team desk instead of a role: the hand-off waits in the desk's queue until someone on it claims it. Set `roleId` or `deskId`, never both.","anyOf":[{"type":"string","minLength":1,"maxLength":80},{"type":"null"}]}},"additionalProperties":false},"visibleToAllAssignees":{"type":"boolean"},"blockOnFailure":{"type":"boolean","description":"Whether a failure stops the flow (\"Block the workflow if this step fails\"). `false` lets the flow continue past it; the failure is still recorded. Stops it when left out."},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"}},"title":"AI Transcribe","description":"Transcribes audio or video to text with AI.\n\nThe settings a template read (`GET /v1/templates/{id}`) returns for this type, as stored. The shared settings (due date, reminders, visibility, monitors) can appear alongside them. To set them in a change, send `StepSettings_AI_TRANSCRIBE`: where this shape holds an id, a change can name a role, field or step by its name or handle.\n\n**Offered by plan:** available when the organization's plan includes `aiTranscribe`.","x-moxo-step-type":"AI_TRANSCRIBE","x-moxo-category":"AUTOMATION","x-moxo-plan-feature":"aiTranscribe"},"StepConfig_AI_TRANSCRIBE_aiAutomation":{"type":"object","properties":{"agentId":{"not":{},"description":"Not accepted on AI utility steps. To run an automation AI agent as a step, use an `AI_AGENT` step and set its `config.agentId`."},"actionType":{"type":"string","enum":["CUSTOM_PROMPT","EXTRACT","SUMMARIZE","TRANSCRIBE","TRANSLATE","WRITE"]},"prompt":{"description":"The instructions for the AI. On a custom prompt step this is the main instruction; on other AI steps, such as extract or summarize, it refines the default behavior. Accepts plain text or a list of tokens; use the token list when the prompt includes references to values from earlier in the flow.","$ref":"#/components/schemas/StepConfigPart_emailBody"},"inputFields":{"description":"The data the AI receives. Include at least one input that references a value from an earlier step; without inputs the step fails.","$ref":"#/components/schemas/StepConfigPart_inputFields"},"outputFields":{"description":"The data the AI produces. Later steps can reference each output.","$ref":"#/components/schemas/StepConfigPart_outputFields"},"humanReview":{"type":"boolean","description":"Whether a member reviews the AI output before the flow continues. When `true`, also set `reviewers`: a step with review turned on and no reviewer can't be published. Defaults to `false`."},"reviewChat":{"type":"boolean","description":"Whether reviewers can talk to the AI about its output and revise the draft in place. Applies only when `humanReview` is `true`. Approving still sends the draft on. Defaults to `false`."},"reviewSample":{"anyOf":[{"type":"object","properties":{"size":{"type":"integer","minimum":1,"maximum":500,"description":"How many lines the reviewer checks, from 1 to 500, each picked with the same chance."},"outputKey":{"type":"string","minLength":1,"maxLength":200,"description":"The name of the list output the lines come from: a `LIST` output, or a CSV, XLSX or JSON file output."}},"required":["size","outputKey"],"additionalProperties":false},{"type":"null"}],"description":"With `humanReview` on, the reviewer checks `size` lines (from 1 to 500), each picked with the same chance, of the list output named by `outputKey`, instead of every line. The output is a `LIST`, or a CSV, XLSX or JSON file. On a new step, leave `reviewSample` out to check every line. On `update_step`, leave it out to keep the sample the step already has, and send `null` to check every line. When the step's automation agent sets `reviewSampleSize`, the review checks at least that many even if `reviewSample` is left out, and sending `null` or a smaller `size` is refused (`422 CHANGES_REFUSED`, `LOCKED_BY_AGENT`)."},"reviewers":{"description":"Who reviews the AI output: an internal role, such as a manager or approver. Required when `humanReview` is `true`.","$ref":"#/components/schemas/StepConfigPart_reviewers"},"model":{"type":"string","description":"The AI model for this step. When not set, the step uses the model of the organization's AI connection, or the step type's default: Claude Opus for extract and Claude Sonnet for the others."},"preprocessing":{"type":"object","properties":{"mode":{"type":"string","enum":["auto","always","never"],"default":"auto","description":"When scanned documents are prepared. `auto` prepares scanned documents only, `always` prepares every document, `never` sends documents as they are. Defaults to `auto`."}},"description":"Preparation for scanned documents: a scan is converted to structured text before the AI reads it."},"extractionMode":{"type":"string","enum":["standard","high_accuracy"],"description":"How a document is read. `standard` reads it in large sections and suits most documents. `high_accuracy` reads it in sections of up to 3 pages, for dense multi-page documents such as general ledgers or bank statements. Defaults to `standard`."},"extractMethod":{"type":"string","enum":["standard","complex_documents"],"description":"Optional advanced extraction. `complex_documents` turns on advanced extraction, which also reads scanned documents. Extraction itself is always on."},"extractArithmeticCheck":{"type":"boolean","description":"Whether the step checks that the extracted figures add up (a running balance, each journal's debits and credits). When on, a read whose figures do not add up pauses for a person to review."},"extractArithmeticVerification":{"type":"boolean","description":"The earlier name of `extractArithmeticCheck`. Still read when `extractArithmeticCheck` is not set; new saves use `extractArithmeticCheck`."},"extractPack":{"type":"object","properties":{"requiredTypes":{"maxItems":12,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"The document type's id, for example `invoice`, `purchase_order` or `receipt`. Lowercase with underscores, unique among the types."},"label":{"type":"string","minLength":1,"description":"The document type's display name, for example `Invoice`, `Purchase order` or `Receipt`."},"hints":{"type":"array","items":{"type":"string"},"description":"Optional file names or file types that identify a file of this type, for example `invoice`, `inv` or `po`."}},"required":["id","label"]},"description":"The document types this multi-file extraction must include, up to 12. Each type must match exactly one uploaded file, or the step pauses."}},"required":["requiredTypes"],"description":"The document types a multi-file extraction expects. The step pauses unless each required type matches exactly one uploaded file. Set by Moxo, not in the step editor."},"extractVerificationCriteria":{"maxItems":8,"type":"array","items":{"$ref":"#/components/schemas/StepConfigPart_extractVerificationCriteriaItem"},"description":"Plain-language checks run as part of arithmetic verification. Up to 8. `journal_footing` checks that a ledger's debits equal its credits; `custom` is a check you write."},"extractDocumentAbout":{"type":"string","maxLength":4000,"description":"An optional note on how accounts appear in the file and which lines to ignore. Plain text, up to 4,000 characters. Used when arithmetic verification is on."},"sourceLanguage":{"type":"string","description":"The language spoken in the recording, or `auto` to detect it."},"options":{"type":"object","properties":{"speakerIdentification":{"type":"boolean","description":"Names who is speaking."},"maxSpeakers":{"type":"number","description":"The most speakers to tell apart."},"includeTimestamps":{"type":"boolean","description":"Adds timestamps to the transcript."}}}},"required":["actionType"]},"StepConfig_AI_TRANSLATE":{"type":"object","properties":{"aiAutomation":{"description":"The AI settings of the step: what the AI does, the data it receives and the outputs it produces.","$ref":"#/components/schemas/StepConfig_AI_TRANSLATE_aiAutomation"},"aiEscalation":{"type":"object","properties":{"roleId":{"anyOf":[{"type":"string","minLength":1,"maxLength":80},{"type":"null"}]},"deskId":{"description":"A team desk instead of a role: the hand-off waits in the desk's queue until someone on it claims it. Set `roleId` or `deskId`, never both.","anyOf":[{"type":"string","minLength":1,"maxLength":80},{"type":"null"}]}},"additionalProperties":false},"visibleToAllAssignees":{"type":"boolean"},"blockOnFailure":{"type":"boolean","description":"Whether a failure stops the flow (\"Block the workflow if this step fails\"). `false` lets the flow continue past it; the failure is still recorded. Stops it when left out."},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"}},"title":"AI Translate","description":"Translates text or a document's content into another language with AI.\n\nThe settings a template read (`GET /v1/templates/{id}`) returns for this type, as stored. The shared settings (due date, reminders, visibility, monitors) can appear alongside them. To set them in a change, send `StepSettings_AI_TRANSLATE`: where this shape holds an id, a change can name a role, field or step by its name or handle.\n\n**Offered by plan:** available when the organization's plan includes `aiTranslate`.","x-moxo-step-type":"AI_TRANSLATE","x-moxo-category":"AUTOMATION","x-moxo-plan-feature":"aiTranslate"},"StepConfig_AI_TRANSLATE_aiAutomation":{"type":"object","properties":{"agentId":{"not":{},"description":"Not accepted on AI utility steps. To run an automation AI agent as a step, use an `AI_AGENT` step and set its `config.agentId`."},"actionType":{"type":"string","enum":["CUSTOM_PROMPT","EXTRACT","SUMMARIZE","TRANSCRIBE","TRANSLATE","WRITE"]},"prompt":{"description":"The instructions for the AI. On a custom prompt step this is the main instruction; on other AI steps, such as extract or summarize, it refines the default behavior. Accepts plain text or a list of tokens; use the token list when the prompt includes references to values from earlier in the flow.","$ref":"#/components/schemas/StepConfigPart_emailBody"},"inputFields":{"description":"The data the AI receives. Include at least one input that references a value from an earlier step; without inputs the step fails.","$ref":"#/components/schemas/StepConfigPart_inputFields"},"outputFields":{"description":"The data the AI produces. Later steps can reference each output.","$ref":"#/components/schemas/StepConfigPart_outputFields"},"humanReview":{"type":"boolean","description":"Whether a member reviews the AI output before the flow continues. When `true`, also set `reviewers`: a step with review turned on and no reviewer can't be published. Defaults to `false`."},"reviewChat":{"type":"boolean","description":"Whether reviewers can talk to the AI about its output and revise the draft in place. Applies only when `humanReview` is `true`. Approving still sends the draft on. Defaults to `false`."},"reviewSample":{"anyOf":[{"type":"object","properties":{"size":{"type":"integer","minimum":1,"maximum":500,"description":"How many lines the reviewer checks, from 1 to 500, each picked with the same chance."},"outputKey":{"type":"string","minLength":1,"maxLength":200,"description":"The name of the list output the lines come from: a `LIST` output, or a CSV, XLSX or JSON file output."}},"required":["size","outputKey"],"additionalProperties":false},{"type":"null"}],"description":"With `humanReview` on, the reviewer checks `size` lines (from 1 to 500), each picked with the same chance, of the list output named by `outputKey`, instead of every line. The output is a `LIST`, or a CSV, XLSX or JSON file. On a new step, leave `reviewSample` out to check every line. On `update_step`, leave it out to keep the sample the step already has, and send `null` to check every line. When the step's automation agent sets `reviewSampleSize`, the review checks at least that many even if `reviewSample` is left out, and sending `null` or a smaller `size` is refused (`422 CHANGES_REFUSED`, `LOCKED_BY_AGENT`)."},"reviewers":{"description":"Who reviews the AI output: an internal role, such as a manager or approver. Required when `humanReview` is `true`.","$ref":"#/components/schemas/StepConfigPart_reviewers"},"model":{"type":"string","description":"The AI model for this step. When not set, the step uses the model of the organization's AI connection, or the step type's default: Claude Opus for extract and Claude Sonnet for the others."},"preprocessing":{"type":"object","properties":{"mode":{"type":"string","enum":["auto","always","never"],"default":"auto","description":"When scanned documents are prepared. `auto` prepares scanned documents only, `always` prepares every document, `never` sends documents as they are. Defaults to `auto`."}},"description":"Preparation for scanned documents: a scan is converted to structured text before the AI reads it."},"extractionMode":{"type":"string","enum":["standard","high_accuracy"],"description":"How a document is read. `standard` reads it in large sections and suits most documents. `high_accuracy` reads it in sections of up to 3 pages, for dense multi-page documents such as general ledgers or bank statements. Defaults to `standard`."},"extractMethod":{"type":"string","enum":["standard","complex_documents"],"description":"Optional advanced extraction. `complex_documents` turns on advanced extraction, which also reads scanned documents. Extraction itself is always on."},"extractArithmeticCheck":{"type":"boolean","description":"Whether the step checks that the extracted figures add up (a running balance, each journal's debits and credits). When on, a read whose figures do not add up pauses for a person to review."},"extractArithmeticVerification":{"type":"boolean","description":"The earlier name of `extractArithmeticCheck`. Still read when `extractArithmeticCheck` is not set; new saves use `extractArithmeticCheck`."},"extractPack":{"type":"object","properties":{"requiredTypes":{"maxItems":12,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"The document type's id, for example `invoice`, `purchase_order` or `receipt`. Lowercase with underscores, unique among the types."},"label":{"type":"string","minLength":1,"description":"The document type's display name, for example `Invoice`, `Purchase order` or `Receipt`."},"hints":{"type":"array","items":{"type":"string"},"description":"Optional file names or file types that identify a file of this type, for example `invoice`, `inv` or `po`."}},"required":["id","label"]},"description":"The document types this multi-file extraction must include, up to 12. Each type must match exactly one uploaded file, or the step pauses."}},"required":["requiredTypes"],"description":"The document types a multi-file extraction expects. The step pauses unless each required type matches exactly one uploaded file. Set by Moxo, not in the step editor."},"extractVerificationCriteria":{"maxItems":8,"type":"array","items":{"$ref":"#/components/schemas/StepConfigPart_extractVerificationCriteriaItem"},"description":"Plain-language checks run as part of arithmetic verification. Up to 8. `journal_footing` checks that a ledger's debits equal its credits; `custom` is a check you write."},"extractDocumentAbout":{"type":"string","maxLength":4000,"description":"An optional note on how accounts appear in the file and which lines to ignore. Plain text, up to 4,000 characters. Used when arithmetic verification is on."},"sourceLanguage":{"type":"string","description":"The language of the input, or `auto` to detect it."},"targetLanguage":{"type":"string","description":"The language to translate into. Defaults to English."},"domain":{"type":"string","description":"The subject area, so its terms are translated correctly (for example `LEGAL` or `MEDICAL`)."},"formalityLevel":{"type":"string","description":"How formal the translation is, for languages that mark formality."}},"required":["actionType"]},"StepConfig_AI_WRITE":{"type":"object","properties":{"aiAutomation":{"description":"The AI settings of the step: what the AI does, the data it receives and the outputs it produces.","$ref":"#/components/schemas/StepConfig_AI_WRITE_aiAutomation"},"aiEscalation":{"type":"object","properties":{"roleId":{"anyOf":[{"type":"string","minLength":1,"maxLength":80},{"type":"null"}]},"deskId":{"description":"A team desk instead of a role: the hand-off waits in the desk's queue until someone on it claims it. Set `roleId` or `deskId`, never both.","anyOf":[{"type":"string","minLength":1,"maxLength":80},{"type":"null"}]}},"additionalProperties":false},"visibleToAllAssignees":{"type":"boolean"},"blockOnFailure":{"type":"boolean","description":"Whether a failure stops the flow (\"Block the workflow if this step fails\"). `false` lets the flow continue past it; the failure is still recorded. Stops it when left out."},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"}},"title":"AI Write","description":"Writes content such as emails, reports, letters or documents with AI.\n\nThe settings a template read (`GET /v1/templates/{id}`) returns for this type, as stored. The shared settings (due date, reminders, visibility, monitors) can appear alongside them. To set them in a change, send `StepSettings_AI_WRITE`: where this shape holds an id, a change can name a role, field or step by its name or handle.\n\n**Offered by plan:** available when the organization's plan includes `aiWrite`.","x-moxo-step-type":"AI_WRITE","x-moxo-category":"AUTOMATION","x-moxo-plan-feature":"aiWrite"},"StepConfig_AI_WRITE_aiAutomation":{"type":"object","properties":{"agentId":{"not":{},"description":"Not accepted on AI utility steps. To run an automation AI agent as a step, use an `AI_AGENT` step and set its `config.agentId`."},"actionType":{"type":"string","enum":["CUSTOM_PROMPT","EXTRACT","SUMMARIZE","TRANSCRIBE","TRANSLATE","WRITE"]},"prompt":{"description":"The instructions for the AI. On a custom prompt step this is the main instruction; on other AI steps, such as extract or summarize, it refines the default behavior. Accepts plain text or a list of tokens; use the token list when the prompt includes references to values from earlier in the flow.","$ref":"#/components/schemas/StepConfigPart_emailBody"},"inputFields":{"description":"The data the AI receives. Include at least one input that references a value from an earlier step; without inputs the step fails.","$ref":"#/components/schemas/StepConfigPart_inputFields"},"outputFields":{"description":"The data the AI produces. Later steps can reference each output.","$ref":"#/components/schemas/StepConfigPart_outputFields"},"humanReview":{"type":"boolean","description":"Whether a member reviews the AI output before the flow continues. When `true`, also set `reviewers`: a step with review turned on and no reviewer can't be published. Defaults to `false`."},"reviewChat":{"type":"boolean","description":"Whether reviewers can talk to the AI about its output and revise the draft in place. Applies only when `humanReview` is `true`. Approving still sends the draft on. Defaults to `false`."},"reviewSample":{"anyOf":[{"type":"object","properties":{"size":{"type":"integer","minimum":1,"maximum":500,"description":"How many lines the reviewer checks, from 1 to 500, each picked with the same chance."},"outputKey":{"type":"string","minLength":1,"maxLength":200,"description":"The name of the list output the lines come from: a `LIST` output, or a CSV, XLSX or JSON file output."}},"required":["size","outputKey"],"additionalProperties":false},{"type":"null"}],"description":"With `humanReview` on, the reviewer checks `size` lines (from 1 to 500), each picked with the same chance, of the list output named by `outputKey`, instead of every line. The output is a `LIST`, or a CSV, XLSX or JSON file. On a new step, leave `reviewSample` out to check every line. On `update_step`, leave it out to keep the sample the step already has, and send `null` to check every line. When the step's automation agent sets `reviewSampleSize`, the review checks at least that many even if `reviewSample` is left out, and sending `null` or a smaller `size` is refused (`422 CHANGES_REFUSED`, `LOCKED_BY_AGENT`)."},"reviewers":{"description":"Who reviews the AI output: an internal role, such as a manager or approver. Required when `humanReview` is `true`.","$ref":"#/components/schemas/StepConfigPart_reviewers"},"model":{"type":"string","description":"The AI model for this step. When not set, the step uses the model of the organization's AI connection, or the step type's default: Claude Opus for extract and Claude Sonnet for the others."},"preprocessing":{"type":"object","properties":{"mode":{"type":"string","enum":["auto","always","never"],"default":"auto","description":"When scanned documents are prepared. `auto` prepares scanned documents only, `always` prepares every document, `never` sends documents as they are. Defaults to `auto`."}},"description":"Preparation for scanned documents: a scan is converted to structured text before the AI reads it."},"extractionMode":{"type":"string","enum":["standard","high_accuracy"],"description":"How a document is read. `standard` reads it in large sections and suits most documents. `high_accuracy` reads it in sections of up to 3 pages, for dense multi-page documents such as general ledgers or bank statements. Defaults to `standard`."},"extractMethod":{"type":"string","enum":["standard","complex_documents"],"description":"Optional advanced extraction. `complex_documents` turns on advanced extraction, which also reads scanned documents. Extraction itself is always on."},"extractArithmeticCheck":{"type":"boolean","description":"Whether the step checks that the extracted figures add up (a running balance, each journal's debits and credits). When on, a read whose figures do not add up pauses for a person to review."},"extractArithmeticVerification":{"type":"boolean","description":"The earlier name of `extractArithmeticCheck`. Still read when `extractArithmeticCheck` is not set; new saves use `extractArithmeticCheck`."},"extractPack":{"type":"object","properties":{"requiredTypes":{"maxItems":12,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"The document type's id, for example `invoice`, `purchase_order` or `receipt`. Lowercase with underscores, unique among the types."},"label":{"type":"string","minLength":1,"description":"The document type's display name, for example `Invoice`, `Purchase order` or `Receipt`."},"hints":{"type":"array","items":{"type":"string"},"description":"Optional file names or file types that identify a file of this type, for example `invoice`, `inv` or `po`."}},"required":["id","label"]},"description":"The document types this multi-file extraction must include, up to 12. Each type must match exactly one uploaded file, or the step pauses."}},"required":["requiredTypes"],"description":"The document types a multi-file extraction expects. The step pauses unless each required type matches exactly one uploaded file. Set by Moxo, not in the step editor."},"extractVerificationCriteria":{"maxItems":8,"type":"array","items":{"$ref":"#/components/schemas/StepConfigPart_extractVerificationCriteriaItem"},"description":"Plain-language checks run as part of arithmetic verification. Up to 8. `journal_footing` checks that a ledger's debits equal its credits; `custom` is a check you write."},"extractDocumentAbout":{"type":"string","maxLength":4000,"description":"An optional note on how accounts appear in the file and which lines to ignore. Plain text, up to 4,000 characters. Used when arithmetic verification is on."},"writeType":{"type":"string","enum":["email","message","document","report"],"description":"What kind of writing it is: `email`, `message`, `document` or `report`. It sets the credit cost."},"contentType":{"type":"string","description":"The kind of content to write. Defaults to `GENERAL`."},"tone":{"type":"string","description":"The tone of the writing. Defaults to `PROFESSIONAL`."},"audience":{"type":"string","description":"Who the writing is for."},"maxLength":{"anyOf":[{"type":"string"},{"type":"number"}],"description":"How long the writing should be."},"template":{"type":"string","description":"A structure for the writing to follow."}},"required":["actionType"]},"StepConfig_AI_AGENT":{"type":"object","properties":{"agentId":{"type":"string","description":"The id of the AI agent to run. Required. An existing agent's id, or the id `POST /v1/agents` returns."},"context":{"type":"string","description":"What this step tells the agent. Can include references to earlier steps' values, such as `${{ steps.<step>.fields.<field> }}`. Text only: a file reference becomes the file's name here, not its content. To give the agent a file's content, use `aiAutomation.inputFields`."},"aiAutomation":{"description":"The step's context and file inputs for the agent. Optional. Prefer it to `context` in new templates.","$ref":"#/components/schemas/StepConfig_AI_AGENT_aiAutomation"},"aiEscalation":{"type":"object","properties":{"roleId":{"anyOf":[{"type":"string","minLength":1,"maxLength":80},{"type":"null"}]},"deskId":{"description":"A team desk instead of a role: the hand-off waits in the desk's queue until someone on it claims it. Set `roleId` or `deskId`, never both.","anyOf":[{"type":"string","minLength":1,"maxLength":80},{"type":"null"}]}},"additionalProperties":false},"visibleToAllAssignees":{"type":"boolean"},"blockOnFailure":{"type":"boolean","description":"Whether a failure stops the flow (\"Block the workflow if this step fails\"). `false` lets the flow continue past it; the failure is still recorded. Stops it when left out."},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"}},"required":["agentId"],"title":"AI Agent","description":"Runs one of your organization's AI agents, with its own instructions, knowledge, skills and guardrails.\n\nThe settings a template read (`GET /v1/templates/{id}`) returns for this type, as stored. The shared settings (due date, reminders, visibility, monitors) can appear alongside them. To set them in a change, send `StepSettings_AI_AGENT`: where this shape holds an id, a change can name a role, field or step by its name or handle.\n\n**Offered by plan:** available when the organization's plan includes `agents`.","x-moxo-step-type":"AI_AGENT","x-moxo-category":"AUTOMATION","x-moxo-plan-feature":"agents"},"StepConfig_AI_AGENT_aiAutomation":{"type":"object","properties":{"stepContext":{"type":"string","description":"What this step tells the agent; the same as `context`, and the preferred place for it. Can include references to text values only. Files go in `inputFields`."},"humanReview":{"type":"boolean","description":"Whether a member reviews the agent's output before the step completes. Defaults to off. When `true`, `reviewers` is required: a step with review on and no reviewer can't be published, and would wait forever when it runs."},"reviewChat":{"type":"boolean","description":"Whether reviewers can talk to the AI about its output and revise the draft in place. Applies only when `humanReview` is `true`. Approving still sends the draft on. Defaults to `false`."},"reviewSample":{"anyOf":[{"type":"object","properties":{"size":{"type":"integer","minimum":1,"maximum":500,"description":"How many lines the reviewer checks, from 1 to 500, each picked with the same chance."},"outputKey":{"type":"string","minLength":1,"maxLength":200,"description":"The name of the list output the lines come from: a `LIST` output, or a CSV, XLSX or JSON file output."}},"required":["size","outputKey"],"additionalProperties":false},{"type":"null"}],"description":"With `humanReview` on, the reviewer checks `size` lines (from 1 to 500), each picked with the same chance, of the list output named by `outputKey`, instead of every line. The output is a `LIST`, or a CSV, XLSX or JSON file. On a new step, leave `reviewSample` out to check every line. On `update_step`, leave it out to keep the sample the step already has, and send `null` to check every line. When the step's automation agent sets `reviewSampleSize`, the review checks at least that many even if `reviewSample` is left out, and sending `null` or a smaller `size` is refused (`422 CHANGES_REFUSED`, `LOCKED_BY_AGENT`)."},"reviewers":{"description":"Who reviews the agent's output: an internal role, such as the flow's manager or approver. Required when `humanReview` is `true`.","$ref":"#/components/schemas/StepConfigPart_reviewers"},"requiresApproval":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"boolean"},"description":"The agent's actions that need a person's approval in this flow, such as `{ \"send_email\": true }`. The agent pauses for approval before each one. Not read while `approvalScope` is `\"all\"`."},"approvalScope":{"type":"string","enum":["all","only"],"description":"`\"all\"`: the agent waits for a person's approval before every action it takes, including actions it gains later. `\"only\"`, or left out: only the actions in `requiresApproval`."},"inputFields":{"description":"The values for the inputs the agent declares, one entry for each input, matched by name. Use it only when the agent declares inputs. For an agent with no declared inputs, pass text through `stepContext`: an input that is not a file and matches no declared input is dropped.","$ref":"#/components/schemas/StepConfig_AI_AGENT_inputFields"},"writableFields":{"type":"array","items":{"type":"string","minLength":1},"description":"The flow fields the agent may change, by id or key. Leave it out to let it change any; an empty list lets it change none."}}},"StepConfig_AI_AGENT_inputFields":{"type":"array","items":{"type":"object","properties":{"fieldId":{"type":"string","description":"A unique id for the input, such as `in_1`."},"name":{"type":"string","description":"The input's name. Must match one of the agent's declared input names exactly, since inputs are matched by name. For example, an agent that declares `company_name` and `email` needs one entry with each name."},"type":{"type":"string","enum":["TEXT","NUMBER","DATE","BOOLEAN","FILE"],"description":"The input's type: `FILE` passes an uploaded file's content (from a File request step); `TEXT`, `NUMBER`, `DATE` and `BOOLEAN` pass a value, such as a form answer. When the agent declares its inputs, their declared types are used, so match them."},"value":{"anyOf":[{"type":"string","description":"Where the input's value comes from: a reference to a value from earlier in the flow. Required. For a `FILE` input, a File request step's files, such as `${{ steps.upload_documents.fields.uploaded_files }}`, which passes the files' content. For other types, the earlier step's field, such as `${{ steps.client_intake.fields.company_name }}`, which passes its value."},{"$ref":"#/components/schemas/StepConfigPart_ref"},{"$ref":"#/components/schemas/StepConfigPart_value_2"},{"type":"object","properties":{"kind":{"type":"string","const":"for-each-item"},"expectedType":{"type":"string"},"selector":{"type":"string","enum":["item","index","number","total"],"description":"What to read from the current pass of a loop. `item` reads a column of the current row; `index` (starting at 0), `number` (starting at 1) and `total` are the loop's counters."},"itemFieldId":{"description":"The column's id, for `item`. Preferred over `itemField`, because it still works after the column is renamed.","type":"string"},"itemField":{"description":"The column's label, for `item` when the list has no column ids. A label stops working when the column is renamed.","type":"string"}},"required":["kind","expectedType","selector"]}],"description":"Where the input's value comes from: a reference to a value from earlier in the flow. Accepts the reference as text or as a structured reference; the structured form is preferred, and text is converted to it on the next save."},"agentInputId":{"type":"string","description":"The agent's input this row fills, by its permanent id. Matched before `name`."}},"required":["name","type","value"]}},"StepConfig_SYSTEM_WEBHOOK":{"type":"object","properties":{"systemWebhook":{"description":"The webhook settings. The step sends a `POST` with a standard Moxo event to the URL. Set `dataFromStepId` to include an earlier step's outputs, and `context` for more values. Set `connectionId` to sign the request in with a saved Secret. For other methods, other headers, a body of your own or to use the reply, use a `REST_API` step.","$ref":"#/components/schemas/StepConfig_SYSTEM_WEBHOOK_systemWebhook"},"approveBeforeRun":{"type":"boolean","description":"Whether a person approves the values this step is about to use before it runs. Available on `REST_API`, `EXTERNAL_APP`, `MCP_SERVER`, `SYSTEM_EMAIL`, `SEND_ANNOUNCEMENT`, `SEND_TO_CONVERSATION`, `SYSTEM_WEBHOOK`, `DATA_TABLE_SAVE_RECORD`, `START_FLOW`, `SCHEDULE_FLOW`, `CODE`, `COLLECT_PAYMENT`, `DOCUSIGN` and `ADOBE_SIGN` steps. When `true`, the step pauses before it calls, sends, writes, starts or schedules anything, until someone approves. Set who approves in the step's `reviewers`: a step with approval on and no approver can't be published."},"approvalRejectMode":{"type":"string","enum":["skip","halt"],"description":"What a rejection does, with `approveBeforeRun`. `skip` (the default) skips this step and the flow continues; `halt` stops the flow."},"webhook":{"type":"object","properties":{"method":{"type":"string","description":"The HTTP method of the call."},"url":{"type":"string"},"connectionId":{"type":"string"},"pendingSecretName":{"type":"string"}}},"reviewers":{"anyOf":[{"type":"object","properties":{"participants":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["AI","HUMAN"]},"roleId":{"type":"string","description":"For a person: the role that takes this seat, by its id."},"contactId":{"type":"string","description":"An external user named on the seat, by the `usr_` id the template read shows. `null` follows the read, as for `userId`."},"userId":{"type":"string","description":"A person named on the seat, by the `usr_` id the template read shows. `null` where the read showed `null` (someone with no id here) keeps the saved person; `null` where it showed an id takes them off the seat."},"agentId":{"type":"string"},"prompt":{"type":"string","description":"The AI participant's step context: instructions for this step only."},"criteria":{"type":"string","description":"For an AI reviewer: what to check. Read before `prompt`."},"context":{"type":"string","description":"An older home of the AI participant's step context, still read. Set `prompt` instead."},"privateNotesGuidance":{"type":"string","maxLength":2000,"description":"When no agent is named: what the AI notes privately for the flow's managers."},"sendBackReply":{"type":"string","enum":["outcome_with_reason","outcome_only"],"description":"When the AI sends work back and no agent is named: what the reply says, `outcome_with_reason` or `outcome_only`."},"howToExplain":{"type":"string","maxLength":2000,"description":"When the AI sends work back and no agent is named: how it explains what to fix."},"inputs":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"value":{"type":"string"},"type":{"type":"string","enum":["TEXT","FILE"]}},"required":["name","value"]}},"participantId":{"type":"string","description":"The participant's id on the step. Keep it when sending the seat back; leave it out for a new participant."},"order":{"type":"number","description":"The participant's place in the seat, from 0, when they act one after another."},"aiConfig":{}},"required":["type"],"additionalProperties":{}}},"sequential":{"type":"boolean"},"completion":{"type":"object","properties":{"mode":{"type":"string","enum":["ANY_ONE","ALL"],"description":"`ANY_ONE`: one participant finishing is enough. `ALL`: every participant finishes."}},"required":["mode"],"description":"When the seat is done."},"showToExternalAssignee":{"description":"Advisors only. `true` lets an assignee outside your organization read the recommendation (the call and its reasons), as advice from your organization. Off unless set.","type":"boolean"},"canEditAnswers":{"description":"Reviewers only, on a Form, PDF form or File request step. `true` lets the reviewer whose turn it is edit the submitted answers (on a File request, add and remove its files) during review, in the Moxo app, instead of sending them back. Off unless set.","type":"boolean"},"reviewItemsTogether":{"description":"Reviewers only, on a person's step inside a For each whose items run at the same time. `true` gives the reviewer one list and one notice for every item instead of one review per item; each item keeps its own run and review. With the loop's `syncStepsAcrossIterations` on, the reviewer approves every item at once (`approve_reviews_together`); off, each item is approved on its own. Publish refuses it in a Repeat while, on an \"Approve before it runs\" step, with no person or role reviewing, and in a loop that runs items one at a time. Off unless set.","type":"boolean"}},"required":["participants"]},{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["AI","HUMAN"]},"roleId":{"type":"string"},"contactId":{"type":"string"},"userId":{"type":"string"},"agentId":{"type":"string"},"prompt":{"type":"string"},"criteria":{"type":"string"},"context":{"type":"string"},"privateNotesGuidance":{"type":"string","maxLength":2000},"sendBackReply":{"type":"string","enum":["outcome_with_reason","outcome_only"]},"howToExplain":{"type":"string","maxLength":2000},"inputs":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"value":{"type":"string"},"type":{"type":"string","enum":["TEXT","FILE"]}},"required":["name","value"]}},"ruleKinds":{"maxItems":80,"type":"array","items":{"type":"object","properties":{"rule":{"type":"string","minLength":1,"maxLength":2000},"kind":{"type":"string","enum":["fact","data_match","coverage","visual","judgment"]},"compare":{"type":"object","properties":{"check":{"type":"string","enum":["compare.money_equal","compare.date_after","compare.names_equal","certificate.insured_name_matches","certificate.limit_at_least","kyc.id_name_matches","kyc.birth_date_matches","kyc.dated_within_three_months"]},"against":{"type":"string","enum":["today","value","input"]},"value":{"type":"string","minLength":1,"maxLength":500},"input":{"type":"string","minLength":1,"maxLength":200}},"required":["check","against"]},"document":{"type":"string","minLength":1,"maxLength":200},"sum":{"type":"object","properties":{"fields":{"minItems":2,"maxItems":60,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}}},"required":["fields"]}},"required":["rule","kind"]}},"participantId":{"type":"string"},"order":{"type":"number"},"aiConfig":{}},"required":["type"],"additionalProperties":{}}}]},"visibleToAllAssignees":{"type":"boolean"},"blockOnFailure":{"type":"boolean","description":"Whether a failure stops the flow (\"Block the workflow if this step fails\"). `false` lets the flow continue past it; the failure is still recorded. Stops it when left out."},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"}},"title":"Webhook","description":"Sends a Moxo event, in a standard format, to an outside URL with a `POST` request.\n\nThe settings a template read (`GET /v1/templates/{id}`) returns for this type, as stored. The shared settings (due date, reminders, visibility, monitors) can appear alongside them. To set them in a change, send `StepSettings_SYSTEM_WEBHOOK`: where this shape holds an id, a change can name a role, field or step by its name or handle.\n\n**Offered by plan:** available when the organization's plan includes `systemWebhook`.","x-moxo-step-type":"SYSTEM_WEBHOOK","x-moxo-category":"AUTOMATION","x-moxo-plan-feature":"systemWebhook"},"StepConfig_SYSTEM_WEBHOOK_systemWebhook":{"type":"object","properties":{"url":{"type":"string"},"dataFromStepId":{"type":"string","description":"The `stepId` of an earlier step in the flow whose outputs are sent with the event, as `dataStep`. Leave it out to send no step data."},"context":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"},"description":"Extra values sent in the event's `context`, as key and value pairs. A value can reference values from earlier in the flow, such as `${{ steps.<step>.fields.<field> }}` or `${{ fields.<key> }}`."},"connectionId":{"type":"string","description":"The id of a saved Secret to sign in with. When set, the Secret's credentials are added to the `POST`, and only for an address on the Secret's own host."},"pendingSecretName":{"type":"string","description":"The name of a Secret this step needs. The template can't be published until the step has a Secret."},"payloadVersion":{"anyOf":[{"type":"number","const":1},{"type":"number","const":2}],"description":"Which body the POST carries. `2`, what a new action starts with: `event: \"webhook_step.fired\"`, `schemaVersion: 2`. `1`, what an action that names none sends: `event: \"step.completed\"`, `schemaVersion: 1`, the body it has always sent."}}},"StepConfig_SYSTEM_EMAIL":{"type":"object","properties":{"systemEmail":{"description":"The email to send. Each recipient is text: an email address or a reference such as `${{ roles.client.email }}`. Attachments are typed references, checked when the template is saved; the subject and body are text that can include references to flow values.","$ref":"#/components/schemas/StepConfig_SYSTEM_EMAIL_systemEmail"},"approveBeforeRun":{"type":"boolean","description":"Whether a person approves the values this step is about to use before it runs. Available on `REST_API`, `EXTERNAL_APP`, `MCP_SERVER`, `SYSTEM_EMAIL`, `SEND_ANNOUNCEMENT`, `SEND_TO_CONVERSATION`, `SYSTEM_WEBHOOK`, `DATA_TABLE_SAVE_RECORD`, `START_FLOW`, `SCHEDULE_FLOW`, `CODE`, `COLLECT_PAYMENT`, `DOCUSIGN` and `ADOBE_SIGN` steps. When `true`, the step pauses before it calls, sends, writes, starts or schedules anything, until someone approves. Set who approves in the step's `reviewers`: a step with approval on and no approver can't be published."},"approvalRejectMode":{"type":"string","enum":["skip","halt"],"description":"What a rejection does, with `approveBeforeRun`. `skip` (the default) skips this step and the flow continues; `halt` stops the flow."},"reviewers":{"anyOf":[{"type":"object","properties":{"participants":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["AI","HUMAN"]},"roleId":{"type":"string","description":"For a person: the role that takes this seat, by its id."},"contactId":{"type":"string","description":"An external user named on the seat, by the `usr_` id the template read shows. `null` follows the read, as for `userId`."},"userId":{"type":"string","description":"A person named on the seat, by the `usr_` id the template read shows. `null` where the read showed `null` (someone with no id here) keeps the saved person; `null` where it showed an id takes them off the seat."},"agentId":{"type":"string"},"prompt":{"type":"string","description":"The AI participant's step context: instructions for this step only."},"criteria":{"type":"string","description":"For an AI reviewer: what to check. Read before `prompt`."},"context":{"type":"string","description":"An older home of the AI participant's step context, still read. Set `prompt` instead."},"privateNotesGuidance":{"type":"string","maxLength":2000,"description":"When no agent is named: what the AI notes privately for the flow's managers."},"sendBackReply":{"type":"string","enum":["outcome_with_reason","outcome_only"],"description":"When the AI sends work back and no agent is named: what the reply says, `outcome_with_reason` or `outcome_only`."},"howToExplain":{"type":"string","maxLength":2000,"description":"When the AI sends work back and no agent is named: how it explains what to fix."},"inputs":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"value":{"type":"string"},"type":{"type":"string","enum":["TEXT","FILE"]}},"required":["name","value"]}},"participantId":{"type":"string","description":"The participant's id on the step. Keep it when sending the seat back; leave it out for a new participant."},"order":{"type":"number","description":"The participant's place in the seat, from 0, when they act one after another."},"aiConfig":{}},"required":["type"],"additionalProperties":{}}},"sequential":{"type":"boolean"},"completion":{"type":"object","properties":{"mode":{"type":"string","enum":["ANY_ONE","ALL"],"description":"`ANY_ONE`: one participant finishing is enough. `ALL`: every participant finishes."}},"required":["mode"],"description":"When the seat is done."},"showToExternalAssignee":{"description":"Advisors only. `true` lets an assignee outside your organization read the recommendation (the call and its reasons), as advice from your organization. Off unless set.","type":"boolean"},"canEditAnswers":{"description":"Reviewers only, on a Form, PDF form or File request step. `true` lets the reviewer whose turn it is edit the submitted answers (on a File request, add and remove its files) during review, in the Moxo app, instead of sending them back. Off unless set.","type":"boolean"},"reviewItemsTogether":{"description":"Reviewers only, on a person's step inside a For each whose items run at the same time. `true` gives the reviewer one list and one notice for every item instead of one review per item; each item keeps its own run and review. With the loop's `syncStepsAcrossIterations` on, the reviewer approves every item at once (`approve_reviews_together`); off, each item is approved on its own. Publish refuses it in a Repeat while, on an \"Approve before it runs\" step, with no person or role reviewing, and in a loop that runs items one at a time. Off unless set.","type":"boolean"}},"required":["participants"]},{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["AI","HUMAN"]},"roleId":{"type":"string"},"contactId":{"type":"string"},"userId":{"type":"string"},"agentId":{"type":"string"},"prompt":{"type":"string"},"criteria":{"type":"string"},"context":{"type":"string"},"privateNotesGuidance":{"type":"string","maxLength":2000},"sendBackReply":{"type":"string","enum":["outcome_with_reason","outcome_only"]},"howToExplain":{"type":"string","maxLength":2000},"inputs":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"value":{"type":"string"},"type":{"type":"string","enum":["TEXT","FILE"]}},"required":["name","value"]}},"ruleKinds":{"maxItems":80,"type":"array","items":{"type":"object","properties":{"rule":{"type":"string","minLength":1,"maxLength":2000},"kind":{"type":"string","enum":["fact","data_match","coverage","visual","judgment"]},"compare":{"type":"object","properties":{"check":{"type":"string","enum":["compare.money_equal","compare.date_after","compare.names_equal","certificate.insured_name_matches","certificate.limit_at_least","kyc.id_name_matches","kyc.birth_date_matches","kyc.dated_within_three_months"]},"against":{"type":"string","enum":["today","value","input"]},"value":{"type":"string","minLength":1,"maxLength":500},"input":{"type":"string","minLength":1,"maxLength":200}},"required":["check","against"]},"document":{"type":"string","minLength":1,"maxLength":200},"sum":{"type":"object","properties":{"fields":{"minItems":2,"maxItems":60,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}}},"required":["fields"]}},"required":["rule","kind"]}},"participantId":{"type":"string"},"order":{"type":"number"},"aiConfig":{}},"required":["type"],"additionalProperties":{}}}]},"visibleToAllAssignees":{"type":"boolean"},"blockOnFailure":{"type":"boolean","description":"Whether a failure stops the flow (\"Block the workflow if this step fails\"). `false` lets the flow continue past it; the failure is still recorded. Stops it when left out."},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"}},"title":"Send Email","description":"Sends an email automatically.\n\nThe settings a template read (`GET /v1/templates/{id}`) returns for this type, as stored. The shared settings (due date, reminders, visibility, monitors) can appear alongside them. To set them in a change, send `StepSettings_SYSTEM_EMAIL`: where this shape holds an id, a change can name a role, field or step by its name or handle.\n\n**Offered by plan:** available when the organization's plan includes `systemEmail`.","x-moxo-step-type":"SYSTEM_EMAIL","x-moxo-category":"AUTOMATION","x-moxo-plan-feature":"systemEmail"},"StepConfig_SYSTEM_EMAIL_systemEmail":{"type":"object","properties":{"to":{"type":"array","items":{"type":"string","description":"An email address, such as `support@example.com`, or a reference to an address from the flow, such as `${{ roles.client.email }}` or `${{ steps.intake.fields.email }}`."},"description":"Who receives the email. Each entry is text: an email address, such as `ops@example.com`, or a reference to an address from the flow, such as `${{ roles.client.email }}` or `${{ steps.intake.fields.email }}`."},"cc":{"type":"array","items":{"type":"string","description":"An email address, such as `support@example.com`, or a reference to an address from the flow, such as `${{ roles.client.email }}` or `${{ steps.intake.fields.email }}`."},"description":"Who receives a copy, written like `to`: email addresses or references such as `${{ roles.client.email }}`. They appear in the email's Cc line. Use it for people who should be informed but aren't the main recipient."},"replyTo":{"type":"array","items":{"type":"string","description":"An email address, such as `support@example.com`, or a reference to an address from the flow, such as `${{ roles.client.email }}` or `${{ steps.intake.fields.email }}`."},"description":"Where replies go, written like `to`: an email address or a reference such as `${{ roles.account_manager.email }}`, which sends replies to the right person in each flow. Overrides the organization's default reply-to address for this step. Usually one address; a list is accepted."},"subject":{"anyOf":[{"type":"string"},{"type":"array","items":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"text","description":"The part's type."},"text":{"type":"string","description":"Fixed text."}},"required":["kind","text"]},{"type":"object","properties":{"kind":{"type":"string","const":"input","description":"The part's type."},"key":{"type":"string","minLength":1,"description":"The key of a start field the template declares."}},"required":["kind","key"]},{"type":"object","properties":{"kind":{"type":"string","const":"role","description":"The part's type."},"roleName":{"type":"string","minLength":1,"description":"A role's name."},"field":{"type":"string","enum":["name","email","phone","title"],"description":"Which of the role's details: `name`, `email`, `phone` or `title`."}},"required":["kind","roleName","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"flow","description":"The part's type."},"field":{"type":"string","enum":["name","description","dueDate","startDate","dueTimestamp","startTimestamp","id"],"description":"Which detail of the flow: `name`, `description`, `dueDate`, `startDate`, `dueTimestamp`, `startTimestamp` or `id`."}},"required":["kind","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"organization","description":"The part's type."},"field":{"type":"string","enum":["name","id"],"description":"Which detail of the organization: `name` or `id`."}},"required":["kind","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"system","description":"The part's type."},"field":{"type":"string","const":"today","description":"Today's date, in the organization's time zone."}},"required":["kind","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"step","description":"The part's type."},"stepName":{"type":"string","minLength":1,"description":"The name of an earlier step."},"field":{"type":"string","minLength":1,"description":"The name of that step's output."}},"required":["kind","stepName","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"current_item","description":"The part's type."},"field":{"type":"string","minLength":1,"description":"A field of the current item, in a step that repeats for each item."}},"required":["kind","field"]}]}}],"description":"The email's subject: text that can include references to flow values, or a list of typed parts, such as `[{ \"kind\": \"text\", \"text\": \"Welcome \" }, { \"kind\": \"input\", \"key\": \"client_name\" }]`. Typed parts can only refer to roles, fields and steps the template has. Either form is saved as text."},"body":{"description":"The email's body: text that can include references to flow values, or a list of typed parts: `{ \"kind\": \"text\", \"text\": \"...\" }` and references whose `kind` is `role`, `input`, `step`, `flow`, `organization` or `current_item`. Use typed parts when the body refers to earlier steps' results, people's details, flow fields, or organization or flow details: they are checked when the template is saved, so a reference can't go stale. Either form is saved as text.","$ref":"#/components/schemas/StepConfigPart_emailBody"},"attachments":{"description":"Files to attach, each a reference to a file from an earlier step, as a typed reference or as text. A reference to a step the template doesn't have, or to something that isn't a file, is refused.","$ref":"#/components/schemas/StepConfig_SYSTEM_EMAIL_attachments"},"includeOrgLogo":{"type":"boolean","description":"Whether to show the organization's logo, set in Branding, at the top of the email. Defaults to `false`, so the email starts with the body."}}},"StepConfig_SYSTEM_EMAIL_attachments":{"type":"array","items":{"type":"object","properties":{"ref":{"anyOf":[{"oneOf":[{"$ref":"#/components/schemas/StepConfigPart_ref_2"},{"type":"object","properties":{"kind":{"type":"string","const":"role","description":"`role`: the reference points at a person on the flow. Set `roleName` and `field` too."},"roleName":{"type":"string","minLength":1,"description":"The role's name, exactly as it appears in the template's roles."},"field":{"type":"string","minLength":1,"description":"The person's detail: `name`, `email`, `phone` or `contactId`, or the key of a custom user field."}},"required":["kind","roleName","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"input","description":"`input`: the reference points at a flow field, whether or not it is asked for at the start. Set `key` too."},"key":{"type":"string","minLength":1,"description":"The flow field's key, not its label. Any of the template's flow fields works, not only those asked for at the start. `_start_link_email` is allowed only when the flow has a start link."}},"required":["kind","key"]},{"type":"object","properties":{"kind":{"type":"string","const":"organization","description":"`organization`: the reference points at the organization. Set `field` to `name` or `id` too."},"field":{"type":"string","minLength":1,"description":"The organization detail: `name` or `id`."}},"required":["kind","field"]}]},{"type":"string","minLength":1}],"description":"A file from an earlier step, preferably as a typed reference such as `{ \"kind\": \"step\", \"stepName\": \"File Request\", \"field\": \"Uploaded Files\" }`. A text reference to a file is also accepted. Role and organization references are refused, because they hold no file."},"kind":{"type":"string","enum":["file","link"],"description":"Whether the entry is a file or a web link. Only files are attached to the email; links are left out."}},"required":["ref"]}},"StepConfigPart_ref_2":{"type":"object","properties":{"kind":{"type":"string","const":"step","description":"`step`: the reference points at an earlier step. Set `stepName` and `field` too."},"stepName":{"type":"string","minLength":1,"description":"The referenced step's name, exactly as it appears in the template."},"field":{"type":"string","minLength":1,"description":"The label or key of the field in the referenced step's results."},"subId":{"type":"string","minLength":1,"description":"The column's id in a repeating group. Leave it out to refer to the whole field."},"sub":{"type":"string","minLength":1,"description":"The column's label in a repeating group. Use `subId` instead when you can."},"rowIndex":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"The row in a repeating group, counted from 0. Leave it out to refer to every row of the column."}},"required":["kind","stepName","field"]},"StepConfig_SEND_ANNOUNCEMENT":{"type":"object","properties":{"sendAnnouncement":{"description":"Posts a one-way announcement to the Announcements channel of the flow's chat. By default, everyone sees it and is notified, and nobody can reply. `audienceRoleIds` narrows who is notified, for example so a client update doesn't email the tax preparer. The flow's chat must have an Announcements channel.","$ref":"#/components/schemas/StepConfig_SEND_ANNOUNCEMENT_sendAnnouncement"},"approveBeforeRun":{"type":"boolean","description":"Whether a person approves the values this step is about to use before it runs. Available on `REST_API`, `EXTERNAL_APP`, `MCP_SERVER`, `SYSTEM_EMAIL`, `SEND_ANNOUNCEMENT`, `SEND_TO_CONVERSATION`, `SYSTEM_WEBHOOK`, `DATA_TABLE_SAVE_RECORD`, `START_FLOW`, `SCHEDULE_FLOW`, `CODE`, `COLLECT_PAYMENT`, `DOCUSIGN` and `ADOBE_SIGN` steps. When `true`, the step pauses before it calls, sends, writes, starts or schedules anything, until someone approves. Set who approves in the step's `reviewers`: a step with approval on and no approver can't be published."},"approvalRejectMode":{"type":"string","enum":["skip","halt"],"description":"What a rejection does, with `approveBeforeRun`. `skip` (the default) skips this step and the flow continues; `halt` stops the flow."},"reviewers":{"anyOf":[{"type":"object","properties":{"participants":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["AI","HUMAN"]},"roleId":{"type":"string","description":"For a person: the role that takes this seat, by its id."},"contactId":{"type":"string","description":"An external user named on the seat, by the `usr_` id the template read shows. `null` follows the read, as for `userId`."},"userId":{"type":"string","description":"A person named on the seat, by the `usr_` id the template read shows. `null` where the read showed `null` (someone with no id here) keeps the saved person; `null` where it showed an id takes them off the seat."},"agentId":{"type":"string"},"prompt":{"type":"string","description":"The AI participant's step context: instructions for this step only."},"criteria":{"type":"string","description":"For an AI reviewer: what to check. Read before `prompt`."},"context":{"type":"string","description":"An older home of the AI participant's step context, still read. Set `prompt` instead."},"privateNotesGuidance":{"type":"string","maxLength":2000,"description":"When no agent is named: what the AI notes privately for the flow's managers."},"sendBackReply":{"type":"string","enum":["outcome_with_reason","outcome_only"],"description":"When the AI sends work back and no agent is named: what the reply says, `outcome_with_reason` or `outcome_only`."},"howToExplain":{"type":"string","maxLength":2000,"description":"When the AI sends work back and no agent is named: how it explains what to fix."},"inputs":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"value":{"type":"string"},"type":{"type":"string","enum":["TEXT","FILE"]}},"required":["name","value"]}},"participantId":{"type":"string","description":"The participant's id on the step. Keep it when sending the seat back; leave it out for a new participant."},"order":{"type":"number","description":"The participant's place in the seat, from 0, when they act one after another."},"aiConfig":{}},"required":["type"],"additionalProperties":{}}},"sequential":{"type":"boolean"},"completion":{"type":"object","properties":{"mode":{"type":"string","enum":["ANY_ONE","ALL"],"description":"`ANY_ONE`: one participant finishing is enough. `ALL`: every participant finishes."}},"required":["mode"],"description":"When the seat is done."},"showToExternalAssignee":{"description":"Advisors only. `true` lets an assignee outside your organization read the recommendation (the call and its reasons), as advice from your organization. Off unless set.","type":"boolean"},"canEditAnswers":{"description":"Reviewers only, on a Form, PDF form or File request step. `true` lets the reviewer whose turn it is edit the submitted answers (on a File request, add and remove its files) during review, in the Moxo app, instead of sending them back. Off unless set.","type":"boolean"},"reviewItemsTogether":{"description":"Reviewers only, on a person's step inside a For each whose items run at the same time. `true` gives the reviewer one list and one notice for every item instead of one review per item; each item keeps its own run and review. With the loop's `syncStepsAcrossIterations` on, the reviewer approves every item at once (`approve_reviews_together`); off, each item is approved on its own. Publish refuses it in a Repeat while, on an \"Approve before it runs\" step, with no person or role reviewing, and in a loop that runs items one at a time. Off unless set.","type":"boolean"}},"required":["participants"]},{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["AI","HUMAN"]},"roleId":{"type":"string"},"contactId":{"type":"string"},"userId":{"type":"string"},"agentId":{"type":"string"},"prompt":{"type":"string"},"criteria":{"type":"string"},"context":{"type":"string"},"privateNotesGuidance":{"type":"string","maxLength":2000},"sendBackReply":{"type":"string","enum":["outcome_with_reason","outcome_only"]},"howToExplain":{"type":"string","maxLength":2000},"inputs":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"value":{"type":"string"},"type":{"type":"string","enum":["TEXT","FILE"]}},"required":["name","value"]}},"ruleKinds":{"maxItems":80,"type":"array","items":{"type":"object","properties":{"rule":{"type":"string","minLength":1,"maxLength":2000},"kind":{"type":"string","enum":["fact","data_match","coverage","visual","judgment"]},"compare":{"type":"object","properties":{"check":{"type":"string","enum":["compare.money_equal","compare.date_after","compare.names_equal","certificate.insured_name_matches","certificate.limit_at_least","kyc.id_name_matches","kyc.birth_date_matches","kyc.dated_within_three_months"]},"against":{"type":"string","enum":["today","value","input"]},"value":{"type":"string","minLength":1,"maxLength":500},"input":{"type":"string","minLength":1,"maxLength":200}},"required":["check","against"]},"document":{"type":"string","minLength":1,"maxLength":200},"sum":{"type":"object","properties":{"fields":{"minItems":2,"maxItems":60,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}}},"required":["fields"]}},"required":["rule","kind"]}},"participantId":{"type":"string"},"order":{"type":"number"},"aiConfig":{}},"required":["type"],"additionalProperties":{}}}]},"visibleToAllAssignees":{"type":"boolean"},"blockOnFailure":{"type":"boolean","description":"Whether a failure stops the flow (\"Block the workflow if this step fails\"). `false` lets the flow continue past it; the failure is still recorded. Stops it when left out."},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"}},"title":"Send Announcement","description":"Posts an announcement to the flow's chat, to everyone by default or to selected roles.\n\nThe settings a template read (`GET /v1/templates/{id}`) returns for this type, as stored. The shared settings (due date, reminders, visibility, monitors) can appear alongside them. To set them in a change, send `StepSettings_SEND_ANNOUNCEMENT`: where this shape holds an id, a change can name a role, field or step by its name or handle.\n\n**Offered by plan:** available when the organization's plan includes `flowChatAnnouncements`.","x-moxo-step-type":"SEND_ANNOUNCEMENT","x-moxo-category":"AUTOMATION","x-moxo-plan-feature":"flowChatAnnouncements"},"StepConfig_SEND_ANNOUNCEMENT_sendAnnouncement":{"type":"object","properties":{"body":{"description":"The announcement. Either text with references, such as `Your kickoff is ${{ steps.schedule_kickoff.fields.date }}`, or a list of parts: `{ kind: \"text\", text }` and `{ kind: \"step\" | \"input\" | \"role\" | \"flow\" | \"organization\" | \"current_item\", ... }`. The list form is checked against the template, so use it when the text refers to earlier steps, start fields, roles, the flow or the organization. Saved as text.","$ref":"#/components/schemas/StepConfigPart_emailBody"},"audience":{"type":"string","enum":["everyone","roles"],"description":"Who the announcement is for. `everyone`, or omitted, reaches every participant (the default). `roles` reaches selected roles only, and with no role selected it reaches nobody. Publishing requires at least one role when it is `roles`."},"audienceRoleIds":{"type":"array","items":{"type":"string","minLength":1},"description":"The template role ids the announcement reaches, from the flow's roles (for example Client). Empty or omitted reaches every participant, unless `audience` is `roles`, when an empty list reaches nobody. When set, only people in those roles are emailed and notified in the app; flow managers can still read the post in the flow, marked “Sent to …”, without an unread badge."}}},"StepConfig_SEND_TO_CONVERSATION":{"type":"object","properties":{"sendToConversation":{"description":"The settings of a Send to Conversation step, which acts in a Chat conversation people can reply in. This differs from Send announcement (a post inside the flow nobody can reply to), System email (a message to an address) and Conversation (an AI conversation with the assignee). A typical setup is one `create_conversation` step with role participants, then later steps whose `target` is `{ \"mode\": \"dynamic\", \"ref\": \"{<create step name> / Conversation ID}\" }`.","$ref":"#/components/schemas/StepConfig_SEND_TO_CONVERSATION_sendToConversation"},"approveBeforeRun":{"type":"boolean","description":"Whether a person approves the values this step is about to use before it runs. Available on `REST_API`, `EXTERNAL_APP`, `MCP_SERVER`, `SYSTEM_EMAIL`, `SEND_ANNOUNCEMENT`, `SEND_TO_CONVERSATION`, `SYSTEM_WEBHOOK`, `DATA_TABLE_SAVE_RECORD`, `START_FLOW`, `SCHEDULE_FLOW`, `CODE`, `COLLECT_PAYMENT`, `DOCUSIGN` and `ADOBE_SIGN` steps. When `true`, the step pauses before it calls, sends, writes, starts or schedules anything, until someone approves. Set who approves in the step's `reviewers`: a step with approval on and no approver can't be published."},"approvalRejectMode":{"type":"string","enum":["skip","halt"],"description":"What a rejection does, with `approveBeforeRun`. `skip` (the default) skips this step and the flow continues; `halt` stops the flow."},"reviewers":{"anyOf":[{"type":"object","properties":{"participants":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["AI","HUMAN"]},"roleId":{"type":"string","description":"For a person: the role that takes this seat, by its id."},"contactId":{"type":"string","description":"An external user named on the seat, by the `usr_` id the template read shows. `null` follows the read, as for `userId`."},"userId":{"type":"string","description":"A person named on the seat, by the `usr_` id the template read shows. `null` where the read showed `null` (someone with no id here) keeps the saved person; `null` where it showed an id takes them off the seat."},"agentId":{"type":"string"},"prompt":{"type":"string","description":"The AI participant's step context: instructions for this step only."},"criteria":{"type":"string","description":"For an AI reviewer: what to check. Read before `prompt`."},"context":{"type":"string","description":"An older home of the AI participant's step context, still read. Set `prompt` instead."},"privateNotesGuidance":{"type":"string","maxLength":2000,"description":"When no agent is named: what the AI notes privately for the flow's managers."},"sendBackReply":{"type":"string","enum":["outcome_with_reason","outcome_only"],"description":"When the AI sends work back and no agent is named: what the reply says, `outcome_with_reason` or `outcome_only`."},"howToExplain":{"type":"string","maxLength":2000,"description":"When the AI sends work back and no agent is named: how it explains what to fix."},"inputs":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"value":{"type":"string"},"type":{"type":"string","enum":["TEXT","FILE"]}},"required":["name","value"]}},"participantId":{"type":"string","description":"The participant's id on the step. Keep it when sending the seat back; leave it out for a new participant."},"order":{"type":"number","description":"The participant's place in the seat, from 0, when they act one after another."},"aiConfig":{}},"required":["type"],"additionalProperties":{}}},"sequential":{"type":"boolean"},"completion":{"type":"object","properties":{"mode":{"type":"string","enum":["ANY_ONE","ALL"],"description":"`ANY_ONE`: one participant finishing is enough. `ALL`: every participant finishes."}},"required":["mode"],"description":"When the seat is done."},"showToExternalAssignee":{"description":"Advisors only. `true` lets an assignee outside your organization read the recommendation (the call and its reasons), as advice from your organization. Off unless set.","type":"boolean"},"canEditAnswers":{"description":"Reviewers only, on a Form, PDF form or File request step. `true` lets the reviewer whose turn it is edit the submitted answers (on a File request, add and remove its files) during review, in the Moxo app, instead of sending them back. Off unless set.","type":"boolean"},"reviewItemsTogether":{"description":"Reviewers only, on a person's step inside a For each whose items run at the same time. `true` gives the reviewer one list and one notice for every item instead of one review per item; each item keeps its own run and review. With the loop's `syncStepsAcrossIterations` on, the reviewer approves every item at once (`approve_reviews_together`); off, each item is approved on its own. Publish refuses it in a Repeat while, on an \"Approve before it runs\" step, with no person or role reviewing, and in a loop that runs items one at a time. Off unless set.","type":"boolean"}},"required":["participants"]},{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["AI","HUMAN"]},"roleId":{"type":"string"},"contactId":{"type":"string"},"userId":{"type":"string"},"agentId":{"type":"string"},"prompt":{"type":"string"},"criteria":{"type":"string"},"context":{"type":"string"},"privateNotesGuidance":{"type":"string","maxLength":2000},"sendBackReply":{"type":"string","enum":["outcome_with_reason","outcome_only"]},"howToExplain":{"type":"string","maxLength":2000},"inputs":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"value":{"type":"string"},"type":{"type":"string","enum":["TEXT","FILE"]}},"required":["name","value"]}},"ruleKinds":{"maxItems":80,"type":"array","items":{"type":"object","properties":{"rule":{"type":"string","minLength":1,"maxLength":2000},"kind":{"type":"string","enum":["fact","data_match","coverage","visual","judgment"]},"compare":{"type":"object","properties":{"check":{"type":"string","enum":["compare.money_equal","compare.date_after","compare.names_equal","certificate.insured_name_matches","certificate.limit_at_least","kyc.id_name_matches","kyc.birth_date_matches","kyc.dated_within_three_months"]},"against":{"type":"string","enum":["today","value","input"]},"value":{"type":"string","minLength":1,"maxLength":500},"input":{"type":"string","minLength":1,"maxLength":200}},"required":["check","against"]},"document":{"type":"string","minLength":1,"maxLength":200},"sum":{"type":"object","properties":{"fields":{"minItems":2,"maxItems":60,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}}},"required":["fields"]}},"required":["rule","kind"]}},"participantId":{"type":"string"},"order":{"type":"number"},"aiConfig":{}},"required":["type"],"additionalProperties":{}}}]},"visibleToAllAssignees":{"type":"boolean"},"blockOnFailure":{"type":"boolean","description":"Whether a failure stops the flow (\"Block the workflow if this step fails\"). `false` lets the flow continue past it; the failure is still recorded. Stops it when left out."},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"}},"title":"Send to Conversation","description":"Acts inside Chat from a running flow: starts a conversation, posts a message, shares files, sends an ask or adds people.\n\nThe settings a template read (`GET /v1/templates/{id}`) returns for this type, as stored. The shared settings (due date, reminders, visibility, monitors) can appear alongside them. To set them in a change, send `StepSettings_SEND_TO_CONVERSATION`: where this shape holds an id, a change can name a role, field or step by its name or handle.\n\n**Offered by plan:** available when the organization's plan includes `conversationAutomation`.","x-moxo-step-type":"SEND_TO_CONVERSATION","x-moxo-category":"AUTOMATION","x-moxo-plan-feature":"conversationAutomation"},"StepConfig_SEND_TO_CONVERSATION_sendToConversation":{"type":"object","properties":{"operation":{"type":"string","enum":["create_conversation","post_message","share_files","request_action","add_participants"],"description":"What the step does when it runs. `create_conversation` starts a new group conversation; it takes no `target`, and later steps point at its `Conversation ID` output. `post_message` posts one message. `share_files` puts files in the conversation's Files list, which is separate from a message attachment. `request_action` posts one ask as a card and needs the in-conversation actions feature to be turned on for the organization. `add_participants` adds people to an existing conversation."},"target":{"description":"The conversation to act on. Required for every operation except `create_conversation`, which takes none. Set it to `{ \"mode\": \"dynamic\", \"ref\": \"{<create step name> / Conversation ID}\" }`.","$ref":"#/components/schemas/StepConfig_SEND_TO_CONVERSATION_target"},"sender":{"description":"Who the message appears to be from. Leave out to post as the organization. For `request_action` it is the person the ask is made on behalf of, and must be a real person: the ask records who it is owed to, which sets the reminder wording, who can cancel it and who gets the response-time credit.","$ref":"#/components/schemas/StepConfig_SEND_TO_CONVERSATION_sender"},"create":{"description":"The new conversation's settings. `create_conversation` only.","$ref":"#/components/schemas/StepConfig_SEND_TO_CONVERSATION_create"},"message":{"type":"object","properties":{"body":{"description":"The message. A string with flow value references, or a structured token list, which suits a message that refers to earlier steps' outputs, inputs, role details or organization and flow details. Everyone in the conversation sees it and is notified, as if a person had typed it.","$ref":"#/components/schemas/StepConfigPart_emailBody"},"attachments":{"description":"Files attached to the message. To put files in the conversation's Files list instead, use `share_files`.","$ref":"#/components/schemas/StepConfig_SEND_TO_CONVERSATION_attachments"}},"description":"The message to post. `post_message` only."},"files":{"description":"The files to share. `share_files` only.","$ref":"#/components/schemas/StepConfig_SEND_TO_CONVERSATION_files"},"fileNames":{"type":"object","propertyNames":{"type":"string","minLength":1},"additionalProperties":{"type":"string"},"description":"Read-only. Maps the storage key of each file uploaded in the template builder to its original file name, so the step can show the name again. Send it back unchanged when you change the step."},"action":{"description":"The ask to post. `request_action` only. The flow doesn't wait for the answer: it posts the ask and moves on. To hold the flow until the work is done, use a step for that work in the flow instead.","$ref":"#/components/schemas/StepConfig_SEND_TO_CONVERSATION_action"},"addPeople":{"type":"object","properties":{"people":{"type":"array","items":{"$ref":"#/components/schemas/StepConfig_SEND_TO_CONVERSATION_peopleItem"},"description":"Who to add. Usually role references, such as a role an earlier Assign role step filled."},"asManagers":{"type":"boolean","description":"Whether the people added can manage the conversation (rename it, add people, archive it). Defaults to `false`: they join as members, who can read and send. Applies to internal people only; an external person always joins as a member."}},"description":"The people to add. `add_participants` only. Adding someone who is already there has no effect, and someone who was removed is added back rather than duplicated. A step can't remove participants."}},"required":["operation"]},"StepConfig_SEND_TO_CONVERSATION_target":{"type":"object","properties":{"mode":{"type":"string","enum":["fixed","dynamic"],"description":"How the conversation is found. `dynamic` finds it when the step runs, from `ref`; use it for every step you create. `fixed` is a conversation a person pinned in the template builder; it can't be set through the API. A step that is already `fixed` runs only after a person in that conversation confirms its exact settings, so changing any of the step's settings needs that confirmation again."},"conversationId":{"type":"string","description":"Read-only. The id of a conversation a person pinned in the template builder (`fixed` mode). To act on a conversation from the API, start one with a `create_conversation` step and point `ref` at it."},"ref":{"type":"string","description":"In `dynamic` mode, the `Conversation ID` output of an earlier `create_conversation` step in this template, written as `{<that step's name> / Conversation ID}`, for example `{Start the client thread / Conversation ID}`. That is the only accepted value. There is no reference for the conversation a flow was started from; the only flow values are `Name`, `Due Date`, `Start Date` and `Id`."}}},"StepConfig_SEND_TO_CONVERSATION_sender":{"type":"object","properties":{"mode":{"type":"string","enum":["organization","participant"],"description":"Who the message is posted as. `organization` (the default) posts as the organization, labeled with its name; participants never see the flow or template name. `participant` posts as a named internal person from the conversation's participants, never an external user."},"person":{"description":"The person who posts in `participant` mode, and the required creator for `create_conversation` and `request_action`: `{ \"type\": \"ROLE\", \"roleId\": \"<role>\" }` or `{ \"type\": \"USER\", \"userId\": \"<user id>\" }`. It must be an internal person who is in the conversation, such as an advisor or preparer role, never an external user. If that person can't post when the step runs, `post_message` and `share_files` post as the organization and record the substitution; `create_conversation` and `request_action` fail, because each needs a person.","$ref":"#/components/schemas/StepConfig_SEND_TO_CONVERSATION_peopleItem"},"organizationLabel":{"type":"string","maxLength":60,"description":"In `organization` mode, the name the message is signed with when a team name is clearer than the organization's, such as `Provisioning` or `Billing`. Plain text, up to 60 characters, with no flow value references. Leave out to sign with the organization's name, the default. Don't use a flow or template name: participants don't see those."}}},"StepConfig_SEND_TO_CONVERSATION_create":{"type":"object","properties":{"name":{"type":"string","description":"The conversation's name. Can include flow value references, for example `${{ fields.client_name }}: ${{ fields.property_address }}`. Leave out to name it after the people in it, as Chat does."},"participants":{"type":"array","items":{"$ref":"#/components/schemas/StepConfig_SEND_TO_CONVERSATION_peopleItem"},"description":"Who is in the conversation. Use role references, so each flow fills them with whoever holds the role. Use a user reference only for a named colleague."},"managers":{"type":"array","items":{"$ref":"#/components/schemas/StepConfig_SEND_TO_CONVERSATION_peopleItem"},"description":"Who can rename the conversation, add people and archive it. At least one is required, and every manager must be an internal person. The creator always manages the conversation and must be internal too, so a conversation can't be all external people."},"showParticipantListToExternal":{"type":"boolean","description":"Whether external people see the full participant list (names only, never email addresses). Defaults to `false`."},"firstMessage":{"anyOf":[{"type":"string"},{"type":"array","items":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"text","description":"The part's type."},"text":{"type":"string","description":"Fixed text."}},"required":["kind","text"]},{"type":"object","properties":{"kind":{"type":"string","const":"input","description":"The part's type."},"key":{"type":"string","minLength":1,"description":"The key of a start field the template declares."}},"required":["kind","key"]},{"type":"object","properties":{"kind":{"type":"string","const":"role","description":"The part's type."},"roleName":{"type":"string","minLength":1,"description":"A role's name."},"field":{"type":"string","enum":["name","email","phone","title"],"description":"Which of the role's details: `name`, `email`, `phone` or `title`."}},"required":["kind","roleName","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"flow","description":"The part's type."},"field":{"type":"string","enum":["name","description","dueDate","startDate","dueTimestamp","startTimestamp","id"],"description":"Which detail of the flow: `name`, `description`, `dueDate`, `startDate`, `dueTimestamp`, `startTimestamp` or `id`."}},"required":["kind","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"organization","description":"The part's type."},"field":{"type":"string","enum":["name","id"],"description":"Which detail of the organization: `name` or `id`."}},"required":["kind","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"system","description":"The part's type."},"field":{"type":"string","const":"today","description":"Today's date, in the organization's time zone."}},"required":["kind","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"step","description":"The part's type."},"stepName":{"type":"string","minLength":1,"description":"The name of an earlier step."},"field":{"type":"string","minLength":1,"description":"The name of that step's output."}},"required":["kind","stepName","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"current_item","description":"The part's type."},"field":{"type":"string","minLength":1,"description":"A field of the current item, in a step that repeats for each item."}},"required":["kind","field"]}]}}],"description":"An optional first message, posted by the same step. Can include flow value references. People without a Moxo account get an email with a link when it is posted."}}},"StepConfig_SEND_TO_CONVERSATION_attachments":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["upload","reference"],"description":"Where the file comes from. `reference`: `ref` is a reference to a file from an earlier step. `upload`: a file uploaded in the template builder, which can't be set through the API."},"ref":{"anyOf":[{"type":"string","minLength":1},{"$ref":"#/components/schemas/StepConfig_SEND_TO_CONVERSATION_ref"},{"type":"string","minLength":1}],"description":"A file output of an earlier step, preferably as `{ \"kind\": \"step\", \"stepName\": \"File Request\", \"field\": \"Uploaded Files\" }`. A flow value reference string is also accepted. Role and organization references are refused, since they hold no file."}},"required":["ref"]}},"StepConfig_SEND_TO_CONVERSATION_files":{"type":"object","properties":{"refs":{"description":"The files to share. They are copied into the conversation, so the conversation's copy is separate from the original.","$ref":"#/components/schemas/StepConfig_SEND_TO_CONVERSATION_refs"},"folderName":{"type":"string","description":"A folder to put the files in, created if it doesn't exist. Can include flow value references, for example `${{ fields.tax_year }} Tax Return`. Leave out to put them at the top of the Files list."},"announce":{"type":"boolean","description":"Whether to also post a message so people notice the files. Defaults to `true`."},"announceMessage":{"description":"The message posted with the files when `announce` is on. Can include flow value references. Required whenever `announce` is on, which it is unless set to `false`: publishing refuses a share with no message, and the step fails if the message is blank when it runs.","$ref":"#/components/schemas/StepConfigPart_emailBody"}}},"StepConfig_SEND_TO_CONVERSATION_action":{"type":"object","properties":{"source":{"type":"string","enum":["template","todo","file_request"],"description":"What kind of ask to post. `todo` (do something) and `file_request` (send a document) are described completely by a title and a description. `template` uses a saved action from the organization's Action templates, which is where asks with a document, a form, options or signatures live. An inline e-signature, form, approval or poll isn't available here."},"templateId":{"type":"string","minLength":1,"description":"With `source: \"template\"`, the id of the saved action template. Leave it unset from the API: a person picks the saved action in the step's settings, and publishing asks for it until they do."},"title":{"type":"string","description":"With `source` `todo` or `file_request`, what the person is asked to do, for example `Photo ID and proof of address`. Can include flow value references. Leave out with `source: \"template\"`: a saved template has its own title."},"description":{"type":"string","description":"With `source` `todo` or `file_request`, optional detail. Can include flow value references."},"assignees":{"type":"array","items":{"type":"object","properties":{"seatRoleId":{"type":"string","minLength":1,"description":"The person's part in the saved action (its named recipient). Required only when the saved action gives each person their own part, such as a signature or a one-at-a-time ask; leave out otherwise."},"person":{"$ref":"#/components/schemas/StepConfig_SEND_TO_CONVERSATION_peopleItem"}},"required":["person"]},"description":"Who is asked. Each entry's `person` is a role reference (usual) or a user reference. Everyone named must already be in the conversation; add them first with an `add_participants` step. With `todo` or `file_request` they share one ask rather than getting one each."},"dueInDays":{"type":"integer","minimum":0,"maximum":365,"description":"When the ask is due, in whole days after this step runs. Leave out for no due date."}}},"StepConfig_SEND_TO_CONVERSATION_peopleItem":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"ROLE","description":"A role in the template. The person is whoever holds the role in each flow, so one template works for every flow."},"roleId":{"type":"string","minLength":1,"description":"The role: the `handle` of a role added in the same request, or the name of a role the template already has. It is resolved to the flow's role id when the step runs."}},"required":["type","roleId"]},{"type":"object","properties":{"type":{"type":"string","const":"USER","description":"One specific person, the same in every flow. Suits a named colleague, not an external user, who differs from flow to flow."},"userId":{"type":"string","minLength":1,"description":"The person's user id (`usr_…`)."}},"required":["type","userId"]}]},"StepConfig_SEND_TO_CONVERSATION_ref":{"oneOf":[{"$ref":"#/components/schemas/StepConfigPart_ref_2"},{"type":"object","properties":{"kind":{"type":"string","const":"role","description":"`role`: the reference points at a person on the flow. Set `roleName` and `field` too."},"roleName":{"type":"string","minLength":1,"description":"The role's name, exactly as it appears in the template's roles."},"field":{"type":"string","minLength":1,"description":"The person's detail: `name`, `email`, `phone` or `contactId`, or the key of a custom user field."}},"required":["kind","roleName","field"]},{"type":"object","properties":{"kind":{"type":"string","const":"input","description":"`input`: the reference points at a flow field, whether or not it is asked for at the start. Set `key` too."},"key":{"type":"string","minLength":1,"description":"The flow field's key, not its label. Any of the template's flow fields works, not only those asked for at the start. `_start_link_email` is allowed only when the flow has a start link."}},"required":["kind","key"]},{"type":"object","properties":{"kind":{"type":"string","const":"organization","description":"`organization`: the reference points at the organization. Set `field` to `name` or `id` too."},"field":{"type":"string","minLength":1,"description":"The organization detail: `name` or `id`."}},"required":["kind","field"]}]},"StepConfig_SEND_TO_CONVERSATION_refs":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["upload","reference"],"description":"Where the file comes from. `reference`: `ref` is a reference to a file from an earlier step. `upload`: a file uploaded in the template builder, which can't be set through the API."},"ref":{"anyOf":[{"type":"string","minLength":1},{"$ref":"#/components/schemas/StepConfig_SEND_TO_CONVERSATION_ref"},{"type":"string","minLength":1}],"description":"A file output of an earlier step, preferably as `{ \"kind\": \"step\", \"stepName\": \"E-signature\", \"field\": \"Signed Document\" }`. Role and organization references are refused, since they hold no file."}},"required":["ref"]}},"StepConfig_SYSTEM_UPDATE_FIELDS":{"type":"object","properties":{"systemUpdateFields":{"type":"object","properties":{"updates":{"type":"object","propertyNames":{"type":"string","minLength":1},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"description":"Flow field values, keyed by field key. For a list field, use the option's label. Moxo saves the field's id and the option's id. Use text for a text field and a list of text for a list field. A value can include references to flow values, such as `${{ steps.personal_information.fields.first_name }}`."}},"description":"The flow fields to write."},"visibleToAllAssignees":{"type":"boolean"},"blockOnFailure":{"type":"boolean","description":"Whether a failure stops the flow (\"Block the workflow if this step fails\"). `false` lets the flow continue past it; the failure is still recorded. Stops it when left out."},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"}},"title":"Update custom fields","description":"Sets values of this flow's fields.\n\nThe settings a template read (`GET /v1/templates/{id}`) returns for this type, as stored. The shared settings (due date, reminders, visibility, monitors) can appear alongside them. To set them in a change, send `StepSettings_SYSTEM_UPDATE_FIELDS`: where this shape holds an id, a change can name a role, field or step by its name or handle.\n\n**Offered by plan:** available when the organization's plan includes `systemUpdateFields`.","x-moxo-step-type":"SYSTEM_UPDATE_FIELDS","x-moxo-category":"AUTOMATION","x-moxo-plan-feature":"systemUpdateFields"},"StepConfig_DATA_TABLE_LOOKUP_RECORD":{"type":"object","properties":{"tableId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"The id of the data table to search, from `GET /v1/data-tables`. The table's name also works."},"match":{"anyOf":[{"$ref":"#/components/schemas/StepConfigPart_match"},{"$ref":"#/components/schemas/StepConfigPart_match_2"}],"description":"How to find the record: one column, `{ fieldId, value }`, for an exact match; or several conditions, `{ match: \"ALL\" | \"ANY\", conditions: [{ fieldId, op, value? }] }`. `fieldId` is a column's id or name. `value` is a fixed value or a reference to a value from earlier in the flow, in `conditions[].value` too; leave it out for `isEmpty` and `isNotEmpty`. Operators: `eq`, `neq`, `contains`, `isEmpty`, `isNotEmpty`, `gt`, `gte`, `lt`, `lte`, `in`, `notIn`. A Save a record step may use only `match: \"ALL\"` with `eq` on every condition, because that match identifies the row it adds when nothing matches. A Look up a record step may use `ALL` or `ANY` and any operator."},"onNoMatch":{"type":"string","enum":["fail","skip"],"description":"What happens when no record matches: `fail` (the default) or `skip`."},"onMultipleMatch":{"type":"string","enum":["first","fail","ask"],"description":"When more than one record matches and the step returns one record: `first` uses the earliest row, `fail` stops the step, `ask` pauses and asks the people in `reviewers` to pick one. `ask` needs `reviewers` and `recordDisplay.labelFieldId`. Do not combine `ask` with returning every matching record."},"recordDisplay":{"type":"object","properties":{"labelFieldId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"The column used as each record's name when someone picks. Copy the column id from the Data Tables section."},"extraFieldIds":{"maxItems":3,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"description":"Up to three more columns shown beside the name."}},"required":["labelFieldId"],"description":"How each matching record is shown when someone is asked to pick: one column names the record, and up to three more columns can be shown beside it."},"reviewers":{"type":"object","properties":{"participants":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","const":"HUMAN","description":"A person or a role in the organization."},"userId":{"type":"string","description":"The person who picks, when one person is named."},"roleId":{"type":"string","description":"The role that picks, when a role is named. An empty role waits until someone is assigned to it."},"participantId":{"type":"string","description":"An id for this row in the builder. The flow does not read it."},"order":{"type":"number","description":"Where this person or role sits in the list."}},"required":["type"]},"description":"Who picks. Name at least one person or role when the step asks someone to pick."},"sequential":{"type":"boolean","description":"Whether the people pick one after another. A pick is not taken in turn, so this stays false."}},"required":["participants"],"description":"Who picks when more than one record matches. People or roles in the organization. Required when the step asks someone to pick."},"returnMode":{"default":"single","type":"string","enum":["single","all"],"description":"`single` returns the one matching record; `all` returns every match, as a list."},"returnLimit":{"type":"integer","exclusiveMinimum":0,"maximum":200,"description":"With `returnMode` `all`: the most records to return."},"returnAllColumns":{"type":"array","items":{"type":"string"},"description":"With `returnMode` `all`: the columns each returned record carries, by id."},"visibleToAllAssignees":{"type":"boolean"},"blockOnFailure":{"type":"boolean","description":"Whether a failure stops the flow (\"Block the workflow if this step fails\"). `false` lets the flow continue past it; the failure is still recorded. Stops it when left out."},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"}},"required":["tableId","match"],"title":"Look up a record","description":"Finds a record in a data table by one column or several conditions. Later steps can use the record's fields.\n\nThe settings a template read (`GET /v1/templates/{id}`) returns for this type, as stored. The shared settings (due date, reminders, visibility, monitors) can appear alongside them. To set them in a change, send `StepSettings_DATA_TABLE_LOOKUP_RECORD`: where this shape holds an id, a change can name a role, field or step by its name or handle.\n\n**Offered by plan:** available when the organization's plan includes `dataTables`.","x-moxo-step-type":"DATA_TABLE_LOOKUP_RECORD","x-moxo-category":"AUTOMATION","x-moxo-plan-feature":"dataTables"},"StepConfigPart_match":{"type":"object","properties":{"match":{"type":"string","enum":["ALL","ANY"],"description":"How the conditions combine: `ALL`, every condition must hold, or `ANY`, at least one must."},"conditions":{"maxItems":25,"type":"array","items":{"$ref":"#/components/schemas/StepConfigPart_conditionsItem"}},"fieldId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"The column to match exactly, by id or name."},"value":{"type":"string","description":"The value to compare: a fixed value or a reference to a value from earlier in the flow, such as `${{ steps.intake_form.fields.email }}`, filled in before the search."}},"required":["match","conditions"],"description":"A filter on data table records: `match` and a list of `conditions`."},"StepConfigPart_match_2":{"type":"object","properties":{"fieldId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"The column to match exactly, by id or name."},"value":{"type":"string","description":"The value to compare: a fixed value or a reference to a value from earlier in the flow, such as `${{ steps.intake_form.fields.email }}`, filled in before the search."},"match":{"type":"string","enum":["ALL","ANY"],"description":"How the conditions combine: `ALL`, every condition must hold, or `ANY`, at least one must."},"conditions":{"maxItems":25,"type":"array","items":{"type":"object","properties":{"fieldId":{"type":"string","minLength":1,"description":"The id of a column in the data table (a UUID), as the data table's columns list it; not a column name or label. An unknown or archived id never matches: in a `match: \"ALL\"` filter, the whole filter then matches no records; in a `match: \"ANY\"` filter, that condition is ignored unless every condition is unknown or archived."},"op":{"type":"string","enum":["eq","neq","contains","isEmpty","isNotEmpty","gt","gte","lt","lte","in","notIn"],"description":"How to compare. Text columns: `eq`, `neq`, `contains`, `in`, `notIn`, `isEmpty`, `isNotEmpty`. Number and date columns also take `gt`, `gte`, `lt` and `lte`. Only `in` and `notIn` take a list of values (or one value, treated as a list of one), up to 100; an empty list matches nothing. Every other operator takes one value."},"value":{"description":"The value to compare with. Leave it out for `isEmpty` and `isNotEmpty`. A list of values (up to 100) is only for `in` and `notIn`; any other operator takes one value and refuses a list. For a single-select column, send the option's id, not its label. Can be a fixed value or a reference to a value from earlier in the flow, such as `${{ fields.selected_series }}`, filled in when the step runs.","anyOf":[{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},{"maxItems":100,"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}]}},"required":["fieldId","op"]}}},"required":["fieldId","value"]},"StepConfig_DATA_TABLE_SAVE_RECORD":{"type":"object","properties":{"tableId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"The data table to save into, by its id or its name; a name is resolved to the table."},"match":{"anyOf":[{"$ref":"#/components/schemas/StepConfigPart_match"},{"$ref":"#/components/schemas/StepConfigPart_match_2"}],"description":"How to find the record: one column, `{ fieldId, value }`, for an exact match; or several conditions, `{ match: \"ALL\" | \"ANY\", conditions: [{ fieldId, op, value? }] }`. `fieldId` is a column's id or name. `value` is a fixed value or a reference to a value from earlier in the flow, in `conditions[].value` too; leave it out for `isEmpty` and `isNotEmpty`. Operators: `eq`, `neq`, `contains`, `isEmpty`, `isNotEmpty`, `gt`, `gte`, `lt`, `lte`, `in`, `notIn`. A Save a record step may use only `match: \"ALL\"` with `eq` on every condition, because that match identifies the row it adds when nothing matches. A Look up a record step may use `ALL` or `ANY` and any operator."},"set":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"},"description":"The values to write, keyed by column name or id; names are resolved. A value is text or a reference to a flow value."},"setActions":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string","enum":["increase","decrease"]},"description":"For number columns, in Add or update mode only (`failIfExists` `false`): map a column that is in `set` to `increase` or `decrease` to add its `set` value to the row's current value, or subtract it, instead of replacing it. Use it for counts, stock and running totals. The amount is a number, 0 or more. A column left out is replaced. Not allowed on a column the step matches on."},"failIfExists":{"type":"boolean","description":"The save mode. `false` (the default) is Add or update: find the matching row and write the values, or add a row when none matches. `true` is Add a new row: insert only, and stop if a duplicate exists."},"approveBeforeRun":{"type":"boolean","description":"Whether a person approves the values this step is about to use before it runs. Available on `REST_API`, `EXTERNAL_APP`, `MCP_SERVER`, `SYSTEM_EMAIL`, `SEND_ANNOUNCEMENT`, `SEND_TO_CONVERSATION`, `SYSTEM_WEBHOOK`, `DATA_TABLE_SAVE_RECORD`, `START_FLOW`, `SCHEDULE_FLOW`, `CODE`, `COLLECT_PAYMENT`, `DOCUSIGN` and `ADOBE_SIGN` steps. When `true`, the step pauses before it calls, sends, writes, starts or schedules anything, until someone approves. Set who approves in the step's `reviewers`: a step with approval on and no approver can't be published."},"approvalRejectMode":{"type":"string","enum":["skip","halt"],"description":"What a rejection does, with `approveBeforeRun`. `skip` (the default) skips this step and the flow continues; `halt` stops the flow."},"reviewers":{"anyOf":[{"type":"object","properties":{"participants":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["AI","HUMAN"]},"roleId":{"type":"string","description":"For a person: the role that takes this seat, by its id."},"contactId":{"type":"string","description":"An external user named on the seat, by the `usr_` id the template read shows. `null` follows the read, as for `userId`."},"userId":{"type":"string","description":"A person named on the seat, by the `usr_` id the template read shows. `null` where the read showed `null` (someone with no id here) keeps the saved person; `null` where it showed an id takes them off the seat."},"agentId":{"type":"string"},"prompt":{"type":"string","description":"The AI participant's step context: instructions for this step only."},"criteria":{"type":"string","description":"For an AI reviewer: what to check. Read before `prompt`."},"context":{"type":"string","description":"An older home of the AI participant's step context, still read. Set `prompt` instead."},"privateNotesGuidance":{"type":"string","maxLength":2000,"description":"When no agent is named: what the AI notes privately for the flow's managers."},"sendBackReply":{"type":"string","enum":["outcome_with_reason","outcome_only"],"description":"When the AI sends work back and no agent is named: what the reply says, `outcome_with_reason` or `outcome_only`."},"howToExplain":{"type":"string","maxLength":2000,"description":"When the AI sends work back and no agent is named: how it explains what to fix."},"inputs":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"value":{"type":"string"},"type":{"type":"string","enum":["TEXT","FILE"]}},"required":["name","value"]}},"participantId":{"type":"string","description":"The participant's id on the step. Keep it when sending the seat back; leave it out for a new participant."},"order":{"type":"number","description":"The participant's place in the seat, from 0, when they act one after another."},"aiConfig":{}},"required":["type"],"additionalProperties":{}}},"sequential":{"type":"boolean"},"completion":{"type":"object","properties":{"mode":{"type":"string","enum":["ANY_ONE","ALL"],"description":"`ANY_ONE`: one participant finishing is enough. `ALL`: every participant finishes."}},"required":["mode"],"description":"When the seat is done."},"showToExternalAssignee":{"description":"Advisors only. `true` lets an assignee outside your organization read the recommendation (the call and its reasons), as advice from your organization. Off unless set.","type":"boolean"},"canEditAnswers":{"description":"Reviewers only, on a Form, PDF form or File request step. `true` lets the reviewer whose turn it is edit the submitted answers (on a File request, add and remove its files) during review, in the Moxo app, instead of sending them back. Off unless set.","type":"boolean"},"reviewItemsTogether":{"description":"Reviewers only, on a person's step inside a For each whose items run at the same time. `true` gives the reviewer one list and one notice for every item instead of one review per item; each item keeps its own run and review. With the loop's `syncStepsAcrossIterations` on, the reviewer approves every item at once (`approve_reviews_together`); off, each item is approved on its own. Publish refuses it in a Repeat while, on an \"Approve before it runs\" step, with no person or role reviewing, and in a loop that runs items one at a time. Off unless set.","type":"boolean"}},"required":["participants"]},{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["AI","HUMAN"]},"roleId":{"type":"string"},"contactId":{"type":"string"},"userId":{"type":"string"},"agentId":{"type":"string"},"prompt":{"type":"string"},"criteria":{"type":"string"},"context":{"type":"string"},"privateNotesGuidance":{"type":"string","maxLength":2000},"sendBackReply":{"type":"string","enum":["outcome_with_reason","outcome_only"]},"howToExplain":{"type":"string","maxLength":2000},"inputs":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"value":{"type":"string"},"type":{"type":"string","enum":["TEXT","FILE"]}},"required":["name","value"]}},"ruleKinds":{"maxItems":80,"type":"array","items":{"type":"object","properties":{"rule":{"type":"string","minLength":1,"maxLength":2000},"kind":{"type":"string","enum":["fact","data_match","coverage","visual","judgment"]},"compare":{"type":"object","properties":{"check":{"type":"string","enum":["compare.money_equal","compare.date_after","compare.names_equal","certificate.insured_name_matches","certificate.limit_at_least","kyc.id_name_matches","kyc.birth_date_matches","kyc.dated_within_three_months"]},"against":{"type":"string","enum":["today","value","input"]},"value":{"type":"string","minLength":1,"maxLength":500},"input":{"type":"string","minLength":1,"maxLength":200}},"required":["check","against"]},"document":{"type":"string","minLength":1,"maxLength":200},"sum":{"type":"object","properties":{"fields":{"minItems":2,"maxItems":60,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}}},"required":["fields"]}},"required":["rule","kind"]}},"participantId":{"type":"string"},"order":{"type":"number"},"aiConfig":{}},"required":["type"],"additionalProperties":{}}}]},"visibleToAllAssignees":{"type":"boolean"},"blockOnFailure":{"type":"boolean","description":"Whether a failure stops the flow (\"Block the workflow if this step fails\"). `false` lets the flow continue past it; the failure is still recorded. Stops it when left out."},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"}},"required":["tableId","match","set"],"title":"Save a record","description":"Adds a record to a data table or updates one, or adds a new row and stops if a duplicate exists. Matches on one column or on several exact columns.\n\nThe settings a template read (`GET /v1/templates/{id}`) returns for this type, as stored. The shared settings (due date, reminders, visibility, monitors) can appear alongside them. To set them in a change, send `StepSettings_DATA_TABLE_SAVE_RECORD`: where this shape holds an id, a change can name a role, field or step by its name or handle.\n\n**Offered by plan:** available when the organization's plan includes `dataTables`.","x-moxo-step-type":"DATA_TABLE_SAVE_RECORD","x-moxo-category":"AUTOMATION","x-moxo-plan-feature":"dataTables"},"StepConfig_UPDATE_SPREADSHEET":{"type":"object","properties":{"mode":{"type":"string","enum":["correct","populate"],"description":"`correct` (the default) updates an existing uploaded file; `populate` fills a standard template."},"sourceFile":{"type":"string","description":"In `correct` mode: a reference to the original uploaded spreadsheet, such as `${{ steps.upload_spreadsheet.fields.uploaded_files }}`. Changes are written to this file, keeping its formatting, tabs and column order."},"templateFile":{"type":"string","description":"In `populate` mode: the standard template to fill, attached while building the template. Its other sheets and dropdowns are kept."},"correctedRows":{"type":"string","description":"One reference to the rows to write: a table on an earlier form, or a list of records from an earlier step, such as extracted rows (for example `${{ steps.correct_rows.fields.records }}`). Each row is keyed by column label. In `correct` mode, rows are matched to the file's rows by row id or by `keyColumn`; in `populate` mode, they are written in order from `startRow`. Optional when `cellValues` fills the file on its own. Publish refuses single answers, a multi-select, or several references here (`LIST_SLOT_NOT_ROWS`); put single values in `cellValues`."},"cellValues":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string","description":"The exact text of a label cell in the file, such as `Company`."},"direction":{"type":"string","enum":["right","below"],"description":"Where the value goes, relative to the label cell. Defaults to `right`."},"value":{"type":"string","description":"A reference to the value to write, such as `${{ org.name }}`."}},"required":["label","value"]},"description":"Single values placed next to existing labels, in .xlsx files only. Optional. Each entry finds the cell whose text is `label` and writes `value` into the cell beside it (to the right by default), keeping that cell's format. A label that isn't found is reported, never guessed."},"keyColumn":{"type":"string","description":"In `correct` mode: the column label used to match rows to the original file's rows when a row has no id. Defaults to the first column."},"sheetName":{"type":"string","description":"For .xlsx files: the worksheet to write. Defaults to the first sheet."},"startRow":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"In `populate` mode: the row to start writing at, counting from 1, below the header. Defaults to 2."},"columns":{"type":"array","items":{"type":"object","properties":{"header":{"type":"string","minLength":1,"description":"The column's header in the spreadsheet."},"ref":{"type":"string","minLength":1,"description":"The value written into the column: a reference to a flow value."}},"required":["header","ref"]},"description":"The value each column gets, one entry per column, written row by row each time the step runs."},"keyColumnId":{"type":"string","description":"The column that identifies a row, by its id, when rows are matched and corrected."},"visibleToAllAssignees":{"type":"boolean"},"blockOnFailure":{"type":"boolean","description":"Whether a failure stops the flow (\"Block the workflow if this step fails\"). `false` lets the flow continue past it; the failure is still recorded. Stops it when left out."},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"}},"title":"Update spreadsheet","description":"Writes flow data into a spreadsheet (Excel or CSV) and returns the updated file. It writes a list of rows, places single values next to existing labels (such as the company name next to a Company cell, in .xlsx files only), or both; a step can write single values only, such as an invoice header. In `correct` mode it updates the original uploaded file, keeping its formatting, tabs and order; in `populate` mode it fills a standard template.\n\nThe settings a template read (`GET /v1/templates/{id}`) returns for this type, as stored. The shared settings (due date, reminders, visibility, monitors) can appear alongside them. To set them in a change, send `StepSettings_UPDATE_SPREADSHEET`: where this shape holds an id, a change can name a role, field or step by its name or handle.\n\n**Offered by plan:** available when the organization's plan includes `updateSpreadsheet`.","x-moxo-step-type":"UPDATE_SPREADSHEET","x-moxo-category":"AUTOMATION","x-moxo-plan-feature":"updateSpreadsheet"},"StepConfig_SYSTEM_UPDATE_FLOW_INFO":{"type":"object","properties":{"systemUpdateFlowInfo":{"description":"What to change on the flow when the step runs: its name, description or due date, and tags to set or clear. Every setting is optional. A value that is the same as the current one is not saved again.","$ref":"#/components/schemas/StepConfig_SYSTEM_UPDATE_FLOW_INFO_systemUpdateFlowInfo"},"visibleToAllAssignees":{"type":"boolean"},"blockOnFailure":{"type":"boolean","description":"Whether a failure stops the flow (\"Block the workflow if this step fails\"). `false` lets the flow continue past it; the failure is still recorded. Stops it when left out."},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"}},"title":"Update flow info","description":"Changes the flow's name, description, due date or tags while it runs.\n\nThe settings a template read (`GET /v1/templates/{id}`) returns for this type, as stored. The shared settings (due date, reminders, visibility, monitors) can appear alongside them. To set them in a change, send `StepSettings_SYSTEM_UPDATE_FLOW_INFO`: where this shape holds an id, a change can name a role, field or step by its name or handle.\n\n**Offered by plan:** available when the organization's plan includes `systemUpdateFlowInfo`.","x-moxo-step-type":"SYSTEM_UPDATE_FLOW_INFO","x-moxo-category":"AUTOMATION","x-moxo-plan-feature":"systemUpdateFlowInfo"},"StepConfig_SYSTEM_UPDATE_FLOW_INFO_systemUpdateFlowInfo":{"type":"object","properties":{"flowName":{"type":"string","description":"The flow's new name, as text that can include flow value references, such as `Onboarding for ${{ fields.customer_name }}`. When it comes out empty, the name is kept."},"flowDescription":{"type":"string","description":"The flow's new description, as text that can include flow value references. When it comes out empty, the description is kept."},"dueAt":{"type":"string","description":"The flow's new due date, as an ISO 8601 date and time, such as `2026-12-31T17:00:00Z`, or a flow value reference that gives one. A value that isn't a valid ISO 8601 date and time keeps the current due date."},"tags":{"maxItems":25,"type":"array","items":{"$ref":"#/components/schemas/StepConfig_SYSTEM_UPDATE_FLOW_INFO_tagsItem"},"description":"Tag groups to set or clear on the flow, one row per group. `pick` sets a tag by its id; `ddr` finds a tag by name or id when the step runs, and does nothing when that comes out empty; `clear` removes the group's tags. Leave out groups you aren't changing."}}},"StepConfig_SYSTEM_UPDATE_FLOW_INFO_tagsItem":{"type":"object","properties":{"groupId":{"type":"string","maxLength":80,"description":"The id of one of your organization's tag groups, including groups only admins can change. Use an id the organization has."},"mode":{"type":"string","enum":["pick","ddr","clear","text"],"description":"How `value` is read. `pick`: a tag id from the group. `ddr`: a flow value reference or a tag name, read when the step runs; an empty result doesn't clear the group. `text`: the short text for a Text group, or a flow value reference; one line, up to 80 characters. `clear`: removes the group's tags."},"value":{"type":"string","maxLength":4000,"description":"The value for this group: a tag id when `mode` is `pick`; a flow value reference or tag name when it is `ddr`; the short text, or a flow value reference, when it is `text`. Leave it out when `mode` is `clear`."}},"required":["groupId","mode"]},"StepConfig_BUSINESS_RULE":{"type":"object","properties":{"businessRule":{"type":"object","properties":{"inputs":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","description":"The variable name the rule conditions use, for example `amount`."},"ref":{"type":"string","description":"A reference to a value from an earlier step, written `${{ steps.<step>.fields.<field> }}`."}},"required":["key","ref"]},"description":"The input variables: each maps a flow value reference to a key the rule conditions use."},"rules":{"type":"array","items":{"type":"object","properties":{"conditions":{"description":"The conditions, which must all match. Leave out or empty when `isDefault` is `true`.","$ref":"#/components/schemas/StepConfig_BUSINESS_RULE_conditions"},"set":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"The values to set when the conditions match, for example `{ \"riskLevel\": \"high\" }`."},"isDefault":{"type":"boolean","description":"Whether this is the fallback rule, which matches when no earlier rule did."}},"required":["set"]},"description":"The rules, checked in order; the first that matches applies. Mark one with `isDefault` as the fallback."},"outputs":{"type":"array","items":{},"description":"The fields the rules set, taken from every rule's `set`."}},"description":"The settings of a Business rule step: inputs (flow value references), then rules that set values when their conditions match. Conditions compare with an operator such as `eq`, `gt`, `gte`, `lt`, `lte`, `between`, `contains`, `in` or `isEmpty`. For `between`, set `value` (the lower bound) and `valueMax` (the upper bound)."},"visibleToAllAssignees":{"type":"boolean"},"blockOnFailure":{"type":"boolean","description":"Whether a failure stops the flow (\"Block the workflow if this step fails\"). `false` lets the flow continue past it; the failure is still recorded. Stops it when left out."},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"}},"title":"Business Rule","description":"Applies conditional rules to set values or make decisions.\n\nThe settings a template read (`GET /v1/templates/{id}`) returns for this type, as stored. The shared settings (due date, reminders, visibility, monitors) can appear alongside them. To set them in a change, send `StepSettings_BUSINESS_RULE`: where this shape holds an id, a change can name a role, field or step by its name or handle.\n\n**Offered by plan:** available when the organization's plan includes `businessRule`.","x-moxo-step-type":"BUSINESS_RULE","x-moxo-category":"AUTOMATION","x-moxo-plan-feature":"businessRule"},"StepConfig_BUSINESS_RULE_conditions":{"type":"array","items":{"type":"object","properties":{"input":{"type":"string","description":"The input to test: one of the `inputs[].key` values."},"operator":{"type":"string","enum":["eq","neq","gt","gte","lt","lte","between","contains","startsWith","endsWith","in","notIn","isEmpty","isNotEmpty"],"description":"How to compare. One of `eq`, `neq`, `gt`, `gte`, `lt`, `lte`, `between`, `contains`, `startsWith`, `endsWith`, `in`, `notIn`, `isEmpty` or `isNotEmpty`."},"value":{"type":"string","description":"The value to compare with; can include flow value references. Leave out for `isEmpty` and `isNotEmpty`. For `in` and `notIn`, a comma-separated list. For `between`, the lower bound (inclusive)."},"valueMax":{"type":"string","description":"The upper bound (inclusive). Required for `between`; ignored otherwise."}},"required":["input","operator"]}},"StepConfig_MATH":{"type":"object","properties":{"math":{"description":"The settings of a Calculate step: inputs (flow value references, each with a variable name), then formulas evaluated in order, then the results to make available to later steps.","$ref":"#/components/schemas/StepConfig_MATH_math"},"visibleToAllAssignees":{"type":"boolean"},"blockOnFailure":{"type":"boolean","description":"Whether a failure stops the flow (\"Block the workflow if this step fails\"). `false` lets the flow continue past it; the failure is still recorded. Stops it when left out."},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"}},"title":"Calculate","description":"Calculates values from earlier steps' data, with the same result every time.\n\nThe settings a template read (`GET /v1/templates/{id}`) returns for this type, as stored. The shared settings (due date, reminders, visibility, monitors) can appear alongside them. To set them in a change, send `StepSettings_MATH`: where this shape holds an id, a change can name a role, field or step by its name or handle.\n\n**Offered by plan:** available when the organization's plan includes `math`.","x-moxo-step-type":"MATH","x-moxo-category":"AUTOMATION","x-moxo-plan-feature":"math"},"StepConfig_MATH_math":{"type":"object","properties":{"inputs":{"description":"The input variables, each read from an earlier step through a flow value reference.","$ref":"#/components/schemas/StepConfig_MATH_inputs"},"operations":{"description":"Named calculations, evaluated from top to bottom. Each can use the inputs and earlier calculations.","$ref":"#/components/schemas/StepConfig_MATH_operations"},"outputs":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"The name of a calculation or an input."}},"required":["name"]},"description":"The calculated values to make available to later steps."},"onError":{"type":"string","enum":["FAIL","USE_DEFAULTS"],"description":"What happens when a calculation fails or isn't a number. `FAIL`: the flow stops. `USE_DEFAULTS`: `0` is used instead and the flow continues."}}},"StepConfig_MATH_inputs":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"The variable name used in formulas, for example `subtotal`."},"ref":{"anyOf":[{"type":"string"},{"$ref":"#/components/schemas/StepConfigPart_ref"},{"type":"object","properties":{"kind":{"type":"string","const":"for-each-item"},"expectedType":{"type":"string"},"selector":{"type":"string","enum":["item","index","number","total"],"description":"What to read from the current pass of a loop. `item` reads a column of the current row; `index` (starting at 0), `number` (starting at 1) and `total` are the loop's counters."},"itemFieldId":{"description":"The column's id, for `item`. Preferred over `itemField`, because it still works after the column is renamed.","type":"string"},"itemField":{"description":"The column's label, for `item` when the list has no column ids. A label stops working when the column is renamed.","type":"string"}},"required":["kind","expectedType","selector"]}],"description":"A reference to a flow value, preferably as a structured reference. A text reference such as `${{ steps.<step>.fields.<field> }}` is also accepted and is converted the next time the template is saved."},"type":{"type":"string","enum":["NUMBER","CURRENCY","PERCENTAGE"],"description":"How to read the value. `CURRENCY` removes currency symbols and commas; `PERCENTAGE` removes `%`."},"default":{"type":"number","description":"The value used when the reference has no value or isn't a number."}},"required":["name","ref"]}},"StepConfig_MATH_operations":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"The result's name, used by later calculations and outputs."},"formula":{"type":"string","description":"The formula, for example `subtotal * (discount / 100)`. Supports `+`, `-`, `*`, `/`, `%`, `round()`, `min()`, `max()`, `ceil()`, `floor()`, `abs()` and conditionals (`a > b ? a : b`)."},"format":{"type":"string","enum":["NUMBER","CURRENCY","PERCENTAGE"],"description":"How the result is shown: `NUMBER`, `CURRENCY` or `PERCENTAGE`. It doesn't change the calculated number, and a `%` or `$` in the formula is not a format. May be absent on calculations created earlier."}},"required":["name","formula"]}},"StepConfig_CODE":{"type":"object","properties":{"code":{"description":"The code step's settings: its inputs (references to values from earlier in the flow, each with a variable name), the code to run and the returned values later steps can use.","$ref":"#/components/schemas/StepConfig_CODE_code"},"approveBeforeRun":{"type":"boolean","description":"Whether a person approves the values this step is about to use before it runs. Available on `REST_API`, `EXTERNAL_APP`, `MCP_SERVER`, `SYSTEM_EMAIL`, `SEND_ANNOUNCEMENT`, `SEND_TO_CONVERSATION`, `SYSTEM_WEBHOOK`, `DATA_TABLE_SAVE_RECORD`, `START_FLOW`, `SCHEDULE_FLOW`, `CODE`, `COLLECT_PAYMENT`, `DOCUSIGN` and `ADOBE_SIGN` steps. When `true`, the step pauses before it calls, sends, writes, starts or schedules anything, until someone approves. Set who approves in the step's `reviewers`: a step with approval on and no approver can't be published."},"approvalRejectMode":{"type":"string","enum":["skip","halt"],"description":"What a rejection does, with `approveBeforeRun`. `skip` (the default) skips this step and the flow continues; `halt` stops the flow."},"reviewers":{"anyOf":[{"type":"object","properties":{"participants":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["AI","HUMAN"]},"roleId":{"type":"string","description":"For a person: the role that takes this seat, by its id."},"contactId":{"type":"string","description":"An external user named on the seat, by the `usr_` id the template read shows. `null` follows the read, as for `userId`."},"userId":{"type":"string","description":"A person named on the seat, by the `usr_` id the template read shows. `null` where the read showed `null` (someone with no id here) keeps the saved person; `null` where it showed an id takes them off the seat."},"agentId":{"type":"string"},"prompt":{"type":"string","description":"The AI participant's step context: instructions for this step only."},"criteria":{"type":"string","description":"For an AI reviewer: what to check. Read before `prompt`."},"context":{"type":"string","description":"An older home of the AI participant's step context, still read. Set `prompt` instead."},"privateNotesGuidance":{"type":"string","maxLength":2000,"description":"When no agent is named: what the AI notes privately for the flow's managers."},"sendBackReply":{"type":"string","enum":["outcome_with_reason","outcome_only"],"description":"When the AI sends work back and no agent is named: what the reply says, `outcome_with_reason` or `outcome_only`."},"howToExplain":{"type":"string","maxLength":2000,"description":"When the AI sends work back and no agent is named: how it explains what to fix."},"inputs":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"value":{"type":"string"},"type":{"type":"string","enum":["TEXT","FILE"]}},"required":["name","value"]}},"participantId":{"type":"string","description":"The participant's id on the step. Keep it when sending the seat back; leave it out for a new participant."},"order":{"type":"number","description":"The participant's place in the seat, from 0, when they act one after another."},"aiConfig":{}},"required":["type"],"additionalProperties":{}}},"sequential":{"type":"boolean"},"completion":{"type":"object","properties":{"mode":{"type":"string","enum":["ANY_ONE","ALL"],"description":"`ANY_ONE`: one participant finishing is enough. `ALL`: every participant finishes."}},"required":["mode"],"description":"When the seat is done."},"showToExternalAssignee":{"description":"Advisors only. `true` lets an assignee outside your organization read the recommendation (the call and its reasons), as advice from your organization. Off unless set.","type":"boolean"},"canEditAnswers":{"description":"Reviewers only, on a Form, PDF form or File request step. `true` lets the reviewer whose turn it is edit the submitted answers (on a File request, add and remove its files) during review, in the Moxo app, instead of sending them back. Off unless set.","type":"boolean"},"reviewItemsTogether":{"description":"Reviewers only, on a person's step inside a For each whose items run at the same time. `true` gives the reviewer one list and one notice for every item instead of one review per item; each item keeps its own run and review. With the loop's `syncStepsAcrossIterations` on, the reviewer approves every item at once (`approve_reviews_together`); off, each item is approved on its own. Publish refuses it in a Repeat while, on an \"Approve before it runs\" step, with no person or role reviewing, and in a loop that runs items one at a time. Off unless set.","type":"boolean"}},"required":["participants"]},{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["AI","HUMAN"]},"roleId":{"type":"string"},"contactId":{"type":"string"},"userId":{"type":"string"},"agentId":{"type":"string"},"prompt":{"type":"string"},"criteria":{"type":"string"},"context":{"type":"string"},"privateNotesGuidance":{"type":"string","maxLength":2000},"sendBackReply":{"type":"string","enum":["outcome_with_reason","outcome_only"]},"howToExplain":{"type":"string","maxLength":2000},"inputs":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"value":{"type":"string"},"type":{"type":"string","enum":["TEXT","FILE"]}},"required":["name","value"]}},"ruleKinds":{"maxItems":80,"type":"array","items":{"type":"object","properties":{"rule":{"type":"string","minLength":1,"maxLength":2000},"kind":{"type":"string","enum":["fact","data_match","coverage","visual","judgment"]},"compare":{"type":"object","properties":{"check":{"type":"string","enum":["compare.money_equal","compare.date_after","compare.names_equal","certificate.insured_name_matches","certificate.limit_at_least","kyc.id_name_matches","kyc.birth_date_matches","kyc.dated_within_three_months"]},"against":{"type":"string","enum":["today","value","input"]},"value":{"type":"string","minLength":1,"maxLength":500},"input":{"type":"string","minLength":1,"maxLength":200}},"required":["check","against"]},"document":{"type":"string","minLength":1,"maxLength":200},"sum":{"type":"object","properties":{"fields":{"minItems":2,"maxItems":60,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}}},"required":["fields"]}},"required":["rule","kind"]}},"participantId":{"type":"string"},"order":{"type":"number"},"aiConfig":{}},"required":["type"],"additionalProperties":{}}}]},"visibleToAllAssignees":{"type":"boolean"},"blockOnFailure":{"type":"boolean","description":"Whether a failure stops the flow (\"Block the workflow if this step fails\"). `false` lets the flow continue past it; the failure is still recorded. Stops it when left out."},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"}},"title":"Run code","description":"Runs code you write against data from earlier steps and makes the values it returns available to later steps.\n\nThe settings a template read (`GET /v1/templates/{id}`) returns for this type, as stored. The shared settings (due date, reminders, visibility, monitors) can appear alongside them. To set them in a change, send `StepSettings_CODE`: where this shape holds an id, a change can name a role, field or step by its name or handle.\n\n**Offered by plan:** available when the organization's plan includes `codeStep`.","x-moxo-step-type":"CODE","x-moxo-category":"AUTOMATION","x-moxo-plan-feature":"codeStep"},"StepConfig_CODE_code":{"type":"object","properties":{"inputs":{"description":"The input variables, each read from an earlier step through a flow value reference.","$ref":"#/components/schemas/StepConfig_CODE_inputs"},"code":{"type":"string","description":"The code to run. Export a `handler(input, context)` function, read each input as `input.<name>`, and return an object whose keys are the declared outputs. Call connected apps only through `api.fetch(connectionId, { path, method, bodyType, body, headers })`, not `fetch`, `require` or `import`; `bodyType` is `\"json\"` (the default) or `\"form\"`. Credentials reach the code only through a connection, so don't write one into the code. `dates.today()`, `dates.parse()` and `dates.format()` use the organization's time zone (`context.orgTimezone`); `dates.utc` and `context.invokedAt` are in UTC."},"outputs":{"type":"array","items":{"$ref":"#/components/schemas/StepConfig_CODE_outputsItem"},"description":"The returned values later steps can use."},"onError":{"type":"string","enum":["FAIL","USE_DEFAULTS"],"description":"What happens when the code fails or returns an output of the wrong type. `USE_DEFAULTS` (the default): an output that failed, is missing or has the wrong type is `null`, and the flow continues. `FAIL`: the step fails and the flow stops there."},"language":{"type":"string","enum":["JAVASCRIPT"],"description":"The language of the code. JavaScript only."},"timeoutMs":{"type":"number","description":"The longest the code may run before it is stopped."},"memoryMb":{"type":"number","description":"The most memory the code may use before it is stopped."},"maxOutputBytes":{"type":"number","description":"The largest value the code may return. A larger value is cut short or refused."},"allowedConnectionIds":{"type":"array","items":{"type":"string"},"description":"The connection ids `api.fetch` may use. A connection id not in this list is refused."}}},"StepConfig_CODE_inputs":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"The variable name the code reads the input as, for example `subtotal`."},"ref":{"anyOf":[{"type":"string"},{"$ref":"#/components/schemas/StepConfigPart_ref"},{"type":"object","properties":{"kind":{"type":"string","const":"for-each-item"},"expectedType":{"type":"string"},"selector":{"type":"string","enum":["item","index","number","total"],"description":"What to read from the current pass of a loop. `item` reads a column of the current row; `index` (starting at 0), `number` (starting at 1) and `total` are the loop's counters."},"itemFieldId":{"description":"The column's id, for `item`. Preferred over `itemField`, because it still works after the column is renamed.","type":"string"},"itemField":{"description":"The column's label, for `item` when the list has no column ids. A label stops working when the column is renamed.","type":"string"}},"required":["kind","expectedType","selector"]}],"description":"A reference to a flow value, preferably as a structured reference. A text reference such as `${{ steps.<step>.fields.<field> }}` is also accepted and is converted the next time the template is saved."}},"required":["name","ref"]}},"StepConfig_CODE_outputsItem":{"type":"object","properties":{"name":{"type":"string","description":"The name of a value the code returns (a key of the returned object). Later steps can reference it."},"type":{"type":"string","enum":["text","number","boolean","date","list","object"],"description":"The type of the returned value: `text`, `number`, `boolean`, `date`, `list` or `object`. Later steps' references are checked against it, and the returned value is checked when the code runs. Defaults to `text`. For a `list`, `itemFields` names the keys each item has, so a For each loop can reference `${{ current.item.<name> }}`."},"itemFields":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"A key the code returns on each list item. A For each loop references it as `${{ current.item.<name> }}`. A name that starts with `_` must match exactly, including case."},"type":{"type":"string","enum":["TEXT","NUMBER","DATE","BOOLEAN"],"description":"The key's type, checked when the code returns: `TEXT`, `NUMBER`, `DATE` or `BOOLEAN`."}},"required":["name","type"]},"description":"For a `list` only: the keys the code returns on every item, each with a name and a type (`TEXT`, `NUMBER`, `DATE` or `BOOLEAN`), for example `[{ \"name\": \"product_code\", \"type\": \"TEXT\" }]`. Leave it out or empty to keep the list open: later steps can still reference `${{ current.item.<key> }}`. Names are exact (`product_code` and `product-code` differ). Don't use `Index`, `Number`, `Total` or `Value`: a For each loop uses them for the position in the list and for the whole item."}},"required":["name"]},"StepConfig_FORMAT":{"type":"object","properties":{"format":{"type":"object","properties":{"operation":{"$ref":"#/components/schemas/StepConfig_FORMAT_operation"},"input":{"description":"The value to change: a reference to an earlier step's value, such as `${{ steps.intake.fields.tags }}`.","$ref":"#/components/schemas/StepConfig_FORMAT_input"},"matchMode":{"type":"string","enum":["exact","ignore_case","contains","starts_with"]},"extractKind":{"type":"string","enum":["email","url","number"]},"dateOutput":{"type":"string","enum":["date","date_time","time"]},"dateFormat":{"type":"string","enum":["yyyy_mm_dd","mm_dd_yyyy","dd_mm_yyyy","month_day_year","iso","readable_12h","readable_24h","hh_mm_24","hh_mm_12","unix_seconds"],"description":"For `date`: the output format, such as `YYYY-MM-DD`, `MM/DD/YYYY`, a readable date or time, or Unix seconds."},"timeZone":{"type":"string","description":"For `date` and `date_diff`: a time zone name, such as `America/New_York`. Publishing fails on a time zone that doesn't exist. Omit it to keep the source time."},"decimals":{"type":"integer","minimum":0,"maximum":10,"description":"For `number_format`: decimal places, from 0 to 10. Money defaults to 2; other styles keep the number as it is."},"currencyCode":{"type":"string","pattern":"^[A-Z]{3}$","description":"For `number_format` with `numberStyle` `money`: an ISO 4217 currency code, such as `USD` or `EUR`. It overrides the value's own currency; omit it to use that currency."},"rounding":{"type":"string","enum":["nearest","up","down"],"description":"For `number_format`: `nearest` (the default), `up` or `down`."},"dateInput":{"type":"string","enum":["auto","mdy","dmy"],"description":"For `date`, `date_add` and `date_diff`: how to read a date with slashes, such as 03/04/2026. `auto` (the default) reads it day first when only day first is possible, and month first otherwise; `mdy` always reads month first; `dmy` always reads day first."},"dateAmount":{"description":"For `date_add`: how many `dateUnit` to add or subtract, as a whole number or a reference to a number from an earlier step. Publishing fails on a fixed value that isn't a whole number up to 36,600.","$ref":"#/components/schemas/StepConfig_FORMAT_dateAmount"},"dateUnit":{"type":"string","enum":["minutes","hours","days","business_days","weeks","months","years"],"description":"For `date_add` and `date_diff`: `minutes`, `hours`, `days` (the default), `business_days` (Monday to Friday), `weeks`, `months` or `years`."},"dateDirection":{"type":"string","enum":["add","subtract"],"description":"For `date_add`: `add` (the default) or `subtract`."},"compareTo":{"type":"string","enum":["now","value"],"description":"For `date_diff`: `now` (the default) or `value`, which uses `compareValue`."},"compareValue":{"description":"For `date_diff` with `compareTo` set to `value`: the other date, usually a reference to an earlier step.","$ref":"#/components/schemas/StepConfig_FORMAT_input"},"numberStyle":{"type":"string","enum":["number","percent","money","plain"],"description":"For `number_format`: `number` (1,234.5, the default), `percent` (0.25 becomes 25%), `money` ($1,234.50, in `currencyCode` or the value's own currency) or `plain` (1234.5)."},"betweenStart":{"type":"string","description":"For `text_between`: the text immediately before the part to return, matched without regard to capitals. Empty starts at the beginning."},"betweenEnd":{"type":"string","description":"For `text_between`: the text immediately after the part to return, matched without regard to capitals. Empty stops at the end of the line."},"slicePart":{"type":"string","enum":["first","last","position"],"description":"For `text_slice`: `first` (the default), `last` or `position`."},"sliceCount":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}],"description":"For `text_slice`: how many characters to keep. Required for `first` and `last`; with `position`, leave it out to keep the rest of the text."},"slicePosition":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}],"description":"For `text_slice` with `slicePart` set to `position`: the character to start at, counting from 1. Defaults to 1."},"countKind":{"type":"string","enum":["items","words","characters","lines"],"description":"For `count`: `items` (the default), `words`, `characters` or `lines`."},"eachItem":{"type":"boolean","description":"For `phone`, `name`, `date` and `text_cleanup`: when `true`, applies the operation to every item of the input list and returns lists."},"listUnique":{"type":"boolean","description":"For `list_cleanup`, and `join_list` with `combineAs` set to `list`: drops repeated items, without regard to capitals. Defaults to `true`."},"listSort":{"type":"boolean","description":"For `list_cleanup`, and `join_list` with `combineAs` set to `list`: sorts the items A to Z. Defaults to `false`."},"pickPosition":{"type":"string","enum":["first","last","number"],"description":"For `list_pick`: `first`, `last` or `number` (uses `pickIndex`)."},"pickIndex":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991,"description":"For `list_pick` with `pickPosition` set to `number`: the position of the item to return, counting from 1."},"propertyKey":{"type":"string","description":"For `pick_property`: the key of the field to return."},"propertyType":{"type":"string","enum":["TEXT","EMAIL","PHONE","URL","NUMBER","DATE","BOOLEAN","JSON"],"description":"For `pick_property`: the type later steps see for the value: `TEXT`, `EMAIL`, `PHONE`, `URL`, `NUMBER`, `DATE`, `BOOLEAN` or `JSON`. Omit it to decide by the field's name: `email` is `EMAIL`; `url`, `website` or `link` is `URL`; anything else is `TEXT`."},"findField":{"type":"string","description":"For `find_item`: the field to search on each item."},"findValue":{"description":"For `find_item`: the value to look for, compared after trimming and without regard to capitals. Use a reference when the value comes from an earlier step.","$ref":"#/components/schemas/StepConfig_FORMAT_input"},"properties":{"description":"For `find_item`: the fields of the found item that later steps can use, as `{ name, key, type }`. Each `key` must be usable in a reference. `type` is the type later steps see; without it, fields named like `email` or `url` keep that type and the rest are text.","$ref":"#/components/schemas/StepConfig_FORMAT_properties"},"extraInputs":{"description":"For `join_list`: more values to combine after `input`, each a reference to an earlier step.","$ref":"#/components/schemas/StepConfig_FORMAT_extraInputs"},"combineAs":{"type":"string","enum":["text","list"],"description":"For `join_list`: `text` (the default) joins everything with `joinSeparator`; `list` returns one list."},"separator":{"type":"string","enum":["comma","semicolon","newline","tab","space","custom"],"description":"What `split_text` splits on. `custom` uses `customSeparator`."},"customSeparator":{"type":"string","description":"The exact characters `split_text` splits on when `separator` is `custom`."},"trimItems":{"type":"boolean","description":"For `split_text`: trims spaces around each item. Defaults to `true`."},"dropEmpty":{"type":"boolean","description":"For `split_text`: drops empty items. Defaults to `true`."},"joinSeparator":{"type":"string","description":"For `join_list`: the text placed between items. Defaults to `\", \"`."},"mappings":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"from":{"type":"string","description":"The value to match, exactly, after trimming, such as `in_progress`."},"to":{"type":"string","description":"The value written when `from` matches, such as `Active`."}},"required":["from","to"]},"description":"For `map_values`: the `{ from, to }` rows. A value matches a row exactly, after trimming. Up to 200 rows."},"unmatched":{"type":"string","enum":["keep","default","fail"],"description":"For `map_values`, when no row matches: keep the original, use `unmatchedDefault`, or fail the step."},"unmatchedDefault":{"type":"string","description":"For `map_values`: the value used when `unmatched` is `default`."},"defaultValue":{"type":"string","description":"For `default_if_empty`: the value used when the input is blank."},"trim":{"type":"boolean","description":"For `text_cleanup`: trims the ends. Defaults to `true`."},"textCase":{"type":"string","enum":["none","upper","lower","title"],"description":"For `text_cleanup`: `none`, `upper`, `lower` or `title`."},"find":{"type":"string","description":"For `text_cleanup`: the exact text to replace. Empty means nothing is replaced."},"replaceWith":{"type":"string","description":"For `text_cleanup`: the replacement for every occurrence of `find`."},"truncateLength":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}],"description":"For `text_cleanup`: the most characters to keep. Omit it, or send `null`, to keep the whole value."},"truncateEllipsis":{"type":"boolean","description":"For `text_cleanup`: ends a shortened value with an ellipsis. Defaults to `true`."}},"required":["operation"],"description":"Changes one value from an earlier step. Later steps read the output as Result."},"visibleToAllAssignees":{"type":"boolean"},"blockOnFailure":{"type":"boolean","description":"Whether a failure stops the flow (\"Block the workflow if this step fails\"). `false` lets the flow continue past it; the failure is still recorded. Stops it when left out."},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"}},"required":["format"],"title":"Format data","description":"Prepares a value from an earlier step without code: splits or joins text, reads or writes JSON, converts values, cleans text, formats common fields, works with lists and finds fields.\n\nThe settings a template read (`GET /v1/templates/{id}`) returns for this type, as stored. The shared settings (due date, reminders, visibility, monitors) can appear alongside them. To set them in a change, send `StepSettings_FORMAT`: where this shape holds an id, a change can name a role, field or step by its name or handle.","x-moxo-step-type":"FORMAT","x-moxo-category":"AUTOMATION"},"StepConfig_FORMAT_operation":{"type":"string","enum":["split_text","join_list","parse_json","to_json","map_values","default_if_empty","text_cleanup","name","phone","address","date","extract","list_cleanup","list_pick","pick_property","find_item","text_between","text_slice","strip_html","count","date_add","date_diff","number_format"],"description":"The operation. Text: `split_text` turns delimited text into a list (with First item and Last item); `join_list` combines `input` and `extraInputs` into one piece of text, or one list when `combineAs` is `list`; `text_cleanup` trims, changes case, finds and replaces, or shortens; `extract` finds the first email address, URL or number in the text. Structured values: `name` splits a full name; `phone` formats a number as `+E.164`; `address` splits an address object or a one-line address; `date` reformats a date or time. Lists: `list_cleanup` drops blanks and repeats and can sort; `list_pick` gets the first, last or nth item. Records: `pick_property` reads one field of an object; `find_item` finds the record in a list whose field matches a value. More text: `text_between` returns the text after `betweenStart` and before `betweenEnd` (to the end of the line when `betweenEnd` is empty); `text_slice` returns the first or last `sliceCount` characters, or `sliceCount` characters from `slicePosition` (such as the last 4 digits of an account number); `strip_html` returns plain text from HTML; `count` counts items, words, characters or lines. Dates: `date`, `date_add` and `date_diff` read ISO dates, `MM/DD/YYYY` or `DD/MM/YYYY` (see `dateInput`), month names, times and Unix seconds; `date_add` adds or subtracts `dateAmount` `dateUnit` (`business_days` skips weekends); `date_diff` returns how many complete `dateUnit` lie from `compareTo` (now, or `compareValue`) to the input, positive when the input is later. A part unit is dropped, toward zero: January 31 to February 28 is 0 months, and 1 month and 29 days is 1 month. Numbers: `number_format` rounds a number or numeric text (`decimals`, `rounding`) and writes it as 1,234.5, 25%, money in `currencyCode` such as $1,234.50, or 1234.5 (`numberStyle` `number`, `percent`, `money` or `plain`); money also reads `{ amount, currency }`. Other: `map_values` replaces values from a from/to table; `default_if_empty` uses a fallback when the input is blank; `parse_json` and `to_json` read and write JSON text."},"StepConfig_FORMAT_input":{"anyOf":[{"type":"string"},{"$ref":"#/components/schemas/StepConfigPart_ref"},{"type":"object","properties":{"kind":{"type":"string","const":"for-each-item"},"expectedType":{"type":"string"},"selector":{"type":"string","enum":["item","index","number","total"],"description":"What to read from the current pass of a loop. `item` reads a column of the current row; `index` (starting at 0), `number` (starting at 1) and `total` are the loop's counters."},"itemFieldId":{"description":"The column's id, for `item`. Preferred over `itemField`, because it still works after the column is renamed.","type":"string"},"itemField":{"description":"The column's label, for `item` when the list has no column ids. A label stops working when the column is renamed.","type":"string"}},"required":["kind","expectedType","selector"]}]},"StepConfig_FORMAT_dateAmount":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"anyOf":[{"type":"string"},{"$ref":"#/components/schemas/StepConfigPart_ref"}]},{"type":"object","properties":{"kind":{"type":"string","const":"for-each-item"},"expectedType":{"type":"string"},"selector":{"type":"string","enum":["item","index","number","total"],"description":"What to read from the current pass of a loop. `item` reads a column of the current row; `index` (starting at 0), `number` (starting at 1) and `total` are the loop's counters."},"itemFieldId":{"description":"The column's id, for `item`. Preferred over `itemField`, because it still works after the column is renamed.","type":"string"},"itemField":{"description":"The column's label, for `item` when the list has no column ids. A label stops working when the column is renamed.","type":"string"}},"required":["kind","expectedType","selector"]}]},"StepConfig_FORMAT_properties":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"The label for this field, such as \"Email\"."},"key":{"type":"string","description":"The key to read from the object, which is also the field's key in references, such as `email`."},"type":{"type":"string","enum":["TEXT","EMAIL","PHONE","URL","NUMBER","DATE","BOOLEAN","JSON"],"description":"The type later steps see for this field: `TEXT`, `EMAIL`, `PHONE`, `URL`, `NUMBER`, `DATE`, `BOOLEAN` or `JSON`. Omit it to decide by the field's name: `email` is `EMAIL`; `url`, `website` or `link` is `URL`; anything else is `TEXT`."}},"required":["name","key"]}},"StepConfig_FORMAT_extraInputs":{"type":"array","items":{"anyOf":[{"type":"string"},{"$ref":"#/components/schemas/StepConfigPart_ref"},{"type":"object","properties":{"kind":{"type":"string","const":"for-each-item"},"expectedType":{"type":"string"},"selector":{"type":"string","enum":["item","index","number","total"],"description":"What to read from the current pass of a loop. `item` reads a column of the current row; `index` (starting at 0), `number` (starting at 1) and `total` are the loop's counters."},"itemFieldId":{"description":"The column's id, for `item`. Preferred over `itemField`, because it still works after the column is renamed.","type":"string"},"itemField":{"description":"The column's label, for `item` when the list has no column ids. A label stops working when the column is renamed.","type":"string"}},"required":["kind","expectedType","selector"]}]}},"StepConfig_REST_API":{"type":"object","properties":{"restApi":{"description":"The API call. The URL, headers and body can include references to values from earlier in the flow.","$ref":"#/components/schemas/StepConfig_REST_API_restApi"},"outputMappings":{"type":"array","items":{"type":"object","properties":{"responseJsonPath":{"type":"string","description":"Where in the response this value is, as a JSONPath from `$`, such as `$.accountStatus`, `$.data.customer.id` or `$.items[0].total`. Required. When the value is at the top level under the same name as `outputKey`, Moxo fills in `$.<outputKey>`; send it when the API nests the value or names it differently."},"outputKey":{"type":"string"}},"required":["responseJsonPath","outputKey"]}},"approveBeforeRun":{"description":"Whether a person approves the request, with its values filled in, before the call is made. The call runs only once it is approved. Useful for calls that change data (`POST`, `PUT`, `PATCH`, `DELETE`).","type":"boolean"},"reviewers":{"anyOf":[{"type":"object","properties":{"participants":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["AI","HUMAN"]},"roleId":{"type":"string","description":"For a person: the role that takes this seat, by its id."},"contactId":{"type":"string","description":"An external user named on the seat, by the `usr_` id the template read shows. `null` follows the read, as for `userId`."},"userId":{"type":"string","description":"A person named on the seat, by the `usr_` id the template read shows. `null` where the read showed `null` (someone with no id here) keeps the saved person; `null` where it showed an id takes them off the seat."},"agentId":{"type":"string"},"prompt":{"type":"string","description":"The AI participant's step context: instructions for this step only."},"criteria":{"type":"string","description":"For an AI reviewer: what to check. Read before `prompt`."},"context":{"type":"string","description":"An older home of the AI participant's step context, still read. Set `prompt` instead."},"privateNotesGuidance":{"type":"string","maxLength":2000,"description":"When no agent is named: what the AI notes privately for the flow's managers."},"sendBackReply":{"type":"string","enum":["outcome_with_reason","outcome_only"],"description":"When the AI sends work back and no agent is named: what the reply says, `outcome_with_reason` or `outcome_only`."},"howToExplain":{"type":"string","maxLength":2000,"description":"When the AI sends work back and no agent is named: how it explains what to fix."},"inputs":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"value":{"type":"string"},"type":{"type":"string","enum":["TEXT","FILE"]}},"required":["name","value"]}},"participantId":{"type":"string","description":"The participant's id on the step. Keep it when sending the seat back; leave it out for a new participant."},"order":{"type":"number","description":"The participant's place in the seat, from 0, when they act one after another."},"aiConfig":{}},"required":["type"],"additionalProperties":{}}},"sequential":{"type":"boolean"},"completion":{"type":"object","properties":{"mode":{"type":"string","enum":["ANY_ONE","ALL"],"description":"`ANY_ONE`: one participant finishing is enough. `ALL`: every participant finishes."}},"required":["mode"],"description":"When the seat is done."},"showToExternalAssignee":{"description":"Advisors only. `true` lets an assignee outside your organization read the recommendation (the call and its reasons), as advice from your organization. Off unless set.","type":"boolean"},"canEditAnswers":{"description":"Reviewers only, on a Form, PDF form or File request step. `true` lets the reviewer whose turn it is edit the submitted answers (on a File request, add and remove its files) during review, in the Moxo app, instead of sending them back. Off unless set.","type":"boolean"},"reviewItemsTogether":{"description":"Reviewers only, on a person's step inside a For each whose items run at the same time. `true` gives the reviewer one list and one notice for every item instead of one review per item; each item keeps its own run and review. With the loop's `syncStepsAcrossIterations` on, the reviewer approves every item at once (`approve_reviews_together`); off, each item is approved on its own. Publish refuses it in a Repeat while, on an \"Approve before it runs\" step, with no person or role reviewing, and in a loop that runs items one at a time. Off unless set.","type":"boolean"}},"required":["participants"]},{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["AI","HUMAN"]},"roleId":{"type":"string"},"contactId":{"type":"string"},"userId":{"type":"string"},"agentId":{"type":"string"},"prompt":{"type":"string"},"criteria":{"type":"string"},"context":{"type":"string"},"privateNotesGuidance":{"type":"string","maxLength":2000},"sendBackReply":{"type":"string","enum":["outcome_with_reason","outcome_only"]},"howToExplain":{"type":"string","maxLength":2000},"inputs":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"value":{"type":"string"},"type":{"type":"string","enum":["TEXT","FILE"]}},"required":["name","value"]}},"ruleKinds":{"maxItems":80,"type":"array","items":{"type":"object","properties":{"rule":{"type":"string","minLength":1,"maxLength":2000},"kind":{"type":"string","enum":["fact","data_match","coverage","visual","judgment"]},"compare":{"type":"object","properties":{"check":{"type":"string","enum":["compare.money_equal","compare.date_after","compare.names_equal","certificate.insured_name_matches","certificate.limit_at_least","kyc.id_name_matches","kyc.birth_date_matches","kyc.dated_within_three_months"]},"against":{"type":"string","enum":["today","value","input"]},"value":{"type":"string","minLength":1,"maxLength":500},"input":{"type":"string","minLength":1,"maxLength":200}},"required":["check","against"]},"document":{"type":"string","minLength":1,"maxLength":200},"sum":{"type":"object","properties":{"fields":{"minItems":2,"maxItems":60,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}}},"required":["fields"]}},"required":["rule","kind"]}},"participantId":{"type":"string"},"order":{"type":"number"},"aiConfig":{}},"required":["type"],"additionalProperties":{}}}]},"approvalRejectMode":{"type":"string","enum":["skip","halt"]},"visibleToAllAssignees":{"type":"boolean"},"blockOnFailure":{"type":"boolean","description":"Whether a failure stops the flow (\"Block the workflow if this step fails\"). `false` lets the flow continue past it; the failure is still recorded. Stops it when left out."},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"}},"title":"REST API","description":"Calls an HTTP API, reads the response and maps values from it for later steps.\n\nThe settings a template read (`GET /v1/templates/{id}`) returns for this type, as stored. The shared settings (due date, reminders, visibility, monitors) can appear alongside them. To set them in a change, send `StepSettings_REST_API`: where this shape holds an id, a change can name a role, field or step by its name or handle.\n\n**Offered by plan:** available when the organization's plan includes `restApi`.","x-moxo-step-type":"REST_API","x-moxo-category":"AUTOMATION","x-moxo-plan-feature":"restApi"},"StepConfig_REST_API_restApi":{"type":"object","properties":{"url":{"type":"string","description":"The URL to call. Can include references, such as `https://api.example.com/users/${{ steps.kickoff.fields.client_id }}`."},"method":{"type":"string","enum":["GET","POST","PUT","PATCH","DELETE"]},"queryParams":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"},"description":"Query parameters added to the URL. Each value can include a reference, such as `{ \"country\": \"${{ steps.address_form.fields.country }}\" }`."},"headers":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"},"description":"HTTP headers. Values can include references, such as `{ \"X-Request-Id\": \"${{ flow.id }}\" }`. To sign in, set `connectionId` to a saved Secret instead."},"body":{"description":"The request body: a JSON object or a string. Can include references. Ignored when `bodyType` is `multipart`."},"bodyType":{"type":"string","enum":["json","multipart"],"description":"How the body is sent. `json` (the default) sends `body` as JSON. `multipart` sends `formFields` as `multipart/form-data`, with text and file parts, for APIs that take document uploads."},"formFields":{"description":"The form parts when `bodyType` is `multipart`. Each one is text, which can include references, or a file from an earlier step.","$ref":"#/components/schemas/StepConfig_REST_API_formFields"},"connectionId":{"type":"string","description":"The id of a saved Secret to sign in with. When set, the Secret's credentials are added to the call and an inline `auth` is ignored."},"pendingSecretName":{"type":"string","description":"The name of a Secret this step needs. The template can't be published until the step has a Secret."},"auth":{"type":"object","properties":{"type":{"type":"string","enum":["none","bearer","basic"]},"token":{"type":"string","description":"A bearer token. Can be a reference, such as `${{ steps.get_token.fields.access_token }}`. To use a saved Secret, set `connectionId` instead."},"username":{"type":"string"},"password":{"type":"string"}}},"responseItemFields":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"type":{"type":"string","enum":["TEXT","NUMBER","DATE","BOOLEAN","CHOICE","OBJECT"]},"enumValues":{"type":"array","items":{"type":"string"}},"fields":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"type":{"type":"string","enum":["TEXT","NUMBER","DATE","BOOLEAN","CHOICE","OBJECT"]},"enumValues":{"type":"array","items":{"type":"string"}},"fields":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"type":{"type":"string","enum":["TEXT","NUMBER","DATE","BOOLEAN","CHOICE","OBJECT"]},"enumValues":{"type":"array","items":{"type":"string"}}},"required":["name","type"]}}},"required":["name","type"]}}},"required":["name","type"]}},"outputMappings":{"type":"array","items":{"type":"object","properties":{"responseJsonPath":{"type":"string","description":"Where in the response this value is, as a JSONPath from `$`, such as `$.accountStatus`, `$.data.customer.id` or `$.items[0].total`. Required. When the value is at the top level under the same name as `outputKey`, Moxo fills in `$.<outputKey>`; send it when the API nests the value or names it differently."},"outputKey":{"type":"string"}},"required":["responseJsonPath","outputKey"]}},"response":{"type":"object","properties":{"mode":{"type":"string","enum":["text","file"],"description":"`text` (the default) reads the response as JSON or text. `file` saves the response as one file, which later steps see as Response File."},"acceptedTypes":{"type":"array","items":{"type":"string"},"description":"In `file` mode: the file types to accept. Presets: `pdf`, `images`, `word`, `excel`, `csv`, `zip` and `any`, or a MIME type such as `application/x-custom`. At least one is required in `file` mode."},"fileName":{"type":"string","description":"In `file` mode: the saved file's name. Can include references to earlier steps. Leave it blank to use the name the API sends."},"maxSizeMb":{"type":"integer","minimum":1,"maximum":50,"description":"In `file` mode: the largest file to accept, in megabytes. Defaults to 25; at most 50."},"sendAcceptHeader":{"type":"boolean","description":"In `file` mode: sends an `Accept` header naming the accepted types. A header set in `headers` always takes precedence."},"continueOnError":{"type":"boolean","description":"In `file` mode: when the API returns an error, completes the step with no file instead of failing, so a later step can branch on the status code."}}},"timeout":{"type":"number","description":"How long to wait for a response, in milliseconds, up to 600000."},"retryPolicy":{"type":"object","properties":{"maxRetries":{"type":"number"},"backoffMs":{"type":"number"}},"description":"How many more times to try a call that can't connect or gets a `429` (after its `Retry-After`), and one that times out, loses its connection after sending, or gets a `408` or `5xx` only when the call is safe to send again: `GET`, `HEAD`, `PUT`, `DELETE`, `OPTIONS`, or an `Idempotency-Key` header. A `POST` that got a `500` or no reply may already have acted, so it is sent once. Also how long to wait before the first retry; each later wait doubles. Any other reply is the API's answer and is not retried."}}},"StepConfig_REST_API_formFields":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"The part's name, as the API expects it, such as `profile` or `file`."},"kind":{"type":"string","const":"text","description":"A text part: plain text or JSON text, which can include references."},"value":{"type":"string","description":"The text part's value, such as JSON text (`{\"class\":\"Document\"}`) or a reference such as `${{ steps.kickoff.fields.client_name }}`."}},"required":["name","kind","value"]},{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"The part's name, as the API expects it, such as `file` or `document`."},"kind":{"type":"string","const":"file","description":"A file part: sends a file from an earlier step."},"fileRef":{"type":"string","minLength":1,"description":"A reference to a file from an earlier step, such as `${{ steps.upload_contract.fields.uploaded_files }}`."}},"required":["name","kind","fileRef"]}]}},"StepConfig_MCP_SERVER":{"type":"object","properties":{"mcpServer":{"type":"object","properties":{"serverUrl":{"type":"string"},"toolName":{"type":"string"},"arguments":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"auth":{"type":"object","properties":{"type":{"type":"string","enum":["NONE","BEARER","HEADER"],"description":"The authentication type for the MCP server."},"token":{"type":"string","description":"A bearer token. Can be a reference, such as `${{ steps.get_token.fields.access_token }}`. To use a saved Secret, set `connectionId` instead."},"headerName":{"type":"string","description":"With `HEADER` authentication, the header's name."},"headerValue":{"type":"string","description":"With `HEADER` authentication, the header's value. Can include flow value references."}},"description":"How the step authenticates with the MCP server."},"outputMappings":{"type":"array","items":{"type":"object","properties":{"resultJsonPath":{"type":"string","description":"Where the value is in the tool's result, as a JSONPath from `$`, for example `$.summary` or `$.data.items[0].id`. When the value is at the top level under the same name as `outputKey`, it defaults to `$.<outputKey>`; set it when the value is nested or named differently."},"outputKey":{"type":"string","description":"The name the value is saved under, so later steps can refer to it as `${{ steps.<this step>.fields.<outputKey> }}`."}},"required":["resultJsonPath","outputKey"]}},"connectionId":{"type":"string","description":"The connection the step signs in with."},"timeout":{"type":"number","description":"How long to wait for the tool to answer, in milliseconds. Defaults to 30 seconds."}},"description":"The settings of an MCP server step, which calls a tool on an MCP server."},"outputMappings":{"type":"array","items":{"type":"object","properties":{"resultJsonPath":{"type":"string","description":"Where the value is in the tool's result, as a JSONPath from `$`, for example `$.summary` or `$.data.items[0].id`. When the value is at the top level under the same name as `outputKey`, it defaults to `$.<outputKey>`; set it when the value is nested or named differently."},"outputKey":{"type":"string","description":"The name the value is saved under, so later steps can refer to it as `${{ steps.<this step>.fields.<outputKey> }}`."}},"required":["resultJsonPath","outputKey"]}},"approveBeforeRun":{"type":"boolean","description":"Whether a person approves the values this step is about to use before it runs. Available on `REST_API`, `EXTERNAL_APP`, `MCP_SERVER`, `SYSTEM_EMAIL`, `SEND_ANNOUNCEMENT`, `SEND_TO_CONVERSATION`, `SYSTEM_WEBHOOK`, `DATA_TABLE_SAVE_RECORD`, `START_FLOW`, `SCHEDULE_FLOW`, `CODE`, `COLLECT_PAYMENT`, `DOCUSIGN` and `ADOBE_SIGN` steps. When `true`, the step pauses before it calls, sends, writes, starts or schedules anything, until someone approves. Set who approves in the step's `reviewers`: a step with approval on and no approver can't be published."},"approvalRejectMode":{"type":"string","enum":["skip","halt"],"description":"What a rejection does, with `approveBeforeRun`. `skip` (the default) skips this step and the flow continues; `halt` stops the flow."},"reviewers":{"anyOf":[{"type":"object","properties":{"participants":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["AI","HUMAN"]},"roleId":{"type":"string","description":"For a person: the role that takes this seat, by its id."},"contactId":{"type":"string","description":"An external user named on the seat, by the `usr_` id the template read shows. `null` follows the read, as for `userId`."},"userId":{"type":"string","description":"A person named on the seat, by the `usr_` id the template read shows. `null` where the read showed `null` (someone with no id here) keeps the saved person; `null` where it showed an id takes them off the seat."},"agentId":{"type":"string"},"prompt":{"type":"string","description":"The AI participant's step context: instructions for this step only."},"criteria":{"type":"string","description":"For an AI reviewer: what to check. Read before `prompt`."},"context":{"type":"string","description":"An older home of the AI participant's step context, still read. Set `prompt` instead."},"privateNotesGuidance":{"type":"string","maxLength":2000,"description":"When no agent is named: what the AI notes privately for the flow's managers."},"sendBackReply":{"type":"string","enum":["outcome_with_reason","outcome_only"],"description":"When the AI sends work back and no agent is named: what the reply says, `outcome_with_reason` or `outcome_only`."},"howToExplain":{"type":"string","maxLength":2000,"description":"When the AI sends work back and no agent is named: how it explains what to fix."},"inputs":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"value":{"type":"string"},"type":{"type":"string","enum":["TEXT","FILE"]}},"required":["name","value"]}},"participantId":{"type":"string","description":"The participant's id on the step. Keep it when sending the seat back; leave it out for a new participant."},"order":{"type":"number","description":"The participant's place in the seat, from 0, when they act one after another."},"aiConfig":{}},"required":["type"],"additionalProperties":{}}},"sequential":{"type":"boolean"},"completion":{"type":"object","properties":{"mode":{"type":"string","enum":["ANY_ONE","ALL"],"description":"`ANY_ONE`: one participant finishing is enough. `ALL`: every participant finishes."}},"required":["mode"],"description":"When the seat is done."},"showToExternalAssignee":{"description":"Advisors only. `true` lets an assignee outside your organization read the recommendation (the call and its reasons), as advice from your organization. Off unless set.","type":"boolean"},"canEditAnswers":{"description":"Reviewers only, on a Form, PDF form or File request step. `true` lets the reviewer whose turn it is edit the submitted answers (on a File request, add and remove its files) during review, in the Moxo app, instead of sending them back. Off unless set.","type":"boolean"},"reviewItemsTogether":{"description":"Reviewers only, on a person's step inside a For each whose items run at the same time. `true` gives the reviewer one list and one notice for every item instead of one review per item; each item keeps its own run and review. With the loop's `syncStepsAcrossIterations` on, the reviewer approves every item at once (`approve_reviews_together`); off, each item is approved on its own. Publish refuses it in a Repeat while, on an \"Approve before it runs\" step, with no person or role reviewing, and in a loop that runs items one at a time. Off unless set.","type":"boolean"}},"required":["participants"]},{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["AI","HUMAN"]},"roleId":{"type":"string"},"contactId":{"type":"string"},"userId":{"type":"string"},"agentId":{"type":"string"},"prompt":{"type":"string"},"criteria":{"type":"string"},"context":{"type":"string"},"privateNotesGuidance":{"type":"string","maxLength":2000},"sendBackReply":{"type":"string","enum":["outcome_with_reason","outcome_only"]},"howToExplain":{"type":"string","maxLength":2000},"inputs":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"value":{"type":"string"},"type":{"type":"string","enum":["TEXT","FILE"]}},"required":["name","value"]}},"ruleKinds":{"maxItems":80,"type":"array","items":{"type":"object","properties":{"rule":{"type":"string","minLength":1,"maxLength":2000},"kind":{"type":"string","enum":["fact","data_match","coverage","visual","judgment"]},"compare":{"type":"object","properties":{"check":{"type":"string","enum":["compare.money_equal","compare.date_after","compare.names_equal","certificate.insured_name_matches","certificate.limit_at_least","kyc.id_name_matches","kyc.birth_date_matches","kyc.dated_within_three_months"]},"against":{"type":"string","enum":["today","value","input"]},"value":{"type":"string","minLength":1,"maxLength":500},"input":{"type":"string","minLength":1,"maxLength":200}},"required":["check","against"]},"document":{"type":"string","minLength":1,"maxLength":200},"sum":{"type":"object","properties":{"fields":{"minItems":2,"maxItems":60,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}}},"required":["fields"]}},"required":["rule","kind"]}},"participantId":{"type":"string"},"order":{"type":"number"},"aiConfig":{}},"required":["type"],"additionalProperties":{}}}]},"visibleToAllAssignees":{"type":"boolean"},"blockOnFailure":{"type":"boolean","description":"Whether a failure stops the flow (\"Block the workflow if this step fails\"). `false` lets the flow continue past it; the failure is still recorded. Stops it when left out."},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"}},"title":"MCP Server","description":"Calls tools on a Model Context Protocol (MCP) server.\n\nThe settings a template read (`GET /v1/templates/{id}`) returns for this type, as stored. The shared settings (due date, reminders, visibility, monitors) can appear alongside them. To set them in a change, send `StepSettings_MCP_SERVER`: where this shape holds an id, a change can name a role, field or step by its name or handle.\n\n**Offered by plan:** available when the organization's plan includes `mcpServer`.\n\n**Needs a connection:** `mcp`, connected in Moxo.","x-moxo-step-type":"MCP_SERVER","x-moxo-category":"AUTOMATION","x-moxo-plan-feature":"mcpServer","x-moxo-requires-connection":["mcp"]},"StepConfig_EXTERNAL_APP":{"type":"object","properties":{"externalApp":{"description":"The app and the action this step runs in it.","$ref":"#/components/schemas/StepConfig_EXTERNAL_APP_externalApp"},"approveBeforeRun":{"type":"boolean","description":"Whether a person approves the values this step is about to use before it runs. Available on `REST_API`, `EXTERNAL_APP`, `MCP_SERVER`, `SYSTEM_EMAIL`, `SEND_ANNOUNCEMENT`, `SEND_TO_CONVERSATION`, `SYSTEM_WEBHOOK`, `DATA_TABLE_SAVE_RECORD`, `START_FLOW`, `SCHEDULE_FLOW`, `CODE`, `COLLECT_PAYMENT`, `DOCUSIGN` and `ADOBE_SIGN` steps. When `true`, the step pauses before it calls, sends, writes, starts or schedules anything, until someone approves. Set who approves in the step's `reviewers`: a step with approval on and no approver can't be published."},"approvalRejectMode":{"type":"string","enum":["skip","halt"],"description":"What a rejection does, with `approveBeforeRun`. `skip` (the default) skips this step and the flow continues; `halt` stops the flow."},"reviewers":{"anyOf":[{"type":"object","properties":{"participants":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["AI","HUMAN"]},"roleId":{"type":"string","description":"For a person: the role that takes this seat, by its id."},"contactId":{"type":"string","description":"An external user named on the seat, by the `usr_` id the template read shows. `null` follows the read, as for `userId`."},"userId":{"type":"string","description":"A person named on the seat, by the `usr_` id the template read shows. `null` where the read showed `null` (someone with no id here) keeps the saved person; `null` where it showed an id takes them off the seat."},"agentId":{"type":"string"},"prompt":{"type":"string","description":"The AI participant's step context: instructions for this step only."},"criteria":{"type":"string","description":"For an AI reviewer: what to check. Read before `prompt`."},"context":{"type":"string","description":"An older home of the AI participant's step context, still read. Set `prompt` instead."},"privateNotesGuidance":{"type":"string","maxLength":2000,"description":"When no agent is named: what the AI notes privately for the flow's managers."},"sendBackReply":{"type":"string","enum":["outcome_with_reason","outcome_only"],"description":"When the AI sends work back and no agent is named: what the reply says, `outcome_with_reason` or `outcome_only`."},"howToExplain":{"type":"string","maxLength":2000,"description":"When the AI sends work back and no agent is named: how it explains what to fix."},"inputs":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"value":{"type":"string"},"type":{"type":"string","enum":["TEXT","FILE"]}},"required":["name","value"]}},"participantId":{"type":"string","description":"The participant's id on the step. Keep it when sending the seat back; leave it out for a new participant."},"order":{"type":"number","description":"The participant's place in the seat, from 0, when they act one after another."},"aiConfig":{}},"required":["type"],"additionalProperties":{}}},"sequential":{"type":"boolean"},"completion":{"type":"object","properties":{"mode":{"type":"string","enum":["ANY_ONE","ALL"],"description":"`ANY_ONE`: one participant finishing is enough. `ALL`: every participant finishes."}},"required":["mode"],"description":"When the seat is done."},"showToExternalAssignee":{"description":"Advisors only. `true` lets an assignee outside your organization read the recommendation (the call and its reasons), as advice from your organization. Off unless set.","type":"boolean"},"canEditAnswers":{"description":"Reviewers only, on a Form, PDF form or File request step. `true` lets the reviewer whose turn it is edit the submitted answers (on a File request, add and remove its files) during review, in the Moxo app, instead of sending them back. Off unless set.","type":"boolean"},"reviewItemsTogether":{"description":"Reviewers only, on a person's step inside a For each whose items run at the same time. `true` gives the reviewer one list and one notice for every item instead of one review per item; each item keeps its own run and review. With the loop's `syncStepsAcrossIterations` on, the reviewer approves every item at once (`approve_reviews_together`); off, each item is approved on its own. Publish refuses it in a Repeat while, on an \"Approve before it runs\" step, with no person or role reviewing, and in a loop that runs items one at a time. Off unless set.","type":"boolean"}},"required":["participants"]},{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["AI","HUMAN"]},"roleId":{"type":"string"},"contactId":{"type":"string"},"userId":{"type":"string"},"agentId":{"type":"string"},"prompt":{"type":"string"},"criteria":{"type":"string"},"context":{"type":"string"},"privateNotesGuidance":{"type":"string","maxLength":2000},"sendBackReply":{"type":"string","enum":["outcome_with_reason","outcome_only"]},"howToExplain":{"type":"string","maxLength":2000},"inputs":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"value":{"type":"string"},"type":{"type":"string","enum":["TEXT","FILE"]}},"required":["name","value"]}},"ruleKinds":{"maxItems":80,"type":"array","items":{"type":"object","properties":{"rule":{"type":"string","minLength":1,"maxLength":2000},"kind":{"type":"string","enum":["fact","data_match","coverage","visual","judgment"]},"compare":{"type":"object","properties":{"check":{"type":"string","enum":["compare.money_equal","compare.date_after","compare.names_equal","certificate.insured_name_matches","certificate.limit_at_least","kyc.id_name_matches","kyc.birth_date_matches","kyc.dated_within_three_months"]},"against":{"type":"string","enum":["today","value","input"]},"value":{"type":"string","minLength":1,"maxLength":500},"input":{"type":"string","minLength":1,"maxLength":200}},"required":["check","against"]},"document":{"type":"string","minLength":1,"maxLength":200},"sum":{"type":"object","properties":{"fields":{"minItems":2,"maxItems":60,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}}},"required":["fields"]}},"required":["rule","kind"]}},"participantId":{"type":"string"},"order":{"type":"number"},"aiConfig":{}},"required":["type"],"additionalProperties":{}}}]},"visibleToAllAssignees":{"type":"boolean"},"blockOnFailure":{"type":"boolean","description":"Whether a failure stops the flow (\"Block the workflow if this step fails\"). `false` lets the flow continue past it; the failure is still recorded. Stops it when left out."},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"}},"title":"External App","description":"Connects to other apps, such as a CRM, a payment system or a project management tool.\n\nThe settings a template read (`GET /v1/templates/{id}`) returns for this type, as stored. The shared settings (due date, reminders, visibility, monitors) can appear alongside them. To set them in a change, send `StepSettings_EXTERNAL_APP`: where this shape holds an id, a change can name a role, field or step by its name or handle.\n\n**Offered by plan:** available when the organization's plan includes `integrations`.","x-moxo-step-type":"EXTERNAL_APP","x-moxo-category":"AUTOMATION","x-moxo-plan-feature":"integrations"},"StepConfig_EXTERNAL_APP_externalApp":{"type":"object","properties":{"appId":{"type":"string","description":"The app's id in the catalog, such as `hubspot`, `salesforce` or `stripe`."},"appName":{"type":"string","description":"The app's name, such as `HubSpot`."},"actionId":{"type":"string","description":"The action's id within the app, such as `create_deal` or `send_message`."},"actionName":{"type":"string","description":"The action's name, such as `Create Deal`."},"connectionMode":{"type":"string","enum":["fixed","per_bundle","per_role"],"description":"How the connection is chosen. `fixed`: the connection in `connectionId`. `per_bundle`: from the connections given when the flow starts. `per_role`: the personal connection of the person assigned the role in `connectionRoleId`, chosen when the step runs; set `connectionRoleId` to one of the template's role ids and leave `connectionId` unset. `per_role` works only for apps that support personal accounts."},"connectionId":{"type":"string","description":"The id of the organization's connection to this app, set when someone connects an account. Only with `connectionMode` `fixed`."},"connectionRoleId":{"type":"string","description":"With `connectionMode` `per_role`: the `roleId` (not the role name) of the role whose assignee's personal connection runs this step. One of the template's role ids."},"inputs":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"The action's inputs, keyed by field id. A value can include references to flow values, such as `${{ steps.client_form.fields.client_name }}`. An input that takes a list of records, such as an invoice's line items, takes an object instead of text, with exactly one of: `source`, a list from an earlier step, with `columnMap` mapping the action's columns to the source's columns (columns with matching names can be left out), as in `{\"source\": \"${{ steps.extract_items.fields.items }}\", \"columnMap\": {\"description\": \"item_name\"}}`; or `rows`, the records themselves, as in `{\"rows\": [{\"description\": \"...\", \"quantity\": \"1\"}]}`, where each cell can hold references."}}},"StepConfig_ASSIGN_ROLE":{"type":"object","properties":{"assignRole":{"type":"object","properties":{"assignments":{"minItems":1,"type":"array","items":{"$ref":"#/components/schemas/StepConfig_ASSIGN_ROLE_assignmentsItem"},"description":"The role assignments, at least one. Each is applied on its own when the step runs, so one can succeed while another fails. Moxo shows them as \"role + email\" rows."}},"required":["assignments"],"additionalProperties":false,"description":"The roles to fill and who fills them, applied when the step runs. Each entry in `assignments` is `{ roleId, email, column?, reassignIfAssigned?, firstName?, lastName?, phone?, title? }`, applied on its own. `firstName`, `lastName`, `phone` and `title` are optional, apply only when a new person is created, and only to a single-person entry. `email` is one person (a fixed email or a reference to a value from earlier in the flow) or, to add a group to one role, a list: a fixed list of emails, or one reference that gives a list (a repeating group column, an AI step's list output or an API call step's list response). A list adds every person to the same role. Set `column` when the list reference is a whole repeating group and the emails are in one of its columns. A group role must allow several people (`cardinality: multi`), and its `roleOptions.completionMode` (any one, all or a majority) decides when its shared step is done. By default, a single-person entry changes nothing when its role already has someone; `reassignIfAssigned: true` replaces them instead, unless the role is tied to a signed e-signature step or a sent DocuSign envelope."},"visibleToAllAssignees":{"type":"boolean"},"blockOnFailure":{"type":"boolean","description":"Whether a failure stops the flow (\"Block the workflow if this step fails\"). `false` lets the flow continue past it; the failure is still recorded. Stops it when left out."},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"}},"title":"Assign Role","description":"Gives one or more roles to people partway through the flow, based on what earlier steps collected: one person per role, such as the signer a form named, or a collected list of people to one shared role, such as every email in a repeating group.\n\nThe settings a template read (`GET /v1/templates/{id}`) returns for this type, as stored. The shared settings (due date, reminders, visibility, monitors) can appear alongside them. To set them in a change, send `StepSettings_ASSIGN_ROLE`: where this shape holds an id, a change can name a role, field or step by its name or handle.\n\n**Offered by plan:** available when the organization's plan includes `assignRole`.","x-moxo-step-type":"ASSIGN_ROLE","x-moxo-category":"AUTOMATION","x-moxo-plan-feature":"assignRole"},"StepConfig_ASSIGN_ROLE_assignmentsItem":{"type":"object","properties":{"roleId":{"type":"string","description":"The role to fill. A template read returns its id, one of the role ids in `definition.roles`. A change names it by its name, its id, or the `handle` of a role added earlier in the same list (`StepSettings_ASSIGN_ROLE`). Use a role whose person isn't known when the flow starts, such as a signer chosen from the deal size. For a group, the role must allow several people (`cardinality: multi`)."},"fromAddedRoles":{"type":"string","description":"The id of an earlier Add role step. This row then fills each role that step made with one person, taken from `column` of the role's own row of the list (by default the Add role step's email column). Set `roleId` to that step's setup role and `email` to its list. A role whose row has no email is left unfilled."},"email":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"Who to assign: one person, as a fixed email or a reference to a value from earlier in the flow (such as `${{ steps.intake.fields.manager_email }}`); or a list, to add a group to the role. A list usually comes from a repeating group column someone filled with emails, such as `${{ steps.collect_beneficiaries.fields.beneficiaries.email }}`; a fixed list of emails, an AI step's list output or an API call step's list response also work. A list adds every person to the same role. A person who isn't in your organization yet is added. A single-person entry changes nothing when the role already has someone, unless `reassignIfAssigned` is set; a list only adds people who aren't on the role yet, so running it again adds no one twice."},"listMode":{"type":"boolean","description":"Which mode Moxo's template builder shows: `true` for \"A collected list of people\", `false` for \"One person\". It doesn't affect what the step does, which reads `email`."},"columnId":{"type":"string","description":"The permanent id of `column`. Moxo sets it from `column` when the template is saved; don't send it."},"column":{"type":"string","description":"The column that holds the emails, by name (not case-sensitive, for example `Email`). Needed only when a list reference names a whole repeating group, such as `${{ steps.collect_beneficiaries.fields.beneficiaries }}`, instead of one column. A column reference, such as `${{ steps.collect_beneficiaries.fields.beneficiaries.email }}`, needs no `column`. Leave it out for a list that is already flat (a fixed list, an AI step's list output or an API call step's list response)."},"reassignIfAssigned":{"type":"boolean","description":"Whether to replace the person already in the role. Single-person entries only. Defaults to `false`: the entry is skipped when the role already has someone. When `true`, the new person also takes over the role's open steps, and gets new links to them. Refused for that entry when the role is tied to a signed e-signature step or a sent DocuSign envelope, which can't be moved to someone else. Ignored for a list, which always adds people."},"personaId":{"type":"string","description":"The persona for a person this step creates. People who already exist keep theirs. When left out, new people get the organization's default external persona. For a list, every new person gets this persona. Must be a persona of your organization that can be assigned (see `personaMemberType`); an unknown id falls back to the default instead of failing the step."},"personaMemberType":{"type":"string","enum":["internal","external"],"description":"Which kind of persona `personaId` is. `internal` invites a new person as a member of your team, using the orchestrator portal, instead of as an external user. Owner and admin personas can't be used here."},"firstName":{"type":"string","description":"The first name for a person this step creates: a fixed value or a reference to a value from earlier in the flow, such as `${{ steps.intake_form.fields.first_name }}`. Used only when the person is created; existing people are not renamed. Not used for a list."},"lastName":{"type":"string","description":"The last name for a person this step creates: a fixed value or a flow value reference. Used only when the person is created; existing people are not renamed. Not used for a list."},"phone":{"type":"string","description":"The phone number for a person this step creates: a fixed value or a flow value reference. Used only when the person is created; existing people's numbers are not changed. Not used for a list."},"title":{"type":"string","description":"The job title for a person this step creates, matched to your organization's titles (added when it is new): a fixed value or a flow value reference. Used only when the person is created; existing people's titles are not changed. Not used for a list."},"customFields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"},"description":"Custom user fields for the person, one flow value reference or fixed value per field key. A value replaces the saved one, for a new person and for someone who already exists. A blank value leaves the saved one unchanged. For a list, each field is its own column: one value is not copied to every person. A key that isn't a custom user field is skipped. A field your directory manages is left unchanged, and the person is still added. Name, phone, title and persona apply only when a person is created."}},"required":["roleId","email"],"additionalProperties":false},"StepConfig_ADD_ROLE":{"type":"object","properties":{"addRole":{"description":"Makes one role per row of a list while the flow runs. Each role is named from `nameColumn`, gets the person in `emailColumn`, copies the settings of `setupRoleId`, and takes that role's place wherever it does, reviews or prepares a later action.","$ref":"#/components/schemas/StepConfig_ADD_ROLE_addRole"},"visibleToAllAssignees":{"type":"boolean"},"blockOnFailure":{"type":"boolean","description":"Whether a failure stops the flow (\"Block the workflow if this step fails\"). `false` lets the flow continue past it; the failure is still recorded. Stops it when left out."},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"}},"title":"Add Role","description":"Makes one role per row of a list while the flow runs. Each role copies the settings of a setup role and takes its place on the actions that role does, reviews or prepares.\n\nThe settings a template read (`GET /v1/templates/{id}`) returns for this type, as stored. The shared settings (due date, reminders, visibility, monitors) can appear alongside them. To set them in a change, send `StepSettings_ADD_ROLE`: where this shape holds an id, a change can name a role, field or step by its name or handle.\n\n**Offered by plan:** available when the organization's plan includes `addRole`.","x-moxo-step-type":"ADD_ROLE","x-moxo-category":"AUTOMATION","x-moxo-plan-feature":"addRole"},"StepConfig_ADD_ROLE_addRole":{"type":"object","properties":{"source":{"type":"string","description":"The list to read, as one reference: a table on an earlier form, the records of a Look up a record step, or a list output."},"nameColumn":{"type":"string","description":"The column whose value names each role, for example \"Entity name\". Leave it empty for a list of plain text."},"nameColumnId":{"type":"string","description":"The permanent id of `nameColumn`. Set by the server when the template is saved; do not send it."},"emailColumn":{"type":"string","description":"The column with each row's email. Leave it empty to fill the roles later with an Assign role step."},"emailColumnId":{"type":"string","description":"The permanent id of `emailColumn`. Set by the server when the template is saved; do not send it."},"setupRoleId":{"type":"string","description":"The template role every created role copies its settings from. Put this role on who does, reviews or prepares the later actions the created roles should take. Nobody holds this role itself, so it is never filled at start or named in text."},"newPeopleAs":{"type":"string","enum":["external","internal"],"description":"How a person new to the organization joins: `external` (the default) or `internal`, a team member. Someone already in the organization keeps who they are."},"personaId":{"type":"string","description":"The persona given to a person this step creates. Required when `newPeopleAs` is `internal`: an internal Orchestrator persona, never Owner or Admin. Omit it for external people to use the organization's default."},"oneRolePerPerson":{"type":"boolean","description":"When true, rows with the same email share one role, named from the first row. Rows with no email stay one role each. Leave it out, or set it to false, for one role per row."}},"required":["source","nameColumn","setupRoleId"],"additionalProperties":false},"StepConfig_UPDATE_USER":{"type":"object","properties":{"updateUser":{"description":"Who to update, and the name, personas, and custom user fields to write. `personRef` is a role, or an email or unique ID from earlier in the flow. A blank value leaves that field as it is. This step does not create a person or a field. Personas are only added.","$ref":"#/components/schemas/StepConfig_UPDATE_USER_updateUser"},"visibleToAllAssignees":{"type":"boolean"},"blockOnFailure":{"type":"boolean","description":"Whether a failure stops the flow (\"Block the workflow if this step fails\"). `false` lets the flow continue past it; the failure is still recorded. Stops it when left out."},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"}},"title":"Update user","description":"Changes one person's name, personas, and existing custom user fields. The new values can be typed, or taken from an earlier step. Personas are only added.\n\nThe settings a template read (`GET /v1/templates/{id}`) returns for this type, as stored. The shared settings (due date, reminders, visibility, monitors) can appear alongside them. To set them in a change, send `StepSettings_UPDATE_USER`: where this shape holds an id, a change can name a role, field or step by its name or handle.\n\n**Offered by plan:** available when the organization's plan includes `updateUser`.","x-moxo-step-type":"UPDATE_USER","x-moxo-category":"AUTOMATION","x-moxo-plan-feature":"updateUser"},"StepConfig_UPDATE_USER_updateUser":{"type":"object","properties":{"personRef":{"type":"string","description":"The one person this step updates: a role, or an email or unique ID from earlier in the flow. If more than one person is on that role when the step runs, the step fails and changes no one. Put the step in a For each to update each of them."},"name":{"type":"string","description":"The person's name in your organization. Leave it out to keep the current name. A blank value leaves the name as it is."},"fields":{"type":"array","items":{"type":"object","properties":{"fieldKey":{"type":"string","description":"The key of an existing custom user field. This step does not create fields."},"value":{"type":"string","description":"The value to write. Type it, or take it from an earlier step. A blank value leaves the field as it is."}},"required":["fieldKey","value"],"additionalProperties":false},"description":"The existing custom user fields to update. The same field twice is refused. A blank value leaves that field as it is."},"personas":{"type":"array","items":{"type":"object","properties":{"personaId":{"type":"string","description":"The persona to add. An external persona, or an internal persona that is not an Orchestrator persona. Never your organization's Owner or Admin persona."}},"required":["personaId"],"additionalProperties":false},"description":"Personas to add for this person. This step only adds. A persona the person already holds is left as is. An empty list changes no persona."}},"additionalProperties":false},"StepConfig_START_FLOW":{"type":"object","properties":{"startFlow":{"description":"The start-a-flow settings. The step starts another flow and this flow continues at once.","$ref":"#/components/schemas/StepConfig_START_FLOW_startFlow"},"approveBeforeRun":{"type":"boolean","description":"Whether a person approves the values this step is about to use before it runs. Available on `REST_API`, `EXTERNAL_APP`, `MCP_SERVER`, `SYSTEM_EMAIL`, `SEND_ANNOUNCEMENT`, `SEND_TO_CONVERSATION`, `SYSTEM_WEBHOOK`, `DATA_TABLE_SAVE_RECORD`, `START_FLOW`, `SCHEDULE_FLOW`, `CODE`, `COLLECT_PAYMENT`, `DOCUSIGN` and `ADOBE_SIGN` steps. When `true`, the step pauses before it calls, sends, writes, starts or schedules anything, until someone approves. Set who approves in the step's `reviewers`: a step with approval on and no approver can't be published."},"approvalRejectMode":{"type":"string","enum":["skip","halt"],"description":"What a rejection does, with `approveBeforeRun`. `skip` (the default) skips this step and the flow continues; `halt` stops the flow."},"reviewers":{"anyOf":[{"type":"object","properties":{"participants":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["AI","HUMAN"]},"roleId":{"type":"string","description":"For a person: the role that takes this seat, by its id."},"contactId":{"type":"string","description":"An external user named on the seat, by the `usr_` id the template read shows. `null` follows the read, as for `userId`."},"userId":{"type":"string","description":"A person named on the seat, by the `usr_` id the template read shows. `null` where the read showed `null` (someone with no id here) keeps the saved person; `null` where it showed an id takes them off the seat."},"agentId":{"type":"string"},"prompt":{"type":"string","description":"The AI participant's step context: instructions for this step only."},"criteria":{"type":"string","description":"For an AI reviewer: what to check. Read before `prompt`."},"context":{"type":"string","description":"An older home of the AI participant's step context, still read. Set `prompt` instead."},"privateNotesGuidance":{"type":"string","maxLength":2000,"description":"When no agent is named: what the AI notes privately for the flow's managers."},"sendBackReply":{"type":"string","enum":["outcome_with_reason","outcome_only"],"description":"When the AI sends work back and no agent is named: what the reply says, `outcome_with_reason` or `outcome_only`."},"howToExplain":{"type":"string","maxLength":2000,"description":"When the AI sends work back and no agent is named: how it explains what to fix."},"inputs":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"value":{"type":"string"},"type":{"type":"string","enum":["TEXT","FILE"]}},"required":["name","value"]}},"participantId":{"type":"string","description":"The participant's id on the step. Keep it when sending the seat back; leave it out for a new participant."},"order":{"type":"number","description":"The participant's place in the seat, from 0, when they act one after another."},"aiConfig":{}},"required":["type"],"additionalProperties":{}}},"sequential":{"type":"boolean"},"completion":{"type":"object","properties":{"mode":{"type":"string","enum":["ANY_ONE","ALL"],"description":"`ANY_ONE`: one participant finishing is enough. `ALL`: every participant finishes."}},"required":["mode"],"description":"When the seat is done."},"showToExternalAssignee":{"description":"Advisors only. `true` lets an assignee outside your organization read the recommendation (the call and its reasons), as advice from your organization. Off unless set.","type":"boolean"},"canEditAnswers":{"description":"Reviewers only, on a Form, PDF form or File request step. `true` lets the reviewer whose turn it is edit the submitted answers (on a File request, add and remove its files) during review, in the Moxo app, instead of sending them back. Off unless set.","type":"boolean"},"reviewItemsTogether":{"description":"Reviewers only, on a person's step inside a For each whose items run at the same time. `true` gives the reviewer one list and one notice for every item instead of one review per item; each item keeps its own run and review. With the loop's `syncStepsAcrossIterations` on, the reviewer approves every item at once (`approve_reviews_together`); off, each item is approved on its own. Publish refuses it in a Repeat while, on an \"Approve before it runs\" step, with no person or role reviewing, and in a loop that runs items one at a time. Off unless set.","type":"boolean"}},"required":["participants"]},{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["AI","HUMAN"]},"roleId":{"type":"string"},"contactId":{"type":"string"},"userId":{"type":"string"},"agentId":{"type":"string"},"prompt":{"type":"string"},"criteria":{"type":"string"},"context":{"type":"string"},"privateNotesGuidance":{"type":"string","maxLength":2000},"sendBackReply":{"type":"string","enum":["outcome_with_reason","outcome_only"]},"howToExplain":{"type":"string","maxLength":2000},"inputs":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"value":{"type":"string"},"type":{"type":"string","enum":["TEXT","FILE"]}},"required":["name","value"]}},"ruleKinds":{"maxItems":80,"type":"array","items":{"type":"object","properties":{"rule":{"type":"string","minLength":1,"maxLength":2000},"kind":{"type":"string","enum":["fact","data_match","coverage","visual","judgment"]},"compare":{"type":"object","properties":{"check":{"type":"string","enum":["compare.money_equal","compare.date_after","compare.names_equal","certificate.insured_name_matches","certificate.limit_at_least","kyc.id_name_matches","kyc.birth_date_matches","kyc.dated_within_three_months"]},"against":{"type":"string","enum":["today","value","input"]},"value":{"type":"string","minLength":1,"maxLength":500},"input":{"type":"string","minLength":1,"maxLength":200}},"required":["check","against"]},"document":{"type":"string","minLength":1,"maxLength":200},"sum":{"type":"object","properties":{"fields":{"minItems":2,"maxItems":60,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}}},"required":["fields"]}},"required":["rule","kind"]}},"participantId":{"type":"string"},"order":{"type":"number"},"aiConfig":{}},"required":["type"],"additionalProperties":{}}}]},"visibleToAllAssignees":{"type":"boolean"},"blockOnFailure":{"type":"boolean","description":"Whether a failure stops the flow (\"Block the workflow if this step fails\"). `false` lets the flow continue past it; the failure is still recorded. Stops it when left out."},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"}},"title":"Start a flow","description":"Starts another flow when this step runs. The new flow runs on its own: this flow doesn't wait for it, and canceling this flow doesn't stop it.\n\nThe settings a template read (`GET /v1/templates/{id}`) returns for this type, as stored. The shared settings (due date, reminders, visibility, monitors) can appear alongside them. To set them in a change, send `StepSettings_START_FLOW`: where this shape holds an id, a change can name a role, field or step by its name or handle.\n\n**Offered by plan:** available when the organization's plan includes `startFlow`.","x-moxo-step-type":"START_FLOW","x-moxo-category":"AUTOMATION","x-moxo-plan-feature":"startFlow"},"StepConfig_START_FLOW_startFlow":{"type":"object","properties":{"targetTemplateId":{"type":"string","description":"The id of the template to start a flow from."},"targetTemplateVersionId":{"type":"string","description":"The version of that template the flow starts on. Set by Moxo when this template is published."},"flowNameTemplate":{"type":"string","maxLength":200,"description":"Optional text for the new flow's name. Can include references to values from earlier in the flow."},"flowOwnerRef":{"type":"string","description":"Optional reference to the email of the new flow's owner. When empty, the new flow has this flow's owner."},"inputMappings":{"type":"array","items":{"type":"object","properties":{"targetInputKey":{"type":"string"},"parentRef":{"type":"string"}},"required":["targetInputKey","parentRef"]}},"roleMappings":{"type":"array","items":{"type":"object","properties":{"targetRoleId":{"type":"string"},"parentRef":{"type":"string"}},"required":["targetRoleId","parentRef"]}},"onUnresolvedRequired":{"type":"string","enum":["fail","start_anyway"]}}},"StepConfig_SCHEDULE_FLOW":{"type":"object","properties":{"scheduleFlow":{"description":"Creates a schedule that starts another flow at a later date when this step runs.","$ref":"#/components/schemas/StepConfig_SCHEDULE_FLOW_scheduleFlow"},"approveBeforeRun":{"type":"boolean","description":"Whether a person approves the values this step is about to use before it runs. Available on `REST_API`, `EXTERNAL_APP`, `MCP_SERVER`, `SYSTEM_EMAIL`, `SEND_ANNOUNCEMENT`, `SEND_TO_CONVERSATION`, `SYSTEM_WEBHOOK`, `DATA_TABLE_SAVE_RECORD`, `START_FLOW`, `SCHEDULE_FLOW`, `CODE`, `COLLECT_PAYMENT`, `DOCUSIGN` and `ADOBE_SIGN` steps. When `true`, the step pauses before it calls, sends, writes, starts or schedules anything, until someone approves. Set who approves in the step's `reviewers`: a step with approval on and no approver can't be published."},"approvalRejectMode":{"type":"string","enum":["skip","halt"],"description":"What a rejection does, with `approveBeforeRun`. `skip` (the default) skips this step and the flow continues; `halt` stops the flow."},"reviewers":{"anyOf":[{"type":"object","properties":{"participants":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["AI","HUMAN"]},"roleId":{"type":"string","description":"For a person: the role that takes this seat, by its id."},"contactId":{"type":"string","description":"An external user named on the seat, by the `usr_` id the template read shows. `null` follows the read, as for `userId`."},"userId":{"type":"string","description":"A person named on the seat, by the `usr_` id the template read shows. `null` where the read showed `null` (someone with no id here) keeps the saved person; `null` where it showed an id takes them off the seat."},"agentId":{"type":"string"},"prompt":{"type":"string","description":"The AI participant's step context: instructions for this step only."},"criteria":{"type":"string","description":"For an AI reviewer: what to check. Read before `prompt`."},"context":{"type":"string","description":"An older home of the AI participant's step context, still read. Set `prompt` instead."},"privateNotesGuidance":{"type":"string","maxLength":2000,"description":"When no agent is named: what the AI notes privately for the flow's managers."},"sendBackReply":{"type":"string","enum":["outcome_with_reason","outcome_only"],"description":"When the AI sends work back and no agent is named: what the reply says, `outcome_with_reason` or `outcome_only`."},"howToExplain":{"type":"string","maxLength":2000,"description":"When the AI sends work back and no agent is named: how it explains what to fix."},"inputs":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"value":{"type":"string"},"type":{"type":"string","enum":["TEXT","FILE"]}},"required":["name","value"]}},"participantId":{"type":"string","description":"The participant's id on the step. Keep it when sending the seat back; leave it out for a new participant."},"order":{"type":"number","description":"The participant's place in the seat, from 0, when they act one after another."},"aiConfig":{}},"required":["type"],"additionalProperties":{}}},"sequential":{"type":"boolean"},"completion":{"type":"object","properties":{"mode":{"type":"string","enum":["ANY_ONE","ALL"],"description":"`ANY_ONE`: one participant finishing is enough. `ALL`: every participant finishes."}},"required":["mode"],"description":"When the seat is done."},"showToExternalAssignee":{"description":"Advisors only. `true` lets an assignee outside your organization read the recommendation (the call and its reasons), as advice from your organization. Off unless set.","type":"boolean"},"canEditAnswers":{"description":"Reviewers only, on a Form, PDF form or File request step. `true` lets the reviewer whose turn it is edit the submitted answers (on a File request, add and remove its files) during review, in the Moxo app, instead of sending them back. Off unless set.","type":"boolean"},"reviewItemsTogether":{"description":"Reviewers only, on a person's step inside a For each whose items run at the same time. `true` gives the reviewer one list and one notice for every item instead of one review per item; each item keeps its own run and review. With the loop's `syncStepsAcrossIterations` on, the reviewer approves every item at once (`approve_reviews_together`); off, each item is approved on its own. Publish refuses it in a Repeat while, on an \"Approve before it runs\" step, with no person or role reviewing, and in a loop that runs items one at a time. Off unless set.","type":"boolean"}},"required":["participants"]},{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["AI","HUMAN"]},"roleId":{"type":"string"},"contactId":{"type":"string"},"userId":{"type":"string"},"agentId":{"type":"string"},"prompt":{"type":"string"},"criteria":{"type":"string"},"context":{"type":"string"},"privateNotesGuidance":{"type":"string","maxLength":2000},"sendBackReply":{"type":"string","enum":["outcome_with_reason","outcome_only"]},"howToExplain":{"type":"string","maxLength":2000},"inputs":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"value":{"type":"string"},"type":{"type":"string","enum":["TEXT","FILE"]}},"required":["name","value"]}},"ruleKinds":{"maxItems":80,"type":"array","items":{"type":"object","properties":{"rule":{"type":"string","minLength":1,"maxLength":2000},"kind":{"type":"string","enum":["fact","data_match","coverage","visual","judgment"]},"compare":{"type":"object","properties":{"check":{"type":"string","enum":["compare.money_equal","compare.date_after","compare.names_equal","certificate.insured_name_matches","certificate.limit_at_least","kyc.id_name_matches","kyc.birth_date_matches","kyc.dated_within_three_months"]},"against":{"type":"string","enum":["today","value","input"]},"value":{"type":"string","minLength":1,"maxLength":500},"input":{"type":"string","minLength":1,"maxLength":200}},"required":["check","against"]},"document":{"type":"string","minLength":1,"maxLength":200},"sum":{"type":"object","properties":{"fields":{"minItems":2,"maxItems":60,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}}},"required":["fields"]}},"required":["rule","kind"]}},"participantId":{"type":"string"},"order":{"type":"number"},"aiConfig":{}},"required":["type"],"additionalProperties":{}}}]},"visibleToAllAssignees":{"type":"boolean"},"blockOnFailure":{"type":"boolean","description":"Whether a failure stops the flow (\"Block the workflow if this step fails\"). `false` lets the flow continue past it; the failure is still recorded. Stops it when left out."},"skipAssignNotification":{"description":"Skips this action's first Action assigned notice. Leave it out or set it to false to send the notice. Used only while Per-action assignment notice is on for the organization. A review still sends. A resend because the action changed stays quiet.","type":"boolean"}},"title":"Schedule a flow","description":"Creates a schedule that starts another flow at a later date, once or repeating, using values collected earlier in this flow, such as a start date and frequency someone gave.\n\nThe settings a template read (`GET /v1/templates/{id}`) returns for this type, as stored. The shared settings (due date, reminders, visibility, monitors) can appear alongside them. To set them in a change, send `StepSettings_SCHEDULE_FLOW`: where this shape holds an id, a change can name a role, field or step by its name or handle.\n\n**Offered by plan:** available when the organization's plan includes `scheduleFlow`.","x-moxo-step-type":"SCHEDULE_FLOW","x-moxo-category":"AUTOMATION","x-moxo-plan-feature":"scheduleFlow"},"StepConfig_SCHEDULE_FLOW_scheduleFlow":{"type":"object","properties":{"targetTemplateId":{"type":"string","description":"The id of the template to start."},"frequencyMode":{"type":"string","enum":["once","recurring"],"description":"`once` or `recurring`, set when the template is built; it can't come from flow data. Defaults to `once`."},"startDate":{"type":"string","description":"A fixed start date (`YYYY-MM-DD`). For `once`."},"startDateRef":{"type":"string","description":"A reference to a date field from earlier in the flow. For `once`."},"fireHour":{"type":"integer","minimum":0,"maximum":23,"description":"The hour it starts (0 to 23), in the schedule's time zone. Defaults to 9. For `once`."},"fireMinute":{"type":"integer","minimum":0,"maximum":59,"description":"The minute it starts (0 to 59), in the schedule's time zone. Defaults to 0. For `once`."},"kind":{"type":"string","enum":["cron","weekdays_before_eom"],"description":"How it repeats, for `recurring`."},"cronPattern":{"type":"string","description":"A cron expression, when `kind` is `cron`."},"kindParams":{"type":"object","properties":{"n":{"type":"integer","minimum":0,"maximum":23},"hour":{"type":"integer","minimum":0,"maximum":23},"minute":{"type":"integer","minimum":0,"maximum":59}},"required":["n","hour","minute"],"description":"Settings for `kind` `weekdays_before_eom`."},"timezone":{"type":"string"},"scheduleNameTemplate":{"type":"string","maxLength":200},"roleMappings":{"type":"array","items":{"type":"object","properties":{"targetRoleId":{"type":"string"},"parentRef":{"type":"string"}},"required":["targetRoleId","parentRef"]}},"inputMappings":{"type":"array","items":{"type":"object","properties":{"targetInputKey":{"type":"string"},"parentRef":{"type":"string"}},"required":["targetInputKey","parentRef"]}},"onUnresolvedRequired":{"type":"string","enum":["fail","start_anyway"]}}},"ViewerTurn":{"type":["string","null"],"enum":["executor","preparer","reviewer",null],"description":"Whether this waits on you now, and for what: `executor` (you do it), `preparer` (you prepare it) or `reviewer` (you review it). `null` when it does not wait on you: it is someone else's turn, you prepare or review after someone who has not finished, your part is done, or the flow is paused. Always `null` for an Org API Key, which has no person behind it. It is the same answer the app uses to show you the button for your part.","example":"reviewer"},"ViewerManages":{"type":"boolean","description":"Whether you manage it. On an action: you sent it, or you manage the conversation it was sent in. On a flow's step: you manage the flow. Always `false` for an Org API Key, which has no person behind it.","example":false},"Persona":{"type":"object","properties":{"id":{"type":"string","description":"The persona's id.","example":"persona_acme_portal"},"name":{"type":"string","description":"The persona's name.","example":"Acme Portal User"},"access":{"type":"string","enum":["orchestrator_portal","portal","magic_link"],"description":"Where people with this persona work: `orchestrator_portal`, your organization's orchestrator portal; `portal`, a named portal (see `portal`); or `magic_link`, magic links and the Activity timeline only, with no portal.","example":"portal"},"userType":{"type":"string","enum":["internal","external"],"description":"Whether this persona is for internal users or external users. It never changes for a persona.","example":"external"},"portal":{"type":["object","null"],"properties":{"id":{"type":"string","description":"The portal's id.","example":"portal_acme"},"name":{"type":"string","description":"The portal's name.","example":"Acme Customer Portal"}},"required":["id","name"],"additionalProperties":false,"description":"The portal this persona uses, when `access=portal`; `null` for `orchestrator_portal` and `magic_link`."},"permissionGroupId":{"type":["string","null"],"description":"The permission group whose capabilities people with this persona get, when `access=orchestrator_portal` (`GET /v1/permission-groups`); `null` otherwise.","example":null}},"required":["id","name","access","userType","portal","permissionGroupId"],"additionalProperties":false},"PermissionGroup":{"type":"object","properties":{"id":{"type":"string","description":"The permission group's id."},"name":{"type":"string","description":"The group's name.","example":"Reviewers"},"description":{"type":["string","null"],"description":"What the group is for."},"isSystem":{"type":"boolean","description":"`true` for the built-in Owner, Admin and Member groups, which can't be deleted."},"systemKey":{"type":["string","null"],"enum":["owner","admin","member",null],"description":"Which built-in group this is, or `null` for one your organization made."},"bundles":{"type":"array","items":{"type":"string"},"description":"The capability bundles the group grants in full, as the Permission groups page shows them (`run.start_flows`, `manage.invite_external`, …)."},"capabilities":{"type":"object","additionalProperties":{"type":"boolean"},"description":"Every capability and whether the group grants it."}},"required":["id","name","description","isSystem","systemKey","bundles","capabilities"],"additionalProperties":false},"ReportSummary":{"type":"object","properties":{"workspace":{"type":"object","properties":{"new":{"type":"integer","description":"Flows started in the last 7 days.","example":12},"inProgress":{"type":"integer","description":"Flows whose status is `IN_PROGRESS` now.","example":47},"completed":{"type":"integer","description":"Flows completed in the last 7 days.","example":19},"due":{"type":"integer","description":"Flows due in the next 7 days.","example":8}},"required":["new","inProgress","completed","due"],"description":"Flow counts for the dashboard's summary card. Each is measured over its own window, so they overlap: `new` also counts flows in `inProgress` and `completed`. Don't add them up; for a breakdown, use `statusDistribution`."},"statusDistribution":{"type":"object","properties":{"inProgress":{"type":"integer","description":"Flows whose status is `IN_PROGRESS`.","example":47},"paused":{"type":"integer","description":"Flows whose status is `PAUSED`: a flow manager paused them.","example":2},"completed":{"type":"integer","description":"Flows whose status is `COMPLETED`.","example":128},"cancelled":{"type":"integer","description":"Flows whose status is `CANCELLED`.","example":6},"total":{"type":"integer","description":"The four counts added together.","example":183}},"required":["inProgress","paused","completed","cancelled","total"],"description":"Every flow you can see, by its status now, over all time. A flow has exactly one status, so the four counts don't overlap and add up to `total`. The `range` filter doesn't apply."},"actions":{"type":"object","properties":{"yourTurn":{"type":"integer","description":"Steps waiting on the caller as their assignee. `0` for an organization API key, which is not a person.","example":3},"dueToday":{"type":"integer","description":"Steps due today that are assigned to the caller, or to anyone in the organization for an organization API key.","example":1},"overdue":{"type":"integer","description":"Steps past their due date.","example":2},"dueSoon":{"type":"integer","description":"Steps due in the next 48 hours.","example":4}},"required":["yourTurn","dueToday","overdue","dueSoon"],"description":"What the caller needs to do next."},"progress":{"type":"object","properties":{"completionRate":{"type":"number","description":"The percentage of flows started in the last 30 days that have completed, from 0 to 100.","example":73.5},"avgCompletionDays":{"type":"string","description":"Average time from start to completion, as readable text.","example":"5 days"},"activeTemplates":{"type":"integer","description":"Templates that started a flow in the last 30 days.","example":7},"totalFlows":{"type":"integer","description":"Every flow this organization has started.","example":1842},"weeklyTrend":{"type":"array","items":{"type":"number"},"description":"Flows completed on each of the last 7 days, Monday to Sunday.","example":[3,5,2,8,6,4,1]}},"required":["completionRate","avgCompletionDays","activeTemplates","totalFlows","weeklyTrend"],"description":"Trends for the dashboard's chart and summary tiles."}},"required":["workspace","statusDistribution","actions","progress"],"additionalProperties":false},"SlaCompliance":{"type":"object","properties":{"overall":{"type":"object","properties":{"totalCompleted":{"type":"integer","description":"Steps completed in the window, including those with no due date.","example":412},"stepsWithDue":{"type":"integer","description":"Completed steps that had a due date: what `complianceRate` is a percentage of. A step with no due date can't be on time or late, so it counts in `totalCompleted` but not here.","example":318},"onTime":{"type":"integer","description":"Steps with a due date that were not marked as breaching it.","example":291},"breached":{"type":"integer","description":"Steps with a due date that were marked as breaching it.","example":27},"complianceRate":{"type":["number","null"],"description":"The whole-number percentage of `stepsWithDue` that were on time. `null` when no step in the window had a due date: nothing was due, so there is no rate.","example":91}},"required":["totalCompleted","stepsWithDue","onTime","breached","complianceRate"],"additionalProperties":false},"templateBreakdown":{"type":"array","items":{"type":"object","properties":{"templateName":{"type":"string","example":"Customer Onboarding"},"templateId":{"type":"string","example":"tpl_9f2c"},"totalSteps":{"type":"integer","description":"Steps from this template completed in the window.","example":96},"avgCompletionMs":{"type":"number","description":"Mean time to complete a step of this template, in milliseconds.","example":43200000},"avgCompletionFormatted":{"type":"string","description":"The same figure rendered for display.","example":"12h"},"breachRate":{"type":"number","description":"The percentage of this template's steps with a due date that missed it.","example":8.3},"bottleneckStep":{"type":["string","null"],"description":"The step with the highest average time in this template, or null when no step recorded a duration. For the steps in order, use `/v1/reports/bottlenecks`.","example":"Review proposal"}},"required":["templateName","templateId","totalSteps","avgCompletionMs","avgCompletionFormatted","breachRate","bottleneckStep"],"additionalProperties":false},"description":"One row per template, highest `breachRate` first."}},"required":["overall","templateBreakdown"],"additionalProperties":false},"TemplatePerformance":{"type":"object","properties":{"templateId":{"type":"string","description":"The template's id.","example":"tpl_onboarding_v3"},"templateName":{"type":"string","example":"Customer Onboarding"},"flowsInPeriod":{"type":"integer","description":"Flows started in the selected period.","example":142},"completed":{"type":"integer","description":"Flows started in the selected period that are now `COMPLETED`.","example":119},"completionRate":{"type":"number","description":"The percentage of flows started in the selected period that completed.","example":84},"avgCycleTimeMs":{"type":"number","description":"Average time from start to completion, in milliseconds.","example":362880000},"previousAvgCycleTimeMs":{"type":"number","description":"The same average for the period before, in milliseconds.","example":388800000},"onTimeRate":{"type":["number","null"],"description":"The share of steps with a due date that were completed on time, or null when none had a due date.","example":92},"slaCompliance":{"type":"number","description":"The SLA compliance percentage.","example":92},"bottleneckStep":{"type":["object","null"],"properties":{"name":{"type":"string"},"avgDurationMs":{"type":"number"}},"required":["name","avgDurationMs"],"additionalProperties":false,"description":"The slowest step by average time, or null when no step recorded a duration."},"completionRateTrend":{"type":"array","items":{"type":"number"},"description":"The completion percentage for each part of the selected period."},"totalFlows":{"type":"integer","description":"Flows in the selected period, leaving out sample, sandbox and deleted flows.","example":142},"completedFlows":{"type":"integer","description":"Completed flows in the selected period, leaving out sample, sandbox and deleted flows.","example":119},"avgCycleTimeDays":{"type":["number","null"],"description":"Average days from a flow's start to its completion. Null when no flow completed.","example":4.2},"overdueCount":{"type":"integer","description":"Running flows that are past their due date.","example":3}},"required":["templateId","templateName","flowsInPeriod","completed","completionRate","avgCycleTimeMs","previousAvgCycleTimeMs","onTimeRate","slaCompliance","bottleneckStep","completionRateTrend"],"additionalProperties":false},"Bottleneck":{"type":"object","properties":{"rowKey":{"type":"string","description":"An id for this row that doesn't change. Use it as the row's key, including for any state your UI keeps per row. Don't parse it: its format differs between the ranking by name and the `byStepType` grouping, and may change.","example":"step:[\"tpl_9f2c\",\"step_4a\"]"},"stepName":{"type":"string","description":"The step's name in the template.","example":"Review proposal"},"stepId":{"type":["string","null"],"description":"The step's id in the template. Null when the row totals a step type rather than one step.","example":"step_upload_kyc"},"templateName":{"type":"string","example":"Customer Onboarding"},"templateId":{"type":"string","example":"tpl_9f2c"},"population":{"type":"string","enum":["human","ai","automation","externalWait"],"description":"What kind of work this step is. Compare durations only within one kind: a person taking two days and an integration taking two seconds measure different things.","example":"human"},"durationCount":{"type":"integer","description":"How many occurrences the average duration is taken over. This differs from `occurrences`, because a run still in progress has no duration yet. To combine rows, weight each average by its `durationCount`, not by `occurrences`.","example":138},"stepType":{"type":["string","null"],"description":"The step type, such as `APPROVAL`, `FORM` or `DOCUSIGN`, so you can group results by kind of step instead of by name. A step name belongs to one template; the type shows whether, for example, approvals are slow everywhere. Null for a run recorded before step types were recorded: group those as \"Unknown\" rather than dropping them, or every other row's share of the total is wrong. Which measurements apply depends on the type.","example":"APPROVAL"},"avgDurationMs":{"type":"number","description":"The average time spent in the step over the report's period, in milliseconds.","example":102240000},"avgDurationFormatted":{"type":"string","description":"The same figure as readable text.","example":"1.2d"},"occurrences":{"type":"integer","description":"Runs of the step counted in the average.","example":142},"breachCount":{"type":"integer","description":"Runs that finished after their due date.","example":11},"failureCount":{"type":"integer","description":"Runs that failed.","example":3},"failureRate":{"type":"number","description":"The share of runs that failed, from 0 to 1. Automations are ranked by it, because a failing integration matters more than a slow one.","example":0.02},"avgTimeToOpenMs":{"type":["number","null"],"description":"Average time from the step becoming available to its first opening. Null when no occurrence recorded a view, which is different from zero.","example":86400000},"avgTimeToFinishMs":{"type":["number","null"],"description":"Average time from the first opening to done.","example":15840000},"avgPrepareMs":{"type":["number","null"],"description":"Average time spent preparing the step. Null, not `0`, when the step has no preparer.","example":null},"avgWorkMs":{"type":["number","null"],"example":72000000},"avgReviewMs":{"type":["number","null"],"description":"Average time from the assignee's submission to the last reviewer finishing. Null when no reviewer completed.","example":30240000},"splitCoverage":{"type":"object","properties":{"measured":{"type":"integer","description":"Occurrences whose time could be split into waiting and working.","example":130},"completedWithoutBeingOpened":{"type":"integer","description":"Occurrences finished with no recorded view, so their time can't be split into waiting and working.","example":12}},"required":["measured","completedWithoutBeingOpened"],"additionalProperties":false},"medianDurationMs":{"type":["number","null"],"description":"The median duration. When it is far from the average, a few slow occurrences are pulling the average up. Null with fewer than two measured occurrences.","example":43200000},"p90DurationMs":{"type":["number","null"],"description":"9 in 10 occurrences finished within this time. Null with fewer than two measured occurrences.","example":259200000},"longestDurationMs":{"type":["number","null"],"description":"The slowest single occurrence in the period. Null when no occurrence was measured.","example":604800000},"avgReminders":{"type":["number","null"],"description":"Reminders sent per occurrence. Null when no occurrence recorded any.","example":2.4},"remindedOccurrences":{"type":"integer","description":"Occurrences that needed at least one reminder. With `avgReminders`, it shows how often this step needs chasing apart from how hard each one is to close.","example":34},"avgReruns":{"type":["number","null"],"description":"Re-runs per occurrence, counting only re-runs performed by a person. Automatic resumes are excluded. Zero, not null, when no occurrence was re-run.","example":2.4},"rerunOccurrences":{"type":"integer","description":"Occurrences a person had to re-run at least once.","example":6},"avgBeforeModelMs":{"type":["number","null"],"description":"For an AI step: the time from the step starting to the model being called, covering both waiting in line and setup (filling in dynamic data, preparing files). With `avgModelMs`, it shows whether a slow AI step is slow because of the model or because of everything around it. Null when no occurrence could be timed.","example":27000},"avgModelMs":{"type":["number","null"],"description":"For an AI step: the model's own work. Null when no occurrence could be timed.","example":7000},"modelTimingCoverage":{"type":"object","properties":{"measured":{"type":"integer","description":"Occurrences the split covers.","example":30},"total":{"type":"integer","description":"Occurrences counted in this row.","example":34}},"required":["measured","total"],"additionalProperties":false,"description":"How many occurrences the split between `avgBeforeModelMs` and `avgModelMs` covers. An occurrence with no timing record can't be split, so when the two counts differ, the split describes only some occurrences."},"escalatedCount":{"type":"integer","description":"Occurrences where someone beyond the assignee had to be brought in, either because the occurrence ran past its deadline or because the AI agent escalated it. Both mean the occurrence did not finish on its own.","example":4},"totalCredits":{"type":["number","null"],"description":"AI credits this step used in the period. Null, not `0`, when no occurrence recorded any credits, so unmeasured is distinguishable from free.","example":182},"avgCredits":{"type":["number","null"],"description":"AI credits per occurrence that recorded any.","example":6},"creditsCoverage":{"type":"object","properties":{"measured":{"type":"integer","description":"Occurrences the credit figure covers.","example":30},"total":{"type":"integer","description":"Occurrences counted in this row.","example":34}},"required":["measured","total"],"additionalProperties":false,"description":"How many occurrences the credit figure covers. When the two counts differ, the figure is a partial total."},"waitingOn":{"type":["string","null"],"enum":["EXTERNAL_APP_EVENT","EXTERNAL_TASK","CONNECTED_APP_EVENT","DATA_TABLE_VALUE","CONDITION_RECHECK","MEETING_TRANSCRIPT",null],"description":"What an external wait is waiting for. Null for every other kind of work.","example":"CONNECTED_APP_EVENT"},"assignees":{"type":"array","items":{"type":"string"},"description":"The names of the people who completed these occurrences.","example":["Sarah Chen"]}},"required":["rowKey","stepName","templateName","templateId","population","durationCount","stepType","avgDurationMs","avgDurationFormatted","occurrences","breachCount","failureCount","failureRate","avgTimeToOpenMs","avgTimeToFinishMs","avgPrepareMs","avgWorkMs","avgReviewMs","splitCoverage","medianDurationMs","p90DurationMs","longestDurationMs","avgReminders","remindedOccurrences","avgReruns","rerunOccurrences","avgBeforeModelMs","avgModelMs","modelTimingCoverage","escalatedCount","totalCredits","avgCredits","creditsCoverage","waitingOn","assignees"],"additionalProperties":false},"StepPerformanceReport":{"type":"object","properties":{"human":{"type":"array","items":{"$ref":"#/components/schemas/Bottleneck"}},"ai":{"type":"array","items":{"$ref":"#/components/schemas/Bottleneck"}},"automation":{"type":"array","items":{"$ref":"#/components/schemas/Bottleneck"}},"externalWait":{"type":"array","items":{"$ref":"#/components/schemas/Bottleneck"}},"byStepType":{"type":"object","properties":{"human":{"type":"array","items":{"$ref":"#/components/schemas/Bottleneck"}},"ai":{"type":"array","items":{"$ref":"#/components/schemas/Bottleneck"}},"automation":{"type":"array","items":{"$ref":"#/components/schemas/Bottleneck"}},"externalWait":{"type":"array","items":{"$ref":"#/components/schemas/Bottleneck"}}},"required":["human","ai","automation","externalWait"],"additionalProperties":false,"description":"The same four kinds of work, grouped by step type instead of by step name. A step name belongs to one template, so a ranking by name can't show whether approvals are slow everywhere; this grouping can. Each row names the step type in `stepName` and totals every measured step of that type in the period, not only the ten listed above. `stepType` is null for runs recorded before step types were recorded."},"composition":{"type":"object","properties":{"humanMs":{"type":"number"},"aiMs":{"type":"number"},"automationMs":{"type":"number"},"externalWaitMs":{"type":"number"},"flowCount":{"type":"integer","description":"Flows the totals are spread across","example":128}},"required":["humanMs","aiMs","automationMs","externalWaitMs","flowCount"],"additionalProperties":false,"description":"Total time spent on each kind of work. This is the one figure you can compare across kinds: it shows whether a process is slowed by people or by integrations."},"populationsPresent":{"type":"array","items":{"type":"string","enum":["human","ai","automation","externalWait"]},"description":"The kinds of work the template contains, taken from its steps rather than from the rows. A kind listed here with an empty list above ran nothing in the period, which can mean an integration has stopped: it produces no rows at all.","example":["human","automation"]},"endToEnd":{"type":"object","properties":{"completedFlowCount":{"type":"integer","description":"How many of the flows counted in `composition.flowCount` have finished. Always part of that count, never the organization's total of completed flows.","example":42},"avgTotalMs":{"type":["number","null"],"description":"Average start-to-finish time across those flows. Null when none of them finished.","example":535680000},"medianTotalMs":{"type":["number","null"],"description":"Typical start-to-finish time across those flows. Null below two of them.","example":432000000}},"required":["completedFlowCount","avgTotalMs","medianTotalMs"],"additionalProperties":false,"description":"Start-to-finish time for those of the flows above that have finished. It has its own count because a flow still running can add step time, so the two counts differ. It covers the flows this report measured, not every flow that completed in the period: for that, read `avgCycleTimeDays` (when present) on `GET /v1/reports/flows/performance`."},"coverage":{"type":"object","properties":{"measured":{"type":"integer"},"completedWithoutBeingOpened":{"type":"integer"}},"required":["measured","completedWithoutBeingOpened"],"additionalProperties":false,"description":"How many occurrences of steps done by people have their time split into waiting and working. The ones that can't be split are counted here rather than dropped."}},"required":["human","ai","automation","externalWait","byStepType","composition","populationsPresent","endToEnd","coverage"],"additionalProperties":false},"TemplatePerformanceResponse":{"type":"object","properties":{"templates":{"type":"array","items":{"$ref":"#/components/schemas/TemplatePerformance"},"description":"Performance for every template in the organization, or for the one named by `templateId`."},"drillDown":{"type":"object","additionalProperties":{},"description":"A breakdown by step for one template, present only when the request names a `templateId`: `{ stepTimings, completionFunnel, cycleTimeDistribution }`."}},"required":["templates"]},"ReportCatalog":{"type":"object","properties":{"entities":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"description":{"type":"string"},"metrics":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"description":{"type":"string"},"format":{"type":"string","enum":["number","percentage","duration"],"description":"How to render the number."},"aggregation":{"type":"string","enum":["count","avg","sum","min","max","ratio","percentile"]},"pointInTime":{"type":"boolean","description":"True when a date range doesn't narrow this figure, as with \"flows in progress now\"."},"forwardWindowDays":{"type":"integer","description":"Set when the figure covers a fixed forward window of this many days."},"composite":{"type":"boolean","description":"True when this metric is combined from other metrics in the catalog, such as a health score."},"groupableDimensions":{"type":"array","items":{"type":"string"},"description":"Dimensions this metric may be grouped by, when narrower than the entity's full list. Absent means all of them."},"thresholds":{"type":"object","properties":{"warning":{"type":"number"},"critical":{"type":"number"},"direction":{"type":"string","enum":["above","below"]}},"additionalProperties":false}},"required":["key","label","description","format","aggregation","pointInTime","composite"],"additionalProperties":false}},"dimensions":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"description":{"type":"string"},"cardinality":{"type":"string","enum":["low","medium","high"],"description":"How many distinct values the dimension has, as a chart hint: `low` suits a bar chart, `high` a table."},"source":{"type":"string","enum":["catalog","custom_field"]},"domain":{"type":"array","items":{"type":"string"},"description":"Every value this dimension can have, in order, when the list is fixed."},"time":{"type":"object","properties":{"grain":{"type":"string","enum":["day","week","month","quarter"],"description":"The length of each period."},"anchor":{"type":"string","enum":["started","completed"],"description":"Which date of the record the period is taken from."}},"required":["grain","anchor"],"additionalProperties":false,"description":"Present when this dimension groups by a date: the period and which date it is taken from."}},"required":["key","label","description","cardinality","source"],"additionalProperties":false}},"filters":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","enum":["string","string[]","boolean","dateRange","number"]},"enumValues":{"type":"array","items":{"type":"string"}}},"required":["key","label","type"],"additionalProperties":false}},"timeAnchors":{"type":"array","items":{"type":"string","enum":["started","completed","resolved","due","activated","cancelled"]},"description":"Values `spec.when` may take for this entity."},"list":{"type":"object","properties":{"supported":{"type":"boolean"},"sortColumns":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"}},"required":["key","label"],"additionalProperties":false},"description":"`list.sortBy` allowlist. Empty when `supported` is false."}},"required":["supported","sortColumns"],"additionalProperties":false}},"required":["key","label","description","metrics","dimensions","filters","timeAnchors","list"],"additionalProperties":false},"description":"Entities the caller may report on. An entity with no metrics, or no readable data for this caller, is omitted."},"modes":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","enum":["standard","cohort","funnel"]},"requiresTemplateId":{"type":"boolean"}},"required":["key","requiresTemplateId"],"additionalProperties":false},"description":"`spec.mode` values, with the condition each one imposes."},"compare":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","enum":["previous_period","year_over_year","custom"]},"requiresBaselinePeriod":{"type":"boolean"}},"required":["key","requiresBaselinePeriod"],"additionalProperties":false},"description":"`spec.compare.type` values, with the condition each one imposes."},"defaultTimeAnchor":{"type":"string","enum":["started","completed","resolved","due","activated","cancelled"],"description":"The anchor applied when `spec.when` is absent."},"specFilterKeys":{"type":"array","items":{"type":"string"},"description":"Every filter key `spec.filters` accepts. This is wider than any one entity's `filters`: `dateRange`, `assignedToMe` and `allTime` apply to every entity."},"limits":{"type":"object","properties":{"minMetrics":{"type":"integer"},"maxMetrics":{"type":"integer"},"maxDimensions":{"type":"integer"},"maxListRows":{"type":"integer","description":"The most `list.limit` can be: how many individual records a list spec can ask for."}},"required":["minMetrics","maxMetrics","maxDimensions","maxListRows"],"additionalProperties":false,"description":"Limits a request must stay within."}},"required":["entities","modes","compare","defaultTimeAnchor","specFilterKeys","limits"],"additionalProperties":false},"ReportQueryResponse":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","description":"The request spec's own `key`, when it set one, so you can match each result to its spec."},"entity":{"type":"string"},"metricValues":{"type":"object","additionalProperties":{"type":["number","null"]}},"comparisonValues":{"type":"object","additionalProperties":{"type":["number","null"]},"description":"Present only when the spec set `compare`: the comparison period's values for the same metrics."},"dimensionalData":{"type":"array","items":{"type":"object","properties":{"dimensions":{"type":"object","additionalProperties":{"type":"string"},"description":"The group's key: one entry per requested dimension, or per correlation axis keyed by the axis heading. On a time axis the value is a date; on a value axis it is the value as recorded."},"values":{"type":"object","additionalProperties":{"type":["number","null"]},"description":"One entry per metric key, or per correlation measure. `null` when this group has no value for that measure; on a correlation, that is the side with no row."},"grades":{"type":"object","additionalProperties":{},"description":"Present only for a composite metric: for this group, why the score is what it is, or why there is none."},"match":{"type":"string","enum":["exact","tolerance","unmatched","ambiguous"],"description":"Present only on a correlation with a `temporal-proximity` axis: how this key was matched. `exact`: at the same time. `tolerance`: matched only within `toleranceSeconds`. `unmatched`: nothing in range, so the row keeps its own time as its key. `ambiguous`: two candidates exactly as close, so it was merged into neither."},"matchDeltaSeconds":{"type":["number","null"],"description":"Present whenever `match` is: the time between this row and the row it matched, in seconds, positive when this row is later. `null` for `unmatched` and `ambiguous` rows, and for a key that took in more than one row from one table, which has no single distance."}},"required":["dimensions","values"],"additionalProperties":false},"description":"Present when the spec set `dimensions` (one row per group) or carried a `correlationSpec` (one row per correlated key)."},"rows":{"type":"array","items":{},"description":"Individual records, present only when the spec set `list`."},"rowSets":{"type":"object","additionalProperties":{"type":"array","items":{}},"description":"Present only when a spec, such as one in cohort mode, produced more than one set of rows. Keyed by a query id."},"metricMeta":{"type":"object","additionalProperties":{}},"warnings":{"type":"array","items":{"type":"string"}},"unappliedFilters":{"type":"array","items":{"type":"object","properties":{"filter":{"type":"string","description":"A filter key this spec sets, e.g. `stepName`, `status`, `dateRange`."},"scope":{"type":"string","description":"Where it is not applied: an entity's figure or list (`account.figure`, `person.list`) or a query path (`cohort`, `funnel`, `activity`)."}},"required":["filter","scope"]},"description":"Present when this spec sets a filter its answer does not apply. The answer still runs and its values ignore these filters; `warnings` carries the same in one line each. Drop the filter or ask a metric or list that applies it."},"truncated":{"type":"boolean","enum":[true],"description":"Present when the answer was cut at a limit, so its values cover only part of the records. Narrow the spec for a complete answer."},"metricGrades":{"type":"object","additionalProperties":{},"description":"Present only for a composite metric: why its score is what it is, or why there is none, by metric key."},"error":{"type":"string","description":"Present when this spec, not the whole batch, failed: a malformed spec, a refused entity or a failed query."},"errorKind":{"type":"string","enum":["forbidden","invalid","failed"]},"withheld":{"type":"object","properties":{"reason":{"type":"string"},"minimumSample":{"type":"integer"},"metricKeys":{"type":"array","items":{"type":"string"}},"sampleIsRecordCount":{"type":"boolean"}},"required":["reason","minimumSample","metricKeys","sampleIsRecordCount"],"additionalProperties":false,"description":"Present when a value was withheld because the sample was too small, rather than because the spec failed."},"matchQuality":{"type":"object","properties":{"keys":{"type":"integer","description":"How many distinct keys the correlation matched on."},"exact":{"type":"integer","description":"Keys every source has a row for, matched at exactly the same time or value. On a `temporal-proximity` axis, a row that matched only within the tolerance is counted under `tolerance`, not here."},"tolerance":{"type":"integer","description":"Keys matched only because of a tolerance: a `temporal-proximity` axis matched them to the nearest row within `toleranceSeconds` rather than to an identical key. `0` on a correlation that matches on equal values only."},"unmatched":{"type":"integer","description":"Keys missing from at least one source. With `mode: \"full\"` they are returned as rows with null measures; with `mode: \"left\"`, a key the first source lacks is left out."},"ambiguous":{"type":"integer","description":"Keys that couldn't be matched: on a `temporal-proximity` axis, two candidate rows exactly as close, within the tolerance. Such a row keeps its own time as its key and is returned on its own; neither candidate is picked. `0` on a correlation that matches on equal values only."},"perSource":{"type":"object","additionalProperties":{"type":"object","properties":{"present":{"type":"integer"},"missing":{"type":"integer"}},"required":["present","missing"],"additionalProperties":false},"description":"For each source table id: how many keys that source has a row for, and how many it doesn't. A source with a row whose measure is null counts as present."},"cardinality":{"type":"object","properties":{"declared":{"type":["string","null"]},"observed":{"type":"string"},"violations":{"type":"integer"}},"required":["declared","observed","violations"],"additionalProperties":false},"disclosure":{"type":"string","description":"One plain sentence that sums up the counts above, ready to show to a person."}},"required":["keys","exact","tolerance","unmatched","ambiguous","perSource","cardinality","disclosure"],"additionalProperties":false,"description":"Present on a correlation across tables (a spec with `correlationSpec`). Counted over every key, not only the returned page: the counts are taken before the row limit applies. It has counts and one sentence, never detail for each key."}},"required":["entity","metricValues","dimensionalData","rows","metricMeta","warnings"]},"description":"One result per request spec, in the same order, including specs that failed on their own (see `error` and `errorKind` on each result)."},"computedAt":{"type":"string","description":"When the batch was computed, as an ISO 8601 time.","example":"2026-01-15T10:30:00.000Z"}},"required":["results","computedAt"],"additionalProperties":false},"UploadEnvelope":{"type":"object","properties":{"fileId":{"type":"string","description":"The file's id. Its bytes are stored once the `PUT` to `uploadUrl` succeeds.","example":"a3f1c2e4-5b6d-4e7f-8a9b-0c1d2e3f4a5b"},"uploadUrl":{"type":"string","description":"The URL to `PUT` the file's bytes to. It stops working at `expiresAt`."},"requiredHeaders":{"type":"object","additionalProperties":{"type":"string"},"description":"Headers the `PUT` must send exactly as given. The URL's signature covers them, so leaving one out or changing it gets a `403` from the storage service, and retrying won't help.","example":{"Content-Type":"application/pdf"}},"expiresAt":{"type":"string","format":"date-time","description":"When `uploadUrl` stops working. Request a new upload to get a fresh URL."},"expiresInSeconds":{"type":"number","deprecated":true,"description":"Deprecated: how long the link works, in seconds, the same as `expiresAt`. Read `expiresAt`; this field is still sent so integrations built on it keep working."},"completionUrl":{"type":"string","description":"Present on some deployments. When it is present, `POST` to it with an empty body after the `PUT` succeeds: that records the file's size and starts its virus scan. Without that call the file is never scanned, so nobody is ever shown it."}},"required":["fileId","uploadUrl","requiredHeaders","expiresAt"],"additionalProperties":false},"StepAttachment":{"type":"object","properties":{"id":{"type":"string","description":"The entry's id; send it to `DELETE`. For a file it is the file id; for a link or a dynamic reference, it is made from the entry itself.","example":"a3f1c2e4-5b6d-4e7f-8a9b-0c1d2e3f4a5b"},"kind":{"type":"string","enum":["file","link","dynamic"],"description":"`file`: an uploaded document. `link`: an external web address. `dynamic`: a reference that resolves to whatever a previous step produced, so it points at a different file on every run and therefore has no fixed file id."},"source":{"type":"string","enum":["template","runtime"],"description":"`template`: from the template this flow started from. `runtime`: added to this flow after it started. Only `runtime` entries can be removed through this API."},"removable":{"type":"boolean"},"fileId":{"type":"string"},"fileName":{"type":"string"},"fileSize":{"type":"number"},"mimeType":{"type":"string"},"scanStatus":{"type":["string","null"],"description":"Where the file's safety check stands. Anything other than `clean` or `skipped` means participants aren't shown the file yet."},"url":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"expression":{"type":"string","description":"For `dynamic` entries, the unresolved reference. For example `{Step 2 / Uploaded Files}`.","example":"{Step 2 / Uploaded Files}"}},"required":["id","kind","source","removable"],"additionalProperties":false},"AddStepAttachmentRequest":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["file"]},"fileName":{"type":"string","minLength":1,"maxLength":500,"example":"engagement-letter.pdf"},"fileSize":{"type":"integer","exclusiveMinimum":0,"description":"The file's size in bytes.","example":24576},"mimeType":{"type":"string","minLength":1,"maxLength":255,"example":"application/pdf"}},"required":["kind","fileName","fileSize","mimeType"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["link"]},"url":{"type":"string","minLength":1,"maxLength":2048,"description":"A full http(s) address. It must be literal; dynamic references are not accepted here.","example":"https://example.com/policy"},"title":{"type":"string","maxLength":200,"example":"Privacy policy"},"description":{"type":"string","maxLength":1000}},"required":["kind","url"],"additionalProperties":false}]},"MultipartStepAttachmentResponse":{"type":"object","properties":{"attachmentId":{"type":"string","description":"The new reference material. For a file this is also the file id."},"fileId":{"type":"string","deprecated":true,"description":"Deprecated: the uploaded attachment, the same as `attachmentId`. Read `attachmentId`; this field is still sent so integrations built on it keep working."},"kind":{"type":"string","enum":["file"]},"fileName":{"type":"string","description":"The file's name.","example":"engagement-letter.pdf"},"fileSize":{"type":"integer","exclusiveMinimum":0,"description":"The file's size in bytes.","example":24576}},"required":["attachmentId","kind","fileName","fileSize"],"additionalProperties":false},"AddStepAttachmentResponse":{"type":"object","properties":{"fileId":{"type":"string","description":"The file's id. Its bytes are stored once the `PUT` to `uploadUrl` succeeds.","example":"a3f1c2e4-5b6d-4e7f-8a9b-0c1d2e3f4a5b"},"uploadUrl":{"type":"string","description":"The URL to `PUT` the file's bytes to. It stops working at `expiresAt`."},"requiredHeaders":{"type":"object","additionalProperties":{"type":"string"},"description":"Headers the `PUT` must send exactly as given. The URL's signature covers them, so leaving one out or changing it gets a `403` from the storage service, and retrying won't help.","example":{"Content-Type":"application/pdf"}},"expiresAt":{"type":"string","format":"date-time","description":"When `uploadUrl` stops working. Request a new upload to get a fresh URL."},"completionUrl":{"type":"string","description":"Present on some deployments. When it is present, `POST` to it with an empty body after the `PUT` succeeds: that records the file's size and starts its virus scan. Without that call the file is never scanned, so nobody is ever shown it."},"attachmentId":{"type":"string"},"kind":{"type":"string","enum":["file","link"]}},"required":["attachmentId","kind"],"additionalProperties":false},"File":{"type":"object","properties":{"id":{"type":"string","description":"The file's id.","example":"file_01HZX..."},"name":{"type":"string","description":"The file's name as it was uploaded.","example":"invoice-acme.pdf"},"mimeType":{"type":"string","description":"The file's MIME type, detected when it was uploaded.","example":"application/pdf"},"size":{"type":"number","description":"The file's size in bytes.","example":24576},"stepId":{"type":["string","null"],"description":"The step this file belongs to. `null` only for a few older files that belong to no step.","example":"step_01HZX..."},"folderId":{"type":["string","null"],"description":"The folder the file is in. `null` when it is directly on the step.","example":null},"createdAt":{"type":"string","format":"date-time","description":"When the upload was started (ISO 8601), before the file's bytes arrived.","example":"2026-05-04T18:32:11Z"},"purgedAt":{"type":["string","null"],"format":"date-time","description":"When your organization's retention policy deleted the file's contents (ISO 8601). The file stays listed and can no longer be downloaded. `null` for a file that is kept.","example":null}},"required":["id","name","mimeType","size","stepId","folderId","createdAt","purgedAt"],"additionalProperties":false},"FlowFileListItem":{"type":"object","properties":{"id":{"type":"string","description":"The file's id.","example":"file_01HZX..."},"fileName":{"type":"string","example":"signed-agreement.pdf"},"fileSize":{"type":"number","description":"The file's size in bytes.","example":24576},"mimeType":{"type":"string","example":"application/pdf"},"folderId":{"type":["string","null"],"description":"The folder the file is in. `null` when it is not in a folder. Files listed in the `__attachments__` view carry `__attachments__` here: it is a view, not a real folder.","example":null},"stepExecutionId":{"type":["string","null"],"description":"The step run that produced the file. `null` for chat uploads, files added directly, and reference entries."},"stepId":{"type":["string","null"],"description":"The step that produced the file (its `stepId` on the flow). `null` for chat uploads, files added directly, and reference entries. A reference entry names the steps that use the file in `references`.","example":"step-1"},"stepName":{"type":["string","null"],"description":"The step's name, with any references to flow data filled in."},"stepType":{"type":["string","null"],"description":"The type of the step that produced the file, for example `ESIGN`.","example":"ESIGN"},"uploaderName":{"type":["string","null"]},"uploadedByUserId":{"type":["string","null"],"description":"The user id of the person who uploaded the file."},"status":{"type":"string","description":"Where the upload stands.","example":"confirmed"},"generationStatus":{"type":"string","description":"Where a file Moxo creates in the background stands. `ready` for every other file.","example":"ready"},"failureReason":{"type":["string","null"],"description":"Why a background generation failed. `null` otherwise."},"createdAt":{"type":"string","format":"date-time","example":"2026-05-04T18:32:11Z"},"chatMessageId":{"type":["string","null"],"description":"The chat message the file was attached to. `null` when it was not sent in chat."},"source":{"type":"string","enum":["template","ddr"],"description":"Only on files in the `__attachments__` view. `template`: attached to the step itself (reference material or a document to sign). `ddr`: a file from an earlier step's output."},"aiRenamedAt":{"type":["string","null"],"format":"date-time","description":"When an automatic rename was applied."},"aiRenameDismissedAt":{"type":["string","null"],"format":"date-time","description":"When someone dismissed the automatic-rename notice."},"aiRenamePendingAt":{"type":["string","null"],"format":"date-time","description":"Set while an automatic rename is in progress."},"isSample":{"type":"boolean","description":"A sample file the builder asked for in a Walkthrough or a Test run, never a real upload."},"fileRole":{"type":["string","null"],"enum":["signed","certificate",null],"description":"`signed` or `certificate` when the step that owns the file recorded it as its signed document or signing certificate. `null` otherwise. Never inferred from the file name."},"preventDownload":{"type":"boolean","description":"The caller may view this file but not download it: a step the flow's author marked view-only shows it as reference material. A person's own upload is exempt. Decided for the caller making the request."},"watermarked":{"type":"boolean","description":"The file is served with the viewer's identity stamped on it when opened, and is left out of ZIP downloads (download it on its own to get the stamped copy)."},"references":{"type":"array","items":{"type":"object","properties":{"stepId":{"type":"string","example":"step-2"},"kind":{"type":"string","enum":["signing_input","attachment"],"description":"`signing_input` is the document an e-sign step asks people to sign. `attachment` is any other file the step shows."}},"required":["stepId","kind"],"additionalProperties":false},"description":"Steps that show this file without having produced it, one entry per step and kind. Always `[]` on ordinary files. Only the steps you can see are listed."},"purgedAt":{"type":["string","null"],"format":"date-time","description":"Present when the file was deleted under the organization's retention policy."},"purgeReasonLabel":{"type":["string","null"]}},"required":["id","fileName","fileSize","mimeType","folderId","stepExecutionId","stepId","stepName","stepType","uploaderName","uploadedByUserId","status","generationStatus","failureReason","createdAt","aiRenamedAt","aiRenameDismissedAt","aiRenamePendingAt","isSample","fileRole","preventDownload","watermarked","references"],"additionalProperties":false},"InsertBuildingBlockRequest":{"type":"object","properties":{"blockTemplateId":{"type":"string","format":"uuid","description":"The published building block to add."},"name":{"type":"string","maxLength":500,"description":"A name for this copy. Leave it out to use the block's own name."},"afterStepId":{"type":"string","description":"Add the block after this step. Leave both places out to add it at the end."},"beforeStepId":{"type":"string","description":"Add the block before this step."},"roleBindings":{"type":"array","items":{"type":"object","properties":{"blockRoleId":{"type":"string","description":"A role of the building block."},"mode":{"type":"string","enum":["alias","promote","current_item"],"description":"`alias` uses a role this flow already has. `promote` adds the role and needs a person. `current_item` uses the current person of an enclosing For each."},"hostRoleId":{"type":"string","description":"The role of this flow that the block role uses, when mode is `alias`."},"holderUserId":{"type":"string","description":"The person who takes the new role, as `usr_…`, when mode is `promote`."},"emailColumn":{"type":"string","description":"The column of the enclosing list that holds the current person's email, when mode is `current_item`."}},"required":["blockRoleId","mode"],"description":"How one role of the block is filled on this flow."},"description":"How the block's roles are filled on this flow. One row per role."},"inputBindings":{"type":"array","items":{"type":"object","properties":{"blockInputFieldId":{"type":"string","description":"An input of the building block."},"parentRef":{"type":"string","description":"A value on this flow that fills that input, as a reference."}},"required":["blockInputFieldId","parentRef"],"description":"One input of the block, filled from this flow."},"description":"Values from this flow that fill the block's inputs."},"milestone":{"anyOf":[{"type":"object","properties":{"milestoneId":{"type":"string","minLength":1,"description":"A milestone next to where the step lands: `steps[].milestone.id` on Get flow.","example":"ms-review"}},"required":["milestoneId"],"additionalProperties":false},{"type":"object","properties":{"newMilestoneName":{"type":"string","minLength":1,"maxLength":80,"description":"The new milestone's name, up to 80 characters, not already a milestone of this flow.","example":"Sanctions screening"}},"required":["newMilestoneName"],"additionalProperties":false}],"description":"The milestone the step goes into, when the flow has milestones where it lands. `{ milestoneId }` joins one next to it: the one it lands inside, or, right after the last step of a milestone, that one or the next. `{ newMilestoneName }` starts a new milestone at this step, and the steps after it in the same milestone move into the new one. Leave it out to join the milestone of the step before it, as before. A milestone that is not next to where the step lands returns `409 MILESTONE_NOT_HERE`, as does a new milestone for a step placed further on than asked (`placement.reanchored`). A choice where there are no milestones returns `400 NO_MILESTONES_HERE`; a name already used, `409 MILESTONE_NAME_TAKEN`."}},"required":["blockTemplateId"],"description":"The building block to add, and where it goes."},"ErrorResponse":{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string","example":"NOT_FOUND"},"message":{"type":"string","example":"Resource not found"},"details":{"type":"array","items":{"type":"string"}},"requestId":{"type":"string","example":"req_abc123"}},"required":["code","message"]}},"required":["success","error"]},"StepDocument":{"type":"object","properties":{"fileId":{"type":"string","description":"The document's file id.","example":"a3f1c2e4-5b6d-4e7f-8a9b-0c1d2e3f4a5b"},"fileName":{"type":"string","example":"w8ben-acme-prefilled.pdf"},"fileSize":{"type":"integer","description":"The document's size in bytes.","example":48213},"pageCount":{"type":"integer","description":"Pages in the document that was just put on the step.","example":1}},"required":["fileId","fileName","fileSize","pageCount"],"additionalProperties":false},"StepDocumentFieldOutcome":{"type":"object","properties":{"retained":{"type":"integer","description":"Fields carried over from the document that was there before. On an E-Sign step this is every signature field, kept in place.","example":12},"added":{"type":"array","items":{"type":"string"},"description":"Fields the new document has that the previous one did not, by their name inside the PDF. Always empty for an E-Sign step.","example":[]},"removed":{"type":"array","items":{"type":"string"},"description":"Fields the previous document had that the new one doesn't. These are gone from the step; check them if you didn't expect any.","example":[]},"conditionsChanged":{"type":"array","items":{"type":"string"},"description":"Fields whose rule for showing or hiding them came out differently in the new document.","example":[]},"preparerFieldsCleared":{"type":"boolean","description":"`true` when a preparer had placed fields on the previous document of a PDF Form step for this run. Positions on one PDF don't map onto another, so those fields are cleared and the step uses the new document's fields; values a preparer filled in stay on the fields the new document still has. An E-Sign step whose preparer placed its signing fields refuses a new document instead (`409 ESIGN_PREPARER_PLACED`).","example":false},"hintValuesCleared":{"type":"array","items":{"type":"string"},"description":"Fields whose saved value was the previous document's own hint text (the gray text in an empty box), saved as an answer by an earlier upload. The value is cleared, so the box shows the new document's hint and starts empty. A value typed in Moxo is never cleared. Always empty for an E-Sign step.","example":[]}},"required":["retained","added","removed","conditionsChanged","preparerFieldsCleared","hintValuesCleared"],"additionalProperties":false},"ReplaceStepDocumentResponse":{"type":"object","properties":{"document":{"$ref":"#/components/schemas/StepDocument"},"fields":{"$ref":"#/components/schemas/StepDocumentFieldOutcome"},"signingSessionReinitialized":{"type":"boolean","description":"`true` when the step is an E-Sign step whose signing had been set up, so signing started again on the new document. Signers are sent new links only while they are signing: not while the step is being prepared (they are told when preparation ends), and not when that notice could not be queued.","example":true}},"required":["document","fields","signingSessionReinitialized"],"additionalProperties":false},"PageRangeErrorResponse":{"type":"object","properties":{"success":{"type":"boolean","enum":[false],"description":"Always false: the call did not succeed."},"error":{"type":"object","properties":{"code":{"type":"string","example":"PAGE_RANGE_OUTSIDE_DOCUMENT","description":"What went wrong, as a code your program can test (see Errors)."},"message":{"type":"string","example":"This document has 12 pages.","description":"What went wrong, in words for a person."},"details":{"type":"array","items":{"type":"string"},"description":"More about what went wrong, when there is more to say."},"requestId":{"type":"string","example":"req_abc123","description":"The request's id: give it to support when you ask about this call."},"pageCount":{"type":"integer","example":12,"description":"The pages the file has: with `PAGE_RANGE_OUTSIDE_DOCUMENT`, so you can ask again within them."}},"required":["code","message"],"description":"Why the pages could not be sent."}},"required":["success","error"]},"FlowArtifact":{"type":"object","properties":{"id":{"type":"string","description":"The artifact's id."},"name":{"type":"string","description":"The artifact's name."},"sections":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The section's id."},"label":{"type":"string","description":"The section's heading."},"blocks":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","description":"The block's id."},"kind":{"type":"string","enum":["value"],"description":"A value from the flow, such as an answer."},"label":{"type":"string","description":"The block's label."},"value":{"type":["string","null"],"description":"The value as the app shows it, or `null` until the flow has it."},"provenance":{"type":"object","properties":{"at":{"type":"string","description":"When (ISO 8601)."},"by":{"type":"string","description":"Who, by name."}},"required":["at"],"additionalProperties":false,"description":"Who gave the value, and when."}},"required":["id","kind","label","value"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","description":"The block's id."},"kind":{"type":"string","enum":["file"],"description":"Files a step produced."},"label":{"type":"string","description":"The block's label."},"files":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The file's id."},"fileName":{"type":"string","description":"The file's name."},"downloadUrl":{"type":["string","null"],"description":"A short-lived link to download it, or `null` while the virus scan runs."},"mimeType":{"type":"string","description":"The file's type."},"fileSize":{"type":"number","description":"The file's size in bytes."},"scanStatus":{"type":"string","description":"The virus scan: `clean`, or still `pending`."},"rowId":{"type":"string","description":"For a file in a table's row: the row (`<fieldId>:<row>`)."},"fieldId":{"type":"string","description":"For a file in a table's row: the table field."},"displayName":{"type":"string","description":"For a file in a table's row: the row's first value, such as a company name."},"columnLabel":{"type":"string","description":"For a file in a table's row: the column it is in."}},"required":["fileName","downloadUrl","scanStatus"],"additionalProperties":false},"description":"The files, empty until the step produces them."},"provenance":{"type":"object","properties":{"at":{"type":"string","description":"When (ISO 8601)."},"by":{"type":"string","description":"Who, by name."}},"required":["at"],"additionalProperties":false,"description":"Who produced them, and when."}},"required":["id","kind","label","files"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","description":"The block's id."},"kind":{"type":"string","enum":["text"],"description":"Fixed text."},"text":{"type":"string","description":"The text, with the flow's values filled in."},"style":{"type":"string","enum":["heading","paragraph"],"description":"A heading or a paragraph."}},"required":["id","kind","text","style"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","description":"The block's id."},"kind":{"type":"string","enum":["ai"],"description":"Text AI writes from the flow's data, which a manager may edit."},"label":{"type":"string","description":"The block's label."},"prompt":{"type":"string","description":"What the AI is asked to write."},"value":{"type":["string","null"],"description":"The text, or `null` until it is written."},"source":{"type":"string","enum":["manual","ai"],"description":"`ai`: as the AI wrote it. `manual`: a person edited it."},"edited":{"type":"object","properties":{"at":{"type":"string","description":"When (ISO 8601)."},"by":{"type":"string","description":"Who, by name."}},"required":["at"],"additionalProperties":false,"description":"Who last wrote or edited it, and when."},"editable":{"type":"boolean","description":"Whether you may change it. Absent means you may not."}},"required":["id","kind","label","prompt","value"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","description":"The block's id."},"kind":{"type":"string","enum":["input"],"description":"A field a person fills in on the artifact."},"label":{"type":"string","description":"The block's label."},"field":{"type":"object","additionalProperties":{},"description":"The field, in the form a Form step's fields take: its `type`, `label` and the settings of that type."},"required":{"type":"boolean","description":"Whether it must be filled in."},"value":{"type":["string","null"],"description":"The value as text (a list or a table as JSON text), or `null` until it is filled in."},"edited":{"type":"object","properties":{"at":{"type":"string","description":"When (ISO 8601)."},"by":{"type":"string","description":"Who, by name."}},"required":["at"],"additionalProperties":false,"description":"Who last filled it in, and when."},"editable":{"type":"boolean","description":"Whether you may change it. Absent means you may not."}},"required":["id","kind","label","field","required","value"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","description":"The block's id."},"kind":{"type":"string","enum":["richtext"],"description":"A document people write together."},"label":{"type":"string","description":"The block's label."},"doc":{"description":"The document in the editor's JSON form, or `null` until it is first opened."},"edited":{"type":"object","properties":{"at":{"type":"string","description":"When (ISO 8601)."},"by":{"type":"string","description":"Who, by name."}},"required":["at"],"additionalProperties":false,"description":"Who last edited it, and when."},"editable":{"type":"boolean","description":"Whether you may change it. Absent means you may not."},"rev":{"type":"integer","description":"Its revision: send it as `baseRev` when you save it. `0` until it is first saved."}},"required":["id","kind","rev"],"additionalProperties":false}]},"description":"The section's blocks, in order."}},"required":["id","blocks"],"additionalProperties":false},"description":"The artifact's sections, in order."}},"required":["id","name","sections"],"additionalProperties":false,"description":"One of the flow's artifacts, with the flow's values filled in."},"UserSummary":{"type":"object","properties":{"id":{"type":"string","description":"The user's id, with the `usr_` prefix. Stable within your organization; the same person has a different id in another organization.","example":"usr_7Kd2mQxWnR4vT9pLcYb3Ae"},"kind":{"type":"string","enum":["internal","external"],"description":"`internal`: a member of your organization. `external`: someone outside it, such as a client in a flow. Both have the same `usr_` id format.","example":"internal"},"name":{"type":"string","description":"The person's name.","example":"Alex Member"},"email":{"type":["string","null"],"description":"Primary email address; `null` when the person was onboarded by org-scoped `uniqueId` only.","example":"alex@org.com"},"uniqueId":{"type":["string","null"],"description":"Org-scoped partner identity key. `null` when unset. Distinct from opaque `id` (`usr_…`) and from `email`.","example":"cust_984431"},"title":{"type":["string","null"],"description":"The job title on this person's profile in your organization; `null` if none.","example":"Head of Lending"},"department":{"type":["string","null"],"description":"The department on this person's profile in your organization; `null` if none or archived. Internal users only: always `null` for an external user.","example":"Finance"},"managerId":{"type":["string","null"],"description":"Internal users only, when the org chart is on: the id of the internal user this person reports to; `null` when no manager is set. Omitted for external users and when the org chart is off.","example":"usr_2kT9fQm4ZpXa"},"directoryManaged":{"type":["object","null"],"properties":{"source":{"type":"string","enum":["scim","sso"],"description":"`scim`: your organization's directory manages this person (SCIM). `sso`: their details update when they sign in with single sign-on.","example":"scim"},"fields":{"type":"array","items":{"type":"string"},"description":"The fields the directory sets, sorted: `name`, `email`, `title`, `department`, `manager`, `active`, and `custom:<key>` for a custom user field. Changing any of them returns `409 DIRECTORY_MANAGED`.","example":["active","department","name","title"]}},"required":["source","fields"],"additionalProperties":false,"description":"Which of this person's fields your organization's directory sets; `null` when it sets none, or no directory is connected. Change those fields in the directory: `PATCH` returns `409 DIRECTORY_MANAGED` for them.","example":null},"phone":{"type":["string","null"],"description":"Phone number in E.164 form; `null` if unset.","example":"+14155550123"},"picture":{"type":["string","null"],"description":"The profile picture's URL: an uploaded picture, or the one from their sign-in provider; `null` if none.","example":"https://cdn.example.com/avatars/alex.png"},"status":{"type":"string","enum":["ACTIVE","INVITED","DEACTIVATED"],"description":"Where the user stands: `INVITED`, invited but not yet joined; `ACTIVE`, a working account; or `DEACTIVATED`, access turned off.","example":"ACTIVE"},"accounts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The account's id.","example":"acc_acme"},"name":{"type":"string","description":"The account's name.","example":"Acme Corp"},"domain":{"type":["string","null"],"description":"Primary email domain for the account; `null` if unset.","example":"example.com"}},"required":["id","name","domain"],"additionalProperties":false},"description":"The accounts this user belongs to; an external user can belong to several. Always empty (`[]`) for `kind=internal`."},"personas":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The persona's id.","example":"persona_admin"},"name":{"type":"string","description":"The persona's name.","example":"Admin"},"kind":{"type":"string","enum":["owner","admin","member","custom"],"description":"What kind of persona this is: `owner`, `admin` and `member` are the three every organization has; `custom` is one your organization created.","example":"admin"}},"required":["id","name","kind"],"additionalProperties":false},"description":"The personas this user has in your organization. Every active user has at least one. An invited user who has not accepted yet shows the persona their invitation gives them."},"primaryChannel":{"type":["string","null"],"enum":["email","sms","slack","teams","whatsapp","imessage","email_and_sms",null],"description":"How Moxo reaches this person first: `email`, `sms`, `slack`, `teams`, `whatsapp` or `imessage`. `email_and_sms` on a profile saved before people could pick more than one. `null` when none is set.","example":"email"},"lastLoginAt":{"type":["string","null"],"format":"date-time","description":"When the user last signed in; `null` if they never have.","example":"2026-06-04T10:00:00.000Z"},"joinedAt":{"type":["string","null"],"format":"date-time","description":"When the user joined your organization, by accepting the invitation or first signing in with single sign-on. `null` while `status=INVITED`.","example":"2026-01-16T12:00:00.000Z"},"createdAt":{"type":"string","format":"date-time","description":"When the user was added to your organization.","example":"2026-01-15T09:00:00.000Z"},"updatedAt":{"type":"string","format":"date-time","description":"When this user last changed as your organization sees them: their sign-in email, their profile in your organization (name, title, department, phone, picture, channel, time zone, language, custom field values), their status and kind, their personas, accounts or manager, and the fields your directory sets for them (`directoryManaged`), including when turning off single sign-on profile updates or setting up Provisioning releases those fields. A change another organization makes to the same person never moves it, and neither does a sign-in (see `lastLoginAt`), an invitation's dates, or a change to a title, department, persona, account or custom user field itself, such as a rename. A plan change or Provisioning being turned off can change `directoryManaged` for everyone at once without moving `updatedAt`.","example":"2026-06-01T14:32:11.000Z"},"customFields":{"type":"object","additionalProperties":{"type":["string","null"]},"description":"This person's custom user fields in your organization, keyed as in Settings → Custom user fields. A field that was deleted is left out. An empty object when your organization has no custom user fields or this person has no values. These are facts about the person, such as a warehouse, a CRM id or a region; they are not a flow's `customFields[]`.","example":{"warehouse":"SFO-1","salesforce_user_id":"005xx000001"}}},"required":["id","kind","name","email","uniqueId","title","department","directoryManaged","phone","picture","status","accounts","personas","primaryChannel","lastLoginAt","joinedAt","createdAt","updatedAt","customFields"],"additionalProperties":false},"UserDetail":{"type":"object","properties":{"id":{"type":"string","description":"The user's id, with the `usr_` prefix. Stable within your organization; the same person has a different id in another organization.","example":"usr_7Kd2mQxWnR4vT9pLcYb3Ae"},"kind":{"type":"string","enum":["internal","external"],"description":"`internal`: a member of your organization. `external`: someone outside it, such as a client in a flow. Both have the same `usr_` id format.","example":"internal"},"name":{"type":"string","description":"The person's name.","example":"Alex Member"},"email":{"type":["string","null"],"description":"Primary email address; `null` when the person was onboarded by org-scoped `uniqueId` only.","example":"alex@org.com"},"uniqueId":{"type":["string","null"],"description":"Org-scoped partner identity key. `null` when unset. Distinct from opaque `id` (`usr_…`) and from `email`.","example":"cust_984431"},"title":{"type":["string","null"],"description":"The job title on this person's profile in your organization; `null` if none.","example":"Head of Lending"},"department":{"type":["string","null"],"description":"The department on this person's profile in your organization; `null` if none or archived. Internal users only: always `null` for an external user.","example":"Finance"},"managerId":{"type":["string","null"],"description":"Internal users only, when the org chart is on: the id of the internal user this person reports to; `null` when no manager is set. Omitted for external users and when the org chart is off.","example":"usr_2kT9fQm4ZpXa"},"directoryManaged":{"type":["object","null"],"properties":{"source":{"type":"string","enum":["scim","sso"],"description":"`scim`: your organization's directory manages this person (SCIM). `sso`: their details update when they sign in with single sign-on.","example":"scim"},"fields":{"type":"array","items":{"type":"string"},"description":"The fields the directory sets, sorted: `name`, `email`, `title`, `department`, `manager`, `active`, and `custom:<key>` for a custom user field. Changing any of them returns `409 DIRECTORY_MANAGED`.","example":["active","department","name","title"]}},"required":["source","fields"],"additionalProperties":false,"description":"Which of this person's fields your organization's directory sets; `null` when it sets none, or no directory is connected. Change those fields in the directory: `PATCH` returns `409 DIRECTORY_MANAGED` for them.","example":null},"phone":{"type":["string","null"],"description":"Phone number in E.164 form; `null` if unset.","example":"+14155550123"},"picture":{"type":["string","null"],"description":"The profile picture's URL: an uploaded picture, or the one from their sign-in provider; `null` if none.","example":"https://cdn.example.com/avatars/alex.png"},"status":{"type":"string","enum":["ACTIVE","INVITED","DEACTIVATED"],"description":"Where the user stands: `INVITED`, invited but not yet joined; `ACTIVE`, a working account; or `DEACTIVATED`, access turned off.","example":"ACTIVE"},"accounts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The account's id.","example":"acc_acme"},"name":{"type":"string","description":"The account's name.","example":"Acme Corp"},"domain":{"type":["string","null"],"description":"Primary email domain for the account; `null` if unset.","example":"example.com"}},"required":["id","name","domain"],"additionalProperties":false},"description":"The accounts this user belongs to; an external user can belong to several. Always empty (`[]`) for `kind=internal`."},"personas":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The persona's id.","example":"persona_admin"},"name":{"type":"string","description":"The persona's name.","example":"Admin"},"kind":{"type":"string","enum":["owner","admin","member","custom"],"description":"What kind of persona this is: `owner`, `admin` and `member` are the three every organization has; `custom` is one your organization created.","example":"admin"}},"required":["id","name","kind"],"additionalProperties":false},"description":"The personas this user has in your organization. Every active user has at least one. An invited user who has not accepted yet shows the persona their invitation gives them."},"primaryChannel":{"type":["string","null"],"enum":["email","sms","slack","teams","whatsapp","imessage","email_and_sms",null],"description":"How Moxo reaches this person first: `email`, `sms`, `slack`, `teams`, `whatsapp` or `imessage`. `email_and_sms` on a profile saved before people could pick more than one. `null` when none is set.","example":"email"},"lastLoginAt":{"type":["string","null"],"format":"date-time","description":"When the user last signed in; `null` if they never have.","example":"2026-06-04T10:00:00.000Z"},"joinedAt":{"type":["string","null"],"format":"date-time","description":"When the user joined your organization, by accepting the invitation or first signing in with single sign-on. `null` while `status=INVITED`.","example":"2026-01-16T12:00:00.000Z"},"createdAt":{"type":"string","format":"date-time","description":"When the user was added to your organization.","example":"2026-01-15T09:00:00.000Z"},"updatedAt":{"type":"string","format":"date-time","description":"When this user last changed as your organization sees them: their sign-in email, their profile in your organization (name, title, department, phone, picture, channel, time zone, language, custom field values), their status and kind, their personas, accounts or manager, and the fields your directory sets for them (`directoryManaged`), including when turning off single sign-on profile updates or setting up Provisioning releases those fields. A change another organization makes to the same person never moves it, and neither does a sign-in (see `lastLoginAt`), an invitation's dates, or a change to a title, department, persona, account or custom user field itself, such as a rename. A plan change or Provisioning being turned off can change `directoryManaged` for everyone at once without moving `updatedAt`.","example":"2026-06-01T14:32:11.000Z"},"customFields":{"type":"object","additionalProperties":{"type":["string","null"]},"description":"This person's custom user fields in your organization, keyed as in Settings → Custom user fields. A field that was deleted is left out. An empty object when your organization has no custom user fields or this person has no values. These are facts about the person, such as a warehouse, a CRM id or a region; they are not a flow's `customFields[]`.","example":{"warehouse":"SFO-1","salesforce_user_id":"005xx000001"}},"timezone":{"type":"string","description":"The person's time zone, as an IANA name such as `America/Los_Angeles`.","example":"America/Los_Angeles"},"invitedAt":{"type":["string","null"],"format":"date-time","description":"When the invitation was sent; `null` if the user was added without one, for example when they first signed in with single sign-on.","example":"2026-01-15T09:00:00.000Z"},"inviteExpiresAt":{"type":["string","null"],"format":"date-time","description":"When the invitation expires. `null` once it has been accepted or revoked.","example":"2026-01-22T09:00:00.000Z"},"deactivatedAt":{"type":["string","null"],"format":"date-time","description":"When the user was deactivated. `null` unless `status=DEACTIVATED`.","example":null}},"required":["id","kind","name","email","uniqueId","title","department","directoryManaged","phone","picture","status","accounts","personas","primaryChannel","lastLoginAt","joinedAt","createdAt","updatedAt","customFields","timezone","invitedAt","inviteExpiresAt","deactivatedAt"],"additionalProperties":false},"CreateUserRequest":{"type":"object","properties":{"kind":{"type":"string","enum":["internal","external"],"description":"Whether the new user is `internal` or `external`. It decides which personas they can have.","example":"external"},"name":{"type":"string","maxLength":255,"description":"The person's full name, up to 255 characters. If you leave it out, the invitation asks for it.","example":"New Person"},"email":{"type":"string","format":"email","description":"Sign-in / invite email. Optional when `uniqueId` is set (at least one of `email` or `uniqueId` is required). Required for an invitation email to go out. When both are sent, `uniqueId` is the durable org key and email is stored as the sign-in address. It must be unique in your organization: an address someone already has, or is invited with, returns `409 DUPLICATE` with their id in `error.existingUserId`, and nothing is changed or sent. An inactive internal user is the same `409 DUPLICATE`, and `error.reason` is `deactivated_member`. An address that is not valid returns `400 VALIDATION_FAILED`.","example":"newperson@acme.com"},"uniqueId":{"type":"string","description":"Org-scoped partner identity key. Unique within the organization (case-insensitive). Letters, digits, and `@ . _ + -` only; max 128 characters. Prefer this over email when both are sent.","example":"cust_984431"},"title":{"type":["string","null"],"maxLength":100,"description":"The job title on the person's profile, up to 100 characters.","example":"Head of Lending"},"sendInvitation":{"type":"boolean","description":"Invite email control. Omit or `true` keeps today's default: an invite goes out when an email is present. Pass `false` only to create the person without mailing. Creates with only `uniqueId` (no email) never mail; `true` without an email is rejected.","example":false},"department":{"type":["string","null"],"maxLength":100,"description":"The department, by name, up to 100 characters. Internal users only: `kind=external` returns `DEPARTMENT_INTERNAL_ONLY`. A name your organization doesn't have yet is added to its department list.","example":"Finance"},"phone":{"type":"string","description":"A phone number in E.164 form.","example":"+14155550199"},"accountId":{"type":"string","description":"The account this user belongs to. External users only; ignored for `kind=internal`.","example":"acc_acme"},"personaId":{"type":"string","description":"The persona the user gets when they join. Defaults to your organization's `member` persona for their `kind`.","example":"persona_admin"},"tier":{"type":"string","enum":["admin","orchestrator","participant"],"description":"Internal users only: the simple choice the Invite dialog offers when you don't pick a persona. `admin` runs the organization, `orchestrator` builds and runs flows, `participant` works through magic links only. Each gives the matching persona your organization has. Send `tier` or `personaId`, not both. Inviting an `admin` needs an admin's token.","example":"orchestrator"},"primaryChannel":{"type":"string","enum":["email","sms","email_and_sms"],"description":"How Moxo reaches the person first, as the Invite dialog sets it. `sms` and `email_and_sms` take effect only with a `phone`. Defaults to `email`.","example":"email"},"smsConsent":{"type":"boolean","description":"Internal users only: the person agreed to receive text messages at `phone`.","example":true},"managerId":{"type":"string","description":"Internal users only, when the org chart is on: the id of the internal user the new person reports to. It must be an active or invited internal user in your organization. Refused for `kind=external`.","example":"usr_2kT9fQm4ZpXa"},"customFields":{"type":"object","additionalProperties":{"type":"string"},"description":"Custom user fields, with the same keys as `PATCH`. Each value you send is saved when the person is added; a blank value leaves a saved one as it is. An unknown key returns `UNKNOWN_KEY`, and a value over 256 characters returns `VALUE_TOO_LONG`; in both cases the person isn't created.","example":{"region":"West","account_id":"A-100"}}},"required":["kind"],"additionalProperties":false},"UpdateUserRequest":{"type":"object","properties":{"name":{"type":"string","maxLength":255,"description":"The new name, up to 255 characters. Returns `409 DIRECTORY_MANAGED` when your organization's directory sets this person's name (see `directoryManaged`).","example":"Alex M. Member"},"email":{"type":"string","maxLength":320,"format":"email","description":"The new email this external user signs in with: the same change a person makes for themselves, for your organization only. They keep their id, unique ID and history here; if they belong to another organization, it keeps the email it knows them by. Their open sessions end, so they sign in again with the new email, and Moxo emails their previous address to say the sign-in email changed (without naming the new one). Only an organization API key holding the `users:email` scope, beside the `external_users:write` every change here takes, can send it (`*` does not include it), only when unique IDs are on, and only for an external user your organization knows by a unique ID. Send it alone: with other fields the request is refused with `400 EMAIL_CHANGE_ALONE`. Sending the email they already have changes nothing. Refused with `403 INSUFFICIENT_SCOPE` (the key lacks `users:email`), `403 FEATURE_DISABLED` (unique IDs are off), `409 EMAIL_CHANGE_NOT_ALLOWED` with `reason` `org_key_only` (not an organization key), `internal_member` (an internal user changes their own email), `no_unique_id` or `sign_in_provider` (they sign in with Google, which owns their email), `409 DIRECTORY_MANAGED` (your directory sets their email) or `409 EMAIL_BELONGS_TO_ANOTHER_ACCOUNT` (that email already signs in to Moxo). Each refusal is in your audit log.","example":"arun.shah@example.com"},"uniqueId":{"type":"string","description":"The new unique ID of an external user your organization already knows by one, for when your system gives them a new number (a prospect becomes a customer). It saves with `personaId` and `customFields` in the same request, or none of them do. Like an email change, only the new ID is kept: the old one no longer finds or signs them in, is recorded in your audit log, and can be given to someone else afterwards. Only an organization API key holding the `users:unique_id` scope, beside the `external_users:write` every change here takes, can send it (`*` does not include it), and only when unique IDs are on. It can't come with `email`. Sending the ID they already have changes nothing; a change only in letter case is saved. Refused with `400 INVALID_UNIQUE_ID` (not a valid unique ID), `403 INSUFFICIENT_SCOPE` (the key lacks `users:unique_id`), `403 FEATURE_DISABLED` (unique IDs are off), `409 UNIQUE_ID_CHANGE_NOT_ALLOWED` with `reason` `org_key_only` (not an organization key), `internal_member` or `no_unique_id`, or `409 UNIQUE_ID_CONFLICT` with `reason` `unique_id_taken` (someone else has it) and `existingUserId` when you may read them. Each refusal but `INVALID_UNIQUE_ID` is in your audit log.","example":"BANK-1234"},"title":{"type":["string","null"],"maxLength":100,"description":"The new job title, up to 100 characters, or `null` to remove it. Anyone else's title is set as an admin would set it. When the token belongs to this same person, your organization's setting for people setting their own title applies: while it is off, the request returns `403 TITLE_EDIT_DISABLED`.","example":"Head of Lending"},"department":{"type":["string","null"],"maxLength":100,"description":"The new department, by name, up to 100 characters, or `null` to remove it. A name your organization doesn't have yet is added to its department list. Internal users only: an external user returns `DEPARTMENT_INTERNAL_ONLY`. Returns `DEPARTMENT_SELF_EDIT` when the token belongs to this same person, because nobody sets their own department.","example":"Finance"},"phone":{"type":["string","null"],"description":"The new phone number in E.164 form, or `null` to remove it.","example":"+14155550123"},"picture":{"type":["string","null"],"description":"The new picture's URL, or `null` to go back to the picture from their sign-in provider.","example":"https://cdn.example.com/avatars/alex-new.png"},"accountId":{"type":["string","null"],"description":"The account the user belongs to (external users only), or `null` to remove them from it. Setting it takes them off any other account in your organization. To put someone on more than one account, use `POST /v1/accounts/{id}/users`.","example":"acc_acme"},"personaId":{"type":"string","description":"The user's new persona.","example":"persona_member"},"timezone":{"type":"string","description":"The new time zone, as an IANA name.","example":"America/New_York"},"managerId":{"type":["string","null"],"description":"Internal users only, when the org chart is on: the id of the internal user this person reports to, or `null` to remove it. It must be an active or invited internal user in your organization. Refused when it would make a loop (the new manager already reports up to this person), when it names the person themselves, or when the token belongs to this same person, because nobody sets their own manager.","example":"usr_2kT9fQm4ZpXa"},"customFields":{"type":"object","additionalProperties":{"type":["string","null"]},"description":"The custom user fields to change. Keys must already exist in Settings → Custom user fields; an unknown key returns `UNKNOWN_KEY`. Send `null` or `\"\"` to clear a value; keys you leave out stay as they are. Each value can be up to 256 characters. Needs no permission beyond the rest of this request. These are not a template's or flow's `customFields`.","example":{"warehouse":"SFO-1"}}},"additionalProperties":false},"AccountSummary":{"type":"object","properties":{"id":{"type":"string","description":"The account's id.","example":"acc_acme"},"name":{"type":"string","description":"The account's name.","example":"Acme Corp"},"domain":{"type":["string","null"],"description":"The account's main email domain; `null` if none.","example":"example.com"},"status":{"type":"string","enum":["ACTIVE","INACTIVE"],"description":"Whether the account is in use. `ACTIVE` is the usual state; an `INACTIVE` account is kept but no longer offered when people choose an account.","example":"ACTIVE"},"usersCount":{"type":"integer","minimum":0,"description":"How many external users belong to this account.","example":7},"createdAt":{"type":"string","format":"date-time","description":"When the account was created.","example":"2026-01-15T09:00:00.000Z"},"updatedAt":{"type":"string","format":"date-time","description":"When the account was last changed.","example":"2026-06-01T14:32:11.000Z"}},"required":["id","name","domain","status","usersCount","createdAt","updatedAt"],"additionalProperties":false},"AccountDetail":{"type":"object","properties":{"id":{"type":"string","description":"The account's id.","example":"acc_acme"},"name":{"type":"string","description":"The account's name.","example":"Acme Corp"},"domain":{"type":["string","null"],"description":"The account's main email domain; `null` if none.","example":"example.com"},"status":{"type":"string","enum":["ACTIVE","INACTIVE"],"description":"Whether the account is in use. `ACTIVE` is the usual state; an `INACTIVE` account is kept but no longer offered when people choose an account.","example":"ACTIVE"},"usersCount":{"type":"integer","minimum":0,"description":"How many external users belong to this account.","example":7},"createdAt":{"type":"string","format":"date-time","description":"When the account was created.","example":"2026-01-15T09:00:00.000Z"},"updatedAt":{"type":"string","format":"date-time","description":"When the account was last changed.","example":"2026-06-01T14:32:11.000Z"},"users":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The user's id, with the `usr_` prefix. Stable within your organization; the same person has a different id in another organization.","example":"usr_7Kd2mQxWnR4vT9pLcYb3Ae"},"kind":{"type":"string","enum":["external"],"description":"Always `external`: accounts hold only external users.","example":"external"},"name":{"type":"string","description":"The person's name.","example":"Ana Silva"},"email":{"type":["string","null"],"description":"The person's primary email; `null` when they were onboarded by org-scoped `uniqueId` only.","example":"ana@example.com"},"phone":{"type":["string","null"],"description":"The person's phone number in E.164 form; `null` if none.","example":"+14155550199"},"status":{"type":"string","enum":["ACTIVE","INVITED","DEACTIVATED"],"description":"Where the user stands: `INVITED`, `ACTIVE` or `DEACTIVATED`.","example":"ACTIVE"},"lastLoginAt":{"type":["string","null"],"format":"date-time","description":"When the user last signed in; `null` if they never have.","example":"2026-06-04T10:00:00.000Z"}},"required":["id","kind","name","email","phone","status","lastLoginAt"],"additionalProperties":false},"description":"The external users who belong to this account, with a shorter set of fields than `UserSummary`."}},"required":["id","name","domain","status","usersCount","createdAt","updatedAt","users"],"additionalProperties":false},"CreateAccountRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"The account's name. Required.","example":"Acme Corp"},"domain":{"type":"string","description":"The account's main email domain.","example":"example.com"}},"required":["name"],"additionalProperties":false},"UpdateAccountRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"The account's new name.","example":"Acme Corporation"},"domain":{"type":["string","null"],"description":"The account's new main email domain, or `null` to remove it.","example":"example.org"},"status":{"type":"string","enum":["ACTIVE","INACTIVE"],"description":"Whether the account is in use: `ACTIVE` or `INACTIVE`.","example":"INACTIVE"}},"additionalProperties":false},"ActionType":{"type":"string","enum":["FORM","QUESTIONNAIRE","POLL","FILE_REQUEST","TODO","CHECKLIST","APPROVAL","ACKNOWLEDGEMENT","ESIGN","DOCUSIGN","DECISION","PDF_FORM","TIME_BOOKING","DOCUMENT_COLLABORATION"],"description":"What a new action can ask for. Payment isn't offered, because a third party completes it. `JOTFORM` isn't offered either: sending one returns `400` with the message \"That action type can't be sent.\"","example":"ESIGN"},"ActionTypeRead":{"type":"string","enum":["FORM","QUESTIONNAIRE","POLL","FILE_REQUEST","TODO","CHECKLIST","APPROVAL","ACKNOWLEDGEMENT","ESIGN","DOCUSIGN","DECISION","CUSTOM_ACTION","PDF_FORM","TIME_BOOKING","DOCUMENT_COLLABORATION","PACKET","JOTFORM"],"description":"What the action asks for: every type `POST /v1/actions` accepts, plus `CUSTOM_ACTION` on actions sent in Moxo, and `JOTFORM` on actions sent before it stopped being offered.","example":"ESIGN"},"ActionStatus":{"type":"string","enum":["open","completed","cancelled"],"description":"Where the action stands. `cancelled` covers both a withdrawal and a decline, and the audit trail says which it was.","example":"open"},"ActionRecipient":{"type":"object","properties":{"userId":{"type":"string","description":"The id of the person asked. Their details are on `GET /v1/users/{id}`.","example":"usr_8Kq2mNp"},"displayName":{"type":"string","example":"Robert Hartwell"},"status":{"type":"string","enum":["pending","completed","declined","not_needed"],"description":"This person's own status, separate from the action's. On an action that any one person can settle, the others show `not_needed` once it is done.","example":"pending"},"openedAt":{"type":["string","null"],"format":"date-time","description":"When this person first opened the action, or `null` if they haven't. Absent when it is not available to this caller: each person's open time goes only to the action's sender, the managers of its conversation, an org admin who manages it, and an organization key. The action's own `openedAt` is set by whoever opens it first, so on an acknowledgement sent to many people it is set the moment one person looks."},"completedAt":{"type":["string","null"],"format":"date-time","description":"When this person finished their part, or `null` until they do."}},"required":["userId","displayName","status","completedAt"],"additionalProperties":false},"Action":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"The action's id.","example":"7c1e4b2a-9d3f-4e8a-b6c5-2f0a1d9e8b47"},"type":{"$ref":"#/components/schemas/ActionTypeRead"},"title":{"type":"string","description":"What was asked, in the requester's words.","example":"Sign the account application"},"description":{"type":["string","null"],"description":"The longer note that reaches the person asked, in their email and on the page."},"status":{"$ref":"#/components/schemas/ActionStatus"},"createdAt":{"type":["string","null"],"format":"date-time","description":"When the action was sent. Almost always set; `null` only in the rare case that no time was recorded."},"dueAt":{"type":["string","null"],"format":"date-time","description":"The due date, or `null` when there is none. Reminders follow the schedule set when the action was sent (`customReminders`), and your organization's defaults for anything it left out. On a flow listed because one of its steps is waiting on you, it is that step's due date."},"completedAt":{"type":["string","null"],"format":"date-time"},"openedAt":{"type":["string","null"],"format":"date-time","description":"When anyone asked first opened the action: the difference between chasing them and giving them a day. `null` when nobody has. Absent when it is not available to this caller: it goes only to the action's sender, the managers of its conversation, an org admin who manages it, and an organization key. Each person's own time is on `recipients[].openedAt`."},"requestedBy":{"type":["object","null"],"properties":{"userId":{"type":"string"},"displayName":{"type":"string"}},"required":["userId","displayName"],"description":"Who sent the action."},"recipients":{"type":"array","items":{"$ref":"#/components/schemas/ActionRecipient"},"description":"Who it was sent to, whether or not they have answered. On a flow listed because one of its steps is waiting on you, the people on that step."},"reminderCount":{"type":["integer","null"],"description":"How many reminders have been sent. `null` unless you sent the action: a person asked sees the action, not how often they were reminded."},"projectName":{"type":["string","null"],"description":"The project this action belongs to, or `null` when it belongs to none."},"buttonLabel":{"type":"string","description":"On an acknowledgement, the words on the button. The caller's language when a translation exists, otherwise the author's words. Absent when the author left the label blank: a Moxo screen then shows its translated \"I Acknowledge\"."},"viewerTurn":{"$ref":"#/components/schemas/ViewerTurn"},"viewerManages":{"$ref":"#/components/schemas/ViewerManages"}},"required":["id","type","title","description","status","createdAt","dueAt","completedAt","requestedBy","recipients","reminderCount","projectName","viewerTurn","viewerManages"],"additionalProperties":false},"CustomReminders":{"type":"object","properties":{"dueDateApproaching":{"type":"boolean","description":"Remind the assignees before the due date."},"dueDateApproachingDays":{"type":"array","items":{"type":"integer","minimum":1,"maximum":365},"minItems":1,"maxItems":5,"description":"How many days before the due date each reminder goes, for example `[90, 60, 30]`."},"actionDue":{"type":"boolean","description":"Remind the assignees on the due date."},"actionOverdue":{"type":"boolean","description":"Send a notice after the due date has passed."},"actionOverdueRepeatDays":{"type":"integer","minimum":1,"maximum":365,"description":"Days between notices after the due date."},"actionOverdueMaxTimes":{"type":"integer","minimum":1,"maximum":10,"description":"The most notices sent after the due date."},"noDueDateFollowUpDays":{"type":"integer","minimum":1,"maximum":30,"description":"An action sent on its own (`POST /v1/actions`) with no due date: days between follow-ups. A flow step refuses it."},"noDueDateFollowUpMax":{"type":"integer","minimum":0,"maximum":10,"description":"An action sent on its own with no due date: how many follow-ups to send; `0` never follows up. A flow step refuses it."},"emails":{"type":"object","properties":{"dueSoon":{"type":"object","properties":{"subject":{"type":"string","maxLength":300,"description":"The email's subject line. May hold the email's variables such as `{{firstName}}`, `{{dueDate}}` and `{{daysUntilDue}}`; `{{dueRow:<column id>}}` for a column of the data table row the step's due date is read from (a due date from a data table); and data references in `{…}`."},"heading":{"type":"string","maxLength":300,"description":"The heading at the top of the email. May hold the email's variables such as `{{firstName}}`, `{{dueDate}}` and `{{daysUntilDue}}`; `{{dueRow:<column id>}}` for a column of the data table row the step's due date is read from (a due date from a data table); and data references in `{…}`."},"body":{"type":"string","maxLength":5000,"description":"The email's message. A blank line starts a new paragraph. May hold the email's variables such as `{{firstName}}`, `{{dueDate}}` and `{{daysUntilDue}}`; `{{dueRow:<column id>}}` for a column of the data table row the step's due date is read from (a due date from a data table); and data references in `{…}`."},"buttonLabel":{"type":"string","maxLength":80,"description":"The words on the button that opens the action."}},"additionalProperties":false,"description":"The reminder sent while the due date is still ahead. A field left out uses the organization's wording."},"overdue":{"type":"object","properties":{"subject":{"type":"string","maxLength":300,"description":"The email's subject line. May hold the email's variables such as `{{firstName}}`, `{{dueDate}}` and `{{daysUntilDue}}`; `{{dueRow:<column id>}}` for a column of the data table row the step's due date is read from (a due date from a data table); and data references in `{…}`."},"heading":{"type":"string","maxLength":300,"description":"The heading at the top of the email. May hold the email's variables such as `{{firstName}}`, `{{dueDate}}` and `{{daysUntilDue}}`; `{{dueRow:<column id>}}` for a column of the data table row the step's due date is read from (a due date from a data table); and data references in `{…}`."},"body":{"type":"string","maxLength":5000,"description":"The email's message. A blank line starts a new paragraph. May hold the email's variables such as `{{firstName}}`, `{{dueDate}}` and `{{daysUntilDue}}`; `{{dueRow:<column id>}}` for a column of the data table row the step's due date is read from (a due date from a data table); and data references in `{…}`."},"buttonLabel":{"type":"string","maxLength":80,"description":"The words on the button that opens the action."}},"additionalProperties":false,"description":"The notice sent after the due date has passed. A field left out uses the organization's wording."},"nudge":{"type":"object","properties":{"subject":{"type":"string","maxLength":300,"description":"The email's subject line. May hold the email's variables such as `{{firstName}}`, `{{dueDate}}` and `{{daysUntilDue}}`; `{{dueRow:<column id>}}` for a column of the data table row the step's due date is read from (a due date from a data table); and data references in `{…}`."},"heading":{"type":"string","maxLength":300,"description":"The heading at the top of the email. May hold the email's variables such as `{{firstName}}`, `{{dueDate}}` and `{{daysUntilDue}}`; `{{dueRow:<column id>}}` for a column of the data table row the step's due date is read from (a due date from a data table); and data references in `{…}`."},"body":{"type":"string","maxLength":5000,"description":"The email's message. A blank line starts a new paragraph. May hold the email's variables such as `{{firstName}}`, `{{dueDate}}` and `{{daysUntilDue}}`; `{{dueRow:<column id>}}` for a column of the data table row the step's due date is read from (a due date from a data table); and data references in `{…}`."},"buttonLabel":{"type":"string","maxLength":80,"description":"The words on the button that opens the action."}},"additionalProperties":false,"description":"The reminder sent for an action with no due date. A field left out uses the organization's wording."}},"additionalProperties":false,"description":"This action's own wording for its reminder emails."}},"additionalProperties":false,"description":"This action's own reminders. Send only the values you want to change; anything you omit follows your organization's setting, including if that setting changes later. `dueDateApproachingDays` is used when the action has a due date (`[7, 1]` reminds a week before and a day before), `noDueDateFollowUpDays` and `noDueDateFollowUpMax` when it has none, which is the usual case. The switches and the overdue settings are the ones a flow step takes, and with the emails they apply when your plan has Custom step reminders. Reminders also stop on their own as soon as the action is answered, declined or withdrawn."},"CreateAction":{"type":"object","properties":{"type":{"$ref":"#/components/schemas/ActionType"},"title":{"type":"string","minLength":1,"maxLength":500,"description":"What you are asking for, as the people asked see it in the email and on the action.","example":"Sign the account application"},"description":{"type":"string","maxLength":5000,"description":"More about what you need, shown to the people asked under the title."},"assigneeUserIds":{"type":"array","items":{"type":"string"},"minItems":1,"maxItems":50,"description":"Who to ask. Every id must be a user in your organization; invite anyone who isn't yet with `POST /v1/users`."},"sides":{"type":"array","items":{"type":"object","properties":{"sideId":{"type":"string","minLength":1,"maxLength":40,"description":"The id of a side in `config.collaboration.sides`.","example":"client"},"assigneeUserIds":{"type":"array","items":{"type":"string"},"minItems":1,"maxItems":50,"description":"The people on this side. Each must also be in `assigneeUserIds`."}},"required":["sideId","assigneeUserIds"],"additionalProperties":false},"minItems":2,"maxItems":6,"description":"Required for `DOCUMENT_COLLABORATION` taking turns (`config.collaboration.mode` `take_turns`), and refused for every other type, and for a collaboration written together (`edit_together`) or reviewed without editing (`comment_only`), which have no sides. Says who is on which side: every side in `config.collaboration.sides` needs at least one person, each person in `assigneeUserIds` is on exactly one side, and nobody is on a side without being in `assigneeUserIds`."},"dueAt":{"type":"string","format":"date-time","description":"When it is due, as an ISO 8601 date and time. Leave it out for no due date.","example":"2026-11-30T17:00:00Z"},"completionMode":{"type":"string","enum":["ANY_ONE","ALL","MAJORITY","SEQUENTIAL"],"description":"How several people share one action. Leave it out unless you mean to choose: the default is `ALL` for an acknowledgement or a signature and `ANY_ONE` for everything else, so sending a value can turn \"everyone must acknowledge this\" into \"any one of you will do\". Not every type takes every rule (a decision is settled by whoever decides first, a poll by every voter), and a rule a type can't follow is refused, not ignored. A `DOCUMENT_COLLABORATION` written together (`edit_together`) takes `ANY_ONE`, `MAJORITY` or `ALL` (the default): how many of the people must approve the same text. One reviewed without editing (`comment_only`) takes `ANY_ONE`, `MAJORITY`, `ALL` (the default) or `SEQUENTIAL` (one at a time, in the order of `assigneeUserIds`): who has to mark it reviewed. One taking turns takes none: the sides agreeing completes it."},"config":{"type":"object","additionalProperties":{},"description":"The type's own setup: the document to sign, the fields to fill, the options to choose between. Shapes follow the step type of the same name. For `DOCUMENT_COLLABORATION`, `collaboration.mode` says how people work: `take_turns` (sides revise files in turn; documents name a file with `ref`, and `sides` says who is on each), or `edit_together` (everyone asked writes the documents together in Moxo, then approves the same text), or `comment_only` (everyone asked reads the documents and comments on them, nobody edits; when the review completes, each document gets a reviewed copy carrying every comment). Written together, each document is `{ \"key\", \"name\"?, \"content\"? }`, `content` being its starting text in Markdown (headings, paragraphs, lists, bold, italic and links); nothing else is taken there. Reviewed without editing, each document is `{ \"key\", \"name\"?, \"ref\" }` (a file) or `{ \"key\", \"name\"?, \"content\" }` (Markdown), never both.","example":{"collaboration":{"mode":"edit_together","documents":[{"key":"policy","name":"Client onboarding policy","content":"# Before kickoff\n\n- Signed statement of work on file"}]}}},"customReminders":{"$ref":"#/components/schemas/CustomReminders"},"conversationId":{"type":"string","minLength":1,"maxLength":200,"description":"Send it in this group conversation, as `GET /v1/conversations` returns it. The action posts in the conversation, everyone in `assigneeUserIds` must be in it, and the conversation's rules decide who may send it. Leave it out to send an action from no conversation."}},"required":["type","title","assigneeUserIds"],"additionalProperties":false},"SdkV1CreateAction":{"type":"object","properties":{"type":{"$ref":"#/components/schemas/ActionType"},"title":{"type":"string","minLength":1,"maxLength":500,"description":"What you are asking for, as the people asked see it in the email and on the action.","example":"Sign the account application"},"description":{"type":"string","maxLength":5000,"description":"More about what you need, shown to the people asked under the title."},"assigneeUserIds":{"type":"array","items":{"type":"string"},"minItems":1,"maxItems":50,"description":"Who to ask. Every id must be a user in your organization; invite anyone who isn't yet with `POST /v1/users`."},"sides":{"type":"array","items":{"type":"object","properties":{"sideId":{"type":"string","minLength":1,"maxLength":40,"description":"The id of a side in `config.collaboration.sides`.","example":"client"},"assigneeUserIds":{"type":"array","items":{"type":"string"},"minItems":1,"maxItems":50,"description":"The people on this side. Each must also be in `assigneeUserIds`."}},"required":["sideId","assigneeUserIds"],"additionalProperties":false},"minItems":2,"maxItems":6,"description":"Required for `DOCUMENT_COLLABORATION` taking turns (`config.collaboration.mode` `take_turns`), and refused for every other type, and for a collaboration written together (`edit_together`) or reviewed without editing (`comment_only`), which have no sides. Says who is on which side: every side in `config.collaboration.sides` needs at least one person, each person in `assigneeUserIds` is on exactly one side, and nobody is on a side without being in `assigneeUserIds`."},"dueAt":{"type":"string","format":"date-time","description":"When it is due, as an ISO 8601 date and time. Leave it out for no due date.","example":"2026-11-30T17:00:00Z"},"completionMode":{"type":"string","enum":["ANY_ONE","ALL","MAJORITY","SEQUENTIAL"],"description":"How several people share one action. Leave it out unless you mean to choose: the default is `ALL` for an acknowledgement or a signature and `ANY_ONE` for everything else, so sending a value can turn \"everyone must acknowledge this\" into \"any one of you will do\". Not every type takes every rule (a decision is settled by whoever decides first, a poll by every voter), and a rule a type can't follow is refused, not ignored. A `DOCUMENT_COLLABORATION` written together (`edit_together`) takes `ANY_ONE`, `MAJORITY` or `ALL` (the default): how many of the people must approve the same text. One reviewed without editing (`comment_only`) takes `ANY_ONE`, `MAJORITY`, `ALL` (the default) or `SEQUENTIAL` (one at a time, in the order of `assigneeUserIds`): who has to mark it reviewed. One taking turns takes none: the sides agreeing completes it."},"config":{"type":"object","additionalProperties":{},"description":"The type's own setup: the document to sign, the fields to fill, the options to choose between. Shapes follow the step type of the same name. For `DOCUMENT_COLLABORATION`, `collaboration.mode` says how people work: `take_turns` (sides revise files in turn; documents name a file with `ref`, and `sides` says who is on each), or `edit_together` (everyone asked writes the documents together in Moxo, then approves the same text), or `comment_only` (everyone asked reads the documents and comments on them, nobody edits; when the review completes, each document gets a reviewed copy carrying every comment). Written together, each document is `{ \"key\", \"name\"?, \"content\"? }`, `content` being its starting text in Markdown (headings, paragraphs, lists, bold, italic and links); nothing else is taken there. Reviewed without editing, each document is `{ \"key\", \"name\"?, \"ref\" }` (a file) or `{ \"key\", \"name\"?, \"content\" }` (Markdown), never both.","example":{"collaboration":{"mode":"edit_together","documents":[{"key":"policy","name":"Client onboarding policy","content":"# Before kickoff\n\n- Signed statement of work on file"}]}}},"customReminders":{"$ref":"#/components/schemas/CustomReminders"}},"required":["type","title","assigneeUserIds"],"additionalProperties":false},"SdkSessionMintRequest":{"type":"object","properties":{"uniqueId":{"type":"string","minLength":1,"maxLength":128,"description":"The person's Unique ID in your organization (needs the Unique ID feature), matched without regard to case. When you send it, it alone says who the person is: do not send `userId` with it (`400 IDENTITY_AMBIGUOUS`). You may send the person's `email` with it; if that email belongs to someone else in your organization, the call returns `409 EMAIL_BELONGS_TO_ANOTHER_USER` and no session is created. An email-shaped Unique ID is still a Unique ID. Prefer this when you identify people by a customer or employee number.","example":"cust_984431"},"email":{"type":"string","format":"email","description":"The person's email, matched without regard to case. Without `uniqueId`, it names the person, and you send exactly one of `email` and `userId`. With `uniqueId`, it is checked, not used to find the person: it must be that person's email or one no one else in your organization has (`409 EMAIL_BELONGS_TO_ANOTHER_USER` otherwise). Handy for demos and quick starts.","example":"jordan@client.example"},"userId":{"type":"string","description":"The person's user id. Send it on its own: not with `email`, and not with `uniqueId`. Use it in production: it stays the same when the person's email changes. Takes either form of the id: the `usr_…` id that `/sdk/v1` responses carry (assignees, chat `authorUserId`, `/sdk/v1/me`) or the UUID that notification links carry in `user_id`. An unknown id gets the same response in either form.","example":"usr_2f8a1c90d4b34e6f"},"personaId":{"type":"string","description":"The persona the session uses, by id. It stays the same when the persona is renamed, so use it in production. Send at most one of `personaId` and `personaName`.","example":"persona_9f2b1c"},"personaName":{"type":"string","description":"The persona the session uses, by name, matched without regard to case among the person's personas. Handy for demos, but it stops matching when an admin renames the persona, so use `personaId` in production. Send at most one of `personaId` and `personaName`.","example":"Customer"},"portalId":{"type":"string","description":"The portal the session opens in. Required when the persona can use more than one portal, and chosen for you when it can use exactly one. Leave it out for orchestrator portal and magic link personas. When it is missing, the call returns `400 PORTAL_REQUIRED`; missing or not matching, the error lists every portal the persona can use in `error.details[]`.","example":"prt_9c2e1b"},"ttlSeconds":{"type":"integer","exclusiveMinimum":0,"maximum":3600,"description":"Reserved; at most 3600. A session lasts 15 minutes whatever you send. For longer use, rely on the SDK, which renews the session in the background.","example":900},"unique_id":{"type":"string","minLength":1,"maxLength":128,"deprecated":true,"description":"Deprecated: use `uniqueId`."},"user_id":{"type":"string","deprecated":true,"description":"Deprecated: use `userId`."},"persona_id":{"type":"string","deprecated":true,"description":"Deprecated: use `personaId`."},"persona_name":{"type":"string","deprecated":true,"description":"Deprecated: use `personaName`."},"portal_id":{"type":"string","deprecated":true,"description":"Deprecated: use `portalId`."},"ttl_seconds":{"type":"integer","exclusiveMinimum":0,"maximum":3600,"deprecated":true,"description":"Deprecated: use `ttlSeconds`."}},"additionalProperties":false},"SdkSessionMintResponse":{"type":"object","properties":{"session_token":{"type":"string","description":"The short-lived session token, a JWT. Return it from `fetchSessionToken` in `@moxo/sdk`, or send it as the Bearer token on `/sdk/v1/*` calls. This response is not wrapped in `{ success, data }`.","example":"eyJhbGciOiJSUzI1NiIs…"},"expires_at":{"type":"integer","description":"When the session expires, as a Unix timestamp in seconds. Defaults to 15 minutes after the session was created.","example":1774003500},"jti":{"type":"string","description":"The token's unique id. Pass it to `DELETE /sdk/auth/sessions/{jti}` to revoke this session early.","example":"a1b2c3d4-0000-4000-8000-000000000001"},"user":{"type":"object","properties":{"id":{"type":"string","description":"The person's user id in this organization (`usr_…`).","example":"usr_123"},"email":{"type":["string","null"],"description":"The person's email. `null` for a person added by `uniqueId` alone.","example":"jordan@client.example"},"uniqueId":{"type":["string","null"],"description":"The person's unique ID in your organization, or `null` when they have none: which of your own ids the session is for.","example":"cust_984431"},"name":{"type":"string","example":"Jordan Client"}},"required":["id","email","uniqueId","name"],"description":"The person the session acts as."},"persona":{"type":"object","properties":{"id":{"type":"string","example":"persona_9f2b1c"},"name":{"type":"string","example":"Customer"},"kind":{"type":"string","description":"Whether the persona is for `internal` or `external` users.","example":"external"},"targetType":{"type":"string","enum":["magic_link","portal","orchestrator_portal"],"description":"The surface class the session is minted for.","example":"magic_link"},"target_type":{"type":"string","enum":["magic_link","portal","orchestrator_portal"],"deprecated":true,"description":"Deprecated alias of `targetType`. The mint response still includes this snake_case field beside camelCase for existing typed SDK consumers.","example":"magic_link"}},"required":["id","name","kind","targetType","target_type"],"description":"The persona the session resolved to."},"portalId":{"type":["string","null"],"description":"The portal the session is for. When you didn't send `portalId`, this is the portal chosen for you. `null` for orchestrator portal and magic link personas.","example":null},"portal_id":{"type":["string","null"],"deprecated":true,"description":"Deprecated alias of `portalId`. The mint response still includes this snake_case field beside camelCase for existing typed SDK consumers.","example":null}},"required":["session_token","expires_at","jti","user","persona","portalId","portal_id"],"additionalProperties":false},"ProvisionSignupRequest":{"type":"object","properties":{"email":{"type":"string","format":"email","description":"The email address to verify. A one-time code is sent to it.","example":"dev@example.com"}},"required":["email"],"additionalProperties":false},"ProvisionSignupResponse":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"message":{"type":"string","description":"The same acknowledgement for every address. It never says whether the address is registered, blocked or new."}},"required":["message"],"additionalProperties":false}},"required":["success","data"],"additionalProperties":false},"ProvisionVerifyRequest":{"type":"object","properties":{"email":{"type":"string","format":"email"},"code":{"type":"string","minLength":4,"maxLength":12,"description":"The one-time code from the verification email. Codes expire in 10 minutes; 5 attempts are allowed."}},"required":["email","code"],"additionalProperties":false},"ProvisionVerifyResponse":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"grant":{"type":"string","description":"A single-use grant tied to the verified email. Use it on `POST /v1/provision/orgs` within 15 minutes."},"expiresInSeconds":{"type":"integer"},"next":{"type":"string"}},"required":["grant","expiresInSeconds","next"],"additionalProperties":false}},"required":["success","data"],"additionalProperties":false},"ProvisionCreateOrgRequest":{"type":"object","properties":{"grant":{"type":"string","description":"The grant from `POST /v1/provision/verify`. It can be used once."},"name":{"type":"string","minLength":2,"maxLength":100,"description":"The organization name. Reserved brand names are refused.","example":"Ledgerline Accounting"},"allowedOrigins":{"type":"array","items":{"type":"string"},"maxItems":20,"description":"Browser origins that may hold SDK sessions: https, host only, for example `https://app.example.com`. Optional. Without any, the organization can't create SDK sessions until an admin adds origins in **Settings → Web SDK** (admins only; it appears once the Web SDK is on for your organization)."},"notificationTargets":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","description":"Your endpoint. Notification links point here instead of the Moxo app, with the event and object ids appended as query parameters.","example":"https://app.example.com/moxo"},"personas":{"type":"array","items":{"type":"string","enum":["orchestrator_portal","portal","magic_link"]},"minItems":1,"description":"Which recipients this target applies to. First match wins, so list the most specific target first."},"label":{"type":"string","maxLength":100,"description":"Your own name for this target. Shown in Settings; never sent anywhere."},"forwardActionTokens":{"type":"boolean","description":"Send the recipient's sign-in token with the link, for magic link recipients only. The token signs that person in, so treat it as a secret and exchange it server to server."}},"required":["url","personas"],"additionalProperties":false},"maxItems":10,"description":"Where notification links point for this organization. Optional: without targets, links point to the Moxo app. This is the only way to set them without signing in, so a fully automated setup can set them when it creates the organization. It applies only when the organization is created: if this call completes an organization that already has SDK settings, those settings are kept and this field is ignored."}},"required":["grant","name"],"additionalProperties":false},"ProvisionCreateOrgResponse":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"organizationId":{"type":"string"},"slug":{"type":"string"},"apiKey":{"type":"object","properties":{"id":{"type":"string"},"token":{"type":"string","description":"The organization API key, returned exactly once. Store it server-side; it is never shown again."},"tokenPreview":{"type":"string"},"scopes":{"type":"array","items":{"type":"string"},"description":"The key's first scopes: SDK sessions, flows, reading templates and external users (to invite your first client). An admin can add more in **Settings → API keys**. The key acts as the organization and cannot build, change or publish a template: use `personalAccessToken` for that."},"expiresAt":{"type":["string","null"]}},"required":["id","token","tokenPreview","scopes","expiresAt"],"additionalProperties":false},"personalAccessToken":{"type":"object","properties":{"id":{"type":"string","description":"The token's id. It is listed under **Settings → Personal access tokens**, where you can revoke it."},"token":{"type":"string","description":"Your personal access token, returned exactly once. It acts as you, with your permissions as the organization's admin: use it to build, change and publish templates (for example `POST /v1/ai/generations`), which only a person can do. Store it server-side; it is never shown again."},"tokenPreview":{"type":"string","description":"The token's first characters, to tell it apart in Settings. It does not work as a token."},"expiresAt":{"type":["string","null"],"description":"When the token stops working (ISO 8601), 90 days after it is created, like the organization API key."}},"required":["id","token","tokenPreview","expiresAt"],"additionalProperties":false,"description":"A personal access token for you, the organization's first admin. Build and publish templates with it; use `apiKey` for what the organization does."},"plan":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"limits":{"type":"object","additionalProperties":{},"description":"The sandbox quotas (flows per month, AI credits, members, storage, daily emails, SDK sessions per day)."}},"required":["id","name","limits"],"additionalProperties":false},"recovered":{"type":"boolean","description":"`true` when this request finished an earlier attempt that created the organization but failed before returning its tokens."},"grantTtlSeconds":{"type":"integer"},"next":{"type":"string"}},"required":["organizationId","slug","apiKey","personalAccessToken","plan","recovered","grantTtlSeconds","next"],"additionalProperties":false}},"required":["success","data"],"additionalProperties":false},"DataTableColumn":{"type":"object","properties":{"id":{"type":"string","description":"The column's permanent id. Records are keyed by `key`, not by this, but you can store the id instead if you prefer, and either one works anywhere a write names a column.","example":"9f8c1e42-6b1f-4a7e-9a3d-2c5b8e0f4c5a"},"key":{"type":"string","description":"A URL-safe key made from the column's name when the column was created. It never changes, even when the column is renamed, and it belongs to that column for good: a column added later with the name of a removed one gets a key of its own (`spend_2`), and a write naming the removed column's key is refused. A record's `values` are keyed by it, and it is safe to store.","example":"vendor_name"},"name":{"type":"string","description":"The column's name.","example":"Vendor Name"},"type":{"type":"string","enum":["text","number","date","timestamp","single_select","email","checkbox","phone","url","file"],"description":"The kind of value the column holds. Set when the column is created and cannot be changed afterwards.","example":"text"},"required":{"type":"boolean","description":"Whether a value is required when a record is created. It isn't applied to existing records, so turning it on doesn't affect records already saved without a value."},"unique":{"type":"boolean","description":"Present only when the column is unique: each value can appear on only one live row. Email comparisons ignore case, and a blank cell is not a value. Absent when the column allows duplicates."},"config":{"description":"Type-specific settings, present only for the types that have any: `single_select` carries `options`, `number` carries `precision`, `timestamp` carries `displayTimezone`, `file` carries `multiple`."}},"required":["id","key","name","type","required"],"additionalProperties":false},"DataTableSummary":{"type":"object","properties":{"id":{"type":"string","example":"3b1d7c90-2f44-4e18-8a6b-7c9e1d5f3a20"},"name":{"type":"string","example":"Vendors"},"slug":{"type":"string","description":"A URL-safe key made from the table's name when the table was created. It doesn't change when the table is renamed, and it isn't reused after the table is deleted: a new table with the same name gets a new slug, such as `vendors_2`.","example":"vendors"},"description":{"type":["string","null"],"example":"Approved suppliers and their billing contacts."},"columns":{"type":"array","items":{"$ref":"#/components/schemas/DataTableColumn"},"description":"The table's live columns, in display order. Archived columns are not listed."},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","name","slug","description","columns","createdAt","updatedAt"],"additionalProperties":false},"DataTable":{"type":"object","properties":{"id":{"type":"string","example":"3b1d7c90-2f44-4e18-8a6b-7c9e1d5f3a20"},"name":{"type":"string","example":"Vendors"},"slug":{"type":"string","description":"A URL-safe key made from the table's name when the table was created. It doesn't change when the table is renamed, and it isn't reused after the table is deleted: a new table with the same name gets a new slug, such as `vendors_2`.","example":"vendors"},"description":{"type":["string","null"],"example":"Approved suppliers and their billing contacts."},"columns":{"type":"array","items":{"$ref":"#/components/schemas/DataTableColumn"},"description":"The table's live columns, in display order. Archived columns are not listed."},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"recordCount":{"type":"integer","description":"How many records the table holds. Returned when you read a single table; the list endpoint does not include it."}},"required":["id","name","slug","description","columns","createdAt","updatedAt","recordCount"],"additionalProperties":false},"DataTableRecord":{"type":"object","properties":{"id":{"type":"string","example":"c1a4f8e2-9d3b-4c67-8e15-0b2f6a9d4c31"},"values":{"type":"object","additionalProperties":{},"description":"The record's cells, keyed by each column's `key`. Keys are set when a column is created and never change, even when the column is renamed, so a mapping you store keeps working.\n\n**Every live column is present, in the same order as `columns[]`, with `null` where the record has no value.** Every record on a page has the same shape, and `values` lines up one-for-one with the column list. Archived columns appear in neither.","example":{"vendor_name":"Acme Cloud Inc","billing_email":null}},"version":{"type":"integer","description":"A counter that goes up by one every time this record is updated. **Most integrations can ignore it.**\n\nIt is here for one case: a new value you worked out from the old one. Read `spend` as 1200, add 300, write 1500. If someone else added 500 in between, your write erases theirs. Send this number back as `version` on the `PATCH` and the request returns `409` instead, so you can read the record again and redo the sum against the current figure.\n\nYou don't need it to protect other columns. A `PATCH` only changes the columns you send, so two systems writing different columns never overwrite each other.","example":3},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","values","version","createdAt","updatedAt"],"additionalProperties":false},"CreateDataTableRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100,"example":"Vendors"},"description":{"type":"string","maxLength":500},"columns":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100,"example":"Vendor Name"},"type":{"type":"string","enum":["text","number","date","timestamp","single_select","email","checkbox","phone","url","file"],"description":"The kind of value the column holds. Set when the column is created and cannot be changed afterwards.","example":"text"},"config":{"description":"Settings for this kind of column, as an object.\n\nSix of the ten column types take no settings: `text`, `date`, `email`, `checkbox`, `phone` and `url`. Leave `config` out for those; sending anything for them, even an empty string, is refused. A `date` value is a day on the calendar written `YYYY-MM-DD`: `2027-02-30` is refused.\n\nThese four take settings:\n\n- `single_select` (required): `{\"options\": [{\"id\": \"active\", \"label\": \"Active\", \"color\": \"jade\"}]}`. The dropdown's choices, 1 to 100 options. `id` is what a record stores, `label` is what a person sees, and `color` is optional.\n- `number` (optional): `{\"precision\": 2}`. Decimal places to show, 0 to 10. It doesn't change what is stored.\n- `timestamp` (optional): `{\"displayTimezone\": \"America/New_York\"}`. The IANA time zone that a time without a zone is read and written in. Defaults to the organization's time zone when the column is created. A cell always stores an absolute UTC time; this setting only decides how a time is placed and shown.\n- `file` (optional): `{\"multiple\": true}`. Lets one cell hold several files, up to 20. Defaults to one file.\n\nOn update, leaving out `config` keeps an existing column's settings. It doesn't clear them.","example":{"options":[{"id":"active","label":"Active"}]}},"required":{"type":"boolean","description":"Whether a value is required when a record is created. It isn't applied to existing records. A new column defaults to `false`; on update, leave it out to keep the column as it is."},"unique":{"type":"boolean","description":"When `true`, each value can appear on only one live row. Email comparisons ignore case, and a blank cell is not a value. On update, leave it out to keep the column as it is, or send `false` to allow duplicates. A file or checkbox column can't be unique. Turning it on while two live rows share a value is refused."}},"required":["name","type"],"additionalProperties":false},"minItems":1,"maxItems":300,"description":"The table's columns, in the order they should appear. At least one."}},"required":["name","columns"],"additionalProperties":false},"ReplaceDataTableRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100,"description":"Omit to leave the name as it is."},"description":{"type":["string","null"],"maxLength":500,"description":"Send `null` to clear it. Omit to leave it as it is."},"columns":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The id of an existing column. Required to rename a column: without an `id` or `key`, a changed name means removing that column and adding a new one. Leave it out for a column you are adding."},"key":{"type":"string","description":"The `key` of an existing column. Used only when `id` is absent."},"name":{"type":"string","minLength":1,"maxLength":100,"example":"Vendor Name"},"type":{"type":"string","enum":["text","number","date","timestamp","single_select","email","checkbox","phone","url","file"],"description":"The kind of value the column holds. Set when the column is created and cannot be changed afterwards.","example":"text"},"config":{"description":"Settings for this kind of column, as an object.\n\nSix of the ten column types take no settings: `text`, `date`, `email`, `checkbox`, `phone` and `url`. Leave `config` out for those; sending anything for them, even an empty string, is refused. A `date` value is a day on the calendar written `YYYY-MM-DD`: `2027-02-30` is refused.\n\nThese four take settings:\n\n- `single_select` (required): `{\"options\": [{\"id\": \"active\", \"label\": \"Active\", \"color\": \"jade\"}]}`. The dropdown's choices, 1 to 100 options. `id` is what a record stores, `label` is what a person sees, and `color` is optional.\n- `number` (optional): `{\"precision\": 2}`. Decimal places to show, 0 to 10. It doesn't change what is stored.\n- `timestamp` (optional): `{\"displayTimezone\": \"America/New_York\"}`. The IANA time zone that a time without a zone is read and written in. Defaults to the organization's time zone when the column is created. A cell always stores an absolute UTC time; this setting only decides how a time is placed and shown.\n- `file` (optional): `{\"multiple\": true}`. Lets one cell hold several files, up to 20. Defaults to one file.\n\nOn update, leaving out `config` keeps an existing column's settings. It doesn't clear them.","example":{"options":[{"id":"active","label":"Active"}]}},"required":{"type":"boolean","description":"Whether a value is required when a record is created. It isn't applied to existing records. A new column defaults to `false`; on update, leave it out to keep the column as it is."},"unique":{"type":"boolean","description":"When `true`, each value can appear on only one live row. Email comparisons ignore case, and a blank cell is not a value. On update, leave it out to keep the column as it is, or send `false` to allow duplicates. A file or checkbox column can't be unique. Turning it on while two live rows share a value is refused."}},"required":["name","type"],"additionalProperties":false},"minItems":1,"maxItems":300,"description":"Every column the table should have, in display order. A live column this list doesn't name is archived. Leave `columns` out to keep the columns as they are."}},"additionalProperties":false},"CreateDataTableRecordsRequest":{"type":"object","properties":{"records":{"type":"array","items":{"type":"object","properties":{"values":{"type":"object","additionalProperties":{},"description":"The cells to set. Each key names a column by its `id`, its `key`, or its `name` (case-insensitive), whichever you have. An unrecognized key is rejected rather than ignored, so a typo can never look like a successful write.","example":{"vendor_name":"Acme Cloud Inc","billing_email":"ap@acme.co"}}},"required":["values"],"additionalProperties":false},"minItems":1,"maxItems":1000,"description":"The records to add. Up to 1000 per request."}},"required":["records"],"additionalProperties":false},"UpdateDataTableRecordRequest":{"type":"object","properties":{"values":{"type":"object","additionalProperties":{},"description":"The cells to set. Each key names a column by its `id`, its `key`, or its `name` (case-insensitive), whichever you have. An unrecognized key is rejected rather than ignored, so a typo can never look like a successful write.","example":{"vendor_name":"Acme Cloud Inc","billing_email":"ap@acme.co"}},"version":{"type":"integer","minimum":0,"description":"Leave it out and your update is applied as sent, which is what most integrations want.\n\nSend the `version` you read if your new value was worked out from the old one (adding to a running total, advancing a status). If the record changed after you read it, the request returns `409`, naming both versions, and nothing is written, so you can read the record again and retry against the current value.","example":3}},"required":["values"],"additionalProperties":false},"ImportDataTableCsvRequest":{"type":"object","properties":{"csv":{"type":"string","minLength":1,"description":"The CSV itself. The first row must be a header naming the table's columns: each column's name or its key, in any order, case-insensitive. You can also send the file as `multipart/form-data`, in a `file` part.","example":"Vendor Name,Spend,Status\nAcme Cloud Inc,1200,active\n"}},"required":["csv"],"additionalProperties":false},"DataTableWriteResult":{"type":"object","properties":{"created":{"type":"integer","description":"Records written."},"failed":{"type":"integer","description":"Records rejected."},"errors":{"type":"array","items":{"type":"object","properties":{"index":{"type":"integer","description":"Which entry failed, as a 0-based index into the `records` array you sent."},"message":{"type":"string","example":"Field \"Age\" expects a finite number"}},"required":["index","message"],"additionalProperties":false},"description":"One entry per rejected record. A rejected record is rolled back on its own, so one bad record doesn't stop the rest from being saved."}},"required":["created","failed","errors"],"additionalProperties":false},"DataTableImportResult":{"type":"object","properties":{"created":{"type":"integer"},"failed":{"type":"integer"},"errors":{"type":"array","items":{"type":"object","properties":{"row":{"type":"integer","description":"The line in the file, counting the header as line 1. `1` marks a header-level warning."},"message":{"type":"string"}},"required":["row","message"],"additionalProperties":false}},"rowLimit":{"type":"integer","description":"Rows a single import accepts, so you can split a larger file without guessing."}},"required":["created","failed","errors","rowLimit"],"additionalProperties":false},"PublicRelationship":{"type":"object","properties":{"id":{"type":"string","description":"The relationship's id. Name it by this in any call that takes one relationship.","example":"8a311e66-c173-4b06-9c2f-6763d1557591"},"externalRef":{"type":["string","null"],"description":"Your own key for this relationship — a core banking customer number, a CRM id — unique in the organization. Calls that take one relationship accept it in place of the `id`. Null when nobody gave this relationship a reference: one made in the app has none unless someone set it.","example":"ACC-123"},"name":{"type":"string","description":"The relationship's name.","example":"Hartwell family"},"conversationId":{"type":["string","null"],"description":"The relationship's one conversation, the same id `GET /v1/conversations` returns. Null until it has been opened — the room is made by its first message. With it you address the room directly: `/v1/conversations/{conversationId}/messages`, `…/files`, `…/actions` and the rest.","example":"7b2f1e44-9c3a-4d18-bb57-1f0a2c6d8e91"},"source":{"type":"string","enum":["manual","import","api"],"description":"`manual` was made in Moxo. `import` and `api` are owned by the feed, and only those can be changed here."},"party":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["people"],"description":"The relationship is built on named people."},"people":{"type":"array","items":{"type":"object","properties":{"userId":{"type":"string","description":"The person's id (`usr_…`), stable in this organization.","example":"usr_robert"},"displayName":{"type":"string","description":"The name shown for this person in the organization.","example":"Robert Hartwell"},"email":{"type":["string","null"],"description":"The person's email address. Null when this organization knows them by a unique ID instead.","example":"robert@hartwell.test"},"uniqueId":{"type":["string","null"],"description":"Your organization's own key for this person (Partner unique ID). Null when unset.","example":"CUST-50817"}},"required":["userId","displayName","email","uniqueId"],"additionalProperties":false},"description":"The external people this relationship is for."}},"required":["kind","people"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["account"],"description":"The relationship is built on an account, and follows who belongs to it."},"accountId":{"type":"string","description":"The account's id, the same id `GET /v1/accounts` returns.","example":"acc_hartwell"},"name":{"type":"string","description":"The account's name.","example":"Hartwell family"}},"required":["kind","accountId","name"],"additionalProperties":false}],"description":"Who the relationship is for: named people, or an account and everyone in it."},"team":{"type":"array","items":{"type":"object","properties":{"userId":{"type":"string","description":"The person's id (`usr_…`), stable in this organization.","example":"usr_robert"},"displayName":{"type":"string","description":"The name shown for this person in the organization.","example":"Robert Hartwell"},"email":{"type":["string","null"],"description":"The person's email address. Null when this organization knows them by a unique ID instead.","example":"robert@hartwell.test"},"uniqueId":{"type":["string","null"],"description":"Your organization's own key for this person (Partner unique ID). Null when unset.","example":"CUST-50817"},"title":{"type":["string","null"],"description":"Their job title in your organization, as People holds it, or null when they have none. A seat on a relationship carries no title of its own, so this is the same title everywhere they appear.","example":"Relationship manager"},"isLead":{"type":"boolean","description":"Whether this person leads the relationship. Exactly one lead when the team is not empty."}},"required":["userId","displayName","email","uniqueId","title","isLead"],"additionalProperties":false},"description":"The people at the organization who look after this relationship. The lead is marked `isLead`."},"createdAt":{"type":"string","format":"date-time","description":"When the relationship was created, ISO 8601."},"updatedAt":{"type":"string","format":"date-time","description":"When the relationship was last changed, ISO 8601."}},"required":["id","externalRef","name","conversationId","source","party","team","createdAt","updatedAt"],"additionalProperties":false},"CreateRelationshipRequest":{"type":"object","properties":{"name":{"type":"string","maxLength":200,"description":"The relationship's name. Worked out from the party when you leave it out.","example":"Hartwell family"},"party":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["people"],"description":"Build it on named people. Send `emails`, `userIds`, `uniqueIds`, or any mix of them."},"emails":{"type":"array","items":{"type":"string","format":"email"},"maxItems":200,"description":"Email addresses of the external users. An address that is not yet a person in this organization is created, and no invitation is sent."},"userIds":{"type":"array","items":{"type":"string"},"maxItems":200,"description":"Public ids (`usr_…`) of external users already in the organization."},"uniqueIds":{"type":"array","items":{"type":"string"},"maxItems":200,"description":"Unique IDs of external users already in the organization (with Partner unique ID on). A unique ID no one has is refused with `400 UNKNOWN_PERSON`; it does not add anyone."}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["account"],"description":"Build it on an account, so it follows who belongs to that account."},"accountId":{"type":"string","description":"The account's id from `GET /v1/accounts`."},"accountRef":{"type":"string","maxLength":200,"description":"The account's domain, or its name when no domain matches. Refused when more than one account matches."}},"required":["kind"],"additionalProperties":false}],"description":"Who the relationship is for. Required, and it names someone: people with at least one email, user id or unique ID, or an account."},"team":{"type":"array","items":{"type":"object","properties":{"userId":{"type":"string","description":"The person's public id (`usr_…`). They must already be on the team side of the organization."},"email":{"type":"string","format":"email","description":"The person's email, when you do not have their id. They must already be in the organization. An unknown email is refused, not invited."},"uniqueId":{"type":"string","description":"The person's unique ID (with Partner unique ID on), when you know them by it. Send one of `uniqueId`, `userId` or `email`."},"isLead":{"type":"boolean","description":"Exactly one member of a non-empty team is the lead."}},"additionalProperties":false},"minItems":1,"maxItems":50,"description":"The people who look after it. At least one, exactly one of them the lead. Required: a relationship has two sides and neither is left out."},"externalRef":{"type":"string","maxLength":120,"description":"Your own key for this relationship, if you have one. Unique in the organization; a reference already in use is refused. Left out, the relationship simply has none and is named by its `id`.","example":"ACC-123"}},"required":["party","team"],"additionalProperties":false},"UpdateRelationshipRequest":{"type":"object","properties":{"name":{"type":"string","maxLength":200,"description":"A new name. Omitted, the current name stays.","example":"Hartwell family office"},"party":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["people"],"description":"Build it on named people. Send `emails`, `userIds`, `uniqueIds`, or any mix of them."},"emails":{"type":"array","items":{"type":"string","format":"email"},"maxItems":200,"description":"Email addresses of the external users. An address that is not yet a person in this organization is created, and no invitation is sent."},"userIds":{"type":"array","items":{"type":"string"},"maxItems":200,"description":"Public ids (`usr_…`) of external users already in the organization."},"uniqueIds":{"type":"array","items":{"type":"string"},"maxItems":200,"description":"Unique IDs of external users already in the organization (with Partner unique ID on). A unique ID no one has is refused with `400 UNKNOWN_PERSON`; it does not add anyone."}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["account"],"description":"Build it on an account, so it follows who belongs to that account."},"accountId":{"type":"string","description":"The account's id from `GET /v1/accounts`."},"accountRef":{"type":"string","maxLength":200,"description":"The account's domain, or its name when no domain matches. Refused when more than one account matches."}},"required":["kind"],"additionalProperties":false}],"description":"Replaces who the relationship is for, and names someone. Omitted, the current party stays."},"team":{"type":"array","items":{"type":"object","properties":{"userId":{"type":"string","description":"The person's public id (`usr_…`). They must already be on the team side of the organization."},"email":{"type":"string","format":"email","description":"The person's email, when you do not have their id. They must already be in the organization. An unknown email is refused, not invited."},"uniqueId":{"type":"string","description":"The person's unique ID (with Partner unique ID on), when you know them by it. Send one of `uniqueId`, `userId` or `email`."},"isLead":{"type":"boolean","description":"Exactly one member of a non-empty team is the lead."}},"additionalProperties":false},"minItems":1,"maxItems":50,"description":"Replaces the whole team, and names at least one person. Omitted, the current team stays. A relationship cannot be left unassigned: delete it instead."}},"additionalProperties":false},"RelationshipDeleted":{"type":"object","properties":{"deleted":{"type":"boolean","enum":[true],"description":"Always `true`. The relationship is gone."}},"required":["deleted"],"additionalProperties":false},"RelationshipMessageRequest":{"type":"object","properties":{"body":{"type":"string","minLength":1,"maxLength":20000,"description":"What to say.","example":"Morning — your statements are ready."}},"required":["body"],"additionalProperties":false},"RelationshipMessage":{"type":"object","properties":{"conversationId":{"type":"string","description":"The relationship's conversation. The same id `GET /v1/conversations` returns."},"messageId":{"type":"string","description":"The message just written."},"created":{"type":"boolean","description":"`true` when this message opened the conversation, `false` when it was already there."}},"required":["conversationId","messageId","created"],"additionalProperties":false},"BulkRelationshipsRequest":{"type":"object","properties":{"rows":{"type":"array","items":{"type":"object","properties":{"externalRef":{"type":"string","minLength":1,"maxLength":120,"description":"Your own key for this relationship. The row is matched on it: a reference that is not here yet makes a new relationship, one that is updates it.","example":"ACC-123"},"name":{"type":"string","maxLength":200,"description":"The relationship's name. Left out or blank on a new one, it is worked out from the party; on one that is already here, the stored name is left alone.","example":"Hartwell family"},"party":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["people"],"description":"Build it on named people. Send `emails`, `userIds`, `uniqueIds`, or any mix of them."},"emails":{"type":"array","items":{"type":"string","format":"email"},"maxItems":200,"description":"Email addresses of the external users. An address that is not yet a person in this organization is created, and no invitation is sent."},"userIds":{"type":"array","items":{"type":"string"},"maxItems":200,"description":"Public ids (`usr_…`) of external users already in the organization."},"uniqueIds":{"type":"array","items":{"type":"string"},"maxItems":200,"description":"Unique IDs of external users already in the organization (with Partner unique ID on). A unique ID no one has is refused with `400 UNKNOWN_PERSON`; it does not add anyone."}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["account"],"description":"Build it on an account, so it follows who belongs to that account."},"accountId":{"type":"string","description":"The account's id from `GET /v1/accounts`."},"accountRef":{"type":"string","maxLength":200,"description":"The account's domain, or its name when no domain matches. Refused when more than one account matches."}},"required":["kind"],"additionalProperties":false}],"description":"Who the relationship is for, and it names someone. Required on a new one. Omitted, the current party stays."},"team":{"type":"array","items":{"type":"object","properties":{"userId":{"type":"string","description":"The person's public id (`usr_…`). They must already be on the team side of the organization."},"email":{"type":"string","format":"email","description":"The person's email, when you do not have their id. They must already be in the organization. An unknown email is refused, not invited."},"uniqueId":{"type":"string","description":"The person's unique ID (with Partner unique ID on), when you know them by it. Send one of `uniqueId`, `userId` or `email`."},"isLead":{"type":"boolean","description":"Exactly one member of a non-empty team is the lead."}},"additionalProperties":false},"minItems":1,"maxItems":50,"description":"The whole team, naming at least one person. Omitted, the current team stays. A relationship cannot be left unassigned: delete it instead."}},"required":["externalRef"],"additionalProperties":false},"maxItems":100,"description":"The relationships to write, up to 100. One refused row does not stop the others."}},"required":["rows"],"additionalProperties":false},"BulkRelationshipsResult":{"type":"object","properties":{"created":{"type":"integer","description":"How many rows made a new relationship."},"updated":{"type":"integer","description":"How many rows changed one that was already there."},"unchanged":{"type":"integer","description":"How many rows matched what was already stored, so nothing was written."},"failed":{"type":"integer","description":"How many rows were refused. Each one is in `errors`."},"errors":{"type":"array","items":{"type":"object","properties":{"externalRef":{"type":"string","description":"The reference of the row that was refused."},"code":{"type":"string","description":"Why it was refused, as a stable code."},"message":{"type":"string","description":"The same reason in words."}},"required":["externalRef","code","message"],"additionalProperties":false},"description":"One entry per refused row, in the order they were sent."}},"required":["created","updated","unchanged","failed","errors"],"additionalProperties":false},"RelationshipList":{"type":"object","properties":{"rows":{"type":"array","items":{"$ref":"#/components/schemas/PublicRelationship"},"description":"This page of relationships, ordered by external reference."},"nextCursor":{"type":["string","null"],"description":"Send this as `cursor` for the next page. Null on the last page."}},"required":["rows","nextCursor"],"additionalProperties":false},"ExternalTask":{"type":"object","properties":{"id":{"type":"string","description":"The task id. Use it to extend, complete or fail the task."},"taskName":{"type":"string","example":"verify-account","description":"The Wait’s task name."},"status":{"type":"string","enum":["open","claimed","completed","failed","closed"],"description":"`open`: waiting to be claimed (also a claimed task whose hold ran out). `claimed`: held by a worker until `lockedUntil`. `completed`: finished with values. `failed`: the last try failed, and so did the step. `closed`: the run ended another way (reopened, skipped, canceled or retried)."},"attempt":{"type":"integer","description":"How many times the task has been claimed. While it is held, the number of this claim.","example":1},"maxTries":{"type":"integer","example":3},"triesLeft":{"type":"integer","description":"Tries left before the step fails. Only a failed try uses one; a hold that runs out does not.","example":3},"flow":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"stepId":{"type":"string","description":"The Wait’s template step id.","example":"verify_account"},"stepExecutionId":{"type":"string","description":"This run of the Wait (`steps[].id` on the flow)."},"values":{"type":"object","additionalProperties":{},"description":"The values the Wait sends, as set in the template. Nothing else in the flow is shared.","example":{"account_id":"ACC-4471"}},"lockedUntil":{"type":["string","null"],"description":"While claimed: when the hold runs out."},"claimedBy":{"type":["object","null"],"properties":{"workerName":{"type":["string","null"]},"keyName":{"type":["string","null"]}},"required":["workerName","keyName"],"description":"Who holds the task, only while it is `claimed`: the worker’s `workerName` and the organization API key’s name. `null` once the hold runs out or after a failed try."},"availableAt":{"type":"string","description":"When the task can be claimed (after a failed try’s pause)."},"lastFailureReason":{"type":["string","null"]},"createdAt":{"type":"string"},"completedAt":{"type":["string","null"]}},"required":["id","taskName","status","attempt","maxTries","triesLeft","flow","stepId","stepExecutionId","values","lockedUntil","claimedBy","availableAt","lastFailureReason","createdAt","completedAt"]},"ClaimedExternalTask":{"allOf":[{"$ref":"#/components/schemas/ExternalTask"},{"type":"object","properties":{"lockToken":{"type":"string","description":"Proof that this claim holds the task. Send it with extend, complete and fail. It is shown only here, once: Moxo keeps only a hash of it, and a later claim of the same task gets a new one."}},"required":["lockToken"]}]},"User":{"type":"object","properties":{"id":{"type":"string","description":"The user's id, with the `usr_` prefix. Stable within your organization.","example":"usr_7Kd2mQxWnR4vT9pLcYb3Ae"},"kind":{"type":"string","enum":["internal","external","agent","service"],"description":"What kind of user this is: `internal`, a member of your organization; `external`, someone outside it, such as a client; `agent`, an AI agent; or `service`, an organization API key acting instead of a person.","example":"internal"},"name":{"type":"string","description":"The person's name, as Moxo shows it.","example":"Alex Member"},"email":{"type":["string","null"],"description":"Primary email. `null` for `kind=agent` and `kind=service`, and when the person was onboarded by org-scoped `uniqueId` only.","example":"alex@org.com"},"uniqueId":{"type":["string","null"],"description":"Org-scoped partner identity key when set. `null` when unset. Distinct from opaque `id` (`usr_…`) and from `email`.","example":"cust_984431"}},"required":["id","kind","name","email"],"additionalProperties":false},"Member":{"type":"object","properties":{"id":{"type":"string","description":"The user's id, with the `usr_` prefix. Stable within your organization.","example":"usr_7Kd2mQxWnR4vT9pLcYb3Ae"},"kind":{"type":"string","enum":["internal","external","agent","service"],"description":"What kind of user this is: `internal`, a member of your organization; `external`, someone outside it, such as a client; `agent`, an AI agent; or `service`, an organization API key acting instead of a person.","example":"internal"},"name":{"type":"string","description":"The person's name, as Moxo shows it.","example":"Alex Member"},"email":{"type":["string","null"],"description":"Primary email. `null` for `kind=agent` and `kind=service`, and when the person was onboarded by org-scoped `uniqueId` only.","example":"alex@org.com"},"uniqueId":{"type":["string","null"],"description":"Org-scoped partner identity key when set. `null` when unset. Distinct from opaque `id` (`usr_…`) and from `email`.","example":"cust_984431"},"access":{"type":"string","enum":["participant","manager","viewer"],"description":"The person's access to this flow: `participant` (the default), who holds a role and does its steps; `manager`, a flow manager with full control; or `viewer`, who can only look.","example":"participant"},"roles":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The role's id from the template.","example":"role-buyer-001"},"name":{"type":"string","description":"The role's name.","example":"Customer"}},"required":["id","name"]},"description":"The roles this person holds in the flow. Empty for a flow manager or viewer who holds no role."}},"required":["id","kind","name","email","access","roles"],"additionalProperties":false},"TemplateCustomField":{"type":"object","properties":{"id":{"type":"string","description":"The field's id, the same as `template.customFields[].id`.","example":"field-deal-size"},"key":{"type":"string","description":"The field's key: a readable name that doesn't change. Filter flows by it with `field[key]`.","example":"deal_size"},"label":{"type":"string","description":"The field's label, as people see it (`label`, as the template file and the SDK name it).","example":"Deal Size"},"name":{"type":"string","deprecated":true,"description":"Deprecated: the field's label, the same as `label`. Read `label`; this field is still sent so integrations built on it keep working."},"type":{"type":"string","enum":["TEXT_SINGLE_LINE","TEXT_MULTI_LINE","SINGLE_SELECT","MULTI_SELECT","DROPDOWN","DYNAMIC_DROPDOWN","DATA_TABLE_LOOKUP","FILE_UPLOAD","DATE","NUMBER","EMAIL","PHONE","CURRENCY","CALCULATED","NAME","ADDRESS","SIGNATURE","YES_NO","RATING","NPS","SCALE","MATRIX","RANKING","URL","TIME","HIDDEN","AUTO_NUMBER","COUNTRY_SELECT","REPEATING_GROUP","HEADING","PARAGRAPH","IMAGE","VIDEO","PAGE_BREAK","LINE_SEPARATOR","FIELD_GROUP","TABLE"],"description":"The field's type.","example":"SINGLE_SELECT"},"collectAtStart":{"type":"boolean","description":"Whether the field is asked for when a flow starts. When `true`, send its value in `customFields` on `POST /v1/templates/{id}/start`; otherwise it fills in as the flow runs."},"required":{"type":"boolean","description":"Whether a flow can't start without a value for this field. Applies only when `collectAtStart` is `true`; otherwise always `false`."},"helpText":{"type":"string","description":"The hint shown under the field where people fill it in. Absent when the field has none.","example":"Annual contract value in USD"},"options":{"type":["array","null"],"items":{"type":"object","properties":{"id":{"type":"string","example":"enterprise"},"label":{"type":"string","example":"Enterprise"}},"required":["id","label"]},"description":"The choices, for a `SINGLE_SELECT`, `MULTI_SELECT` or `DROPDOWN` field; `null` for other types."},"showBadge":{"type":"boolean","description":"When `true`, the field shows as a badge in flow lists."},"showBanner":{"type":"boolean","description":"When `true`, the field shows as a banner across the top of the flow page whenever it has a value."}},"required":["id","key","label","type","collectAtStart","required"],"additionalProperties":false},"StepStatus":{"type":"object","properties":{"key":{"type":"string","description":"The status's key: it comes from the status's name and is fixed once the template is published with the status, so a later rename keeps it. Filter steps by it with `customStatus` on `GET /v1/steps`, and send it to `PUT /v1/flows/{id}/steps/{stepId}/custom-status`.","example":"awaiting_counterparty"},"name":{"type":"string","description":"The status as people see it.","example":"Awaiting counterparty"},"color":{"type":"string","enum":["blue","green","red","amber","gray","purple","orange","teal"],"description":"The colour it shows in.","example":"amber"}},"required":["key","name","color"],"additionalProperties":false},"CustomField":{"type":"object","properties":{"id":{"type":"string","description":"The field's id, the same as `template.customFields[].id`.","example":"field-deal-size"},"key":{"type":"string","description":"The field's key: a readable name that doesn't change. Filter flows by it with `field[key]`.","example":"deal_size"},"label":{"type":"string","description":"The field's label, as people see it (`label`, as the template file and the SDK name it).","example":"Deal Size"},"name":{"type":"string","deprecated":true,"description":"Deprecated: the field's label, the same as `label`. Read `label`; this field is still sent so integrations built on it keep working."},"type":{"type":"string","enum":["TEXT_SINGLE_LINE","TEXT_MULTI_LINE","SINGLE_SELECT","MULTI_SELECT","DROPDOWN","DYNAMIC_DROPDOWN","DATA_TABLE_LOOKUP","FILE_UPLOAD","DATE","NUMBER","EMAIL","PHONE","CURRENCY","CALCULATED","NAME","ADDRESS","SIGNATURE","YES_NO","RATING","NPS","SCALE","MATRIX","RANKING","URL","TIME","HIDDEN","AUTO_NUMBER","COUNTRY_SELECT","REPEATING_GROUP","HEADING","PARAGRAPH","IMAGE","VIDEO","PAGE_BREAK","LINE_SEPARATOR","FIELD_GROUP","TABLE"],"description":"The field's type.","example":"SINGLE_SELECT"},"collectAtStart":{"type":"boolean","description":"Whether the field was asked for when the flow started. When `false`, its `value` filled in as the flow ran."},"required":{"type":"boolean","description":"Whether the field needed a value for the flow to start. Applies only when `collectAtStart` is `true`; otherwise always `false`."},"options":{"type":["array","null"],"items":{"type":"object","properties":{"id":{"type":"string","example":"enterprise"},"label":{"type":"string","example":"Enterprise"}},"required":["id","label"]},"description":"The choices, for a `SINGLE_SELECT`, `MULTI_SELECT` or `DROPDOWN` field; `null` for other types."},"value":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"type":"object","additionalProperties":{}},{"type":"null"}],"description":"The field's value: a string for most types, an array of strings for `MULTI_SELECT`, an object for types with parts such as `TEXT_FULLNAME` and `ADDRESS`, or `null` when empty."}},"required":["id","key","label","type","collectAtStart","required","value"],"additionalProperties":false},"FlowApiKeyActor":{"type":"object","properties":{"kind":{"type":"string","enum":["api_key"],"description":"Always `api_key`: an organization API key, not a person."},"id":{"type":"string","description":"The organization API key's id."},"name":{"type":"string","description":"The key's name, as set in Settings → API keys. Empty when the key has since been deleted and no name was recorded."}},"required":["kind","id","name"],"additionalProperties":false,"description":"An organization API key. A key acts as itself, never as a person."},"StartedBy":{"oneOf":[{"type":"object","properties":{"method":{"type":"string","enum":["manual"],"description":"Started by a signed-in person in the orchestrator portal."},"at":{"type":"string","format":"date-time"},"user":{"anyOf":[{"$ref":"#/components/schemas/User"},{"type":"null"}]}},"required":["method","at","user"],"additionalProperties":false},{"type":"object","properties":{"method":{"type":"string","enum":["start_link"],"description":"Started from a start link, with or without signing in."},"at":{"type":"string","format":"date-time"},"user":{"anyOf":[{"$ref":"#/components/schemas/User"},{"type":"null"}]},"portal":{"type":"object","properties":{"id":{"type":"string","example":"portal_acme"},"name":{"type":"string","example":"Acme Customer Portal"},"slug":{"type":"string","example":"acme"}},"required":["id","name","slug"],"additionalProperties":false}},"required":["method","at","user","portal"],"additionalProperties":false},{"type":"object","properties":{"method":{"type":"string","enum":["email"],"description":"Started by an email sent to the template's start address."},"at":{"type":"string","format":"date-time"},"email":{"type":"object","properties":{"from":{"type":"object","properties":{"address":{"type":"string","example":"ana@example.com"},"name":{"type":["string","null"],"example":"Ana Silva"}},"required":["address","name"]},"to":{"type":"string","example":"intake@example.moxo.app"},"subject":{"type":"string","example":"New deal request"},"receivedAt":{"type":"string","format":"date-time","example":"2026-06-04T10:00:00.000Z"}},"required":["from","to","subject","receivedAt"],"additionalProperties":false}},"required":["method","at","email"],"additionalProperties":false},{"type":"object","properties":{"method":{"type":"string","enum":["app_event"],"description":"Started by an event in a connected app, such as HubSpot, Zoho or Salesforce."},"at":{"type":"string","format":"date-time"},"app":{"type":"object","properties":{"provider":{"type":"string","example":"hubspot"},"objectType":{"type":"string","example":"ticket"},"objectLabel":{"type":"string","example":"Ticket #4231: Login issue"},"fields":{"type":"object","additionalProperties":{"type":"string"},"description":"The app record's fields when the event happened.","example":{"stage":"open"}}},"required":["provider","objectType","objectLabel","fields"],"additionalProperties":false}},"required":["method","at","app"],"additionalProperties":false},{"type":"object","properties":{"method":{"type":"string","enum":["flow_step"],"description":"Started by a step in another flow: a Sub-flow (`sub_flow`), a Start a flow step (`fire_and_forget`), or a schedule that a Schedule a flow step created (`scheduled`). No person is named; a scheduled run has an owner, but that owner didn't start it. `parent` names the flow only when you can open it, and the step only when you can see it."},"kind":{"type":"string","enum":["sub_flow","fire_and_forget","scheduled"]},"at":{"type":"string","format":"date-time"},"parent":{"type":"object","properties":{"flowId":{"type":"string","example":"flow_abc123"},"flowName":{"type":"string","example":"Master Onboarding"},"stepExecutionId":{"type":"string","example":"se_xyz789"},"stepName":{"type":"string","example":"Start KYC sub-flow"},"templateName":{"type":["string","null"],"example":"Onboarding Master"}},"required":["flowId","flowName","stepExecutionId","stepName","templateName"],"additionalProperties":false}},"required":["method","kind","at","parent"],"additionalProperties":false},{"type":"object","properties":{"method":{"type":"string","enum":["webhook"],"description":"Started by a call to the template's incoming webhook, from a system rather than a person."},"at":{"type":"string","format":"date-time"},"webhook":{"type":"object","properties":{"source":{"type":["string","null"],"description":"The label of the integration that called the webhook, when it sent one.","example":null},"receivedAt":{"type":"string","format":"date-time","example":"2026-06-29T10:00:00.000Z"}},"required":["source","receivedAt"],"additionalProperties":false}},"required":["method","at","webhook"],"additionalProperties":false},{"type":"object","properties":{"method":{"type":"string","enum":["api"],"description":"Started with an organization API key (`POST /v1/flows` or the MCP `start_flow` tool). The key starts as itself: no person is the starter, so no one is seated in a role filled by the person who starts the flow unless the start named them in `roleAssignments`."},"at":{"type":"string","format":"date-time","description":"When the flow started."},"apiKey":{"$ref":"#/components/schemas/FlowApiKeyActor"}},"required":["method","at","apiKey"],"additionalProperties":false},{"type":"object","properties":{"method":{"type":"string","enum":["schedule"],"description":"Started by a schedule someone set up (on the Schedules page, `POST /v1/schedules` or MCP `manage_template_triggers` `add_schedule`). No person is named: the schedule's owner set it up but didn't start this run. A schedule a Schedule a flow step made is `flow_step` with `kind: scheduled`."},"at":{"type":"string","format":"date-time","description":"When the flow started."},"schedule":{"type":"object","properties":{"id":{"type":"string","description":"The schedule's id, as `GET /v1/schedules` lists it."},"name":{"type":"string","description":"The schedule's name when this run started."}},"required":["id","name"],"additionalProperties":false,"description":"The schedule that started this run."}},"required":["method","at","schedule"],"additionalProperties":false},{"type":"object","properties":{"method":{"type":"string","enum":["data_table"],"description":"Started by a data table trigger: a row was added or changed, or a date in a row came due. No person is the starter. `requestedBy` is the person who added or changed the row, when a person did."},"at":{"type":"string","format":"date-time","description":"When the flow started."},"dataTable":{"type":"object","properties":{"id":{"type":"string","description":"The data table's id."},"name":{"type":"string","description":"The data table's name when this flow started."}},"required":["id","name"],"additionalProperties":false,"description":"The data table that started this flow."},"requestedBy":{"anyOf":[{"$ref":"#/components/schemas/User"},{"type":"null"}],"description":"The person who added or changed the row. Null when no person did (a date came due, or an automation wrote the row) or when you can't see them."}},"required":["method","at","dataTable","requestedBy"],"additionalProperties":false},{"type":"object","properties":{"method":{"type":"string","enum":["system"],"description":"Started by Moxo itself, not by a person, key, trigger or flow."},"at":{"type":"string","format":"date-time","description":"When the flow started."}},"required":["method","at"],"additionalProperties":false},{"type":"object","properties":{"method":{"type":"string","enum":["legacy"],"description":"Started before Moxo recorded how flows start; who started it is unknown."},"at":{"type":"string","format":"date-time","description":"When the flow started."}},"required":["method","at"],"additionalProperties":false}],"description":"Who or what started the flow, by `method`. New methods can be added: treat a `method` you don't know as \"started some other way\"."},"PathStep":{"type":"object","properties":{"id":{"type":["string","null"],"description":"This run of the step. `null` until it starts, and when it runs once for each item."},"stepId":{"type":"string","description":"The step on the flow."},"type":{"type":"string","description":"The step type, such as `FORM`."},"name":{"type":"string","description":"The step's name."},"executionId":{"type":["string","null"],"deprecated":true,"description":"Deprecated: this run of the step, the same as `id`. Read `id`; this field is still sent so integrations built on it keep working."},"stepName":{"type":"string","deprecated":true,"description":"Deprecated: the step's name, the same as `name`. Read `name`; this field is still sent so integrations built on it keep working."},"stepType":{"type":"string","deprecated":true,"description":"Deprecated: the step's type, the same as `type`. Read `type`; this field is still sent so integrations built on it keep working."},"status":{"type":"string","enum":["PENDING","AWAITING_HOST_SETUP","AWAITING_CONNECTION","AWAITING_BUNDLE","WAITING_FOR_ASSIGNEE","PREPARING","IN_PROGRESS","REVIEWING","PAUSED","COMPLETED","SKIPPED","CANCELLED","FAILED","SUPERSEDED"]},"paths":{"type":"array","items":{"$ref":"#/components/schemas/Path"}}},"required":["id","stepId","type","name","status"],"additionalProperties":false,"description":"A step on a path, by id. The same step is listed in full in the flow's `steps`: find it there by `id` or `stepId`."},"Path":{"type":"object","properties":{"pathId":{"type":"string","description":"This path's id: a branch path's `pathId`, a decision outcome's `outcomeId`, or `approve` / `reject` on an approval.","example":"p-kyc"},"label":{"type":["string","null"]},"steps":{"type":"array","items":{"$ref":"#/components/schemas/PathStep"}}},"required":["pathId","label","steps"],"additionalProperties":false},"StepFailure":{"type":"object","properties":{"code":{"type":"string","enum":["AI_UNAVAILABLE","AI_CONNECTION_REJECTED","AI_INPUT_TOO_LARGE","AI_PROVIDER_ERROR","STEP_FAILED"],"description":"Why the step failed. An AI step whose call to the AI provider failed: `AI_UNAVAILABLE` (the provider was busy or timed out: retry the step), `AI_CONNECTION_REJECTED` (the provider refused the AI connection's key: reconnect it), `AI_INPUT_TOO_LARGE` (the request or a document is over the provider's limit: split it), `AI_PROVIDER_ERROR` (any other provider failure). Any other failure is `STEP_FAILED`: `message` says what to do. The specific codes are for the flow's managers; someone who doesn't manage the flow reads `STEP_FAILED` with the same `message`."},"message":{"type":"string","description":"What went wrong and what to do, in plain words. Never the AI provider's raw answer."},"details":{"type":"object","properties":{"providerMessage":{"type":"string","description":"On your own AI connection, what the provider said, in its own words: short, never JSON. Shown to a flow manager only."}},"required":["providerMessage"],"additionalProperties":false,"description":"More about the failure, when there is more to say."}},"required":["code","message"],"additionalProperties":false,"description":"Present when the step failed (`status: \"FAILED\"`): why, in one shape for every step. Absent on a step that has not failed.","example":{"code":"AI_PROVIDER_ERROR","message":"Your AI connection's provider could not complete this request. Check the connection and its model, then try again.","details":{"providerMessage":"The model acme-large does not exist."}}},"Step":{"type":"object","properties":{"id":{"type":"string","description":"This run of the step: its own id on this flow. A step that runs once for each item has one run, and one `id`, per item. Point at it from elsewhere as `stepExecutionId`."},"stepId":{"type":"string","description":"The step on this flow, shared by every run of it. It exists before the step starts and stays the same when the step is reopened. Every step endpoint accepts it, and so does `afterStepId` on Add a step.","example":"step-1780601506493-2"},"key":{"type":["string","null"],"description":"The step's key: what the template's file calls it. `null` for a step from a flow started before steps had keys.","example":"breach_report"},"paths":{"type":"array","items":{"$ref":"#/components/schemas/Path"},"description":"This step's own paths, on a branch, a decision or an approval, each naming the steps on it. Those steps are also in the flow's `steps`, in full: a path only says where each one sits. Absent on a step that has none. A repeating section is not listed: its steps run once per item, so a single one cannot be addressed from here."},"outcomes":{"type":"array","items":{"type":"object","properties":{"outcomeId":{"type":"string"},"key":{"type":["string","null"],"description":"The option's key: what the template's file calls it. `null` when it has none."},"label":{"type":"string"}},"required":["outcomeId","key","label"],"additionalProperties":false},"description":"A decision step's options, as its decider is offered them for this run (a preparer's label first). Complete the step with `resultData: { outcomeId }`, sending the option's `outcomeId` (its `key` is refused, naming the id). Absent on every other step type.","example":[{"outcomeId":"o-approve","key":"approve","label":"Approve"},{"outcomeId":"o-decline","key":"decline","label":"Decline"}]},"fallback":{"type":"object","properties":{"reason":{"type":"string","enum":["NONZERO_EXIT","OUTPUT_MISSING","OUTPUT_TYPE_MISMATCH","SANDBOX_BOUNDARY"],"description":"`NONZERO_EXIT`: the code exited with an error. `OUTPUT_MISSING`: it did not return a declared output. `OUTPUT_TYPE_MISMATCH`: it returned an output of the wrong type. `SANDBOX_BOUNDARY`: it ran out of time or memory, or reached a site it may not."},"message":{"type":"string","description":"What went wrong, in one sentence."}},"required":["reason","message"],"additionalProperties":false,"description":"Present when the step's outputs are empty because it failed and its `onError` is `USE_DEFAULTS` (the default for a Code step), which lets the flow go on. Each declared output is then `null` in `resultData`; this says why. Absent when the outputs are the step's own.","example":{"reason":"OUTPUT_MISSING","message":"The code did not return segment. It returned: Segment."}},"numberSources":{"type":"object","additionalProperties":{"type":"object","properties":{"basis":{"type":"string","enum":["read","computed"],"description":"`read`: printed in what the step read. `computed`: worked out from values that were, and Moxo re-ran the calculation."},"value":{"type":"string","description":"The number this describes, as exact text. It matches the output's value in `resultData`: a value changed later by a person has no entry."},"where":{"type":"object","properties":{"document":{"type":"string","description":"The document or input it was read from."},"page":{"type":"integer","description":"The page, for a PDF."},"quote":{"type":"string","description":"The words it was read from."}},"additionalProperties":false,"description":"For `read`: where it is printed."},"from":{"type":"array","items":{"type":"string"},"description":"For `computed`: the documents the calculation read."}},"required":["basis","value"],"additionalProperties":false},"description":"On an AI step or agent step: how each single number output that is checked against documents was proved, by output name. A number not checked has no entry. Present only for a reader inside your organization who manages the flow or reviews the step, or an organization key, the same readers the app shows it to. Absent otherwise.","example":{"Invoice total":{"basis":"read","value":"12480","where":{"document":"invoice.pdf","page":2,"quote":"Total due 12,480.00"}},"Overdue invoices":{"basis":"computed","value":"3","from":["aging.xlsx"]}}},"zeroItems":{"type":"object","properties":{"reason":{"type":"string","enum":["empty_list","no_value","value_not_a_list","zero_count","no_matching_records","no_rows","no_roles"],"description":"`empty_list`: the list had no rows. `no_value`: the step it reads finished without filling the list. `value_not_a_list`: on runs before 6 Nov 2026 only, the value it read was not a list (such a loop now fails instead). `zero_count`: the count was 0. `no_matching_records`: no data table records matched. `no_rows`: the spreadsheet had no rows. `no_roles`: an Each role loop resolved no roles.","example":"empty_list"}},"required":["reason"],"additionalProperties":false,"description":"Present on a `FOR_EACH` step that ran zero times, saying why. The step still completes and the flow goes on. Absent otherwise.","example":{"reason":"empty_list"}},"failure":{"$ref":"#/components/schemas/StepFailure"},"type":{"type":"string","description":"The step type, such as `FORM` or `ESIGN`: the step's `type` in the template.","example":"FORM"},"name":{"type":"string","description":"The step's name in this flow: the step's `name` in the template, unless a manager renamed it on this flow.","example":"Intake form"},"executionId":{"type":"string","deprecated":true,"description":"Deprecated: this run of the step, the same as `id`. Read `id`; this field is still sent so integrations built on it keep working."},"templateStepId":{"type":"string","deprecated":true,"description":"Deprecated: the step on the flow, the same as `stepId`. Read `stepId`; this field is still sent so integrations built on it keep working."},"stepType":{"type":"string","deprecated":true,"description":"Deprecated: the step's type, the same as `type`. Read `type`; this field is still sent so integrations built on it keep working."},"stepName":{"type":"string","deprecated":true,"description":"Deprecated: the step's name, the same as `name`. Read `name`; this field is still sent so integrations built on it keep working."},"description":{"type":["string","null"],"description":"What the step asks of its assignee, as HTML: a preparer's description for this run, else the step's own, with references to earlier steps filled in for you as the app shows them. `null` when the step has none."},"stepIndex":{"type":"integer"},"status":{"type":"string","enum":["PENDING","AWAITING_HOST_SETUP","AWAITING_CONNECTION","AWAITING_BUNDLE","WAITING_FOR_ASSIGNEE","PREPARING","IN_PROGRESS","REVIEWING","PAUSED","COMPLETED","SKIPPED","CANCELLED","FAILED","SUPERSEDED"]},"viewerTurn":{"$ref":"#/components/schemas/ViewerTurn"},"viewerManages":{"$ref":"#/components/schemas/ViewerManages"},"completionMode":{"type":["string","null"],"enum":["ONE","ALL","MAJORITY","SEQUENTIAL","PARALLEL","AGREEMENT","ANY_ONE",null],"description":"How the step completes when more than one person is on it, as the template sets. `null` for steps that route the flow: branches, `FOR_EACH`, `WAIT` and `SUB_FLOW`. `ANY_ONE` is deprecated and means `ONE`: it is still answered for a step stored that way."},"resultData":{"type":["object","null"],"additionalProperties":{},"description":"Step-type-specific result. [Completing a step](#tag/steps) shows its shape for each step type. An AI step's or agent's list output of more than 50,000 rows arrives as a CSV file of every row: the file object a file output gives (`id`, `fileName`, `fileSize`, `mimeType` `text/csv`) in place of the array, with `listRows` (how many rows) and `listColumns` (its header). A list of 50,000 rows or fewer is the array."},"prepared":{"type":["object","null"],"properties":{"title":{"type":"string"},"description":{"type":"string"},"dueDate":{"type":"string","format":"date-time"}},"additionalProperties":false,"description":"What a preparer set for this run: title, description and due date. `null` when no preparer is configured or the preparer hasn't finished."},"advisor":{"type":["object","null"],"properties":{"id":{"type":["string","null"],"description":"The agent the advisor runs as. `null` when it runs as the organization's default advisor.","example":"agent_advisor_1"},"name":{"type":"string","description":"The agent's name, or `AI advisor` when no named agent stands behind it.","example":"Form Coach"},"description":{"type":["string","null"],"description":"Always `null`."},"agentVersionPinned":{"type":["integer","null"],"description":"Always `null`."}},"required":["id","name","description","agentVersionPinned"],"additionalProperties":false,"description":"The AI advisor that helps the assignee on this step (it suggests; it does not act). `null` when no advisor runs on it."},"milestone":{"type":["object","null"],"properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false,"description":"The milestone the step belongs to. `null` when it belongs to none."},"branchPath":{"type":["string","null"]},"pathIndex":{"type":["integer","null"]},"parentExecutionId":{"type":["string","null"],"description":"The run of the branch, decision, loop or approval step this run sits inside (its `id` in `steps[]`). `null` at the top level."},"iterationContext":{"type":["object","null"],"properties":{"index":{"type":"integer","description":"This run's position in the list, starting at 0."},"total":{"type":"integer","description":"How many runs there are, when known."},"item":{"description":"The item this run is for, as it is in the list, such as a person or a data table row."}},"required":["index","total"],"additionalProperties":false,"description":"Which item this run is for, on a `FOR_EACH` step only."},"iterationName":{"type":["string","null"],"description":"What this run's item is called, on a step inside a `FOR_EACH` only: the For each's Iteration label filled in for the item (a plain label is numbered, `Entity 3`), else the item's first text value. `null` when nothing names the item; show `Iteration` and its number. Absent on a step outside a For each.","example":"Harbour View Holdings"},"iterationProgress":{"type":"object","properties":{"done":{"type":"integer","description":"Items whose actions are all done."},"open":{"type":"integer","description":"Items with an action under way, overdue ones included."},"notStarted":{"type":"integer","description":"Items whose actions have not started."},"overdue":{"type":"integer","description":"Open items past their current action's due date. Also counted in `open`."},"total":{"type":"integer","description":"`done` + `open` + `notStarted`. Skipped, cancelled and failed items are not counted."}},"required":["done","open","notStarted","overdue","total"],"additionalProperties":false,"description":"Where the items of a `FOR_EACH` step stand, counted from the people's actions, sub-flows and inner loops of each item that you can see. Absent on every other step.","example":{"done":12,"open":30,"notStarted":8,"overdue":3,"total":50}},"subFlowProgress":{"type":["object","null"],"properties":{"done":{"type":"integer","description":"The sub-flow's people's actions that are done."},"open":{"type":"integer","description":"Its actions under way."},"notStarted":{"type":"integer","description":"Its actions not started yet."},"total":{"type":"integer","description":"`done` + `open` + `notStarted`. Skipped, cancelled and failed actions are not counted."}},"required":["done","open","notStarted","total"],"additionalProperties":false,"description":"On a `SUB_FLOW` step inside a `FOR_EACH` (each item is one sub-flow): how the people's actions of the sub-flow this item started stand. Automations and a sub-flow that sub-flow starts in turn are not counted. `null` when you don't manage that sub-flow. Absent on every other step, and before the sub-flow starts.","example":{"done":14,"open":6,"notStarted":30,"total":50}},"customStatus":{"anyOf":[{"$ref":"#/components/schemas/StepStatus"},{"type":"null"}],"description":"The step status someone put on this step from the template's `stepStatuses`, shown beside `status` (which it never changes). `null` when none is set, once the step is finished (or has not started), when it was reopened or run again since, or when the organization's plan does not have Custom step statuses."},"reminderCount":{"type":"integer"},"lastReminderSentAt":{"type":["string","null"],"format":"date-time"},"escalatedAt":{"type":["string","null"],"format":"date-time","description":"When someone beyond the assignee was brought in on the step's current round. `null` when it has not been escalated; reopening the step clears it."},"escalationCause":{"type":["string","null"],"enum":["agent","late_action",null],"description":"Why the step was escalated: `late_action`, it wasn't done by its due time, so the people set on its escalation were added to it; or `agent`, the AI agent escalated the step. `null` when `escalatedAt` is `null`, and for an escalation from an overdue alert, which has no recorded cause.","example":"late_action"},"reopenCount":{"type":"integer"},"reopenReason":{"type":["string","null"],"description":"Why the step was last reopened: a send back's reason, as its reader may see it. `null` when it was never reopened, or none was given."},"reopenedAt":{"type":["string","null"],"format":"date-time","description":"When the step was last reopened. `null` when it was never reopened."},"reopenedBy":{"anyOf":[{"$ref":"#/components/schemas/User"},{"type":"null"}],"description":"The person who last reopened the step. `null` when it was never reopened, or when an AI agent or the system reopened it (`reopenedByKind`)."},"reopenedByKind":{"type":["string","null"],"enum":["person","agent","system",null],"description":"Who last reopened the step: `person` (named in `reopenedBy`), `agent` (an AI agent sent it back, named in `reopenedByAgent`), or `system` (an API key, a loop back, or Moxo itself). Read it with `reopenReason` and `reopenedAt` to tell a step sent back for changes from one still waiting on its first round. `null` when it was never reopened.","example":"agent"},"reopenedByAgent":{"type":["object","null"],"properties":{"id":{"type":"string","description":"The agent's id."},"name":{"type":"string","description":"The agent's name."}},"required":["id","name"],"additionalProperties":false,"description":"The AI agent that last sent the step back, when `reopenedByKind` is `agent`. `null` otherwise."},"preparersSequential":{"type":"boolean","description":"Whether the step's preparers take turns: a person prepares only after an AI preparer has finished, failed, or run past `preparingDeadlineAt`. `false` when they prepare at the same time, or the step has no preparers."},"preparingDeadlineAt":{"type":["string","null"],"format":"date-time","description":"When an AI preparer's turn ends, so a person can prepare even if it hasn't finished. `null` when no AI preparer is working on the step."},"completedBy":{"anyOf":[{"$ref":"#/components/schemas/User"},{"type":"null"}],"description":"Who finished the step. `null` while it is not finished, or when it finished on its own."},"completedOnBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/User"},{"type":"null"}],"description":"Who the step was completed for, when `completedBy` completed it on their behalf: a flow manager who completed someone else's step, or filled it in for them. `null` when the person who completed it was its assignee, and while it is not finished."},"forceCompleted":{"type":"boolean"},"forceCompleteReason":{"type":["string","null"]},"timeToComplete":{"type":["integer","null"],"description":"Milliseconds from start to completion. `null` until the step is `COMPLETED`."},"firstViewedAt":{"type":["string","null"],"format":"date-time"},"assignees":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The assignment's id.","example":"sea_abc"},"role":{"type":"string","enum":["preparer","executor","reviewer","viewer"],"example":"executor"},"roleId":{"type":["string","null"],"description":"The role this assignment comes from. `null` for an AI agent, and for a person named directly rather than through a role.","example":"role-buyer-001"},"sortOrder":{"type":"integer","example":0},"user":{"anyOf":[{"$ref":"#/components/schemas/User"},{"type":"null"}],"description":"The person assigned. `kind=agent` for an AI agent. `null` when nobody fills the assignment yet, or the person was removed."},"desk":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"description":"The desk the step is assigned to. Absent when it is assigned to a person."},"status":{"type":"string","enum":["PENDING","COMPLETED","NOT_NEEDED"],"description":"This assignment's part: `PENDING` until it is done, `COMPLETED` once it is, `NOT_NEEDED` when the step went on without it (another assignee was enough, or the step was cancelled or force-completed).","example":"PENDING"},"createdAt":{"type":"string","format":"date-time"},"notifiedAt":{"type":["string","null"],"format":"date-time"},"completedAt":{"type":["string","null"],"format":"date-time"}},"required":["id","role","roleId","sortOrder","user","status","createdAt","notifiedAt","completedAt"],"additionalProperties":false}},"startedAt":{"type":["string","null"],"format":"date-time"},"dueAt":{"type":["string","null"],"format":"date-time"},"completedAt":{"type":["string","null"],"format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","stepId","key","type","name","description","stepIndex","status","viewerTurn","viewerManages","completionMode","resultData","prepared","advisor","milestone","branchPath","pathIndex","parentExecutionId","iterationContext","customStatus","reminderCount","lastReminderSentAt","escalatedAt","escalationCause","reopenCount","reopenReason","reopenedAt","reopenedBy","reopenedByKind","reopenedByAgent","preparersSequential","preparingDeadlineAt","completedBy","completedOnBehalfOf","forceCompleted","forceCompleteReason","timeToComplete","firstViewedAt","assignees","startedAt","dueAt","completedAt","updatedAt"],"additionalProperties":false},"FlowSummary":{"type":"object","properties":{"id":{"type":"string"},"template":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"version":{"type":"integer","description":"The published version of the template this flow started from. Later publishes don't change it. `0` when the flow has no linked version."}},"required":["id","name","version"],"additionalProperties":false},"name":{"type":"string"},"description":{"type":["string","null"]},"status":{"type":"string","enum":["IN_PROGRESS","PAUSED","COMPLETED","CANCELLED","BLOCKED"]},"totalSteps":{"type":"integer"},"completedSteps":{"type":"integer"},"hasSubFlows":{"type":"boolean","description":"`true` when the flow's template has a Sub-flow step, whether or not one has started. To list the flows it started, use `originFlowId`."},"originFlowId":{"type":["string","null"],"description":"The flow that started this one, through a Sub-flow, Start a flow or Schedule a flow step. `null` when no flow started it. Only a `sub_flow` child is canceled with its parent."},"startedByKind":{"type":["string","null"],"enum":["sub_flow","start_flow","scheduled",null],"description":"How the parent started this flow: `sub_flow` (it is part of the parent and is canceled with it), `start_flow` or `scheduled`. `null` when no flow started it."},"startedByStepId":{"type":["string","null"],"description":"The step in the parent flow that started this one. `null` when no flow started it, or when you can't open the parent."},"depth":{"type":["integer","null"],"description":"How far below `rootFlowId` this flow is: 1 is a flow the root started itself. `null` on a list without `rootFlowId`."},"currentStep":{"type":["object","null"],"properties":{"index":{"type":"integer"},"user":{"anyOf":[{"$ref":"#/components/schemas/User"},{"type":"null"}],"description":"The assignee of the current step. `null` when the step has no assignee, has several, or is finished."}},"required":["index","user"],"additionalProperties":false},"customFields":{"type":"array","items":{"$ref":"#/components/schemas/CustomField"}},"accounts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","example":"acct_acme"},"name":{"type":"string","example":"Acme Corp"}},"required":["id","name"]},"description":"Accounts this flow is linked to. Empty when no external participant belongs to an account."},"startedBy":{"$ref":"#/components/schemas/StartedBy"},"dueAt":{"type":["string","null"],"format":"date-time"},"completedAt":{"type":["string","null"],"format":"date-time"},"completionReason":{"type":["string","null"]},"cancelledAt":{"type":["string","null"],"format":"date-time"},"cancelledBy":{"anyOf":[{"$ref":"#/components/schemas/User"},{"$ref":"#/components/schemas/FlowApiKeyActor"},{"type":"null"}],"description":"Who cancelled the flow: a person (`User`), or an organization API key (`kind: \"api_key\"`) when one did. `null` when it was not cancelled, or when the system cancelled it (a rule or a timeout, not a person or a key)."},"cancellationReason":{"type":["string","null"]},"archivedAt":{"type":["string","null"],"format":"date-time"},"archivedBy":{"anyOf":[{"$ref":"#/components/schemas/User"},{"type":"null"}]},"lastActivityAt":{"type":"string","format":"date-time","description":"The time of the latest activity on the flow, or when it started if nothing has happened yet. Recent (`sort=recent`) orders by this same time."},"isTest":{"type":"boolean","description":"`true` for a test run, and for any flow a test run started (a sub-flow, or one started or scheduled by a step). A test run's emails, texts, webhooks, API calls and app actions really go out, each marked as a test (`[TEST]`, `\"test\": true`, `X-Moxo-Test: true`). \"Schedule a flow\" in a test is simulated and makes no schedule."},"updatedAt":{"type":"string","format":"date-time"},"lastChangedAt":{"type":["string","null"],"format":"date-time","description":"The time of the flow’s latest change, to the microsecond: a field, an answer, a step, a person or a status. Opening or viewing a flow is not a change. For people who can’t see every part of a flow, only changes they can see count, and it errs toward fewer: a change the app shows them may not count. `null` when no change is recorded. `updatedSince` lists flows by this time.","example":"2026-10-22T14:04:30.112345Z"}},"required":["id","template","name","description","status","totalSteps","completedSteps","hasSubFlows","originFlowId","startedByKind","startedByStepId","depth","currentStep","customFields","accounts","startedBy","dueAt","completedAt","completionReason","cancelledAt","cancelledBy","cancellationReason","archivedAt","archivedBy","lastActivityAt","isTest","updatedAt"],"additionalProperties":false},"FlowDetail":{"type":"object","properties":{"id":{"type":"string"},"template":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"status":{"type":"string","enum":["ACTIVE","DRAFT","ARCHIVED"]},"version":{"type":"integer","description":"The published version of the template this flow started from. Later publishes don't change it. `0` when the flow has no linked version."},"publishedAt":{"type":["string","null"],"format":"date-time"},"publishedBy":{"anyOf":[{"$ref":"#/components/schemas/User"},{"type":"null"}]}},"required":["id","name","description","status","version","publishedAt","publishedBy"],"additionalProperties":false},"name":{"type":"string"},"description":{"type":["string","null"]},"status":{"type":"string","enum":["IN_PROGRESS","PAUSED","COMPLETED","CANCELLED","BLOCKED"]},"totalSteps":{"type":"integer"},"completedSteps":{"type":"integer"},"hasSubFlows":{"type":"boolean","description":"`true` when the flow's template has a Sub-flow step, whether or not one has started. To list the flows it started, use `originFlowId`."},"originFlowId":{"type":["string","null"],"description":"The flow that started this one, through a Sub-flow, Start a flow or Schedule a flow step. `null` when no flow started it. Only a `sub_flow` child is canceled with its parent."},"startedByKind":{"type":["string","null"],"enum":["sub_flow","start_flow","scheduled",null],"description":"How the parent started this flow: `sub_flow` (it is part of the parent and is canceled with it), `start_flow` or `scheduled`. `null` when no flow started it."},"startedByStepId":{"type":["string","null"],"description":"The step in the parent flow that started this one. `null` when no flow started it, or when you can't open the parent."},"depth":{"type":["integer","null"],"description":"How far below `rootFlowId` this flow is: 1 is a flow the root started itself. `null` on a list without `rootFlowId`."},"currentStep":{"type":["object","null"],"properties":{"index":{"type":"integer"},"user":{"anyOf":[{"$ref":"#/components/schemas/User"},{"type":"null"}],"description":"The assignee of the current step. `null` when the step has no assignee, has several, or is finished."}},"required":["index","user"],"additionalProperties":false},"customFields":{"type":"array","items":{"$ref":"#/components/schemas/CustomField"}},"accounts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","example":"acct_acme"},"name":{"type":"string","example":"Acme Corp"}},"required":["id","name"]},"description":"Accounts this flow is linked to. Empty when no external participant belongs to an account."},"startedBy":{"$ref":"#/components/schemas/StartedBy"},"dueAt":{"type":["string","null"],"format":"date-time"},"completedAt":{"type":["string","null"],"format":"date-time"},"completionReason":{"type":["string","null"]},"cancelledAt":{"type":["string","null"],"format":"date-time"},"cancelledBy":{"anyOf":[{"$ref":"#/components/schemas/User"},{"$ref":"#/components/schemas/FlowApiKeyActor"},{"type":"null"}],"description":"Who cancelled the flow: a person (`User`), or an organization API key (`kind: \"api_key\"`) when one did. `null` when it was not cancelled, or when the system cancelled it (a rule or a timeout, not a person or a key)."},"cancellationReason":{"type":["string","null"]},"archivedAt":{"type":["string","null"],"format":"date-time"},"archivedBy":{"anyOf":[{"$ref":"#/components/schemas/User"},{"type":"null"}]},"lastActivityAt":{"type":"string","format":"date-time","description":"The time of the latest activity on the flow, or when it started if nothing has happened yet. Recent (`sort=recent`) orders by this same time."},"isTest":{"type":"boolean","description":"`true` for a test run, and for any flow a test run started (a sub-flow, or one started or scheduled by a step). A test run's emails, texts, webhooks, API calls and app actions really go out, each marked as a test (`[TEST]`, `\"test\": true`, `X-Moxo-Test: true`). \"Schedule a flow\" in a test is simulated and makes no schedule."},"updatedAt":{"type":"string","format":"date-time"},"lastChangedAt":{"type":["string","null"],"format":"date-time","description":"The time of the flow’s latest change, to the microsecond: a field, an answer, a step, a person or a status. Opening or viewing a flow is not a change. For people who can’t see every part of a flow, only changes they can see count, and it errs toward fewer: a change the app shows them may not count. `null` when no change is recorded. `updatedSince` lists flows by this time.","example":"2026-10-22T14:04:30.112345Z"},"startedFlows":{"type":"object","properties":{"total":{"type":"integer"},"open":{"type":"integer"}},"required":["total","open"],"additionalProperties":false,"description":"How many flows this one started directly, of every kind, that you can open: `total`, and `open` for those still in progress or paused. The same count `GET /v1/flows?originFlowId={id}` pages through."},"chatAssistantEnabled":{"type":"boolean"},"chatAssistant":{"type":["object","null"],"properties":{"enabled":{"type":"boolean","description":"The AI assistant answers in this flow."},"offSource":{"type":["string","null"],"enum":["manager","template",null],"description":"Who turned it off: `manager` (a flow manager of this flow) or `template` (the template's assistant was turned off). `null` when it is on."},"templateEnabled":{"type":"boolean","description":"The template's own assistant is on. While it is off, the flow's assistant cannot be turned on."},"agentName":{"type":["string","null"],"description":"The assistant's name in this flow. `null` when its agent no longer exists."}},"required":["enabled","offSource","templateEnabled","agentName"],"additionalProperties":false,"description":"The flow's AI assistant, readable by anyone who can see the flow. A flow manager turns it on or off with `PATCH /v1/flows/{id}/chat-assistant`. `null` when the template has no assistant."},"members":{"type":"array","items":{"$ref":"#/components/schemas/Member"},"description":"The people on the flow: everyone who holds a role or has flow manager or viewer access. AI agents are in `agents[]`."},"roles":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The role's id from the template.","example":"role-buyer-001"},"name":{"type":"string","description":"The role's name.","example":"Customer"},"assigned":{"type":"boolean","description":"`true` when `user` or `desk` is set."},"user":{"anyOf":[{"$ref":"#/components/schemas/User"},{"type":"null"}],"description":"The person who holds this role. `null` when nobody holds it, or a desk does."},"desk":{"type":["object","null"],"properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"description":"The desk that holds this role. `null` when nobody holds it, or a person does."}},"required":["id","name","assigned","user","desk"],"additionalProperties":false},"description":"Who holds each role (the inverse of `members[].roles`). One entry for each of the template's roles, held or not."},"agents":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]}},"required":["id","name","description"]}},"steps":{"type":"array","items":{"$ref":"#/components/schemas/Step"}},"completedBy":{"anyOf":[{"$ref":"#/components/schemas/User"},{"type":"null"}]}},"required":["id","template","name","description","status","totalSteps","completedSteps","hasSubFlows","originFlowId","startedByKind","startedByStepId","depth","currentStep","customFields","accounts","startedBy","dueAt","completedAt","completionReason","cancelledAt","cancelledBy","cancellationReason","archivedAt","archivedBy","lastActivityAt","isTest","updatedAt","startedFlows","chatAssistantEnabled","chatAssistant","members","roles","agents","steps","completedBy"],"additionalProperties":false},"StepDetail":{"type":"object","properties":{"id":{"type":"string","description":"This run of the step: its own id on this flow. A step that runs once for each item has one run, and one `id`, per item. Point at it from elsewhere as `stepExecutionId`."},"stepId":{"type":"string","description":"The step on this flow, shared by every run of it. It exists before the step starts and stays the same when the step is reopened. Every step endpoint accepts it, and so does `afterStepId` on Add a step.","example":"step-1780601506493-2"},"key":{"type":["string","null"],"description":"The step's key: what the template's file calls it. `null` for a step from a flow started before steps had keys.","example":"breach_report"},"paths":{"type":"array","items":{"$ref":"#/components/schemas/Path"},"description":"This step's own paths, on a branch, a decision or an approval, each naming the steps on it. Those steps are also in the flow's `steps`, in full: a path only says where each one sits. Absent on a step that has none. A repeating section is not listed: its steps run once per item, so a single one cannot be addressed from here."},"outcomes":{"type":"array","items":{"type":"object","properties":{"outcomeId":{"type":"string"},"key":{"type":["string","null"],"description":"The option's key: what the template's file calls it. `null` when it has none."},"label":{"type":"string"}},"required":["outcomeId","key","label"],"additionalProperties":false},"description":"A decision step's options, as its decider is offered them for this run (a preparer's label first). Complete the step with `resultData: { outcomeId }`, sending the option's `outcomeId` (its `key` is refused, naming the id). Absent on every other step type.","example":[{"outcomeId":"o-approve","key":"approve","label":"Approve"},{"outcomeId":"o-decline","key":"decline","label":"Decline"}]},"fallback":{"type":"object","properties":{"reason":{"type":"string","enum":["NONZERO_EXIT","OUTPUT_MISSING","OUTPUT_TYPE_MISMATCH","SANDBOX_BOUNDARY"],"description":"`NONZERO_EXIT`: the code exited with an error. `OUTPUT_MISSING`: it did not return a declared output. `OUTPUT_TYPE_MISMATCH`: it returned an output of the wrong type. `SANDBOX_BOUNDARY`: it ran out of time or memory, or reached a site it may not."},"message":{"type":"string","description":"What went wrong, in one sentence."}},"required":["reason","message"],"additionalProperties":false,"description":"Present when the step's outputs are empty because it failed and its `onError` is `USE_DEFAULTS` (the default for a Code step), which lets the flow go on. Each declared output is then `null` in `resultData`; this says why. Absent when the outputs are the step's own.","example":{"reason":"OUTPUT_MISSING","message":"The code did not return segment. It returned: Segment."}},"numberSources":{"type":"object","additionalProperties":{"type":"object","properties":{"basis":{"type":"string","enum":["read","computed"],"description":"`read`: printed in what the step read. `computed`: worked out from values that were, and Moxo re-ran the calculation."},"value":{"type":"string","description":"The number this describes, as exact text. It matches the output's value in `resultData`: a value changed later by a person has no entry."},"where":{"type":"object","properties":{"document":{"type":"string","description":"The document or input it was read from."},"page":{"type":"integer","description":"The page, for a PDF."},"quote":{"type":"string","description":"The words it was read from."}},"additionalProperties":false,"description":"For `read`: where it is printed."},"from":{"type":"array","items":{"type":"string"},"description":"For `computed`: the documents the calculation read."}},"required":["basis","value"],"additionalProperties":false},"description":"On an AI step or agent step: how each single number output that is checked against documents was proved, by output name. A number not checked has no entry. Present only for a reader inside your organization who manages the flow or reviews the step, or an organization key, the same readers the app shows it to. Absent otherwise.","example":{"Invoice total":{"basis":"read","value":"12480","where":{"document":"invoice.pdf","page":2,"quote":"Total due 12,480.00"}},"Overdue invoices":{"basis":"computed","value":"3","from":["aging.xlsx"]}}},"zeroItems":{"type":"object","properties":{"reason":{"type":"string","enum":["empty_list","no_value","value_not_a_list","zero_count","no_matching_records","no_rows","no_roles"],"description":"`empty_list`: the list had no rows. `no_value`: the step it reads finished without filling the list. `value_not_a_list`: on runs before 6 Nov 2026 only, the value it read was not a list (such a loop now fails instead). `zero_count`: the count was 0. `no_matching_records`: no data table records matched. `no_rows`: the spreadsheet had no rows. `no_roles`: an Each role loop resolved no roles.","example":"empty_list"}},"required":["reason"],"additionalProperties":false,"description":"Present on a `FOR_EACH` step that ran zero times, saying why. The step still completes and the flow goes on. Absent otherwise.","example":{"reason":"empty_list"}},"failure":{"$ref":"#/components/schemas/StepFailure"},"type":{"type":"string","description":"The step type, such as `FORM` or `ESIGN`: the step's `type` in the template.","example":"FORM"},"name":{"type":"string","description":"The step's name in this flow: the step's `name` in the template, unless a manager renamed it on this flow.","example":"Intake form"},"executionId":{"type":"string","deprecated":true,"description":"Deprecated: this run of the step, the same as `id`. Read `id`; this field is still sent so integrations built on it keep working."},"templateStepId":{"type":"string","deprecated":true,"description":"Deprecated: the step on the flow, the same as `stepId`. Read `stepId`; this field is still sent so integrations built on it keep working."},"stepType":{"type":"string","deprecated":true,"description":"Deprecated: the step's type, the same as `type`. Read `type`; this field is still sent so integrations built on it keep working."},"stepName":{"type":"string","deprecated":true,"description":"Deprecated: the step's name, the same as `name`. Read `name`; this field is still sent so integrations built on it keep working."},"description":{"type":["string","null"],"description":"What the step asks of its assignee, as HTML: a preparer's description for this run, else the step's own, with references to earlier steps filled in for you as the app shows them. `null` when the step has none."},"stepIndex":{"type":"integer"},"status":{"type":"string","enum":["PENDING","AWAITING_HOST_SETUP","AWAITING_CONNECTION","AWAITING_BUNDLE","WAITING_FOR_ASSIGNEE","PREPARING","IN_PROGRESS","REVIEWING","PAUSED","COMPLETED","SKIPPED","CANCELLED","FAILED","SUPERSEDED"]},"viewerTurn":{"$ref":"#/components/schemas/ViewerTurn"},"viewerManages":{"$ref":"#/components/schemas/ViewerManages"},"completionMode":{"type":["string","null"],"enum":["ONE","ALL","MAJORITY","SEQUENTIAL","PARALLEL","AGREEMENT","ANY_ONE",null],"description":"How the step completes when more than one person is on it, as the template sets. `null` for steps that route the flow: branches, `FOR_EACH`, `WAIT` and `SUB_FLOW`. `ANY_ONE` is deprecated and means `ONE`: it is still answered for a step stored that way."},"resultData":{"type":["object","null"],"additionalProperties":{},"description":"Step-type-specific result. [Completing a step](#tag/steps) shows its shape for each step type. An AI step's or agent's list output of more than 50,000 rows arrives as a CSV file of every row: the file object a file output gives (`id`, `fileName`, `fileSize`, `mimeType` `text/csv`) in place of the array, with `listRows` (how many rows) and `listColumns` (its header). A list of 50,000 rows or fewer is the array."},"prepared":{"type":["object","null"],"properties":{"title":{"type":"string"},"description":{"type":"string"},"dueDate":{"type":"string","format":"date-time"}},"additionalProperties":false,"description":"What a preparer set for this run: title, description and due date. `null` when no preparer is configured or the preparer hasn't finished."},"advisor":{"type":["object","null"],"properties":{"id":{"type":["string","null"],"description":"The agent the advisor runs as. `null` when it runs as the organization's default advisor.","example":"agent_advisor_1"},"name":{"type":"string","description":"The agent's name, or `AI advisor` when no named agent stands behind it.","example":"Form Coach"},"description":{"type":["string","null"],"description":"Always `null`."},"agentVersionPinned":{"type":["integer","null"],"description":"Always `null`."}},"required":["id","name","description","agentVersionPinned"],"additionalProperties":false,"description":"The AI advisor that helps the assignee on this step (it suggests; it does not act). `null` when no advisor runs on it."},"milestone":{"type":["object","null"],"properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false,"description":"The milestone the step belongs to. `null` when it belongs to none."},"branchPath":{"type":["string","null"]},"pathIndex":{"type":["integer","null"]},"parentExecutionId":{"type":["string","null"],"description":"The run of the branch, decision, loop or approval step this run sits inside (its `id` in `steps[]`). `null` at the top level."},"iterationContext":{"type":["object","null"],"properties":{"index":{"type":"integer","description":"This run's position in the list, starting at 0."},"total":{"type":"integer","description":"How many runs there are, when known."},"item":{"description":"The item this run is for, as it is in the list, such as a person or a data table row."}},"required":["index","total"],"additionalProperties":false,"description":"Which item this run is for, on a `FOR_EACH` step only."},"iterationName":{"type":["string","null"],"description":"What this run's item is called, on a step inside a `FOR_EACH` only: the For each's Iteration label filled in for the item (a plain label is numbered, `Entity 3`), else the item's first text value. `null` when nothing names the item; show `Iteration` and its number. Absent on a step outside a For each.","example":"Harbour View Holdings"},"iterationProgress":{"type":"object","properties":{"done":{"type":"integer","description":"Items whose actions are all done."},"open":{"type":"integer","description":"Items with an action under way, overdue ones included."},"notStarted":{"type":"integer","description":"Items whose actions have not started."},"overdue":{"type":"integer","description":"Open items past their current action's due date. Also counted in `open`."},"total":{"type":"integer","description":"`done` + `open` + `notStarted`. Skipped, cancelled and failed items are not counted."}},"required":["done","open","notStarted","overdue","total"],"additionalProperties":false,"description":"Where the items of a `FOR_EACH` step stand, counted from the people's actions, sub-flows and inner loops of each item that you can see. Absent on every other step.","example":{"done":12,"open":30,"notStarted":8,"overdue":3,"total":50}},"subFlowProgress":{"type":["object","null"],"properties":{"done":{"type":"integer","description":"The sub-flow's people's actions that are done."},"open":{"type":"integer","description":"Its actions under way."},"notStarted":{"type":"integer","description":"Its actions not started yet."},"total":{"type":"integer","description":"`done` + `open` + `notStarted`. Skipped, cancelled and failed actions are not counted."}},"required":["done","open","notStarted","total"],"additionalProperties":false,"description":"On a `SUB_FLOW` step inside a `FOR_EACH` (each item is one sub-flow): how the people's actions of the sub-flow this item started stand. Automations and a sub-flow that sub-flow starts in turn are not counted. `null` when you don't manage that sub-flow. Absent on every other step, and before the sub-flow starts.","example":{"done":14,"open":6,"notStarted":30,"total":50}},"customStatus":{"anyOf":[{"$ref":"#/components/schemas/StepStatus"},{"type":"null"}],"description":"The step status someone put on this step from the template's `stepStatuses`, shown beside `status` (which it never changes). `null` when none is set, once the step is finished (or has not started), when it was reopened or run again since, or when the organization's plan does not have Custom step statuses."},"reminderCount":{"type":"integer"},"lastReminderSentAt":{"type":["string","null"],"format":"date-time"},"escalatedAt":{"type":["string","null"],"format":"date-time","description":"When someone beyond the assignee was brought in on the step's current round. `null` when it has not been escalated; reopening the step clears it."},"escalationCause":{"type":["string","null"],"enum":["agent","late_action",null],"description":"Why the step was escalated: `late_action`, it wasn't done by its due time, so the people set on its escalation were added to it; or `agent`, the AI agent escalated the step. `null` when `escalatedAt` is `null`, and for an escalation from an overdue alert, which has no recorded cause.","example":"late_action"},"reopenCount":{"type":"integer"},"reopenReason":{"type":["string","null"],"description":"Why the step was last reopened: a send back's reason, as its reader may see it. `null` when it was never reopened, or none was given."},"reopenedAt":{"type":["string","null"],"format":"date-time","description":"When the step was last reopened. `null` when it was never reopened."},"reopenedBy":{"anyOf":[{"$ref":"#/components/schemas/User"},{"type":"null"}],"description":"The person who last reopened the step. `null` when it was never reopened, or when an AI agent or the system reopened it (`reopenedByKind`)."},"reopenedByKind":{"type":["string","null"],"enum":["person","agent","system",null],"description":"Who last reopened the step: `person` (named in `reopenedBy`), `agent` (an AI agent sent it back, named in `reopenedByAgent`), or `system` (an API key, a loop back, or Moxo itself). Read it with `reopenReason` and `reopenedAt` to tell a step sent back for changes from one still waiting on its first round. `null` when it was never reopened.","example":"agent"},"reopenedByAgent":{"type":["object","null"],"properties":{"id":{"type":"string","description":"The agent's id."},"name":{"type":"string","description":"The agent's name."}},"required":["id","name"],"additionalProperties":false,"description":"The AI agent that last sent the step back, when `reopenedByKind` is `agent`. `null` otherwise."},"preparersSequential":{"type":"boolean","description":"Whether the step's preparers take turns: a person prepares only after an AI preparer has finished, failed, or run past `preparingDeadlineAt`. `false` when they prepare at the same time, or the step has no preparers."},"preparingDeadlineAt":{"type":["string","null"],"format":"date-time","description":"When an AI preparer's turn ends, so a person can prepare even if it hasn't finished. `null` when no AI preparer is working on the step."},"completedBy":{"anyOf":[{"$ref":"#/components/schemas/User"},{"type":"null"}],"description":"Who finished the step. `null` while it is not finished, or when it finished on its own."},"completedOnBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/User"},{"type":"null"}],"description":"Who the step was completed for, when `completedBy` completed it on their behalf: a flow manager who completed someone else's step, or filled it in for them. `null` when the person who completed it was its assignee, and while it is not finished."},"forceCompleted":{"type":"boolean"},"forceCompleteReason":{"type":["string","null"]},"timeToComplete":{"type":["integer","null"],"description":"Milliseconds from start to completion. `null` until the step is `COMPLETED`."},"firstViewedAt":{"type":["string","null"],"format":"date-time"},"assignees":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The assignment's id.","example":"sea_abc"},"role":{"type":"string","enum":["preparer","executor","reviewer","viewer"],"example":"executor"},"roleId":{"type":["string","null"],"description":"The role this assignment comes from. `null` for an AI agent, and for a person named directly rather than through a role.","example":"role-buyer-001"},"sortOrder":{"type":"integer","example":0},"user":{"anyOf":[{"$ref":"#/components/schemas/User"},{"type":"null"}],"description":"The person assigned. `kind=agent` for an AI agent. `null` when nobody fills the assignment yet, or the person was removed."},"desk":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"description":"The desk the step is assigned to. Absent when it is assigned to a person."},"status":{"type":"string","enum":["PENDING","COMPLETED","NOT_NEEDED"],"description":"This assignment's part: `PENDING` until it is done, `COMPLETED` once it is, `NOT_NEEDED` when the step went on without it (another assignee was enough, or the step was cancelled or force-completed).","example":"PENDING"},"createdAt":{"type":"string","format":"date-time"},"notifiedAt":{"type":["string","null"],"format":"date-time"},"completedAt":{"type":["string","null"],"format":"date-time"}},"required":["id","role","roleId","sortOrder","user","status","createdAt","notifiedAt","completedAt"],"additionalProperties":false}},"startedAt":{"type":["string","null"],"format":"date-time"},"dueAt":{"type":["string","null"],"format":"date-time"},"completedAt":{"type":["string","null"],"format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"formFields":{"type":"array","items":{"type":"object","properties":{"fieldId":{"type":"string","description":"The key `resultData` holds this field's answer under. Send it as the key when you complete the step.","example":"fld_company_name"},"key":{"type":["string","null"],"description":"The field's key: what the template's file calls it. Answers are keyed by `fieldId`, not by this. `null` for a field from before fields had keys.","example":"company_name"},"label":{"type":["string","null"],"description":"What people see.","example":"Company name"},"type":{"type":["string","null"],"description":"The field type (a form field's `type`, a questionnaire question's `answerType`).","example":"TEXT_SINGLE_LINE"},"required":{"type":"boolean"},"options":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string","description":"What people see."},"value":{"type":"string","description":"The name the step stores, and what you answer with."}},"required":["label","value"],"additionalProperties":false},"description":"A choice question's options. Answer with one of their `value`s (an array for a multi-select)."},"defaultValue":{"description":"The value the field starts with in the form: the template's default, or a value carried from an earlier step, resolved for this run. A choice question's names its options by `value`. Absent when the field starts empty.","example":"Acme Freight"}},"required":["fieldId","key","label","type","required"],"additionalProperties":false},"description":"For a form or questionnaire step: its fields as the form shows them to you, each with the value it starts with. On a form that gives each role its own fields, you get only the fields of your roles (a flow manager or an organization API key gets them all). A starting value filled in from an earlier step is returned only to a flow manager, an organization API key and the people assigned to the step; anyone else gets the template's own starting values. Absent for other step types, and for a step you see as progress only."},"pollQuestions":{"type":"array","items":{"type":"object","properties":{"questionId":{"type":"string","description":"The key `resultData.answers` holds the vote under.","example":"q1"},"question":{"type":"string","description":"The question as people see it."},"allowMultiple":{"type":"boolean","description":"More than one option may be picked."},"allowOther":{"type":"boolean","description":"A write-in is allowed: pick `__other__` and send the text in `resultData.otherText[questionId]`."},"options":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string","description":"What a vote names the option by.","example":"o1"},"label":{"type":"string","description":"What people see."},"optionId":{"type":"string","deprecated":true,"description":"Deprecated: what a vote names, the same as `value`. Read `value`; this field is still sent so integrations built on it keep working."}},"required":["value","label"],"additionalProperties":false},"description":"The options to vote for."}},"required":["questionId","question","allowMultiple","allowOther","options"],"additionalProperties":false},"description":"For a poll step: its questions and options, by what a vote names them with. Vote with `resultData: { answers: { \"<questionId>\": [\"<value>\"] } }`. Absent for other step types, and for a step you see as progress only."},"askedFingerprint":{"type":"string","description":"What the step asks as you read it, on a step whose question can change until the first answer (a to-do, acknowledgement, approval, decision, poll, checklist, file request, form, questionnaire, PDF form or e-signature). Send it back as `askedFingerprint` with `/complete` or `/decline`: when what the step asks changed since you read it, nothing is saved (`409 STEP_CHANGED`). Read the step again and answer what it asks now. Its name, due date, reminders and who is asked do not change it.","example":"af1-3b0c9e14a2d75f68"},"checklistItems":{"type":"array","items":{"type":"object","properties":{"itemId":{"type":"string","description":"The key `resultData.checklistState` holds the item under.","example":"item-1"},"label":{"type":"string","description":"The item as people see it."},"status":{"type":"string","description":"`NOT_STARTED`, `DONE` or `SKIPPED`.","example":"NOT_STARTED"}},"required":["itemId","label","status"],"additionalProperties":false},"description":"For a checklist step: its items as you see them, with where each stands. Complete it with `resultData: { checklistState: { \"<itemId>\": { \"status\": \"DONE\" } } }`. On a checklist that shows people only their own items, you get only yours (a flow manager or an organization API key gets them all). Absent for other step types, and for a step you see as progress only."},"flow":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"status":{"type":"string","enum":["IN_PROGRESS","PAUSED","COMPLETED","CANCELLED","BLOCKED"]},"template":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"version":{"type":"integer","description":"The published version of the template this flow started from. Later publishes don't change it. `0` when the flow has no linked version."}},"required":["id","name","version"],"additionalProperties":false}},"required":["id","name","status","template"],"additionalProperties":false}},"required":["id","stepId","key","type","name","description","stepIndex","status","viewerTurn","viewerManages","completionMode","resultData","prepared","advisor","milestone","branchPath","pathIndex","parentExecutionId","iterationContext","customStatus","reminderCount","lastReminderSentAt","escalatedAt","escalationCause","reopenCount","reopenReason","reopenedAt","reopenedBy","reopenedByKind","reopenedByAgent","preparersSequential","preparingDeadlineAt","completedBy","completedOnBehalfOf","forceCompleted","forceCompleteReason","timeToComplete","firstViewedAt","assignees","startedAt","dueAt","completedAt","updatedAt","flow"],"additionalProperties":false},"CustomFieldValueInput":{"type":"object","properties":{"key":{"type":"string","minLength":1,"description":"The field's `key`, from `customFields[]` on `GET /v1/templates/{id}` or `GET /v1/flows/{id}`. A field's id or label here returns `400 VALIDATION_ERROR` naming the key to send.","example":"deal_size"},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}],"description":"A value of the field's type. Numbers and booleans can be sent as JSON values or as strings: a `NUMBER` field takes `1` or `\"1\"`, and a `YES_NO` field takes `true` or `\"yes\"`. A choice field takes an option's value, id or label, and stores its id; a name that could be two options is refused, naming their ids."}},"required":["key","value"],"additionalProperties":false},"StartFlowRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":255,"description":"The new flow's name. Defaults to \"{template.name} - Run {YYYY-MM-DD}\"."},"dueAt":{"type":["string","null"],"format":"date-time","description":"The new flow's due date (ISO 8601, in UTC or with an offset). Defaults to the due date the template sets. A date that has already passed returns `400 DUE_DATE_IN_PAST` and the flow doesn't start."},"roleAssignments":{"type":"array","items":{"type":"object","properties":{"roleId":{"type":"string","description":"The role: its `key` (what the template's file calls it), its id, or its name.","example":"buyer"},"uniqueId":{"type":"string","description":"The person's org-scoped unique ID (needs the Partner unique ID feature). Send exactly one of `uniqueId`, `userId` or `email`.","example":"cust_984431"},"userId":{"type":"string","description":"The id of an existing user (`usr_…`).","example":"usr_7Kd2mQxWnR4vT9pLcYb3Ae"},"email":{"type":"string","format":"email","description":"The person's email: someone in your organization, or someone new, whom the start adds as an external user when the role takes external users and you may add them.","example":"alex@example.com"},"customUserFields":{"type":"object","additionalProperties":{"type":"string"},"description":"Custom user fields to save on this person. Saving them needs the same permission as editing that person: `external_users:write` for an external person, `team:write` for an internal one. If the caller can start a flow but can't edit the person, the request returns `403 INSUFFICIENT_SCOPE` and the flow doesn't start. A value you send replaces the saved one; a blank value leaves it as it is. An unknown key returns `UNKNOWN_KEY`, and a value over 256 characters returns `VALUE_TOO_LONG`; in both cases the flow doesn't start. These are not the flow's own fields (`customFields` on the request).","example":{"region":"West"}}},"required":["roleId"],"additionalProperties":false},"default":[],"description":"Who holds each role, the same list on `POST /v1/templates/{id}/start` and MCP `start_flow`. Each entry names the role by its `key`, id or name, and the person by exactly one of `uniqueId`, `userId` or `email`. Left out, no role is filled by the request. To put several people on a role a group holds, send one entry for each of them with the same `roleId`. A role you leave out is left open: its steps wait until someone holds it (`POST /v1/flows/{id}/roles/{roleId}/assign`). A role that hosts a meeting must be filled at the start, by a member of your team (`400 HOST_ROLE_UNASSIGNED` otherwise), unless an Assign role step fills it first."},"customFields":{"type":"array","items":{"$ref":"#/components/schemas/CustomFieldValueInput"},"description":"Values for the template's start fields, if it has any (`collectAtStart: true` on `GET /v1/templates/{id}`), each by its `key`. A required one that's missing returns `400`, naming it."},"buildingBlockRoleAssignments":{"type":"object","additionalProperties":{"anyOf":[{"type":"object","properties":{"uniqueId":{"type":"string","description":"The person's org-scoped unique ID (needs the Partner unique ID feature). Send exactly one of `uniqueId`, `userId` or `email`.","example":"cust_984431"},"userId":{"type":"string","description":"The id of the user to assign."},"email":{"type":"string","format":"email","description":"The person's email: someone in your organization, or someone new, whom the start adds as an external user when the role takes external users and you may add them."}},"additionalProperties":false},{"type":"array","items":{"type":"object","properties":{"uniqueId":{"type":"string","description":"The person's org-scoped unique ID (needs the Partner unique ID feature). Send exactly one of `uniqueId`, `userId` or `email`.","example":"cust_984431"},"userId":{"type":"string","description":"The id of the user to assign."},"email":{"type":"string","format":"email","description":"The person's email: someone in your organization, or someone new, whom the start adds as an external user when the role takes external users and you may add them."}},"additionalProperties":false},"minItems":1}]},"description":"Who holds each building block role that isn't linked to a role of this template: one person, or a list of them for a role a group holds. Required when such a role has `managerToggle` set or needs someone assigned by hand. Key each entry by the building block role's name (for example \"Account Manager\"). When the same building block is used more than once, key it by \"<blockStepId>:<blockRoleId>\" to name one use. A name that more than one such role shares returns `AMBIGUOUS_BLOCK_ROLE`; use the \"<blockStepId>:<blockRoleId>\" form instead."},"buildingBlockFieldValues":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","description":"The `key` of a building block input field that isn't linked to a field of this template, for example \"contract_value\", from `GET /v1/templates/{id}`, as every start value names its field."},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}],"description":"A value of the field's type. Numbers and booleans can be sent as JSON values or as strings, for example `1` or `\"1\"` for a `NUMBER` field."}},"required":["key","value"],"additionalProperties":false},"description":"Values for building block input fields that aren't linked to a field of this template and aren't in its `customFields`, each by its `key`. Required when such a field is required."},"tags":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}},"description":"Tag choices, as the Start flow dialog makes them: each tag group's id with the ids of the tags picked in it. Kept when the person starting may see tags; otherwise, and for an organization API key, the template's tags apply.","example":{"tg-region":["tag-west"]}},"tagTexts":{"type":"object","additionalProperties":{"type":"string"},"description":"Text tag choices: each text tag group's id with its short text. Kept on the same terms as `tags`.","example":{"tg-matter":"M-1042"}},"deskSelections":{"type":"object","additionalProperties":{"type":"string"},"description":"The team queue for each role the template fills from a desk: the role's id with the desk's id.","example":{"role-reviewer":"desk-underwriting"}},"roleAccounts":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}},"description":"Accounts picked for roles: the role's id with account ids. The account's people join the role, and later joins and leaves follow.","example":{"role-customer":["acc_acme"]}},"roleAccountPeople":{"type":"object","additionalProperties":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"description":"For each account picked in `roleAccounts`, who it puts on the role: the role's id, then the account's id, with user ids (`usr_…`).","example":{"role-customer":{"acc_acme":["usr_7Kd2mQxWnR4vT9pLcYb3Ae"]}}},"connectionBundleKey":{"type":"string","description":"The stable key of the connection bundle the new flow acts through, when the template uses a connected app that is set up per connection bundle. Ignored otherwise."}},"additionalProperties":false},"UpdateFlowInfoRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":255},"customFields":{"type":"array","items":{"$ref":"#/components/schemas/CustomFieldValueInput"},"description":"The fields to change, each by its `key`; fields you leave out keep their value. Numbers and booleans can be sent as JSON values or as strings (a `NUMBER` field takes `1` or `\"1\"`)."},"dueAt":{"type":["string","null"],"format":"date-time","description":"The flow's due date (ISO 8601), or `null` to remove it. A date that has already passed returns `400 DUE_DATE_IN_PAST` and nothing is saved; sending the date the flow already has is not a change."}},"additionalProperties":false},"StepMonitors":{"type":"object","properties":{"stepExecutionId":{"type":"string","description":"The step run the monitors are on."},"monitors":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The monitor's id on the step."},"action":{"type":["string","null"],"enum":["escalate","fire_webhook","cancel_flow","jump_to_step","update_fields","send_email",null],"description":"What it does. `null` when the monitor does not match the current shape."},"when":{"type":"string","description":"When it fires, in words.","example":"when it is overdue"},"does":{"type":"string","description":"What it does, in words.","example":"bring in the assignee's manager"},"state":{"type":"string","enum":["off","armed","waiting_for_event","not_started","finished","waiting_for_due_date","fired","not_armed","unrecognized"],"description":"`armed`: set, and checks at `nextCheckAt`. `waiting_for_event`: fires at its moment on the step. `off`: its kind is not turned on for your organization (escalation, or monitors), so it never fires. `not_started`: arms when the step starts. `waiting_for_due_date`: an overdue timer on a step with no due date. `fired`: it already fired on this round of the step (see `lastFired`). `finished`: the step is finished. `not_armed`: not set on this round (a reopen holds back a monitor that would cancel the flow). `unrecognized`: it does not match the current shape, so it never fires."},"stateWords":{"type":"string","description":"The state in words."},"nextCheckAt":{"type":["string","null"],"format":"date-time","description":"When it checks next, while `armed`. Monitors are checked at this time, and at the latest within a minute after it."},"lastFired":{"type":["object","null"],"properties":{"at":{"type":"string","format":"date-time","description":"When it last fired."},"outcome":{"type":"string","description":"What happened, as a code.","example":"escalated"},"words":{"type":"string","description":"What happened, in words."}},"required":["at","outcome","words"],"description":"What it last did on this round of the step. `null` when it has not fired."}},"required":["id","action","when","does","state","stateWords","nextCheckAt","lastFired"],"additionalProperties":false},"description":"Each monitor set on the step."}},"required":["stepExecutionId","monitors"],"additionalProperties":false},"AddMemberRequest":{"type":"object","properties":{"uniqueId":{"type":"string","description":"The person's org-scoped unique ID (needs the Partner unique ID feature). Send exactly one of `uniqueId`, `userId` or `email`.","example":"cust_984431"},"userId":{"type":"string","description":"The id of an existing user in your organization."},"email":{"type":"string","format":"email","description":"The email of an existing user in your organization."},"access":{"type":"string","enum":["participant","manager","viewer"],"description":"The person's access to the flow. When left out, it is `viewer` if you send no `roles`, and `participant` if you do."},"roles":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]},"description":"The roles to give the person, by id. Required for `access=participant`; refused for `access=viewer`."}},"additionalProperties":false},"RemoveMemberRequest":{"type":"object","properties":{"uniqueId":{"type":"string","description":"The person's org-scoped unique ID (needs the Partner unique ID feature). Send exactly one of `uniqueId`, `userId` or `email`.","example":"cust_984431"},"userId":{"type":"string"},"email":{"type":"string","format":"email","description":"The email of an existing user in your organization."}},"additionalProperties":false},"AssignRoleRequest":{"type":"object","properties":{"uniqueId":{"type":"string","description":"The person's org-scoped unique ID (needs the Partner unique ID feature). Send exactly one of `uniqueId`, `userId` or `email`.","example":"cust_984431"},"userId":{"type":"string","description":"The user to give the role. They replace whoever held it."},"email":{"type":"string","format":"email","description":"The email of an existing user in your organization."}},"additionalProperties":false},"ReassignStepRequest":{"type":"object","properties":{"toUserId":{"type":"string","description":"The new assignee's user id."},"toEmail":{"type":"string","format":"email","description":"Or the email of an existing user in your organization."},"fromUserId":{"type":"string","description":"The assignee to replace. Required when the step has more than one assignee."},"role":{"type":"string","enum":["executor","preparer","reviewer"],"description":"Which part of the step to reassign: `executor` (the assignee), `preparer` or `reviewer`. Defaults to `executor`."},"addSeat":{"type":"boolean","description":"Add `toUserId` / `toEmail` beside whoever already holds the step, on this step only, instead of replacing anyone. The app's \"Add to this step only\". Assignees only (`role` `executor`). Not on e-sign, DocuSign, Adobe Sign, document collaboration or identity verification steps."},"unassign":{"type":"boolean","description":"Take `fromUserId` off the step instead of handing it over. The app's \"Remove from step\". Send no `toUserId` or `toEmail`. Anyone else on the step keeps their place."},"fillLoopItem":{"type":"boolean","description":"Put `toUserId` or `toEmail` on this step as the person for the current row of a parallel For each, beside the roles already on it. The app's Assign on a row that still needs a person. Assignees only (`role` `executor`). Send no `fromUserId`: nobody is replaced. Not together with `addSeat` or `unassign`. Refused when the step is not assigned to the current person (`400 NOT_A_LOOP_ITEM_STEP`)."}},"additionalProperties":false},"StepDueRule":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["RELATIVE"],"description":"Due a set time after the step starts."},"value":{"type":"number","exclusiveMinimum":0,"description":"How long after the step starts it is due.","example":3},"unit":{"type":"string","enum":["MINUTES","HOURS","DAYS","WEEKS"],"description":"The unit of `value`."},"dayType":{"type":"string","enum":["calendar","business"],"description":"`business` counts working days only. Default `calendar`."}},"required":["type","value","unit"],"additionalProperties":false,"description":"Due this long after the step starts."},{"type":"object","properties":{"type":{"type":"string","enum":["FIXED"],"description":"Due on a set day."},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"The day it is due, `YYYY-MM-DD`. A day that does not exist (`2026-02-31`) returns `400 VALIDATION_FAILED`.","example":"2026-12-15"}},"required":["type","date"],"additionalProperties":false,"description":"Due on this day."},{"type":"object","properties":{"type":{"type":"string","enum":["BEFORE_FLOW_DUE"],"description":"Due a set time before the flow's due date."},"value":{"type":"number","exclusiveMinimum":0,"description":"How long before the flow is due.","example":2},"unit":{"type":"string","enum":["MINUTES","HOURS","DAYS","WEEKS"],"description":"The unit of `value`."},"dayType":{"type":"string","enum":["calendar","business"],"description":"`business` counts working days only. Default `calendar`."}},"required":["type","value","unit"],"additionalProperties":false,"description":"Due this long before the flow is due."}],"description":"When the step is due, as a rule: `RELATIVE` (after the step starts), `FIXED` (a day) or `BEFORE_FLOW_DUE` (before the flow's due date). A rule that reads a date from an earlier step or a data table is set in Moxo."},"EditStepRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":500,"description":"The step's new name."},"description":{"type":"string","maxLength":20000,"description":"The step's instructions. Plain text or the same rich text the app writes; unsafe HTML is removed. An empty string clears them."},"dueAt":{"type":["string","null"],"format":"date-time","description":"When the step is due, as an ISO 8601 date and time. `null` removes the due date. A time that has already passed returns `400 DUE_DATE_IN_PAST`. Not with `stepDue`.","example":"2026-11-30T17:00:00Z"},"stepDue":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["RELATIVE"],"description":"Due a set time after the step starts."},"value":{"type":"number","exclusiveMinimum":0,"description":"How long after the step starts it is due.","example":3},"unit":{"type":"string","enum":["MINUTES","HOURS","DAYS","WEEKS"],"description":"The unit of `value`."},"dayType":{"type":"string","enum":["calendar","business"],"description":"`business` counts working days only. Default `calendar`."}},"required":["type","value","unit"],"additionalProperties":false,"description":"Due this long after the step starts."},{"type":"object","properties":{"type":{"type":"string","enum":["FIXED"],"description":"Due on a set day."},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"The day it is due, `YYYY-MM-DD`. A day that does not exist (`2026-02-31`) returns `400 VALIDATION_FAILED`.","example":"2026-12-15"}},"required":["type","date"],"additionalProperties":false,"description":"Due on this day."},{"type":"object","properties":{"type":{"type":"string","enum":["BEFORE_FLOW_DUE"],"description":"Due a set time before the flow's due date."},"value":{"type":"number","exclusiveMinimum":0,"description":"How long before the flow is due.","example":2},"unit":{"type":"string","enum":["MINUTES","HOURS","DAYS","WEEKS"],"description":"The unit of `value`."},"dayType":{"type":"string","enum":["calendar","business"],"description":"`business` counts working days only. Default `calendar`."}},"required":["type","value","unit"],"additionalProperties":false,"description":"Due this long before the flow is due."},{"type":"null"}],"description":"When the step is due, as a rule the step keeps: `null` removes it. Not with `dueAt`."},"assignee":{"type":["object","null"],"properties":{"uniqueId":{"type":"string","minLength":1,"description":"The person's org-scoped unique ID (needs the Partner unique ID feature). Send exactly one of `uniqueId`, `userId` or `email`.","example":"cust_984431"},"userId":{"type":"string","minLength":1,"description":"The person's id (`usr_…`)."},"email":{"type":"string","format":"email","description":"Or the email of a person who already exists in this organization. Nobody new is invited."}},"additionalProperties":false,"description":"Give a step that has not started to one person, in place of its roles. `null` takes the person off so the step goes back to its roles. On a step that has more than one role, a person can only fill its one role nobody holds yet, as in Moxo; otherwise this returns `400 AMBIGUOUS_MULTI_ROLE_ASSIGNMENT`: give it to roles with `roleIds` instead. A step that has started returns `409 STEP_STARTED` (use reassign instead), unless it is waiting for someone with nobody on it."},"roleIds":{"type":"array","items":{"type":"string","minLength":1},"minItems":1,"maxItems":50,"description":"Give a step that has not started to these roles (`roles[].roleId` from `GET /v1/flows/{id}`); they replace its roles. Not with `assignee`. A step that has started returns `409 STEP_STARTED` (use reassign instead), unless it is waiting for someone with nobody on it."},"config":{"type":"object","additionalProperties":{},"description":"The step's settings to change, with the keys Get step settings shows in `config`. Each setting you send replaces that setting; settings you leave out stay as they are (an `approval`, `decision` or `esign` object is merged into the current one). Send a list (form fields, options, checklist items, signature fields) whole. Every setting is checked before anything changes, and all problems come back at once in `error.details`: a setting this step type doesn't have, or a value it can't use, returns `400 INVALID_STEP_SETTINGS`; a setting your plan doesn't include returns `400 CAPABILITY_DISABLED`; the name, description, people and due-date rule inside `config` return `SENT_AS_ITS_OWN_FIELD`, naming the field to send instead.","example":{"formFields":[{"fieldId":"full_name","label":"Full name","type":"TEXT_SINGLE_LINE","required":true}]}},"signers":{"type":"object","properties":{"add":{"type":"array","items":{"type":"string","minLength":1},"minItems":1,"maxItems":20,"description":"Roles to add as signers (`roleId` from `signers.canAdd` in Get step settings): a role of this flow held by one person. Each added signer signs where you place their fields (`config.fields` with their `roleId`), in the same request."},"order":{"type":"array","items":{"type":"string","minLength":1},"minItems":1,"maxItems":40,"description":"With `add`, for signers who take turns: every signer's `roleId`, in the order they sign, the added ones included. As in Moxo, the order is set when signers are added."}},"additionalProperties":false,"description":"An e-sign step only: add signers, and with them the signing order, as Add signer does in Moxo."}},"additionalProperties":false},"StepEditEffects":{"type":"object","properties":{"signersRelinked":{"type":"integer","minimum":0,"description":"Signers sent a new link because what they sign changed (the document, its fields, the signers or the signing style). Their earlier links stop working. `0` while the step is being prepared: its signers are told when preparation ends."},"linksResent":{"type":"integer","minimum":0,"description":"People sent new one-tap buttons (Approve, Acknowledge, Mark done, a decision's options) because what a to-do, acknowledgement, approval or decision asks changed. The buttons in their earlier email stop working; the link that opens the step still does. `0` when no one-tap email went out."}},"required":["signersRelinked","linksResent"],"additionalProperties":false,"description":"How many people this save sent a new link. Counts people a notice was queued for, never people it did not reach."},"StepLocks":{"type":"object","properties":{"content":{"type":"object","properties":{"locked":{"type":"boolean","description":"Whether a save that changes it is refused now."},"reason":{"type":["string","null"],"enum":["answered","acknowledged","signed","decided","voted","chosen","under_review","finished","set_at_send","preparer_placed","ai_set_at_send",null],"description":"Why, when locked; else `null`."},"code":{"type":["string","null"],"description":"The error code a save changing what the step asks gets now (for example `STEP_ALREADY_ANSWERED`), or `null`."},"sentence":{"type":["string","null"],"description":"The sentence that refusal says, or `null`."}},"required":["locked","reason","code","sentence"],"additionalProperties":false,"description":"What the step asks: the questions, options, document and fields, and (an approval's or acknowledgement's) the description. The name, due date and reminders always change."},"completionMode":{"type":"object","properties":{"locked":{"type":"boolean","description":"Whether a save that changes it is refused now."},"reason":{"type":["string","null"],"enum":["answered","acknowledged","signed","decided","voted","chosen","under_review","finished","set_at_send","preparer_placed","ai_set_at_send",null],"description":"Why, when locked; else `null`."}},"required":["locked","reason"],"additionalProperties":false,"description":"Whether anyone or everyone must respond. Fixed once someone responded."},"aiHelp":{"type":"object","properties":{"prepare":{"type":"object","properties":{"locked":{"type":"boolean","description":"Whether a save that changes it is refused now."},"reason":{"type":["string","null"],"enum":["answered","acknowledged","signed","decided","voted","chosen","under_review","finished","set_at_send","preparer_placed","ai_set_at_send",null],"description":"Why, when locked; else `null`."}},"required":["locked","reason"],"additionalProperties":false,"description":"AI preparation (`prepare`): adding, removing or changing an AI preparer."},"preparers":{"type":"object","properties":{"locked":{"type":"boolean","description":"Whether a save that changes it is refused now."},"reason":{"type":["string","null"],"enum":["answered","acknowledged","signed","decided","voted","chosen","under_review","finished","set_at_send","preparer_placed","ai_set_at_send",null],"description":"Why, when locked; else `null`."}},"required":["locked","reason"],"additionalProperties":false,"description":"Who prepares (`preparers`, people). Fixed once preparation can have started: an action when it is sent, a flow step once it starts (`reason` `set_at_send`)."},"assist_switch":{"type":"object","properties":{"locked":{"type":"boolean","description":"Whether a save that changes it is refused now."},"reason":{"type":["string","null"],"enum":["answered","acknowledged","signed","decided","voted","chosen","under_review","finished","set_at_send","preparer_placed","ai_set_at_send",null],"description":"Why, when locked; else `null`."}},"required":["locked","reason"],"additionalProperties":false,"description":"Assist on or off (`assist_switch`)."},"assist_agent":{"type":"object","properties":{"locked":{"type":"boolean","description":"Whether a save that changes it is refused now."},"reason":{"type":["string","null"],"enum":["answered","acknowledged","signed","decided","voted","chosen","under_review","finished","set_at_send","preparer_placed","ai_set_at_send",null],"description":"Why, when locked; else `null`."}},"required":["locked","reason"],"additionalProperties":false,"description":"Which agent Assist uses (`assist_agent`)."},"assist_grants":{"type":"object","properties":{"locked":{"type":"boolean","description":"Whether a save that changes it is refused now."},"reason":{"type":["string","null"],"enum":["answered","acknowledged","signed","decided","voted","chosen","under_review","finished","set_at_send","preparer_placed","ai_set_at_send",null],"description":"Why, when locked; else `null`."}},"required":["locked","reason"],"additionalProperties":false,"description":"Which earlier answers Assist may read (`assist_grants`)."},"advise":{"type":"object","properties":{"locked":{"type":"boolean","description":"Whether a save that changes it is refused now."},"reason":{"type":["string","null"],"enum":["answered","acknowledged","signed","decided","voted","chosen","under_review","finished","set_at_send","preparer_placed","ai_set_at_send",null],"description":"Why, when locked; else `null`."}},"required":["locked","reason"],"additionalProperties":false,"description":"Advise (`advise`)."},"ai_review":{"type":"object","properties":{"locked":{"type":"boolean","description":"Whether a save that changes it is refused now."},"reason":{"type":["string","null"],"enum":["answered","acknowledged","signed","decided","voted","chosen","under_review","finished","set_at_send","preparer_placed","ai_set_at_send",null],"description":"Why, when locked; else `null`."}},"required":["locked","reason"],"additionalProperties":false,"description":"AI Review (`ai_review`): adding, removing or changing an AI reviewer."},"ai_rename":{"type":"object","properties":{"locked":{"type":"boolean","description":"Whether a save that changes it is refused now."},"reason":{"type":["string","null"],"enum":["answered","acknowledged","signed","decided","voted","chosen","under_review","finished","set_at_send","preparer_placed","ai_set_at_send",null],"description":"Why, when locked; else `null`."}},"required":["locked","reason"],"additionalProperties":false,"description":"Rename files (`ai_rename`, `config.aiRename`): turning it on or off, AI naming or a naming pattern, and its wording."}},"required":["prepare","preparers","assist_switch","assist_agent","assist_grants","advise","ai_review","ai_rename"],"additionalProperties":false,"description":"AI help is fixed when the step is sent, and who prepares once preparation can have started. Each key is the name a refused save lists in `error.details.settings`. What Assist knows and how it answers (its setup) still changes."}},"required":["content","completionMode","aiHelp"],"additionalProperties":false,"description":"What a save would refuse now, and why: the same check the edit makes."},"RunningStepSettings":{"type":"object","properties":{"id":{"type":"string","description":"The step's execution id."},"stepId":{"type":"string","description":"The step on the flow."},"type":{"type":"string","description":"The step type, such as `FORM` or `ESIGN`.","example":"FORM"},"stepType":{"type":"string","deprecated":true,"description":"Deprecated: the step's type, the same as `type`. Read `type`; this field is still sent so integrations built on it keep working."},"templateStepId":{"type":"string","deprecated":true,"description":"Deprecated: the step on the flow, the same as `stepId`. Read `stepId`; this field is still sent so integrations built on it keep working."},"status":{"type":"string","enum":["PENDING","AWAITING_HOST_SETUP","AWAITING_CONNECTION","AWAITING_BUNDLE","WAITING_FOR_ASSIGNEE","PREPARING","IN_PROGRESS","REVIEWING","PAUSED","COMPLETED","SKIPPED","CANCELLED","FAILED","SUPERSEDED"],"description":"The step's status in this run."},"name":{"type":["string","null"],"description":"The step's name. Change it with `name`."},"description":{"type":["string","null"],"description":"The step's instructions. Change them with `description`."},"editable":{"type":"object","properties":{"now":{"type":"boolean","description":"Whether Moxo changes this step's settings now. A change can still be refused for something that happened on the step (someone signed or acknowledged it)."},"until":{"type":["string","null"],"enum":["submitted","started",null],"description":"`submitted`: until the person doing the step submits it. `started`: until the step starts. `null`: Moxo doesn't change this step type's settings on a running flow."}},"required":["now","until"],"additionalProperties":false,"description":"Whether the settings can change, and until when."},"locks":{"type":"object","properties":{"content":{"type":"object","properties":{"locked":{"type":"boolean","description":"Whether a save that changes it is refused now."},"reason":{"type":["string","null"],"enum":["answered","acknowledged","signed","decided","voted","chosen","under_review","finished","set_at_send","preparer_placed","ai_set_at_send",null],"description":"Why, when locked; else `null`."},"code":{"type":["string","null"],"description":"The error code a save changing what the step asks gets now (for example `STEP_ALREADY_ANSWERED`), or `null`."},"sentence":{"type":["string","null"],"description":"The sentence that refusal says, or `null`."},"until":{"type":["string","null"],"enum":["first_answer","sent","started","submitted",null],"description":"Until when what the step asks can change: `first_answer`: until someone answers, acknowledges, decides, votes, chooses or signs. `sent`: fixed when it was sent. `started`: until the step starts. `submitted`: until the person doing the step submits it. `null`: Moxo doesn't change it on a running flow."}},"required":["locked","reason","code","sentence","until"],"additionalProperties":false,"description":"What the step asks: whether a save changing it is refused now, why, with the code and sentence, and until when it can change."},"completionMode":{"type":"object","properties":{"locked":{"type":"boolean","description":"Whether a save that changes it is refused now."},"reason":{"type":["string","null"],"enum":["answered","acknowledged","signed","decided","voted","chosen","under_review","finished","set_at_send","preparer_placed","ai_set_at_send",null],"description":"Why, when locked; else `null`."}},"required":["locked","reason"],"additionalProperties":false,"description":"Whether anyone or everyone must respond. Fixed once someone responded."},"aiHelp":{"type":"object","properties":{"prepare":{"type":"object","properties":{"locked":{"type":"boolean","description":"Whether a save that changes it is refused now."},"reason":{"type":["string","null"],"enum":["answered","acknowledged","signed","decided","voted","chosen","under_review","finished","set_at_send","preparer_placed","ai_set_at_send",null],"description":"Why, when locked; else `null`."}},"required":["locked","reason"],"additionalProperties":false,"description":"AI preparation (`prepare`): adding, removing or changing an AI preparer."},"preparers":{"type":"object","properties":{"locked":{"type":"boolean","description":"Whether a save that changes it is refused now."},"reason":{"type":["string","null"],"enum":["answered","acknowledged","signed","decided","voted","chosen","under_review","finished","set_at_send","preparer_placed","ai_set_at_send",null],"description":"Why, when locked; else `null`."}},"required":["locked","reason"],"additionalProperties":false,"description":"Who prepares (`preparers`, people). Fixed once preparation can have started: an action when it is sent, a flow step once it starts (`reason` `set_at_send`)."},"assist_switch":{"type":"object","properties":{"locked":{"type":"boolean","description":"Whether a save that changes it is refused now."},"reason":{"type":["string","null"],"enum":["answered","acknowledged","signed","decided","voted","chosen","under_review","finished","set_at_send","preparer_placed","ai_set_at_send",null],"description":"Why, when locked; else `null`."}},"required":["locked","reason"],"additionalProperties":false,"description":"Assist on or off (`assist_switch`)."},"assist_agent":{"type":"object","properties":{"locked":{"type":"boolean","description":"Whether a save that changes it is refused now."},"reason":{"type":["string","null"],"enum":["answered","acknowledged","signed","decided","voted","chosen","under_review","finished","set_at_send","preparer_placed","ai_set_at_send",null],"description":"Why, when locked; else `null`."}},"required":["locked","reason"],"additionalProperties":false,"description":"Which agent Assist uses (`assist_agent`)."},"assist_grants":{"type":"object","properties":{"locked":{"type":"boolean","description":"Whether a save that changes it is refused now."},"reason":{"type":["string","null"],"enum":["answered","acknowledged","signed","decided","voted","chosen","under_review","finished","set_at_send","preparer_placed","ai_set_at_send",null],"description":"Why, when locked; else `null`."}},"required":["locked","reason"],"additionalProperties":false,"description":"Which earlier answers Assist may read (`assist_grants`)."},"advise":{"type":"object","properties":{"locked":{"type":"boolean","description":"Whether a save that changes it is refused now."},"reason":{"type":["string","null"],"enum":["answered","acknowledged","signed","decided","voted","chosen","under_review","finished","set_at_send","preparer_placed","ai_set_at_send",null],"description":"Why, when locked; else `null`."}},"required":["locked","reason"],"additionalProperties":false,"description":"Advise (`advise`)."},"ai_review":{"type":"object","properties":{"locked":{"type":"boolean","description":"Whether a save that changes it is refused now."},"reason":{"type":["string","null"],"enum":["answered","acknowledged","signed","decided","voted","chosen","under_review","finished","set_at_send","preparer_placed","ai_set_at_send",null],"description":"Why, when locked; else `null`."}},"required":["locked","reason"],"additionalProperties":false,"description":"AI Review (`ai_review`): adding, removing or changing an AI reviewer."},"ai_rename":{"type":"object","properties":{"locked":{"type":"boolean","description":"Whether a save that changes it is refused now."},"reason":{"type":["string","null"],"enum":["answered","acknowledged","signed","decided","voted","chosen","under_review","finished","set_at_send","preparer_placed","ai_set_at_send",null],"description":"Why, when locked; else `null`."}},"required":["locked","reason"],"additionalProperties":false,"description":"Rename files (`ai_rename`, `config.aiRename`): turning it on or off, AI naming or a naming pattern, and its wording."}},"required":["prepare","preparers","assist_switch","assist_agent","assist_grants","advise","ai_review","ai_rename"],"additionalProperties":false,"description":"AI help is fixed when the step is sent, and who prepares once preparation can have started. Each key is the name a refused save lists in `error.details.settings`. What Assist knows and how it answers (its setup) still changes."}},"required":["content","completionMode","aiHelp"],"additionalProperties":false,"description":"What a save would refuse now, and why, and until when what the step asks can change."},"config":{"type":"object","additionalProperties":{},"description":"The step's settings, with the keys `PATCH /v1/flows/{id}/steps/{stepId}` takes in `config`. A file is named by its `fileId`; a person by their id (`usr_…`). Send a setting back unchanged and nothing changes."},"stepDue":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["RELATIVE"],"description":"Due a set time after the step starts."},"value":{"type":"number","description":"How long after the step starts it is due."},"unit":{"type":"string","description":"The unit of `value`: `MINUTES`, `HOURS`, `DAYS` or `WEEKS`."},"dayType":{"type":"string","description":"`business` counts working days only."}},"required":["type","value","unit"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["FIXED"],"description":"Due on a set day."},"date":{"type":"string","description":"The day it is due, `YYYY-MM-DD`."}},"required":["type","date"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["BEFORE_FLOW_DUE"],"description":"Due a set time before the flow's due date."},"value":{"type":"number","description":"How long before the flow is due."},"unit":{"type":"string","description":"The unit of `value`."},"dayType":{"type":"string","description":"`business` counts working days only."}},"required":["type","value","unit"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["DDR","DATA_TABLE_DATE"],"description":"Where the rule reads its date."}},"required":["type"],"additionalProperties":false,"description":"A rule set in Moxo that reads the date from an earlier step (`DDR`) or a data table (`DATA_TABLE_DATE`). Send `stepDue` to replace it."},{"type":"null"}],"description":"The step's due-date rule, as the step stores it, or `null`."},"signers":{"type":"object","properties":{"signingOrder":{"type":"string","enum":["SEQUENTIAL","PARALLEL"],"description":"`SEQUENTIAL`: signers take turns. `PARALLEL`: everyone signs at once."},"roleIds":{"type":"array","items":{"type":"string"},"description":"The roles that sign this step."},"canAdd":{"type":"array","items":{"type":"object","properties":{"roleId":{"type":"string","description":"The role, for `signers.add`."},"name":{"type":"string","description":"The role's name."}},"required":["roleId","name"],"additionalProperties":false},"description":"Roles you can add as signers now (`signers.add`)."}},"required":["signingOrder","roleIds","canAdd"],"additionalProperties":false,"description":"An e-sign step only."}},"required":["id","stepId","type","status","name","description","editable","locks","config","stepDue"],"additionalProperties":false},"RemovedStep":{"type":"object","properties":{"id":{"type":"string","description":"The removed run's execution id."},"stepId":{"type":"string","description":"The step on the flow."},"templateStepId":{"type":"string","deprecated":true,"description":"Deprecated: the step on the flow, the same as `stepId`. Read `stepId`; this field is still sent so integrations built on it keep working."},"outcome":{"type":"string","enum":["deleted","skipped"],"description":"`deleted`: a step added to this flow at the top level that the flow hadn't reached yet (status `PENDING`) is gone, as if it was never added. `skipped`: any other step (one the flow has reached, even if nobody acted on it, and one added inside a branch path included) stays in the flow's steps as `SKIPPED` (\"Removed by owner\"), and the flow moves on past it."}},"required":["id","stepId","outcome"],"additionalProperties":false},"RemoveStepRequest":{"type":"object","properties":{"reason":{"type":"string","minLength":1,"maxLength":5000,"description":"Optional. Why the step is removed. It is kept on the audit trail.","example":"The broker sent this form twice."}},"additionalProperties":false},"AddLoopItemRequest":{"type":"object","properties":{"item":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{"type":"string"}},{"type":"null"}]},"description":"The item, by the loop's item field names. Omit for a loop that repeats a number of times. A list of plain values takes `{ \"value\": \"...\" }`.","example":{"Question":"Sanctions screening contact","Details":"Name the person who handles sanctions screening."}},"recordId":{"type":"string","minLength":1,"description":"A loop over a data table: the existing row to add."},"reason":{"type":"string","minLength":1,"maxLength":2000,"description":"Optional. Why the item was added. It is kept on the audit trail.","example":"The broker sent it after we started."}},"additionalProperties":false},"AddedLoopItem":{"type":"object","properties":{"index":{"type":"integer","description":"The item's place in the loop, from 0."},"total":{"type":"integer","description":"Items in the loop now."},"start":{"type":"object","properties":{"kind":{"type":"string","enum":["now","after_previous","scheduled","not_started"],"description":"When the item starts."},"at":{"type":"string","description":"With `scheduled`: when it starts (ISO 8601)."}},"required":["kind"],"description":"`now`: it started. `after_previous`: a one-at-a-time loop; it starts after the items before it. `scheduled`: a loop with a start interval; it starts at `at`. `not_started`: the item was added but could not be started; it waits until the loop runs again."}},"required":["index","total","start"],"additionalProperties":false},"MoveStepRequest":{"type":"object","properties":{"afterStepId":{"type":"string","minLength":1,"description":"Put the step right after this one (`steps[].stepId` or `steps[].id` from `GET /v1/flows/{id}`).","example":"step-4"},"beforeStepId":{"type":"string","minLength":1,"description":"Or right before this one. Send exactly one of `afterStepId` and `beforeStepId`.","example":"step-2"}},"additionalProperties":false},"MovedStep":{"type":"object","properties":{"id":{"type":["string","null"],"description":"The moved step's execution id, or `null` for a step inside a branch, decision or loop that has not started (it has no run yet)."},"stepId":{"type":"string","description":"The step on the flow."},"templateStepId":{"type":"string","deprecated":true,"description":"Deprecated: the step on the flow, the same as `stepId`. Read `stepId`; this field is still sent so integrations built on it keep working."},"moved":{"type":"boolean","description":"False when the step already sat there: nothing changed."},"stepIndex":{"type":"integer","description":"The step's position on the flow after the move (a step inside a path has its container's position)."}},"required":["id","stepId","moved","stepIndex"],"additionalProperties":false},"PauseFlowRequest":{"type":"object","properties":{"reason":{"type":"string","minLength":1,"maxLength":500,"description":"Required. Why the flow is paused. Everyone who opens the flow sees it, and it is kept on the audit trail.","example":"Waiting on the client's bank to confirm the transfer."}},"required":["reason"],"additionalProperties":false},"ForceCompleteStepRequest":{"type":"object","properties":{"resultData":{"type":"object","additionalProperties":{},"description":"The step's result, in the same shape as `/complete` takes it: a form's answers keyed by each field's `fieldId`."},"reason":{"type":"string","description":"Why you are completing the step. It is recorded on the audit trail."},"skipReview":{"type":"boolean","description":"For a step with a reviewer: `true` completes it now, without its review. Omitted or `false`, the step goes to its reviewer, who approves it or asks for changes."},"timeEntry":{"type":"object","additionalProperties":false,"properties":{"minutes":{"type":"integer","minimum":1,"maximum":1439,"description":"The time spent, in whole minutes, 1 to 1439."},"billable":{"type":"boolean","description":"Whether the time is billable."},"description":{"type":["string","null"],"maxLength":500,"description":"What the time was spent on, up to 500 characters. Leave it out, or send `null` or an empty string, for none."},"forUserId":{"type":"string","minLength":1,"maxLength":200,"description":"Whose time this is (`usr_…`): a person on this step, or you."}},"required":["minutes","billable","forUserId"],"description":"Time tracking only: whose time this is and how long it took. `forUserId` is a person on this step (the entry goes on their part of it) or you; anyone else is refused with `400 TIME_ENTRY_INVALID`. You are recorded as the one who logged it."},"timePrompt":{"type":"boolean","description":"Time tracking only: `true` when your screen asked for time. When the template requires time and this is `true`, a request without `timeEntry` returns `400 TIME_ENTRY_REQUIRED`. Leave it out to finish without time; the person can log it later."}},"additionalProperties":false},"CompleteStepRequest":{"type":"object","properties":{"resultData":{"type":"object","additionalProperties":{},"description":"The step's result. Its shape depends on the step type. A form's answers are keyed by each field's `fieldId` from `GET /v1/flows/{id}` (for example `\"field-5fc19b7eba08\"`), and a questionnaire's by each question's `questionId`: the keys a step read returns its answers under. A field's `key` or label in place of its id returns `400 VALIDATION_FAILED` naming the id to send.","example":{"field-5fc19b7eba08":"Acme Corp"}},"note":{"type":"string","maxLength":20000,"description":"A note to post with your completion, up to 4,000 characters, when the flow has Shared notes turned on. With `noteFormat: \"html\"` it is HTML, up to 20,000 characters, cleaned to the formatting notes allow."},"noteFormat":{"type":"string","enum":["text","html"],"description":"Whether `note` is plain text (`text`, the default) or HTML (`html`)."},"askedFingerprint":{"type":"string","minLength":1,"maxLength":64,"description":"The step's `askedFingerprint` from `GET /v1/flows/{id}/steps/{stepId}`. When what the step asks changed since you read it, nothing is saved and the call returns `409 STEP_CHANGED`. Left out, the answer is saved without this check.","example":"af1-3b0c9e14a2d75f68"},"timeEntry":{"type":"object","additionalProperties":false,"properties":{"minutes":{"type":"integer","minimum":1,"maximum":1439,"description":"The time spent, in whole minutes, 1 to 1439."},"billable":{"type":"boolean","description":"Whether the time is billable."},"description":{"type":["string","null"],"maxLength":500,"description":"What the time was spent on, up to 500 characters. Leave it out, or send `null` or an empty string, for none."}},"required":["minutes","billable"],"description":"Time tracking only: the time spent, as `minutes` (1 to 1439), `billable` and an optional `description` (up to 500 characters). Saved with this request, and only if it succeeds. Ignored when the flow doesn't track time or the person acting isn't on your team. A value that isn't valid returns `400 TIME_ENTRY_INVALID` with its `field`, and nothing is completed."},"timePrompt":{"type":"boolean","description":"Time tracking only: `true` when your screen asked for time. When the template requires time and this is `true`, a request without `timeEntry` returns `400 TIME_ENTRY_REQUIRED`. Leave it out to finish without time; the person can log it later."}},"additionalProperties":false},"DeclineStepRequest":{"type":"object","properties":{"reason":{"type":"string","minLength":1,"description":"Why the step is declined. The requester and the audit trail show it."},"action":{"type":"string","enum":["request_changes","reject"],"description":"`request_changes` sends the step back for changes; `reject` rejects it. Left out, the approval does what its `onReject` setting says. An approval offers `reject` only when its `onReject.action` is `end_flow` or `rejection_steps` (or it has rejection steps), and `request_changes` only when it doesn't end the flow or run rejection steps; an action it doesn't offer returns `400 VALIDATION_ERROR`, and `error.details` names the `onReject` values that allow it."},"targetStepIds":{"type":"array","items":{"type":"string"},"description":"When the approver chooses which earlier steps to reopen (`onReject.action` `approver_decides`): those steps, each by its run's `steps[].id` or its `steps[].stepId` from `GET /v1/flows/{id}`. A `stepId` that more than one run shares (a For each step) returns `409 AMBIGUOUS_STEP` with the runs' ids in `error.runIds`, and nothing is sent back."},"askedFingerprint":{"type":"string","minLength":1,"maxLength":64,"description":"The approval's `askedFingerprint` from `GET /v1/flows/{id}/steps/{stepId}`. When what it asks changed since you read it, nothing is saved and the call returns `409 STEP_CHANGED`.","example":"af1-3b0c9e14a2d75f68"},"timeEntry":{"type":"object","additionalProperties":false,"properties":{"minutes":{"type":"integer","minimum":1,"maximum":1439,"description":"The time spent, in whole minutes, 1 to 1439."},"billable":{"type":"boolean","description":"Whether the time is billable."},"description":{"type":["string","null"],"maxLength":500,"description":"What the time was spent on, up to 500 characters. Leave it out, or send `null` or an empty string, for none."}},"required":["minutes","billable"],"description":"Time tracking only: the time spent, as `minutes` (1 to 1439), `billable` and an optional `description` (up to 500 characters). Saved with this request, and only if it succeeds. Ignored when the flow doesn't track time or the person acting isn't on your team. A value that isn't valid returns `400 TIME_ENTRY_INVALID` with its `field`, and nothing is completed."},"timePrompt":{"type":"boolean","description":"Time tracking only: `true` when your screen asked for time. When the template requires time and this is `true`, a request without `timeEntry` returns `400 TIME_ENTRY_REQUIRED`. Leave it out to finish without time; the person can log it later."}},"required":["reason"],"additionalProperties":false},"PrepareCompleteRequest":{"type":"object","properties":{"resultData":{"type":"object","additionalProperties":{},"description":"The step's result. Its shape depends on the step type. A form's answers are keyed by each field's `fieldId` from `GET /v1/flows/{id}` (for example `\"field-5fc19b7eba08\"`), and a questionnaire's by each question's `questionId`: the keys a step read returns its answers under. A field's `key` or label in place of its id returns `400 VALIDATION_FAILED` naming the id to send.","example":{"field-5fc19b7eba08":"Acme Corp"}},"overrides":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":200,"description":"The step's name for this run, up to 200 characters. A title of only spaces is refused."},"description":{"type":"string","maxLength":10000,"description":"What the step asks of its assignee in this run, up to 10,000 characters, in place of the step's own."},"attachments":{"type":"array","items":{"type":"object","properties":{"fileName":{"type":"string","minLength":1,"maxLength":512,"description":"The file's name, as people see it, up to 512 characters."},"mediaType":{"type":"string","minLength":1,"maxLength":200,"description":"The file's media type, such as `application/pdf`."},"data":{"type":"string","minLength":1,"description":"The file's contents, base64-encoded, without a `data:` prefix. Up to 10 MB a file (before encoding); more returns `413 PAYLOAD_TOO_LARGE`."},"uploadedAt":{"type":"string","description":"When you added the file, as an ISO 8601 date and time. It is kept as sent."}},"required":["fileName","mediaType","data","uploadedAt"]},"maxItems":20,"description":"Files to add to the step's reference materials, sent in the body. Up to 20, counting the ones other preparers of the step added; more returns `422`. The files in one request may be up to 15 MB together (before encoding); more returns `413 PAYLOAD_TOO_LARGE`. A file sent again is kept once."},"dueDate":{"type":"string","description":"When the step is due: a day (`2026-11-05`), due at noon that day in the organization's time zone, or an ISO 8601 date and time. A date and time with no offset is read in the organization's time zone. An empty string removes the due date. A day that has already ended, or a time that has already passed, returns `400 DUE_DATE_IN_PAST`."},"privateNote":{"type":"string","maxLength":5000,"description":"A note for the step's assignee, up to 5,000 characters. They see it on the step."},"setup":{"type":"object","properties":{"documentRef":{"type":"string","format":"uuid","description":"An e-sign, PDF form or document review step: the document to sign, fill in or review in this run, as the `fileId` of a file you uploaded to this step (`POST /v1/flows/{flowId}/steps/{stepId}/files`). Leave it out to keep the step's own document."},"prefilledValues":{"type":"object","additionalProperties":{},"description":"Values the assignee starts with, keyed by a form or PDF form field's id, a questionnaire question's id, or an e-sign text, full name or checkbox field's `id`. Each value is in the shape that field or question takes."},"starterAttachments":{"type":"array","items":{"type":"object","properties":{"ref":{"type":"string","format":"uuid","description":"The `fileId` of a file you uploaded to this step (`POST /v1/flows/{flowId}/steps/{stepId}/files`)."}},"required":["ref"]},"maxItems":20,"description":"A file request step: up to 20 files to give the assignee to start from. They are never counted as files the assignee uploaded."},"fields":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The field's id, unique in the list. Keep it on a field you change; give a field you add an id of your own."},"type":{"type":"string","enum":["signature","initials","stamp","date_signed","full_name","text","checkbox","dropdown","radio","multi_select"],"description":"The field's type: `signature`, `initials`, `stamp`, `date_signed`, `full_name`, `text`, `checkbox`, `dropdown`, `radio` or `multi_select`. A `stamp` box holds a picture of the signer's seal, chosen while signing. A signer whose only boxes are stamps signs with the stamp, and the certificate shows the method as Stamp."},"roleId":{"type":"string","description":"The `roleId` of the signer who fills it."},"required":{"type":"boolean","default":true,"description":"Whether the signer must fill it. Defaults to `true`."},"page":{"type":"integer","minimum":1,"description":"The page the field is on, counting from 1."},"x":{"type":"number","minimum":0,"maximum":100,"description":"The field's left edge, as a percentage of the page width."},"y":{"type":"number","minimum":0,"maximum":100,"description":"The field's top edge, as a percentage of the page height."},"width":{"type":"number","minimum":0.1,"maximum":100,"description":"The field's width, as a percentage of the page width."},"height":{"type":"number","minimum":0.1,"maximum":100,"description":"The field's height, as a percentage of the page height."},"defaultValue":{"type":"string","description":"For a text or full-name field: the value it starts with, fixed or a reference to a flow value."},"placeholder":{"type":"string","description":"A hint shown in the empty field. It is never printed."},"label":{"type":"string","description":"The field's label, as signers see it."},"context":{"type":"string","maxLength":500,"description":"A note for the AI preparer only. Signers never see it."},"locked":{"type":"boolean","description":"For a text or full-name field: can't be changed once the signer fills it."},"forceCurrentDate":{"type":"boolean","description":"For a signing date: filled with today's date and locked."},"onlyFutureDates":{"type":"boolean","description":"For a signing date: accepts only future dates."},"maxLength":{"type":"integer","minimum":1,"description":"For a text or full-name field: the most characters accepted."},"options":{"type":"array","items":{"type":"string"},"description":"For a dropdown, radio or multi-select field: its options."},"checkboxGroup":{"type":"string","description":"For checkboxes: a group name. Checkboxes in one group act like radio buttons: checking one unchecks the others."},"format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"Set to `text`."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["number"],"description":"Set to `number`."},"min":{"type":"number","description":"The smallest number accepted, inclusive. Taken from the PDF's own range check on upload, or set in the field editor."},"max":{"type":"number","description":"The largest number accepted, inclusive. Taken from the PDF's own range check on upload, or set in the field editor."},"customMessage":{"type":"string","maxLength":500,"description":"The message shown when a number is out of range, instead of the standard one. Set in the field editor; an upload never fills it in."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["phone"],"description":"Set to `phone`."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["email"],"description":"Set to `email`."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["zip"],"description":"Set to `zip`."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["ssn"],"description":"Set to `ssn`."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["date"],"description":"Set to `date`."},"defaultToCurrentDate":{"type":"boolean","description":"Starts the date at today."},"futureDatesOnly":{"type":"boolean","description":"Accepts only dates after today."},"pastDatesOnly":{"type":"boolean","description":"Accepts only dates before today."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["custom"],"description":"Set to `custom`."},"regex":{"type":"string","minLength":1,"maxLength":500,"description":"For a pattern format: the regular expression the value must match."}},"required":["type","regex"]}],"description":"The format a text field must have, such as a number, an email or a date."},"fontSize":{"type":"number","minimum":8,"maximum":36,"description":"The text size, in points, 8 to 36."},"fontColor":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$","description":"The text color, as a hex color such as `#1a2b3c`."},"pdfFieldName":{"type":"string","description":"The field's name in the PDF. Set by Moxo when the PDF is read; send back what Moxo returned, or leave it out."},"origin":{"type":"string","enum":["acroform","anchor","custom"],"description":"Whether the field is the PDF's own form field (`acroform`) or drawn on the page (`anchor`, `custom`). Required with `pdfFieldName`. Set by Moxo when the PDF is read; send back what Moxo returned, or leave it out."},"inferredFrom":{"type":"string","enum":["auto","manual"],"description":"Whether Moxo found the field (`auto`) or a person placed it (`manual`). Set by Moxo; leave it out."},"widgetPositions":{"type":"array","items":{"type":"object","properties":{"page":{"type":"number","description":"The page the box is on, counting from 1."},"x":{"type":"number","description":"The box's left edge, as a percentage of the page width."},"y":{"type":"number","description":"The box's top edge, as a percentage of the page height."},"width":{"type":"number","description":"The box's width, as a percentage of the page width."},"height":{"type":"number","description":"The box's height, as a percentage of the page height."},"optionValue":{"type":"string","description":"The option this box selects."}},"required":["page","x","y","width","height","optionValue"]},"description":"For a radio field: one box for each option. Set by Moxo when the PDF is read; send back what Moxo returned, or leave it out."},"readOnly":{"type":"boolean","description":"The signer can't change it: it shows its value."},"signatureLine":{"type":"boolean","description":"For a signature or initials field: `true` draws a line under the box when it is signed. Leave it out for none."},"labelAnchor":{"type":"object","properties":{"text":{"type":"string","minLength":1,"maxLength":40,"description":"The printed label this field follows, such as `By:`."},"nearby":{"type":"string","minLength":1,"maxLength":200,"description":"The line of text above that label, when one is close enough to tell two copies apart."},"occurrence":{"type":"integer","minimum":1,"maximum":20,"description":"Which copy of the label this field follows. The first copy is 1."},"occurrenceCount":{"type":"integer","minimum":1,"maximum":20,"description":"How many copies of that label, with the same line above, the sample had."},"dx":{"type":"number","minimum":-2000,"maximum":2000,"description":"How far the field sits to the right of the label, in points. A negative number sits to its left."},"dy":{"type":"number","minimum":-2000,"maximum":2000,"description":"How far the field sits below the label, in points. A negative number sits above it."}},"required":["text","occurrence","occurrenceCount","dx","dy"],"description":"Where this field sits relative to a printed label on the sample. Recorded when fields are placed from the sample's labels. Absent when the field stays on its page number."},"defaultValueSource":{"type":"string","enum":["builder","ddr","ai","person"],"description":"Who set `defaultValue`: `builder` (the template), `ddr` (a value from earlier in the flow), `ai` (the AI that fills in fields in advance) or `person` (someone preparing the step). Send back what Moxo returned, or leave it out."},"defaultValueFrom":{"type":"string","maxLength":300,"description":"Where `defaultValue` was copied from, as a label such as `Intake form › Company name`. Send back what Moxo returned, or leave it out."}},"required":["id","type","roleId","page","x","y","width","height"]},"maxItems":200,"description":"An e-sign step: the signing fields on the document, up to 200, each with the `roleId` of the signer who fills it. They replace the step's fields for this run, so send them all. Leave it out to keep the step's own."},"pdfFormFields":{"type":"array","items":{"type":"object","properties":{"fieldId":{"type":"string","description":"The field's id, unique in the list. Keep it on a field you change; give a field you place an id of your own."},"pdfFieldName":{"type":"string","description":"The field's name in the PDF, as Moxo returned it when it read the document. For a field you place yourself, send its `fieldId`."},"label":{"type":"string","description":"The field's label, as people see it."},"context":{"type":"string","maxLength":500,"description":"A note, up to 500 characters, for the AI that fills in fields in advance. People filling in the form never see it."},"fieldType":{"type":"string","enum":["text","checkbox","dropdown","radio","signature","multi_select"],"description":"The field's type: `text`, `checkbox`, `dropdown`, `radio`, `signature` or `multi_select`."},"required":{"type":"boolean","description":"Whether the field must be filled in."},"requiredSource":{"type":"string","enum":["imported","builder"],"description":"Where the field's required setting came from: `imported` (the PDF marks it required; uploading the PDF again refreshes it) or `builder` (set in Moxo). Send back the value Moxo returned for the field; otherwise leave it out."},"readOnly":{"type":"boolean","description":"Shown with its value, and can't be changed."},"readOnlySource":{"type":"string","enum":["imported","builder"],"description":"Where the field's read-only setting came from: `imported` (the PDF locks it; uploading the PDF again refreshes it) or `builder` (set in Moxo). Send back the value Moxo returned for the field; otherwise leave it out."},"defaultValue":{"type":"string","description":"The value the field starts with: fixed text or a reference to a flow value."},"defaultValueSource":{"type":"string","enum":["builder","ddr","ai","person"],"description":"Who set `defaultValue`: `builder` (the template), `ddr` (a value from earlier in the flow), `ai` (the AI that fills in fields in advance) or `person` (someone preparing the step). Send back what Moxo returned, or leave it out."},"defaultValueFrom":{"type":"string","maxLength":300,"description":"Where `defaultValue` was copied from, as a label such as `Intake form › Company name`. Send back what Moxo returned, or leave it out."},"placeholder":{"type":"string","description":"A hint shown in the empty field, taken from the PDF. It is never a value, and it is never printed."},"multiline":{"type":"boolean","description":"Whether the value wraps inside the box, as the PDF sets it. Read from the document: send back what Moxo returned."},"options":{"type":"array","items":{"type":"string"},"description":"For a dropdown, radio or multi-select field: its options."},"dataRef":{"type":"string","description":"A reference to a value from earlier in the flow that fills in this field in advance."},"maxLength":{"type":"number","description":"For text: the most characters accepted."},"fontSize":{"type":"number","exclusiveMinimum":0,"description":"The text size, in points. Left out, the step's `defaultFontSize` is used, then the size the PDF sets, then a size that fits the box."},"format":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"],"description":"Set to `text`."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["number"],"description":"Set to `number`."},"min":{"type":"number","description":"The smallest number accepted, inclusive. Taken from the PDF's own range check on upload, or set in the field editor."},"max":{"type":"number","description":"The largest number accepted, inclusive. Taken from the PDF's own range check on upload, or set in the field editor."},"customMessage":{"type":"string","maxLength":500,"description":"The message shown when a number is out of range, instead of the standard one. Set in the field editor; an upload never fills it in."},"filledGroup":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"The group's name, the same on every field in it. When the group came from the PDF on upload, it is the PDF's own function name."},"sumMax":{"type":"number","description":"The largest total the group's filled values may add up to, inclusive. The same on every field in the group."}},"required":["id","sumMax"],"description":"A limit on the total of several number fields. Every field in the group has the same `id` and `sumMax`, and the filled values must add up to `sumMax` or less; empty values aren't counted. Set in the field editor, or taken from the PDF on upload when its own validation states the numbers."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["phone"],"description":"Set to `phone`."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["email"],"description":"Set to `email`."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["zip"],"description":"Set to `zip`."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["ssn"],"description":"Set to `ssn`."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["date"],"description":"Set to `date`."},"defaultToCurrentDate":{"type":"boolean","description":"Starts the date at today."},"futureDatesOnly":{"type":"boolean","description":"Accepts only dates after today."},"pastDatesOnly":{"type":"boolean","description":"Accepts only dates before today."}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["custom"],"description":"Set to `custom`."},"regex":{"type":"string","minLength":1,"maxLength":500,"description":"For a pattern format: the regular expression the value must match."}},"required":["type","regex"]}],"description":"The format a text field must have, such as a number, an email or a date."},"formatSource":{"type":"string","enum":["imported","builder"],"description":"Where the field's format came from: `imported` (read from the PDF; uploading the PDF again refreshes it) or `builder` (set in Moxo). Send back the value Moxo returned for the field; otherwise leave it out."},"page":{"type":"number","description":"The page the field is on, counting from 1."},"x":{"type":"number","description":"The field's left edge, as a percentage of the page width."},"y":{"type":"number","description":"The field's top edge, as a percentage of the page height."},"width":{"type":"number","description":"The field's width, as a percentage of the page width."},"height":{"type":"number","description":"The field's height, as a percentage of the page height."},"widgetPositions":{"type":"array","items":{"type":"object","properties":{"page":{"type":"number","description":"The page the box is on, counting from 1."},"x":{"type":"number","description":"The box's left edge, as a percentage of the page width."},"y":{"type":"number","description":"The box's top edge, as a percentage of the page height."},"width":{"type":"number","description":"The box's width, as a percentage of the page width."},"height":{"type":"number","description":"The box's height, as a percentage of the page height."},"optionValue":{"type":"string","description":"The option this box selects."},"pdfFieldName":{"type":"string","description":"For a checkbox question made from separate checkboxes: the PDF's own checkbox this option fills. Absent on a box you placed."}},"required":["page","x","y","width","height","optionValue"]},"description":"For a radio field or a checkbox question: one box for each option. Set by Moxo when the PDF is read; send back what Moxo returned, or leave it out."},"assignedRoleId":{"type":"string","description":"With per-role field assignment: the id of the role that fills in this field."},"origin":{"type":"string","enum":["acroform","anchor","custom"],"description":"Where the field came from: `acroform` (one of the PDF's own form fields), `anchor` (found automatically by AI) or `custom` (added in the template builder)."},"recovered":{"type":"boolean","enum":[true],"description":"`true` on a field Moxo found from a box drawn on the page, where the PDF's own text field had been flattened. Set by Moxo when the PDF is read: send back what Moxo returned, or leave it out on a field you place."},"conditionalLogic":{"type":"object","properties":{"action":{"type":"string","enum":["show","hide"],"description":"Whether the field is shown or hidden when the conditions match. `show`: shown only when they match. `hide`: hidden when they match."},"logicType":{"type":"string","enum":["all","any"],"description":"How the conditions combine. `all`: every condition must match. `any`: at least one must match."},"conditions":{"type":"array","items":{"type":"object","properties":{"source":{"type":"string","enum":["form","ddr"],"description":"Where the condition reads its value. `form`, or omitted: a field in this form. `ddr`: a value from earlier in the flow, such as an earlier step's answer, a start field or a role's details."},"fieldKey":{"type":"string","description":"The field in this form to test, by its field id. Required for a condition on this form, which is the default. Leave it out when `source` is `ddr`, where `ref` names the value instead."},"ref":{"type":"string","description":"The value to test when `source` is `ddr`: a reference to a value from earlier in the flow, such as `${{ steps.intake.fields.segment }}`. Required for that source."},"operator":{"type":"string","enum":["equals","not_equals","contains","not_contains","greater_than","less_than","greater_than_or_equal","less_than_or_equal","starts_with","ends_with","is_empty","is_not_empty","in","not_in"],"description":"How to compare the value. One of `equals`, `not_equals`, `contains`, `not_contains`, `greater_than`, `less_than`, `greater_than_or_equal`, `less_than_or_equal`, `starts_with`, `ends_with`, `is_empty`, `is_not_empty`, `in` or `not_in`."},"value":{"type":"string","description":"The value to compare with."},"valueRef":{"type":"string","description":"The value to compare against, from earlier in the flow, such as `${{ steps.intake.fields.tier }}`. When set, the rule uses that value instead of `value`. A reference that is missing or empty does not match."},"relativeValue":{"type":"object","properties":{"anchor":{"type":"string","enum":["today"],"description":"The date the offset counts from. Only `today` is supported: the date is worked out again each time the rule runs, so it never goes out of date."},"direction":{"type":"string","enum":["before","after"],"description":"Whether the compared date is before or after the anchor. With `offset` and `unit`, `before`, `3` and `years` mean three years before today."},"offset":{"type":"integer","minimum":0,"maximum":1000,"description":"How many units from the anchor: a whole number from 0 to 1000."},"unit":{"type":"string","enum":["days","weeks","months","years"],"description":"The unit of the offset: `days`, `weeks`, `months` or `years`."}},"required":["anchor","direction","offset","unit"],"description":"For a date: compare with a date relative to another, `{ anchor, direction, offset, unit }`, such as 30 days after today."},"columnId":{"type":"string","description":"For a rule on a Look up a record field in this form: the id of a column of the record it picks, from the field's `config.source.columns`. The rule then compares that column instead of the whole record. For an option column, `value` is the option id. When several records are picked, `equals` matches when any of them matches. A timestamp column, and a lookup with no columns, take only `is_empty` and `is_not_empty`."}},"required":["operator"]},"description":"The conditions that decide whether the field is shown. Each one tests another field in this form (`fieldKey`) or a value from earlier in the flow (`source: \"ddr\"` with `ref`)."}},"required":["action","logicType","conditions"],"description":"When the field is shown or hidden, with the same rules as a form field: `{ action: \"show\" | \"hide\", logicType: \"all\" | \"any\", conditions: [...] }`. Rules the PDF already has are imported with it."},"conditionalLogicSource":{"type":"string","enum":["imported","builder"],"description":"Where the field's show or hide rule came from: `imported` (read from the PDF) or `builder` (set in Moxo). Leave it out when the field has no rule."},"initiallyHidden":{"type":"boolean","enum":[true],"description":"`true` when the PDF hides the field when it opens and the field has no show or hide rule of its own. Read from the document: send back what Moxo returned, or leave it out."}},"required":["fieldId","pdfFieldName","label"]},"maxItems":500,"description":"A PDF form step: its fillable fields, up to 500, such as the ones found in a new document you sent in `documentRef`, or fields you placed on a PDF that has none. They replace the step's fields for this run, so send them all. Leave it out to keep the step's own."},"autoDetectSignerRoleId":{"type":"string","description":"Accepted and not kept: each signing field's own `roleId` says who signs it."},"defaultFontSize":{"type":"number","minimum":8,"maximum":36,"description":"An e-sign or PDF form step: the text size, in points, 8 to 36, for every field that sets no `fontSize` of its own."},"designatedSignerPhone":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$","description":"An e-sign step that checks signers by text message: the mobile number to send the code to, for a signer with no number on file, in international format such as `+15551234567`. It is saved to the signer's profile."},"additionalSignerRoleIds":{"type":"array","items":{"type":"string","minLength":1},"maxItems":20,"description":"An e-sign step: up to 20 roles to add as signers (`roleId` from `signers.canAdd` in Get step settings), each a role of this flow held by one person. Place their fields in `fields`, with their `roleId`."},"removedSignerRoleIds":{"type":"array","items":{"type":"string","minLength":1},"maxItems":40,"description":"An e-sign step: the optional signers to take off this agreement, by `roleId`, up to 40. Their fields leave the document. A signer the template requires can't be taken off."},"signerOrder":{"type":"array","items":{"type":"string","minLength":1},"maxItems":40,"description":"An e-sign step whose signers take turns, with `additionalSignerRoleIds`: every signer's `roleId`, the added ones included, each once, in the order they sign. Leave it out for the template's order, then the added signers in the order you sent them."},"documents":{"type":"array","items":{"type":"object","properties":{"documentKey":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,39}$","description":"The document's key in the step's settings."},"ref":{"type":"string","format":"uuid","description":"The `fileId` of a file you uploaded to this step (`POST /v1/flows/{flowId}/steps/{stepId}/files`)."}},"required":["documentKey","ref"],"additionalProperties":false},"maxItems":10,"description":"A document collaboration step: the file for each of its documents, at most one per document and 10 in all. Each becomes the document's first version. A document left out keeps the step's own file."},"slotValues":{"type":"object","additionalProperties":{"type":"object","additionalProperties":{"type":"string","maxLength":4000}},"description":"A document collaboration step whose documents are Word templates: the values for their placeholders, by the document's key, then the placeholder's name. The first version is filled in with them. A placeholder filled from the flow's data keeps that value, and an empty value leaves the placeholder as it is."},"checklist":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"itemId":{"type":"string","minLength":1,"maxLength":200,"description":"The item's id, for an item the step already has. Leave it out on a new item: it gets an id of its own."},"label":{"type":"string","minLength":1,"maxLength":500,"description":"The item as people see it, up to 500 characters."},"description":{"type":"string","maxLength":2000,"description":"More detail on the item, up to 2,000 characters. Optional."},"unchanged":{"type":"boolean","enum":[true],"description":"`true` on an item you kept as it is: it keeps the step's own wording. Leave it out on an item you changed or added."}},"required":["label"],"additionalProperties":false},"minItems":1,"maxItems":500,"description":"The items, 1 to 500, in the order people see them."}},"required":["items"],"additionalProperties":false,"description":"A checklist step: its items for this run. They replace the step's list, so send every item you keep. What counts as done stays as the step has it."},"decision":{"type":"object","properties":{"outcomes":{"type":"array","items":{"type":"object","properties":{"outcomeId":{"type":"string","minLength":1,"maxLength":200,"description":"The option's id on the step. An id the step doesn't have returns `422 PREPARE_EDIT_LOCKED`."},"label":{"type":"string","minLength":1,"maxLength":200,"description":"The option's label, as the person deciding sees it, up to 200 characters."},"unchanged":{"type":"boolean","enum":[true],"description":"`true` on an option you didn't rename: it keeps the step's own label."}},"required":["outcomeId","label"],"additionalProperties":false},"minItems":1,"maxItems":10,"description":"The options to relabel, 1 to 10. An option you leave out keeps its label."}},"required":["outcomes"],"additionalProperties":false,"description":"A decision step: new labels for its options in this run. The options, and where each one leads, stay as the step has them."},"removedReferenceIds":{"type":"array","items":{"type":"string","minLength":1,"maxLength":200},"maxItems":200,"description":"Reference materials to take off the step for this run, by their `id` in the step's list of attachments, up to 200. The rest stay. An id the step doesn't list is ignored. Files you add go in `attachments`."},"fileRequest":{"type":"object","properties":{"instructions":{"type":"string","maxLength":10000,"description":"What to upload, as the assignee sees it, up to 10,000 characters."},"allowedTypes":{"type":["array","null"],"items":{"type":"string","minLength":1,"maxLength":100},"minItems":1,"maxItems":50,"description":"The file types accepted, 1 to 50, such as `pdf` or `jpg`. `null` accepts any type."},"maxFiles":{"type":["integer","null"],"minimum":1,"maximum":50,"description":"The most files the assignee can upload, 1 to 50. `null` lifts the step's own limit."}},"additionalProperties":false,"description":"A file request step: its upload rules and instructions for this run. A setting you leave out stays as the step has it."},"webApp":{"type":"object","properties":{"url":{"type":"string","minLength":1,"maxLength":4000,"description":"The web app's full address, starting with `https://` or `http://`, used as written."},"parameters":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":200,"description":"The parameter's name, up to 200 characters."},"value":{"type":"string","maxLength":4000,"description":"The parameter's value, up to 4,000 characters, used as written."}},"required":["key","value"],"additionalProperties":false},"maxItems":100,"description":"Query parameters added to the address, up to 100. Leave it out for none."}},"required":["url"],"additionalProperties":false,"description":"A web app step that opens an address: the address and its parameters for this run. How the step completes stays as the step has it. A web app that runs an uploaded page has no address to change: `422 PREPARE_EDIT_LOCKED`."},"form":{"type":"object","properties":{"fields":{"type":"array","items":{"type":"object","properties":{"fieldId":{"type":"string","minLength":1,"maxLength":200,"description":"The id of a field the step has, to change it. Leave it out to add a field, with a `type`."},"tempId":{"type":"string","minLength":1,"maxLength":100,"description":"For a field you add: a name you choose, up to 100 characters, so `prefilledValues` can give it a starting value. It is not kept."},"label":{"type":"string","minLength":1,"maxLength":500,"description":"The field's label, as people see it, up to 500 characters."},"type":{"type":"string","enum":["TEXT_SINGLE_LINE","TEXT_MULTI_LINE","NUMBER","DATE","TIME","EMAIL","PHONE","URL","YES_NO","SINGLE_SELECT","MULTI_SELECT","DROPDOWN","FILE_UPLOAD"],"description":"The field type. Required on a field you add; on a field the step has, it changes the type. A field the rest of the flow uses can't change type: `422 PREPARE_EDIT_LOCKED`."},"required":{"type":"boolean","description":"Whether the field must be filled in. Read on a field you add or retype; a field you only relabel keeps its own."},"helpText":{"type":"string","maxLength":2000,"description":"Help text shown with the field, up to 2,000 characters."},"options":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string","minLength":1,"maxLength":500,"description":"The option as people see it, up to 500 characters."}},"required":["label"],"additionalProperties":false},"maxItems":100,"description":"For a choice field you add or retype: its options, up to 100. A field you only relabel keeps its own."}},"required":["label"],"additionalProperties":false},"maxItems":500,"description":"The fields you change or add, up to 500. A field you leave out stays as it is. Added fields go after the step's own."},"removedFieldIds":{"type":"array","items":{"type":"string","minLength":1,"maxLength":200},"maxItems":500,"description":"The ids of fields to take off, up to 500. A field the rest of the flow uses can't be taken off: `422 PREPARE_EDIT_LOCKED`."}},"required":["fields"],"additionalProperties":false,"description":"A form step: changes to its fields for this run. Change, add or take off at least one field."},"questionnaire":{"type":"object","properties":{"questions":{"type":"array","items":{"type":"object","properties":{"questionId":{"type":"string","minLength":1,"maxLength":200,"description":"The id of a question the step has, to change it. Leave it out to add a question, with an `answerType`."},"tempId":{"type":"string","minLength":1,"maxLength":100,"description":"For a question you add: a name you choose, up to 100 characters, so `prefilledValues` can give it a starting answer. It is not kept."},"question":{"type":"string","minLength":1,"maxLength":1000,"description":"The question as people see it, up to 1,000 characters."},"answerType":{"type":"string","enum":["SINGLE_SELECT","MULTI_SELECT","TEXT","YES_NO","DATE","TIME"],"description":"How the question is answered. Required on a question you add; on a question the step has, it changes the type. A question the rest of the flow uses can't change type: `422 PREPARE_EDIT_LOCKED`."},"required":{"type":"boolean","description":"Whether the question must be answered. Read on a question you add or retype; a question you only reword keeps its own."},"options":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string","minLength":1,"maxLength":500,"description":"What an answer stores when this choice is picked. Usually the same as `label`."},"label":{"type":"string","minLength":1,"maxLength":500,"description":"The choice as people see it."}},"required":["value","label"],"additionalProperties":false},"maxItems":100,"description":"For a choice question you add or retype: its choices, up to 100, each `{ value, label }` of up to 500 characters. A question you only reword keeps its own."}},"required":["question"],"additionalProperties":false},"maxItems":500,"description":"The questions you change or add, up to 500. A question you leave out stays as it is. Added questions go after the step's own."},"removedQuestionIds":{"type":"array","items":{"type":"string","minLength":1,"maxLength":200},"maxItems":500,"description":"The ids of questions to take off, up to 500. A question the rest of the flow uses can't be taken off: `422 PREPARE_EDIT_LOCKED`."}},"required":["questions"],"additionalProperties":false,"description":"A questionnaire step: changes to its questions for this run. Change, add or take off at least one question."},"packet":{"type":"object","properties":{"asks":{"type":"object","additionalProperties":{"type":"object","additionalProperties":{}},"description":"Each part's own setup, keyed by its step id, in the shape that part's type takes here."},"offAskIds":{"type":"array","items":{"type":"string","minLength":1,"maxLength":200},"maxItems":30,"description":"The step ids of parts turned off for this run. A part the rest of the flow uses can't be turned off: `422`."},"overrides":{"type":"object","additionalProperties":{"type":"object","properties":{"description":{"type":"string","maxLength":10000,"description":"What the part asks of the person in this run, up to 10,000 characters, in place of its own. Only on a part whose type lets a preparer change it."},"attachments":{"type":"array","items":{"type":"object","properties":{"fileName":{"type":"string","minLength":1,"maxLength":512,"description":"The file's name, as people see it, up to 512 characters."},"mediaType":{"type":"string","minLength":1,"maxLength":200,"description":"The file's media type, such as `application/pdf`."},"data":{"type":"string","minLength":1,"description":"The file's contents, base64-encoded, without a `data:` prefix. Up to 10 MB a file (before encoding); more returns `413 PAYLOAD_TOO_LARGE`."},"uploadedAt":{"type":"string","description":"When you added the file, as an ISO 8601 date and time. It is kept as sent."}},"required":["fileName","mediaType","data","uploadedAt"]},"maxItems":20,"description":"Files to add to the part, up to 20, sent in the body. Only on a part whose type takes reference files."}},"additionalProperties":false},"description":"What each part's own prepare changes beside its setup, keyed by its step id: its words and the files added to it."}},"additionalProperties":false,"description":"A packet step: the setup of each of its parts, and the parts turned off for this run."}},"additionalProperties":false,"description":"The step's own content for this run, such as the document to sign, a form's fields or a checklist's items. Send only the settings for the step's type: a newer setting meant for another type, such as `checklist` on a form step, returns `422 PREPARE_EDIT_LOCKED`."}},"description":"Your changes to the step for this run, made as its preparer: `title`, `description`, `attachments`, `dueDate`, `privateNote`, and `setup` (the step's own settings, such as an e-sign step's `documentRef`, signers and fields, or a form's fields). Leave out what you don't change."},"timeEntry":{"type":"object","additionalProperties":false,"properties":{"minutes":{"type":"integer","minimum":1,"maximum":1439,"description":"The time spent, in whole minutes, 1 to 1439."},"billable":{"type":"boolean","description":"Whether the time is billable."},"description":{"type":["string","null"],"maxLength":500,"description":"What the time was spent on, up to 500 characters. Leave it out, or send `null` or an empty string, for none."}},"required":["minutes","billable"],"description":"Time tracking only: the time spent, as `minutes` (1 to 1439), `billable` and an optional `description` (up to 500 characters). Saved with this request, and only if it succeeds. Ignored when the flow doesn't track time or the person acting isn't on your team. A value that isn't valid returns `400 TIME_ENTRY_INVALID` with its `field`, and nothing is completed."},"timePrompt":{"type":"boolean","description":"Time tracking only: `true` when your screen asked for time. When the template requires time and this is `true`, a request without `timeEntry` returns `400 TIME_ENTRY_REQUIRED`. Leave it out to finish without time; the person can log it later."}},"additionalProperties":false},"ReopenStepRequest":{"type":"object","properties":{"reason":{"type":"string","minLength":1,"description":"Why the step goes back. The people it goes back to and the audit trail show it."},"sendBackTo":{"type":"string","enum":["assignee","preparers"],"description":"Who the step goes back to, as the app's Reopen and Send back to preparers do. `assignee` (the default): a finished or reviewing step returns to its assignee. `preparers`: the step returns to its preparers, who prepare it again before its assignee sees it; it works on a finished step and on one still with its assignee, when the step has a person preparing it (`400 NO_PREPARERS` otherwise, `400 SEND_BACK_NOT_ALLOWED` for a step in review). A Packet goes back to its person only, with `packetAskIds` (`400 SEND_BACK_NOT_ALLOWED` for `preparers`)."},"closesAt":{"type":"string","format":"date-time","description":"For a Form or File request with Close at the due date on: when it closes now, a date and time still ahead (`400 CLOSE_IN_PAST` otherwise). It becomes the step's due date. Left out, the step keeps its own close while that is still ahead, else gets the one its template's due date gives from now; with neither (a fixed date already passed, or a date set by hand), the reopen returns `400 CLOSE_REQUIRED`. Ignored for other steps.","example":"2026-11-30T17:00:00Z"},"overrideReason":{"type":"string","enum":["knew_more","ai_misread","policy_differs","test_or_demo"],"description":"Why you are reopening a step an AI review had approved, the same one-tap pick the app's Reopen dialog offers. `knew_more`: you knew something the AI did not. `ai_misread`: the AI got the facts wrong. `policy_differs`: your policy says otherwise. `test_or_demo`: this was a test or a demo. Optional, and never required. Kept only when that person saw the AI review. An organization API key cannot give one, because no person overrode the AI. Recorded on the reopen and not shown on the flow."},"packetAskIds":{"type":"array","items":{"type":"string","minLength":1,"maxLength":200},"minItems":1,"maxItems":30,"description":"For a Packet: the parts to redo, by their step ids in the template (a packet's `asks`). Required to reopen a packet, and refused on any other step (`400 PACKET_ASKS_NOT_PICKED`). A packet goes back to its person only, never to its preparers. Each must have been done (`400 PACKET_ASK_NOT_REOPENABLE` names one that was not). A signature after the first part picked is reopened too, because it was made on what is being redone. The others stay as they were.","example":["ask-w9"]}},"required":["reason"],"additionalProperties":false},"SkipStepRequest":{"type":"object","properties":{"reason":{"type":"string","description":"Why the step is passed over. It is kept on the audit trail."}},"additionalProperties":false},"GroupCompletion":{"type":"object","properties":{"advanced":{"type":"boolean","description":"Whether enough people have completed the step for it to move on."},"completedCount":{"type":"integer","minimum":0},"totalCount":{"type":"integer","minimum":0}},"required":["advanced","completedCount","totalCount"]},"BulkStartFlowsRequest":{"type":"object","properties":{"bulkRoleId":{"type":"string","description":"The role each recipient holds, in their own flow."},"recipients":{"type":"array","items":{"type":"object","properties":{"uniqueId":{"type":"string","description":"The person's org-scoped unique ID (needs the Partner unique ID feature). Send exactly one of `uniqueId`, `userId` or `email`.","example":"cust_984431"},"userId":{"type":"string","description":"The id of an existing user."},"email":{"type":"string","format":"email","description":"The person's email: someone in your organization, or someone new, whom the flow adds as an external user."}},"additionalProperties":false},"minItems":1,"maxItems":100,"description":"One flow is started for each recipient, up to 100. Each entry takes `uniqueId` or `userId` (someone in your organization) or `email`. An email no one in your organization has adds that person as an external user, as a single start does: the request needs the right to add external users (`external_users:write` for an API key, else `403 INSUFFICIENT_SCOPE`), and a recipient on a role internal users fill fails that flow. For more recipients, use the CSV bulk start in the app."},"sharedRoleAssignments":{"type":"array","items":{"type":"object","properties":{"roleId":{"type":"string","description":"The role's id from the template."},"uniqueId":{"type":"string","description":"The person's org-scoped unique ID (needs the Partner unique ID feature). Send exactly one of `uniqueId`, `userId` or `email`.","example":"cust_984431"},"userId":{"type":"string","description":"The id of an existing user who holds this role in every flow."},"email":{"type":"string","format":"email","description":"The email of an existing user in your organization who holds this role in every flow."}},"required":["roleId"],"additionalProperties":false},"description":"Roles held by the same person on every flow. Each entry takes `roleId` and the person's `uniqueId`, `userId` or `email`. An email no one in your organization has is added as an external user by the first flow, as for a recipient."},"customFields":{"type":"array","items":{"$ref":"#/components/schemas/CustomFieldValueInput"},"description":"Field values for every flow, each by its `key`. Numbers and booleans can be sent as JSON values or as strings (a `NUMBER` field takes `1` or `\"1\"`)."},"namePattern":{"type":"string","description":"The name for each flow. Write `{Role: <role name> / Name}` for the name of whoever holds a role on that flow, so `{Role: Customer / Name}` with `bulkRoleId` set to the Customer role names each flow after its recipient. `Email` in place of `Name` gives their email.","example":"Onboarding: {Role: Customer / Name}"}},"required":["bulkRoleId","recipients"],"additionalProperties":false},"SuccessAck":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]}},"required":["success"],"additionalProperties":false,"description":"The response to a request that changes a state: `success: true` and nothing else."},"SuccessWithId":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false}},"required":["success","data"],"additionalProperties":false,"description":"The response to a request that creates something: only the new item's id."},"FlowChatMessage":{"type":"object","properties":{"id":{"type":"string","description":"The message's id.","example":"msg-7f3a"},"stepExecutionId":{"type":["string","null"],"description":"The step run this message is attached to, or `null` for a message on the whole flow.","example":"step-exec-12"},"parentMessageId":{"type":["string","null"],"description":"Set when this message is a reply; the root carries `replies`.","example":null},"authorType":{"type":"string","enum":["internal","external","agent","system"],"description":"`internal`: a member of the organization that owns the flow; `external`: someone outside it; `agent`: an AI agent; `system`: a message Moxo generated.","example":"external"},"authorName":{"type":"string","description":"The author's name.","example":"Martin O"},"authorUserId":{"type":["string","null"],"description":"The author's user id (`usr_…`), in the same form assignees and notification links use, so you can match them without a lookup. `null` for system messages, and when the author can't be matched to a user in the organization.","example":"usr_2f8a1c90d4b34e6f"},"you":{"type":"boolean","description":"`true` when you wrote this message, matched on who you are rather than on the name. Use it to align your own messages in a custom chat UI. Always `false` with an organization API key, and for agent and system authors.","example":false},"authorIsInternal":{"type":"boolean","description":"`true` when the author is an internal user of your organization.","example":false},"messageType":{"type":"string","enum":["user_message","ai_message"],"description":"Whether a person or an AI agent wrote the message.","example":"user_message"},"visibility":{"type":"string","enum":["all","internal_only"],"description":"`all`: shared with external participants. `internal_only`: a note for internal users, never shown to external participants, and returned only to callers allowed to see it.","example":"all"},"body":{"type":["string","null"],"description":"The message text. `null` when the message was deleted (see `deleted`).","example":"Thanks, I uploaded the signed form."},"bodyFormat":{"type":"string","enum":["text","html"],"description":"`text`: `body` is plain text. `html`: `body` is formatted text from Moxo's editor, as HTML.","example":"text"},"deleted":{"type":"boolean","description":"`true` when the author deleted the message.","example":false},"resolved":{"type":"boolean","description":"`true` when the message or its thread was marked resolved.","example":false},"attachments":{"type":"array","items":{"type":"object","properties":{"fileName":{"type":"string","example":"signed-form.pdf"},"mimeType":{"type":"string","example":"application/pdf"}},"required":["fileName","mimeType"]},"description":"Files attached to the message: name and type only, with no download link."},"createdAt":{"type":"string","description":"When the message was posted (ISO 8601).","example":"2026-06-25T17:00:00.000Z"},"editedAt":{"type":["string","null"],"description":"When the message was last edited (ISO 8601), or `null` if it never was.","example":null},"replies":{"type":"array","items":{"$ref":"#/components/schemas/FlowChatMessage"},"description":"Replies to this message. Present only on a message that starts a thread."}},"required":["id","stepExecutionId","parentMessageId","authorType","authorName","authorUserId","you","authorIsInternal","messageType","visibility","body","bodyFormat","deleted","resolved","attachments","createdAt","editedAt"],"additionalProperties":false,"description":"One message in a flow's chat. A message that starts a thread carries its `replies[]`, in the same shape."},"NewStep":{"description":"A new step: its `handle`, its `type`, and its settings in `config`. Pick the variant for the step's type; its `config` lists the settings that type is sent with.","oneOf":[{"$ref":"#/components/schemas/NewStep_FORM"},{"$ref":"#/components/schemas/NewStep_QUESTIONNAIRE"},{"$ref":"#/components/schemas/NewStep_POLL"},{"$ref":"#/components/schemas/NewStep_FILE_REQUEST"},{"$ref":"#/components/schemas/NewStep_TODO"},{"$ref":"#/components/schemas/NewStep_CHECKLIST"},{"$ref":"#/components/schemas/NewStep_APPROVAL"},{"$ref":"#/components/schemas/NewStep_ACKNOWLEDGEMENT"},{"$ref":"#/components/schemas/NewStep_WATCH_VIDEO"},{"$ref":"#/components/schemas/NewStep_PACKET"},{"$ref":"#/components/schemas/NewStep_DOCUMENT_REVIEW"},{"$ref":"#/components/schemas/NewStep_DOCUMENT_COLLABORATION"},{"$ref":"#/components/schemas/NewStep_PREPARE_DOCUMENT_BY_PERSON"},{"$ref":"#/components/schemas/NewStep_ESIGN"},{"$ref":"#/components/schemas/NewStep_DOCUSIGN"},{"$ref":"#/components/schemas/NewStep_ADOBE_SIGN"},{"$ref":"#/components/schemas/NewStep_JOTFORM"},{"$ref":"#/components/schemas/NewStep_IDENTITY_VERIFICATION"},{"$ref":"#/components/schemas/NewStep_COLLECT_PAYMENT"},{"$ref":"#/components/schemas/NewStep_DECISION"},{"$ref":"#/components/schemas/NewStep_CUSTOM_ACTION"},{"$ref":"#/components/schemas/NewStep_CONVERSATION"},{"$ref":"#/components/schemas/NewStep_WEB_APP"},{"$ref":"#/components/schemas/NewStep_PREPARE_DOCUMENT"},{"$ref":"#/components/schemas/NewStep_PDF_FORM"},{"$ref":"#/components/schemas/NewStep_TIME_BOOKING"},{"$ref":"#/components/schemas/NewStep_SINGLE_CHOICE_BRANCH"},{"$ref":"#/components/schemas/NewStep_MULTI_CHOICE_BRANCH"},{"$ref":"#/components/schemas/NewStep_PARALLEL_BRANCH"},{"$ref":"#/components/schemas/NewStep_JUMP"},{"$ref":"#/components/schemas/NewStep_TERMINATE"},{"$ref":"#/components/schemas/NewStep_WAIT"},{"$ref":"#/components/schemas/NewStep_FOR_EACH"},{"$ref":"#/components/schemas/NewStep_REPEAT_WHILE"},{"$ref":"#/components/schemas/NewStep_SUB_FLOW"},{"$ref":"#/components/schemas/NewStep_BUILDING_BLOCK"},{"$ref":"#/components/schemas/NewStep_AI_CUSTOM_PROMPT"},{"$ref":"#/components/schemas/NewStep_AI_EXTRACT"},{"$ref":"#/components/schemas/NewStep_AI_SUMMARIZE"},{"$ref":"#/components/schemas/NewStep_AI_TRANSCRIBE"},{"$ref":"#/components/schemas/NewStep_AI_TRANSLATE"},{"$ref":"#/components/schemas/NewStep_AI_WRITE"},{"$ref":"#/components/schemas/NewStep_AI_AGENT"},{"$ref":"#/components/schemas/NewStep_SYSTEM_WEBHOOK"},{"$ref":"#/components/schemas/NewStep_SYSTEM_EMAIL"},{"$ref":"#/components/schemas/NewStep_SEND_ANNOUNCEMENT"},{"$ref":"#/components/schemas/NewStep_SEND_TO_CONVERSATION"},{"$ref":"#/components/schemas/NewStep_SYSTEM_UPDATE_FIELDS"},{"$ref":"#/components/schemas/NewStep_DATA_TABLE_LOOKUP_RECORD"},{"$ref":"#/components/schemas/NewStep_DATA_TABLE_SAVE_RECORD"},{"$ref":"#/components/schemas/NewStep_UPDATE_SPREADSHEET"},{"$ref":"#/components/schemas/NewStep_SYSTEM_UPDATE_FLOW_INFO"},{"$ref":"#/components/schemas/NewStep_BUSINESS_RULE"},{"$ref":"#/components/schemas/NewStep_MATH"},{"$ref":"#/components/schemas/NewStep_CODE"},{"$ref":"#/components/schemas/NewStep_FORMAT"},{"$ref":"#/components/schemas/NewStep_REST_API"},{"$ref":"#/components/schemas/NewStep_MCP_SERVER"},{"$ref":"#/components/schemas/NewStep_EXTERNAL_APP"},{"$ref":"#/components/schemas/NewStep_ASSIGN_ROLE"},{"$ref":"#/components/schemas/NewStep_ADD_ROLE"},{"$ref":"#/components/schemas/NewStep_UPDATE_USER"},{"$ref":"#/components/schemas/NewStep_START_FLOW"},{"$ref":"#/components/schemas/NewStep_SCHEDULE_FLOW"}],"discriminator":{"propertyName":"type","mapping":{"FORM":"#/components/schemas/NewStep_FORM","QUESTIONNAIRE":"#/components/schemas/NewStep_QUESTIONNAIRE","POLL":"#/components/schemas/NewStep_POLL","FILE_REQUEST":"#/components/schemas/NewStep_FILE_REQUEST","TODO":"#/components/schemas/NewStep_TODO","CHECKLIST":"#/components/schemas/NewStep_CHECKLIST","APPROVAL":"#/components/schemas/NewStep_APPROVAL","ACKNOWLEDGEMENT":"#/components/schemas/NewStep_ACKNOWLEDGEMENT","WATCH_VIDEO":"#/components/schemas/NewStep_WATCH_VIDEO","PACKET":"#/components/schemas/NewStep_PACKET","DOCUMENT_REVIEW":"#/components/schemas/NewStep_DOCUMENT_REVIEW","DOCUMENT_COLLABORATION":"#/components/schemas/NewStep_DOCUMENT_COLLABORATION","PREPARE_DOCUMENT_BY_PERSON":"#/components/schemas/NewStep_PREPARE_DOCUMENT_BY_PERSON","ESIGN":"#/components/schemas/NewStep_ESIGN","DOCUSIGN":"#/components/schemas/NewStep_DOCUSIGN","ADOBE_SIGN":"#/components/schemas/NewStep_ADOBE_SIGN","JOTFORM":"#/components/schemas/NewStep_JOTFORM","IDENTITY_VERIFICATION":"#/components/schemas/NewStep_IDENTITY_VERIFICATION","COLLECT_PAYMENT":"#/components/schemas/NewStep_COLLECT_PAYMENT","DECISION":"#/components/schemas/NewStep_DECISION","CUSTOM_ACTION":"#/components/schemas/NewStep_CUSTOM_ACTION","CONVERSATION":"#/components/schemas/NewStep_CONVERSATION","WEB_APP":"#/components/schemas/NewStep_WEB_APP","PREPARE_DOCUMENT":"#/components/schemas/NewStep_PREPARE_DOCUMENT","PDF_FORM":"#/components/schemas/NewStep_PDF_FORM","TIME_BOOKING":"#/components/schemas/NewStep_TIME_BOOKING","SINGLE_CHOICE_BRANCH":"#/components/schemas/NewStep_SINGLE_CHOICE_BRANCH","MULTI_CHOICE_BRANCH":"#/components/schemas/NewStep_MULTI_CHOICE_BRANCH","PARALLEL_BRANCH":"#/components/schemas/NewStep_PARALLEL_BRANCH","JUMP":"#/components/schemas/NewStep_JUMP","TERMINATE":"#/components/schemas/NewStep_TERMINATE","WAIT":"#/components/schemas/NewStep_WAIT","FOR_EACH":"#/components/schemas/NewStep_FOR_EACH","REPEAT_WHILE":"#/components/schemas/NewStep_REPEAT_WHILE","SUB_FLOW":"#/components/schemas/NewStep_SUB_FLOW","BUILDING_BLOCK":"#/components/schemas/NewStep_BUILDING_BLOCK","AI_CUSTOM_PROMPT":"#/components/schemas/NewStep_AI_CUSTOM_PROMPT","AI_EXTRACT":"#/components/schemas/NewStep_AI_EXTRACT","AI_SUMMARIZE":"#/components/schemas/NewStep_AI_SUMMARIZE","AI_TRANSCRIBE":"#/components/schemas/NewStep_AI_TRANSCRIBE","AI_TRANSLATE":"#/components/schemas/NewStep_AI_TRANSLATE","AI_WRITE":"#/components/schemas/NewStep_AI_WRITE","AI_AGENT":"#/components/schemas/NewStep_AI_AGENT","SYSTEM_WEBHOOK":"#/components/schemas/NewStep_SYSTEM_WEBHOOK","SYSTEM_EMAIL":"#/components/schemas/NewStep_SYSTEM_EMAIL","SEND_ANNOUNCEMENT":"#/components/schemas/NewStep_SEND_ANNOUNCEMENT","SEND_TO_CONVERSATION":"#/components/schemas/NewStep_SEND_TO_CONVERSATION","SYSTEM_UPDATE_FIELDS":"#/components/schemas/NewStep_SYSTEM_UPDATE_FIELDS","DATA_TABLE_LOOKUP_RECORD":"#/components/schemas/NewStep_DATA_TABLE_LOOKUP_RECORD","DATA_TABLE_SAVE_RECORD":"#/components/schemas/NewStep_DATA_TABLE_SAVE_RECORD","UPDATE_SPREADSHEET":"#/components/schemas/NewStep_UPDATE_SPREADSHEET","SYSTEM_UPDATE_FLOW_INFO":"#/components/schemas/NewStep_SYSTEM_UPDATE_FLOW_INFO","BUSINESS_RULE":"#/components/schemas/NewStep_BUSINESS_RULE","MATH":"#/components/schemas/NewStep_MATH","CODE":"#/components/schemas/NewStep_CODE","FORMAT":"#/components/schemas/NewStep_FORMAT","REST_API":"#/components/schemas/NewStep_REST_API","MCP_SERVER":"#/components/schemas/NewStep_MCP_SERVER","EXTERNAL_APP":"#/components/schemas/NewStep_EXTERNAL_APP","ASSIGN_ROLE":"#/components/schemas/NewStep_ASSIGN_ROLE","ADD_ROLE":"#/components/schemas/NewStep_ADD_ROLE","UPDATE_USER":"#/components/schemas/NewStep_UPDATE_USER","START_FLOW":"#/components/schemas/NewStep_START_FLOW","SCHEDULE_FLOW":"#/components/schemas/NewStep_SCHEDULE_FLOW"}}},"StepSettings":{"type":"object","properties":{"name":{"type":"string","description":"The step's name."},"description":{"type":"string","description":"What the step is for, in a sentence. Every new step needs one: the assignee reads it."},"nameTemplate":{"type":"string","description":"A name with values from earlier in the flow, shown instead of `name` once those values are known. Write the values as references, as in any other text. `name` stays the plain name other steps refer to."},"assignees":{"anyOf":[{"type":"string"},{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"object","properties":{"roleId":{"type":"string","description":"The role's id."}},"required":["roleId"],"additionalProperties":{},"description":"A role, as returned in a step."}]}}],"description":"The roles that do the step: role names (or the handle of a role added in this list). A role id, or `{ roleId }` as returned in a step, is also accepted. Refused on a control or automation step: `AI_AGENT`, `AI_CUSTOM_PROMPT`, `AI_EXTRACT`, `AI_SUMMARIZE`, `AI_TRANSCRIBE`, `AI_TRANSLATE`, `AI_WRITE`, `BUILDING_BLOCK`, `BUSINESS_RULE`, `EXTERNAL_APP`, `FOR_EACH`, `JUMP`, `MATH`, `MCP_SERVER`, `MULTI_CHOICE_BRANCH`, `PARALLEL_BRANCH`, `REPEAT_WHILE`, `REST_API`, `SINGLE_CHOICE_BRANCH`, `SUB_FLOW`, `SYSTEM_EMAIL`, `SYSTEM_UPDATE_FIELDS`, `SYSTEM_UPDATE_FLOW_INFO`, `SYSTEM_WEBHOOK`, `TERMINATE`, `WAIT`."},"stepDue":{"type":"object","properties":{"type":{"type":"string","enum":["RELATIVE","FIXED","BEFORE_FLOW_DUE","DDR","DATA_TABLE_DATE"],"description":"`RELATIVE`: a time after the step starts. `FIXED`: a date. `BEFORE_FLOW_DUE`: a time before the flow is due. `DDR`: a date from a field. `DATA_TABLE_DATE`: a date from a data table row (plans with Data Tables). It is write-only: a template read leaves it out, because it holds the table's own ids, so a step that has one reads with no `stepDue`."},"value":{"type":"number","description":"For `RELATIVE` and `BEFORE_FLOW_DUE`: how many units, a whole number."},"unit":{"type":"string","enum":["MINUTES","HOURS","DAYS","WEEKS"],"description":"For `RELATIVE` and `BEFORE_FLOW_DUE`: the unit."},"dayType":{"type":"string","enum":["calendar","business"],"description":"For `RELATIVE` and `BEFORE_FLOW_DUE`: count `calendar` days (the default) or `business` days, Monday to Friday, as \"Exclude weekends\" does in the builder."},"date":{"type":"string","description":"For `FIXED`: the date, as an ISO date, today or later. A date that has passed is refused with `DUE_DATE_IN_PAST`."},"token":{"anyOf":[{"type":"string"},{"type":"object","properties":{"kind":{"type":"string","description":"What it reads."}},"required":["kind"],"additionalProperties":{},"description":"A structured reference."}],"description":"For `DDR`: the date field, e.g. `{Intake / Start date}`."},"offset":{"type":"object","properties":{"value":{"type":"number","description":"How many units."},"unit":{"type":"string","enum":["MINUTES","HOURS","DAYS","WEEKS"],"description":"The unit."},"direction":{"type":"string","enum":["before","after"],"description":"Before or after the date."},"dayType":{"type":"string","enum":["calendar","business"],"description":"Count `calendar` days (the default) or `business` days, Monday to Friday."}},"required":["value","unit","direction"],"additionalProperties":{},"description":"For `DDR` and `DATA_TABLE_DATE`: a time before or after that date."},"tableId":{"type":"string","description":"For `DATA_TABLE_DATE`: the data table, by its id."},"rowMatch":{"type":"object","properties":{"match":{"type":"string","enum":["ALL","ANY"],"description":"`ALL`: every rule matches. `ANY`: one does."},"conditions":{"type":"array","items":{"type":"object","properties":{"fieldId":{"type":"string","description":"The column, by its id."},"op":{"type":"string","description":"How it compares, such as `eq`, `neq`, `contains` or `gt`."},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}],"description":"What it compares with: fixed text, a number, `true` or `false`, a list for `in` and `notIn`, or a reference to a flow value."}},"required":["fieldId","op"],"additionalProperties":{},"description":"One rule."},"description":"The rules."}},"additionalProperties":{},"description":"For `DATA_TABLE_DATE`: the rules that find the row."},"fieldId":{"type":"string","description":"For `DATA_TABLE_DATE`: the date column, by its id."}},"required":["type"],"additionalProperties":{},"description":"When the step is due. Needed by monitors that run after it is overdue."},"monitors":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The monitor's id, to change or keep one. Leave out on a new one; Moxo makes it."},"trigger":{"type":"object","properties":{"kind":{"type":"string","enum":["timer.since_assigned","timer.since_overdue","event"],"description":"`timer.since_assigned`: a time after the step starts. `timer.since_overdue`: a time after it is overdue (needs `stepDue`). `event`: when something happens on the step."},"duration":{"type":"object","properties":{"value":{"type":"integer","minimum":0,"description":"How many units. 0 (at the due time) only with `escalate`."},"unit":{"type":"string","enum":["MINUTES","HOURS","DAYS","WEEKS"],"description":"The unit."}},"required":["value","unit"],"additionalProperties":{},"description":"For a timer: how long to wait."},"on":{"type":"string","enum":["step_started","step_completed","submitted_for_review","review_changes_requested","approved","rejected","file_uploaded","all_files_received"],"description":"For `event`: what happens, e.g. `step_completed`, `approved`, `rejected`."}},"required":["kind"],"additionalProperties":{},"description":"When it fires."},"action":{"type":"object","properties":{"kind":{"type":"string","enum":["fire_webhook","send_email","cancel_flow","jump_to_step","update_fields","escalate"],"description":"What it does: send a webhook, send an email, cancel the flow, send the flow back to an earlier step, set flow fields, or bring more people onto the late step."},"url":{"type":"string","description":"For `fire_webhook`: the address to send it to."},"to":{"type":"array","items":{"type":"string"},"description":"For `send_email`: who receives it. Each entry is an address, or a role email such as `{Role: Clerk / Email}`. A role reaches every person holding it. Required for `send_email`."},"subject":{"type":"string","description":"For `send_email`: the subject. It can include flow details the same way a Send email step subject does. Required for `send_email`."},"body":{"type":"string","description":"For `send_email`: the message. It can include flow details the same way a Send email step body does. Required for `send_email`."},"context":{"type":"object","additionalProperties":{"type":"string"},"description":"For `fire_webhook`: extra keys and values to send."},"dataFromStepId":{"type":"string","description":"For `fire_webhook`: a step whose answers to send with it."},"targetStepId":{"type":"string","description":"For `jump_to_step`: the earlier step to go back to."},"preserveData":{"type":"boolean","description":"For `jump_to_step`: keep that step's answers as a draft."},"updates":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"description":"For `update_fields`: flow field key to value. For a choice field, the option's label."},"target":{"type":"object","properties":{"kind":{"type":"string","enum":["role","manager"],"description":"`role`: everyone in a role joins the step. `manager`: the assignee's manager."},"roleName":{"type":"string","description":"For `role`: the role's name."},"roleId":{"type":"string","description":"For `role`: the role's id, instead of its name."},"roleHandle":{"type":"string","description":"For `role`: the handle of a role added in this list."},"levels":{"type":"integer","minimum":1,"maximum":2,"description":"For `manager`: 1 is their manager, 2 their manager's manager."},"fallbackEmail":{"type":"string","description":"For `manager`: who joins when the assignee has no manager."}},"required":["kind"],"additionalProperties":{},"description":"For `escalate`: who to bring in."}},"required":["kind"],"additionalProperties":{},"description":"What it does."}},"required":["trigger","action"],"additionalProperties":{},"description":"One monitor: when it fires and what it does."},"description":"What happens automatically when the step is late or something happens on it. The list you send replaces the step's monitors: send the ones to keep (with their `id`), leave out the ones to remove."},"customReminders":{"type":["object","null"],"properties":{"dueDateApproaching":{"type":"boolean","description":"Remind the assignees before the due date."},"dueDateApproachingDays":{"type":"array","items":{"type":"integer","minimum":1,"maximum":365},"minItems":1,"maxItems":5,"description":"How many days before the due date each reminder goes, for example `[90, 60, 30]`."},"actionDue":{"type":"boolean","description":"Remind the assignees on the due date."},"actionOverdue":{"type":"boolean","description":"Send a notice after the due date has passed."},"actionOverdueRepeatDays":{"type":"integer","minimum":1,"maximum":365,"description":"Days between notices after the due date."},"actionOverdueMaxTimes":{"type":"integer","minimum":1,"maximum":10,"description":"The most notices sent after the due date."},"noDueDateFollowUpDays":{"type":"integer","minimum":1,"maximum":30,"description":"An action sent on its own (`POST /v1/actions`) with no due date: days between follow-ups. A flow step refuses it."},"noDueDateFollowUpMax":{"type":"integer","minimum":0,"maximum":10,"description":"An action sent on its own with no due date: how many follow-ups to send; `0` never follows up. A flow step refuses it."},"emails":{"type":"object","properties":{"dueSoon":{"type":"object","properties":{"subject":{"type":"string","maxLength":300,"description":"The email's subject line. May hold the email's variables such as `{{firstName}}`, `{{dueDate}}` and `{{daysUntilDue}}`; `{{dueRow:<column id>}}` for a column of the data table row the step's due date is read from (a due date from a data table); and data references in `{…}`."},"heading":{"type":"string","maxLength":300,"description":"The heading at the top of the email. May hold the email's variables such as `{{firstName}}`, `{{dueDate}}` and `{{daysUntilDue}}`; `{{dueRow:<column id>}}` for a column of the data table row the step's due date is read from (a due date from a data table); and data references in `{…}`."},"body":{"type":"string","maxLength":5000,"description":"The email's message. A blank line starts a new paragraph. May hold the email's variables such as `{{firstName}}`, `{{dueDate}}` and `{{daysUntilDue}}`; `{{dueRow:<column id>}}` for a column of the data table row the step's due date is read from (a due date from a data table); and data references in `{…}`."},"buttonLabel":{"type":"string","maxLength":80,"description":"The words on the button that opens the action."}},"additionalProperties":false,"description":"The reminder sent while the due date is still ahead. A field left out uses the organization's wording."},"overdue":{"type":"object","properties":{"subject":{"type":"string","maxLength":300,"description":"The email's subject line. May hold the email's variables such as `{{firstName}}`, `{{dueDate}}` and `{{daysUntilDue}}`; `{{dueRow:<column id>}}` for a column of the data table row the step's due date is read from (a due date from a data table); and data references in `{…}`."},"heading":{"type":"string","maxLength":300,"description":"The heading at the top of the email. May hold the email's variables such as `{{firstName}}`, `{{dueDate}}` and `{{daysUntilDue}}`; `{{dueRow:<column id>}}` for a column of the data table row the step's due date is read from (a due date from a data table); and data references in `{…}`."},"body":{"type":"string","maxLength":5000,"description":"The email's message. A blank line starts a new paragraph. May hold the email's variables such as `{{firstName}}`, `{{dueDate}}` and `{{daysUntilDue}}`; `{{dueRow:<column id>}}` for a column of the data table row the step's due date is read from (a due date from a data table); and data references in `{…}`."},"buttonLabel":{"type":"string","maxLength":80,"description":"The words on the button that opens the action."}},"additionalProperties":false,"description":"The notice sent after the due date has passed. A field left out uses the organization's wording."},"nudge":{"type":"object","properties":{"subject":{"type":"string","maxLength":300,"description":"The email's subject line. May hold the email's variables such as `{{firstName}}`, `{{dueDate}}` and `{{daysUntilDue}}`; `{{dueRow:<column id>}}` for a column of the data table row the step's due date is read from (a due date from a data table); and data references in `{…}`."},"heading":{"type":"string","maxLength":300,"description":"The heading at the top of the email. May hold the email's variables such as `{{firstName}}`, `{{dueDate}}` and `{{daysUntilDue}}`; `{{dueRow:<column id>}}` for a column of the data table row the step's due date is read from (a due date from a data table); and data references in `{…}`."},"body":{"type":"string","maxLength":5000,"description":"The email's message. A blank line starts a new paragraph. May hold the email's variables such as `{{firstName}}`, `{{dueDate}}` and `{{daysUntilDue}}`; `{{dueRow:<column id>}}` for a column of the data table row the step's due date is read from (a due date from a data table); and data references in `{…}`."},"buttonLabel":{"type":"string","maxLength":80,"description":"The words on the button that opens the action."}},"additionalProperties":false,"description":"The reminder sent for an action with no due date. A field left out uses the organization's wording."}},"additionalProperties":false,"description":"This action's own wording for its reminder emails."}},"additionalProperties":false,"description":"This step's own reminders, when the organization has Custom step reminders. Leave out or send `null` for the default reminders. Schedule fields left out come from the role, then the template. `emails.dueSoon`, `emails.overdue` and `emails.nudge` word the reminder emails: a field left out uses the organization's wording."},"visibility":{"type":"object","properties":{"mode":{"type":"string","enum":["ASSIGNEE_ONLY","ALL","SPECIFIC_ROLES"],"description":"`ASSIGNEE_ONLY` (the default): only the people on the step. `ALL`: everyone on the flow. `SPECIFIC_ROLES`: these roles too."},"roles":{"type":"array","items":{"type":"string"},"description":"For `SPECIFIC_ROLES`: the roles, by name or id."}},"additionalProperties":{},"description":"Who sees the step."},"completion":{"type":["object","null"],"properties":{"mode":{"type":"string","enum":["ONE","MAJORITY","ALL"],"description":"`ONE`: any one person on any role. `MAJORITY`: more than half of everyone assigned across roles. `ALL`: everyone on every role."}},"additionalProperties":{},"description":"For a step with two or more roles: an override of the roles' own completion settings. Send `null` to remove it: every role then completes the step at once, each by its own setting. A step with one role follows its role's setting and keeps no override."},"assigneeOrder":{"type":"string","enum":["SEQUENTIAL","PARALLEL"],"description":"Several assignees act one after another or at the same time."},"skipSequentialOrder":{"type":"boolean","description":"Start at the same time as the step before it."},"dependsOnStepIds":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"object","properties":{"stepId":{"type":"string","description":"The step's id."}},"required":["stepId"],"additionalProperties":{}}]},"description":"Start as soon as these earlier steps are done, instead of waiting for everything before it. Step ids, or `{ stepId }` as returned in a step."},"paths":{"type":"array","items":{"type":"object","properties":{"handle":{"type":"string","description":"A name you choose, unique in this list, so later changes in the same list can use it where an id goes. The response maps it to its new id in `ids`."},"label":{"type":"string","description":"The path's name."},"condition":{"type":"object","properties":{"type":{"type":"string","enum":["EQUALS","NOT_EQUALS","CONTAINS","NOT_CONTAINS","ARRAY_CONTAINS","GREATER_THAN","LESS_THAN","GREATER_THAN_OR_EQUAL","LESS_THAN_OR_EQUAL","STARTS_WITH","ENDS_WITH","IS_EMPTY","NOT_EMPTY","IN","NOT_IN","ELSE"],"description":"How to compare. `ELSE` takes no operands; `IS_EMPTY` and `NOT_EMPTY` take only `left`."},"left":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"object","properties":{"kind":{"type":"string","description":"What it reads: `step`, `input`, `role` or `organization`."}},"required":["kind"],"additionalProperties":{},"description":"A structured reference to the value."}],"description":"What to check: a reference such as `{Intake / Entity type}`, or a value."},"right":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"object","properties":{"kind":{"type":"string","description":"What it reads: `step`, `input`, `role` or `organization`."}},"required":["kind"],"additionalProperties":{},"description":"A structured reference to the value."}],"description":"What to compare it with. Match a choice by its label."}},"required":["type"],"additionalProperties":{},"description":"When the flow takes this path."},"conditions":{"type":"array","items":{"$ref":"#/components/schemas/PathCondition"},"description":"Several rules, combined by `conditionLogic`."},"conditionLogic":{"type":"string","enum":["ALL","ANY"],"description":"`ALL` or `ANY`."}},"required":["handle","label"],"additionalProperties":{},"description":"A path of a new branch."},"description":"For a new branch: its paths. Add the steps in each with add_step and `pathId`. To change an existing branch's paths, use update_paths."},"outcomes":{"type":"array","items":{"type":"object","properties":{"handle":{"type":"string","description":"A name you choose, unique in this list, so later changes in the same list can use it where an id goes. The response maps it to its new id in `ids`."},"label":{"type":"string","description":"The outcome as the person deciding sees it."}},"required":["handle","label"],"additionalProperties":{},"description":"An outcome of a new Decision."},"description":"For a new Decision: its outcomes. Add their steps with add_step and `outcomeId`. To change them later, use update_paths."}},"required":["name","description"],"additionalProperties":{},"description":"The step's settings: the shared ones below, and the settings of its type (its `StepSettings_<TYPE>` schema, such as `StepSettings_FORM`). Each `NewStep` variant names the one for its type and has an example."},"PathCondition":{"type":"object","properties":{"type":{"type":"string","enum":["EQUALS","NOT_EQUALS","CONTAINS","NOT_CONTAINS","ARRAY_CONTAINS","GREATER_THAN","LESS_THAN","GREATER_THAN_OR_EQUAL","LESS_THAN_OR_EQUAL","STARTS_WITH","ENDS_WITH","IS_EMPTY","NOT_EMPTY","IN","NOT_IN","ELSE"],"description":"How to compare. `ELSE` takes no operands; `IS_EMPTY` and `NOT_EMPTY` take only `left`."},"left":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"object","properties":{"kind":{"type":"string","description":"What it reads: `step`, `input`, `role` or `organization`."}},"required":["kind"],"additionalProperties":{},"description":"A structured reference to the value."}],"description":"What to check: a reference such as `{Intake / Entity type}`, or a value."},"right":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"object","properties":{"kind":{"type":"string","description":"What it reads: `step`, `input`, `role` or `organization`."}},"required":["kind"],"additionalProperties":{},"description":"A structured reference to the value."}],"description":"What to compare it with. Match a choice by its label."}},"required":["type"],"additionalProperties":{},"description":"A rule the flow takes a path by."},"StepSettingsChange":{"type":"object","properties":{"name":{"type":"string","description":"The step's name."},"description":{"type":"string","description":"What the step is for."},"nameTemplate":{"type":"string","description":"A name with values from earlier in the flow, shown instead of `name` once those values are known. Write the values as references, as in any other text. `name` stays the plain name other steps refer to."},"assignees":{"anyOf":[{"type":"string"},{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"object","properties":{"roleId":{"type":"string","description":"The role's id."}},"required":["roleId"],"additionalProperties":{},"description":"A role, as returned in a step."}]}}],"description":"The roles that do the step: role names (or the handle of a role added in this list). A role id, or `{ roleId }` as returned in a step, is also accepted. Refused on a control or automation step: `AI_AGENT`, `AI_CUSTOM_PROMPT`, `AI_EXTRACT`, `AI_SUMMARIZE`, `AI_TRANSCRIBE`, `AI_TRANSLATE`, `AI_WRITE`, `BUILDING_BLOCK`, `BUSINESS_RULE`, `EXTERNAL_APP`, `FOR_EACH`, `JUMP`, `MATH`, `MCP_SERVER`, `MULTI_CHOICE_BRANCH`, `PARALLEL_BRANCH`, `REPEAT_WHILE`, `REST_API`, `SINGLE_CHOICE_BRANCH`, `SUB_FLOW`, `SYSTEM_EMAIL`, `SYSTEM_UPDATE_FIELDS`, `SYSTEM_UPDATE_FLOW_INFO`, `SYSTEM_WEBHOOK`, `TERMINATE`, `WAIT`."},"stepDue":{"type":"object","properties":{"type":{"type":"string","enum":["RELATIVE","FIXED","BEFORE_FLOW_DUE","DDR","DATA_TABLE_DATE"],"description":"`RELATIVE`: a time after the step starts. `FIXED`: a date. `BEFORE_FLOW_DUE`: a time before the flow is due. `DDR`: a date from a field. `DATA_TABLE_DATE`: a date from a data table row (plans with Data Tables). It is write-only: a template read leaves it out, because it holds the table's own ids, so a step that has one reads with no `stepDue`."},"value":{"type":"number","description":"For `RELATIVE` and `BEFORE_FLOW_DUE`: how many units, a whole number."},"unit":{"type":"string","enum":["MINUTES","HOURS","DAYS","WEEKS"],"description":"For `RELATIVE` and `BEFORE_FLOW_DUE`: the unit."},"dayType":{"type":"string","enum":["calendar","business"],"description":"For `RELATIVE` and `BEFORE_FLOW_DUE`: count `calendar` days (the default) or `business` days, Monday to Friday, as \"Exclude weekends\" does in the builder."},"date":{"type":"string","description":"For `FIXED`: the date, as an ISO date, today or later. A date that has passed is refused with `DUE_DATE_IN_PAST`."},"token":{"anyOf":[{"type":"string"},{"type":"object","properties":{"kind":{"type":"string","description":"What it reads."}},"required":["kind"],"additionalProperties":{},"description":"A structured reference."}],"description":"For `DDR`: the date field, e.g. `{Intake / Start date}`."},"offset":{"type":"object","properties":{"value":{"type":"number","description":"How many units."},"unit":{"type":"string","enum":["MINUTES","HOURS","DAYS","WEEKS"],"description":"The unit."},"direction":{"type":"string","enum":["before","after"],"description":"Before or after the date."},"dayType":{"type":"string","enum":["calendar","business"],"description":"Count `calendar` days (the default) or `business` days, Monday to Friday."}},"required":["value","unit","direction"],"additionalProperties":{},"description":"For `DDR` and `DATA_TABLE_DATE`: a time before or after that date."},"tableId":{"type":"string","description":"For `DATA_TABLE_DATE`: the data table, by its id."},"rowMatch":{"type":"object","properties":{"match":{"type":"string","enum":["ALL","ANY"],"description":"`ALL`: every rule matches. `ANY`: one does."},"conditions":{"type":"array","items":{"type":"object","properties":{"fieldId":{"type":"string","description":"The column, by its id."},"op":{"type":"string","description":"How it compares, such as `eq`, `neq`, `contains` or `gt`."},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}],"description":"What it compares with: fixed text, a number, `true` or `false`, a list for `in` and `notIn`, or a reference to a flow value."}},"required":["fieldId","op"],"additionalProperties":{},"description":"One rule."},"description":"The rules."}},"additionalProperties":{},"description":"For `DATA_TABLE_DATE`: the rules that find the row."},"fieldId":{"type":"string","description":"For `DATA_TABLE_DATE`: the date column, by its id."}},"required":["type"],"additionalProperties":{},"description":"When the step is due. Needed by monitors that run after it is overdue."},"monitors":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The monitor's id, to change or keep one. Leave out on a new one; Moxo makes it."},"trigger":{"type":"object","properties":{"kind":{"type":"string","enum":["timer.since_assigned","timer.since_overdue","event"],"description":"`timer.since_assigned`: a time after the step starts. `timer.since_overdue`: a time after it is overdue (needs `stepDue`). `event`: when something happens on the step."},"duration":{"type":"object","properties":{"value":{"type":"integer","minimum":0,"description":"How many units. 0 (at the due time) only with `escalate`."},"unit":{"type":"string","enum":["MINUTES","HOURS","DAYS","WEEKS"],"description":"The unit."}},"required":["value","unit"],"additionalProperties":{},"description":"For a timer: how long to wait."},"on":{"type":"string","enum":["step_started","step_completed","submitted_for_review","review_changes_requested","approved","rejected","file_uploaded","all_files_received"],"description":"For `event`: what happens, e.g. `step_completed`, `approved`, `rejected`."}},"required":["kind"],"additionalProperties":{},"description":"When it fires."},"action":{"type":"object","properties":{"kind":{"type":"string","enum":["fire_webhook","send_email","cancel_flow","jump_to_step","update_fields","escalate"],"description":"What it does: send a webhook, send an email, cancel the flow, send the flow back to an earlier step, set flow fields, or bring more people onto the late step."},"url":{"type":"string","description":"For `fire_webhook`: the address to send it to."},"to":{"type":"array","items":{"type":"string"},"description":"For `send_email`: who receives it. Each entry is an address, or a role email such as `{Role: Clerk / Email}`. A role reaches every person holding it. Required for `send_email`."},"subject":{"type":"string","description":"For `send_email`: the subject. It can include flow details the same way a Send email step subject does. Required for `send_email`."},"body":{"type":"string","description":"For `send_email`: the message. It can include flow details the same way a Send email step body does. Required for `send_email`."},"context":{"type":"object","additionalProperties":{"type":"string"},"description":"For `fire_webhook`: extra keys and values to send."},"dataFromStepId":{"type":"string","description":"For `fire_webhook`: a step whose answers to send with it."},"targetStepId":{"type":"string","description":"For `jump_to_step`: the earlier step to go back to."},"preserveData":{"type":"boolean","description":"For `jump_to_step`: keep that step's answers as a draft."},"updates":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"description":"For `update_fields`: flow field key to value. For a choice field, the option's label."},"target":{"type":"object","properties":{"kind":{"type":"string","enum":["role","manager"],"description":"`role`: everyone in a role joins the step. `manager`: the assignee's manager."},"roleName":{"type":"string","description":"For `role`: the role's name."},"roleId":{"type":"string","description":"For `role`: the role's id, instead of its name."},"roleHandle":{"type":"string","description":"For `role`: the handle of a role added in this list."},"levels":{"type":"integer","minimum":1,"maximum":2,"description":"For `manager`: 1 is their manager, 2 their manager's manager."},"fallbackEmail":{"type":"string","description":"For `manager`: who joins when the assignee has no manager."}},"required":["kind"],"additionalProperties":{},"description":"For `escalate`: who to bring in."}},"required":["kind"],"additionalProperties":{},"description":"What it does."}},"required":["trigger","action"],"additionalProperties":{},"description":"One monitor: when it fires and what it does."},"description":"What happens automatically when the step is late or something happens on it. The list you send replaces the step's monitors: send the ones to keep (with their `id`), leave out the ones to remove."},"customReminders":{"type":["object","null"],"properties":{"dueDateApproaching":{"type":"boolean","description":"Remind the assignees before the due date."},"dueDateApproachingDays":{"type":"array","items":{"type":"integer","minimum":1,"maximum":365},"minItems":1,"maxItems":5,"description":"How many days before the due date each reminder goes, for example `[90, 60, 30]`."},"actionDue":{"type":"boolean","description":"Remind the assignees on the due date."},"actionOverdue":{"type":"boolean","description":"Send a notice after the due date has passed."},"actionOverdueRepeatDays":{"type":"integer","minimum":1,"maximum":365,"description":"Days between notices after the due date."},"actionOverdueMaxTimes":{"type":"integer","minimum":1,"maximum":10,"description":"The most notices sent after the due date."},"noDueDateFollowUpDays":{"type":"integer","minimum":1,"maximum":30,"description":"An action sent on its own (`POST /v1/actions`) with no due date: days between follow-ups. A flow step refuses it."},"noDueDateFollowUpMax":{"type":"integer","minimum":0,"maximum":10,"description":"An action sent on its own with no due date: how many follow-ups to send; `0` never follows up. A flow step refuses it."},"emails":{"type":"object","properties":{"dueSoon":{"type":"object","properties":{"subject":{"type":"string","maxLength":300,"description":"The email's subject line. May hold the email's variables such as `{{firstName}}`, `{{dueDate}}` and `{{daysUntilDue}}`; `{{dueRow:<column id>}}` for a column of the data table row the step's due date is read from (a due date from a data table); and data references in `{…}`."},"heading":{"type":"string","maxLength":300,"description":"The heading at the top of the email. May hold the email's variables such as `{{firstName}}`, `{{dueDate}}` and `{{daysUntilDue}}`; `{{dueRow:<column id>}}` for a column of the data table row the step's due date is read from (a due date from a data table); and data references in `{…}`."},"body":{"type":"string","maxLength":5000,"description":"The email's message. A blank line starts a new paragraph. May hold the email's variables such as `{{firstName}}`, `{{dueDate}}` and `{{daysUntilDue}}`; `{{dueRow:<column id>}}` for a column of the data table row the step's due date is read from (a due date from a data table); and data references in `{…}`."},"buttonLabel":{"type":"string","maxLength":80,"description":"The words on the button that opens the action."}},"additionalProperties":false,"description":"The reminder sent while the due date is still ahead. A field left out uses the organization's wording."},"overdue":{"type":"object","properties":{"subject":{"type":"string","maxLength":300,"description":"The email's subject line. May hold the email's variables such as `{{firstName}}`, `{{dueDate}}` and `{{daysUntilDue}}`; `{{dueRow:<column id>}}` for a column of the data table row the step's due date is read from (a due date from a data table); and data references in `{…}`."},"heading":{"type":"string","maxLength":300,"description":"The heading at the top of the email. May hold the email's variables such as `{{firstName}}`, `{{dueDate}}` and `{{daysUntilDue}}`; `{{dueRow:<column id>}}` for a column of the data table row the step's due date is read from (a due date from a data table); and data references in `{…}`."},"body":{"type":"string","maxLength":5000,"description":"The email's message. A blank line starts a new paragraph. May hold the email's variables such as `{{firstName}}`, `{{dueDate}}` and `{{daysUntilDue}}`; `{{dueRow:<column id>}}` for a column of the data table row the step's due date is read from (a due date from a data table); and data references in `{…}`."},"buttonLabel":{"type":"string","maxLength":80,"description":"The words on the button that opens the action."}},"additionalProperties":false,"description":"The notice sent after the due date has passed. A field left out uses the organization's wording."},"nudge":{"type":"object","properties":{"subject":{"type":"string","maxLength":300,"description":"The email's subject line. May hold the email's variables such as `{{firstName}}`, `{{dueDate}}` and `{{daysUntilDue}}`; `{{dueRow:<column id>}}` for a column of the data table row the step's due date is read from (a due date from a data table); and data references in `{…}`."},"heading":{"type":"string","maxLength":300,"description":"The heading at the top of the email. May hold the email's variables such as `{{firstName}}`, `{{dueDate}}` and `{{daysUntilDue}}`; `{{dueRow:<column id>}}` for a column of the data table row the step's due date is read from (a due date from a data table); and data references in `{…}`."},"body":{"type":"string","maxLength":5000,"description":"The email's message. A blank line starts a new paragraph. May hold the email's variables such as `{{firstName}}`, `{{dueDate}}` and `{{daysUntilDue}}`; `{{dueRow:<column id>}}` for a column of the data table row the step's due date is read from (a due date from a data table); and data references in `{…}`."},"buttonLabel":{"type":"string","maxLength":80,"description":"The words on the button that opens the action."}},"additionalProperties":false,"description":"The reminder sent for an action with no due date. A field left out uses the organization's wording."}},"additionalProperties":false,"description":"This action's own wording for its reminder emails."}},"additionalProperties":false,"description":"This step's own reminders, when the organization has Custom step reminders. Leave out or send `null` for the default reminders. Schedule fields left out come from the role, then the template. `emails.dueSoon`, `emails.overdue` and `emails.nudge` word the reminder emails: a field left out uses the organization's wording."},"visibility":{"type":"object","properties":{"mode":{"type":"string","enum":["ASSIGNEE_ONLY","ALL","SPECIFIC_ROLES"],"description":"`ASSIGNEE_ONLY` (the default): only the people on the step. `ALL`: everyone on the flow. `SPECIFIC_ROLES`: these roles too."},"roles":{"type":"array","items":{"type":"string"},"description":"For `SPECIFIC_ROLES`: the roles, by name or id."}},"additionalProperties":{},"description":"Who sees the step."},"completion":{"type":["object","null"],"properties":{"mode":{"type":"string","enum":["ONE","MAJORITY","ALL"],"description":"`ONE`: any one person on any role. `MAJORITY`: more than half of everyone assigned across roles. `ALL`: everyone on every role."}},"additionalProperties":{},"description":"For a step with two or more roles: an override of the roles' own completion settings. Send `null` to remove it: every role then completes the step at once, each by its own setting. A step with one role follows its role's setting and keeps no override."},"assigneeOrder":{"type":"string","enum":["SEQUENTIAL","PARALLEL"],"description":"Several assignees act one after another or at the same time."},"skipSequentialOrder":{"type":"boolean","description":"Start at the same time as the step before it."},"dependsOnStepIds":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"object","properties":{"stepId":{"type":"string","description":"The step's id."}},"required":["stepId"],"additionalProperties":{}}]},"description":"Start as soon as these earlier steps are done, instead of waiting for everything before it. Step ids, or `{ stepId }` as returned in a step."},"paths":{"type":"array","items":{"type":"object","properties":{"handle":{"type":"string","description":"A name you choose, unique in this list, so later changes in the same list can use it where an id goes. The response maps it to its new id in `ids`."},"label":{"type":"string","description":"The path's name."},"condition":{"type":"object","properties":{"type":{"type":"string","enum":["EQUALS","NOT_EQUALS","CONTAINS","NOT_CONTAINS","ARRAY_CONTAINS","GREATER_THAN","LESS_THAN","GREATER_THAN_OR_EQUAL","LESS_THAN_OR_EQUAL","STARTS_WITH","ENDS_WITH","IS_EMPTY","NOT_EMPTY","IN","NOT_IN","ELSE"],"description":"How to compare. `ELSE` takes no operands; `IS_EMPTY` and `NOT_EMPTY` take only `left`."},"left":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"object","properties":{"kind":{"type":"string","description":"What it reads: `step`, `input`, `role` or `organization`."}},"required":["kind"],"additionalProperties":{},"description":"A structured reference to the value."}],"description":"What to check: a reference such as `{Intake / Entity type}`, or a value."},"right":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"object","properties":{"kind":{"type":"string","description":"What it reads: `step`, `input`, `role` or `organization`."}},"required":["kind"],"additionalProperties":{},"description":"A structured reference to the value."}],"description":"What to compare it with. Match a choice by its label."}},"required":["type"],"additionalProperties":{},"description":"When the flow takes this path."},"conditions":{"type":"array","items":{"$ref":"#/components/schemas/PathCondition"},"description":"Several rules, combined by `conditionLogic`."},"conditionLogic":{"type":"string","enum":["ALL","ANY"],"description":"`ALL` or `ANY`."}},"required":["handle","label"],"additionalProperties":{},"description":"A path of a new branch."},"description":"For a new branch: its paths. Add the steps in each with add_step and `pathId`. To change an existing branch's paths, use update_paths."},"outcomes":{"type":"array","items":{"type":"object","properties":{"handle":{"type":"string","description":"A name you choose, unique in this list, so later changes in the same list can use it where an id goes. The response maps it to its new id in `ids`."},"label":{"type":"string","description":"The outcome as the person deciding sees it."}},"required":["handle","label"],"additionalProperties":{},"description":"An outcome of a new Decision."},"description":"For a new Decision: its outcomes. Add their steps with add_step and `outcomeId`. To change them later, use update_paths."}},"additionalProperties":{},"description":"The settings to change: the shared ones below, and any setting of the step's type (its `StepSettings_<TYPE>` schema, such as `StepSettings_FORM`). Nested settings merge; the rest stay."},"NewFormField":{"type":"object","properties":{"handle":{"type":"string","minLength":1,"description":"A name you choose, so later changes in this list can use it where a field id goes. Read the new field's id from the outline."},"label":{"type":"string","minLength":1,"description":"The field's label."},"type":{"type":"string","minLength":1,"description":"The field type, e.g. `TEXT_SINGLE_LINE`, `EMAIL`, `DROPDOWN`, `DATE`, `FILE_UPLOAD`. `TEXT` is read as `TEXT_SINGLE_LINE`."},"required":{"type":"boolean","description":"The form can't be submitted without it."},"options":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"object","properties":{"id":{"type":"string","description":"Keep an option's id. Leave out on a new one."},"label":{"type":"string","minLength":1,"description":"The option as people see it."},"value":{"type":"string","description":"The value a rule matches. Leave out to use the label."},"color":{"type":"string","description":"Its color."}},"required":["label"],"additionalProperties":{}}]},"description":"For a choice field: its options, as labels or `{ label }` objects."}},"required":["handle","label","type"],"additionalProperties":{},"description":"A form field: `handle`, `label`, `type`, and the settings its type takes."},"FormFieldChange":{"type":"object","properties":{"type":{"type":"string","minLength":1,"description":"The field's type (its current one, unless you are changing it)."},"label":{"type":"string","description":"Its new label."},"required":{"type":"boolean","description":"Whether it must be answered."},"options":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"object","properties":{"id":{"type":"string","description":"Keep an option's id. Leave out on a new one."},"label":{"type":"string","minLength":1,"description":"The option as people see it."},"value":{"type":"string","description":"The value a rule matches. Leave out to use the label."},"color":{"type":"string","description":"Its color."}},"required":["label"],"additionalProperties":{}}]},"description":"Its options."}},"required":["type"],"additionalProperties":{},"description":"The settings to change, with the field's `type`. Settings you leave out stay."},"RoleChange":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"The role's name. Steps are assigned to it by this name in `assignees`."},"key":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,63}$","description":"Its key: what a template file and the run API name it by. Lowercase letters, digits, _ and -, unique in the template. Leave out: its handle is its key."},"description":{"type":"string","description":"What the role does."},"resolution":{"$ref":"#/components/schemas/RoleResolutionChange"},"roleOptions":{"type":"object","properties":{"managerToggle":{"type":"boolean","description":"People in this role manage the flow."},"allowViewAllActions":{"type":"boolean","description":"People in this role see every step, not only their own."},"viewerOnly":{"type":"boolean","description":"The role only views the flow; it can't be assigned steps."},"allowViewAutomations":{"type":"boolean","description":"People in this role see automated steps."},"cardinality":{"type":"string","enum":["single","multi"],"description":"`single`: one person fills the role. `multi`: one or more people."},"completionMode":{"type":"string","enum":["ANY_ONE","ALL","MAJORITY"],"description":"When several people fill the role, how many must finish its steps: `ANY_ONE`, `MAJORITY` or `ALL`. Sent in a role's `options`, as the template read shows it, `ONE` is `ANY_ONE`."},"viewMode":{"type":"string","enum":["SPOTLIGHT","GALLERY"],"description":"How the role sees its steps: `SPOTLIGHT` (one at a time) or `GALLERY` (all at once)."}},"additionalProperties":{},"description":"What the role may see and do."},"notificationPrefs":{"type":"object","properties":{"delivery":{"type":"string","enum":["AUTO","PRIMARY_CHANNEL","ALL_CHANNELS"],"description":"Mirrors `sendVia`. Set `sendVia` instead."},"sendVia":{"type":"string","enum":["PRIMARY","ALL_CHANNELS"],"description":"Notify via: `PRIMARY` (each person's own channel) or `ALL_CHANNELS` (email and text). `ALL_CHANNELS` needs text messages turned on for your organization."},"escalateAfter":{"type":"string","enum":["NEVER","1_HOUR","4_HOURS","1_DAY","2_DAYS","1_WEEK"],"description":"Follow up after: how long a notification can go unseen before it is sent again on the person's other channels. `NEVER`, `1_HOUR`, `4_HOURS`, `1_DAY`, `2_DAYS` or `1_WEEK`."},"events":{"type":"object","properties":{"actionAssigned":{"type":"boolean","description":"When one of the role's actions is assigned."},"dueDateApproaching":{"type":"boolean","description":"Before an action's due date."},"dueDateApproachingDays":{"type":"array","items":{"type":"number"},"description":"Days before the due date to remind this role, one reminder each, e.g. [7, 1]. 1 to 5 reminders, each 1 to 365 days."},"actionDue":{"type":"boolean","description":"When an action is due."},"actionOverdue":{"type":"boolean","description":"When an action is overdue."},"actionOverdueRepeatDays":{"type":"number","description":"Days between overdue reminders."},"actionOverdueMaxTimes":{"type":"number","description":"The most overdue reminders one action sends."},"actionCompleted":{"type":"boolean","description":"When an action is completed."},"flowStarted":{"type":"boolean","description":"When the flow starts."},"flowOverdue":{"type":"boolean","description":"When the flow is overdue."},"flowOverdueRepeatDays":{"type":"number","description":"Days between flow overdue reminders."},"flowOverdueMaxTimes":{"type":"number","description":"The most flow overdue reminders sent."},"chatMessage":{"type":"boolean","description":"When a chat message is posted in the flow."},"addedAsViewer":{"type":"boolean","description":"When someone in the role is added as a viewer."},"milestoneCompleted":{"type":"boolean","description":"When a milestone is completed."},"flowCompleted":{"type":"boolean","description":"When the flow completes."}},"additionalProperties":false,"description":"Turn single notifications on or off for this role, e.g. `{ \"actionOverdue\": false }`. Each one you leave out follows the template."}},"additionalProperties":false,"description":"This role's own notification settings. Leave out to use the template's."}},"additionalProperties":{},"description":"The role's fields to change, as add_role takes them. Fields you leave out stay."},"RoleResolutionChange":{"type":"object","properties":{"type":{"type":"string","enum":["CONTACT_TBD","FIXED_CONTACT","FLOW_INPUT","FLOW_STARTER","ORG_CHART","ROUND_ROBIN","DESK"],"description":"`CONTACT_TBD`: chosen when a flow starts. `FIXED_CONTACT`: the same person every time. `FLOW_STARTER`: whoever starts the flow. `FLOW_INPUT`: an email from a start field. `ROUND_ROBIN`: in turn from a list. `ORG_CHART`: from your org chart. `DESK`: a desk."},"startFrom":{"type":"object","properties":{"kind":{"type":"string","enum":["FLOW_STARTER","ROLE"],"description":"`FLOW_STARTER` or `ROLE`."},"roleHandle":{"type":"string","description":"For `ROLE`: the role, by handle or id."}},"required":["kind"],"additionalProperties":{},"description":"For `ORG_CHART`: whose manager, or whose work it reviews."},"levels":{"type":"integer","minimum":1,"maximum":5,"description":"For `ORG_CHART` by manager: 1 is the manager, up to 5 levels up."},"position":{"type":"object","properties":{"departmentName":{"type":"string","minLength":1,"description":"The department, by its exact name."},"titleName":{"type":"string","minLength":1,"description":"The title, by its exact name."}},"required":["departmentName","titleName"],"additionalProperties":{},"description":"For `ORG_CHART` by title: everyone with this title in this department."},"fallbackEmail":{"type":"string","description":"For `ORG_CHART`: who fills the role when the org chart finds no one. Needed to publish."},"email":{"type":"string","description":"For `FIXED_CONTACT`: the person's email."},"inputKey":{"type":"string","description":"For `FLOW_INPUT`: the key of the start field with the email."},"emails":{"type":"array","items":{"type":"string"},"description":"For `FIXED_CONTACT` with several people, or `ROUND_ROBIN`: their emails."},"userIds":{"type":"array","items":{"type":"string"},"description":"For `FIXED_CONTACT` with several people, or `ROUND_ROBIN`: their user ids (`usr_…`), instead of or beside `emails`. A person with no email is kept by id."},"userId":{"type":"string","description":"For `FIXED_CONTACT`: the person's user id, instead of `email`."},"deskMode":{"type":"string","enum":["fixed","chooseAtStart","routeByField"],"description":"For `DESK`: `fixed` (one desk), `chooseAtStart`, or `routeByField`."},"desk":{"type":"string","minLength":1,"description":"For `DESK` (`fixed`): the desk's name or id."},"routeByField":{"type":"string","minLength":1,"description":"For `DESK` (`routeByField`): the key of the start dropdown whose answer picks the desk."},"claimScope":{"type":"string","enum":["action","role"],"description":"For `DESK`: whoever claims it takes this step only (`action`) or every step of the role (`role`)."}},"required":["type"],"additionalProperties":{},"description":"Who fills the role. Leave out to choose a person when each flow starts."},"FlowFieldSettings":{"anyOf":[{"type":"object","properties":{},"additionalProperties":false,"description":"No settings of its own: `TEXT_SINGLE_LINE`, `NUMBER`, `CURRENCY`, `RATING`, `NPS`, `SINGLE_SELECT`, `DROPDOWN`, `COUNTRY_SELECT`, `YES_NO`, `DATE`, `TIME`, `MATRIX`, `REPEATING_GROUP`, `SIGNATURE`, `HIDDEN`, `HEADING`, `PARAGRAPH`, `IMAGE`, `VIDEO`, `PAGE_BREAK`, `LINE_SEPARATOR`, `FIELD_GROUP`."},{"type":"object","properties":{"allowVoice":{"type":"boolean","description":"Let people speak their answer."},"voiceSaveTextAs":{"type":"string","enum":["english","original"],"description":"Save a spoken answer in English (translated if needed) or in the language spoken."}},"additionalProperties":{},"description":"Settings of a `TEXT_MULTI_LINE` field."},{"type":"object","properties":{"includeName":{"type":"boolean","description":"Ask for a first and last name above the email, and name the person this email adds from it."}},"additionalProperties":{},"description":"Settings of a `EMAIL` field."},{"type":"object","properties":{"hyperlinkLabel":{"type":"string","description":"The text shown for the link."}},"additionalProperties":{},"description":"Settings of a `URL` field."},{"type":"object","properties":{"formula":{"type":"string","maxLength":500,"description":"The calculation over other fields of the same form, e.g. `{{field:price}} * {{field:quantity}}`. Use a field's handle, or its id when it already exists."},"format":{"type":"string","enum":["NUMBER","CURRENCY","PERCENTAGE"],"description":"How the result is shown: `NUMBER`, `CURRENCY` or `PERCENTAGE`."},"decimals":{"type":"integer","minimum":0,"maximum":6,"description":"Decimal places shown."},"currencyCode":{"type":"string","minLength":3,"maxLength":3,"description":"For `CURRENCY`: the ISO 4217 code, e.g. `USD`."}},"required":["formula","format"],"additionalProperties":{},"description":"Settings of a `CALCULATED` field."},{"type":"object","properties":{"min":{"type":"number","description":"The lowest value."},"max":{"type":"number","description":"The highest value."},"step":{"type":"number","exclusiveMinimum":0,"description":"The step between values."},"leftLabel":{"type":"string","description":"The label at the low end."},"rightLabel":{"type":"string","description":"The label at the high end."}},"additionalProperties":{},"description":"Settings of a `SCALE` field."},{"type":"object","properties":{"searchOptions":{"type":"boolean","description":"Let people search the options."}},"additionalProperties":{},"description":"Settings of a `MULTI_SELECT` field."},{"type":"object","properties":{"sourceMode":{"type":"string","enum":["cascading","prior_step","org_chart_reports"],"description":"Where the options come from: another field's answer (`cascading`), an earlier step (`prior_step`), or a person's reports in the org chart (`org_chart_reports`)."},"orgChartReports":{"type":"object","properties":{"roleId":{"type":"string","description":"The role whose person's reports are listed. A role of your team."},"levels":{"type":"string","enum":["direct","all"],"description":"`direct` (the default): the people who report to them. `all`: everyone under them, up to 5 levels."},"fallbackUserId":{"type":["string","null"],"description":"Who is offered when the person has no reports."}},"additionalProperties":{},"description":"For `org_chart_reports`: whose reports are listed."},"optionsSourceRef":{"type":"string","description":"For `prior_step`: the earlier answer the options come from."},"optionsBackup":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string","description":"The option as people see it."},"value":{"type":"string","description":"The option's value."}},"required":["label","value"],"additionalProperties":{}},"description":"Options shown when the source has none."}},"additionalProperties":{},"description":"Settings of a `DYNAMIC_DROPDOWN` field."},{"type":"object","properties":{"source":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["data_table"],"description":"Records from one of your data tables."},"tableId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"string","enum":[""]}],"description":"The data table."},"labelFieldId":{"type":"string","format":"uuid","description":"The column shown for each record."},"columns":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The column's id."},"key":{"type":"string","description":"The column's key."},"name":{"type":"string","description":"The column's name."},"type":{"type":"string","description":"The column's type."},"options":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The choice's id, which a show/hide rule stores."},"label":{"type":"string","description":"The choice's name."}},"required":["id","label"],"additionalProperties":{}},"description":"An option column's choices. Leave it out on every other column."}},"required":["id","name"],"additionalProperties":{}},"description":"A copy of the table's columns, kept current by every save, so a For each over the picks lists them. Leave it out: the server writes it."}},"required":["kind","tableId"],"additionalProperties":{}},{"type":"object","properties":{"kind":{"type":"string","enum":["rest"],"description":"Records from an API."},"url":{"type":"string","description":"The search API's address. The search term goes in a query parameter or the body, never the path."},"method":{"type":"string","enum":["GET","POST"],"description":"`GET` (the default) or `POST`."},"contentType":{"type":"string","enum":["json","form"],"description":"For `POST`: `json` or `form`."},"body":{"anyOf":[{"type":"string"},{"type":"object","additionalProperties":{"type":"string"}}],"description":"For `POST`: the body. `{{search}}` is replaced by the search term."},"searchBodyKey":{"type":"string","description":"A body key that gets the search term."},"queryParams":{"type":"object","additionalProperties":{"type":"string"},"description":"Query parameters sent every time."},"headers":{"type":"object","additionalProperties":{"type":"string"},"description":"Headers sent every time. Sign in with `connectionId`, not a header."},"searchParam":{"type":"string","description":"The query parameter that carries the search term. Leave out for none."},"resultPath":{"type":"string","description":"The path to the list of records in the API's response, e.g. `data.items`."},"itemPath":{"type":"string","description":"A list inside each record whose items become the choices."},"idPath":{"type":"string","description":"Where each record's id is."},"labelPath":{"type":"string","description":"Where each record's label is."},"fields":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"The name later steps read it by."},"path":{"type":"string","description":"Where it is in the record."}},"required":["name","path"],"additionalProperties":{}},"description":"Values of the chosen record later steps can read, as `{Step / name}`."},"connectionId":{"type":"string","description":"The Secret it signs in with. Use this or `auth`, not both."},"auth":{"type":"object","properties":{"type":{"type":"string","enum":["bearer","basic"],"description":"`bearer` or `basic`."},"token":{"type":"string","description":"For `bearer`: the token."},"username":{"type":"string","description":"For `basic`: the user name."},"password":{"type":"string","description":"For `basic`: the password."}},"required":["type"],"additionalProperties":{},"description":"How it signs in, without a Secret. Prefer `connectionId`."},"pagination":{"type":"object","properties":{"style":{"type":"string","enum":["offset","page","cursor"],"description":"How pages are asked for."},"paramIn":{"type":"string","enum":["query","body"],"description":"Where the page goes: the query or the body."},"paramName":{"type":"string","minLength":1,"description":"The parameter that carries the page."},"pageSize":{"type":"integer","minimum":1,"maximum":100,"description":"Records per page. 20 when left out."},"pageSizeParam":{"type":"string","description":"The parameter that carries the page size."},"hasMorePath":{"type":"string","description":"The path in the response that says there are more pages."},"cursorPath":{"type":"string","description":"The path in the response to the next page's cursor."}},"required":["style","paramIn","paramName"],"additionalProperties":{},"description":"How the API pages its responses. Omit when it returns everything in one response."}},"required":["kind","url","searchParam","resultPath","labelPath"],"additionalProperties":{}}],"description":"Where the records come from: one of your data tables, or an API."},"tableId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"string","enum":[""]}],"description":"A data table to read records from. Prefer `source`."},"labelFieldId":{"type":"string","format":"uuid","description":"The column shown for each record, with `tableId`. Prefer `source`."},"displayFields":{"type":"array","items":{"type":"string"},"description":"Columns shown under each record, to tell them apart."},"visibleFieldIds":{"type":"array","items":{"type":"string","format":"uuid"},"description":"Not used."},"filter":{"type":"object","properties":{"match":{"type":"string","enum":["ALL","ANY"],"description":"`ALL`: every rule must match. `ANY`: one is enough."},"conditions":{"type":"array","items":{"type":"object","properties":{"fieldId":{"type":"string","minLength":1,"description":"The column's id in the data table."},"op":{"type":"string","enum":["eq","neq","contains","isEmpty","isNotEmpty","gt","gte","lt","lte","in","notIn"],"description":"How to compare: `eq`, `neq`, `contains`, `in`, `notIn`, `isEmpty`, `isNotEmpty`; for numbers and dates also `gt`, `gte`, `lt`, `lte`."},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},"maxItems":100}],"description":"What to compare with. Leave out for `isEmpty` and `isNotEmpty`; a list only for `in` and `notIn`."},"sourceFieldId":{"type":"string","minLength":1,"description":"Another field of the same form whose answer is compared, by its id."},"sourceSubFieldId":{"type":"string","minLength":1,"description":"In a repeating group: the column of the same row whose value is compared, by its id."},"sourceSubFieldKey":{"type":"string","minLength":1,"description":"The column of the same row, by key. Prefer `sourceSubFieldId`."},"sourceGroupSubFieldId":{"type":"string","minLength":1,"description":"A column of this group's source table, whose value in this row is compared."},"sourceGroupSubFieldKey":{"type":"string","minLength":1,"description":"A column of this group's source table, whose value in this row is compared. By key; prefer `sourceGroupSubFieldId`."}},"required":["fieldId","op"],"additionalProperties":{}},"maxItems":25,"description":"The rules."}},"required":["match","conditions"],"additionalProperties":{},"description":"Which records are offered."},"interactionMode":{"type":"string","enum":["search","dropdown"],"description":"How a record is picked: `search` (the default) or `dropdown`."}},"additionalProperties":{},"description":"Settings of a `DATA_TABLE_LOOKUP` field."},{"type":"object","properties":{"defaultCountry":{"type":"string","pattern":"^[A-Z]{2}$","description":"The country it opens on, e.g. `GB`. Leave out to use your organization's."},"allowedCountries":{"type":"array","items":{"type":"string","pattern":"^[A-Z]{2}$"},"minItems":1,"maxItems":250,"description":"The countries offered. Leave out for all."}},"additionalProperties":{},"description":"Settings of a `PHONE` field."},{"type":"object","properties":{"showMiddleName":{"type":"boolean","description":"Ask for a middle name."}},"additionalProperties":{},"description":"Settings of a `NAME` field."},{"type":"object","properties":{"showCountry":{"type":"boolean","description":"Ask for the country."},"addressSuggestions":{"type":"boolean","description":"Suggest addresses as people type."},"defaultCountry":{"type":"string","pattern":"^[A-Z]{2}$","description":"The country it opens on, e.g. `GB`. Leave out to use your organization's."}},"additionalProperties":{},"description":"Settings of a `ADDRESS` field."},{"type":"object","properties":{"items":{"type":"array","items":{"type":"string","minLength":1},"minItems":1,"description":"The items to rank."}},"required":["items"],"additionalProperties":{},"description":"Settings of a `RANKING` field."},{"type":"object","properties":{"aiRename":{"type":"object","properties":{"enabled":{"type":"boolean","default":false,"description":"Turn renaming on."},"mode":{"type":"string","enum":["ai","pattern"],"default":"ai","description":"`ai`: Moxo AI reads each file and names it (uses credits). `pattern`: name it from `nameTemplate`."},"additionalPrompt":{"type":"string","maxLength":2000,"description":"For `ai`: how to name the file, e.g. `{Client name}-Invoice`."},"nameTemplate":{"type":"string","maxLength":500,"description":"For `pattern`: the name, with references, e.g. `{Client name}-{Financial year}`."}},"additionalProperties":{},"description":"Rename uploaded files when the form is completed."},"retentionSelection":{"oneOf":[{"type":"object","properties":{"mode":{"type":"string","enum":["inherit"],"description":"`inherit`: new uploads follow the organization policy."}},"required":["mode"],"additionalProperties":{}},{"type":"object","properties":{"mode":{"type":"string","enum":["keep"],"description":"`keep`: new uploads are kept, exempt from the organization policy."}},"required":["mode"],"additionalProperties":{}},{"type":"object","properties":{"mode":{"type":"string","enum":["rule"],"description":"`rule`: new uploads follow the named retention rule."},"ruleId":{"type":"string","minLength":1,"description":"The retention rule. Required when the choice is `rule`."}},"required":["mode","ruleId"],"additionalProperties":{}}],"description":"Which retention rule new uploads to this field follow. `inherit` follows the organization policy. `keep` exempts the files. `rule` uses a named rule, and then `ruleId` is required."}},"additionalProperties":{},"description":"Settings of a `FILE_UPLOAD` field."},{"type":"object","properties":{"prefix":{"type":"string","maxLength":32,"description":"Text before the number, e.g. `INV-`."},"digits":{"type":"integer","minimum":1,"maximum":10,"description":"How many digits, padded with zeros."}},"additionalProperties":{},"description":"Settings of a `AUTO_NUMBER` field."},{"type":"object","properties":{"table":{"type":"object","properties":{"columns":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":80,"description":"The column's id. Keep it when editing."},"header":{"type":"string","maxLength":2000,"description":"The column header text. Bold, italic, underline and links are kept."},"widthPct":{"type":"number","minimum":5,"maximum":100,"description":"The column's share of the table width, in percent. Leave out for an even share."},"answer":{"type":"object","properties":{"type":{"type":"string","enum":["TEXT_SINGLE_LINE","TEXT_MULTI_LINE","NUMBER","DATE","DROPDOWN","EMAIL","URL"],"description":"What each cell takes: `TEXT_SINGLE_LINE`, `TEXT_MULTI_LINE`, `NUMBER`, `DATE`, `DROPDOWN`, `EMAIL` or `URL`."},"required":{"type":"boolean","description":"Every cell to fill in in this column needs an answer before Submit."},"options":{"type":"array","items":{"type":"string","minLength":1,"maxLength":200},"maxItems":100,"description":"The choices a `DROPDOWN` column offers."}},"required":["type"],"additionalProperties":{},"description":"Set when people fill in this column's cells, in the rows marked to fill in. Leave out for a column of your own text."}},"required":["id","header"],"additionalProperties":{}},"minItems":1,"maxItems":12,"description":"The columns, left to right."},"rows":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":80,"description":"The row's id. Keep it when editing."},"cells":{"type":"object","additionalProperties":{"type":"string","maxLength":4000},"description":"Each cell's text, by column id. Bold, italic, underline and links are kept."},"fillable":{"type":"boolean","description":"People fill in this row's cells in the columns that take an answer."}},"required":["id"],"additionalProperties":{}},"maxItems":200,"description":"The rows, top to bottom."},"includeHeaders":{"type":"boolean","description":"Show the header row with the column headers. On by default."},"borders":{"type":"boolean","description":"Draw a border around every cell. On by default."},"fillable":{"type":"boolean","description":"People fill in some cells: where a row marked to fill in meets a column with an answer. Off by default."},"headerColor":{"anyOf":[{"type":"string","enum":["default","slate","glacier","jade"]},{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"}],"description":"The header row color: `default`, `slate`, `glacier`, `jade`, or a custom hex color such as `#7A2040`."}},"required":["columns","rows"],"additionalProperties":{},"description":"The table: its columns, rows and look. People read it; it collects no answer."}},"required":["table"],"additionalProperties":{},"description":"Settings of a `TABLE` field."}],"description":"The settings of the field's type. Each variant names the types it is for."},"NotificationSettingsChange":{"type":"object","properties":{"mode":{"type":"string","enum":["default","custom"],"description":"`default` uses your organization's standard notifications; `custom` uses this template's own. Changing any alert switches the template to `custom`."},"assignee":{"type":"object","properties":{"actionAlerts":{"type":"object","properties":{"actionAssigned":{"type":"boolean","description":"Tell them when a step is given to them."},"dueDateApproaching":{"type":"boolean","description":"Remind them before a step is due."},"dueDateApproachingDays":{"type":"array","items":{"type":"number"},"description":"Days before the due date to remind them, one reminder each, e.g. [90, 60, 30]. 1 to 5 reminders, each 1 to 365 days."},"actionDue":{"type":"boolean","description":"Remind them on the day a step is due."},"actionOverdue":{"type":"boolean","description":"Remind them when a step is overdue."},"actionOverdueRepeatDays":{"type":"integer","minimum":1,"maximum":365,"description":"Repeat the overdue reminder every this many days (1 to 365)."},"actionOverdueMaxTimes":{"type":"integer","minimum":1,"maximum":10,"description":"Send the overdue reminder at most this many times (1 to 10)."},"delivery":{"type":"string","enum":["AUTO","PRIMARY_CHANNEL","ALL_CHANNELS"],"description":"How to reach them: `AUTO` or `PRIMARY_CHANNEL` on the channel each person prefers, `ALL_CHANNELS` on every channel they can get."},"showDeadlinesToAssignees":{"type":"boolean","description":"Show them when each of their steps is due."}},"additionalProperties":{},"description":"Their steps: when one is given to them, and the reminders before and after it is due."},"flowCompletion":{"type":"object","properties":{"flowCompleted":{"type":"boolean","description":"Tell them when the flow completes."},"delivery":{"type":"string","enum":["AUTO","PRIMARY_CHANNEL","ALL_CHANNELS"],"description":"How to reach them: `AUTO` or `PRIMARY_CHANNEL` on the channel each person prefers, `ALL_CHANNELS` on every channel they can get."}},"additionalProperties":{},"description":"When the flow they worked on is done."},"commentAlerts":{"type":"object","properties":{"newComment":{"type":"boolean","description":"Tell them about a new comment."},"reply":{"type":"boolean","description":"Tell them about a reply to their comment."},"mention":{"type":"boolean","description":"Tell them when someone mentions them."},"delivery":{"type":"string","enum":["AUTO","PRIMARY_CHANNEL","ALL_CHANNELS"],"description":"How to reach them: `AUTO` or `PRIMARY_CHANNEL` on the channel each person prefers, `ALL_CHANNELS` on every channel they can get."}},"additionalProperties":{},"description":"Comments in the flow."}},"additionalProperties":{},"description":"What the people a step is assigned to are told."},"manager":{"type":"object","properties":{"actionAlerts":{"type":"object","properties":{"actionCompleted":{"type":"boolean","description":"Tell them when a step is completed."},"delivery":{"type":"string","enum":["AUTO","PRIMARY_CHANNEL","ALL_CHANNELS"],"description":"How to reach them: `AUTO` or `PRIMARY_CHANNEL` on the channel each person prefers, `ALL_CHANNELS` on every channel they can get."}},"additionalProperties":{},"description":"Steps in the flow."},"flowAlerts":{"type":"object","properties":{"flowStarted":{"type":"boolean","description":"Tell them when the flow starts."},"flowOverdue":{"type":"boolean","description":"Remind them when the flow is overdue."},"flowOverdueRepeatDays":{"type":"integer","minimum":1,"maximum":365,"description":"Repeat the overdue reminder every this many days (1 to 365)."},"flowOverdueMaxTimes":{"type":"integer","minimum":1,"maximum":10,"description":"Send the overdue reminder at most this many times (1 to 10)."},"milestoneCompleted":{"type":"boolean","description":"Tell them when a milestone is completed."},"flowCompleted":{"type":"boolean","description":"Tell them when the flow completes."},"stepWaitingForAssignee":{"type":"boolean","description":"Tell them when a step is waiting for someone to be assigned."},"delivery":{"type":"string","enum":["AUTO","PRIMARY_CHANNEL","ALL_CHANNELS"],"description":"How to reach them: `AUTO` or `PRIMARY_CHANNEL` on the channel each person prefers, `ALL_CHANNELS` on every channel they can get."}},"additionalProperties":{},"description":"The flow itself, and the reminder when it is overdue."},"escalationAlerts":{"type":"object","properties":{"assigneeNotStartedDays":{"type":["integer","null"],"minimum":1,"maximum":365,"description":"Alert when an assignee hasn't started their step after this many days (1 to 365). `null` turns it off."},"automationFailure":{"type":"boolean","description":"Alert when an automated step fails."},"flowOffTrack":{"type":"boolean","description":"Alert when a step is due after the flow's due date."},"flowStalled":{"type":"boolean","description":"Alert when the flow has stalled."},"flowAtRisk":{"type":"boolean","description":"Kept for older templates; no alert uses it."},"waitingForAssigneeDays":{"type":["integer","null"],"minimum":1,"maximum":365,"description":"Alert when a step has had no one assigned for this many days (1 to 365). `null` turns it off."},"assigneeAbandonmentHours":{"type":["number","null"],"description":"Alert when an assignee opened their step but hasn't submitted it after this many hours. `null` turns it off."},"delivery":{"type":"string","enum":["AUTO","PRIMARY_CHANNEL","ALL_CHANNELS"],"description":"How to reach them: `AUTO` or `PRIMARY_CHANNEL` on the channel each person prefers, `ALL_CHANNELS` on every channel they can get."},"recipients":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["ALL_FLOW_MANAGERS"],"description":"The flow's managers."}},"required":["type"],"additionalProperties":{}},{"type":"object","properties":{"type":{"type":"string","enum":["ALL_TEMPLATE_OWNERS"],"description":"The template's owners."}},"required":["type"],"additionalProperties":{}},{"type":"object","properties":{"type":{"type":"string","enum":["SPECIFIC_USERS"],"description":"The teammates named in `userIds`."},"userIds":{"type":"array","items":{"type":"string"},"maxItems":10,"description":"The teammates to alert, by user id (at most 10)."}},"required":["type","userIds"],"additionalProperties":{}},{"type":"object","properties":{"type":{"type":"string","enum":["SPECIFIC_ROLE"],"description":"Whoever holds the flow manager roles named in `roleNames`."},"roleNames":{"type":"array","items":{"type":"string"},"maxItems":10,"description":"The flow manager roles to alert, by name (at most 10)."},"fallbackEmail":{"type":["string","null"],"format":"email","description":"Optional email address to receive escalations when none of the chosen roles have anyone assigned on a flow."}},"required":["type","roleNames"],"additionalProperties":{}}],"description":"Who gets escalations. Without it, the flow's managers; with no manager, the template owners."},"flowStalledRecipients":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["ALL_FLOW_MANAGERS"],"description":"The flow's managers."}},"required":["type"],"additionalProperties":{}},{"type":"object","properties":{"type":{"type":"string","enum":["ALL_TEMPLATE_OWNERS"],"description":"The template's owners."}},"required":["type"],"additionalProperties":{}},{"type":"object","properties":{"type":{"type":"string","enum":["SPECIFIC_USERS"],"description":"The teammates named in `userIds`."},"userIds":{"type":"array","items":{"type":"string"},"maxItems":10,"description":"The teammates to alert, by user id (at most 10)."}},"required":["type","userIds"],"additionalProperties":{}},{"type":"object","properties":{"type":{"type":"string","enum":["SPECIFIC_ROLE"],"description":"Whoever holds the flow manager roles named in `roleNames`."},"roleNames":{"type":"array","items":{"type":"string"},"maxItems":10,"description":"The flow manager roles to alert, by name (at most 10)."},"fallbackEmail":{"type":["string","null"],"format":"email","description":"Optional email address to receive escalations when none of the chosen roles have anyone assigned on a flow."}},"required":["type","roleNames"],"additionalProperties":{}}],"description":"Override who gets the flow-stalled escalation. Same shape as `recipients`. When absent, the condition inherits `recipients`."},"flowOffTrackRecipients":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["ALL_FLOW_MANAGERS"],"description":"The flow's managers."}},"required":["type"],"additionalProperties":{}},{"type":"object","properties":{"type":{"type":"string","enum":["ALL_TEMPLATE_OWNERS"],"description":"The template's owners."}},"required":["type"],"additionalProperties":{}},{"type":"object","properties":{"type":{"type":"string","enum":["SPECIFIC_USERS"],"description":"The teammates named in `userIds`."},"userIds":{"type":"array","items":{"type":"string"},"maxItems":10,"description":"The teammates to alert, by user id (at most 10)."}},"required":["type","userIds"],"additionalProperties":{}},{"type":"object","properties":{"type":{"type":"string","enum":["SPECIFIC_ROLE"],"description":"Whoever holds the flow manager roles named in `roleNames`."},"roleNames":{"type":"array","items":{"type":"string"},"maxItems":10,"description":"The flow manager roles to alert, by name (at most 10)."},"fallbackEmail":{"type":["string","null"],"format":"email","description":"Optional email address to receive escalations when none of the chosen roles have anyone assigned on a flow."}},"required":["type","roleNames"],"additionalProperties":{}}],"description":"Override who gets the flow-off-track escalation. Same shape as `recipients`. When absent, the condition inherits `recipients`."},"assigneeNotStartedRecipients":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["ALL_FLOW_MANAGERS"],"description":"The flow's managers."}},"required":["type"],"additionalProperties":{}},{"type":"object","properties":{"type":{"type":"string","enum":["ALL_TEMPLATE_OWNERS"],"description":"The template's owners."}},"required":["type"],"additionalProperties":{}},{"type":"object","properties":{"type":{"type":"string","enum":["SPECIFIC_USERS"],"description":"The teammates named in `userIds`."},"userIds":{"type":"array","items":{"type":"string"},"maxItems":10,"description":"The teammates to alert, by user id (at most 10)."}},"required":["type","userIds"],"additionalProperties":{}},{"type":"object","properties":{"type":{"type":"string","enum":["SPECIFIC_ROLE"],"description":"Whoever holds the flow manager roles named in `roleNames`."},"roleNames":{"type":"array","items":{"type":"string"},"maxItems":10,"description":"The flow manager roles to alert, by name (at most 10)."},"fallbackEmail":{"type":["string","null"],"format":"email","description":"Optional email address to receive escalations when none of the chosen roles have anyone assigned on a flow."}},"required":["type","roleNames"],"additionalProperties":{}}],"description":"Override who gets the assignee-not-started escalation. Same shape as `recipients`. When absent, the condition inherits `recipients`."},"automationFailureRecipients":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["ALL_FLOW_MANAGERS"],"description":"The flow's managers."}},"required":["type"],"additionalProperties":{}},{"type":"object","properties":{"type":{"type":"string","enum":["ALL_TEMPLATE_OWNERS"],"description":"The template's owners."}},"required":["type"],"additionalProperties":{}},{"type":"object","properties":{"type":{"type":"string","enum":["SPECIFIC_USERS"],"description":"The teammates named in `userIds`."},"userIds":{"type":"array","items":{"type":"string"},"maxItems":10,"description":"The teammates to alert, by user id (at most 10)."}},"required":["type","userIds"],"additionalProperties":{}},{"type":"object","properties":{"type":{"type":"string","enum":["SPECIFIC_ROLE"],"description":"Whoever holds the flow manager roles named in `roleNames`."},"roleNames":{"type":"array","items":{"type":"string"},"maxItems":10,"description":"The flow manager roles to alert, by name (at most 10)."},"fallbackEmail":{"type":["string","null"],"format":"email","description":"Optional email address to receive escalations when none of the chosen roles have anyone assigned on a flow."}},"required":["type","roleNames"],"additionalProperties":{}}],"description":"Override who gets the automation-failure escalation. Same shape as `recipients`. When absent, the condition inherits `recipients`."},"waitingForAssigneeRecipients":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["ALL_FLOW_MANAGERS"],"description":"The flow's managers."}},"required":["type"],"additionalProperties":{}},{"type":"object","properties":{"type":{"type":"string","enum":["ALL_TEMPLATE_OWNERS"],"description":"The template's owners."}},"required":["type"],"additionalProperties":{}},{"type":"object","properties":{"type":{"type":"string","enum":["SPECIFIC_USERS"],"description":"The teammates named in `userIds`."},"userIds":{"type":"array","items":{"type":"string"},"maxItems":10,"description":"The teammates to alert, by user id (at most 10)."}},"required":["type","userIds"],"additionalProperties":{}},{"type":"object","properties":{"type":{"type":"string","enum":["SPECIFIC_ROLE"],"description":"Whoever holds the flow manager roles named in `roleNames`."},"roleNames":{"type":"array","items":{"type":"string"},"maxItems":10,"description":"The flow manager roles to alert, by name (at most 10)."},"fallbackEmail":{"type":["string","null"],"format":"email","description":"Optional email address to receive escalations when none of the chosen roles have anyone assigned on a flow."}},"required":["type","roleNames"],"additionalProperties":{}}],"description":"Override who gets the waiting-for-assignee escalation. Same shape as `recipients`. When absent, the condition inherits `recipients`."},"assigneeAbandonmentRecipients":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["ALL_FLOW_MANAGERS"],"description":"The flow's managers."}},"required":["type"],"additionalProperties":{}},{"type":"object","properties":{"type":{"type":"string","enum":["ALL_TEMPLATE_OWNERS"],"description":"The template's owners."}},"required":["type"],"additionalProperties":{}},{"type":"object","properties":{"type":{"type":"string","enum":["SPECIFIC_USERS"],"description":"The teammates named in `userIds`."},"userIds":{"type":"array","items":{"type":"string"},"maxItems":10,"description":"The teammates to alert, by user id (at most 10)."}},"required":["type","userIds"],"additionalProperties":{}},{"type":"object","properties":{"type":{"type":"string","enum":["SPECIFIC_ROLE"],"description":"Whoever holds the flow manager roles named in `roleNames`."},"roleNames":{"type":"array","items":{"type":"string"},"maxItems":10,"description":"The flow manager roles to alert, by name (at most 10)."},"fallbackEmail":{"type":["string","null"],"format":"email","description":"Optional email address to receive escalations when none of the chosen roles have anyone assigned on a flow."}},"required":["type","roleNames"],"additionalProperties":{}}],"description":"Override who gets the assignee-abandonment escalation. Same shape as `recipients`. When absent, the condition inherits `recipients`."},"unresolvedCommentRecipients":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["ALL_FLOW_MANAGERS"],"description":"The flow's managers."}},"required":["type"],"additionalProperties":{}},{"type":"object","properties":{"type":{"type":"string","enum":["ALL_TEMPLATE_OWNERS"],"description":"The template's owners."}},"required":["type"],"additionalProperties":{}},{"type":"object","properties":{"type":{"type":"string","enum":["SPECIFIC_USERS"],"description":"The teammates named in `userIds`."},"userIds":{"type":"array","items":{"type":"string"},"maxItems":10,"description":"The teammates to alert, by user id (at most 10)."}},"required":["type","userIds"],"additionalProperties":{}},{"type":"object","properties":{"type":{"type":"string","enum":["SPECIFIC_ROLE"],"description":"Whoever holds the flow manager roles named in `roleNames`."},"roleNames":{"type":"array","items":{"type":"string"},"maxItems":10,"description":"The flow manager roles to alert, by name (at most 10)."},"fallbackEmail":{"type":["string","null"],"format":"email","description":"Optional email address to receive escalations when none of the chosen roles have anyone assigned on a flow."}},"required":["type","roleNames"],"additionalProperties":{}}],"description":"Override who gets the unresolved-comment escalation. Same shape as `recipients`. When absent, the condition inherits `recipients`."}},"additionalProperties":{},"description":"Escalations: alerts when the flow needs attention. They only tell people; to bring someone onto a late step, add an `escalate` monitor to the step."},"commentAlerts":{"type":"object","properties":{"newComment":{"type":"boolean","description":"Tell them about a new comment."},"reply":{"type":"boolean","description":"Tell them about a reply to their comment."},"mention":{"type":"boolean","description":"Tell them when someone mentions them."},"internalOnlyComment":{"type":"boolean","description":"Tell them about a comment only your team can see."},"delivery":{"type":"string","enum":["AUTO","PRIMARY_CHANNEL","ALL_CHANNELS"],"description":"How to reach them: `AUTO` or `PRIMARY_CHANNEL` on the channel each person prefers, `ALL_CHANNELS` on every channel they can get."}},"additionalProperties":{},"description":"Comments in the flow."}},"additionalProperties":{},"description":"What the flow's managers are told."},"viewer":{"type":"object","properties":{"flowAlerts":{"type":"object","properties":{"addedAsViewer":{"type":"boolean","description":"Tell them when they are added as a viewer."},"flowStarted":{"type":"boolean","description":"Tell them when the flow starts."},"milestoneCompleted":{"type":"boolean","description":"Tell them when a milestone is completed."},"flowCompleted":{"type":"boolean","description":"Tell them when the flow completes."},"delivery":{"type":"string","enum":["AUTO","PRIMARY_CHANNEL","ALL_CHANNELS"],"description":"How to reach them: `AUTO` or `PRIMARY_CHANNEL` on the channel each person prefers, `ALL_CHANNELS` on every channel they can get."}},"additionalProperties":{},"description":"The flow itself."}},"additionalProperties":{},"description":"What the flow's viewers are told."},"channelIntegrations":{"type":"object","properties":{"webhooks":{"type":"object","properties":{"endpoints":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"An existing endpoint id from the outline. Keeps that endpoint and its signing secret."},"label":{"type":"string","minLength":1,"maxLength":120,"description":"The endpoint's name."},"url":{"type":"string","description":"The public https address Moxo sends events to."},"enabled":{"type":"boolean","description":"Send events to it. On unless you send false."},"events":{"anyOf":[{"type":"array","items":{"type":"string","enum":["flowStarted","stepStarted","stepCompleted","flowCompleted","flowCancelled","stepOverdue","stepEscalated"]},"maxItems":7},{"type":"object","properties":{"flowStarted":{"type":"boolean","description":"A flow started."},"stepStarted":{"type":"boolean","description":"A step started."},"stepCompleted":{"type":"boolean","description":"A step was completed."},"flowCompleted":{"type":"boolean","description":"A flow finished."},"flowCancelled":{"type":"boolean","description":"A flow was cancelled."},"stepOverdue":{"type":"boolean","description":"A step is overdue."},"stepEscalated":{"type":"boolean","description":"More people were brought onto a late step."}},"additionalProperties":false}],"description":"`events` is a list of event names ([\"flowCompleted\", \"stepCompleted\"]) or an object of booleans ({ \"flowCompleted\": true }). The events are flowStarted, stepStarted, stepCompleted, flowCompleted, flowCancelled, stepOverdue, stepEscalated. When you send events, the ones you leave out are off; leave `events` out to keep an endpoint's current events."}},"required":["label","url"],"additionalProperties":false},"maxItems":20,"description":"Every endpoint the template sends to: the list you send is the whole set."}},"required":["endpoints"],"additionalProperties":false,"description":"Outgoing webhooks. The list you send is the whole set: an endpoint is matched by `id`, else by `url`, and keeps its signing secret; a new one gets a secret Moxo makes, which a person copies from the builder."}},"additionalProperties":{},"description":"Channel integrations. Only `webhooks` can be set from code."}},"additionalProperties":{},"description":"The template's notifications, as the Notifications panel saves them: send only what you change. Changing an alert switches the template to custom notifications."},"WebhookTriggerFilter":{"type":"object","properties":{"root":{"type":"object","properties":{"kind":{"type":"string","enum":["group"],"description":"A group of conditions and groups."},"op":{"type":"string","enum":["AND","OR"],"description":"`AND`: every child must match. `OR`: any one is enough."},"children":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["group"],"description":"A group of conditions and groups."},"op":{"type":"string","enum":["AND","OR"],"description":"`AND`: every child must match. `OR`: any one is enough."},"children":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["group"],"description":"A group of conditions and groups."},"op":{"type":"string","enum":["AND","OR"],"description":"`AND`: every child must match. `OR`: any one is enough."},"children":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["group"],"description":"A group of conditions and groups."},"op":{"type":"string","enum":["AND","OR"],"description":"`AND`: every child must match. `OR`: any one is enough."},"children":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["group"],"description":"A group of conditions and groups."},"op":{"type":"string","enum":["AND","OR"],"description":"`AND`: every child must match. `OR`: any one is enough."},"children":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["group"],"description":"A group of conditions and groups."},"op":{"type":"string","enum":["AND","OR"],"description":"`AND`: every child must match. `OR`: any one is enough."},"children":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["condition"],"description":"One test on a field."},"field":{"type":"string","minLength":1,"maxLength":1000,"description":"The field to test, as a dot path such as `deal.stage`."},"op":{"type":"string","enum":["eq","neq","in","contains","startsWith","gt","lt","between","isSet","isEmpty","hasAnyOf"],"description":"How to compare: `eq` (the default), `neq`, `in`, `contains`, `startsWith`, `gt`, `lt`, `between`, `isSet`, `isEmpty` or `hasAnyOf`."},"value":{"type":"string","maxLength":1000,"description":"The value to compare with. Empty for `isSet` and `isEmpty`; `in`, `between` and `hasAnyOf` read `values` instead."},"values":{"type":"array","items":{"type":"string","maxLength":1000},"maxItems":100,"description":"The values for `in` (any of them), `between` (from and to) and `hasAnyOf`."}},"required":["kind","field","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["pipelineStage"],"description":"A record in one of these stages of a pipeline."},"pipelineField":{"type":"string","minLength":1,"maxLength":1000,"description":"The field that holds the pipeline."},"stageField":{"type":"string","minLength":1,"maxLength":1000,"description":"The field that holds the stage."},"pipeline":{"type":"string","minLength":1,"maxLength":1000,"description":"The pipeline."},"stages":{"type":"array","items":{"type":"string","maxLength":1000},"maxItems":100,"description":"The stages that match."}},"required":["kind","pipelineField","stageField","pipeline","stages"],"additionalProperties":false}]},"maxItems":100,"description":"The conditions and groups inside."}},"required":["kind","op","children"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["condition"],"description":"One test on a field."},"field":{"type":"string","minLength":1,"maxLength":1000,"description":"The field to test, as a dot path such as `deal.stage`."},"op":{"type":"string","enum":["eq","neq","in","contains","startsWith","gt","lt","between","isSet","isEmpty","hasAnyOf"],"description":"How to compare: `eq` (the default), `neq`, `in`, `contains`, `startsWith`, `gt`, `lt`, `between`, `isSet`, `isEmpty` or `hasAnyOf`."},"value":{"type":"string","maxLength":1000,"description":"The value to compare with. Empty for `isSet` and `isEmpty`; `in`, `between` and `hasAnyOf` read `values` instead."},"values":{"type":"array","items":{"type":"string","maxLength":1000},"maxItems":100,"description":"The values for `in` (any of them), `between` (from and to) and `hasAnyOf`."}},"required":["kind","field","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["pipelineStage"],"description":"A record in one of these stages of a pipeline."},"pipelineField":{"type":"string","minLength":1,"maxLength":1000,"description":"The field that holds the pipeline."},"stageField":{"type":"string","minLength":1,"maxLength":1000,"description":"The field that holds the stage."},"pipeline":{"type":"string","minLength":1,"maxLength":1000,"description":"The pipeline."},"stages":{"type":"array","items":{"type":"string","maxLength":1000},"maxItems":100,"description":"The stages that match."}},"required":["kind","pipelineField","stageField","pipeline","stages"],"additionalProperties":false}]},"maxItems":100,"description":"The conditions and groups inside."}},"required":["kind","op","children"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["condition"],"description":"One test on a field."},"field":{"type":"string","minLength":1,"maxLength":1000,"description":"The field to test, as a dot path such as `deal.stage`."},"op":{"type":"string","enum":["eq","neq","in","contains","startsWith","gt","lt","between","isSet","isEmpty","hasAnyOf"],"description":"How to compare: `eq` (the default), `neq`, `in`, `contains`, `startsWith`, `gt`, `lt`, `between`, `isSet`, `isEmpty` or `hasAnyOf`."},"value":{"type":"string","maxLength":1000,"description":"The value to compare with. Empty for `isSet` and `isEmpty`; `in`, `between` and `hasAnyOf` read `values` instead."},"values":{"type":"array","items":{"type":"string","maxLength":1000},"maxItems":100,"description":"The values for `in` (any of them), `between` (from and to) and `hasAnyOf`."}},"required":["kind","field","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["pipelineStage"],"description":"A record in one of these stages of a pipeline."},"pipelineField":{"type":"string","minLength":1,"maxLength":1000,"description":"The field that holds the pipeline."},"stageField":{"type":"string","minLength":1,"maxLength":1000,"description":"The field that holds the stage."},"pipeline":{"type":"string","minLength":1,"maxLength":1000,"description":"The pipeline."},"stages":{"type":"array","items":{"type":"string","maxLength":1000},"maxItems":100,"description":"The stages that match."}},"required":["kind","pipelineField","stageField","pipeline","stages"],"additionalProperties":false}]},"maxItems":100,"description":"The conditions and groups inside."}},"required":["kind","op","children"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["condition"],"description":"One test on a field."},"field":{"type":"string","minLength":1,"maxLength":1000,"description":"The field to test, as a dot path such as `deal.stage`."},"op":{"type":"string","enum":["eq","neq","in","contains","startsWith","gt","lt","between","isSet","isEmpty","hasAnyOf"],"description":"How to compare: `eq` (the default), `neq`, `in`, `contains`, `startsWith`, `gt`, `lt`, `between`, `isSet`, `isEmpty` or `hasAnyOf`."},"value":{"type":"string","maxLength":1000,"description":"The value to compare with. Empty for `isSet` and `isEmpty`; `in`, `between` and `hasAnyOf` read `values` instead."},"values":{"type":"array","items":{"type":"string","maxLength":1000},"maxItems":100,"description":"The values for `in` (any of them), `between` (from and to) and `hasAnyOf`."}},"required":["kind","field","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["pipelineStage"],"description":"A record in one of these stages of a pipeline."},"pipelineField":{"type":"string","minLength":1,"maxLength":1000,"description":"The field that holds the pipeline."},"stageField":{"type":"string","minLength":1,"maxLength":1000,"description":"The field that holds the stage."},"pipeline":{"type":"string","minLength":1,"maxLength":1000,"description":"The pipeline."},"stages":{"type":"array","items":{"type":"string","maxLength":1000},"maxItems":100,"description":"The stages that match."}},"required":["kind","pipelineField","stageField","pipeline","stages"],"additionalProperties":false}]},"maxItems":100,"description":"The conditions and groups inside."}},"required":["kind","op","children"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["condition"],"description":"One test on a field."},"field":{"type":"string","minLength":1,"maxLength":1000,"description":"The field to test, as a dot path such as `deal.stage`."},"op":{"type":"string","enum":["eq","neq","in","contains","startsWith","gt","lt","between","isSet","isEmpty","hasAnyOf"],"description":"How to compare: `eq` (the default), `neq`, `in`, `contains`, `startsWith`, `gt`, `lt`, `between`, `isSet`, `isEmpty` or `hasAnyOf`."},"value":{"type":"string","maxLength":1000,"description":"The value to compare with. Empty for `isSet` and `isEmpty`; `in`, `between` and `hasAnyOf` read `values` instead."},"values":{"type":"array","items":{"type":"string","maxLength":1000},"maxItems":100,"description":"The values for `in` (any of them), `between` (from and to) and `hasAnyOf`."}},"required":["kind","field","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["pipelineStage"],"description":"A record in one of these stages of a pipeline."},"pipelineField":{"type":"string","minLength":1,"maxLength":1000,"description":"The field that holds the pipeline."},"stageField":{"type":"string","minLength":1,"maxLength":1000,"description":"The field that holds the stage."},"pipeline":{"type":"string","minLength":1,"maxLength":1000,"description":"The pipeline."},"stages":{"type":"array","items":{"type":"string","maxLength":1000},"maxItems":100,"description":"The stages that match."}},"required":["kind","pipelineField","stageField","pipeline","stages"],"additionalProperties":false}]},"maxItems":100,"description":"The conditions and groups inside."}},"required":["kind","op","children"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["condition"],"description":"One test on a field."},"field":{"type":"string","minLength":1,"maxLength":1000,"description":"The field to test, as a dot path such as `deal.stage`."},"op":{"type":"string","enum":["eq","neq","in","contains","startsWith","gt","lt","between","isSet","isEmpty","hasAnyOf"],"description":"How to compare: `eq` (the default), `neq`, `in`, `contains`, `startsWith`, `gt`, `lt`, `between`, `isSet`, `isEmpty` or `hasAnyOf`."},"value":{"type":"string","maxLength":1000,"description":"The value to compare with. Empty for `isSet` and `isEmpty`; `in`, `between` and `hasAnyOf` read `values` instead."},"values":{"type":"array","items":{"type":"string","maxLength":1000},"maxItems":100,"description":"The values for `in` (any of them), `between` (from and to) and `hasAnyOf`."}},"required":["kind","field","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["pipelineStage"],"description":"A record in one of these stages of a pipeline."},"pipelineField":{"type":"string","minLength":1,"maxLength":1000,"description":"The field that holds the pipeline."},"stageField":{"type":"string","minLength":1,"maxLength":1000,"description":"The field that holds the stage."},"pipeline":{"type":"string","minLength":1,"maxLength":1000,"description":"The pipeline."},"stages":{"type":"array","items":{"type":"string","maxLength":1000},"maxItems":100,"description":"The stages that match."}},"required":["kind","pipelineField","stageField","pipeline","stages"],"additionalProperties":false}]},"maxItems":100,"description":"The conditions and groups inside."}},"required":["kind","op","children"],"additionalProperties":false,"description":"The conditions, as one group. Leave it out to match everything."},"op":{"type":"string","enum":["AND","OR"],"description":"The older flat form: how `predicates` combine. Send `root` instead."},"predicates":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string","minLength":1,"maxLength":1000,"description":"The field to test, as a dot path such as `deal.stage`."},"op":{"type":"string","enum":["eq","neq","in","contains","startsWith","gt","lt","between","isSet","isEmpty","hasAnyOf"],"description":"How to compare: `eq` (the default), `neq`, `in`, `contains`, `startsWith`, `gt`, `lt`, `between`, `isSet`, `isEmpty` or `hasAnyOf`."},"value":{"type":"string","maxLength":1000,"description":"The value to compare with. Empty for `isSet` and `isEmpty`; `in`, `between` and `hasAnyOf` read `values` instead."},"values":{"type":"array","items":{"type":"string","maxLength":1000},"maxItems":100,"description":"The values for `in` (any of them), `between` (from and to) and `hasAnyOf`."}},"required":["field","value"],"additionalProperties":false},"maxItems":100,"description":"The older flat form: a list of conditions. Send `root` instead."}},"additionalProperties":false,"description":"Conditions, combined with `AND` and `OR`, that a delivery's original JSON must meet to start a flow. They are checked before the mapping. Fields can be dot paths such as `event.type`. An empty object matches every authenticated delivery."},"WebhookConfig":{"type":"object","properties":{"webhookUrl":{"type":"string","description":"The URL other systems send requests to. With `none`, it contains a secret token that can't be guessed; with `hmac` or `api_key`, it is the template's plain endpoint. The token is a secret, so an organization API key reads a `none` webhook's URL without it; a person with edit access sees it whole.","example":"https://api.moxo.com/v1/webhooks/incoming/tpl_onboarding_v3"},"authMethod":{"type":"string","enum":["hmac","api_key","none"],"description":"How incoming webhook callers authenticate. `hmac` signs the timestamp and raw body with the shared secret and sends `X-Moxo-Signature`; `api_key` sends the secret in `X-API-Key`; `none` uses an unguessable secret token embedded in the webhook URL and is not anonymous.","example":"hmac"},"secret":{"type":["string","null"],"description":"The secret in plain text, returned only by `regenerate`, `reveal` and a change of auth method. Always `null` on `GET`, so store it when you receive it.","example":null},"secretPresent":{"type":"boolean","description":"`true` when a credential exists for the current auth method.","example":true},"secretNeedsRegenerate":{"type":"boolean","description":"`true` when this webhook refuses every delivery until its secret is regenerated: the secret can no longer be used, and deliveries need it. That is an `hmac` webhook, or an `api_key` webhook from before Moxo kept a hash of the key. A newer `api_key` webhook keeps working, and a `none` webhook's key is its URL, so both answer `false`. Call `regenerate` and give the sender the new secret.","example":false},"secretLast4":{"type":["string","null"],"description":"The last 4 characters of the live secret, as you hold it: the signing secret, the API key itself, or the token in a `none` webhook's URL. Compare it with your copy to check which secret is live. `null` when there is no secret yet, or for an API key made before October 2026 whose last 4 Moxo cannot tell: replace it with `regenerate` to get one.","example":"9f2c"},"previousKeyExpiresAt":{"type":["string","null"],"format":"date-time","description":"When the API key or HMAC signing secret that `regenerate` replaced stops working, if you chose to keep it working for a while (`previousKeyGraceSeconds`). `null` when the old one already stopped, which is the default: a replaced secret stops at once.","example":null},"signatureVersion":{"type":"string","enum":["v0","v1"],"description":"How the endpoint was made. `v1`: every endpoint made since the timestamped signature, and any whose secret was regenerated. `v0`: an older one. Both accept both signatures: `X-Moxo-Signature` (recommended: an HMAC over `<t>.<raw body>`, with a timestamp, each accepted once) and the body-only `X-Webhook-Signature`.","example":"v1"},"enabled":{"type":"boolean","description":"Whether the endpoint accepts requests; a disabled endpoint returns `404`. An endpoint starts disabled and turns on when the template's Webhook start mode is saved (Template Settings → Start Modes → Webhook, then Save). Regenerating the secret doesn't turn on a disabled endpoint.","example":true},"filter":{"anyOf":[{"$ref":"#/components/schemas/WebhookTriggerFilter"},{"type":"null"}],"description":"The conditions being edited, or `null` when every authenticated delivery starts a flow. A change waits for the template's next publish; until then, live deliveries use the published conditions and `hasPendingSetup` is `true`."},"hasPendingSetup":{"type":"boolean","description":"`true` when a change to the mapping or conditions waits for the template's next publish. Live deliveries keep the published setup until then; the test URL uses the new one.","example":false}},"required":["webhookUrl","authMethod","secret","secretPresent","secretNeedsRegenerate","secretLast4","previousKeyExpiresAt","signatureVersion","enabled","filter","hasPendingSetup"],"additionalProperties":false},"WebhookPayloadMapping":{"type":"object","properties":{"source":{"type":"string","enum":["universal_json","jotform"],"description":"`universal_json` for any JSON sender; `jotform` for a JotForm submission.","example":"universal_json"},"flowName":{"anyOf":[{"type":"object","properties":{"_literal":{"type":"string"}},"required":["_literal"],"additionalProperties":false,"description":"Fixed text.","example":{"_literal":"Website"}},{"type":"object","properties":{"_template":{"type":"string"}},"required":["_template"],"additionalProperties":false,"description":"Text built from the sender's payload: `{{payload.path.to.value}}` is replaced with that value. Every token starts with `payload.`; `{{message.subject}}` is refused, write `{{payload.message.subject}}`.","example":{"_template":"{{payload.company.name}}"}}]},"description":{"anyOf":[{"type":"object","properties":{"_literal":{"type":"string"}},"required":["_literal"],"additionalProperties":false,"description":"Fixed text.","example":{"_literal":"Website"}},{"type":"object","properties":{"_template":{"type":"string"}},"required":["_template"],"additionalProperties":false,"description":"Text built from the sender's payload: `{{payload.path.to.value}}` is replaced with that value. Every token starts with `payload.`; `{{message.subject}}` is refused, write `{{payload.message.subject}}`.","example":{"_template":"{{payload.company.name}}"}}]},"dueAt":{"anyOf":[{"type":"object","properties":{"_literal":{"type":"string"}},"required":["_literal"],"additionalProperties":false,"description":"Fixed text.","example":{"_literal":"Website"}},{"type":"object","properties":{"_template":{"type":"string"}},"required":["_template"],"additionalProperties":false,"description":"Text built from the sender's payload: `{{payload.path.to.value}}` is replaced with that value. Every token starts with `payload.`; `{{message.subject}}` is refused, write `{{payload.message.subject}}`.","example":{"_template":"{{payload.company.name}}"}}]},"customFields":{"type":"object","additionalProperties":{"anyOf":[{"type":"object","properties":{"_literal":{"type":"string"}},"required":["_literal"],"additionalProperties":false,"description":"Fixed text.","example":{"_literal":"Website"}},{"type":"object","properties":{"_template":{"type":"string"}},"required":["_template"],"additionalProperties":false,"description":"Text built from the sender's payload: `{{payload.path.to.value}}` is replaced with that value. Every token starts with `payload.`; `{{message.subject}}` is refused, write `{{payload.message.subject}}`.","example":{"_template":"{{payload.company.name}}"}},{"type":"object","additionalProperties":{"anyOf":[{"type":"object","properties":{"_literal":{"type":"string"}},"required":["_literal"],"additionalProperties":false,"description":"Fixed text.","example":{"_literal":"Website"}},{"type":"object","properties":{"_template":{"type":"string"}},"required":["_template"],"additionalProperties":false,"description":"Text built from the sender's payload: `{{payload.path.to.value}}` is replaced with that value. Every token starts with `payload.`; `{{message.subject}}` is refused, write `{{payload.message.subject}}`.","example":{"_template":"{{payload.company.name}}"}}]},"description":"A field with parts (Name, Address, Phone, Currency), mapped part by part, for example `{ \"city\": { \"_template\": \"{{payload.city}}\" } }`."}]},"description":"One entry per start field, keyed by the field's `key`, label or id. Moxo saves it under the field's id, so renaming the field later doesn't break the mapping."},"roleAssignments":{"type":"object","additionalProperties":{"anyOf":[{"type":"object","properties":{"_literal":{"type":"string"}},"required":["_literal"],"additionalProperties":false,"description":"Fixed text.","example":{"_literal":"Website"}},{"type":"object","properties":{"_template":{"type":"string"}},"required":["_template"],"additionalProperties":false,"description":"Text built from the sender's payload: `{{payload.path.to.value}}` is replaced with that value. Every token starts with `payload.`; `{{message.subject}}` is refused, write `{{payload.message.subject}}`.","example":{"_template":"{{payload.company.name}}"}},{"type":"object","properties":{"_email":{"type":"string"}},"required":["_email"],"additionalProperties":false,"description":"The person's email, read from the payload (`{{payload.contact.email}}`). Every token starts with `payload.`.","example":{"_email":"{{payload.contact.email}}"}},{"type":"object","properties":{"name":{"anyOf":[{"type":"object","properties":{"_literal":{"type":"string"}},"required":["_literal"],"additionalProperties":false,"description":"Fixed text.","example":{"_literal":"Website"}},{"type":"object","properties":{"_template":{"type":"string"}},"required":["_template"],"additionalProperties":false,"description":"Text built from the sender's payload: `{{payload.path.to.value}}` is replaced with that value. Every token starts with `payload.`; `{{message.subject}}` is refused, write `{{payload.message.subject}}`.","example":{"_template":"{{payload.company.name}}"}}]},"email":{"anyOf":[{"type":"object","properties":{"_literal":{"type":"string"}},"required":["_literal"],"additionalProperties":false,"description":"Fixed text.","example":{"_literal":"Website"}},{"type":"object","properties":{"_template":{"type":"string"}},"required":["_template"],"additionalProperties":false,"description":"Text built from the sender's payload: `{{payload.path.to.value}}` is replaced with that value. Every token starts with `payload.`; `{{message.subject}}` is refused, write `{{payload.message.subject}}`.","example":{"_template":"{{payload.company.name}}"}},{"type":"object","properties":{"_email":{"type":"string"}},"required":["_email"],"additionalProperties":false,"description":"The person's email, read from the payload (`{{payload.contact.email}}`). Every token starts with `payload.`.","example":{"_email":"{{payload.contact.email}}"}}]},"phone":{"anyOf":[{"type":"object","properties":{"_literal":{"type":"string"}},"required":["_literal"],"additionalProperties":false,"description":"Fixed text.","example":{"_literal":"Website"}},{"type":"object","properties":{"_template":{"type":"string"}},"required":["_template"],"additionalProperties":false,"description":"Text built from the sender's payload: `{{payload.path.to.value}}` is replaced with that value. Every token starts with `payload.`; `{{message.subject}}` is refused, write `{{payload.message.subject}}`.","example":{"_template":"{{payload.company.name}}"}}]},"countryCode":{"anyOf":[{"type":"object","properties":{"_literal":{"type":"string"}},"required":["_literal"],"additionalProperties":false,"description":"Fixed text.","example":{"_literal":"Website"}},{"type":"object","properties":{"_template":{"type":"string"}},"required":["_template"],"additionalProperties":false,"description":"Text built from the sender's payload: `{{payload.path.to.value}}` is replaced with that value. Every token starts with `payload.`; `{{message.subject}}` is refused, write `{{payload.message.subject}}`.","example":{"_template":"{{payload.company.name}}"}}]},"customFields":{"type":"object","additionalProperties":{"anyOf":[{"type":"object","properties":{"_literal":{"type":"string"}},"required":["_literal"],"additionalProperties":false,"description":"Fixed text.","example":{"_literal":"Website"}},{"type":"object","properties":{"_template":{"type":"string"}},"required":["_template"],"additionalProperties":false,"description":"Text built from the sender's payload: `{{payload.path.to.value}}` is replaced with that value. Every token starts with `payload.`; `{{message.subject}}` is refused, write `{{payload.message.subject}}`.","example":{"_template":"{{payload.company.name}}"}}]}}},"additionalProperties":false}]},"description":"One entry per role, keyed by the role's name or `roleId`. Moxo saves it under the `roleId`. A name that two roles share stays as written."},"fieldValues":{"type":"object","additionalProperties":{"anyOf":[{"type":"object","properties":{"_literal":{"type":"string"}},"required":["_literal"],"additionalProperties":false,"description":"Fixed text.","example":{"_literal":"Website"}},{"type":"object","properties":{"_template":{"type":"string"}},"required":["_template"],"additionalProperties":false,"description":"Text built from the sender's payload: `{{payload.path.to.value}}` is replaced with that value. Every token starts with `payload.`; `{{message.subject}}` is refused, write `{{payload.message.subject}}`.","example":{"_template":"{{payload.company.name}}"}},{"type":"object","additionalProperties":{"anyOf":[{"type":"object","properties":{"_literal":{"type":"string"}},"required":["_literal"],"additionalProperties":false,"description":"Fixed text.","example":{"_literal":"Website"}},{"type":"object","properties":{"_template":{"type":"string"}},"required":["_template"],"additionalProperties":false,"description":"Text built from the sender's payload: `{{payload.path.to.value}}` is replaced with that value. Every token starts with `payload.`; `{{message.subject}}` is refused, write `{{payload.message.subject}}`.","example":{"_template":"{{payload.company.name}}"}}]},"description":"A field with parts (Name, Address, Phone, Currency), mapped part by part, for example `{ \"city\": { \"_template\": \"{{payload.city}}\" } }`."}]},"deprecated":true,"description":"Deprecated: a webhook mapping's start fields, the same as `customFields`. Read `customFields`; this field is still sent so integrations built on it keep working."}},"required":["source"],"description":"Turns whatever JSON a sender posts into a flow start, so the sender does not have to send Moxo's own `{ name, fieldValues, roleAssignments }` shape.","example":{"source":"universal_json","flowName":{"_template":"Onboarding for {{payload.company.name}}"},"customFields":{"company_name":{"_template":"{{payload.company.name}}"}},"roleAssignments":{"Client":{"_email":"{{payload.contact.email}}"}}}},"WebhookEventPayload":{"type":"object","properties":{"event":{"type":"string","enum":["flow.started","step.started","step.completed","flow.completed","flow.cancelled","step.overdue","step.escalated","flow.paused","flow.resumed","action.sent","action.opened","action.completed","action.declined","action.cancelled"],"description":"Which event this is.","example":"step.completed"},"timestamp":{"type":"string","description":"When it happened, in UTC (ISO 8601).","example":"2026-10-06T10:15:34.267Z"},"template":{"type":"object","properties":{"id":{"type":["string","null"],"description":"`null` for a run not started from a template, such as an action.","example":"tpl_onboarding_v3"},"name":{"type":"string","description":"Usually the template name, but can be the flow name; identify the template by `id`. The action title for an action.","example":"Client onboarding"}},"required":["id","name"],"additionalProperties":false},"flow":{"type":"object","properties":{"id":{"type":"string","example":"flow_abc123"},"name":{"type":"string","example":"Acme onboarding"},"status":{"type":"string","description":"On `step.*` events this is `IN_PROGRESS`, even for the last step.","example":"IN_PROGRESS"}},"required":["id","name","status"],"additionalProperties":false},"step":{"type":"object","properties":{"stepId":{"type":"string","description":"The step on the flow, as `steps[].stepId` on Get flow. Stays the same across reopens and repeats.","example":"step-intake"},"stepExecutionId":{"type":"string","description":"This run of the step, as `steps[].id` on Get flow. Pairs `step.started` with `step.completed`.","example":"a1b2c3d4-0000-4000-8000-000000000003"},"name":{"type":"string","description":"The step's name as written in the template.","example":"Intake form"},"index":{"type":"integer","description":"Reliable only on `step.started`. Identify steps by `stepId` and `stepExecutionId`.","example":0},"id":{"type":"string","deprecated":true,"description":"Deprecated: the step on the flow (`step.id`), the same as `stepId`. Read `stepId`; this field is still sent so integrations built on it keep working."},"executionId":{"type":"string","deprecated":true,"description":"Deprecated: the run the event is about (`step.executionId`), the same as `stepExecutionId`. Read `stepExecutionId`; this field is still sent so integrations built on it keep working."}},"required":["stepId","stepExecutionId","name","index"],"additionalProperties":false,"description":"Present on `step.*` events."},"onBehalfOf":{"type":"object","properties":{"userId":{"type":"string","description":"The assignee's id, with the `usr_` prefix: the id `GET /v1/users` returns. Always this form.","example":"usr_7Kd2mQxWnR4vT9pLcYb3Ae"},"name":{"type":"string","description":"The assignee's name.","example":"Ana Ruiz"},"roleName":{"type":"string","description":"The role the assignee holds on the step.","example":"Client"},"uniqueId":{"type":["string","null"],"description":"The assignee's unique ID in your organization, or `null` when they have none.","example":"cust_984431"},"email":{"type":["string","null"],"description":"The assignee's email, or `null` when they were added by unique ID only."}},"required":["userId","name","roleName","uniqueId","email"],"additionalProperties":false,"description":"Only on `step.completed`, and only when a flow manager completed the step for its assignee. Names the assignee; the manager who completed it is on the step's record."},"metadata":{"type":"object","additionalProperties":{},"description":"Depends on the event. On `step.completed` it holds the step results.","example":{"company_name":"Acme"}},"test":{"type":"boolean","enum":[true],"description":"`true` when a test sent it: a test run, or the endpoint's **Test** button. Absent on real work. The delivery also carries the header `X-Moxo-Test: true`."}},"required":["event","timestamp","template","metadata"],"additionalProperties":false},"PersonWebhookEventPayload":{"type":"object","properties":{"event":{"type":"string","enum":["user.unique_id_changed"],"description":"Which event this is.","example":"user.unique_id_changed"},"timestamp":{"type":"string","description":"When it happened, in UTC (ISO 8601).","example":"2026-12-01T10:42:07.000Z"},"person":{"type":"object","properties":{"id":{"type":"string","description":"The person's `usr_` id.","example":"usr_7Qm2LxR9aTb4Kc1NvW8pZe"},"uniqueId":{"type":["string","null"],"description":"The unique ID they have now.","example":"BANK-1234"},"previousUniqueId":{"type":["string","null"],"description":"The unique ID it replaced.","example":"PRPT-1234"}},"required":["id","uniqueId","previousUniqueId"],"additionalProperties":false,"description":"Who the event is about."},"metadata":{"type":"object","additionalProperties":{},"description":"Which door made the change and who: `source` and `changedBy`.","example":{"source":"api","changedBy":{"type":"api_key","name":"Bank CRM"}}},"test":{"type":"boolean","enum":[true],"description":"`true` when a test sent it. Absent on real work."}},"required":["event","timestamp","person","metadata"],"additionalProperties":false},"ActionWebhookEndpoint":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_-]+$","description":"Your id for the endpoint: letters, digits, `-` and `_`. Keep it the same to change an endpoint; a new id is a new endpoint with a new signing secret.","example":"crm-sync"},"label":{"type":"string","minLength":1,"maxLength":120,"description":"The name shown on the Defaults page.","example":"CRM sync"},"url":{"type":"string","maxLength":2048,"format":"uri","description":"Where deliveries go. `https` only.","example":"https://hooks.example.com/moxo"},"enabled":{"type":"boolean","description":"`false` keeps the endpoint but sends it nothing."},"events":{"type":"object","additionalProperties":{"type":"boolean"},"description":"Which events it gets, each `true` or `false`; a key left out is off. The action events: `actionSent`, `actionOpened`, `actionCompleted`, `actionDeclined`, `actionCancelled` (payload `WebhookEventPayload`, `action.sent`, …). With Partner unique ID: `userUniqueIdChanged` (payload `PersonWebhookEventPayload`, `user.unique_id_changed`). Deliveries are signed with `X-Moxo-Signature`.","example":{"actionSent":true,"actionCompleted":true,"userUniqueIdChanged":true}},"createdAt":{"type":"string","description":"When it was added (ISO 8601). Send back the value you read; a new endpoint takes any time you choose.","example":"2026-11-02T09:00:00.000Z"}},"required":["id","label","url","enabled","events","createdAt"],"additionalProperties":false},"WebhookTestResult":{"type":"object","properties":{"delivered":{"type":"boolean","description":"`true` when the receiver answered with a `2xx` status."},"status":{"type":"integer","description":"The receiver's HTTP status, or `0` when it could not be reached.","example":200},"body":{"type":"string","description":"The first 500 characters of the receiver's answer, or why it could not be reached."},"payload":{"type":"object","additionalProperties":{},"description":"The test delivery that was sent, in the shape of the webhook event payload (`WebhookEventPayload`), with `\"test\": true`."}},"required":["delivered","status","body","payload"],"additionalProperties":false},"RoleResolution":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["CONTACT_TBD"]}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["FLOW_STARTER"]}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["FIXED_CONTACT"]},"email":{"type":"string"},"phone":{"type":"string"},"emails":{"type":"array","items":{"type":"string"}},"userId":{"type":["string","null"],"description":"For a role set to one member of this organization: the person's public id (`usr_…`), as a change names them; null when they have none in this organization."},"userIds":{"type":"array","items":{"type":"string"},"description":"People with no email (added by `uniqueId` alone), by public id (`usr_…`). Held beside `emails`; the flow start assigns both. A person with an email is listed in `emails`."}},"required":["type"],"additionalProperties":false,"description":"Always the same person or people: by email (and phone), one member by `userId`, or by public id in `userIds` for someone with no email."},{"type":"object","properties":{"type":{"type":"string","enum":["EXPLICIT_USER"],"description":"Deprecated: the same as `FIXED_CONTACT` with `userId`."},"userId":{"type":["string","null"],"description":"The person's public id (`usr_…`); null when they have none in this organization."}},"required":["type","userId"],"additionalProperties":false,"deprecated":true,"description":"Deprecated: the same as `type: \"FIXED_CONTACT\"`. Still answered for data stored this way, so integrations built on it keep working; send `FIXED_CONTACT`."},{"type":"object","properties":{"type":{"type":"string","enum":["FLOW_INPUT"]},"inputKey":{"type":"string","description":"The key of the start field whose answer names the person."}},"required":["type","inputKey"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["KICKOFF_FORM_FIELD"]},"fieldKey":{"type":"string"}},"required":["type","fieldKey"],"additionalProperties":false,"description":"Works like `FLOW_INPUT`: `fieldKey` is the key of the start form field whose answer names the person."},{"type":"object","properties":{"type":{"type":"string","enum":["FLOW_VARIABLE"]},"variableKey":{"type":"string"}},"required":["type","variableKey"],"additionalProperties":false,"description":"Works like `FLOW_INPUT`, with the field named by `variableKey`."},{"type":"object","properties":{"type":{"type":"string","enum":["ROUND_ROBIN"]},"emails":{"type":"array","items":{"type":"string"}},"entries":{"type":"array","items":{"type":"object","properties":{"email":{"type":"string"},"phone":{"type":"string"}},"additionalProperties":false}},"userIds":{"type":"array","items":{"type":"string"},"description":"People with no email (added by `uniqueId` alone), by public id (`usr_…`), in the rotation beside `emails`."}},"required":["type"],"additionalProperties":false,"description":"Takes turns among a list of people, by email (and phone), or by public id in `userIds` for someone with no email."},{"type":"object","properties":{"type":{"type":"string","enum":["DESK"]},"deskId":{"type":"string","description":"The desk that fills the role (see `/v1/desks`). Empty when the person who starts the flow picks it."},"chooseAtStart":{"type":"boolean","description":"True when the person who starts the flow picks the desk."},"claim_scope":{"type":"string","enum":["action","role"],"description":"`action`: each step is claimed on its own. `role`: the first claim takes every step of this role in the flow."}},"required":["type"],"additionalProperties":false,"description":"Queued on a desk for one of its members to claim."},{"type":"object","properties":{"type":{"type":"string","enum":["ORG_CHART"]},"startFrom":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["FLOW_STARTER"]}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["ROLE"]},"roleId":{"type":"string"}},"required":["kind","roleId"],"additionalProperties":false}],"description":"Whose manager fills the role (with `levels`), or whose work it reviews (with `position`): the person who starts the flow, or the person in another role on this template."},"levels":{"type":"integer","minimum":1,"maximum":5,"description":"1 = their manager, 2 = their manager's manager, up to 5. Present when the role is filled by a manager; absent when it is filled by `position`."},"position":{"type":"object","properties":{"departmentId":{"type":"string"},"departmentName":{"type":"string"},"titleId":{"type":"string"},"titleName":{"type":"string"}},"required":["departmentId","titleId"],"additionalProperties":false,"description":"Present when the role is filled by everyone in a department with a title (a Controller in Finance), leaving out whose work it reviews; the first to act completes it. Names are as of the template's last save."}},"required":["type","startFrom"],"additionalProperties":false,"description":"Filled from the org chart: the manager of a person in the flow (`levels`), or everyone in a department with a title (`position`). A start request cannot set it."},{"type":"object","properties":{"type":{"type":"string","enum":["RULES"]},"config":{"type":"object","properties":{"source":{"type":"string","enum":["FLOW_INPUT","FLOW_VARIABLE","KICKOFF_FORM_FIELD","STEP_OUTPUT"]},"inputKey":{"type":"string"},"variableKey":{"type":"string"},"fieldKey":{"type":"string"},"stepOutputRef":{"type":"string"},"rules":{"type":"array","items":{"type":"object","properties":{"if":{"type":"object","properties":{"contains":{"type":"string"},"equals":{"type":"string"},"notEmpty":{"type":"boolean"}},"additionalProperties":false},"then":{"$ref":"#/components/schemas/RoleResolution"}},"required":["if","then"],"additionalProperties":false}},"default":{"$ref":"#/components/schemas/RoleResolution"}},"required":["source","rules","default"],"additionalProperties":false}},"required":["type","config"],"additionalProperties":false,"description":"The first rule whose condition matches the answer picks how the role is filled; otherwise `default`."}],"description":"How the role is filled. People are named by public id (`usr_…`) or email; fields by key."},"TemplateStep":{"type":"object","properties":{"stepId":{"type":"string","description":"The step's id in the template. It doesn't change.","example":"step-02b5045cb858"},"type":{"type":"string","enum":["FORM","QUESTIONNAIRE","POLL","FILE_REQUEST","TODO","CHECKLIST","APPROVAL","ACKNOWLEDGEMENT","WATCH_VIDEO","PACKET","DOCUMENT_REVIEW","DOCUMENT_COLLABORATION","PREPARE_DOCUMENT_BY_PERSON","ESIGN","DOCUSIGN","ADOBE_SIGN","JOTFORM","IDENTITY_VERIFICATION","COLLECT_PAYMENT","DECISION","CUSTOM_ACTION","CONVERSATION","WEB_APP","PREPARE_DOCUMENT","PDF_FORM","TIME_BOOKING","SINGLE_CHOICE_BRANCH","MULTI_CHOICE_BRANCH","PARALLEL_BRANCH","JUMP","TERMINATE","WAIT","FOR_EACH","REPEAT_WHILE","SUB_FLOW","BUILDING_BLOCK","AI_CUSTOM_PROMPT","AI_EXTRACT","AI_SUMMARIZE","AI_TRANSCRIBE","AI_TRANSLATE","AI_WRITE","AI_AGENT","SYSTEM_WEBHOOK","SYSTEM_EMAIL","SEND_ANNOUNCEMENT","SEND_TO_CONVERSATION","SYSTEM_UPDATE_FIELDS","DATA_TABLE_LOOKUP_RECORD","DATA_TABLE_SAVE_RECORD","UPDATE_SPREADSHEET","SYSTEM_UPDATE_FLOW_INFO","BUSINESS_RULE","MATH","CODE","FORMAT","REST_API","MCP_SERVER","EXTERNAL_APP","ASSIGN_ROLE","ADD_ROLE","UPDATE_USER","START_FLOW","SCHEDULE_FLOW"],"description":"The action type. Each type's settings are the `StepConfig_<TYPE>` schema. Every type:\n\n- `FORM`: Form, human action. Settings: `StepConfig_FORM`.\n- `QUESTIONNAIRE`: Questionnaire, human action. Settings: `StepConfig_QUESTIONNAIRE`.\n- `POLL`: Poll, human action. Settings: `StepConfig_POLL`.\n- `FILE_REQUEST`: File Request, human action. Settings: `StepConfig_FILE_REQUEST`.\n- `TODO`: To-Do, human action. Settings: `StepConfig_TODO`.\n- `CHECKLIST`: Checklist, human action. Settings: `StepConfig_CHECKLIST`. Coming soon.\n- `APPROVAL`: Approval, human action. Settings: `StepConfig_APPROVAL`.\n- `ACKNOWLEDGEMENT`: Acknowledgement, human action. Settings: `StepConfig_ACKNOWLEDGEMENT`.\n- `WATCH_VIDEO`: Watch video, human action. Settings: `StepConfig_WATCH_VIDEO`.\n- `PACKET`: Packet, human action. Settings: `StepConfig_PACKET`.\n- `DOCUMENT_REVIEW`: Document Review, human action. Settings: `StepConfig_DOCUMENT_REVIEW`.\n- `DOCUMENT_COLLABORATION`: Document Collaboration, human action. Settings: `StepConfig_DOCUMENT_COLLABORATION`.\n- `PREPARE_DOCUMENT_BY_PERSON`: Prepare document, human action. Settings: `StepConfig_PREPARE_DOCUMENT_BY_PERSON`.\n- `ESIGN`: E-Signature, human action. Settings: `StepConfig_ESIGN`.\n- `DOCUSIGN`: DocuSign, human action. Settings: `StepConfig_DOCUSIGN`.\n- `ADOBE_SIGN`: Adobe Acrobat Sign, human action. Settings: `StepConfig_ADOBE_SIGN`.\n- `JOTFORM`: Jotform, human action. Settings: `StepConfig_JOTFORM`.\n- `IDENTITY_VERIFICATION`: Identity verification, human action. Settings: `StepConfig_IDENTITY_VERIFICATION`.\n- `COLLECT_PAYMENT`: Collect Payment, human action. Settings: `StepConfig_COLLECT_PAYMENT`.\n- `DECISION`: Decision, human action. Settings: `StepConfig_DECISION`.\n- `CUSTOM_ACTION`: Custom Action, human action. Settings: `StepConfig_CUSTOM_ACTION`.\n- `CONVERSATION`: Goal, human action. Settings: `StepConfig_CONVERSATION`.\n- `WEB_APP`: Web App, human action. Settings: `StepConfig_WEB_APP`.\n- `PREPARE_DOCUMENT`: Prepare document, automation. Settings: `StepConfig_PREPARE_DOCUMENT`.\n- `PDF_FORM`: PDF Form, human action. Settings: `StepConfig_PDF_FORM`.\n- `TIME_BOOKING`: Time Booking, human action. Settings: `StepConfig_TIME_BOOKING`.\n- `SINGLE_CHOICE_BRANCH`: Single Choice Branch (If/Else), control. Settings: `StepConfig_SINGLE_CHOICE_BRANCH`.\n- `MULTI_CHOICE_BRANCH`: Multi Choice Branch, control. Settings: `StepConfig_MULTI_CHOICE_BRANCH`.\n- `PARALLEL_BRANCH`: Parallel Branch, control. Settings: `StepConfig_PARALLEL_BRANCH`.\n- `JUMP`: Jump, control. Settings: `StepConfig_JUMP`.\n- `TERMINATE`: Terminate, control. Settings: `StepConfig_TERMINATE`.\n- `WAIT`: Wait, control. Settings: `StepConfig_WAIT`.\n- `FOR_EACH`: For Each (Loop), control. Settings: `StepConfig_FOR_EACH`.\n- `REPEAT_WHILE`: Repeat while, control. Settings: `StepConfig_REPEAT_WHILE`.\n- `SUB_FLOW`: Sub Flow, control. Settings: `StepConfig_SUB_FLOW`.\n- `BUILDING_BLOCK`: Building block, control. Settings: `StepConfig_BUILDING_BLOCK`.\n- `AI_CUSTOM_PROMPT`: AI Custom Prompt, automation. Settings: `StepConfig_AI_CUSTOM_PROMPT`.\n- `AI_EXTRACT`: AI Extract, automation. Settings: `StepConfig_AI_EXTRACT`.\n- `AI_SUMMARIZE`: AI Summarize, automation. Settings: `StepConfig_AI_SUMMARIZE`.\n- `AI_TRANSCRIBE`: AI Transcribe, automation. Settings: `StepConfig_AI_TRANSCRIBE`.\n- `AI_TRANSLATE`: AI Translate, automation. Settings: `StepConfig_AI_TRANSLATE`.\n- `AI_WRITE`: AI Write, automation. Settings: `StepConfig_AI_WRITE`.\n- `AI_AGENT`: AI Agent, automation. Settings: `StepConfig_AI_AGENT`.\n- `SYSTEM_WEBHOOK`: Webhook, automation. Settings: `StepConfig_SYSTEM_WEBHOOK`.\n- `SYSTEM_EMAIL`: Send Email, automation. Settings: `StepConfig_SYSTEM_EMAIL`.\n- `SEND_ANNOUNCEMENT`: Send Announcement, automation. Settings: `StepConfig_SEND_ANNOUNCEMENT`.\n- `SEND_TO_CONVERSATION`: Send to Conversation, automation. Settings: `StepConfig_SEND_TO_CONVERSATION`.\n- `SYSTEM_UPDATE_FIELDS`: Update custom fields, automation. Settings: `StepConfig_SYSTEM_UPDATE_FIELDS`.\n- `DATA_TABLE_LOOKUP_RECORD`: Look up a record, automation. Settings: `StepConfig_DATA_TABLE_LOOKUP_RECORD`.\n- `DATA_TABLE_SAVE_RECORD`: Save a record, automation. Settings: `StepConfig_DATA_TABLE_SAVE_RECORD`.\n- `UPDATE_SPREADSHEET`: Update spreadsheet, automation. Settings: `StepConfig_UPDATE_SPREADSHEET`.\n- `SYSTEM_UPDATE_FLOW_INFO`: Update flow info, automation. Settings: `StepConfig_SYSTEM_UPDATE_FLOW_INFO`.\n- `BUSINESS_RULE`: Business Rule, automation. Settings: `StepConfig_BUSINESS_RULE`.\n- `MATH`: Calculate, automation. Settings: `StepConfig_MATH`.\n- `CODE`: Run code, automation. Settings: `StepConfig_CODE`.\n- `FORMAT`: Format data, automation. Settings: `StepConfig_FORMAT`.\n- `REST_API`: REST API, automation. Settings: `StepConfig_REST_API`.\n- `MCP_SERVER`: MCP Server, automation. Settings: `StepConfig_MCP_SERVER`.\n- `EXTERNAL_APP`: External App, automation. Settings: `StepConfig_EXTERNAL_APP`.\n- `ASSIGN_ROLE`: Assign Role, automation. Settings: `StepConfig_ASSIGN_ROLE`.\n- `ADD_ROLE`: Add Role, automation. Settings: `StepConfig_ADD_ROLE`.\n- `UPDATE_USER`: Update user, automation. Settings: `StepConfig_UPDATE_USER`.\n- `START_FLOW`: Start a flow, automation. Settings: `StepConfig_START_FLOW`.\n- `SCHEDULE_FLOW`: Schedule a flow, automation. Settings: `StepConfig_SCHEDULE_FLOW`.","example":"FORM"},"name":{"type":"string"},"description":{"type":["string","null"]},"assignees":{"type":"array","items":{"type":"object","properties":{"roleId":{"type":"string"},"roleName":{"type":["string","null"]}},"required":["roleId","roleName"]},"description":"The roles assigned to this step. Empty on a step no person does (an automation, a branch, a wait)."},"completion":{"type":["object","null"],"properties":{"mode":{"type":"string","enum":["ONE","MAJORITY","ALL"]}},"required":["mode"],"description":"An override of the roles' own completion settings, when the step sets one: `ONE` (any one person on any role), `MAJORITY` (more than half of everyone assigned across roles) or `ALL` (everyone on every role). `null` is no override: on a step with two or more roles, every role completes it at once, each by its own setting; on a step with one role, that role's setting decides (a role that sets none: everyone on an acknowledgement or a document review, else any one). Also `null` on every step no person does."},"milestone":{"type":["object","null"],"properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"config":{"type":"object","additionalProperties":{},"description":"The settings of this step's `type`, as documented by the `StepConfig_<TYPE>` schema for that type (for example `StepConfig_REST_API`), plus the shared settings every step can carry (due date, reminders, visibility, monitors). Path and outcome ids are returned as `id`, and every nested step is returned in this same `TemplateStep` shape. Some settings are sent in a different form when you change a template (roles by name, monitors without ids): see [Step fields in responses](/docs/guides/build-templates-from-code#step-fields-in-responses).\n\n**References.** Text that reads a value from earlier in the flow comes back as a `${{ }}` reference, the form a change list takes, such as `${{ steps.intake.fields.email }}` or `${{ roles.client.email }}`: a step, role or field by the key its template file gives it, else by its id; a flow field by its key; a Secret or tag group by its name (`${{ secrets['Acme API'].apiKey }}`). Sent back unchanged in a change list, it changes nothing. A reference to something the template no longer has keeps the id it stores, quoted (`${{ steps['step-02b5'].fields.email }}`), and publishing names it.\n\n**Steps inside other steps.** `steps[]` lists the top-level steps in order. A step that contains others keeps them inside its own `config`, each one a full `TemplateStep` (with its own `stepId`, `type`, `assignees` and `config`), nested as deep as the template is:\n\n- `SINGLE_CHOICE_BRANCH`, `MULTI_CHOICE_BRANCH`, `PARALLEL_BRANCH`: `config.paths`, and in each path its `steps` (each path has an `id`, a `label` and, for the choice branches, the `conditions` that pick it).\n- `DECISION`: `config.outcomes`, and in each outcome its `steps` (each outcome has an `id` and a `label`).\n- `APPROVAL`: `config.approveBranch.steps[]` and `config.rejectBranch.steps[]`, when the approval routes the flow.\n- `FOR_EACH`, `REPEAT_WHILE`: `config.steps[]`, the steps repeated each round.\n\nTo walk every step, visit `steps[]` and, for each step, the lists above. Example: a branch whose first path holds a form.\n\n```json\n{\n  \"stepId\": \"step-route\",\n  \"type\": \"SINGLE_CHOICE_BRANCH\",\n  \"name\": \"Route by customer type\",\n  \"assignees\": [],\n  \"completion\": null,\n  \"config\": {\n    \"paths\": [\n      {\n        \"id\": \"path-business\",\n        \"label\": \"Business\",\n        \"steps\": [\n          {\n            \"stepId\": \"step-kyb\",\n            \"type\": \"FORM\",\n            \"name\": \"Business details\",\n            \"description\": null,\n            \"assignees\": [{ \"roleId\": \"role-customer\", \"roleName\": \"Customer\" }],\n            \"completion\": null,\n            \"milestone\": null,\n            \"config\": { \"formFields\": [{ \"label\": \"Company number\", \"type\": \"TEXT_SINGLE_LINE\" }] }\n          }\n        ]\n      },\n      { \"id\": \"path-individual\", \"label\": \"Individual\", \"steps\": [] }\n    ]\n  }\n}\n```"},"typedInCredentials":{"type":"array","items":{"type":"string"},"description":"The settings of this step that hold a key or password someone typed in, rather than a Secret. Such a value is never returned: it reads `null` in `config`. A person moves it to a Secret (Manage → Connected apps), and the step then names that Secret by id (`GET /v1/connections` gives its name). Absent when there are none.","example":["Authorization"]}},"required":["stepId","type","name","description","assignees","completion","milestone","config"],"additionalProperties":false},"TemplateFolder":{"type":"object","properties":{"id":{"type":"string","description":"The folder's id: send it as `folderId` to `PUT /v1/templates/{id}/folder`."},"name":{"type":"string","description":"The folder's name, as the template library shows it.","example":"Onboarding"},"parentFolderId":{"type":["string","null"],"description":"The folder it is in; null at the top level."},"templateCount":{"type":"integer","description":"Flow templates you can see directly in it."},"totalTemplateCount":{"type":"integer","description":"Flow templates you can see in it or its subfolders."}},"required":["id","name","parentFolderId","templateCount","totalTemplateCount"],"additionalProperties":false},"TemplateFolderCreateBody":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":255,"description":"The folder's name, as the template library shows it. Spaces at either end are dropped.","example":"Onboarding"},"parentFolderId":{"type":["string","null"],"minLength":1,"description":"Make it inside this folder. Leave it out, or send null, for the top level. A folder 5 levels deep can't hold a folder (`FOLDER_TOO_DEEP`)."}},"required":["name"],"additionalProperties":false},"TemplateFolderChangeBody":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":255,"description":"The folder's name, as the template library shows it. Spaces at either end are dropped.","example":"Onboarding"},"parentFolderId":{"type":["string","null"],"minLength":1,"description":"Move the folder, with everything in it, into this folder. Leave it out to keep it where it is; send null to move it to the top level. Refused into itself or one of its own folders (`FOLDER_CYCLE`), or past 5 levels (`FOLDER_TOO_DEEP`)."}},"additionalProperties":false},"EmailStartBody":{"type":"object","properties":{"paused":{"type":"boolean","description":"`true` pauses the email start: its address stops starting flows and keeps its conditions and mapping. `false` resumes it and turns Start by email on if it is off.","example":true}},"required":["paused"],"additionalProperties":false},"EmailStart":{"type":"object","properties":{"startByEmail":{"type":"boolean","description":"The template's Start by email setting is on."},"paused":{"type":"boolean","description":"The email start is paused: mail to its address starts no flow. Mail starts flows when `startByEmail` is true and `paused` is false."}},"required":["startByEmail","paused"],"additionalProperties":false,"description":"Whether the template starts by email, and whether that start is paused."},"EmailStartChange":{"type":"object","properties":{"startByEmail":{"type":"boolean","description":"The template's Start by email setting is on."},"paused":{"type":"boolean","description":"The email start is paused: mail to its address starts no flow. Mail starts flows when `startByEmail` is true and `paused` is false."},"supportedStartModes":{"type":"array","items":{"type":"string"},"description":"The template's start modes that are on after the change, as `PATCH /v1/templates/{id}/trigger-activation` answers them."},"disabledStartModes":{"type":"array","items":{"type":"string"},"description":"The template's start modes that are paused after the change."}},"required":["startByEmail","paused","supportedStartModes","disabledStartModes"],"additionalProperties":false,"description":"The email start after the change, with the template's start modes as the change left them (another change made meanwhile included)."},"TemplatePublisher":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["person"]},"id":{"type":"string","description":"The person's user id (`usr_` prefix), as on `User`.","example":"usr_123"},"name":{"type":"string"},"email":{"type":["string","null"]}},"required":["kind","id","name","email"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["api_key"]},"id":{"type":"string","description":"The organization API key's id."},"name":{"type":"string","description":"The key's name, as set in Settings → API keys."}},"required":["kind","id","name"],"additionalProperties":false}],"description":"Who published the live version: `person` (a person) or `api_key` (an organization API key)."},"DependencyAction":{"type":"object","properties":{"stepId":{"type":"string"},"name":{"type":"string"}},"required":["stepId","name"],"additionalProperties":false,"description":"A step that uses it."},"TemplateDependency":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["connection"]},"id":{"type":"string"},"type":{"type":["string","null"],"enum":["app","ai","secret","mcp",null],"description":"`app`: an app account. `ai`: an AI provider. `secret`: a Secret. `mcp`: an MCP server."},"name":{"type":["string","null"],"description":"Null for a connection you cannot see in Connected Apps."},"actions":{"type":"array","items":{"$ref":"#/components/schemas/DependencyAction"},"description":"The steps that use it. Empty when only a template setting or the start form does."}},"required":["kind","id","type","name","actions"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["host"]},"host":{"type":["string","null"],"description":"The host that a REST API step, an outgoing webhook or a monitor that fires a webhook calls. Null when the address is built from an answer in the flow."},"dynamic":{"type":"boolean","description":"True when the address is built from an answer in the flow, so it cannot be named."},"actions":{"type":"array","items":{"$ref":"#/components/schemas/DependencyAction"},"description":"The steps that use it. Empty when only a template setting or the start form does."}},"required":["kind","host","dynamic","actions"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["agent"]},"id":{"type":"string"},"name":{"type":["string","null"],"description":"Null for someone who cannot open AI agents."},"uses":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["connection"]},"id":{"type":"string"},"type":{"type":"string","enum":["app","ai","secret","mcp"],"description":"`app`: an app account. `ai`: an AI provider. `secret`: a Secret. `mcp`: an MCP server."},"name":{"type":"string"}},"required":["kind","id","type","name"],"additionalProperties":false},"description":"The connections this agent’s tools use, among those you can see."},"actions":{"type":"array","items":{"$ref":"#/components/schemas/DependencyAction"},"description":"The steps that use it. Empty when only a template setting or the start form does."}},"required":["kind","id","name","uses","actions"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["template"]},"id":{"type":"string"},"name":{"type":["string","null"],"description":"Null for a template you cannot open."},"startedByKind":{"type":"string","enum":["sub_flow","start_flow","scheduled","building_block"],"description":"How this template starts or includes it: `sub_flow`, `start_flow`, `scheduled` or `building_block`."},"actions":{"type":"array","items":{"$ref":"#/components/schemas/DependencyAction"},"description":"The steps that use it. Empty when only a template setting or the start form does."}},"required":["kind","id","name","startedByKind","actions"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["data_table"]},"id":{"type":"string"},"name":{"type":["string","null"],"description":"Null for someone who cannot open data tables."},"actions":{"type":"array","items":{"$ref":"#/components/schemas/DependencyAction"},"description":"The steps that use it. Empty when only a template setting or the start form does."}},"required":["kind","id","name","actions"],"additionalProperties":false}],"description":"Something a template uses. By name and id, never a credential."},"TemplateSummary":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"status":{"type":"string","enum":["ACTIVE","DRAFT","ARCHIVED"]},"version":{"type":"integer","description":"The published version number, as the builder's Version history shows it. A template never published is version 1. Not the draft revision, which change and publish results name `draftRevision`.","example":3},"kind":{"type":"string","enum":["process","action"],"description":"What kind of run this template starts. A `process` template starts a multi-step flow through `POST /v1/templates/{id}/start`. An `action` template is one saved request (a signature, an approval, a form, a file), kept with its wording and its named recipients so it goes out the same way every time. Send it with `POST /v1/actions`; `/start` accepts process templates only.","example":"process"},"coverImageUrl":{"type":["string","null"]},"folder":{"type":["object","null"],"properties":{"id":{"type":"string","description":"The folder's id, as `GET /v1/template-folders` lists it."},"name":{"type":"string","description":"The folder's name."}},"required":["id","name"],"additionalProperties":false,"description":"The folder the template is in, or null when it is in none."},"totalSteps":{"type":"integer","description":"Every step, including steps inside branches, decisions and loops."},"hasUnpublishedChanges":{"type":"boolean"},"startLink":{"type":["object","null"],"properties":{"url":{"type":"string"},"embedId":{"type":"string"},"initiatorRole":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]}},"required":["url","embedId","initiatorRole"],"additionalProperties":false},"isBuildingBlock":{"type":"boolean"},"permissions":{"type":"object","properties":{"owners":{"type":"object","properties":{"type":{"type":"string","enum":["EXPLICIT_USERS","ALL_MEMBERS","ADMINS_ONLY","PERMISSION_GROUP"]},"users":{"type":"array","items":{"$ref":"#/components/schemas/User"},"description":"Populated when `type` is `EXPLICIT_USERS`; absent otherwise."}},"required":["type"],"additionalProperties":false},"editors":{"type":"object","properties":{"type":{"type":"string","enum":["EXPLICIT_USERS","ALL_MEMBERS","ADMINS_ONLY","PERMISSION_GROUP"]},"users":{"type":"array","items":{"$ref":"#/components/schemas/User"},"description":"Populated when `type` is `EXPLICIT_USERS`; absent otherwise."}},"required":["type"],"additionalProperties":false},"initiators":{"type":"object","properties":{"type":{"type":"string","enum":["EXPLICIT_USERS","ALL_MEMBERS","ADMINS_ONLY","PERMISSION_GROUP"]},"users":{"type":"array","items":{"$ref":"#/components/schemas/User"},"description":"Populated when `type` is `EXPLICIT_USERS`; absent otherwise."}},"required":["type"],"additionalProperties":false}},"required":["owners","editors","initiators"],"additionalProperties":false},"createdAt":{"type":"string","format":"date-time"},"createdBy":{"anyOf":[{"$ref":"#/components/schemas/User"},{"type":"null"}]},"updatedAt":{"type":"string","format":"date-time"},"publishedAt":{"type":["string","null"],"format":"date-time","description":"When the live version was published. Null for a draft or an archived template."},"publishedBy":{"anyOf":[{"$ref":"#/components/schemas/TemplatePublisher"},{"type":"null"}],"description":"Who published the live version: a person or an organization API key. Null for a draft or an archived template."},"runningFlows":{"type":"integer","description":"With `uses` only: the flows from this template that haven't finished and whose steps use it, among the flows you can open."},"uses":{"type":"array","items":{"$ref":"#/components/schemas/DependencyAction"},"description":"With `uses` only: the steps that use it."},"canEdit":{"type":"boolean","description":"With `uses` only: whether you can change this template."},"lastChangedAt":{"type":["string","null"],"format":"date-time","description":"On an `updatedSince` list only: the time of the template’s latest publish, to the microsecond.","example":"2026-10-22T09:30:11.020Z"}},"required":["id","name","description","status","version","kind","coverImageUrl","folder","totalSteps","hasUnpublishedChanges","startLink","isBuildingBlock","permissions","createdAt","createdBy","updatedAt","publishedAt","publishedBy"],"additionalProperties":false},"TemplateDetail":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"status":{"type":"string","enum":["ACTIVE","DRAFT","ARCHIVED"]},"version":{"type":"integer","description":"The published version number, as the builder's Version history shows it. A template never published is version 1. Not the draft revision, which change and publish results name `draftRevision`.","example":3},"kind":{"type":"string","enum":["process","action"],"description":"What kind of run this template starts. A `process` template starts a multi-step flow through `POST /v1/templates/{id}/start`. An `action` template is one saved request (a signature, an approval, a form, a file), kept with its wording and its named recipients so it goes out the same way every time. Send it with `POST /v1/actions`; `/start` accepts process templates only.","example":"process"},"coverImageUrl":{"type":["string","null"]},"folder":{"type":["object","null"],"properties":{"id":{"type":"string","description":"The folder's id, as `GET /v1/template-folders` lists it."},"name":{"type":"string","description":"The folder's name."}},"required":["id","name"],"additionalProperties":false,"description":"The folder the template is in, or null when it is in none."},"totalSteps":{"type":"integer","description":"Every step, including steps inside branches, decisions and loops."},"hasUnpublishedChanges":{"type":"boolean"},"startLink":{"type":["object","null"],"properties":{"url":{"type":"string"},"embedId":{"type":"string"},"initiatorRole":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]}},"required":["url","embedId","initiatorRole"],"additionalProperties":false},"isBuildingBlock":{"type":"boolean"},"permissions":{"type":"object","properties":{"owners":{"type":"object","properties":{"type":{"type":"string","enum":["EXPLICIT_USERS","ALL_MEMBERS","ADMINS_ONLY","PERMISSION_GROUP"]},"users":{"type":"array","items":{"$ref":"#/components/schemas/User"},"description":"Populated when `type` is `EXPLICIT_USERS`; absent otherwise."}},"required":["type"],"additionalProperties":false},"editors":{"type":"object","properties":{"type":{"type":"string","enum":["EXPLICIT_USERS","ALL_MEMBERS","ADMINS_ONLY","PERMISSION_GROUP"]},"users":{"type":"array","items":{"$ref":"#/components/schemas/User"},"description":"Populated when `type` is `EXPLICIT_USERS`; absent otherwise."}},"required":["type"],"additionalProperties":false},"initiators":{"type":"object","properties":{"type":{"type":"string","enum":["EXPLICIT_USERS","ALL_MEMBERS","ADMINS_ONLY","PERMISSION_GROUP"]},"users":{"type":"array","items":{"$ref":"#/components/schemas/User"},"description":"Populated when `type` is `EXPLICIT_USERS`; absent otherwise."}},"required":["type"],"additionalProperties":false}},"required":["owners","editors","initiators"],"additionalProperties":false},"createdAt":{"type":"string","format":"date-time"},"createdBy":{"anyOf":[{"$ref":"#/components/schemas/User"},{"type":"null"}]},"updatedAt":{"type":"string","format":"date-time"},"publishedAt":{"type":["string","null"],"format":"date-time","description":"When the live version was published. Null for a draft or an archived template."},"publishedBy":{"anyOf":[{"$ref":"#/components/schemas/TemplatePublisher"},{"type":"null"}],"description":"Who published the live version: a person or an organization API key. Null for a draft or an archived template."},"runningFlows":{"type":"integer","description":"With `uses` only: the flows from this template that haven't finished and whose steps use it, among the flows you can open."},"uses":{"type":"array","items":{"$ref":"#/components/schemas/DependencyAction"},"description":"With `uses` only: the steps that use it."},"canEdit":{"type":"boolean","description":"With `uses` only: whether you can change this template."},"lastChangedAt":{"type":["string","null"],"format":"date-time","description":"On an `updatedSince` list only: the time of the template’s latest publish, to the microsecond.","example":"2026-10-22T09:30:11.020Z"},"copy":{"type":"string","enum":["working","published"],"description":"Which copy of the template this read shows. `published`: the live copy, what a start uses (the default). `working`: the working copy, the one `POST /v1/templates/{id}/changes` changes and publishing makes live, read with `copy=working`, or by default for a template never published. The two differ when `hasUnpublishedChanges` is true. `GET /v1/templates/{id}/versions/{versionId}` reads any published version.","example":"published"},"draftRevision":{"type":["integer","null"],"description":"Only on a `copy=working` read: the working copy's revision, to send as `baseVersion` to `POST /v1/templates/{id}/changes`. A part of that read sent back unchanged changes nothing. Null on any other read.","example":12},"flowName":{"type":["string","null"],"description":"The pattern that names flows started from this template. It can include dynamic data, such as an answer from the start form, as a `${{ }}` reference (`${{ fields.client_name }}`)."},"roles":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The role's id in the template. It doesn't change."},"name":{"type":"string","description":"The role's name."},"resolution":{"$ref":"#/components/schemas/RoleResolution"},"options":{"type":"object","properties":{"managerToggle":{"type":"boolean"},"viewerOnly":{"type":"boolean"},"allowViewAllActions":{"type":"boolean"},"allowViewAutomations":{"type":"boolean"},"cardinality":{"type":"string","enum":["single","multi"],"description":"`single`: one person fills the role. `multi`: one or more people. Absent reads as `multi`."},"completionMode":{"type":"string","enum":["ONE","MAJORITY","ALL"],"description":"When several people fill the role, how many must finish its steps: `ONE` (any one), `MAJORITY` or `ALL`. A step can set its own."},"viewMode":{"type":"string","enum":["SPOTLIGHT","GALLERY"],"description":"How the role sees its steps: `SPOTLIGHT` (one at a time) or `GALLERY` (all at once)."}},"additionalProperties":false}},"required":["id","name","resolution","options"],"additionalProperties":false}},"milestones":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"stepIds":{"type":"array","items":{"type":"string"}}},"required":["id","name","description","stepIds"],"additionalProperties":false}},"customFields":{"type":"array","items":{"$ref":"#/components/schemas/TemplateCustomField"},"description":"The template's flow fields, without values. On `GET /v1/flows/{id}`, each flow field also has its `value`."},"stepStatuses":{"type":"array","items":{"$ref":"#/components/schemas/StepStatus"},"description":"The template's own step statuses, in order: what a step's `customStatus` is drawn from, and the keys `PUT /v1/flows/{id}/steps/{stepId}/custom-status` accepts. Empty when it has none. A flow keeps the list it started with."},"definition":{"type":"object","properties":{"fields":{"type":"array","items":{"$ref":"#/components/schemas/TemplateCustomField"},"description":"The same list as `customFields`."}},"required":["fields"],"additionalProperties":false,"deprecated":true,"description":"Deprecated: the template's flow fields, as `definition.fields`, the same as `customFields`. Read `customFields`; this field is still sent so integrations built on it keep working."},"steps":{"type":"array","items":{"$ref":"#/components/schemas/TemplateStep"}},"agents":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]}},"required":["id","name","description"]}},"dueDates":{"type":"object","properties":{"flowDue":{"type":["object","null"],"properties":{"type":{"type":"string","enum":["RELATIVE","FIXED"],"description":"`RELATIVE`: due a set time after the flow starts. `FIXED`: due on one date."},"unit":{"type":"string","description":"For `RELATIVE`: `HOURS`, `DAYS` or `WEEKS`."},"value":{"anyOf":[{"type":"number"},{"type":"string"}],"description":"For `RELATIVE`: how many `unit`s after the flow starts."},"date":{"type":"string","description":"For `FIXED`: the date the flow is due."}},"required":["type"],"description":"When a flow from this template is due. `null` when it has no due date."}},"required":["flowDue"],"additionalProperties":false},"supportedStartModes":{"type":"array","items":{"type":"string","enum":["MANUAL","START_LINK","WEBHOOK","EMAIL","APP"]},"description":"The ways a flow can start from the live template that are on now. `MANUAL` is always on. The same list `PATCH /v1/templates/{id}/trigger-activation` sets.","example":["MANUAL","WEBHOOK"]},"disabledStartModes":{"type":"array","items":{"type":"string","enum":["MANUAL","START_LINK","WEBHOOK","EMAIL","APP"]},"description":"Ways of starting that are set up but paused: their settings are kept, and they start no flow until turned on again.","example":[]},"aiEscalations":{"type":"object","properties":{"roleId":{"type":["string","null"],"description":"A role on this template that manages the flow (`roles[].id`). `null`: the flow's managers, then the template's owners, then the admins."},"deskId":{"type":["string","null"],"description":"A team desk instead of a role: the hand-off waits in that desk's queue until someone on it claims it. `null` when a role or the default path is set."}},"required":["roleId","deskId"],"additionalProperties":false,"description":"Template settings › AI escalations: who an AI agent on this template hands work it cannot finish to, unless a step names its own role (`aiEscalation.roleId`). A live setting: set with `update_settings` (`fields.aiEscalations`); it applies at once, to running flows too."},"dependencies":{"type":"array","items":{"$ref":"#/components/schemas/TemplateDependency"},"description":"With `expand=dependencies` only: every connection, outside address, AI agent, sub-template and data table this template uses."}},"required":["id","name","description","status","version","kind","coverImageUrl","folder","totalSteps","hasUnpublishedChanges","startLink","isBuildingBlock","permissions","createdAt","createdBy","updatedAt","publishedAt","publishedBy","copy","draftRevision","flowName","roles","milestones","customFields","stepStatuses","steps","agents","dueDates","supportedStartModes","disabledStartModes","aiEscalations"],"additionalProperties":false},"PublishTemplateRequest":{"type":"object","properties":{"changeNote":{"type":"string","minLength":1,"maxLength":1000,"description":"What this version changes, in your words. Stored on the version and shown wherever its version is read (`changeNote` on `GET /v1/templates/{id}/versions`).","example":"Adds the kickoff call."}},"additionalProperties":false},"DuplicateTemplateRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":500,"description":"The new draft's name. Defaults to \"<original name> (Copy)\".","example":"Acme onboarding"}},"additionalProperties":false},"TemplateImportUploadRequest":{"type":"object","properties":{"fileName":{"type":"string","minLength":1,"maxLength":255,"example":"customer-onboarding.moxo"},"fileSize":{"type":"integer","minimum":0,"description":"Size in bytes.","example":48213},"mimeType":{"type":"string","minLength":1,"maxLength":255,"example":"application/octet-stream"}},"required":["fileName","fileSize","mimeType"]},"TemplateImportRequest":{"type":"object","properties":{"fileId":{"type":"string","minLength":1,"description":"The `fileId` from `POST /v1/templates/import-init`, after the file was uploaded."},"folderId":{"type":["string","null"],"minLength":1,"description":"Put the new template in this folder."}},"required":["fileId"],"additionalProperties":false,"description":"The draft takes the name in the file. To rename it, call `PATCH /v1/templates/{id}` after the import."},"TemplateImportResult":{"type":"object","properties":{"id":{"type":"string","description":"The new template's id. It is a draft, and you own it."},"name":{"type":"string"},"status":{"type":"string","enum":["DRAFT"]},"agentIds":{"type":"array","items":{"type":"string"},"description":"Draft agents created from a `.moxo-bundle`. Empty for a `.moxo` file."},"configWarnings":{"type":"array","items":{"type":"string"},"description":"What to reconnect or set up before publishing, in plain language: connected apps, Secrets, agents, email starts and app starts. Credentials are never in the file.","example":["Reconnect HubSpot in the \"Create deal\" action."]}},"required":["id","name","status","agentIds","configWarnings"],"additionalProperties":false},"PublishWarning":{"type":"object","properties":{"severity":{"type":"string","enum":["warning"],"description":"Always `warning`: the template published."},"rule":{"type":"string","description":"What the warning is about, as a stable code, for example `ESCALATION_OFF_FOR_ORG`.","example":"ESCALATION_OFF_FOR_ORG"},"stepName":{"type":"string","description":"The step it is about, by name."},"stepId":{"type":["string","null"],"description":"The step's id, when it is about one step."},"path":{"type":"string","description":"The setting it is about, inside the template."},"message":{"type":"string","description":"What to know, and what to do about it."}},"required":["severity","stepName","message"],"description":"Something that publishes but may not do what you expect."},"DeleteTemplateResult":{"anyOf":[{"type":"object","properties":{"deleted":{"type":"boolean","enum":[true]}},"required":["deleted"],"additionalProperties":false,"description":"The template is deleted."},{"type":"object","properties":{"requiresConfirmation":{"type":"boolean","enum":[true]},"inProgressFlowCount":{"type":"integer","description":"Flows still running from this template. They keep running after the delete."},"dataTableTriggerCount":{"type":"integer","description":"Data table triggers that would stop starting flows."},"activeScheduleCount":{"type":"integer","description":"Schedules that would stop starting flows."},"templateName":{"type":"string"}},"required":["requiresConfirmation","inProgressFlowCount","dataTableTriggerCount","activeScheduleCount","templateName"],"additionalProperties":false,"description":"Nothing was deleted. Repeat the call with `?force=true` to delete anyway."}]},"TemplateVersion":{"type":"object","properties":{"id":{"type":"string","description":"The version's id, for `GET …/versions/{versionId}` and restore. A publish from before every publish was kept has the id `history:<version>` and no content.","example":"7b2f0c1e-3a4d-4b5e-9f60-1a2b3c4d5e6f"},"version":{"type":"integer","description":"The published version number: the same number as the template's `version` and the builder's Version history.","example":3},"isCurrent":{"type":"boolean","description":"True for the version that is live now. Exactly one entry is current on a published template; none on a draft or an archived one."},"publishedAt":{"type":["string","null"],"format":"date-time"},"publishedBy":{"anyOf":[{"$ref":"#/components/schemas/TemplatePublisher"},{"type":"null"}],"description":"Who published this version: a person or an organization API key. Null when it was not recorded."},"flowCount":{"type":"integer","description":"Flows that ran this version (sandbox and sample flows left out)."},"changeNote":{"type":["string","null"]},"source":{"type":"string","enum":["builder","api","mcp","ai_generation","agent_attach","system","recorded_at_first_use"],"description":"Where the publish came from: the builder, the REST API, MCP, the AI builder, adding an agent, or the system (`system`). `recorded_at_first_use` marks a version published before every publish was kept."},"systemReason":{"type":["string","null"],"description":"For a `system` version: the reason for it. Null otherwise."},"restorable":{"type":"boolean","description":"False for a publish whose content was never kept (published before every publish was kept, and no flow ever ran it): it is listed for the record and cannot be restored or read."}},"required":["id","version","isCurrent","publishedAt","publishedBy","flowCount","changeNote","source","systemReason","restorable"],"additionalProperties":false,"description":"One published version. Every publish is kept, newest first. A publish from before every publish was kept, that no flow ever ran, is listed with its date and publisher only (`restorable: false`)."},"TemplateVersionDetail":{"type":"object","properties":{"id":{"type":"string","description":"The version's id, for `GET …/versions/{versionId}` and restore. A publish from before every publish was kept has the id `history:<version>` and no content.","example":"7b2f0c1e-3a4d-4b5e-9f60-1a2b3c4d5e6f"},"version":{"type":"integer","description":"The published version number: the same number as the template's `version` and the builder's Version history.","example":3},"isCurrent":{"type":"boolean","description":"True for the version that is live now. Exactly one entry is current on a published template; none on a draft or an archived one."},"publishedAt":{"type":["string","null"],"format":"date-time"},"publishedBy":{"anyOf":[{"$ref":"#/components/schemas/TemplatePublisher"},{"type":"null"}],"description":"Who published this version: a person or an organization API key. Null when it was not recorded."},"flowCount":{"type":"integer","description":"Flows that ran this version (sandbox and sample flows left out)."},"changeNote":{"type":["string","null"]},"source":{"type":"string","enum":["builder","api","mcp","ai_generation","agent_attach","system","recorded_at_first_use"],"description":"Where the publish came from: the builder, the REST API, MCP, the AI builder, adding an agent, or the system (`system`). `recorded_at_first_use` marks a version published before every publish was kept."},"systemReason":{"type":["string","null"],"description":"For a `system` version: the reason for it. Null otherwise."},"restorable":{"type":"boolean","description":"False for a publish whose content was never kept (published before every publish was kept, and no flow ever ran it): it is listed for the record and cannot be restored or read."},"flowName":{"type":["string","null"],"description":"The pattern that names flows started from this template. It can include dynamic data, such as an answer from the start form, as a `${{ }}` reference (`${{ fields.client_name }}`)."},"roles":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The role's id in the template. It doesn't change."},"name":{"type":"string","description":"The role's name."},"resolution":{"$ref":"#/components/schemas/RoleResolution"},"options":{"type":"object","properties":{"managerToggle":{"type":"boolean"},"viewerOnly":{"type":"boolean"},"allowViewAllActions":{"type":"boolean"},"allowViewAutomations":{"type":"boolean"},"cardinality":{"type":"string","enum":["single","multi"],"description":"`single`: one person fills the role. `multi`: one or more people. Absent reads as `multi`."},"completionMode":{"type":"string","enum":["ONE","MAJORITY","ALL"],"description":"When several people fill the role, how many must finish its steps: `ONE` (any one), `MAJORITY` or `ALL`. A step can set its own."},"viewMode":{"type":"string","enum":["SPOTLIGHT","GALLERY"],"description":"How the role sees its steps: `SPOTLIGHT` (one at a time) or `GALLERY` (all at once)."}},"additionalProperties":false}},"required":["id","name","resolution","options"],"additionalProperties":false}},"milestones":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"stepIds":{"type":"array","items":{"type":"string"}}},"required":["id","name","description","stepIds"],"additionalProperties":false}},"customFields":{"type":"array","items":{"$ref":"#/components/schemas/TemplateCustomField"},"description":"The template's flow fields, without values. On `GET /v1/flows/{id}`, each flow field also has its `value`."},"steps":{"type":"array","items":{"$ref":"#/components/schemas/TemplateStep"}},"agents":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]}},"required":["id","name","description"]}},"dueDates":{"type":"object","properties":{"flowDue":{"type":["object","null"],"properties":{"type":{"type":"string","enum":["RELATIVE","FIXED"],"description":"`RELATIVE`: due a set time after the flow starts. `FIXED`: due on one date."},"unit":{"type":"string","description":"For `RELATIVE`: `HOURS`, `DAYS` or `WEEKS`."},"value":{"anyOf":[{"type":"number"},{"type":"string"}],"description":"For `RELATIVE`: how many `unit`s after the flow starts."},"date":{"type":"string","description":"For `FIXED`: the date the flow is due."}},"required":["type"],"description":"When a flow from this template is due. `null` when it has no due date."}},"required":["flowDue"],"additionalProperties":false},"permissions":{"type":"object","properties":{"owners":{"type":"object","properties":{"type":{"type":"string","enum":["EXPLICIT_USERS","ALL_MEMBERS","ADMINS_ONLY","PERMISSION_GROUP"]},"users":{"type":"array","items":{"$ref":"#/components/schemas/User"},"description":"Populated when `type` is `EXPLICIT_USERS`; absent otherwise."}},"required":["type"],"additionalProperties":false},"editors":{"type":"object","properties":{"type":{"type":"string","enum":["EXPLICIT_USERS","ALL_MEMBERS","ADMINS_ONLY","PERMISSION_GROUP"]},"users":{"type":"array","items":{"$ref":"#/components/schemas/User"},"description":"Populated when `type` is `EXPLICIT_USERS`; absent otherwise."}},"required":["type"],"additionalProperties":false},"initiators":{"type":"object","properties":{"type":{"type":"string","enum":["EXPLICIT_USERS","ALL_MEMBERS","ADMINS_ONLY","PERMISSION_GROUP"]},"users":{"type":"array","items":{"$ref":"#/components/schemas/User"},"description":"Populated when `type` is `EXPLICIT_USERS`; absent otherwise."}},"required":["type"],"additionalProperties":false}},"required":["owners","editors","initiators"],"additionalProperties":false},"stepStatuses":{"type":"array","items":{"$ref":"#/components/schemas/StepStatus"},"description":"The template's own step statuses, in order: what a step's `customStatus` is drawn from, and the keys `PUT /v1/flows/{id}/steps/{stepId}/custom-status` accepts. Empty when it has none. A flow keeps the list it started with."}},"required":["id","version","isCurrent","publishedAt","publishedBy","flowCount","changeNote","source","systemReason","restorable","flowName","roles","milestones","customFields","steps","agents","dueDates","permissions","stepStatuses"],"additionalProperties":false,"description":"One published version and its content, in the shape of the template detail."},"TemplateKeptDraft":{"type":"object","properties":{"id":{"type":"string","description":"The kept draft, `kept:<id>`. Restore it with `POST /v1/templates/{id}/versions/{versionId}/restore` to undo the restore that replaced it; compare it with `GET …/versions/{versionId}/compare`."},"keptAt":{"type":"string","description":"When a restore replaced it."},"author":{"type":["object","null"],"properties":{"id":{"type":"string","description":"The person's public id."},"name":{"type":["string","null"],"description":"Their name in this organization."}},"required":["id","name"],"additionalProperties":false,"description":"Who wrote the draft, when known. Never the person who restored."}},"required":["id","keptAt","author"],"additionalProperties":false,"description":"A draft a restore replaced, kept so the restore can be undone. Kept for at least 30 days."},"TemplateVersionChanges":{"type":"object","properties":{"target":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["version"],"description":"A published version."},"versionId":{"type":"string","description":"The version compared, as `GET /v1/templates/{id}/versions` lists it."},"version":{"type":"integer","description":"Its version number."}},"required":["kind","versionId","version"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["kept_draft"],"description":"A draft a restore replaced and kept."},"keptDraftId":{"type":"string","description":"Its id, `kept:<id>`, as `GET /v1/templates/{id}/kept-drafts` lists it."},"keptAt":{"type":"string","description":"When the restore replaced it."}},"required":["kind","keptDraftId","keptAt"],"additionalProperties":false}],"description":"What is compared: a published version, or a draft a restore kept."},"against":{"type":"string","enum":["draft","live"],"description":"What the version is compared with: the draft for a person who can edit the template; what is live for anyone else."},"same":{"type":"boolean","description":"True when restoring the version would change nothing."},"restoreRefused":{"type":["object","null"],"properties":{"message":{"type":"string","description":"Why, in plain words."}},"required":["message"],"additionalProperties":false,"description":"Why a restore of this version would be refused, when it would be. The changes are still listed."},"steps":{"type":"object","properties":{"changed":{"type":"array","items":{"type":"object","properties":{"stepId":{"type":"string","description":"The step's permanent id, the same in every version."},"name":{"type":"string","description":"The step's name."},"type":{"type":"string","description":"The step's type, for example `FORM` or `ESIGN`."},"counts":{"type":"object","additionalProperties":{"type":"object","properties":{"added":{"type":"integer","description":"How many a restore adds."},"removed":{"type":"integer","description":"How many a restore removes."},"changed":{"type":"integer","description":"How many a restore changes."},"moved":{"type":"integer","description":"How many a restore moves."}},"required":["added","removed","changed","moved"],"additionalProperties":false},"description":"How many form fields, document fields, checklist items or settings change, by section."},"mostlyRebuilt":{"type":"boolean","description":"True when its type changed or fewer than half of its fields or checklist items are still there (an edited one is still there): show that first."},"typeChanged":{"type":["object","null"],"properties":{"from":{"type":"string","description":"The step's type in the draft."},"to":{"type":"string","description":"Its type in the version."}},"required":["from","to"],"additionalProperties":false,"description":"The step's type, when the restore changes it."},"lines":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["value"],"description":"A value changed."},"section":{"type":["string","null"],"description":"Where the change sits: `fields`, `document`, `document_fields`, `checklist_items`, `settings`, `flow_start`, a template area, or null for the step itself."},"item":{"type":"string","enum":["step","setting","assignee","field","option","document","document_field","checklist_item","template_setting"],"description":"What changed: the step, one of its settings, its assignees, a form field, an option, the document, a field on the document, a checklist item, or a template setting."},"label":{"type":"string","description":"The name of what changed, as the template names it (a field label, an option, a setting)."},"parent":{"type":"string","description":"For an option: the field it belongs to."},"property":{"type":["string","null"],"description":"Which property of the item changed (for example `name`, `label`, `required`), or null when the item is the value itself."},"from":{"type":"string","description":"What the draft has now."},"to":{"type":"string","description":"What the version has: what a restore puts back."}},"required":["kind","section","item","label","property","from","to"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["edited_text"],"description":"Long text was edited (over 120 characters, or more than one line). Show it folded."},"section":{"type":["string","null"],"description":"Where the change sits: `fields`, `document`, `document_fields`, `checklist_items`, `settings`, `flow_start`, a template area, or null for the step itself."},"item":{"type":"string","enum":["step","setting","assignee","field","option","document","document_field","checklist_item","template_setting"],"description":"What changed: the step, one of its settings, its assignees, a form field, an option, the document, a field on the document, a checklist item, or a template setting."},"label":{"type":"string","description":"The name of what changed, as the template names it (a field label, an option, a setting)."},"parent":{"type":"string","description":"For an option: the field it belongs to."},"property":{"type":["string","null"],"description":"Which property of the item changed (for example `name`, `label`, `required`), or null when the item is the value itself."},"from":{"type":"string","description":"What the draft has now."},"to":{"type":"string","description":"What the version has: what a restore puts back."}},"required":["kind","section","item","label","property","from","to"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["added"],"description":"The version has it; the draft does not. A restore adds it."},"section":{"type":["string","null"],"description":"Where the change sits: `fields`, `document`, `document_fields`, `checklist_items`, `settings`, `flow_start`, a template area, or null for the step itself."},"item":{"type":"string","enum":["step","setting","assignee","field","option","document","document_field","checklist_item","template_setting"],"description":"What changed: the step, one of its settings, its assignees, a form field, an option, the document, a field on the document, a checklist item, or a template setting."},"label":{"type":"string","description":"The name of what changed, as the template names it (a field label, an option, a setting)."},"parent":{"type":"string","description":"For an option: the field it belongs to."},"meta":{"type":"object","properties":{"fieldType":{"type":"string","description":"For a form field: its type."},"required":{"type":"boolean","description":"For a form field: whether it must be answered."},"page":{"type":"number","description":"For a document field: the page it sits on, from 1."},"fieldKind":{"type":"string","description":"For a document field: what it is (a signature, initials, a date, text)."},"party":{"type":"string","description":"For a document field: who fills it."}},"additionalProperties":false,"description":"A few facts about what is added, where they apply."}},"required":["kind","section","item","label"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["removed"],"description":"The draft has it; the version does not. A restore removes it."},"section":{"type":["string","null"],"description":"Where the change sits: `fields`, `document`, `document_fields`, `checklist_items`, `settings`, `flow_start`, a template area, or null for the step itself."},"item":{"type":"string","enum":["step","setting","assignee","field","option","document","document_field","checklist_item","template_setting"],"description":"What changed: the step, one of its settings, its assignees, a form field, an option, the document, a field on the document, a checklist item, or a template setting."},"label":{"type":"string","description":"The name of what changed, as the template names it (a field label, an option, a setting)."},"parent":{"type":"string","description":"For an option: the field it belongs to."}},"required":["kind","section","item","label"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["moved"],"description":"It is in both, in a different place."},"section":{"type":["string","null"],"description":"Where the change sits: `fields`, `document`, `document_fields`, `checklist_items`, `settings`, `flow_start`, a template area, or null for the step itself."},"item":{"type":"string","enum":["step","setting","assignee","field","option","document","document_field","checklist_item","template_setting"],"description":"What changed: the step, one of its settings, its assignees, a form field, an option, the document, a field on the document, a checklist item, or a template setting."},"label":{"type":"string","description":"The name of what changed, as the template names it (a field label, an option, a setting)."},"parent":{"type":"string","description":"For an option: the field it belongs to."},"fromIndex":{"type":"integer","description":"Its place in the draft, from 0."},"toIndex":{"type":"integer","description":"Its place in the version, from 0."}},"required":["kind","section","item","label","fromIndex","toIndex"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["other"],"description":"A setting shown only as changed: too deep to describe value by value, a pointer to something you may not see, or a credential or header, whose value is never shown."},"section":{"type":["string","null"],"description":"Where the change sits: `fields`, `document`, `document_fields`, `checklist_items`, `settings`, `flow_start`, a template area, or null for the step itself."},"item":{"type":"string","enum":["step","setting","assignee","field","option","document","document_field","checklist_item","template_setting"],"description":"What changed: the step, one of its settings, its assignees, a form field, an option, the document, a field on the document, a checklist item, or a template setting."},"label":{"type":"string","description":"The name of what changed, as the template names it (a field label, an option, a setting)."},"parent":{"type":"string","description":"For an option: the field it belongs to."},"paths":{"type":"array","items":{"type":"string"},"description":"The dotted paths of the setting that differ."}},"required":["kind","section","item","label","paths"],"additionalProperties":false}],"description":"One change, from the draft (`from`) to the version (`to`): a value, long text edited, something added, removed or moved, or a setting described only by its paths."},"description":"Every change on the step, one line each. Never capped."}},"required":["stepId","name","type","counts","mostlyRebuilt","typeChanged","lines"],"additionalProperties":false},"description":"Steps in both, with what a restore changes in each."},"onlyInVersion":{"type":"array","items":{"type":"object","properties":{"stepId":{"type":"string","description":"The step's permanent id, the same in every version."},"name":{"type":"string","description":"The step's name."},"type":{"type":"string","description":"The step's type, for example `FORM` or `ESIGN`."}},"required":["stepId","name","type"],"additionalProperties":false},"description":"Steps a restore adds back."},"onlyInDraft":{"type":"array","items":{"type":"object","properties":{"stepId":{"type":"string","description":"The step's permanent id, the same in every version."},"name":{"type":"string","description":"The step's name."},"type":{"type":"string","description":"The step's type, for example `FORM` or `ESIGN`."}},"required":["stepId","name","type"],"additionalProperties":false},"description":"Steps a restore removes from the draft."},"moved":{"type":"array","items":{"type":"object","properties":{"stepId":{"type":"string","description":"The step's permanent id, the same in every version."},"name":{"type":"string","description":"The step's name."},"type":{"type":"string","description":"The step's type, for example `FORM` or `ESIGN`."},"fromIndex":{"type":"integer","description":"Its place in the draft, from 0."},"toIndex":{"type":"integer","description":"Its place in the version, from 0."}},"required":["stepId","name","type","fromIndex","toIndex"],"additionalProperties":false},"description":"Steps in both, in a different order."}},"required":["changed","onlyInVersion","onlyInDraft","moved"],"additionalProperties":false,"description":"What a restore changes in the steps, matched by `stepId`."},"roles":{"type":"object","properties":{"onlyInVersion":{"type":"array","items":{"type":"string"},"description":"Roles a restore adds back."},"onlyInDraft":{"type":"array","items":{"type":"string"},"description":"Roles a restore removes."},"renamed":{"type":"array","items":{"type":"object","properties":{"from":{"type":"string","description":"The role's name in the draft."},"to":{"type":"string","description":"Its name in the version."}},"required":["from","to"],"additionalProperties":false},"description":"Roles in both with a different name."}},"required":["onlyInVersion","onlyInDraft","renamed"],"additionalProperties":false,"description":"What a restore changes in the roles, matched by their ids."},"flowStart":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["value"],"description":"A value changed."},"section":{"type":["string","null"],"description":"Where the change sits: `fields`, `document`, `document_fields`, `checklist_items`, `settings`, `flow_start`, a template area, or null for the step itself."},"item":{"type":"string","enum":["step","setting","assignee","field","option","document","document_field","checklist_item","template_setting"],"description":"What changed: the step, one of its settings, its assignees, a form field, an option, the document, a field on the document, a checklist item, or a template setting."},"label":{"type":"string","description":"The name of what changed, as the template names it (a field label, an option, a setting)."},"parent":{"type":"string","description":"For an option: the field it belongs to."},"property":{"type":["string","null"],"description":"Which property of the item changed (for example `name`, `label`, `required`), or null when the item is the value itself."},"from":{"type":"string","description":"What the draft has now."},"to":{"type":"string","description":"What the version has: what a restore puts back."}},"required":["kind","section","item","label","property","from","to"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["edited_text"],"description":"Long text was edited (over 120 characters, or more than one line). Show it folded."},"section":{"type":["string","null"],"description":"Where the change sits: `fields`, `document`, `document_fields`, `checklist_items`, `settings`, `flow_start`, a template area, or null for the step itself."},"item":{"type":"string","enum":["step","setting","assignee","field","option","document","document_field","checklist_item","template_setting"],"description":"What changed: the step, one of its settings, its assignees, a form field, an option, the document, a field on the document, a checklist item, or a template setting."},"label":{"type":"string","description":"The name of what changed, as the template names it (a field label, an option, a setting)."},"parent":{"type":"string","description":"For an option: the field it belongs to."},"property":{"type":["string","null"],"description":"Which property of the item changed (for example `name`, `label`, `required`), or null when the item is the value itself."},"from":{"type":"string","description":"What the draft has now."},"to":{"type":"string","description":"What the version has: what a restore puts back."}},"required":["kind","section","item","label","property","from","to"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["added"],"description":"The version has it; the draft does not. A restore adds it."},"section":{"type":["string","null"],"description":"Where the change sits: `fields`, `document`, `document_fields`, `checklist_items`, `settings`, `flow_start`, a template area, or null for the step itself."},"item":{"type":"string","enum":["step","setting","assignee","field","option","document","document_field","checklist_item","template_setting"],"description":"What changed: the step, one of its settings, its assignees, a form field, an option, the document, a field on the document, a checklist item, or a template setting."},"label":{"type":"string","description":"The name of what changed, as the template names it (a field label, an option, a setting)."},"parent":{"type":"string","description":"For an option: the field it belongs to."},"meta":{"type":"object","properties":{"fieldType":{"type":"string","description":"For a form field: its type."},"required":{"type":"boolean","description":"For a form field: whether it must be answered."},"page":{"type":"number","description":"For a document field: the page it sits on, from 1."},"fieldKind":{"type":"string","description":"For a document field: what it is (a signature, initials, a date, text)."},"party":{"type":"string","description":"For a document field: who fills it."}},"additionalProperties":false,"description":"A few facts about what is added, where they apply."}},"required":["kind","section","item","label"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["removed"],"description":"The draft has it; the version does not. A restore removes it."},"section":{"type":["string","null"],"description":"Where the change sits: `fields`, `document`, `document_fields`, `checklist_items`, `settings`, `flow_start`, a template area, or null for the step itself."},"item":{"type":"string","enum":["step","setting","assignee","field","option","document","document_field","checklist_item","template_setting"],"description":"What changed: the step, one of its settings, its assignees, a form field, an option, the document, a field on the document, a checklist item, or a template setting."},"label":{"type":"string","description":"The name of what changed, as the template names it (a field label, an option, a setting)."},"parent":{"type":"string","description":"For an option: the field it belongs to."}},"required":["kind","section","item","label"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["moved"],"description":"It is in both, in a different place."},"section":{"type":["string","null"],"description":"Where the change sits: `fields`, `document`, `document_fields`, `checklist_items`, `settings`, `flow_start`, a template area, or null for the step itself."},"item":{"type":"string","enum":["step","setting","assignee","field","option","document","document_field","checklist_item","template_setting"],"description":"What changed: the step, one of its settings, its assignees, a form field, an option, the document, a field on the document, a checklist item, or a template setting."},"label":{"type":"string","description":"The name of what changed, as the template names it (a field label, an option, a setting)."},"parent":{"type":"string","description":"For an option: the field it belongs to."},"fromIndex":{"type":"integer","description":"Its place in the draft, from 0."},"toIndex":{"type":"integer","description":"Its place in the version, from 0."}},"required":["kind","section","item","label","fromIndex","toIndex"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["other"],"description":"A setting shown only as changed: too deep to describe value by value, a pointer to something you may not see, or a credential or header, whose value is never shown."},"section":{"type":["string","null"],"description":"Where the change sits: `fields`, `document`, `document_fields`, `checklist_items`, `settings`, `flow_start`, a template area, or null for the step itself."},"item":{"type":"string","enum":["step","setting","assignee","field","option","document","document_field","checklist_item","template_setting"],"description":"What changed: the step, one of its settings, its assignees, a form field, an option, the document, a field on the document, a checklist item, or a template setting."},"label":{"type":"string","description":"The name of what changed, as the template names it (a field label, an option, a setting)."},"parent":{"type":"string","description":"For an option: the field it belongs to."},"paths":{"type":"array","items":{"type":"string"},"description":"The dotted paths of the setting that differ."}},"required":["kind","section","item","label","paths"],"additionalProperties":false}],"description":"One change, from the draft (`from`) to the version (`to`): a value, long text edited, something added, removed or moved, or a setting described only by its paths."},"description":"Changes to how a flow starts: its start fields and start settings."},"other":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["value"],"description":"A value changed."},"section":{"type":["string","null"],"description":"Where the change sits: `fields`, `document`, `document_fields`, `checklist_items`, `settings`, `flow_start`, a template area, or null for the step itself."},"item":{"type":"string","enum":["step","setting","assignee","field","option","document","document_field","checklist_item","template_setting"],"description":"What changed: the step, one of its settings, its assignees, a form field, an option, the document, a field on the document, a checklist item, or a template setting."},"label":{"type":"string","description":"The name of what changed, as the template names it (a field label, an option, a setting)."},"parent":{"type":"string","description":"For an option: the field it belongs to."},"property":{"type":["string","null"],"description":"Which property of the item changed (for example `name`, `label`, `required`), or null when the item is the value itself."},"from":{"type":"string","description":"What the draft has now."},"to":{"type":"string","description":"What the version has: what a restore puts back."}},"required":["kind","section","item","label","property","from","to"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["edited_text"],"description":"Long text was edited (over 120 characters, or more than one line). Show it folded."},"section":{"type":["string","null"],"description":"Where the change sits: `fields`, `document`, `document_fields`, `checklist_items`, `settings`, `flow_start`, a template area, or null for the step itself."},"item":{"type":"string","enum":["step","setting","assignee","field","option","document","document_field","checklist_item","template_setting"],"description":"What changed: the step, one of its settings, its assignees, a form field, an option, the document, a field on the document, a checklist item, or a template setting."},"label":{"type":"string","description":"The name of what changed, as the template names it (a field label, an option, a setting)."},"parent":{"type":"string","description":"For an option: the field it belongs to."},"property":{"type":["string","null"],"description":"Which property of the item changed (for example `name`, `label`, `required`), or null when the item is the value itself."},"from":{"type":"string","description":"What the draft has now."},"to":{"type":"string","description":"What the version has: what a restore puts back."}},"required":["kind","section","item","label","property","from","to"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["added"],"description":"The version has it; the draft does not. A restore adds it."},"section":{"type":["string","null"],"description":"Where the change sits: `fields`, `document`, `document_fields`, `checklist_items`, `settings`, `flow_start`, a template area, or null for the step itself."},"item":{"type":"string","enum":["step","setting","assignee","field","option","document","document_field","checklist_item","template_setting"],"description":"What changed: the step, one of its settings, its assignees, a form field, an option, the document, a field on the document, a checklist item, or a template setting."},"label":{"type":"string","description":"The name of what changed, as the template names it (a field label, an option, a setting)."},"parent":{"type":"string","description":"For an option: the field it belongs to."},"meta":{"type":"object","properties":{"fieldType":{"type":"string","description":"For a form field: its type."},"required":{"type":"boolean","description":"For a form field: whether it must be answered."},"page":{"type":"number","description":"For a document field: the page it sits on, from 1."},"fieldKind":{"type":"string","description":"For a document field: what it is (a signature, initials, a date, text)."},"party":{"type":"string","description":"For a document field: who fills it."}},"additionalProperties":false,"description":"A few facts about what is added, where they apply."}},"required":["kind","section","item","label"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["removed"],"description":"The draft has it; the version does not. A restore removes it."},"section":{"type":["string","null"],"description":"Where the change sits: `fields`, `document`, `document_fields`, `checklist_items`, `settings`, `flow_start`, a template area, or null for the step itself."},"item":{"type":"string","enum":["step","setting","assignee","field","option","document","document_field","checklist_item","template_setting"],"description":"What changed: the step, one of its settings, its assignees, a form field, an option, the document, a field on the document, a checklist item, or a template setting."},"label":{"type":"string","description":"The name of what changed, as the template names it (a field label, an option, a setting)."},"parent":{"type":"string","description":"For an option: the field it belongs to."}},"required":["kind","section","item","label"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["moved"],"description":"It is in both, in a different place."},"section":{"type":["string","null"],"description":"Where the change sits: `fields`, `document`, `document_fields`, `checklist_items`, `settings`, `flow_start`, a template area, or null for the step itself."},"item":{"type":"string","enum":["step","setting","assignee","field","option","document","document_field","checklist_item","template_setting"],"description":"What changed: the step, one of its settings, its assignees, a form field, an option, the document, a field on the document, a checklist item, or a template setting."},"label":{"type":"string","description":"The name of what changed, as the template names it (a field label, an option, a setting)."},"parent":{"type":"string","description":"For an option: the field it belongs to."},"fromIndex":{"type":"integer","description":"Its place in the draft, from 0."},"toIndex":{"type":"integer","description":"Its place in the version, from 0."}},"required":["kind","section","item","label","fromIndex","toIndex"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["other"],"description":"A setting shown only as changed: too deep to describe value by value, a pointer to something you may not see, or a credential or header, whose value is never shown."},"section":{"type":["string","null"],"description":"Where the change sits: `fields`, `document`, `document_fields`, `checklist_items`, `settings`, `flow_start`, a template area, or null for the step itself."},"item":{"type":"string","enum":["step","setting","assignee","field","option","document","document_field","checklist_item","template_setting"],"description":"What changed: the step, one of its settings, its assignees, a form field, an option, the document, a field on the document, a checklist item, or a template setting."},"label":{"type":"string","description":"The name of what changed, as the template names it (a field label, an option, a setting)."},"parent":{"type":"string","description":"For an option: the field it belongs to."},"paths":{"type":"array","items":{"type":"string"},"description":"The dotted paths of the setting that differ."}},"required":["kind","section","item","label","paths"],"additionalProperties":false}],"description":"One change, from the draft (`from`) to the version (`to`): a value, long text edited, something added, removed or moved, or a setting described only by its paths."},"description":"Changes to the template's other settings."}},"required":["target","against","same","restoreRefused","steps","roles","flowStart","other"],"additionalProperties":false,"description":"What restoring one version would change, one line per change. Steps and roles are matched by their ids, so a rename is one change. Nothing is left out: a setting that can't be described value by value is listed by its paths."},"ConnectionSummary":{"type":"object","properties":{"id":{"type":"string","description":"Use it with `GET /v1/templates?uses=connection:<id>`."},"type":{"type":"string","enum":["app","ai","secret","mcp"],"description":"`app`: an app account. `ai`: an AI provider. `secret`: a Secret. `mcp`: an MCP server."},"name":{"type":"string"},"app":{"type":["string","null"],"description":"The app, for an app account or an AI provider. Null for a Secret or an MCP server."},"appId":{"type":["string","null"],"description":"The app's id in the app catalog: what an app action's `externalApp.appId` takes (`GET /v1/step-types/EXTERNAL_APP` lists the apps). Null for a Secret or an MCP server."},"owner":{"type":"string","enum":["organization","personal"],"description":"`personal` for a person’s own account."},"accountEmail":{"type":["string","null"],"description":"The address the account signed in with, when the connection has one."}},"required":["id","type","name","app","appId","owner","accountEmail"],"additionalProperties":false},"AgentFile":{"type":"object","properties":{"agentId":{"type":"string","description":"The agent's id."},"name":{"type":"string","description":"The agent's name."},"draftRevision":{"type":"integer","description":"The draft revision the file was read at. Send it as `baseVersion` on a push to push only onto this draft."},"fileName":{"type":"string","description":"A file name to save it under."},"file":{"type":"string","description":"The agent as a `.yaml` file (`apiVersion: moxo/v1`, `kind: Agent`), its first line naming the file's JSON Schema."}},"required":["agentId","name","draftRevision","fileName","file"]},"AgentVersion":{"type":"object","properties":{"id":{"type":"string","description":"The version's id."},"publishVersion":{"type":"integer","description":"Its number: 1 for the first publish, then 2, 3 and on."},"publishedAt":{"type":"string","description":"When it was published (ISO 8601)."}},"required":["id","publishVersion","publishedAt"]},"AgentVersionFile":{"type":"object","properties":{"agentId":{"type":"string","description":"The agent's id."},"versionId":{"type":"string","description":"The version's id."},"publishVersion":{"type":"integer","description":"The version's number."},"name":{"type":"string","description":"The agent's name in that version."},"fileName":{"type":"string","description":"A file name to save it under."},"file":{"type":"string","description":"That version as a `.yaml` agent file, in the same shape as the draft's file, so two versions diff line by line."}},"required":["agentId","versionId","publishVersion","name","fileName","file"]},"AgentTestRun":{"type":"object","properties":{"id":{"type":"string","description":"The run's id."},"agentId":{"type":"string","description":"The agent it tests."},"state":{"type":"string","enum":["running","succeeded","failed","cancelled","interrupted"],"description":"`running` until it ends. `cancelled`: stopped. `interrupted`: nothing was watching it when it ended, and the reaper ended it."},"durationMs":{"type":"integer","description":"How long it took, once it ended."},"credits":{"type":["number","null"],"description":"What it would cost in credits, when your organization shows AI cost. A test is never charged."},"result":{"type":["object","null"],"additionalProperties":{},"description":"What the agent produced, as Agent Foundry's Test shows it: `prepared`, `advise`, `review` or `automation`. Null when it produced nothing."},"failureMessage":{"type":"string","description":"Why a failed run failed, in a sentence."}},"required":["id","agentId","state"]},"AgentEvalRun":{"type":"object","properties":{"id":{"type":"string","description":"The eval run's id."},"agentId":{"type":"string","description":"The agent it evaluates."},"state":{"type":"string","enum":["running","done","failed"],"description":"`running` until the answer is in."},"answer":{"type":"string","enum":["worse","held_on_examples","inconclusive","not_replayable","no_changes","not_published","not_enough_examples","no_rubric","stopped_at_budget"],"description":"`worse`: an example the published version got right and must keep (a regression anchor) broke, or the draft did significantly worse (McNemar). `held_on_examples`: it held, as the Improve loop proves a change. `inconclusive`: neither can be said with this many examples, the common answer. `not_replayable`: the draft changes something a replay can't reproduce (`differs` names it). `no_changes`: the draft is the published version, so there is nothing to compare. `not_published`: the agent was never published, so there is no version to compare against. `not_enough_examples`: too few kept examples. `no_rubric`: set a quality rubric in Agent Foundry › Evaluate first. `stopped_at_budget`: today's share for API eval runs is used up (`budget`); not a verdict."},"differs":{"type":"array","items":{"type":"string"},"description":"`not_replayable`: what the draft changes that a replay can't reproduce, or both `instructions` and `model` (one change at a time)."},"change":{"type":"object","properties":{"kind":{"type":"string","enum":["instructions","model"],"description":"`instructions` or `model`: the one change the run replayed."},"direction":{"type":"string","enum":["lighter","heavier"],"description":"A model change: to a lighter model (it must hold up) or a heavier one (it must do better)."}},"required":["kind"],"description":"The change replayed."},"stats":{"type":"object","properties":{"n":{"type":"integer","description":"Examples graded on both sides."},"b":{"type":"integer","description":"Examples the published version passed and the draft failed."},"c":{"type":"integer","description":"Examples the draft passed and the published version failed."},"anchorsInSet":{"type":"integer","description":"Examples the published version must keep getting right (regression anchors)."},"survivingAnchors":{"type":"integer","description":"Of those, graded on both sides."},"anchorFailures":{"type":"integer","description":"Anchors the draft broke."},"judgeAgreement":{"type":["number","null"],"description":"How often the grader agrees with your people (a lower bound); null before it has enough of their grades."}},"required":["n","b","c","anchorsInSet","survivingAnchors","anchorFailures","judgeAgreement"],"description":"The counts behind the answer, when the run graded both sides."},"examples":{"type":"array","items":{"type":"object","properties":{"exampleId":{"type":"string","description":"The example's id."},"role":{"type":"string","description":"`regression_anchor`, `anti_example` or `correction`."},"current":{"type":["string","null"],"enum":["pass","fail",null],"description":"The published version on this example; null when it could not be graded."},"candidate":{"type":["string","null"],"enum":["pass","fail",null],"description":"The draft on this example; null when it could not be graded."}},"required":["exampleId","role","current","candidate"]},"description":"Each example's grade on both sides. Never its content."},"budget":{"type":"object","properties":{"resetsAt":{"type":"string","description":"When the share resets (ISO 8601)."},"dailyUsd":{"type":"number","description":"The daily share for API eval runs, per organization."}},"required":["resetsAt","dailyUsd"],"description":"`stopped_at_budget`: when the share resets, and its size."}},"required":["id","agentId","state"]},"AgentFilePushResult":{"type":"object","properties":{"applied":{"type":"boolean","description":"True when the change was saved."},"accepted":{"type":"boolean","description":"False when the file or its change was refused: see `issues`. Nothing was or would be saved."},"changes":{"type":"array","items":{"type":"string"},"description":"The file keys whose value changes, such as `instructions` or `toolConfig`. Empty when the file matches the agent."},"issues":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string","description":"A stable code for the problem, such as `CONNECTION_IN_FOUNDRY` or `UNKNOWN_KNOWLEDGE`."},"pointer":{"type":"string","description":"Where in the file (or the update body), as a JSON pointer. An empty string is the whole of it."},"problem":{"type":"string","description":"What is wrong, in a sentence."},"fix":{"type":"string","description":"How to resolve it, in a sentence."}},"required":["code","pointer","problem","fix"]},"description":"Why the file can't be pushed. When there are any, nothing is saved."},"warnings":{"type":"array","items":{"type":"string"},"description":"Notes from the save, such as a skill that no longer exists being left out."},"draftRevision":{"type":"integer","description":"The draft revision now. After an applied push, the new one."}},"required":["applied","accepted","changes","issues","warnings","draftRevision"]},"BuilderAgent":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"kind":{"type":"string","enum":["prepare","advise","review","automation","chat"],"description":"One of `prepare`, `advise`, `review`, `automation` or `chat`."},"status":{"type":"string","enum":["DRAFT","ACTIVE","ARCHIVED"],"description":"`DRAFT` until published. An `ACTIVE` agent runs in flows."},"hasUnpublishedChanges":{"type":"boolean","description":"True when a published agent has saved changes that are not published yet."},"inputs":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string"},"required":{"type":"boolean"}},"required":["name","type","required"]}},"outputs":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string"},"required":{"type":"boolean","description":"True when every run must fill it: a run that leaves it blank waits for a person."}},"required":["name","type","required"]}},"toolIds":{"type":"array","items":{"type":"string"}},"externalSource":{"type":["object","null"],"properties":{"kind":{"type":"string","enum":["webhook","openai_responses","claude_managed_agent","copilot_studio","grok_bot"],"description":"`grok_bot`: a Grok Bot routine, which you can set through this API. An agent set up in Agent Foundry can also run on `webhook`, `openai_responses`, `claude_managed_agent` or `copilot_studio`; those are set in Agent Foundry."},"connectionId":{"type":["string","null"],"description":"The connection it runs through, from **Connected Apps** (`GET /v1/connections`). Null while a person who picked the host in Agent Foundry hasn't picked the connection yet."},"connectionRemoved":{"type":"boolean","description":"True when the connection was removed from Connected Apps. The agent can't run until a person picks another."}},"required":["kind","connectionId","connectionRemoved"],"additionalProperties":false,"description":"Where the agent runs. Null: in Moxo. A published agent with unpublished changes shows the host the next publish makes live."},"escalation":{"type":["object","null"],"properties":{"escalate":{"type":"string","description":"\"Also escalate when…\", in the builder's own words."}},"required":["escalate"],"additionalProperties":false,"description":"Human in the loop › Escalate: the \"Also escalate when…\" text the agent judges. Null: only the always-on reasons."},"requireHumanReview":{"type":"boolean","description":"Human in the loop › Require human review: a person approves the agent's result before any step that uses it completes. A template step cannot turn it off."},"reviewChat":{"type":"boolean","description":"With `requireHumanReview`: reviewers can chat with the AI to change the draft before approving."},"reviewSampleSize":{"type":["integer","null"],"description":"With `requireHumanReview`: reviewers check a sample of at least this many lines of a list result, each picked with the same chance, instead of every line. `null` clears only this minimum. A template step's own `reviewSample` still applies, and while this is set a step can check more lines, never fewer."},"actionApprovals":{"type":["object","null"],"properties":{"all":{"type":"boolean","enum":[true],"description":"Every action waits for a person's approval, actions added later too."},"tools":{"type":"array","items":{"type":"string"},"description":"Only these actions wait for a person's approval."}},"additionalProperties":false,"description":"Human in the loop › Approve actions before they run: `{ \"all\": true }` (every action, those added later too) or `{ \"tools\": [...] }`. Null: off. A template step can add actions, never remove these."},"connectionsToBind":{"type":"array","items":{"type":"object","properties":{"toolId":{"type":"string"},"name":{"type":"string"}},"required":["toolId","name"]},"description":"Tools whose connection a person sets up in Agent Foundry (open `url`)."},"needs":{"type":["array","null"],"items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"blocksPublish":{"type":"boolean"}},"required":["key","label","blocksPublish"]},"description":"Setup that is still missing. Items with `blocksPublish` must be done before the agent can be published. Null when it couldn't be checked; ask again."},"url":{"type":"string","description":"Where a person opens this agent in Moxo."},"updatedAt":{"type":["string","null"]},"changedFields":{"type":"array","items":{"type":"string"},"description":"On update: the settings that changed, by the names the update takes."},"warnings":{"type":"array","items":{"type":"string"},"description":"On create and update: notes from the save, such as a setting stored that the agent's runs don't use (it is kept as sent), a setting the agent's type does not hold being cleared, or a skill that no longer exists being left out."}},"required":["id","name","description","kind","status","hasUnpublishedChanges","inputs","outputs","toolIds","externalSource","escalation","requireHumanReview","reviewChat","reviewSampleSize","actionApprovals","connectionsToBind","needs","url","updatedAt"]},"BuilderAttachableAgent":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"kind":{"type":"string"},"status":{"type":"string","enum":["ACTIVE"]},"inputs":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string"},"required":{"type":"boolean"}},"required":["name","type","required"]}},"outputs":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string"},"required":{"type":"boolean","description":"True when every run must fill it: a run that leaves it blank waits for a person."}},"required":["name","type","required"]}}},"required":["id","name","description","kind","status","inputs","outputs"],"description":"What a template editor without the **Manage AI agents** permission sees: a published agent a step can use."},"BuilderAgentKnowledgeSource":{"type":"object","properties":{"id":{"type":"string"},"fileName":{"type":["string","null"]},"fileSize":{"type":["number","null"]},"mimeType":{"type":["string","null"]},"status":{"type":"string","description":"`PENDING` until the file is uploaded and scanned, then `READY` or `FAILED`."},"createdAt":{"type":["string","null"]},"inDraft":{"type":"boolean","description":"Whether the agent's draft uses this file: what the next publish runs with. An upload adds the file to the draft."},"inPublishedVersion":{"type":"boolean","description":"Whether the agent's published version uses this file: what runs now. A file uploaded after the last publish is used once the agent is published again."},"notInDraft":{"type":["object","null"],"properties":{"code":{"type":"string","enum":["joins_when_read","needs_archway_detach","replacement_needs_archway_detach","not_listed"],"description":"`joins_when_read`: added once the file is uploaded and read. `needs_archway_detach`: the agent was installed from an Archway bundle and the upload did not send `x-archway-detach-ack: 1`, so the file was not added. `replacement_needs_archway_detach`: a replacement was refused for the same reason, so the file is back to its earlier version (`inDraft` stays `true`). `not_listed`: the draft does not list it."},"message":{"type":"string","description":"The same, in a sentence to show a person."}},"required":["code","message"],"description":"Why the agent's draft does not use this file, or `null` when it does. A file the draft uses has one only when its replacement was refused (`replacement_needs_archway_detach`)."}},"required":["id","fileName","fileSize","mimeType","status","createdAt","inDraft","inPublishedVersion","notInDraft"]},"BuilderTemplateSetup":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"status":{"type":"string"},"ownerIds":{"type":"array","items":{"type":"string"}},"ownerPermission":{"type":["object","null"],"properties":{"type":{"type":"string","enum":["EXPLICIT_USERS","ADMINS_ONLY","PERMISSION_GROUP"],"description":"`EXPLICIT_USERS`: the people in `ownerIds`. `ADMINS_ONLY`: organization admins. `PERMISSION_GROUP`: the groups in `principals`."},"principals":{"type":"array","items":{"type":"string"}}},"required":["type"],"additionalProperties":false},"folder":{"type":["object","null"],"properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"mode":{"type":"string","enum":["predefined","adaptive"],"description":"How flows from this template run, as set now. A change reaches new flows when the template is next published."},"goal":{"type":["string","null"],"description":"For `adaptive`: the end state the flow works toward, as set now. Always `null` for `predefined`."},"url":{"type":"string"}},"required":["id","name","status","ownerIds","ownerPermission","folder","mode","goal","url"],"additionalProperties":false},"BuilderScheduleBase":{"type":"object","properties":{"id":{"type":"string","description":"The schedule's id."},"templateId":{"type":"string","description":"The template it starts."},"templateName":{"type":"string","description":"That template's name."},"scheduleName":{"type":"string","description":"The schedule's name."},"cronPattern":{"type":"string","description":"5 fields: minute hour day-of-month month day-of-week. Empty for `weekdays_before_eom` and `once`."},"timezone":{"type":"string","description":"The IANA time zone it runs in."},"enabled":{"type":"boolean","description":"Whether it starts flows."},"lastRunAt":{"type":["string","null"],"description":"When it last started a flow."},"nextRun":{"type":["string","null"],"description":"When it next starts one, on its live timing. `null` when it won't, including while it is paused. A timing change waiting for the template's next publish (`hasPendingSetup`) does not move it until then."},"hasPendingSetup":{"type":"boolean","description":"`true` when a change to when it runs or what it starts waits for the template's next publish. The timing and start values shown are that change; `nextRun` and the flows it starts until then follow the published setup."},"flowTitleTemplate":{"type":["string","null"],"description":"The name each flow it starts gets."},"roleAssignments":{"type":["object","null"],"additionalProperties":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"description":"Role id → person id, or a list of them when the role is given to several people. An internal user's id starts with `user:`."},"customFields":{"type":["array","null"],"items":{"$ref":"#/components/schemas/CustomFieldValueInput"},"description":"Start-form answers, each field by its `key`, as a start takes them."},"kickoffData":{"type":["object","null"],"additionalProperties":{},"deprecated":true,"description":"Deprecated: the start values, as a map of field key to value, the same as `customFields`. Read `customFields`; this field is still sent so integrations built on it keep working."},"flowDue":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["DAYS_AFTER_START"],"description":"Due a number of days after the flow starts."},"days":{"type":"integer","minimum":1,"maximum":3650,"description":"How many days after the flow starts."}},"required":["type","days"]},{"type":"object","properties":{"type":{"type":"string","enum":["DAY_OF_MONTH"],"description":"Due on a day of the month; a day already past rolls to the next month."},"day":{"type":"integer","minimum":1,"maximum":31,"description":"Day of the month, 1 to 31 (31 means the last day of a shorter month)."}},"required":["type","day"]},{"type":"object","properties":{"type":{"type":"string","enum":["DAY_OF_YEAR"],"description":"Due on a date in the year; a date already past rolls to the next year."},"month":{"type":"integer","minimum":1,"maximum":12,"description":"Month, 1 to 12."},"day":{"type":"integer","minimum":1,"maximum":31,"description":"Day of the month."}},"required":["type","month","day"]},{"type":"null"}],"description":"When each flow it starts is due, or `null` for none."},"createdByAutomation":{"type":"boolean","description":"True when a Schedule a flow step made it, rather than a person."},"sourceFlowId":{"type":["string","null"],"description":"The flow whose step made it. `null` for a schedule a person made, and when that flow was deleted."},"sourceFlowName":{"type":["string","null"],"description":"That flow's name."},"createdAt":{"type":"string","description":"When it was created."}},"required":["id","templateId","templateName","scheduleName","cronPattern","timezone","enabled","lastRunAt","nextRun","hasPendingSetup","flowTitleTemplate","roleAssignments","customFields","flowDue","createdByAutomation","sourceFlowId","sourceFlowName","createdAt"]},"BuilderSchedule":{"oneOf":[{"$ref":"#/components/schemas/BuilderSchedule_cron"},{"$ref":"#/components/schemas/BuilderSchedule_weekdays_before_eom"},{"$ref":"#/components/schemas/BuilderSchedule_once"}],"discriminator":{"propertyName":"kind","mapping":{"cron":"#/components/schemas/BuilderSchedule_cron","weekdays_before_eom":"#/components/schemas/BuilderSchedule_weekdays_before_eom","once":"#/components/schemas/BuilderSchedule_once"}}},"BuilderSchedule_cron":{"allOf":[{"$ref":"#/components/schemas/BuilderScheduleBase"},{"type":"object","properties":{"kind":{"type":"string","enum":["cron"],"description":"`cron`: on a cron pattern. `weekdays_before_eom`: a number of weekdays before month end. `once`: one time."},"kindParams":{"type":"null","description":"`null`: the schedule runs on `cronPattern`."}},"required":["kind","kindParams"]}]},"BuilderSchedule_weekdays_before_eom":{"allOf":[{"$ref":"#/components/schemas/BuilderScheduleBase"},{"type":"object","properties":{"kind":{"type":"string","enum":["weekdays_before_eom"],"description":"`cron`: on a cron pattern. `weekdays_before_eom`: a number of weekdays before month end. `once`: one time."},"kindParams":{"type":"object","properties":{"n":{"type":"integer","description":"How many weekdays before the end of the month."},"hour":{"type":"integer","description":"Hour of the day, 0 to 23."},"minute":{"type":"integer","description":"Minute of the hour, 0 to 59."}},"required":["n","hour","minute"],"description":"Which weekday before month end, and when."}},"required":["kind","kindParams"]}]},"BuilderSchedule_once":{"allOf":[{"$ref":"#/components/schemas/BuilderScheduleBase"},{"type":"object","properties":{"kind":{"type":"string","enum":["once"],"description":"`cron`: on a cron pattern. `weekdays_before_eom`: a number of weekdays before month end. `once`: one time."},"kindParams":{"type":"object","properties":{"runAt":{"type":"string","description":"When it runs, once, as an ISO 8601 time in UTC."}},"required":["runAt"],"description":"When it runs. A Schedule a flow step makes these."}},"required":["kind","kindParams"]}]},"AppTriggerMapping":{"type":"object","properties":{"flowName":{"anyOf":[{"type":"object","properties":{"_literal":{"type":"string","description":"Fixed text."}},"required":["_literal"],"additionalProperties":false},{"type":"object","properties":{"_template":{"type":"string","description":"Text with the event's fields in double braces."}},"required":["_template"],"additionalProperties":false}],"description":"The new flow's name."},"flowOwner":{"anyOf":[{"type":"object","properties":{"_literal":{"type":"string","description":"Fixed text."}},"required":["_literal"],"additionalProperties":false},{"type":"object","properties":{"_template":{"type":"string","description":"Text with the event's fields in double braces."}},"required":["_template"],"additionalProperties":false}],"description":"The flow's owner: the email of a person in your organization."},"rolesByEmail":{"type":"object","additionalProperties":{"anyOf":[{"type":"object","properties":{"_literal":{"type":"string","description":"Fixed text."}},"required":["_literal"],"additionalProperties":false},{"type":"object","properties":{"_template":{"type":"string","description":"Text with the event's fields in double braces."}},"required":["_template"],"additionalProperties":false},{"type":"object","properties":{"_email":{"type":"string","description":"The event field that holds the person's email."}},"required":["_email"],"additionalProperties":false},{"type":"object","properties":{"_phone":{"type":"string","description":"The event field that holds the person's phone number."}},"required":["_phone"],"additionalProperties":false}],"description":"Who fills the role: a value as above, or `{ \"_email\": \"<field>\" }` / `{ \"_phone\": \"<field>\" }` naming the event field that holds the person's email or phone."},"description":"Each role, by name, filled by the person with this email."},"rolesByPhone":{"type":"object","additionalProperties":{"anyOf":[{"type":"object","properties":{"_literal":{"type":"string","description":"Fixed text."}},"required":["_literal"],"additionalProperties":false},{"type":"object","properties":{"_template":{"type":"string","description":"Text with the event's fields in double braces."}},"required":["_template"],"additionalProperties":false},{"type":"object","properties":{"_email":{"type":"string","description":"The event field that holds the person's email."}},"required":["_email"],"additionalProperties":false},{"type":"object","properties":{"_phone":{"type":"string","description":"The event field that holds the person's phone number."}},"required":["_phone"],"additionalProperties":false}],"description":"Who fills the role: a value as above, or `{ \"_email\": \"<field>\" }` / `{ \"_phone\": \"<field>\" }` naming the event field that holds the person's email or phone."},"description":"Each role, by name, filled by the person with this phone number."},"rolesByChannel":{"type":"object","additionalProperties":{"anyOf":[{"type":"object","properties":{"_literal":{"type":"string","description":"Fixed text."}},"required":["_literal"],"additionalProperties":false},{"type":"object","properties":{"_template":{"type":"string","description":"Text with the event's fields in double braces."}},"required":["_template"],"additionalProperties":false},{"type":"object","properties":{"_channel":{"type":"string","enum":["email","sms","email_and_sms"],"description":"Email, text message, or both."}},"required":["_channel"],"additionalProperties":false}],"description":"How the role holder is reached: `{ \"_channel\": \"email\" | \"sms\" | \"email_and_sms\" }`, or a value from the event (anything else is ignored)."},"description":"Each role, by name: how its holder is reached."},"rolesByPersona":{"type":"object","additionalProperties":{"type":"object","properties":{"_persona":{"type":"string","minLength":1,"description":"The persona id."},"_memberType":{"type":"string","enum":["internal","external"],"description":"Whether the persona is for internal or external users. Moxo checks it against the persona."}},"required":["_persona"],"additionalProperties":false,"description":"The persona a new person in the role gets: `{ \"_persona\": \"<persona id>\" }`. Leave the role out for the organization's default."},"description":"Each role, by name: the persona a person new to Moxo gets."},"rolesByCustomField":{"type":"object","additionalProperties":{"type":"object","additionalProperties":{"anyOf":[{"type":"object","properties":{"_literal":{"type":"string","description":"Fixed text."}},"required":["_literal"],"additionalProperties":false},{"type":"object","properties":{"_template":{"type":"string","description":"Text with the event's fields in double braces."}},"required":["_template"],"additionalProperties":false}],"description":"A value: `{ \"_literal\": \"<text>\" }` for fixed text, or `{ \"_template\": \"<text>\" }` with the event's fields in double braces, such as `{{task.creatorEmail}}` (the fields are listed by `GET /v1/flow-triggers/providers/{provider}/fields`)."}},"description":"Each role, by name: the person fields to set on its holder, by field key."},"customFields":{"type":"object","additionalProperties":{"anyOf":[{"type":"object","properties":{"_literal":{"type":"string","description":"Fixed text."}},"required":["_literal"],"additionalProperties":false},{"type":"object","properties":{"_template":{"type":"string","description":"Text with the event's fields in double braces."}},"required":["_template"],"additionalProperties":false}],"description":"A value: `{ \"_literal\": \"<text>\" }` for fixed text, or `{ \"_template\": \"<text>\" }` with the event's fields in double braces, such as `{{task.creatorEmail}}` (the fields are listed by `GET /v1/flow-triggers/providers/{provider}/fields`)."},"description":"The start fields, by field key."},"resource":{"type":"object","additionalProperties":{},"description":"What the trigger watches within the app, as the app's object options give it (`GET /v1/flow-triggers/providers/{provider}/objects`), for example a Salesforce object or an Asana project."}},"required":["flowName","flowOwner"],"additionalProperties":false,"description":"Which fields of the app's event fill the new flow's name, owner, start fields and roles. Roles and start fields are named as the template names them."},"AppTriggerFilter":{"type":"object","properties":{"root":{"type":"object","properties":{"kind":{"type":"string","enum":["group"],"description":"A group of conditions and groups."},"op":{"type":"string","enum":["AND","OR"],"description":"`AND`: every child must match. `OR`: any one is enough."},"children":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["group"],"description":"A group of conditions and groups."},"op":{"type":"string","enum":["AND","OR"],"description":"`AND`: every child must match. `OR`: any one is enough."},"children":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["group"],"description":"A group of conditions and groups."},"op":{"type":"string","enum":["AND","OR"],"description":"`AND`: every child must match. `OR`: any one is enough."},"children":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["group"],"description":"A group of conditions and groups."},"op":{"type":"string","enum":["AND","OR"],"description":"`AND`: every child must match. `OR`: any one is enough."},"children":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["group"],"description":"A group of conditions and groups."},"op":{"type":"string","enum":["AND","OR"],"description":"`AND`: every child must match. `OR`: any one is enough."},"children":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["group"],"description":"A group of conditions and groups."},"op":{"type":"string","enum":["AND","OR"],"description":"`AND`: every child must match. `OR`: any one is enough."},"children":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["condition"],"description":"One test on a field."},"field":{"type":"string","minLength":1,"maxLength":1000,"description":"The field to test, as a dot path such as `deal.stage`."},"op":{"type":"string","enum":["eq","neq","in","contains","startsWith","gt","lt","between","isSet","isEmpty","hasAnyOf"],"description":"How to compare: `eq` (the default), `neq`, `in`, `contains`, `startsWith`, `gt`, `lt`, `between`, `isSet`, `isEmpty` or `hasAnyOf`."},"value":{"type":"string","maxLength":1000,"description":"The value to compare with. Empty for `isSet` and `isEmpty`; `in`, `between` and `hasAnyOf` read `values` instead."},"values":{"type":"array","items":{"type":"string","maxLength":1000},"maxItems":100,"description":"The values for `in` (any of them), `between` (from and to) and `hasAnyOf`."}},"required":["kind","field","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["pipelineStage"],"description":"A record in one of these stages of a pipeline."},"pipelineField":{"type":"string","minLength":1,"maxLength":1000,"description":"The field that holds the pipeline."},"stageField":{"type":"string","minLength":1,"maxLength":1000,"description":"The field that holds the stage."},"pipeline":{"type":"string","minLength":1,"maxLength":1000,"description":"The pipeline."},"stages":{"type":"array","items":{"type":"string","maxLength":1000},"maxItems":100,"description":"The stages that match."}},"required":["kind","pipelineField","stageField","pipeline","stages"],"additionalProperties":false}]},"maxItems":100,"description":"The conditions and groups inside."}},"required":["kind","op","children"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["condition"],"description":"One test on a field."},"field":{"type":"string","minLength":1,"maxLength":1000,"description":"The field to test, as a dot path such as `deal.stage`."},"op":{"type":"string","enum":["eq","neq","in","contains","startsWith","gt","lt","between","isSet","isEmpty","hasAnyOf"],"description":"How to compare: `eq` (the default), `neq`, `in`, `contains`, `startsWith`, `gt`, `lt`, `between`, `isSet`, `isEmpty` or `hasAnyOf`."},"value":{"type":"string","maxLength":1000,"description":"The value to compare with. Empty for `isSet` and `isEmpty`; `in`, `between` and `hasAnyOf` read `values` instead."},"values":{"type":"array","items":{"type":"string","maxLength":1000},"maxItems":100,"description":"The values for `in` (any of them), `between` (from and to) and `hasAnyOf`."}},"required":["kind","field","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["pipelineStage"],"description":"A record in one of these stages of a pipeline."},"pipelineField":{"type":"string","minLength":1,"maxLength":1000,"description":"The field that holds the pipeline."},"stageField":{"type":"string","minLength":1,"maxLength":1000,"description":"The field that holds the stage."},"pipeline":{"type":"string","minLength":1,"maxLength":1000,"description":"The pipeline."},"stages":{"type":"array","items":{"type":"string","maxLength":1000},"maxItems":100,"description":"The stages that match."}},"required":["kind","pipelineField","stageField","pipeline","stages"],"additionalProperties":false}]},"maxItems":100,"description":"The conditions and groups inside."}},"required":["kind","op","children"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["condition"],"description":"One test on a field."},"field":{"type":"string","minLength":1,"maxLength":1000,"description":"The field to test, as a dot path such as `deal.stage`."},"op":{"type":"string","enum":["eq","neq","in","contains","startsWith","gt","lt","between","isSet","isEmpty","hasAnyOf"],"description":"How to compare: `eq` (the default), `neq`, `in`, `contains`, `startsWith`, `gt`, `lt`, `between`, `isSet`, `isEmpty` or `hasAnyOf`."},"value":{"type":"string","maxLength":1000,"description":"The value to compare with. Empty for `isSet` and `isEmpty`; `in`, `between` and `hasAnyOf` read `values` instead."},"values":{"type":"array","items":{"type":"string","maxLength":1000},"maxItems":100,"description":"The values for `in` (any of them), `between` (from and to) and `hasAnyOf`."}},"required":["kind","field","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["pipelineStage"],"description":"A record in one of these stages of a pipeline."},"pipelineField":{"type":"string","minLength":1,"maxLength":1000,"description":"The field that holds the pipeline."},"stageField":{"type":"string","minLength":1,"maxLength":1000,"description":"The field that holds the stage."},"pipeline":{"type":"string","minLength":1,"maxLength":1000,"description":"The pipeline."},"stages":{"type":"array","items":{"type":"string","maxLength":1000},"maxItems":100,"description":"The stages that match."}},"required":["kind","pipelineField","stageField","pipeline","stages"],"additionalProperties":false}]},"maxItems":100,"description":"The conditions and groups inside."}},"required":["kind","op","children"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["condition"],"description":"One test on a field."},"field":{"type":"string","minLength":1,"maxLength":1000,"description":"The field to test, as a dot path such as `deal.stage`."},"op":{"type":"string","enum":["eq","neq","in","contains","startsWith","gt","lt","between","isSet","isEmpty","hasAnyOf"],"description":"How to compare: `eq` (the default), `neq`, `in`, `contains`, `startsWith`, `gt`, `lt`, `between`, `isSet`, `isEmpty` or `hasAnyOf`."},"value":{"type":"string","maxLength":1000,"description":"The value to compare with. Empty for `isSet` and `isEmpty`; `in`, `between` and `hasAnyOf` read `values` instead."},"values":{"type":"array","items":{"type":"string","maxLength":1000},"maxItems":100,"description":"The values for `in` (any of them), `between` (from and to) and `hasAnyOf`."}},"required":["kind","field","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["pipelineStage"],"description":"A record in one of these stages of a pipeline."},"pipelineField":{"type":"string","minLength":1,"maxLength":1000,"description":"The field that holds the pipeline."},"stageField":{"type":"string","minLength":1,"maxLength":1000,"description":"The field that holds the stage."},"pipeline":{"type":"string","minLength":1,"maxLength":1000,"description":"The pipeline."},"stages":{"type":"array","items":{"type":"string","maxLength":1000},"maxItems":100,"description":"The stages that match."}},"required":["kind","pipelineField","stageField","pipeline","stages"],"additionalProperties":false}]},"maxItems":100,"description":"The conditions and groups inside."}},"required":["kind","op","children"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["condition"],"description":"One test on a field."},"field":{"type":"string","minLength":1,"maxLength":1000,"description":"The field to test, as a dot path such as `deal.stage`."},"op":{"type":"string","enum":["eq","neq","in","contains","startsWith","gt","lt","between","isSet","isEmpty","hasAnyOf"],"description":"How to compare: `eq` (the default), `neq`, `in`, `contains`, `startsWith`, `gt`, `lt`, `between`, `isSet`, `isEmpty` or `hasAnyOf`."},"value":{"type":"string","maxLength":1000,"description":"The value to compare with. Empty for `isSet` and `isEmpty`; `in`, `between` and `hasAnyOf` read `values` instead."},"values":{"type":"array","items":{"type":"string","maxLength":1000},"maxItems":100,"description":"The values for `in` (any of them), `between` (from and to) and `hasAnyOf`."}},"required":["kind","field","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["pipelineStage"],"description":"A record in one of these stages of a pipeline."},"pipelineField":{"type":"string","minLength":1,"maxLength":1000,"description":"The field that holds the pipeline."},"stageField":{"type":"string","minLength":1,"maxLength":1000,"description":"The field that holds the stage."},"pipeline":{"type":"string","minLength":1,"maxLength":1000,"description":"The pipeline."},"stages":{"type":"array","items":{"type":"string","maxLength":1000},"maxItems":100,"description":"The stages that match."}},"required":["kind","pipelineField","stageField","pipeline","stages"],"additionalProperties":false}]},"maxItems":100,"description":"The conditions and groups inside."}},"required":["kind","op","children"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["condition"],"description":"One test on a field."},"field":{"type":"string","minLength":1,"maxLength":1000,"description":"The field to test, as a dot path such as `deal.stage`."},"op":{"type":"string","enum":["eq","neq","in","contains","startsWith","gt","lt","between","isSet","isEmpty","hasAnyOf"],"description":"How to compare: `eq` (the default), `neq`, `in`, `contains`, `startsWith`, `gt`, `lt`, `between`, `isSet`, `isEmpty` or `hasAnyOf`."},"value":{"type":"string","maxLength":1000,"description":"The value to compare with. Empty for `isSet` and `isEmpty`; `in`, `between` and `hasAnyOf` read `values` instead."},"values":{"type":"array","items":{"type":"string","maxLength":1000},"maxItems":100,"description":"The values for `in` (any of them), `between` (from and to) and `hasAnyOf`."}},"required":["kind","field","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["pipelineStage"],"description":"A record in one of these stages of a pipeline."},"pipelineField":{"type":"string","minLength":1,"maxLength":1000,"description":"The field that holds the pipeline."},"stageField":{"type":"string","minLength":1,"maxLength":1000,"description":"The field that holds the stage."},"pipeline":{"type":"string","minLength":1,"maxLength":1000,"description":"The pipeline."},"stages":{"type":"array","items":{"type":"string","maxLength":1000},"maxItems":100,"description":"The stages that match."}},"required":["kind","pipelineField","stageField","pipeline","stages"],"additionalProperties":false}]},"maxItems":100,"description":"The conditions and groups inside."}},"required":["kind","op","children"],"additionalProperties":false,"description":"The conditions, as one group. Leave it out to match everything."},"op":{"type":"string","enum":["AND","OR"],"description":"The older flat form: how `predicates` combine. Send `root` instead."},"predicates":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string","minLength":1,"maxLength":1000,"description":"The field to test, as a dot path such as `deal.stage`."},"op":{"type":"string","enum":["eq","neq","in","contains","startsWith","gt","lt","between","isSet","isEmpty","hasAnyOf"],"description":"How to compare: `eq` (the default), `neq`, `in`, `contains`, `startsWith`, `gt`, `lt`, `between`, `isSet`, `isEmpty` or `hasAnyOf`."},"value":{"type":"string","maxLength":1000,"description":"The value to compare with. Empty for `isSet` and `isEmpty`; `in`, `between` and `hasAnyOf` read `values` instead."},"values":{"type":"array","items":{"type":"string","maxLength":1000},"maxItems":100,"description":"The values for `in` (any of them), `between` (from and to) and `hasAnyOf`."}},"required":["field","value"],"additionalProperties":false},"maxItems":100,"description":"The older flat form: a list of conditions. Send `root` instead."}},"additionalProperties":false,"description":"Conditions, combined with `AND` and `OR`, that the app's event must meet to start a flow. `{}` starts one for every event."},"BuilderAppTrigger":{"type":"object","properties":{"id":{"type":"string"},"templateId":{"type":"string"},"provider":{"type":"string"},"eventType":{"type":"string"},"connectionId":{"type":["string","null"],"description":"Null when the connection was removed or turned off."},"mapping":{},"filter":{},"enabled":{"type":"boolean"},"deliveryMode":{"type":["string","null"]},"lastEventAt":{"type":["string","null"]},"hasError":{"type":"boolean"},"hasPendingSetup":{"type":"boolean","description":"True when an event, mapping or conditions change waits for the template's next publish. Live events keep the published setup until then."},"createdAt":{"type":["string","null"]}},"required":["id","templateId","provider","eventType","connectionId","enabled","deliveryMode","lastEventAt","hasError","hasPendingSetup","createdAt"]},"BuilderEmailTriggerPause":{"type":"object","properties":{"id":{"type":"string","description":"The email trigger's id."},"startByEmail":{"type":"boolean","description":"Whether the template's Start by email is on."},"paused":{"type":"boolean","description":"Whether the email start is paused: emails start a flow only when `startByEmail` is `true` and this is `false`."}},"required":["id","startByEmail","paused"],"additionalProperties":false},"BuilderEmailTrigger":{"type":"object","properties":{"id":{"type":"string"},"templateId":{"type":"string"},"startByEmail":{"type":"boolean","description":"Whether the template's Start by email is on (`PATCH /v1/templates/{id}/trigger-activation`). `false` after the email start is removed or switched off."},"enabled":{"type":"boolean","description":"`false` while this trigger is paused, from the app's Email switch or through the API (one switch). An email starts a flow only when `startByEmail` and this are both `true` and the template is published."},"filter":{"type":["object","null"],"properties":{"sender":{"type":"string","description":"Text the sender's address or name must contain."},"subject":{"type":"string","description":"Text the subject must contain."}},"description":"Only emails whose sender or subject contains this text start a flow. `null` when every email does."},"mapping":{"type":["object","null"],"properties":{"roleAssignments":{"type":"object","additionalProperties":{"type":"string","enum":["from"]},"description":"Role → `from`: the sender fills that role."},"customFields":{"type":"object","additionalProperties":{"type":"string","enum":["from","fromName","subject","body"]},"description":"Start field key → the email part that fills it."},"inputs":{"type":"object","additionalProperties":{"type":"string","enum":["from","fromName","subject","body"]},"deprecated":true,"description":"Deprecated: an email trigger's start fields, the same as `customFields`. Read `customFields`; this field is still sent so integrations built on it keep working."}},"additionalProperties":false,"description":"`roleAssignments`: role → `from` (the sender). `customFields`: start form field key → the part of the email that fills it."},"inboxAddress":{"type":["string","null"],"description":"The address that starts a flow. Null until the template is published with Start by email on."},"note":{"type":"string"},"hasPendingSetup":{"type":"boolean","description":"True when a mapping or conditions change waits for the template's next publish. Live emails keep the published setup until then."},"createdAt":{"type":["string","null"]},"updatedAt":{"type":["string","null"]}},"required":["id","templateId","startByEmail","enabled","filter","mapping","inboxAddress","hasPendingSetup","createdAt","updatedAt"]},"FlowTreeProgress":{"type":"object","properties":{"done":{"type":"integer","description":"Actions people completed.","example":3},"open":{"type":"integer","description":"Actions the flow has reached that are not finished yet.","example":2},"notStarted":{"type":"integer","description":"Actions the flow has not reached yet.","example":6},"total":{"type":"integer","description":"`done + open + notStarted`. Skipped, canceled and failed actions are not counted.","example":11}},"required":["done","open","notStarted","total"],"additionalProperties":false,"description":"People's actions only. Automations are never counted."},"FlowTreeRowRef":{"type":"object","properties":{"key":{"type":["string","null"],"description":"The named row's `key` in this tree, or `null` for a step with no row of its own (a Wait, a branch or a building block)."},"name":{"type":"string","description":"Its name, as the row shows it: a sub-flow you can't open is named by its template."}},"required":["key","name"],"additionalProperties":false,"description":"A step another row names."},"FlowTreeWaitingOn":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["after"],"description":"`after`: the step right before it on its path is not finished yet."},"rows":{"type":"array","items":{"$ref":"#/components/schemas/FlowTreeRowRef"},"description":"What comes right before it on its path and is not finished yet."}},"required":["kind","rows"],"additionalProperties":false,"description":"Plain order: it starts after these."},{"type":"object","properties":{"kind":{"type":"string","enum":["work"],"description":"`work`: it waits for other work to finish."},"rows":{"type":"array","items":{"$ref":"#/components/schemas/FlowTreeRowRef"},"description":"The open work it waits for: a running sub-flow, or a For each, Repeat while or Parallel paths (its `group` row, never each open step inside it)."}},"required":["kind","rows"],"additionalProperties":false,"description":"Held by other work: it waits for these."},{"type":"object","properties":{"kind":{"type":"string","enum":["wait"],"description":"`wait`: it sits behind a running Wait step."},"name":{"type":"string","description":"The Wait step's name."},"until":{"type":["string","null"],"description":"When the Wait ends (ISO 8601), for a Wait for a duration or a date; otherwise `null`."}},"required":["kind","name","until"],"additionalProperties":false,"description":"Behind a running Wait step."}],"description":"What a step not started yet waits for."},"FlowTreeRow":{"type":"object","properties":{"key":{"type":"string","description":"Unique within this tree, and stable between reads."},"depth":{"type":"integer","description":"`0` for the flow's own steps; a sub-flow's or a group's rows are one deeper than its row.","example":0},"kind":{"type":"string","enum":["action","automation","subflow","locked","group"],"description":"`action`: a person's action. `automation`: a step that runs on its own. `subflow`: a sub-flow you can open, or one not started yet; its steps follow it. `locked`: a sub-flow you can't open: it shows the template's name and its status, nothing else, and is not counted. `group`: a For each, a Repeat while or Parallel paths (or one iteration or path of it, see `groupType`); its rows follow it, one level deeper."},"flowId":{"type":"string","description":"The flow the step belongs to."},"stepId":{"type":"string","description":"The template's step id."},"stepExecutionId":{"type":["string","null"],"description":"This run of the step: what step endpoints take as `{stepId}`."},"name":{"type":"string","description":"The step's name; for a sub-flow you can open, the sub-flow's name; for a locked one, its template's name."},"type":{"type":"string","description":"The step type, for example `FORM` or `SUB_FLOW`.","example":"FORM"},"stepType":{"type":"string","deprecated":true,"description":"Deprecated: the step's type, the same as `type`. Read `type`; this field is still sent so integrations built on it keep working."},"status":{"type":"string","enum":["completed","in_progress","not_started","skipped","cancelled","failed"],"description":"Where the step stands. For a sub-flow: its flow's status (`in_progress` while it runs or is paused)."},"assignees":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The person's id (`usr_…`)."},"name":{"type":"string","description":"Their name."}},"required":["id","name"],"additionalProperties":false},"description":"The people on an action. Empty on every other row."},"customStatus":{"anyOf":[{"$ref":"#/components/schemas/StepStatus"},{"type":"null"}],"description":"The step's own status from the template, when one is set and step statuses are on for your plan."},"dueAt":{"type":["string","null"],"description":"When the step is due (ISO 8601), or `null`."},"childFlowId":{"type":["string","null"],"description":"A sub-flow row's flow; `null` until it starts, on a `locked` row (a sub-flow you can't open), and on every other row."},"templateName":{"type":["string","null"],"description":"A sub-flow row's template name; `null` on every other row."},"counted":{"type":"boolean","description":"`true` when the flow waits for this sub-flow, so its actions count in the flow's progress. A sub-flow that lets the flow go on without it is shown, not counted."},"progress":{"anyOf":[{"$ref":"#/components/schemas/FlowTreeProgress"},{"type":"null"}],"description":"A sub-flow row's own progress, its counted sub-flows included. A sub-flow not started yet counts the actions its template will start with. On a `group` row: a For each or a Repeat while counts its iterations (an iteration is done when its actions are); Parallel paths, an iteration and a path count their actions. `null` on every other row and on a locked one."},"waitingOn":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["after"],"description":"`after`: the step right before it on its path is not finished yet."},"rows":{"type":"array","items":{"$ref":"#/components/schemas/FlowTreeRowRef"},"description":"What comes right before it on its path and is not finished yet."}},"required":["kind","rows"],"additionalProperties":false,"description":"Plain order: it starts after these."},{"type":"object","properties":{"kind":{"type":"string","enum":["work"],"description":"`work`: it waits for other work to finish."},"rows":{"type":"array","items":{"$ref":"#/components/schemas/FlowTreeRowRef"},"description":"The open work it waits for: a running sub-flow, or a For each, Repeat while or Parallel paths (its `group` row, never each open step inside it)."}},"required":["kind","rows"],"additionalProperties":false,"description":"Held by other work: it waits for these."},{"type":"object","properties":{"kind":{"type":"string","enum":["wait"],"description":"`wait`: it sits behind a running Wait step."},"name":{"type":"string","description":"The Wait step's name."},"until":{"type":["string","null"],"description":"When the Wait ends (ISO 8601), for a Wait for a duration or a date; otherwise `null`."}},"required":["kind","name","until"],"additionalProperties":false,"description":"Behind a running Wait step."},{"type":"null"}],"description":"What a `not_started` row waits for. `null` on every other row, and when the reason is not certain (for example when the step before it is one you can't see)."},"heldOn":{"type":["string","null"],"enum":["host_setup","connection","bundle","paused",null],"description":"An open action or automation held on something other than its people's work: `host_setup` (a booking's host has not connected their calendar), `connection` (an app connection is missing), `bundle` (the flow has no connection bundle yet) or `paused`. `null` otherwise."},"blocking":{"type":"boolean","description":"`true` for open work in the way of other work: an open action or automation, or a running sub-flow with no open row beneath it. The sub-flows around such a row are not themselves `blocking`."},"holdsUp":{"type":"array","items":{"type":"string"},"description":"The `key` of each not-started row this row holds up: each row whose `waitingOn` names it directly, and, on a `blocking` row, each row its enclosing sub-flows and groups hold up, up to the first sub-flow its parent does not wait for (an open step inside a sub-flow or a For each holds up the step after it)."},"groupType":{"type":["string","null"],"enum":["for_each","repeat_while","parallel","iteration","path",null],"description":"On a `group` row: `for_each`, `repeat_while` or `parallel` for the container, or `iteration` (one item of a loop, or one round) or `path` (one of Parallel paths) for a part of one with more than one row of its own. A part with a single row has no row of its own: that row sits directly under the group. `null` on every other row."},"iterationCount":{"type":["integer","null"],"description":"On a `for_each` or `repeat_while` row: how many iterations have rows. `null` on every other row.","example":50},"pathCount":{"type":["integer","null"],"description":"On a `parallel` row: how many paths have rows. `null` on every other row.","example":3},"groupNumber":{"type":["integer","null"],"description":"On an `iteration` or `path` row: its place in the group, from 1. Its `name` is empty when nothing names it: show it as \"Iteration 3\" or \"Path 2\". `null` on every other row.","example":3},"stepName":{"type":["string","null"],"description":"On an `action` or `automation` row whose `name` is its loop item (a For each with that one step): the step's own name. `null` on every other row.","example":"Answer the question"}},"required":["key","depth","kind","flowId","stepId","stepExecutionId","name","type","status","assignees","customStatus","dueAt","childFlowId","templateName","counted","progress","waitingOn","heldOn","blocking","holdsUp","groupType","iterationCount","pathCount","groupNumber","stepName"],"additionalProperties":false},"FlowTree":{"type":"object","properties":{"flowId":{"type":"string","description":"The flow you asked for."},"hasSubFlows":{"type":"boolean","description":"`true` when the flow's steps include a sub-flow, started or not."},"showSubFlowSwitch":{"type":"boolean","description":"`true` when at least one sub-flow is one you can open, or has not started yet: progress with sub-flows then differs from this flow's own."},"truncated":{"type":"boolean","description":"`true` when the flow has more sub-flows than one tree reads in full (200). Each one past that is a `subflow` row with its `childFlowId` and status, no rows beneath it and `progress: null`, and is not in `progress`. Read it with its own tree."},"progress":{"allOf":[{"$ref":"#/components/schemas/FlowTreeProgress"},{"description":"This flow's actions plus those of every sub-flow it waits for that you can open, at every depth. Always actions, never iterations."}]},"viewerAssigneeId":{"type":["string","null"],"description":"Your id (`usr_…`) in this organization. It is the same id the rows use for you, so a filter for you matches your steps. `null` when you have no id here."},"rows":{"type":"array","items":{"$ref":"#/components/schemas/FlowTreeRow"},"description":"Every step you can see, in order. A sub-flow or `group` row is followed by its own rows, one level deeper. A branch's paths that did not run are left out."}},"required":["flowId","hasSubFlows","showSubFlowSwitch","truncated","progress","viewerAssigneeId","rows"],"additionalProperties":false},"AddFlowStepPersonRef":{"type":"object","properties":{"uniqueId":{"type":"string","minLength":1,"description":"Org-scoped partner identity for a person already in your organization.","example":"cust_984431"},"userId":{"type":"string","minLength":1,"description":"Person id from `GET /v1/users` (`usr_…`).","example":"usr_01HZXK3N8P9Q2R4S6T7V8W9X0Y"},"email":{"type":"string","format":"email","description":"A person's email. In `assignees`, someone in your organization or someone new, whom the add adds as an external user; for preparers and reviewers, someone already in your organization.","example":"leo.park@example.com"},"roleId":{"type":"string","minLength":1,"description":"A role's id, from `roles[].id` on `GET /v1/flows/{id}`. Whoever holds the role gets the step; if nobody holds it, the step waits.","example":"role-customer"}},"additionalProperties":false},"AddFlowSubFlowRole":{"type":"object","properties":{"roleId":{"type":"string","minLength":1,"description":"A role of the sub-flow's template, by its key, its id or its exact name (`roles[]` on `GET /v1/templates/{id}`). One the template does not have returns `400 VALIDATION_FAILED` naming it; a name two of its roles share, naming both by key and id.","example":"role-compliance-reviewer"},"userId":{"type":"string","minLength":1,"description":"The person who fills it, from `GET /v1/users`.","example":"usr_01HZXK3N8P9Q2R4S6T7V8W9X0Y"},"email":{"type":"string","format":"email","description":"The person who fills it, by the email of someone in your organization.","example":"dana@example.com"},"fromRoleId":{"type":"string","minLength":1,"description":"A role of this flow, by its key, its id or its exact name (`roles[]` on `GET /v1/flows/{id}`): everyone who holds it fills the sub-flow's role. One this flow does not have returns `400 VALIDATION_FAILED` naming it. A role several people hold, sent into a role for one person, returns `400 SUB_FLOW_ROLE_HAS_SEVERAL`.","example":"role-account-lead"}},"required":["roleId"],"additionalProperties":false},"AddFlowSubFlow":{"type":"object","properties":{"templateId":{"type":"string","minLength":1,"description":"The published template to start, from `GET /v1/templates`. A template you may not start returns `403 SUB_FLOW_CHILD_NOT_STARTABLE_BY_EDITOR`; one not published `400 SUB_FLOW_CHILD_NOT_PUBLISHED`; an archived one `400 SUB_FLOW_CHILD_UNAVAILABLE`; one published again while this request ran `409 SUB_FLOW_CHILD_CHANGED` (send it again).","example":"tpl_broker_questionnaire"},"name":{"type":"string","minLength":1,"maxLength":200,"description":"The sub-flow's name, and the step's. Defaults to the template's name.","example":"Questionnaire: Prime brokerage"},"start":{"type":"string","enum":["now","later"],"default":"now","description":"`now` (the default) starts it at once, beside the step the flow is on: that step stays open, and finishing the sub-flow never moves this flow past it. During a For each it goes right after the loop and starts beside the items. With nothing in progress it is refused (`409 NOTHING_IN_PROGRESS`), on a paused flow too (`409 FLOW_PAUSED_START_NOW`), and while your organization is over its flow quota (`402 ORG_FROZEN`): never queued. `later` puts it in the flow's order (at `afterStepId`, or at the end) and it starts when the flow reaches it.","example":"now"},"waitFor":{"type":"string","enum":["started","finished"],"default":"started","description":"`started` (the default): the step is done once the sub-flow has started, and this flow carries on. `finished`: the step stays open until the sub-flow finishes.","example":"started"},"matchRoles":{"type":"boolean","default":true,"description":"Fill each role of the sub-flow you leave out from a role of this flow with the same id, or with a name both have once. Only roles a person fills by hand are matched: a role the template fills itself (org chart, a fixed person, a team desk, rules) keeps its own answer.","example":true},"roleAssignments":{"type":"array","items":{"$ref":"#/components/schemas/AddFlowSubFlowRole"},"maxItems":100,"description":"Who fills the sub-flow's roles. A role left empty after matching stays to be decided in the sub-flow, as on a flow started without it, except one the sub-flow cannot start without (the host of a meeting it opens with), which returns `400 SUB_FLOW_CHILD_ROLE_UNMAPPED` naming it. A person sent for a role the org chart or a fixed person fills returns `400 ROLE_FILLED_FROM_ORG_CHART` or `400 ROLE_ASSIGNED_AUTOMATICALLY`; one sent for a role rules fill replaces the rule, as when starting a flow."},"customFields":{"type":"array","items":{"$ref":"#/components/schemas/CustomFieldValueInput"},"description":"The sub-flow's start details, each field by its `key` from `GET /v1/templates/{id}` on the sub-flow's template, checked as a start checks them: a missing required one returns `400 START_FIELD_REQUIRED`, a field's id or label in `key` and any other problem `400 VALIDATION_FAILED`. A File field takes the `fileId` of a document already on this flow.","example":[{"key":"broker","value":"Prime brokerage"},{"key":"due_back","value":"2026-11-14"}]},"deskSelections":{"type":"object","additionalProperties":{"type":"string","minLength":1},"description":"The team desk for each role of the sub-flow whose desk is chosen at start, each role by its key, its id or its exact name. One missing returns `400 SUB_FLOW_DESK_REQUIRED`; a desk not in your organization `404 DESK_NOT_FOUND`.","example":{"role-onboarding-desk":"dsk_7f3a"}}},"required":["templateId"],"additionalProperties":false},"AddFlowBranchPathStep":{"type":"object","properties":{"type":{"type":"string","enum":["FORM","TODO","APPROVAL","FILE_REQUEST","ACKNOWLEDGEMENT","DECISION","QUESTIONNAIRE","CHECKLIST"],"description":"The step type to add: one of `FORM`, `TODO`, `APPROVAL`, `FILE_REQUEST`, `ACKNOWLEDGEMENT`, `DECISION`, `QUESTIONNAIRE` or `CHECKLIST`. Required unless you send `subFlow`. A For each or another branch can't go in a path added this way.","example":"TODO"},"name":{"type":"string","minLength":1,"maxLength":500,"description":"The step's name. Required with `type`.","example":"KYC check"},"description":{"type":"string","maxLength":10000,"description":"Longer instructions shown with the step."},"config":{"type":"object","additionalProperties":{},"description":"Settings for this step type, as for a step added on its own (`config` on the request)."},"assignees":{"type":"array","items":{"$ref":"#/components/schemas/AddFlowStepPersonRef"},"minItems":1,"description":"Who does the step: people (`{ userId }` or `{ email }`) or roles of this flow (`{ roleId }`), not both (`400 VALIDATION_FAILED`). The step has no run until its branch starts, so each person is added to the flow as a role that always goes to them, as a template step with a fixed person is, and holds it from now: when the branch starts, the step is theirs. Two steps for the same person share one role. People are judged by the same rule as on a step added on its own (`assignees` on the request): someone deactivated returns `400 ASSIGNEE_NOT_INVITABLE`, and someone new by email is added as an external user, which needs `external_users:write` for an API key (else `403 INSUFFICIENT_SCOPE`). With two or more people or roles, set `completion.mode`.","example":[{"email":"leo.park@example.com"}]},"completion":{"type":"object","properties":{"mode":{"type":"string","enum":["ONE","ALL"],"description":"How several people finish the step: `ONE`, any one of them; `ALL`, every one of them.","example":"ONE"}},"required":["mode"],"additionalProperties":false,"description":"With two or more people or roles, how they finish the step. The same `completion` a step added on its own takes.","example":{"mode":"ALL"}},"subFlow":{"allOf":[{"$ref":"#/components/schemas/AddFlowSubFlow"},{"description":"Start another flow from this path instead of a step of `type`, with `start: \"later\"`: it starts when the path reaches it. Send it on its own."}]}},"additionalProperties":false},"AddFlowBranchPath":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200,"description":"The path's name, as people see it.","example":"KYC"},"steps":{"type":"array","items":{"$ref":"#/components/schemas/AddFlowBranchPathStep"},"minItems":1,"maxItems":50,"description":"The path's steps, in order. They run one after another once the branch starts."}},"required":["name","steps"],"additionalProperties":false},"AddFlowStepRequest":{"type":"object","properties":{"type":{"type":"string","enum":["FORM","TODO","APPROVAL","FILE_REQUEST","ACKNOWLEDGEMENT","DECISION","QUESTIONNAIRE","CHECKLIST","PARALLEL_BRANCH"],"description":"The step type to add: one of `FORM`, `TODO`, `APPROVAL`, `FILE_REQUEST`, `ACKNOWLEDGEMENT`, `DECISION`, `QUESTIONNAIRE` or `CHECKLIST`. Required unless you send `subFlow`. `PARALLEL_BRANCH` adds a branch whose `paths` all start together when the flow reaches it, and the step after it waits for every path (see `paths`).","example":"TODO"},"name":{"type":"string","minLength":1,"maxLength":500,"description":"The step's name, as people see it. Required with `type`.","example":"Collect the signed W-9"},"paths":{"type":"array","items":{"$ref":"#/components/schemas/AddFlowBranchPath"},"minItems":2,"maxItems":10,"description":"With `type: \"PARALLEL_BRANCH\"` only, and required with it: the branch's paths, at least 2. The branch goes at the top level of the flow, before or after a step the flow has not reached (`afterStepId` or `beforeStepId`, or at the end). It goes live as Edit process puts a change live in the app, with the same checks: a place in front of a step that has started returns `422 STRAND`, an anchor inside a path `400 VALIDATION_FAILED`. Its steps have no run until the branch starts: `paths[].steps` in the answer lists their `stepId`s. A path can't be added to a branch that has already started: it counted its paths when it started."},"subFlow":{"allOf":[{"$ref":"#/components/schemas/AddFlowSubFlow"},{"description":"Start another flow from this one, as a sub-flow linked to it, instead of adding a step of `type`. Send it on its own: not with `type`, `name`, `description`, `config` or assignees. `afterStepId` and `beforeStepId` apply only with `start: \"later\"`. `afterStepId` may name a step inside a path, as for any step (see `afterStepId`): a sub-flow on a running path goes after the last action that has started, or after a later action that has not, and starts when the step before it finishes. The step after the branch waits for it. A role of the sub-flow the org chart fills, that neither a manager nor the template's fallback can take, returns `422 ORG_CHART_NO_APPROVER` and nothing is added."}]},"description":{"type":"string","maxLength":10000,"description":"Longer instructions shown with the step.","example":"Ask the client to upload the signed form before Friday."},"assignees":{"type":"array","items":{"$ref":"#/components/schemas/AddFlowStepPersonRef"},"minItems":1,"description":"Who does the step. Each entry is one of `{ userId }` (from `GET /v1/users`), `{ email }`, or `{ roleId }`; one person is a list of one. People and roles together return `400 VALIDATION_FAILED`. Each person must be active: a deactivated person returns `400 ASSIGNEE_NOT_INVITABLE` (never reactivated), and an AI agent or a service account is refused. An email no one in your organization has adds that person as an external user, as a flow start does, in the same change as the step: that needs the right to add external users (`external_users:write` for an API key), else `403 INSUFFICIENT_SCOPE` and nothing is added. With two or more people, set `completion.mode`. Leave it out to leave the step unassigned.","example":[{"userId":"usr_01HZXK3N8P9Q2R4S6T7V8W9X0Y"}]},"completion":{"type":"object","properties":{"mode":{"type":"string","enum":["ONE","ALL"],"description":"How several people finish the step: `ONE`, any one of them; `ALL`, every one of them.","example":"ONE"}},"required":["mode"],"additionalProperties":false,"description":"With two or more people, how they finish the step. The same `completion` a template step holds. An older flat `completionMode` is still read as this, with a `Deprecation` header.","example":{"mode":"ALL"}},"preparers":{"type":"object","properties":{"people":{"type":"array","items":{"$ref":"#/components/schemas/AddFlowStepPersonRef"},"minItems":1,"description":"The people or roles for this part of the step."},"completionMode":{"type":"string","enum":["ONE","ALL"],"description":"How several people finish the step: `ONE`, any one of them; `ALL`, every one of them.","example":"ONE"}},"required":["people"],"additionalProperties":false,"description":"People who set the step up before the assignee acts."},"reviewers":{"type":"object","properties":{"people":{"type":"array","items":{"$ref":"#/components/schemas/AddFlowStepPersonRef"},"minItems":1,"description":"The people or roles for this part of the step."},"completionMode":{"type":"string","enum":["ONE","ALL"],"description":"How several people finish the step: `ONE`, any one of them; `ALL`, every one of them.","example":"ONE"}},"required":["people"],"additionalProperties":false,"description":"People who review the assignee's work."},"afterStepId":{"type":"string","minLength":1,"description":"Put the new step immediately after this one, and it starts when this one is done: this is how to make a step wait for a task. Send `steps[].stepId` or `steps[].id` from `GET /v1/flows/{id}`. Omit it to add the step at the end. A value that names no step of this flow is refused. If that spot is behind work that has already started, the step is placed at the earliest allowed spot and `placement.reanchored` is `true`. A step sent with `config.skipSequentialOrder: true` does not wait for the step before it: after a top-level step that has started (in progress or completed) it stays where you name, even behind the step the flow is on, and starts at once. It may also name a step inside a path, listed under `steps[].paths[]`: the new step goes immediately after it, and `placement` reports `containerStepId` and `pathId`. On a path that is running, that step has to be the last one that has started, or a later step that has not. The path has to still be open. A finished path, a path the flow did not take, a Decision that has started and not been answered, a path of a Decision the flow did not take, an approval that has started, an anchor before the last action that has started, or a path nested more than one level deep returns `409 PATH_CLOSED`. On the path a Decision chose, while that path is still open, the new step goes after the last action that has started, including a Decision inside a parallel or choice branch. In a branch, decision or approval that has not started yet, the step is added to the path wherever you name, and goes live as Edit process puts a change live: it has no run until its path starts, so the answer has `started: false`, `id: null` and `status: null`, and a person it goes to is added to the flow as a role that always goes to them, and holds it from now, as in a new branch's path (see `paths`). A repeating section can't be used here.","example":"step-2"},"beforeStepId":{"type":"string","minLength":1,"description":"Put the new step immediately before this top-level step instead, as Edit process does in the app. Send `steps[].stepId` or `steps[].id` from `GET /v1/flows/{id}`. Don't send it with `afterStepId`. The step must not have started, and the flow must not have moved past it: otherwise the request returns `409 INSERT_BEFORE_STARTED_STEP` and nothing is added (the step is never placed somewhere else). A step sent with `config.skipSequentialOrder: true` may go before a step that has started, once the step before that one has started too, and starts at once. A value that names no top-level step of this flow returns `404 NOT_FOUND`.","example":"step-4"},"milestone":{"anyOf":[{"type":"object","properties":{"milestoneId":{"type":"string","minLength":1,"description":"A milestone next to where the step lands: `steps[].milestone.id` on Get flow.","example":"ms-review"}},"required":["milestoneId"],"additionalProperties":false},{"type":"object","properties":{"newMilestoneName":{"type":"string","minLength":1,"maxLength":80,"description":"The new milestone's name, up to 80 characters, not already a milestone of this flow.","example":"Sanctions screening"}},"required":["newMilestoneName"],"additionalProperties":false}],"description":"The milestone the step goes into, when the flow has milestones where it lands. `{ milestoneId }` joins one next to it: the one it lands inside, or, right after the last step of a milestone, that one or the next. `{ newMilestoneName }` starts a new milestone at this step, and the steps after it in the same milestone move into the new one. Leave it out to join the milestone of the step before it, as before. A milestone that is not next to where the step lands returns `409 MILESTONE_NOT_HERE`, as does a new milestone for a step placed further on than asked (`placement.reanchored`). A choice where there are no milestones returns `400 NO_MILESTONES_HERE`; a name already used, `409 MILESTONE_NAME_TAKEN`. Milestone ids are `steps[].milestone.id` on Get flow.","example":{"newMilestoneName":"Sanctions screening"}},"continueIfCompleted":{"type":"boolean","description":"When `true`, a finished flow is reopened first, as Continue does in the app, and then the step is added. Without it, a finished flow returns `400 INVALID_STATE`.","example":true},"reason":{"type":"string","maxLength":500,"description":"Why the step is being added. It is kept with the step for people who review the flow later.","example":"The client asked for a W-9 before we can pay them."},"config":{"type":"object","additionalProperties":{},"description":"Settings for this step type. See the operation description for a working example of each step type (file request limits, form fields, decision outcomes, questionnaire questions, checklist items, and shared keys like `stepDue` and link `attachments`). A decision or approval added here is one step: do not put other steps inside it. A decision needs at least 2 options in `outcomes`, each with a `label`, for example `[{\"label\":\"Approve\"},{\"label\":\"Send back\"}]`. Leave `outcomeId` out and one is created for each option. Every setting is checked before anything is added, and a request that cannot work adds nothing. A key this step type doesn't have, or a value outside its limits, returns `400 INVALID_STEP_SETTINGS`; a setting your plan doesn't include returns `400 CAPABILITY_DISABLED`; and `skipSequentialOrder` together with `dependsOnStepIds` returns `400 CONFLICTING_START_RULES`, because a step starts either with the previous step or after specific steps, never both. `dependsOnStepIds` lets the step start sooner, once those steps are done, even while the step before it is still open; it never makes it wait longer (to make it wait for a task, use `afterStepId`). Send `steps[].stepId` values from `GET /v1/flows/{id}`. An id that names no step of this flow returns `404 NOT_FOUND`, naming the parameter; a step that comes after this one's place returns `400 INVALID_STEP_SETTINGS` (`WAITS_FOR_LATER_STEP`). Every problem comes back at once in `error.details`, each naming its `field` such as `config.fileRequest.maxFiles`.","example":{"fileRequest":{"maxFiles":3,"instructions":"PDF preferred"},"stepDue":{"type":"RELATIVE","value":3,"unit":"DAYS","dayType":"calendar"}}}},"additionalProperties":false},"AddFlowStepPlacement":{"type":"object","properties":{"requestedAfterStepId":{"type":["string","null"],"description":"The `afterStepId` you sent, or `null` when you left it out."},"requestedBeforeStepId":{"type":["string","null"],"description":"The `beforeStepId` you sent. Present only when you sent one."},"afterStepId":{"type":["string","null"],"description":"The step the new one sits after, once it is placed."},"stepIndex":{"type":"integer","description":"Zero-based position of the new step after this call."},"reanchored":{"type":"boolean","description":"`true` when the spot you asked for was behind work that had already started, so the step was moved forward to the earliest allowed place."},"containerStepId":{"type":"string","description":"The branch, decision or approval whose path the step went into. Absent for a step at the top level.","example":"s-route"},"pathId":{"type":"string","description":"The path the step went into (`steps[].paths[].pathId` on Get flow). Absent for a step at the top level.","example":"p-high"},"milestone":{"type":"object","properties":{"id":{"type":"string","description":"The milestone's id, as `steps[].milestone.id` on Get flow."},"name":{"type":"string","description":"The milestone's name."},"created":{"type":"boolean","description":"`true` when this add started the milestone (`newMilestoneName`)."}},"required":["id","name","created"],"additionalProperties":false,"description":"The milestone the step joined or started. Absent where the flow has no milestones.","example":{"id":"milestone_8f2c1a","name":"Sanctions screening","created":true}},"branchStepId":{"type":"string","deprecated":true,"description":"Deprecated: the step whose path holds the added step, the same as `containerStepId`. Read `containerStepId`; this field is still sent so integrations built on it keep working."}},"required":["requestedAfterStepId","afterStepId","stepIndex","reanchored"],"additionalProperties":false},"AddFlowStepResponse":{"type":"object","properties":{"id":{"type":["string","null"],"description":"This run of the step (also `steps[].id` on Get flow). `null` only when `started` is `false`: the step has no run yet. Accepted as `afterStepId`, and as `{stepId}` on Get step, Skip, Reassign, Remind, Reopen, Complete, Decline, and Complete preparation phase.","example":"a3f1c2e4-5b6d-4e7f-8a9b-0c1d2e3f4a5b"},"stepId":{"type":"string","description":"Stable id of this step on the flow (also `steps[].stepId` on Get flow). Also accepted as `{stepId}` on every step endpoint and as `afterStepId`. The step exists only on this flow: another flow from the same template doesn't have it.","example":"dynamic_ab12cd34"},"type":{"type":"string","enum":["FORM","TODO","APPROVAL","FILE_REQUEST","ACKNOWLEDGEMENT","DECISION","QUESTIONNAIRE","CHECKLIST","SUB_FLOW","PARALLEL_BRANCH"],"description":"The step type to add: one of `FORM`, `TODO`, `APPROVAL`, `FILE_REQUEST`, `ACKNOWLEDGEMENT`, `DECISION`, `QUESTIONNAIRE` or `CHECKLIST`. `SUB_FLOW` for a step added with `subFlow`, `PARALLEL_BRANCH` for a branch.","example":"TODO"},"name":{"type":"string","description":"The step's name, as people see it.","example":"Collect the signed W-9"},"executionId":{"type":["string","null"],"deprecated":true,"description":"Deprecated: this run of the step, the same as `id`. Read `id`; this field is still sent so integrations built on it keep working."},"templateStepId":{"type":"string","deprecated":true,"description":"Deprecated: the step on the flow, the same as `stepId`. Read `stepId`; this field is still sent so integrations built on it keep working."},"stepType":{"type":"string","enum":["FORM","TODO","APPROVAL","FILE_REQUEST","ACKNOWLEDGEMENT","DECISION","QUESTIONNAIRE","CHECKLIST","SUB_FLOW","PARALLEL_BRANCH"],"deprecated":true,"description":"Deprecated: the step's type, the same as `type`. Read `type`; this field is still sent so integrations built on it keep working."},"stepName":{"type":"string","deprecated":true,"description":"Deprecated: the step's name, the same as `name`. Read `name`; this field is still sent so integrations built on it keep working."},"stepIndex":{"type":"integer","description":"Zero-based position of the step on the flow after this call.","example":2},"status":{"type":["string","null"],"enum":["PENDING","AWAITING_HOST_SETUP","AWAITING_CONNECTION","AWAITING_BUNDLE","WAITING_FOR_ASSIGNEE","PREPARING","IN_PROGRESS","REVIEWING","PAUSED","COMPLETED","SKIPPED","CANCELLED","FAILED","SUPERSEDED",null],"description":"State of the step right after it was added. A step placed after the one the flow is on stays pending until the flow reaches it. A step added to a paused flow stays pending until the flow resumes. `null` only when `started` is `false`.","example":"PENDING"},"started":{"type":"boolean","description":"`true` when the step has its run on the flow (`id`). `false` when it went into a path of a branch, decision or approval that has not started: it is in the flow's process and gets its run when its path starts, and `id` and `status` are `null`.","example":true},"paths":{"type":"array","items":{"type":"object","properties":{"pathId":{"type":"string","description":"The path (`steps[].paths[].pathId` on Get flow)."},"name":{"type":"string","description":"Its name."},"steps":{"type":"array","items":{"type":"object","properties":{"stepId":{"type":"string","description":"The step on the flow, accepted as `afterStepId` and on every step endpoint once it has a run."},"type":{"type":"string","enum":["FORM","TODO","APPROVAL","FILE_REQUEST","ACKNOWLEDGEMENT","DECISION","QUESTIONNAIRE","CHECKLIST","SUB_FLOW"],"description":"Its type."},"name":{"type":"string","description":"Its name."}},"required":["stepId","type","name"],"additionalProperties":false},"description":"The path's steps, in order."}},"required":["pathId","name","steps"],"additionalProperties":false},"description":"Present for a branch (`type: \"PARALLEL_BRANCH\"`): its paths and their steps."},"placement":{"allOf":[{"$ref":"#/components/schemas/AddFlowStepPlacement"},{"description":"Where the step landed relative to what you asked for."}]},"flowReopened":{"type":"boolean","description":"`true` when `continueIfCompleted` reopened a finished flow before adding the step."},"subFlow":{"type":"object","properties":{"flowId":{"type":["string","null"],"description":"The sub-flow, once it has started: with `start: \"now\"` this is usually set. `null` while it is starting, or with `start: \"later\"`. Find it later with `GET /v1/flows?originFlowId={id}`.","example":"5b8e2f14-3c7a-4d91-a0e6-9f2b7c4d1a38"},"roles":{"type":"array","items":{"type":"object","properties":{"roleId":{"type":"string","description":"A role of the sub-flow.","example":"role-compliance-reviewer"},"name":{"type":"string","description":"Its name.","example":"Compliance reviewer"},"filledBy":{"type":"string","enum":["mapping","automatic","org_chart","desk","later"],"description":"`mapping`: the people you sent or matched. `org_chart`: the org chart's pick, named in `people`. `automatic`: the template fills it (a fixed person, rules). `desk`: a team desk. `later`: a step in the sub-flow fills it.","example":"mapping"},"people":{"type":"array","items":{"type":"object","properties":{"userId":{"type":["string","null"],"description":"The person, from `GET /v1/users`."},"name":{"type":"string","description":"Their name."}},"required":["userId","name"]},"description":"Who fills it, when that is known now."}},"required":["roleId","name","filledBy","people"]},"description":"Who each role of the sub-flow went to."}},"required":["flowId","roles"],"description":"Present when the step was added with `subFlow`."}},"required":["id","stepId","type","name","stepIndex","status","started","placement"],"additionalProperties":false},"ReviewApproveRequest":{"type":"object","properties":{"notes":{"type":"string","maxLength":5000,"description":"A note shown to the person who submitted the step, with the approval. Up to 5,000 characters."},"timeEntry":{"type":"object","additionalProperties":false,"properties":{"minutes":{"type":"integer","minimum":1,"maximum":1439,"description":"The time spent, in whole minutes, 1 to 1439."},"billable":{"type":"boolean","description":"Whether the time is billable."},"description":{"type":["string","null"],"maxLength":500,"description":"What the time was spent on, up to 500 characters. Leave it out, or send `null` or an empty string, for none."}},"required":["minutes","billable"],"description":"Time tracking only: the time the reviewer spent, as `minutes` (1 to 1439), `billable` and an optional `description` (up to 500 characters). Ignored when the flow doesn't track time or the reviewer isn't on your team. A value that isn't valid returns `400 TIME_ENTRY_INVALID` with its `field`."},"timePrompt":{"type":"boolean","description":"Time tracking only: `true` when the screen asked for time. When the template requires time and this is `true`, a request without `timeEntry` returns `400 TIME_ENTRY_REQUIRED`."}}},"ReviewDeclineRequest":{"type":"object","properties":{"packetAskIds":{"type":"array","items":{"type":"string","minLength":1,"maxLength":200},"minItems":1,"maxItems":30,"description":"Packet steps only, and required there: the step ids of the parts to redo. Every signature after the first part picked is redone too. Parts not picked stay done."},"reason":{"type":"string","minLength":1,"maxLength":5000,"description":"What the person who submitted the step should change. Required and not blank, 1 to 5,000 characters. They see it on the returned step, and it is recorded as a Returned note when the flow has Notes turned on."},"dropFileIds":{"type":"array","items":{"type":"string","minLength":1},"maxItems":500,"description":"File request steps only, when your organization lets reviewers keep or reject individual files (ignored otherwise): ids of the submitted files to reject. Files not listed are kept. Leave it out to reject every submitted file."},"formRequestChanges":{"type":"object","properties":{"appendRows":{"anyOf":[{"type":"object","properties":{"fieldId":{"type":"string","minLength":1,"maxLength":200},"rows":{"type":"array","items":{"type":"object","additionalProperties":{"anyOf":[{"type":"string","maxLength":5000},{"type":"number"},{"type":"boolean"},{"type":"null"}]}},"minItems":1,"maxItems":50}},"required":["fieldId","rows"]},{"type":"array","items":{"type":"object","properties":{"fieldId":{"type":"string","minLength":1,"maxLength":200},"rows":{"type":"array","items":{"type":"object","additionalProperties":{"anyOf":[{"type":"string","maxLength":5000},{"type":"number"},{"type":"boolean"},{"type":"null"}]}},"minItems":1,"maxItems":50}},"required":["fieldId","rows"]},"minItems":1,"maxItems":20}],"description":"Rows to append to repeating groups on this form: a list with one entry per group (up to 20 groups, each named once), or a single entry for one group. Each row names its cells by column id (a column name or key is also accepted). Up to 50 rows in total. Answer columns are left empty."},"addFields":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string","minLength":1,"maxLength":200},"type":{"type":"string","enum":["TEXT_SINGLE_LINE","TEXT_MULTI_LINE","DATE","FILE_UPLOAD","SINGLE_SELECT"]},"required":{"type":"boolean"},"options":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string","minLength":1,"maxLength":200,"description":"What the choice stores when picked."},"label":{"type":"string","minLength":1,"maxLength":200,"description":"What the person sees."}},"required":["value","label"],"additionalProperties":false},"maxItems":50,"description":"Single select only: the choices, each `{ value, label }`."}},"required":["label","type"],"additionalProperties":false},"minItems":1,"maxItems":30,"description":"Fields to add on this form only. A single select needs `options`."},"lockPriorAnswers":{"type":"boolean","description":"When `true`, answers already on the form can't be changed after it is sent back."}},"description":"Changes to ask for on a form step, when your organization allows them on a send back: rows or fields added to this run, with the same form reopened. Leave it out to send back with a note only."},"timeEntry":{"type":"object","additionalProperties":false,"properties":{"minutes":{"type":"integer","minimum":1,"maximum":1439,"description":"The time spent, in whole minutes, 1 to 1439."},"billable":{"type":"boolean","description":"Whether the time is billable."},"description":{"type":["string","null"],"maxLength":500,"description":"What the time was spent on, up to 500 characters. Leave it out, or send `null` or an empty string, for none."}},"required":["minutes","billable"],"description":"Time tracking only: the time the reviewer spent, as `minutes` (1 to 1439), `billable` and an optional `description` (up to 500 characters). Ignored when the flow doesn't track time or the reviewer isn't on your team. A value that isn't valid returns `400 TIME_ENTRY_INVALID` with its `field`."},"timePrompt":{"type":"boolean","description":"Time tracking only: `true` when the screen asked for time. When the template requires time and this is `true`, a request without `timeEntry` returns `400 TIME_ENTRY_REQUIRED`."}},"required":["reason"]},"ReviewGroupMarkRequest":{"type":"object","properties":{"invocationEpoch":{"type":"integer","minimum":0,"description":"The item's `invocationEpoch` as you read it. An item that moved since returns `409 REVIEW_ITEM_CHANGED`."},"marked":{"type":"boolean","description":"`true` to mark the item reviewed, `false` to take the mark off."}},"required":["invocationEpoch","marked"],"additionalProperties":false},"ReviewGroupApproveRequest":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"stepExecutionId":{"type":"string","minLength":1,"maxLength":80,"description":"The item's own run, from the list."},"invocationEpoch":{"type":"integer","minimum":0,"description":"The item's `invocationEpoch` as you read it."}},"required":["stepExecutionId","invocationEpoch"],"additionalProperties":false},"minItems":1,"maxItems":500,"description":"The items to approve, each with the `invocationEpoch` you read. At most 500."},"notes":{"type":"string","maxLength":4000,"description":"A note saved with each approval. Up to 4,000 characters."}},"required":["items"],"additionalProperties":false},"ResolveOutputRequest":{"oneOf":[{"type":"object","properties":{"choice":{"type":"string","enum":["record"],"description":"Picks `recordId` from the waiting list."},"recordId":{"type":"string","format":"uuid","description":"The record id from the waiting list."},"round":{"type":"string","maxLength":80,"description":"The list's round. When the records changed, nothing is saved and the call returns the current list."}},"required":["choice","recordId"],"additionalProperties":false},{"type":"object","properties":{"choice":{"type":"string","enum":["none"],"description":"Follows the step's no-match setting."},"recordId":{"type":"string","format":"uuid","description":"Ignored. A client may still send the id of a record it did not pick."},"round":{"type":"string","maxLength":80,"description":"The list's round. When the records changed, nothing is saved and the call returns the current list."}},"required":["choice"],"additionalProperties":false}]},"FlowAccessRequest":{"type":"object","properties":{"id":{"type":"string","description":"The request's id. Send it to approve or decline the request."},"requester":{"allOf":[{"$ref":"#/components/schemas/User"},{"description":"The person who asked to join the flow."}]},"requestedAt":{"type":"string","format":"date-time","description":"When they asked (ISO 8601)."}},"required":["id","requester","requestedAt"],"additionalProperties":false},"FlowNote":{"type":"object","properties":{"id":{"type":"string","description":"The note's id."},"body":{"type":"string","description":"The note, as text or cleaned HTML (`bodyFormat`)."},"bodyFormat":{"type":"string","enum":["text","html"],"description":"Whether `body` is plain text or HTML."},"source":{"type":"string","enum":["composer","submit","return"],"description":"`composer`: written in Notes. `submit`: left with a submitted step. `return`: left when a step was sent back."},"createdAt":{"type":"string","description":"When it was written (ISO 8601)."},"actor":{"type":"object","properties":{"id":{"type":"string","description":"The writer's public id (`usr_…`)."},"name":{"type":"string","description":"The writer's name."},"email":{"type":"string","description":"The writer's email, when you may see it."}},"required":["id","name"],"additionalProperties":false,"description":"Who wrote the note."},"step":{"type":"object","properties":{"id":{"type":"string","description":"The step run it is on, when it had started."},"executionId":{"type":"string","deprecated":true,"description":"Deprecated: the step run the note is on, the same as `id`. Read `id`; this field is still sent so integrations built on it keep working."},"stepId":{"type":"string","description":"The step it is on."},"name":{"type":"string","description":"The step's name."},"number":{"type":"number","description":"The step's number in the flow, as the app shows it."}},"required":["name"],"additionalProperties":false,"description":"The step the note is on. Absent on a note for the whole flow."}},"required":["id","body","bodyFormat","source","createdAt","actor"],"additionalProperties":false},"DocCollabPage":{"type":"object","additionalProperties":{},"description":"The collaboration as the app shows it to you: its mode and phase, the sides and who is on each, whose turn it is, the versions and their documents, your side's draft, the held copies, the sections, and what you may do now (`permissions`). People are named by their public id (`usr_…`). You see what the person the token belongs to sees in the app: the other side's draft never."},"DocCollabActAnswer":{"type":"object","properties":{"view":{"$ref":"#/components/schemas/DocCollabPage"},"result":{"type":"object","additionalProperties":{},"description":"What the act produced, when it produced something to name: a new version's number, whether the documents are now agreed, how many people a reminder reached."},"idempotent":{"type":"boolean","enum":[true],"description":"Present on a retry with the same `Idempotency-Key`: the act was already done, and `view` is the page as it stands now."}},"required":["view"],"additionalProperties":false,"description":"The page after the act, as the app shows it to you, and what the act produced."},"DocCollabPartComment":{"type":"object","properties":{"id":{"type":"string","description":"The comment's id."},"partId":{"type":["string","null"],"description":"The part it is on."},"kind":{"type":"string","enum":["text","document"],"description":"`text`: on a passage (`textAnchor`). `document`: on the whole part."},"page":{"type":"number","description":"Always `0` on a part."},"x":{"type":"number","description":"Always `0` on a part."},"y":{"type":"number","description":"Always `0` on a part."},"width":{"type":"number","description":"Always `0` on a part."},"height":{"type":"number","description":"Always `0` on a part."},"body":{"type":"string","description":"What the comment says."},"parentId":{"type":["string","null"],"description":"For a reply, the comment it replies to."},"textAnchor":{"type":["object","null"],"properties":{"quote":{"type":"string","description":"The passage's words."},"prefix":{"type":"string","description":"The words just before it."},"suffix":{"type":"string","description":"The words just after it."},"from":{"type":"string","description":"Where the passage starts in the part."},"to":{"type":"string","description":"Where it ends."}},"required":["quote","prefix","suffix"],"additionalProperties":false,"description":"The passage it is on, or `null` on the whole part."},"suggestion":{"type":"null","description":"Always `null` on a part."},"audienceSideId":{"type":["string","null"],"description":"`null`: everyone who reads the part reads it. A side's id: only that side."},"onDraft":{"type":"boolean","description":"It is on your side's unsent draft."},"mentionedUserIds":{"type":"array","items":{"type":"string"},"description":"The people it names, by public id (`usr_…`)."},"mentions":{"type":"array","items":{"type":"object","properties":{"userId":{"type":"string","description":"Their public id (`usr_…`)."},"displayName":{"type":"string","description":"Their name."}},"required":["userId","displayName"],"additionalProperties":false},"description":"The people it names."},"resolvedAt":{"type":["string","null"],"description":"When its thread was resolved (ISO 8601), or `null`."},"authorUserId":{"type":["string","null"],"description":"Who wrote it, by public id (`usr_…`)."},"authorName":{"type":["string","null"],"description":"Who wrote it, by name."},"authorIsExternal":{"type":"boolean","description":"Whether its writer is outside your organization."},"isMine":{"type":"boolean","description":"You wrote it."},"createdAt":{"type":"string","description":"When it was written (ISO 8601)."}},"required":["id","partId","kind","page","x","y","width","height","body","parentId","textAnchor","suggestion","audienceSideId","onDraft","mentionedUserIds","mentions","resolvedAt","authorUserId","authorName","isMine","createdAt"],"additionalProperties":false,"description":"A comment on a part of a document written in Moxo."},"PreparedDocumentVersion":{"type":"object","properties":{"id":{"type":"string","description":"The version's id. Download it, or restore it, by this id."},"kind":{"type":"string","enum":["filled","edited","uploaded","restored"],"description":"`filled`: the Word template filled with the flow's data as the action started. `edited`: saved in Moxo's editor. `uploaded`: an edited copy uploaded. `restored`: a copy of an earlier version."},"fileName":{"type":"string","description":"The Word file's name."},"createdAt":{"type":"string","description":"When the version was made (ISO 8601)."},"createdByName":{"type":"string","description":"Who made it. Absent on `filled`."},"pageCount":{"type":"number","description":"Its pages, once Moxo has made its PDF."}},"required":["id","kind","fileName","createdAt"],"additionalProperties":false,"description":"One version of the document."},"PreparedDocumentSuggestion":{"type":"object","properties":{"id":{"type":"string","description":"The suggestion's id. Accept or dismiss it by this id."},"source":{"type":"string","enum":["prepare","advise"],"description":"`prepare`: the AI preparer's value for a placeholder no flow data fills. `advise`: the AI advisor's change to the latest version."},"kind":{"type":"string","enum":["fill","replace","insert","comment"],"description":"`fill`: `text` in place of the placeholder. `replace`: `text` in place of `anchor.quote`. `insert`: `text` right after `anchor.quote`. `comment`: a note on `anchor.quote` that changes nothing (dismiss it once read)."},"anchor":{"type":"object","properties":{"quote":{"type":"string","description":"The exact text it applies to; for a `fill`, the placeholder as written, such as `{{Territory}}`."},"placeholder":{"type":"string","description":"For a `fill`: the placeholder's name."},"paragraph":{"type":"integer","description":"The paragraph the quote is in (from 0), when the quote appears more than once."},"start":{"type":"integer","description":"Where the quote starts in that paragraph (a character offset)."},"end":{"type":"integer","description":"Where the quote ends in that paragraph."}},"required":["quote"],"additionalProperties":false,"description":"Where in the document it applies."},"text":{"type":"string","description":"The new text. Empty for a `comment`."},"why":{"type":"string","description":"Why the AI suggests it."},"from":{"type":"string","description":"Where it came from, as the step names it, such as a form's name or \"What to look for\"."},"citations":{"type":"array","items":{"type":"object","properties":{"document":{"type":"string","description":"The document it rests on."},"quote":{"type":"string","description":"The words in that document."}},"required":["document","quote"],"additionalProperties":false},"description":"The sources an advisor's suggestion rests on."}},"required":["id","source","kind","anchor","text","why","from"],"additionalProperties":false,"description":"An open AI suggestion, shown beside the document, never in it, until the person accepts or dismisses it."},"PreparedDocument":{"type":"object","properties":{"latest":{"$ref":"#/components/schemas/PreparedDocumentVersion"},"earlier":{"type":"array","items":{"$ref":"#/components/schemas/PreparedDocumentVersion"},"description":"The earlier versions, newest first."},"editingBy":{"type":"object","properties":{"name":{"type":"string","description":"Who has the document open in Moxo's editor."},"isYou":{"type":"boolean","description":"It is the person the token belongs to."}},"required":["name","isYou"],"additionalProperties":false,"description":"Present while someone has the document open in Moxo's editor: nobody else can change it then (`409 LOCKED`)."},"signatureCheck":{"type":"object","properties":{"versionId":{"type":"string","description":"The version that was checked."},"status":{"type":"string","enum":["pending","ok","failed","error"],"description":"`pending` while Moxo makes the version's PDF and reads it (submitting waits for it). `ok`: every signature label is in place. `failed`: one is not (`problems`). `error`: the check couldn't run."},"ok":{"type":"boolean","description":"`true` when every signature label a later E-Sign step follows is in place and blank."},"problems":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string","description":"The signature label."},"signer":{"type":"string","description":"The signer block it belongs to."},"reason":{"type":"string","enum":["missing","ambiguous","not_blank","unreadable"],"description":"What is wrong with it."}},"required":["label","reason"],"additionalProperties":false},"description":"What the check found, one entry per label."},"checkedAt":{"type":"string","description":"When it was checked (ISO 8601)."}},"required":["versionId","status","ok","problems","checkedAt"],"additionalProperties":false,"description":"What the signature check found on the latest version. The document can be submitted only when `ok`."},"unfilledPlaceholders":{"type":"array","items":{"type":"string"},"description":"The `{{placeholders}}` still in the latest version, which the person preparing it fills in before submitting."},"canEdit":{"type":"boolean","description":"The person the token belongs to may change the document now: the assignee, on their turn."},"submitBlockedReason":{"type":"string","enum":["editing_by_other","check_pending","check_failed","unfilled_placeholders"],"description":"Why the document can't be submitted now, when it can't: someone else has it open in the editor, the signature check is still running or found a problem, or placeholders are left to fill."},"nextPersonName":{"type":"string","description":"Who signs the document next, when that is one person."},"suggestions":{"type":"array","items":{"$ref":"#/components/schemas/PreparedDocumentSuggestion"},"description":"The open AI suggestions: the AI preparer's values for placeholders still unfilled, then the AI advisor's changes to the latest version. Empty when the step has no AI helper or none is open. Open ones are dismissed when the document is submitted."},"adviseChecked":{"type":"boolean","description":"`true` when the AI advisor has checked the latest version (with `suggestions` empty: it suggests nothing)."}},"required":["latest","earlier","unfilledPlaceholders","canEdit","suggestions","adviseChecked"],"additionalProperties":false,"description":"The document as the person preparing it sees it: the latest version, the earlier ones, and who may change it."},"PreparedDocumentState":{"anyOf":[{"$ref":"#/components/schemas/PreparedDocument"},{"type":"object","properties":{"notStarted":{"type":"boolean","enum":[true],"description":"The action isn't the assignee's yet (the step hasn't started), or it ended before the document was made: there is nothing to show or change."},"canEdit":{"type":"boolean","enum":[false],"description":"Always `false`: nothing can be changed yet."}},"required":["notStarted","canEdit"],"additionalProperties":false,"description":"Before the action is the assignee's: no document yet."}],"description":"The document and its versions, or, before the action is the assignee's, `notStarted`."},"PreparedDocumentUploadResult":{"anyOf":[{"type":"object","properties":{"ok":{"type":"boolean","enum":[true],"description":"The copy was kept."},"view":{"$ref":"#/components/schemas/PreparedDocument"}},"required":["ok","view"],"additionalProperties":false,"description":"The copy is the latest version now."},{"type":"object","properties":{"ok":{"type":"boolean","enum":[false],"description":"Nothing was kept."},"code":{"type":"string","enum":["OLDER_COPY"],"description":"Your copy is older than the document's latest changes."},"downloadedAt":{"type":"string","description":"When your copy was downloaded (ISO 8601)."},"newerEditAt":{"type":"string","description":"When the document was last changed since (ISO 8601)."}},"required":["ok","code","downloadedAt","newerEditAt"],"additionalProperties":false,"description":"Your copy was downloaded before newer changes. Send it again with `confirmOlderCopy=true` to replace them."},{"type":"object","properties":{"ok":{"type":"boolean","enum":[false],"description":"Nothing was kept."},"code":{"type":"string","enum":["NOT_WORD"],"description":"The file is not a Word document."}},"required":["ok","code"],"additionalProperties":false,"description":"The file is not a Word document (.docx). Nothing was kept."}],"description":"The upload's outcome."},"PreparedDocumentAcceptSuggestionResult":{"anyOf":[{"type":"object","properties":{"ok":{"type":"boolean","enum":[true],"description":"The change was made."},"view":{"$ref":"#/components/schemas/PreparedDocument"}},"required":["ok","view"],"additionalProperties":false,"description":"The change is in a new latest version, made as your own edit."},{"type":"object","properties":{"ok":{"type":"boolean","enum":[false],"description":"Nothing was changed."},"code":{"type":"string","enum":["EDITING","STALE","DECIDED"],"description":"`EDITING`: the document is open in Moxo's editor; accept it there. `STALE`: the text it applies to is no longer in the latest version. `DECIDED`: it was already accepted or dismissed."}},"required":["ok","code"],"additionalProperties":false,"description":"The suggestion couldn't be accepted now."}],"description":"The accept's outcome."},"PreparedDocumentDismissSuggestionResult":{"anyOf":[{"type":"object","properties":{"ok":{"type":"boolean","enum":[true],"description":"The suggestion was set aside."},"view":{"$ref":"#/components/schemas/PreparedDocument"}},"required":["ok","view"],"additionalProperties":false,"description":"The document, without the suggestion."},{"type":"object","properties":{"ok":{"type":"boolean","enum":[false],"description":"Nothing was changed."},"code":{"type":"string","enum":["DECIDED"],"description":"It was already accepted or dismissed."}},"required":["ok","code"],"additionalProperties":false,"description":"The suggestion was already decided."}],"description":"The dismissal's outcome."},"DeskSummary":{"type":"object","properties":{"id":{"type":"string","description":"The desk's id, used wherever the API refers to a desk, such as `roles[].desk.id` and `steps[].assignees[].desk.id`.","example":"desk_acme_kyc"},"name":{"type":"string","description":"The desk's name.","example":"KYC Reviewers"},"description":{"type":["string","null"],"description":"What the desk handles.","example":"All KYC reviews for new onboarding flows."},"routingKey":{"type":["string","null"],"description":"The value that sends work to this desk when a template role assigns work by a field value. A flow whose field holds exactly this text, in any case, is assigned to this desk. Unique within your organization. `null` when the desk takes no work assigned by a field.","example":"US Bank"},"memberCount":{"type":"integer","description":"How many users are on the desk."},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","name","description","routingKey","memberCount","createdAt","updatedAt"],"additionalProperties":false},"DeskDetail":{"type":"object","properties":{"id":{"type":"string","description":"The desk's id, used wherever the API refers to a desk, such as `roles[].desk.id` and `steps[].assignees[].desk.id`.","example":"desk_acme_kyc"},"name":{"type":"string","description":"The desk's name.","example":"KYC Reviewers"},"description":{"type":["string","null"],"description":"What the desk handles.","example":"All KYC reviews for new onboarding flows."},"routingKey":{"type":["string","null"],"description":"The value that sends work to this desk when a template role assigns work by a field value. A flow whose field holds exactly this text, in any case, is assigned to this desk. Unique within your organization. `null` when the desk takes no work assigned by a field.","example":"US Bank"},"memberCount":{"type":"integer","description":"How many users are on the desk."},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"members":{"type":"array","items":{"$ref":"#/components/schemas/User"},"description":"The users on this desk. Any of them can pick up work sent to the desk."}},"required":["id","name","description","routingKey","memberCount","createdAt","updatedAt","members"],"additionalProperties":false},"ConversationInboxKind":{"type":"string","enum":["group","flow"],"description":"`group`: a group conversation. `flow`: a flow's chat, included in the conversation list. To list group conversations only, without flow chats, send `kind=group`.","example":"group"},"ConversationParticipant":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"kind":{"type":"string","enum":["internal","external","agent"]},"role":{"type":"string","enum":["manager","member"]},"email":{"type":"string","format":"email"}},"required":["id","name","kind","role"],"additionalProperties":false},"ConversationSummary":{"type":"object","properties":{"id":{"type":"string","description":"The conversation's id, or the flow's id on a flow chat."},"title":{"type":["string","null"]},"kind":{"$ref":"#/components/schemas/ConversationInboxKind"},"archived":{"type":"boolean"},"pictureUrl":{"type":["string","null"]},"participantCount":{"type":"integer"},"lastMessageAt":{"type":["string","null"],"format":"date-time"},"lastMessagePreview":{"type":["string","null"]},"unreadCount":{"type":"integer","description":"How many messages you haven't read. Present for personal access tokens and user sessions; absent for organization API keys."},"role":{"type":"string","enum":["manager","member"],"description":"Your role in a group conversation. Absent on flow chats, and for organization API keys, which aren't members."},"viewerOnly":{"type":"boolean","description":"True when you may read this group conversation and are not in it. Join to take part. Absent when you are already in it, on flow chats, and for organization API keys."},"updatedAt":{"type":"string","format":"date-time"},"flowId":{"type":"string"},"flowStatus":{"type":"string"},"flowTemplateId":{"type":["string","null"]}},"required":["id","title","kind","archived","pictureUrl","participantCount","lastMessageAt","lastMessagePreview"],"additionalProperties":false,"description":"One conversation in the list."},"ConversationDetail":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["group"]},"title":{"type":["string","null"]},"archived":{"type":"boolean"},"pictureUrl":{"type":["string","null"]},"showParticipantsToExternal":{"type":"boolean"},"participants":{"type":"array","items":{"$ref":"#/components/schemas/ConversationParticipant"}},"unreadCount":{"type":"integer","description":"How many messages you haven't read. Present for personal access tokens and user sessions; absent for organization API keys."},"role":{"type":"string","enum":["manager","member"],"description":"Your role in the conversation. Absent for organization API keys, which aren't members."},"viewerOnly":{"type":"boolean","description":"True when you may read this conversation and are not in it. Join to take part. Absent when you are already in it, and for organization API keys."}},"required":["id","kind","title","archived","pictureUrl","showParticipantsToExternal","participants"],"additionalProperties":false},"ConversationMessageAttachment":{"type":"object","properties":{"id":{"type":"string"},"fileName":{"type":"string"},"mimeType":{"type":"string"},"sizeBytes":{"type":"integer"}},"required":["id","fileName","mimeType","sizeBytes"],"additionalProperties":false},"ConversationMessageReaction":{"type":"object","properties":{"emoji":{"type":"string"},"count":{"type":"integer"},"reactedByMe":{"type":"boolean"}},"required":["emoji","count","reactedByMe"],"additionalProperties":false},"ConversationMessageAuthor":{"type":"object","properties":{"id":{"type":["string","null"]},"name":{"type":"string"},"kind":{"type":"string","enum":["internal","external","agent","system"]}},"required":["id","name","kind"],"additionalProperties":false},"ConversationMessage":{"type":"object","properties":{"id":{"type":"string"},"conversationId":{"type":"string"},"parentMessageId":{"type":["string","null"]},"author":{"$ref":"#/components/schemas/ConversationMessageAuthor"},"body":{"type":["string","null"]},"bodyFormat":{"type":"string","enum":["text","html"]},"deleted":{"type":"boolean"},"pinned":{"type":"boolean"},"createdAt":{"type":"string"},"editedAt":{"type":["string","null"]},"attachments":{"type":"array","items":{"$ref":"#/components/schemas/ConversationMessageAttachment"}},"removedFileCount":{"type":"integer","minimum":0,"description":"How many of the message's files were deleted since it was sent. They are not in `attachments`; show that a file was removed in their place."},"reactions":{"type":"array","items":{"$ref":"#/components/schemas/ConversationMessageReaction"}}},"required":["id","conversationId","parentMessageId","author","body","bodyFormat","deleted","pinned","createdAt","editedAt","attachments","removedFileCount","reactions"],"additionalProperties":false},"CreateConversation":{"type":"object","properties":{"title":{"type":["string","null"],"maxLength":200},"participants":{"type":"array","items":{"type":"object","properties":{"userId":{"type":"string","description":"The id of an existing user in your organization."},"email":{"type":"string","format":"email","description":"The email of an existing user in your organization."}},"additionalProperties":false},"maxItems":100,"description":"The people to add, each by `userId` or `email`."},"managers":{"type":"array","items":{"type":"object","properties":{"userId":{"type":"string","description":"The id of an existing user in your organization."},"email":{"type":"string","format":"email","description":"The email of an existing user in your organization."}},"additionalProperties":false},"maxItems":100,"description":"People on your team who manage the conversation from the start, beside the person who starts it. Each one must also be in `participants`. People outside your organization cannot be managers."},"showParticipantsToExternal":{"type":"boolean"},"startedBy":{"type":"object","properties":{"userId":{"type":"string","description":"The id of an existing user in your organization."},"email":{"type":"string","format":"email","description":"The email of an existing user in your organization."}},"additionalProperties":false,"description":"The person on your team who starts the conversation, and becomes its manager. Required with an organization API key. A personal access token always starts it as the person the token belongs to; leave this out."}},"additionalProperties":false},"AddConversationParticipants":{"type":"object","properties":{"participants":{"type":"array","items":{"type":"object","properties":{"userId":{"type":"string","description":"The id of an existing user in your organization."},"email":{"type":"string","format":"email","description":"The email of an existing user in your organization."}},"additionalProperties":false},"minItems":1,"maxItems":50,"description":"The people to add, each by `userId` or `email`."}},"required":["participants"],"additionalProperties":false},"PatchConversation":{"type":"object","properties":{"title":{"type":["string","null"],"maxLength":200}},"additionalProperties":false},"SendConversationMessage":{"type":"object","properties":{"body":{"type":"string","maxLength":120000,"description":"The message text, up to 32,000 visible characters (HTML markup does not count). May be empty when `attachmentFileIds` names a file."},"bodyFormat":{"type":"string","enum":["text","html"]},"parentMessageId":{"type":"string"},"mentionedUserIds":{"type":"array","items":{"type":"string"},"maxItems":50},"attachmentFileIds":{"type":"array","items":{"type":"string"},"maxItems":10}},"additionalProperties":false},"SdkSendConversationMessage":{"type":"object","properties":{"body":{"type":"string","maxLength":120000,"description":"The message text, up to 32,000 visible characters (HTML markup does not count)."},"bodyFormat":{"type":"string","enum":["text","html"]},"parentMessageId":{"type":"string"},"mentionedUserIds":{"type":"array","items":{"type":"string"},"maxItems":50}},"required":["body"],"additionalProperties":false},"ConversationFile":{"type":"object","properties":{"id":{"type":"string"},"fileName":{"type":"string"},"mimeType":{"type":"string"},"sizeBytes":{"type":"integer"},"folderId":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"}},"required":["id","fileName","mimeType","sizeBytes","folderId","createdAt"],"additionalProperties":false},"ConversationFolder":{"type":"object","properties":{"id":{"type":"string"},"parentFolderId":{"type":["string","null"]},"name":{"type":"string"}},"required":["id","parentFolderId","name"],"additionalProperties":false},"CreateConversationFolder":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":255,"description":"The folder's name. Spaces at either end are dropped. Two folders side by side can't share a name.","example":"Statements"},"parentFolderId":{"type":["string","null"],"minLength":1,"description":"Make it inside this folder, from List files. Leave it out (or send `null`) to make it at the top. Folders go at most three deep."}},"required":["name"],"additionalProperties":false},"RenameConversationFolder":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":255,"description":"The folder's new name. Spaces at either end are dropped.","example":"Statements 2026"}},"required":["name"],"additionalProperties":false},"ConversationUploadInit":{"type":"object","properties":{"fileName":{"type":"string","minLength":1,"maxLength":500,"description":"The file's name, with its extension. At most 500 characters."},"fileSize":{"type":"integer","exclusiveMinimum":0,"maximum":2147483648,"description":"The file's size in bytes, at most 2 GB. It counts toward the organization's storage."},"mimeType":{"type":"string","minLength":1,"maxLength":255,"description":"The file's type, such as `application/pdf`. The `PUT` sends it as `Content-Type`."},"folderId":{"type":["string","null"],"description":"A folder id from List files or Make a folder. Leave it out for the top level."}},"required":["fileName","fileSize","mimeType"],"additionalProperties":false},"ConversationFeedType":{"type":"string","enum":["message","file","action"],"description":"What the feed item is: a message, a file or an action."},"ConversationFeedMessageItem":{"type":"object","properties":{"id":{"type":"string"},"conversationId":{"type":"string"},"parentMessageId":{"type":["string","null"]},"author":{"$ref":"#/components/schemas/ConversationMessageAuthor"},"body":{"type":["string","null"]},"bodyFormat":{"type":"string","enum":["text","html"]},"deleted":{"type":"boolean"},"pinned":{"type":"boolean"},"createdAt":{"type":"string"},"editedAt":{"type":["string","null"]},"attachments":{"type":"array","items":{"$ref":"#/components/schemas/ConversationMessageAttachment"}},"removedFileCount":{"type":"integer","minimum":0,"description":"How many of the message's files were deleted since it was sent. They are not in `attachments`; show that a file was removed in their place."},"reactions":{"type":"array","items":{"$ref":"#/components/schemas/ConversationMessageReaction"}},"type":{"type":"string","enum":["message"]}},"required":["id","conversationId","parentMessageId","author","body","bodyFormat","deleted","pinned","createdAt","editedAt","attachments","removedFileCount","reactions","type"],"additionalProperties":false},"ConversationFeedFileItem":{"type":"object","properties":{"type":{"type":"string","enum":["file"]},"id":{"type":"string"},"fileName":{"type":"string"},"mimeType":{"type":"string"},"sizeBytes":{"type":"integer"},"createdAt":{"type":"string"}},"required":["type","id","fileName","mimeType","sizeBytes","createdAt"],"additionalProperties":false},"ConversationFeedActionItem":{"type":"object","properties":{"type":{"type":"string","enum":["action"]},"id":{"type":"string"},"title":{"type":"string"},"status":{"type":"string","enum":["open","completed","cancelled"]},"actionType":{"type":["string","null"]},"createdAt":{"type":["string","null"],"description":"When the action was sent."}},"required":["type","id","title","status","actionType","createdAt"],"additionalProperties":false},"ConversationFeedItem":{"oneOf":[{"$ref":"#/components/schemas/ConversationFeedMessageItem"},{"$ref":"#/components/schemas/ConversationFeedFileItem"},{"$ref":"#/components/schemas/ConversationFeedActionItem"}],"discriminator":{"propertyName":"type","mapping":{"message":"#/components/schemas/ConversationFeedMessageItem","file":"#/components/schemas/ConversationFeedFileItem","action":"#/components/schemas/ConversationFeedActionItem"}}},"ConversationActionSummary":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"status":{"type":"string","enum":["open","completed","cancelled"]},"actionType":{"type":["string","null"]}},"required":["id","title","status","actionType"],"additionalProperties":false},"ConversationActionDetail":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"description":{"type":["string","null"]},"status":{"type":"string","enum":["open","completed","cancelled"]},"actionType":{"type":["string","null"]},"createdAt":{"type":["string","null"]},"dueAt":{"type":["string","null"]},"completedAt":{"type":["string","null"]}},"required":["id","title","description","status","actionType","createdAt","dueAt","completedAt"],"additionalProperties":false},"SdkMe":{"type":"object","properties":{"userId":{"type":["string","null"],"description":"The person's user id in this organization (`usr_…`). Notification links carry the same id in `user_id`, so you can match the two without a lookup.","example":"usr_2f8a1c90d4b34e6f"},"name":{"type":"string","description":"The person's name in this organization.","example":"Sarah Chen"},"email":{"type":"string","description":"Email address.","example":"sarah@example.com"},"personaTarget":{"type":["string","null"],"enum":["magic_link","portal","orchestrator_portal",null],"description":"Where the session's persona works: `magic_link`, `portal` or `orchestrator_portal`. A portal session also carries `portalId`.","example":"portal"},"portalId":{"type":["string","null"],"description":"The portal this session belongs to. Null for magic link and orchestrator portal personas.","example":"prt_9c2e1b"},"organization":{"type":"object","properties":{"id":{"type":"string","description":"Organization id.","example":"org_1a2b3c"},"slug":{"type":["string","null"],"description":"Organization URL slug.","example":"ledgerline"},"name":{"type":["string","null"],"description":"Organization display name.","example":"Ledgerline"}},"required":["id","slug","name"],"additionalProperties":false,"description":"The organization this session belongs to."}},"required":["userId","name","email","personaTarget","portalId","organization"],"additionalProperties":false},"SdkDashboardFlow":{"type":"object","properties":{"id":{"type":"string","description":"Flow id.","example":"f7c2b8d1-4a3e-4f2b-9c1d-8e7a6b5c4d3e"},"name":{"type":"string","description":"Flow name.","example":"Q3 Client Onboarding for Sarah Chen"},"status":{"type":"string","enum":["IN_PROGRESS","COMPLETED","CANCELLED","PAUSED"],"description":"Flow lifecycle status.","example":"IN_PROGRESS"},"progress":{"type":"object","properties":{"completed":{"type":"integer","description":"Steps completed.","example":2},"total":{"type":"integer","description":"Total steps.","example":5}},"required":["completed","total"],"additionalProperties":false,"description":"Steps completed out of the steps this person can see. A participant's total can be smaller than a flow manager's for the same flow, so compare progress only between sessions for the same person."},"currentStepTypes":{"type":"array","items":{"type":"string"},"description":"The types of the active steps, each listed once, in flow order.","example":["FILE_REQUEST"]},"awaitingOn":{"type":["string","null"],"enum":["you","others",null],"description":"`you` when the signed-in person has a step to act on; `others` while the flow waits on someone else; `null` when the flow no longer waits on anyone. Use it to decide what to show first.","example":"you"},"isDue":{"type":"boolean","description":"True when the next step is due today or overdue.","example":false},"hasActivity":{"type":"boolean","description":"True once anything has happened on the flow. It decides whether the flow counts as new or in progress.","example":true},"unreadChatCount":{"type":"integer","description":"Unread in-flow chat messages for this user on the step their card opens.","example":0},"accessLevel":{"type":"string","description":"The caller's access to this flow: `participant`, `viewer`, `manager`, `owner` or `admin`.","example":"participant"},"nextStepDueAt":{"type":"string","description":"ISO-8601 due date of the next step. Present only when the organization shows deadlines to assignees.","example":"2026-08-29T23:59:59.000Z"},"createdAt":{"type":["string","null"],"description":"ISO-8601 flow start time.","example":"2026-08-12T09:00:00.000Z"},"updatedAt":{"type":["string","null"],"description":"ISO-8601 last activity time.","example":"2026-08-27T16:02:11.000Z"}},"required":["id","name","status","progress","currentStepTypes","awaitingOn","isDue","hasActivity","unreadChatCount","accessLevel","createdAt","updatedAt"],"additionalProperties":false},"SdkDashboard":{"type":"object","properties":{"summary":{"type":"object","properties":{"new":{"type":"integer","description":"Flows with no activity yet.","example":1},"inProgress":{"type":"integer","description":"Flows in progress.","example":3},"due":{"type":"integer","description":"Flows due today or overdue.","example":1},"completed":{"type":"integer","description":"Completed flows.","example":7}},"required":["new","inProgress","due","completed"],"additionalProperties":false,"description":"Counts for the dashboard summary cards."},"flows":{"type":"array","items":{"$ref":"#/components/schemas/SdkDashboardFlow"},"description":"The user's flows, most recent first."}},"required":["summary","flows"],"additionalProperties":false},"SdkFlowAssignee":{"type":"object","properties":{"id":{"type":["string","null"],"description":"The person's user id in this organization (`usr_…`), or null when the person can no longer be found.","example":"usr_2f8a1c90d4b34e6f"},"name":{"type":"string","description":"Display name.","example":"Sarah Chen"},"kind":{"type":"string","description":"`internal` (your own team), `external` (a client, vendor or partner) or `agent` (an AI agent).","example":"external"},"you":{"type":"boolean","description":"True when this assignee is the signed-in person.","example":true}},"required":["id","name","kind","you"],"additionalProperties":false},"SdkFlowStep":{"type":"object","properties":{"id":{"type":"string","description":"The step's execution id: the id the step endpoints take.","example":"9a41c6e2-7b3f-4d8a-b2c1-5e6f7a8b9c0d"},"stepId":{"type":"string","description":"The step's id in the template. The same for every run of this step.","example":"step_intake_docs"},"name":{"type":"string","description":"The step's name, as the Moxo portal shows it. A title set by the preparer takes precedence. Dynamic data is filled in when the caller sees the step in full, and left blank when they see progress only.","example":"Upload Q3 financial statements"},"type":{"type":"string","description":"The step type, such as `FORM`, `FILE_REQUEST` or `APPROVAL`.","example":"FILE_REQUEST"},"status":{"type":"string","description":"The step's status, such as `PENDING`, `IN_PROGRESS`, `COMPLETED` or `SKIPPED`.","example":"IN_PROGRESS"},"index":{"type":"integer","description":"Position in the flow (0-based).","example":2},"dueAt":{"type":["string","null"],"description":"ISO-8601 due date, or null.","example":null},"startedAt":{"type":["string","null"],"description":"ISO-8601 time the step started, or null before it starts.","example":"2026-08-27T09:00:00.000Z"},"completedAt":{"type":["string","null"],"description":"ISO-8601 completion time, or null.","example":null},"assignedToYou":{"type":"boolean","description":"True when the signed-in person is an assignee of this step.","example":true},"viewerTurn":{"$ref":"#/components/schemas/ViewerTurn"},"viewerManages":{"$ref":"#/components/schemas/ViewerManages"},"assignees":{"type":"array","items":{"$ref":"#/components/schemas/SdkFlowAssignee"},"description":"The step's current assignees."},"description":{"type":"string","description":"The step's description, as the Moxo portal shows it. Dynamic data is filled in when the caller sees the step in full, and left blank when they see progress only.","example":"Please review the 2027 engagement letter for Acme Wealth Ltd."},"attachmentCount":{"type":"integer","description":"How many files and links the step detail returns. Zero when the caller sees progress only.","example":1}},"required":["id","stepId","name","type","status","index","dueAt","startedAt","completedAt","assignedToYou","viewerTurn","viewerManages","assignees","description","attachmentCount"],"additionalProperties":false},"SdkStepAttachment":{"type":"object","properties":{"id":{"type":"string","description":"File id, or the link address for a web link.","example":"fil_7"},"kind":{"type":"string","enum":["file","link"],"description":"A file, or a web link.","example":"file"},"source":{"type":"string","enum":["reference","submission","generated"],"description":"Reference material, a submission, or a file the flow generated.","example":"reference"},"fromStepExecutionId":{"type":"string","description":"The step execution this file belongs to, when it is known and is not the step being read."},"fileName":{"type":"string","description":"File name, or the link title.","example":"Engagement letter 2027.pdf"},"mimeType":{"type":"string","description":"MIME type. Empty for a web link.","example":"application/pdf"},"fileSize":{"type":"integer","description":"Size in bytes. Zero for a web link.","example":284113},"url":{"type":"string","description":"Present on a web link. A file has no storage address here."},"generationStatus":{"type":"string","description":"`ready`, or `failed` when a generated file didn't finish. A failed file stays in the list, with no download link.","example":"failed"}},"required":["id","kind","source","fileName","mimeType","fileSize"],"additionalProperties":false},"SdkStepDetail":{"type":"object","properties":{"id":{"type":"string","description":"Step execution id.","example":"sx_42"},"type":{"type":"string","description":"Step type.","example":"APPROVAL"},"name":{"type":"string","description":"The step's name, as the Moxo portal shows it, with dynamic data filled in. A title set by the preparer takes precedence.","example":"Approve engagement letter"},"description":{"type":"string","description":"The step's description, as the Moxo portal shows it, with dynamic data filled in.","example":"Hi Dana, please review the 2027 engagement letter for Acme Wealth Ltd and approve to continue."},"viewerTurn":{"$ref":"#/components/schemas/ViewerTurn"},"viewerManages":{"$ref":"#/components/schemas/ViewerManages"},"attachments":{"type":"array","items":{"$ref":"#/components/schemas/SdkStepAttachment"},"description":"Reference materials the caller can see, including files resolved from earlier steps, plus this step's own visible files. A file from a form that hides another role's answer is left out."},"acknowledgementText":{"type":"string","description":"On an acknowledgement step, the same text as `description`, when that is not empty."},"buttonLabel":{"type":"string","description":"On an acknowledgement step, the words the author set for the button. Absent when they left it blank: the Moxo screen then shows its translated \"I Acknowledge\". This is not `acknowledgementText`."},"askedFingerprint":{"type":"string","description":"What the step asks as you read it, on a step whose question can change until the first answer (a to-do, acknowledgement, approval, decision, poll, checklist, file request, form, questionnaire, PDF form or e-signature). Send it back as `askedFingerprint` when you complete or decline: when what the step asks changed since, nothing is saved (`409 STEP_CHANGED`). Its name, due date and reminders do not change it.","example":"af1-3b0c9e14a2d75f68"}},"required":["id","type","name","description","viewerTurn","viewerManages","attachments"],"additionalProperties":false},"SdkFileDownload":{"type":"object","properties":{"id":{"type":"string","description":"File id.","example":"fil_7"},"fileName":{"type":"string","description":"File name.","example":"Engagement letter 2027.pdf"},"mimeType":{"type":"string","description":"MIME type.","example":"application/pdf"},"fileSize":{"type":"integer","description":"Size in bytes.","example":284113},"downloadUrl":{"type":"string","description":"Signed download link. It expires in 5 minutes."},"expiresAt":{"type":"string","description":"ISO-8601 time when the link stops working.","example":"2026-10-19T12:05:00.000Z"}},"required":["id","fileName","mimeType","fileSize","downloadUrl","expiresAt"],"additionalProperties":false},"SdkFlowDetail":{"type":"object","properties":{"id":{"type":"string","description":"Flow id.","example":"f7c2b8d1-4a3e-4f2b-9c1d-8e7a6b5c4d3e"},"name":{"type":"string","description":"Flow name.","example":"Q3 Client Onboarding for Sarah Chen"},"status":{"type":"string","description":"Flow lifecycle status.","example":"IN_PROGRESS"},"accessLevel":{"type":"string","description":"The caller's access to this flow. The response holds only what that access allows: participants and viewers see only the steps visible to them.","example":"participant"},"startedAt":{"type":["string","null"],"description":"ISO-8601 start time.","example":"2026-08-12T09:00:00.000Z"},"updatedAt":{"type":["string","null"],"description":"ISO-8601 last activity time.","example":"2026-08-27T16:02:11.000Z"},"completedAt":{"type":["string","null"],"description":"ISO-8601 completion time, or null.","example":null},"steps":{"type":"array","items":{"$ref":"#/components/schemas/SdkFlowStep"},"description":"The step runs the caller can see, in flow order."}},"required":["id","name","status","accessLevel","startedAt","updatedAt","completedAt","steps"],"additionalProperties":false},"SdkKickoffField":{"type":"object","properties":{"id":{"type":"string","description":"The field's id.","example":"a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d"},"key":{"type":"string","description":"The field's key, what the template's file calls it. Start values name the field by it in `customFields`.","example":"client_email"},"label":{"type":"string","description":"Field label to render.","example":"Client email"},"type":{"type":"string","description":"The field type, such as `TEXT_SINGLE_LINE`, `EMAIL`, `DROPDOWN` or `DATE`.","example":"EMAIL"},"required":{"type":"boolean","description":"True when the field must be filled to start the flow.","example":true},"helpText":{"type":"string","description":"Helper text to render under the field.","example":"We send the engagement letter here."},"placeholder":{"type":"string","description":"Placeholder text.","example":"name@example.com"},"options":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Option id. Submit this as the value.","example":"opt_q3"},"label":{"type":"string","description":"Option label to render.","example":"Q3 2026"}},"required":["id","label"],"additionalProperties":false},"description":"The choices for a `DROPDOWN` or `MULTI_SELECT` field."},"width":{"type":"string","enum":["full","half"],"description":"Layout hint.","example":"full"}},"required":["id","key","label","type","required"],"additionalProperties":false},"SdkTemplate":{"type":"object","properties":{"id":{"type":"string","description":"The template's id. Use it in your own links, and to start a flow with `POST /sdk/v1/flows`.","example":"tpl_8d4a13c8"},"name":{"type":"string","description":"The template's name, or its portal title when one is set.","example":"Q3 Client Onboarding"},"description":{"type":"string","description":"Description shown in the catalog.","example":"Collect documents, review, and sign off."},"stepCount":{"type":"integer","description":"How many steps the template has.","example":5},"kickoffFields":{"type":"array","items":{"$ref":"#/components/schemas/SdkKickoffField"},"description":"The start form's fields. Show them in your own UI to collect the values a flow starts with."},"initiatorFieldKeys":{"type":"array","items":{"type":"string"},"description":"Keys of the fields that take their value from the person starting the flow. Fill these in from the signed-in person and hide them, as Moxo's own start dialog does.","example":["client_email"]}},"required":["id","name","description","stepCount","kickoffFields","initiatorFieldKeys"],"additionalProperties":false},"SdkNotification":{"type":"object","properties":{"id":{"type":"string","description":"Notification id.","example":"ntf_5e6f7a8b"},"type":{"type":"string","description":"The kind of notification, such as `action_assigned` or `flow_completed`.","example":"action_assigned"},"title":{"type":"string","description":"Short title.","example":"New action for you"},"body":{"type":["string","null"],"description":"Body text, or null.","example":"Upload Q3 financial statements"},"flowId":{"type":["string","null"],"description":"Related flow id, or null.","example":"f7c2b8d1-4a3e-4f2b-9c1d-8e7a6b5c4d3e"},"stepExecutionId":{"type":["string","null"],"description":"Related step execution id, or null.","example":null},"readAt":{"type":["string","null"],"description":"ISO-8601 read time, or null while unread.","example":null},"createdAt":{"type":["string","null"],"description":"ISO-8601 creation time.","example":"2026-08-27T09:02:00.000Z"}},"required":["id","type","title","body","flowId","stepExecutionId","readAt","createdAt"],"additionalProperties":false},"SdkFieldCondition":{"type":"object","properties":{"fieldId":{"type":"string","description":"The field in the same form that this condition reads. Absent when the rule reads a value from outside the form (see `resolved`).","example":"a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d"},"operator":{"type":"string","description":"How to compare, such as `equals`, `not_equals`, `contains` or `greater_than`.","example":"equals"},"value":{"type":"string","description":"The comparison target, when the rule compares against a literal.","example":"opt_yes"},"compareValue":{"type":"string","description":"The comparison target when the rule compares against a value from an earlier step. Present only after that value has been resolved. It replaces `value`, and it does not change while the form is open. The reference itself is not sent.","example":"Gold"},"relativeValue":{"type":"object","properties":{"anchor":{"type":"string","enum":["today"]},"direction":{"type":"string","enum":["before","after"]},"offset":{"type":"integer"},"unit":{"type":"string","enum":["days","weeks","months","years"]}},"required":["anchor","direction","offset","unit"],"additionalProperties":false,"description":"For a date rule only: compare against a date counted from today when the rule is checked. Takes precedence over `value`."},"resolved":{"type":"boolean","description":"Present when the rule reads a value from outside this form: Moxo has already checked the rule, and this is the result. Treat it as fixed while the form is open. The outside value itself is not sent.","example":true},"columnId":{"type":"string","description":"Present when `fieldId` is a Look up a record field and the rule compares one column of the picked record. With several picks, a positive operator holds when any picked record matches, `not_equals` when none does. For an option column, `value` is the option id.","example":"col_9f2c1a"},"columnType":{"type":"string","enum":["text","number","date","timestamp","choice","checkbox"],"description":"With `columnId`: how to compare that column. The lookup's columns are not sent. `text` is text, email, phone or a link. `number` compares as a number. `date` compares as a calendar date. `timestamp` only answers whether the cell is empty. `choice` is an option column: `value` is the option id and `compareLabel` is its current name. `checkbox` compares `true` or `false`, and a blank cell is false.","example":"number"},"compareLabel":{"type":"string","description":"With `columnId` on an option column: the option name as the table has it now. Compare the picked record's cell with this name.","example":"Gold"}},"required":["operator"],"additionalProperties":false},"SdkFieldConditionalLogic":{"type":"object","properties":{"action":{"type":"string","enum":["show","hide"],"description":"What happens when the rule matches."},"logicType":{"type":"string","enum":["all","any"],"description":"Whether every condition must match, or any one."},"conditions":{"type":"array","items":{"$ref":"#/components/schemas/SdkFieldCondition"}}},"required":["action","logicType","conditions"],"additionalProperties":false},"SdkFormField":{"type":"object","properties":{"id":{"type":"string","description":"The field's id. Key your answers by it when you complete the step.","example":"a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d"},"key":{"type":"string","description":"A readable key, when the field has one.","example":"account_number"},"label":{"type":"string","description":"The field's label, with dynamic data already filled in.","example":"Account number"},"type":{"type":"string","description":"The field type, such as `TEXT_SINGLE_LINE`, `EMAIL`, `DROPDOWN`, `DATE` or `FILE_UPLOAD`.","example":"TEXT_SINGLE_LINE"},"required":{"type":"boolean","description":"True when the field must be filled to complete the step.","example":true},"description":{"type":"string","description":"Helper text to render under the field.","example":"As printed on the statement."},"placeholder":{"type":"string","description":"Placeholder text.","example":"0000-0000"},"defaultValue":{"description":"The pre-filled value, already in the form the field type expects. For a choice question it names options by their `options[].id` (an array of ids for a multi-select)."},"options":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Option id. Submit this as the value.","example":"opt_q3"},"label":{"type":"string","description":"Option label to render.","example":"Q3 2026"}},"required":["id","label"],"additionalProperties":false},"description":"The choices for a `DROPDOWN`, `MULTI_SELECT` or `RADIO` field."},"conditionalLogic":{"allOf":[{"$ref":"#/components/schemas/SdkFieldConditionalLogic"},{"description":"When to show or hide this field. Check conditions on fields in the same form as the person types; a condition with `resolved` has already been checked and doesn't change."}]},"width":{"type":"string","enum":["full","half"],"description":"Layout hint.","example":"full"}},"required":["id","label","type","required"],"additionalProperties":false},"SdkStepFormSchema":{"type":"object","properties":{"stepExecutionId":{"type":"string","description":"The step execution this schema belongs to.","example":"se_1a2b3c4d"},"stepType":{"type":"string","description":"The step type, such as `FORM`, `FILE_REQUEST`, `APPROVAL` or `TODO`.","example":"FORM"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/SdkFormField"},"description":"The fields to show, in order: the same fields the Moxo portal shows the assignee."}},"required":["stepExecutionId","stepType","fields"],"additionalProperties":false},"SdkStepCompleteResult":{"type":"object","properties":{"step":{"type":"object","properties":{"id":{"type":"string","description":"Step execution id.","example":"se_1a2b3c4d"},"status":{"type":"string","description":"The step's status after this submission, such as `COMPLETED`, `IN_PROGRESS` while other assignees still have to submit, or `REVIEWING`.","example":"COMPLETED"}},"required":["id","status"],"additionalProperties":false},"flow":{"type":"object","properties":{"id":{"type":"string","description":"Flow id.","example":"f7c2b8d1-4a3e-4f2b-9c1d-8e7a6b5c4d3e"},"status":{"type":"string","description":"The flow's status after this submission.","example":"IN_PROGRESS"}},"required":["id","status"],"additionalProperties":false},"group":{"type":"object","properties":{"completedCount":{"type":"integer","description":"Assignees who have submitted so far.","example":2},"totalCount":{"type":"integer","description":"Assignees in the group.","example":3},"advanced":{"type":"boolean","description":"True when this submission satisfied the group and the flow advanced.","example":false}},"required":["completedCount","totalCount","advanced"],"additionalProperties":false,"description":"Present when several people must submit this step: your submission may be one of several it needs."},"postProcessing":{"type":"boolean","enum":[true],"description":"Present when the submission is recorded and the step completes once Moxo finishes renaming its files with AI. Read the flow again later for the result."}},"required":["step","flow"],"additionalProperties":false},"SdkStepDeclineResult":{"type":"object","properties":{"step":{"type":"object","properties":{"id":{"type":"string","description":"Step execution id.","example":"se_1a2b3c4d"},"status":{"type":"string","description":"The step's status after the decline.","example":"COMPLETED"}},"required":["id","status"],"additionalProperties":false},"decision":{"type":"string","enum":["REJECT","REQUEST_CHANGES"],"description":"What the decline did. A request for changes becomes `REJECT` when the template has no path for changes."},"reopenedStepIds":{"type":"array","items":{"type":"string"},"description":"Step executions reopened by a request for changes (empty for a final reject).","example":[]}},"required":["step","decision","reopenedStepIds"],"additionalProperties":false},"SdkStepUpload":{"type":"object","properties":{"fileId":{"type":"string","description":"The uploaded file's id. Send it in the matching field when you complete the step; a file the submission never names is not shown to anyone.","example":"fil_9c8d7e6f"},"fileName":{"type":"string","description":"Original file name.","example":"statement-q3.pdf"},"fileSize":{"type":"integer","description":"Size in bytes.","example":482133},"mimeType":{"type":"string","description":"Detected content type.","example":"application/pdf"},"scanStatus":{"type":"string","description":"The virus scan's result: `clean` or `skipped`. The scan runs before the upload is accepted, so this endpoint never returns a pending state.","example":"clean"}},"required":["fileId","fileName","fileSize","mimeType","scanStatus"],"additionalProperties":false},"SdkFlowStart":{"type":"object","properties":{"flowId":{"type":"string","description":"The new flow's id. Read the flow with `GET /sdk/v1/flows/{id}`. The response has no link or token: the session is the credential for every later call.","example":"f7c2b8d1-4a3e-4f2b-9c1d-8e7a6b5c4d3e"}},"required":["flowId"],"additionalProperties":false},"FlowTombstone":{"type":"object","properties":{"id":{"type":"string"},"deleted":{"type":"boolean","enum":[true]},"lastChangedAt":{"type":["string","null"],"format":"date-time"}},"required":["id","deleted","lastChangedAt"],"additionalProperties":false,"description":"A flow deleted at or after `updatedSince`, returned only to a caller who could see it: its id, that it was deleted, and when. Nothing else about it is returned."},"ReviewGroup":{"type":"object","properties":{"loopExecutionId":{"type":"string","description":"The For each run the items belong to."},"stepId":{"type":"string","description":"The step's template id."},"stepName":{"type":"string","description":"The step's name."},"approvalMode":{"type":"string","enum":["approve_all","approve_each"],"description":"`approve_all`: the loop moves items on together (Sync steps across items), so Approve all is for every item at once, enabled once every item is in. `approve_each`: each item moves on when approved; Approve all approves the items that are ready."},"items":{"type":"array","items":{"$ref":"#/components/schemas/ReviewGroupItem"},"description":"The items you may see: those you review, or every item when you manage the flow."},"canAct":{"type":"boolean","description":"You review at least one item. A flow manager who reviews none reads the list and acts on nothing, as on every review."}},"required":["loopExecutionId","stepId","stepName","approvalMode","items","canAct"],"description":"The items reviewed together."},"ReviewGroupItem":{"type":"object","properties":{"stepExecutionId":{"type":"string","description":"The item's own run. `review-approve` and `review-decline` take it to act on this item alone."},"invocationEpoch":{"type":"integer","description":"The run's round when read. Send it back with Mark reviewed and Approve all: an item that moved since is left alone."},"index":{"type":"integer","description":"The item's place in the loop, from 0."},"label":{"type":"string","description":"The item's name: the For each's Iteration label, else the item's own name, else \"Item N\"."},"assignee":{"type":["object","null"],"properties":{"name":{"type":["string","null"],"description":"Their name, or null."},"email":{"type":["string","null"],"description":"Their email, or null."}},"required":["name","email"],"description":"Who does the item's step, when known."},"state":{"type":"string","enum":["not_started","in_progress","ai_reviewing","ready","other_reviewer","sent_back","approved","skipped","failed"],"description":"`not_started`, `in_progress`, `ai_reviewing` (an AI reviews first), `ready` (yours to review now), `other_reviewer` (in review, someone else's turn), `sent_back`, `approved`, `skipped` or `failed`. Only `approved`, `skipped` and `failed` never hold up Approve all."},"marked":{"type":"boolean","description":"You marked this submission reviewed (items moving on together only). Not an approval; a resubmission clears it."},"submittedAt":{"type":["string","null"],"description":"When the item went into review (ISO 8601), or null."},"sentBackReason":{"type":["string","null"],"description":"What the reviewer asked for when the item was sent back, or null."}},"required":["stepExecutionId","invocationEpoch","index","label","assignee","state","marked","submittedAt","sentBackReason"]},"Change":{"oneOf":[{"$ref":"#/components/schemas/Change_add_step"},{"$ref":"#/components/schemas/Change_update_step"},{"$ref":"#/components/schemas/Change_remove_step"},{"$ref":"#/components/schemas/Change_move_step"},{"$ref":"#/components/schemas/Change_reorder_steps"},{"$ref":"#/components/schemas/Change_update_form_fields"},{"$ref":"#/components/schemas/Change_update_paths"},{"$ref":"#/components/schemas/Change_add_role"},{"$ref":"#/components/schemas/Change_update_role"},{"$ref":"#/components/schemas/Change_remove_role"},{"$ref":"#/components/schemas/Change_add_milestone"},{"$ref":"#/components/schemas/Change_update_milestone"},{"$ref":"#/components/schemas/Change_remove_milestone"},{"$ref":"#/components/schemas/Change_add_field"},{"$ref":"#/components/schemas/Change_update_field"},{"$ref":"#/components/schemas/Change_remove_field"},{"$ref":"#/components/schemas/Change_update_template_info"},{"$ref":"#/components/schemas/Change_update_permissions"},{"$ref":"#/components/schemas/Change_update_flow_start"},{"$ref":"#/components/schemas/Change_update_due_dates"},{"$ref":"#/components/schemas/Change_update_step_statuses"},{"$ref":"#/components/schemas/Change_update_flow_monitors"},{"$ref":"#/components/schemas/Change_update_settings"},{"$ref":"#/components/schemas/Change_add_artifact"},{"$ref":"#/components/schemas/Change_update_artifact"},{"$ref":"#/components/schemas/Change_remove_artifact"},{"$ref":"#/components/schemas/Change_update_template_tags"},{"$ref":"#/components/schemas/Change_update_block_interface"},{"$ref":"#/components/schemas/Change_update_connection_policy"},{"$ref":"#/components/schemas/Change_update_custom_agents"}],"discriminator":{"propertyName":"op","mapping":{"add_step":"#/components/schemas/Change_add_step","update_step":"#/components/schemas/Change_update_step","remove_step":"#/components/schemas/Change_remove_step","move_step":"#/components/schemas/Change_move_step","reorder_steps":"#/components/schemas/Change_reorder_steps","update_form_fields":"#/components/schemas/Change_update_form_fields","update_paths":"#/components/schemas/Change_update_paths","add_role":"#/components/schemas/Change_add_role","update_role":"#/components/schemas/Change_update_role","remove_role":"#/components/schemas/Change_remove_role","add_milestone":"#/components/schemas/Change_add_milestone","update_milestone":"#/components/schemas/Change_update_milestone","remove_milestone":"#/components/schemas/Change_remove_milestone","add_field":"#/components/schemas/Change_add_field","update_field":"#/components/schemas/Change_update_field","remove_field":"#/components/schemas/Change_remove_field","update_template_info":"#/components/schemas/Change_update_template_info","update_permissions":"#/components/schemas/Change_update_permissions","update_flow_start":"#/components/schemas/Change_update_flow_start","update_due_dates":"#/components/schemas/Change_update_due_dates","update_step_statuses":"#/components/schemas/Change_update_step_statuses","update_flow_monitors":"#/components/schemas/Change_update_flow_monitors","update_settings":"#/components/schemas/Change_update_settings","add_artifact":"#/components/schemas/Change_add_artifact","update_artifact":"#/components/schemas/Change_update_artifact","remove_artifact":"#/components/schemas/Change_remove_artifact","update_template_tags":"#/components/schemas/Change_update_template_tags","update_block_interface":"#/components/schemas/Change_update_block_interface","update_connection_policy":"#/components/schemas/Change_update_connection_policy","update_custom_agents":"#/components/schemas/Change_update_custom_agents"}},"description":"One change. A list of changes is applied in order and saved all together, or not at all. A change can use the `handle` of anything an earlier change in the same list adds, wherever an id goes; the response maps each handle to its new id. Guide: [Build templates from code](/docs/guides/build-templates-from-code)."},"Change_add_step":{"type":"object","properties":{"op":{"type":"string","enum":["add_step"],"description":"Add a step, at the top level or inside a path, an outcome, a loop or an approval branch."},"after":{"type":["string","null"],"description":"The step it goes after: a step id, the name of a step at that level, or a handle from earlier in this list. `null` puts it first."},"step":{"allOf":[{"$ref":"#/components/schemas/NewStep"},{"description":"The new step."}]},"pathId":{"type":"string","description":"The path the step goes in: a path id, or the handle of a path added earlier in this list. In a loop use `\"forEach\"`; in an approval use `\"approveBranch\"` or `\"rejectBranch\"`. Leave out for the top level."},"outcomeId":{"type":"string","description":"The Decision outcome the step goes in: an outcome id, or the handle of one added earlier in this list."},"parentStepId":{"type":"string","description":"The branch, Decision, loop or approval step that owns `pathId` or `outcomeId`: its id or its name. Required for `\"forEach\"`, `\"approveBranch\"` and `\"rejectBranch\"`."},"milestoneId":{"type":["string","null"],"description":"The milestone the step belongs to: its id, or the handle of one added earlier in this list. `null` takes it out of its milestone."}},"required":["op","after","step"],"additionalProperties":false,"title":"add_step","description":"Add a step, at the top level or inside a path, an outcome, a loop or an approval branch.","example":{"op":"add_step","after":null,"pathId":"trust","parentStepId":"step-route","step":{"handle":"trust_check","type":"TODO","config":{"name":"Check the trust deed","description":"The reviewer checks who controls the trust.","assignees":["Reviewer"],"stepDue":{"type":"RELATIVE","value":1,"unit":"DAYS"},"monitors":[{"trigger":{"kind":"timer.since_overdue","duration":{"value":0,"unit":"HOURS"}},"action":{"kind":"escalate","target":{"kind":"role","roleName":"Finance"}}}]}}}},"Change_update_step":{"type":"object","properties":{"op":{"type":"string","enum":["update_step"],"description":"Change a step's settings or its milestone. Only the settings you send change."},"stepId":{"type":"string","description":"The step's id or its name, or the `handle` of a step added earlier in this list."},"fields":{"allOf":[{"$ref":"#/components/schemas/StepSettingsChange"},{"description":"The settings to change. Settings you leave out keep their values; nested settings merge. A step's own file (the PDF to sign, review, fill or prepare, a spreadsheet template, a web app's HTML page) is `document: { ref: \"<fileId>\" }`, after uploading it to the step; a collaboration sets each document's `ref`. E-signature fields are `fields`: page, x, y, width and height (percent of the page) and the signer's `roleId`."}]},"milestoneId":{"type":["string","null"],"description":"The milestone the step belongs to: its id, or the handle of one added earlier in this list. `null` takes it out of its milestone."},"key":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,63}$","description":"The step's new key: what a template file and the run API name it by. Unique in the template. A published step keeps its key."}},"required":["op","stepId"],"additionalProperties":false,"title":"update_step","description":"Change a step's settings or its milestone. Only the settings you send change.","example":{"op":"update_step","stepId":"step-old-check","fields":{"assignees":["Legal"]}}},"Change_remove_step":{"type":"object","properties":{"op":{"type":"string","enum":["remove_step"],"description":"Remove a step."},"stepId":{"type":"string","description":"The step to remove: its id or its name."},"replacedBy":{"type":"string","description":"The step that now supplies the removed step's data: a step id or name, or a handle from earlier in this list. Whatever read the removed step reads this one instead. Without it, removing a step another step still reads is refused as `STEP_STILL_READ`, naming each reader: change or remove those steps in the same list. A reference is never blanked."}},"required":["op","stepId"],"additionalProperties":false,"title":"remove_step","description":"Remove a step.","example":{"op":"remove_step","stepId":"step-old-check"}},"Change_move_step":{"type":"object","properties":{"op":{"type":"string","enum":["move_step"],"description":"Move a step to directly after another step, including into the section that step is in. Name a path or outcome only when the destination is that specific one."},"stepId":{"type":"string","description":"The step to move: its id or its name."},"after":{"type":["string","null"],"description":"The step it goes after: its id or its name, wherever that step is. Leave out pathId, outcomeId and parentStepId to place this step in that step's section, directly after it. `null` puts it first in the section it is already in."},"pathId":{"type":"string","description":"The path to move it into. Leave out, along with outcomeId and parentStepId, to place the step directly after `after`. Set it only to target that path; then `after` must be a step in the path, or `null` to put the step first."},"outcomeId":{"type":"string","description":"The Decision outcome to move it into. Leave out, along with pathId and parentStepId, to place the step directly after `after`. Set it only to target that outcome; then `after` must be a step in the outcome, or `null` to put the step first."},"parentStepId":{"type":"string","description":"The branch, Decision, loop or approval that owns pathId or outcomeId: its id or its name. On its own it does not choose a section. Leave it out, with pathId and outcomeId, to place the step directly after `after`. Required with pathId `\"forEach\"`, `\"approveBranch\"` or `\"rejectBranch\"`."}},"required":["op","stepId","after"],"additionalProperties":false,"title":"move_step","description":"Move a step to directly after another step, including into the section that step is in. Name a path or outcome only when the destination is that specific one.","example":{"op":"move_step","stepId":"step-old-check","after":"step-intake"}},"Change_reorder_steps":{"type":"object","properties":{"op":{"type":"string","enum":["reorder_steps"],"description":"Set the order of every step at one level."},"orderedStepIds":{"type":"array","items":{"type":"string"},"description":"Every step at that level, each once, in the new order."},"pathId":{"type":"string","description":"The path whose steps to reorder. Leave out for the top level."},"outcomeId":{"type":"string","description":"The Decision outcome whose steps to reorder."},"parentStepId":{"type":"string","description":"The branch, Decision, loop or approval step that owns `pathId` or `outcomeId`: its id or its name. Required for `\"forEach\"`, `\"approveBranch\"` and `\"rejectBranch\"`."}},"required":["op","orderedStepIds"],"additionalProperties":false,"title":"reorder_steps","description":"Set the order of every step at one level.","example":{"op":"reorder_steps","orderedStepIds":["step-intake","step-route","step-old-check","step-review"]}},"Change_update_form_fields":{"type":"object","properties":{"op":{"type":"string","enum":["update_form_fields"],"description":"Add, change, remove or reorder the fields of a Form step. Fields you don't name keep their ids."},"stepId":{"type":"string","description":"The Form step: its id or its name, or the handle of a Form step added earlier in this list."},"ops":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"op":{"type":"string","enum":["add_field"]},"afterFieldId":{"type":["string","null"],"description":"The field it goes after: a field id, or the handle of a field added earlier. `null` puts it first."},"field":{"allOf":[{"$ref":"#/components/schemas/NewFormField"},{"description":"The new field: `handle`, `label`, `type`, and the settings its type takes. A question's label is never blank: a blank one is refused as `FIELD_LABEL_REQUIRED`."}]}},"required":["op","afterFieldId","field"],"additionalProperties":{}},{"type":"object","properties":{"op":{"type":"string","enum":["update_field"]},"fieldId":{"type":"string","description":"The field to change: its id, or the handle of a field added earlier in this list."},"patch":{"allOf":[{"$ref":"#/components/schemas/FormFieldChange"},{"description":"The settings to change, with the field's `type`."}]}},"required":["op","fieldId","patch"],"additionalProperties":{}},{"type":"object","properties":{"op":{"type":"string","enum":["remove_field"]},"fieldId":{"type":"string","description":"The field to remove. Rules that depend on it are removed too."}},"required":["op","fieldId"],"additionalProperties":{}},{"type":"object","properties":{"op":{"type":"string","enum":["reorder_fields"]},"fieldIds":{"type":"array","items":{"type":"string"},"minItems":1,"description":"Every field of the form, each once, in the new order."}},"required":["op","fieldIds"],"additionalProperties":{}}]},"minItems":1,"description":"The field changes, applied in order."}},"required":["op","stepId","ops"],"additionalProperties":false,"title":"update_form_fields","description":"Add, change, remove or reorder the fields of a Form step. Fields you don't name keep their ids.","example":{"op":"update_form_fields","stepId":"step-intake","ops":[{"op":"add_field","afterFieldId":"field-company-name","field":{"handle":"tax_id","label":"Tax ID","type":"TEXT_SINGLE_LINE"}}]}},"Change_update_paths":{"type":"object","properties":{"op":{"type":"string","enum":["update_paths"],"description":"Add, rename, remove or reorder the paths of a branch, or the outcomes of a Decision. The steps inside stay where they are."},"stepId":{"type":"string","description":"The branch or Decision step: its id or its name, or the handle of one added earlier in this list."},"ops":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"op":{"type":"string","enum":["add_path"]},"afterPathId":{"type":["string","null"],"description":"The path it goes after: a path id or a handle from earlier in this list. `null` puts it first. An Else path always stays last."},"path":{"type":"object","properties":{"handle":{"type":"string","minLength":1,"description":"A name you choose, unique in this list, so later changes in the same list can use it where an id goes. The response maps it to its new id in `ids`."},"key":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,63}$","description":"Its key: what a template file and the run API name it by. Lowercase letters, digits, _ and -, unique in the template. Leave out: its handle is its key."},"label":{"type":"string","minLength":1,"description":"The path's name."},"condition":{"anyOf":[{"$ref":"#/components/schemas/PathCondition"},{"type":"null"}],"description":"When the flow takes this path. `{ \"type\": \"ELSE\" }` is the path taken when no other matches."},"conditions":{"type":"array","items":{"anyOf":[{"$ref":"#/components/schemas/PathCondition"},{"type":"null"}]},"description":"Several rules for one path, combined by `conditionLogic`. Send this or `condition`, not both."},"conditionLogic":{"type":"string","enum":["ALL","ANY"],"description":"`ALL`: every rule must match (the default). `ANY`: one is enough."}},"required":["handle","label"],"additionalProperties":false,"description":"The new path. Add its steps with add_step, `pathId` set to this handle."}},"required":["op","afterPathId","path"],"additionalProperties":false},{"type":"object","properties":{"op":{"type":"string","enum":["update_path"]},"pathId":{"type":"string","minLength":1,"description":"The path to change: its id, or a handle from earlier in this list."},"patch":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,63}$","description":"The path's new key. Unique in the template. A published path keeps its key."},"label":{"type":"string","minLength":1,"description":"The path's new name."},"condition":{"anyOf":[{"$ref":"#/components/schemas/PathCondition"},{"type":"null"}],"description":"When the flow takes this path."},"conditions":{"type":"array","items":{"anyOf":[{"$ref":"#/components/schemas/PathCondition"},{"type":"null"}]},"description":"Several rules for one path, combined by `conditionLogic`."},"conditionLogic":{"type":"string","enum":["ALL","ANY"],"description":"`ALL` or `ANY`."}},"additionalProperties":false,"description":"What to change. Anything you leave out stays."}},"required":["op","pathId","patch"],"additionalProperties":false},{"type":"object","properties":{"op":{"type":"string","enum":["remove_path"]},"pathId":{"type":"string","minLength":1,"description":"The path to remove. Its steps are removed with it; move them out first to keep them."}},"required":["op","pathId"],"additionalProperties":false},{"type":"object","properties":{"op":{"type":"string","enum":["reorder_paths"]},"pathIds":{"type":"array","items":{"type":"string","minLength":1},"minItems":1,"description":"Every path of the branch, each once, in the new order."}},"required":["op","pathIds"],"additionalProperties":false},{"type":"object","properties":{"op":{"type":"string","enum":["add_outcome"]},"afterOutcomeId":{"type":["string","null"],"description":"The outcome it goes after. `null` puts it first."},"outcome":{"type":"object","properties":{"handle":{"type":"string","minLength":1,"description":"A name you choose, unique in this list, so later changes in the same list can use it where an id goes. The response maps it to its new id in `ids`."},"key":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,63}$","description":"Its key: what a template file and the run API name it by. Lowercase letters, digits, _ and -, unique in the template. Leave out: its handle is its key."},"label":{"type":"string","minLength":1,"description":"The outcome as the person deciding sees it."}},"required":["handle","label"],"additionalProperties":false,"description":"The new outcome. Add its steps with add_step, `outcomeId` set to this handle."}},"required":["op","afterOutcomeId","outcome"],"additionalProperties":false},{"type":"object","properties":{"op":{"type":"string","enum":["update_outcome"]},"outcomeId":{"type":"string","minLength":1,"description":"The outcome to rename."},"patch":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,63}$","description":"The outcome's new key. Unique in the template. A published outcome keeps its key."},"label":{"type":"string","minLength":1,"description":"The outcome's new name."}},"additionalProperties":false,"description":"What to change."}},"required":["op","outcomeId","patch"],"additionalProperties":false},{"type":"object","properties":{"op":{"type":"string","enum":["remove_outcome"]},"outcomeId":{"type":"string","minLength":1,"description":"The outcome to remove. Its steps are removed with it."}},"required":["op","outcomeId"],"additionalProperties":false},{"type":"object","properties":{"op":{"type":"string","enum":["reorder_outcomes"]},"outcomeIds":{"type":"array","items":{"type":"string","minLength":1},"minItems":1,"description":"Every outcome of the Decision, each once, in the new order."}},"required":["op","outcomeIds"],"additionalProperties":false}]},"minItems":1,"description":"The changes, applied in order: path changes for a branch, outcome changes for a Decision."}},"required":["op","stepId","ops"],"additionalProperties":false,"title":"update_paths","description":"Add, rename, remove or reorder the paths of a branch, or the outcomes of a Decision. The steps inside stay where they are.","example":{"op":"update_paths","stepId":"step-route","ops":[{"op":"add_path","afterPathId":"path-person","path":{"handle":"trust","label":"Trust","condition":{"type":"CONTAINS","left":"${{ steps.intake.fields.company_name }}","right":"Trust"}}}]}},"Change_add_role":{"type":"object","properties":{"op":{"type":"string","enum":["add_role"],"description":"Add a role."},"role":{"type":"object","properties":{"roleId":{"type":"string","description":"Leave out; use `handle`."},"handle":{"type":"string","description":"A name you choose, unique in this list, so later changes in the same list can use it where an id goes. The response maps it to its new id in `ids`."},"name":{"type":"string","minLength":1,"description":"The role's name. Steps are assigned to it by this name in `assignees`."},"key":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,63}$","description":"Its key: what a template file and the run API name it by. Lowercase letters, digits, _ and -, unique in the template. Leave out: its handle is its key."},"description":{"type":"string","description":"What the role does."},"resolution":{"$ref":"#/components/schemas/RoleResolutionChange"},"roleOptions":{"type":"object","properties":{"managerToggle":{"type":"boolean","description":"People in this role manage the flow."},"allowViewAllActions":{"type":"boolean","description":"People in this role see every step, not only their own."},"viewerOnly":{"type":"boolean","description":"The role only views the flow; it can't be assigned steps."},"allowViewAutomations":{"type":"boolean","description":"People in this role see automated steps."},"cardinality":{"type":"string","enum":["single","multi"],"description":"`single`: one person fills the role. `multi`: one or more people."},"completionMode":{"type":"string","enum":["ANY_ONE","ALL","MAJORITY"],"description":"When several people fill the role, how many must finish its steps: `ANY_ONE`, `MAJORITY` or `ALL`. Sent in a role's `options`, as the template read shows it, `ONE` is `ANY_ONE`."},"viewMode":{"type":"string","enum":["SPOTLIGHT","GALLERY"],"description":"How the role sees its steps: `SPOTLIGHT` (one at a time) or `GALLERY` (all at once)."}},"additionalProperties":{},"description":"What the role may see and do."},"notificationPrefs":{"type":"object","properties":{"delivery":{"type":"string","enum":["AUTO","PRIMARY_CHANNEL","ALL_CHANNELS"],"description":"Mirrors `sendVia`. Set `sendVia` instead."},"sendVia":{"type":"string","enum":["PRIMARY","ALL_CHANNELS"],"description":"Notify via: `PRIMARY` (each person's own channel) or `ALL_CHANNELS` (email and text). `ALL_CHANNELS` needs text messages turned on for your organization."},"escalateAfter":{"type":"string","enum":["NEVER","1_HOUR","4_HOURS","1_DAY","2_DAYS","1_WEEK"],"description":"Follow up after: how long a notification can go unseen before it is sent again on the person's other channels. `NEVER`, `1_HOUR`, `4_HOURS`, `1_DAY`, `2_DAYS` or `1_WEEK`."},"events":{"type":"object","properties":{"actionAssigned":{"type":"boolean","description":"When one of the role's actions is assigned."},"dueDateApproaching":{"type":"boolean","description":"Before an action's due date."},"dueDateApproachingDays":{"type":"array","items":{"type":"number"},"description":"Days before the due date to remind this role, one reminder each, e.g. [7, 1]. 1 to 5 reminders, each 1 to 365 days."},"actionDue":{"type":"boolean","description":"When an action is due."},"actionOverdue":{"type":"boolean","description":"When an action is overdue."},"actionOverdueRepeatDays":{"type":"number","description":"Days between overdue reminders."},"actionOverdueMaxTimes":{"type":"number","description":"The most overdue reminders one action sends."},"actionCompleted":{"type":"boolean","description":"When an action is completed."},"flowStarted":{"type":"boolean","description":"When the flow starts."},"flowOverdue":{"type":"boolean","description":"When the flow is overdue."},"flowOverdueRepeatDays":{"type":"number","description":"Days between flow overdue reminders."},"flowOverdueMaxTimes":{"type":"number","description":"The most flow overdue reminders sent."},"chatMessage":{"type":"boolean","description":"When a chat message is posted in the flow."},"addedAsViewer":{"type":"boolean","description":"When someone in the role is added as a viewer."},"milestoneCompleted":{"type":"boolean","description":"When a milestone is completed."},"flowCompleted":{"type":"boolean","description":"When the flow completes."}},"additionalProperties":false,"description":"Turn single notifications on or off for this role, e.g. `{ \"actionOverdue\": false }`. Each one you leave out follows the template."}},"additionalProperties":false,"description":"This role's own notification settings. Leave out to use the template's."}},"required":["name"],"additionalProperties":{},"description":"The new role."}},"required":["op","role"],"additionalProperties":false,"title":"add_role","description":"Add a role.","example":{"op":"add_role","role":{"handle":"legal","name":"Legal"}}},"Change_update_role":{"type":"object","properties":{"op":{"type":"string","enum":["update_role"],"description":"Change a role's name, description, or who fills it."},"roleId":{"type":"string","description":"The role to change: its id or its name."},"fields":{"allOf":[{"$ref":"#/components/schemas/RoleChange"},{"description":"What to change. Anything you leave out stays. A role's options are `roleOptions`, or `options` as the template read shows them."}]}},"required":["op","roleId","fields"],"additionalProperties":false,"title":"update_role","description":"Change a role's name, description, or who fills it.","example":{"op":"update_role","roleId":"role-reviewer","fields":{"name":"Compliance reviewer"}}},"Change_remove_role":{"type":"object","properties":{"op":{"type":"string","enum":["remove_role"],"description":"Remove a role."},"roleId":{"type":"string","description":"The role to remove: its id or its name."},"moveTo":{"type":"string","description":"The role that takes over its steps: a role id or name, or the handle of a role added in this list. It can't be a view-only role."}},"required":["op","roleId"],"additionalProperties":false,"title":"remove_role","description":"Remove a role.","example":{"op":"remove_role","roleId":"role-compliance"}},"Change_add_milestone":{"type":"object","properties":{"op":{"type":"string","enum":["add_milestone"],"description":"Add a milestone. Put steps in it with `milestoneId` on add_step or update_step. A milestone runs from its first step to the next milestone."},"milestoneId":{"type":"string","description":"Leave out; use `handle`."},"handle":{"type":"string","description":"A name you choose, unique in this list, so later changes in the same list can use it where an id goes. The response maps it to its new id in `ids`."},"name":{"type":"string","minLength":1,"description":"The milestone's name."},"key":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,63}$","description":"Its key: what a template file and the run API name it by. Lowercase letters, digits, _ and -, unique in the template. Leave out: its handle is its key."},"description":{"type":"string","description":"What happens in it."},"pathId":{"type":"string","description":"For a milestone inside a path: the path. Leave out for the top level."},"outcomeId":{"type":"string","description":"For a milestone inside a Decision outcome: the outcome."},"parentStepId":{"type":"string","description":"The step that owns `pathId` or `outcomeId`: its id or its name."}},"required":["op","name"],"additionalProperties":false,"title":"add_milestone","description":"Add a milestone. Put steps in it with `milestoneId` on add_step or update_step. A milestone runs from its first step to the next milestone.","example":{"op":"add_milestone","handle":"review_stage","name":"Review"}},"Change_update_milestone":{"type":"object","properties":{"op":{"type":"string","enum":["update_milestone"],"description":"Rename a milestone or change its description."},"milestoneId":{"type":"string","description":"The milestone to change."},"fields":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"The new name."},"description":{"type":["string","null"],"description":"The new description. `null` or an empty text: none."},"key":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,63}$","description":"The milestone's new key. Unique in the template. A published milestone keeps its key."}},"additionalProperties":false,"description":"What to change."}},"required":["op","milestoneId","fields"],"additionalProperties":false,"title":"update_milestone","description":"Rename a milestone or change its description.","example":{"op":"update_milestone","milestoneId":"milestone-intake","fields":{"name":"Getting started"}}},"Change_remove_milestone":{"type":"object","properties":{"op":{"type":"string","enum":["remove_milestone"],"description":"Remove a milestone. Its steps stay."},"milestoneId":{"type":"string","description":"The milestone to remove."}},"required":["op","milestoneId"],"additionalProperties":false,"title":"remove_milestone","description":"Remove a milestone. Its steps stay.","example":{"op":"remove_milestone","milestoneId":"milestone-intake"}},"Change_add_field":{"type":"object","properties":{"op":{"type":"string","enum":["add_field"],"description":"Add a flow field: asked for when a flow starts (with `input`), or set as it runs."},"field":{"type":"object","properties":{"key":{"type":"string","minLength":1,"description":"Its key: lowercase with underscores, unique on the template. Steps read it as `{Inputs / key}`."},"label":{"type":"string","minLength":1,"description":"Its label. A blank one is refused as `FIELD_LABEL_REQUIRED`."},"type":{"type":"string","minLength":1,"description":"Its type. `TEXT` is read as `TEXT_SINGLE_LINE`."},"options":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"object","properties":{"id":{"type":"string","description":"Keep an option's id. Leave out on a new one."},"label":{"type":"string","minLength":1,"description":"The option as people see it."},"value":{"type":"string","description":"The value a rule matches. Leave out to use the label."},"color":{"type":"string","description":"Its color."}},"required":["label"],"additionalProperties":{}}]},"description":"For a choice field: its options, as labels or `{ label }` objects."},"defaultValue":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"Its starting value."},"helpText":{"type":"string","description":"Help shown under it on a form."},"config":{"allOf":[{"$ref":"#/components/schemas/FlowFieldSettings"},{"description":"Settings of its type, such as `currencyCode` for a Currency field."}]},"input":{"anyOf":[{"type":"boolean"},{"type":"object","properties":{"required":{"type":"boolean","description":"A flow can't start without it."}},"additionalProperties":{}}],"description":"Ask for it when a flow starts. `true` is read as `{ \"required\": false }`."},"showBadge":{"type":"boolean","description":"Show its value as a badge on flow cards."},"showBanner":{"type":"boolean","description":"Show its value in a banner across the top of the flow."}},"required":["key","label","type"],"additionalProperties":{},"description":"The new flow field."}},"required":["op","field"],"additionalProperties":false,"title":"add_field","description":"Add a flow field: asked for when a flow starts (with `input`), or set as it runs.","example":{"op":"add_field","field":{"key":"region","label":"Region","type":"DROPDOWN","options":["EMEA","Americas"],"input":{"required":true}}}},"Change_update_field":{"type":"object","properties":{"op":{"type":"string","enum":["update_field"],"description":"Change a flow field."},"fieldKey":{"type":"string","description":"The key of the flow field to change."},"fields":{"type":"object","properties":{"key":{"type":"string","minLength":1,"description":"Its new key: lowercase with underscores, unique on the template. A field that has been published keeps its key (`409 FIELD_KEY_LOCKED`)."},"label":{"type":"string","description":"Its new label."},"type":{"type":"string","minLength":1,"description":"Its new type."},"options":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"object","properties":{"id":{"type":"string","description":"Keep an option's id. Leave out on a new one."},"label":{"type":"string","minLength":1,"description":"The option as people see it."},"value":{"type":"string","description":"The value a rule matches. Leave out to use the label."},"color":{"type":"string","description":"Its color."}},"required":["label"],"additionalProperties":{}}]},"description":"Its options, as labels or `{ label }` objects."},"defaultValue":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"Its starting value."},"helpText":{"type":"string","description":"Help shown under it on a form."},"config":{"allOf":[{"$ref":"#/components/schemas/FlowFieldSettings"},{"description":"Settings of its type."}]},"input":{"type":"object","properties":{"required":{"type":"boolean","description":"A flow can't start without it."}},"additionalProperties":{},"description":"Ask for it when a flow starts."},"showBadge":{"type":"boolean","description":"Show its value as a badge on flow cards."},"showBanner":{"type":"boolean","description":"Show its value in a banner across the top of the flow."}},"additionalProperties":{},"description":"What to change. Anything you leave out stays. The names the template read uses are taken too: `name` for `label`, and `collectAtStart` and `required` for `input`. An option sent with its `id` keeps what the read leaves out of it."}},"required":["op","fieldKey","fields"],"additionalProperties":false,"title":"update_field","description":"Change a flow field.","example":{"op":"update_field","fieldKey":"deal_size","fields":{"label":"Deal size (USD)"}}},"Change_remove_field":{"type":"object","properties":{"op":{"type":"string","enum":["remove_field"],"description":"Remove a flow field."},"fieldKey":{"type":"string","description":"The key of the flow field to remove. Fix the steps that read it in the same list."}},"required":["op","fieldKey"],"additionalProperties":false,"title":"remove_field","description":"Remove a flow field.","example":{"op":"remove_field","fieldKey":"deal_size"}},"Change_update_template_info":{"type":"object","properties":{"op":{"type":"string","enum":["update_template_info"],"description":"Change the template's name, description, or the name each new flow gets."},"fields":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"The template's new name."},"description":{"type":["string","null"],"description":"The template's new description. `null` or an empty text: none."},"flowNameTemplate":{"type":["string","null"],"description":"The name each new flow gets. May use start fields and roles, e.g. `Onboarding - {Inputs / company_name}`, never step answers. `null`: each flow takes the default name, the template's name and its first start field."}},"additionalProperties":{},"description":"What to change."}},"required":["op","fields"],"additionalProperties":false,"title":"update_template_info","description":"Change the template's name, description, or the name each new flow gets.","example":{"op":"update_template_info","fields":{"name":"Customer onboarding","description":"From intake to approval."}}},"Change_update_permissions":{"type":"object","properties":{"op":{"type":"string","enum":["update_permissions"],"description":"Change who can start, change and own the template."},"fields":{"type":"object","properties":{"execute":{"type":"object","properties":{"type":{"type":"string","enum":["EXPLICIT_USERS","ALL_MEMBERS","ADMINS_ONLY","PERMISSION_GROUP"],"description":"Everyone on your team, admins only, named people, or a permission group. Leave out when you send `people` or `groups`."},"people":{"type":"array","items":{"type":"string"},"description":"People on your team, by the email they sign in with."},"groups":{"type":"array","items":{"type":"string"},"description":"Permission groups, by name."}},"additionalProperties":{},"description":"Who can start flows from the template."},"edit":{"type":"object","properties":{"type":{"type":"string","enum":["EXPLICIT_USERS","ALL_MEMBERS","ADMINS_ONLY","PERMISSION_GROUP"],"description":"Everyone on your team, admins only, named people, or a permission group. Leave out when you send `people` or `groups`."},"people":{"type":"array","items":{"type":"string"},"description":"People on your team, by the email they sign in with."},"groups":{"type":"array","items":{"type":"string"},"description":"Permission groups, by name."}},"additionalProperties":{},"description":"Who can change the template."},"owner":{"type":"object","properties":{"type":{"type":"string","enum":["EXPLICIT_USERS","ALL_MEMBERS","ADMINS_ONLY","PERMISSION_GROUP"],"description":"Everyone on your team, admins only, named people, or a permission group. Leave out when you send `people` or `groups`."},"people":{"type":"array","items":{"type":"string"},"description":"People on your team, by the email they sign in with."},"groups":{"type":"array","items":{"type":"string"},"description":"Permission groups, by name."}},"additionalProperties":{},"description":"Who owns the template."}},"additionalProperties":{},"description":"The audiences to change. Each is `{ \"type\": ... }`, or named `people` (emails) or `groups` (permission group names). The names the template read uses are taken too: `initiators`, `editors` and `owners`, with people as its `users`."}},"required":["op","fields"],"additionalProperties":false,"title":"update_permissions","description":"Change who can start, change and own the template.","example":{"op":"update_permissions","fields":{"execute":{"type":"ALL_MEMBERS"}}}},"Change_update_flow_start":{"type":"object","properties":{"op":{"type":"string","enum":["update_flow_start"],"description":"Change how flows start."},"fields":{"type":"object","properties":{"supportedStartModes":{"type":"array","items":{"type":"string","enum":["MANUAL","START_LINK","WEBHOOK","EMAIL"]},"description":"How flows can start. A webhook's address and secret are made when you publish; a person copies them from the builder."},"startLink":{"type":"object","properties":{"initiatorRole":{"type":"string","description":"The role, by name, given to the person who starts a flow from the link. Needed with `START_LINK`."},"initiatorPersonaId":{"type":"string","description":"The persona a new outside person gets when they start a flow from the link. Leave out for your default."},"identityField":{"type":"object","properties":{"label":{"type":"string","description":"Its label."},"placeholder":{"type":"string","description":"Its placeholder."},"afterFieldKey":{"type":["string","null"],"description":"The flow field it comes after. `null` puts it first."}},"additionalProperties":{},"description":"The email field on the start page."},"initPage":{"type":"object","properties":{"title":{"type":"string","description":"Its title."},"subtitle":{"type":"string","description":"Its subtitle."},"buttonLabel":{"type":"string","description":"Its button."}},"additionalProperties":{},"description":"The page people see before they start."},"completedPage":{"type":"object","properties":{"title":{"type":"string","description":"Its title."},"subtitle":{"type":"string","description":"Its subtitle."},"body":{"type":"string","description":"Its text."}},"additionalProperties":{},"description":"The page people see after they start."},"backgroundColor":{"type":["string","null"],"pattern":"^#[0-9a-fA-F]{6}$","description":"The page color behind this start link. A 6-digit hex, like `#F3EFE8`. Leave it out to keep the saved color. `null` clears it, and the page keeps the grey gradient. The form stays white."}},"additionalProperties":{},"description":"The start link's pages and who starts through it."}},"additionalProperties":{},"description":"What to change."}},"required":["op","fields"],"additionalProperties":false,"title":"update_flow_start","description":"Change how flows start.","example":{"op":"update_flow_start","fields":{"supportedStartModes":["MANUAL","WEBHOOK"]}}},"Change_update_due_dates":{"type":"object","properties":{"op":{"type":"string","enum":["update_due_dates"],"description":"Set the flow's due date."},"fields":{"type":"object","properties":{"flowDue":{"type":["object","null"],"properties":{"type":{"type":"string","enum":["RELATIVE","FIXED"],"description":"`RELATIVE`: after the flow starts. `FIXED`: on a date."},"value":{"type":"number","description":"For `RELATIVE`: how many units."},"unit":{"type":"string","enum":["HOURS","DAYS","WEEKS"],"description":"For `RELATIVE`: the unit."},"date":{"type":"string","description":"For `FIXED`: the date, as an ISO date."}},"additionalProperties":{},"description":"When each flow is due. `null`: flows have no due date."}},"additionalProperties":{},"description":"What to change. A step's own due date is `stepDue`, set with update_step."}},"required":["op","fields"],"additionalProperties":false,"title":"update_due_dates","description":"Set the flow's due date.","example":{"op":"update_due_dates","fields":{"flowDue":{"type":"RELATIVE","value":10,"unit":"DAYS"}}}},"Change_update_step_statuses":{"type":"object","properties":{"op":{"type":"string","enum":["update_step_statuses"],"description":"Set all step statuses."},"stepStatuses":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Keeps a status."},"key":{"type":"string","description":"Optional."},"name":{"type":"string","minLength":1,"maxLength":60,"description":"Its words."},"color":{"type":"string","enum":["blue","green","red","amber","gray","purple","orange","teal"],"description":"Its colour."}},"required":["name","color"],"additionalProperties":false},"maxItems":30,"description":"All, in order."}},"required":["op","stepStatuses"],"additionalProperties":false,"title":"update_step_statuses","description":"Set all step statuses.","example":{"op":"update_step_statuses","stepStatuses":[{"name":"With legal","color":"purple"}]}},"Change_update_flow_monitors":{"type":"object","properties":{"op":{"type":"string","enum":["update_flow_monitors"],"description":"Set all flow monitors: the whole list. One left out is removed. Leave this change out to keep the saved monitors."},"flowMonitors":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Keeps a monitor. Send the same id to change it."},"name":{"type":"string","minLength":1,"maxLength":80,"description":"Its name. Required."},"when":{"type":"object","properties":{"groups":{"type":"array","items":{"type":"object","properties":{"op":{"type":"string","enum":["all","any"],"description":"`all`: every condition in the group. `any`: one is enough."},"conditions":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["status"],"description":"`status`: a Flows list status."},"cmp":{"type":"string","enum":["is","is_not"],"description":"`is` or `is_not`."},"values":{"type":"array","items":{"type":"string","enum":["WAITING_FOR_ASSIGNEE","DUE_SOON","OVERDUE","ON_TRACK","OFF_TRACK","STALLED","ESCALATED","FAILED"]},"minItems":1,"description":"Flow statuses, the same ones as the Flows list: `ON_TRACK`, `WAITING_FOR_ASSIGNEE`, `DUE_SOON`, `OVERDUE`, `OFF_TRACK`, `STALLED`, `ESCALATED`, `FAILED`."}},"required":["kind","cmp","values"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["step"],"description":"`step`: where a step stands."},"stepId":{"type":"string","minLength":1,"description":"The step."},"cmp":{"type":"string","enum":["is","is_not"],"description":"`is` or `is_not`."},"state":{"type":"string","enum":["complete","in_progress","overdue"],"description":"`complete`, `in_progress`, or `overdue`."}},"required":["kind","stepId","cmp","state"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["field"],"description":"`field`: a custom field."},"fieldId":{"type":"string","minLength":1,"description":"The custom field."},"cmp":{"type":"string","enum":["is","is_not","contains","gt","lt","is_empty","is_not_empty"],"description":"How to compare it: is, is_not, contains, gt, lt, is_empty, is_not_empty."},"value":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string","minLength":1},"minItems":1}],"description":"The value to compare. Leave it out for is_empty and is_not_empty."}},"required":["kind","fieldId","cmp"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["role"],"description":"`role`: who holds a role."},"roleId":{"type":"string","minLength":1,"description":"The role."},"cmp":{"type":"string","enum":["is_assigned","is_not_assigned","is_assigned_to"],"description":"`is_assigned`, `is_not_assigned`, or `is_assigned_to`."},"userId":{"type":"string","minLength":1,"description":"The person, when the role is assigned to someone."}},"required":["kind","roleId","cmp"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["answer"],"description":"`answer`: an answer on a step."},"stepId":{"type":"string","minLength":1,"description":"The step the answer is on."},"questionId":{"type":"string","minLength":1,"description":"The question or form field."},"cmp":{"type":"string","enum":["is","is_not","contains","gt","lt","is_empty","is_not_empty"],"description":"How to compare the answer: is, is_not, contains, gt, lt, is_empty, is_not_empty. A number, date, or choice compares as that type."},"value":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string","minLength":1},"minItems":1}],"description":"The value to compare. Leave it out for is_empty and is_not_empty."}},"required":["kind","stepId","questionId","cmp"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["time"],"description":"`time`: how long something has taken."},"amount":{"type":"integer","exclusiveMinimum":0,"description":"How long."},"unit":{"type":"string","enum":["minutes","hours","days"],"description":"`minutes`, `hours`, or `days`."},"since":{"type":"string","enum":["flow_started","step_opened","last_activity","past_due"],"description":"`flow_started`, `step_opened`, `last_activity`, or `past_due`."},"stepId":{"type":"string","minLength":1,"description":"The step, when time is counted from a step opening."},"due":{"anyOf":[{"type":"string","enum":["flow"]},{"type":"object","properties":{"fieldId":{"type":"string","minLength":1,"description":"The date field the due date comes from."}},"required":["fieldId"],"additionalProperties":false}],"description":"For `past_due`: `\"flow\"`, or a date field."}},"required":["kind","amount","unit","since"],"additionalProperties":false}]},"minItems":1,"description":"The conditions in this group."}},"required":["op","conditions"],"additionalProperties":false},"minItems":1,"description":"The groups. All of them must match."}},"required":["groups"],"additionalProperties":false,"description":"When it runs. Every group must match."},"actions":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["fire_webhook"],"description":"`fire_webhook`: call a webhook."},"url":{"type":"string","minLength":1,"description":"Where to send the webhook."},"context":{"type":"object","additionalProperties":{"type":"string"},"description":"Extra text sent with the webhook, keyed by the name you choose."}},"required":["kind","url"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["send_email"],"description":"`send_email`: send an email."},"to":{"anyOf":[{"type":"object","properties":{"role":{"type":"string","minLength":1,"description":"The role, by its id."}},"required":["role"],"additionalProperties":false},{"type":"object","properties":{"user":{"type":"string","minLength":1,"description":"The person, by their user id."}},"required":["user"],"additionalProperties":false}],"description":"Who gets the email: a role, or a person."},"subject":{"type":"string","minLength":1,"description":"The subject."},"body":{"type":"string","minLength":1,"description":"The message."}},"required":["kind","to","subject","body"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["update_fields"],"description":"`update_fields`: set custom fields."},"updates":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"description":"The custom fields to set, keyed by field id. Each value is text or a list of text."},"updateFileNames":{"type":"object","additionalProperties":{"type":"string"},"description":"A file name for a file field, keyed by that field's id."}},"required":["kind","updates"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["cancel_flow"],"description":"`cancel_flow`: cancel the flow."},"reason":{"type":"string","description":"Why the flow was cancelled. Shown on the flow."}},"required":["kind"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["archive"],"description":"Archive the flow. Only after it is cancelled."}},"required":["kind"],"additionalProperties":false}]},"minItems":1,"description":"What it does, in this order: a webhook, an email, custom fields, cancel, then archive. Each kind once. Archive only comes after cancel."}},"required":["id","name","when","actions"],"additionalProperties":false},"maxItems":8,"description":"Every flow monitor, in order. One left out is removed."}},"required":["op","flowMonitors"],"additionalProperties":false,"title":"update_flow_monitors","description":"Set all flow monitors: the whole list. One left out is removed. Leave this change out to keep the saved monitors.","example":{"op":"update_flow_monitors","flowMonitors":[{"id":"monitor-overdue","name":"Overdue","when":{"groups":[{"op":"all","conditions":[{"kind":"status","cmp":"is","values":["OVERDUE"]}]}]},"actions":[{"kind":"cancel_flow","reason":"The flow is overdue."}]}]}},"Change_update_settings":{"type":"object","properties":{"op":{"type":"string","enum":["update_settings"],"description":"Change template settings: notifications, the chat assistant, auto-archive, time tracking and outgoing webhooks."},"fields":{"type":"object","properties":{"autoArchiveEnabled":{"type":"boolean","description":"Archive flows when they finish."},"coverImage":{"type":"string","description":"The cover image: a URL, or `\"DEFAULT\"`."},"chatAssistant":{"type":"object","properties":{"enabled":{"type":"boolean","description":"Turn it on or off."},"agentId":{"type":"string","description":"The AI agent that answers. Leave out for your organization's default."},"name":{"type":"string","description":"Its name in the chat."},"persona":{"type":"string","description":"How it presents itself."},"instructions":{"type":"string","description":"What it should and shouldn't do."},"supportMode":{"type":"string","enum":["AI_HUMAN","AI_ONLY","HUMAN_ONLY"],"description":"Who answers: the assistant with your team, the assistant alone, or your team alone."},"handoffAfterAttempts":{"type":"number","description":"Hand the chat to your team after this many tries."}},"additionalProperties":{},"description":"The assistant that answers in the flow chat."},"notifications":{"allOf":[{"$ref":"#/components/schemas/NotificationSettingsChange"},{"description":"The template's notifications, as the Notifications panel saves them. Changing an alert switches the template to custom notifications."}]},"timeTracking":{"type":"object","properties":{"enabled":{"type":"boolean","description":"Turn time tracking on or off."},"required":{"type":"boolean","description":"Time must be entered before a step completes."},"defaultBillable":{"type":"boolean","description":"Time starts as billable."},"loggers":{"type":"string","enum":["internal","managers"],"description":"`internal`: anyone on your team. `managers`: flow managers only."}},"additionalProperties":false,"description":"Ask your team for the time they spent when they complete a step."},"aiEscalations":{"type":"object","properties":{"roleId":{"type":["string","null"],"minLength":1,"maxLength":80,"description":"A role on this template that manages the flow (`roles[].roleId`). `null`: the flow's managers, then the template's owners, then the admins."},"deskId":{"type":["string","null"],"minLength":1,"maxLength":80,"description":"A team desk instead of a role: the hand-off waits in that desk's queue until someone on it claims it. Set roleId or deskId, never both."}},"additionalProperties":false,"description":"Who an AI agent on this template hands its work over to. Applies at once, to running flows too."}},"additionalProperties":{},"description":"The settings to change. Anything you leave out stays; nested settings merge. A key the template's settings don't have is refused as `UNKNOWN_SETTING`, never dropped."}},"required":["op","fields"],"additionalProperties":false,"title":"update_settings","description":"Change template settings: notifications, the chat assistant, auto-archive, time tracking and outgoing webhooks.","example":{"op":"update_settings","fields":{"autoArchiveEnabled":true}}},"Change_add_artifact":{"type":"object","properties":{"op":{"type":"string","enum":["add_artifact"],"description":"Add an artifact: what the flow produces, built from values and files of its steps."},"handle":{"type":"string","description":"A name you choose, unique in this list, so later changes in the same list can use it where an id goes. The response maps it to its new id in `ids`."},"name":{"type":"string","minLength":1,"description":"The artifact's name, for example \"Capital expense request\"."},"sections":{"type":"array","items":{"type":"object","properties":{"handle":{"type":"string","description":"A name you choose for the section."},"label":{"type":"string","minLength":1,"description":"The section heading. A single section needs none."},"blocks":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"handle":{"type":"string","description":"A name you choose for the block."},"kind":{"type":"string","enum":["value"]},"label":{"type":"string","minLength":1,"description":"The row label, e.g. \"Amount\"."},"ref":{"type":"string","minLength":1,"description":"The value to show, e.g. `{Business case / Amount}`."}},"required":["handle","kind","label","ref"],"additionalProperties":false},{"type":"object","properties":{"handle":{"type":"string","description":"A name you choose for the block."},"kind":{"type":"string","enum":["file"]},"label":{"type":"string","minLength":1,"description":"Its label. Leave out to use the file's name."},"sourceStepId":{"type":"string","description":"The Form, PDF form, File request or E-sign step whose file this is: a step id or a handle from earlier in this list."}},"required":["handle","kind","sourceStepId"],"additionalProperties":false}]},"minItems":1,"description":"What the section shows, in order."}},"required":["handle","blocks"],"additionalProperties":false},"minItems":1,"description":"Its sections, in order."}},"required":["op","handle","name","sections"],"additionalProperties":false,"title":"add_artifact","description":"Add an artifact: what the flow produces, built from values and files of its steps.","example":{"op":"add_artifact","handle":"summary","name":"Onboarding summary","sections":[{"handle":"company","blocks":[{"handle":"company_name","kind":"value","label":"Company","ref":"${{ steps.intake.fields.company_name }}"}]}]}},"Change_update_artifact":{"type":"object","properties":{"op":{"type":"string","enum":["update_artifact"],"description":"Set an artifact whole, by its id, as the template stores it: it replaces the one with that id, or adds it. A setting you leave out (`share`, `fill`, `settings`) is removed; its `key` stays what it is unless you send another."},"artifactId":{"type":"string","minLength":1,"description":"The artifact's id."},"key":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,63}$","description":"Its key, unique in the template. Leave out: it keeps the key it has."},"name":{"type":"string","minLength":1,"description":"Its name."},"sections":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Keeps a section."},"label":{"type":"string","description":"The section heading."},"blocks":{"type":"array","items":{"type":"object","additionalProperties":{}},"description":"Its blocks, as the template stores them: each with its `id`, its `kind` and that kind's fields."}},"required":["id","blocks"],"additionalProperties":false},"minItems":1,"description":"All its sections, in order, as the template stores them."},"share":{"type":"object","additionalProperties":{},"description":"Who besides the flow's managers sees it."},"fill":{"type":"object","additionalProperties":{},"description":"Who fills its fields and documents."},"settings":{"type":"object","additionalProperties":{},"description":"Its own settings."}},"required":["op","artifactId","name","sections"],"additionalProperties":false,"title":"update_artifact","description":"Set an artifact whole, by its id, as the template stores it: it replaces the one with that id, or adds it. A setting you leave out (`share`, `fill`, `settings`) is removed; its `key` stays what it is unless you send another.","example":{"op":"update_artifact","artifactId":"artifact-closing-pack","name":"Closing pack","sections":[{"id":"section-documents","label":"Documents","blocks":[{"id":"block-intake-file","kind":"file","sourceStepId":"step-intake"}]}]}},"Change_remove_artifact":{"type":"object","properties":{"op":{"type":"string","enum":["remove_artifact"],"description":"Remove an artifact. Running flows keep theirs."},"artifactId":{"type":"string","minLength":1,"description":"The artifact's id."}},"required":["op","artifactId"],"additionalProperties":false,"title":"remove_artifact","description":"Remove an artifact. Running flows keep theirs.","example":{"op":"remove_artifact","artifactId":"artifact-closing-pack"}},"Change_update_template_tags":{"type":"object","properties":{"op":{"type":"string","enum":["update_template_tags"],"description":"Set the tags each new flow gets, which tag groups the person starting a flow may change, and text tags' starting text."},"tags":{"type":"array","items":{"type":"string","minLength":1},"maxItems":200,"description":"Tag ids each new flow gets. `[]` clears them."},"tagStart":{"type":"object","additionalProperties":{"type":"object","properties":{"editable":{"type":"boolean","description":"They may change it."},"required":{"type":"boolean","description":"They must pick one."}},"additionalProperties":false},"description":"By tag group id: whether the person starting a flow may change it (`editable`) and must pick one (`required`)."},"tagTexts":{"type":"object","additionalProperties":{"type":"string"},"description":"By text tag group id: its starting text."}},"required":["op"],"additionalProperties":false,"title":"update_template_tags","description":"Set the tags each new flow gets, which tag groups the person starting a flow may change, and text tags' starting text.","example":{"op":"update_template_tags","tags":[]}},"Change_update_block_interface":{"type":"object","properties":{"op":{"type":"string","enum":["update_block_interface"],"description":"Set whether other templates can insert this one as a building block, and what it hands back to them."},"blockInterface":{"type":"object","properties":{"enabled":{"type":"boolean","description":"Other templates may insert this one."},"exposedOutputs":{"type":"array","items":{"type":"object","properties":{"exposedKey":{"type":"string","minLength":1,"description":"The name the inserting template reads it by."},"exposedName":{"type":"string","description":"Its label."},"type":{"type":"string","description":"Its value type."},"sourceStepId":{"type":"string","minLength":1,"description":"The step that produces it."},"sourceOutputKey":{"type":"string","minLength":1,"description":"Which of that step's outputs."},"valueShape":{"type":"object","additionalProperties":{},"description":"Its shape, as the builder records it."}},"required":["exposedKey","sourceStepId","sourceOutputKey"],"additionalProperties":false},"description":"The values it hands back."},"roleIntents":{"type":"object","additionalProperties":{"type":"string","enum":["host_provides","block_introduces"]},"description":"By role id: `host_provides` (the inserting flow names who) or `block_introduces` (a role of its own)."}},"additionalProperties":false,"description":"The whole interface."}},"required":["op","blockInterface"],"additionalProperties":false,"title":"update_block_interface","description":"Set whether other templates can insert this one as a building block, and what it hands back to them.","example":{"op":"update_block_interface","blockInterface":{"enabled":true}}},"Change_update_connection_policy":{"type":"object","properties":{"op":{"type":"string","enum":["update_connection_policy"],"description":"Set which connection bundles a flow may use, and how a flow picks one. `null` removes the policy."},"connectionPolicy":{"type":["object","null"],"properties":{"source":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["pinned"],"description":"`pinned`: every flow uses one bundle."},"setId":{"type":"string","format":"uuid","description":"The one bundle every flow uses, by its id."}},"required":["kind","setId"],"additionalProperties":{}},{"type":"object","properties":{"kind":{"type":"string","enum":["picker"],"description":"`picker`: the person starting the flow picks the bundle."}},"required":["kind"],"additionalProperties":{}},{"type":"object","properties":{"kind":{"type":"string","enum":["expression"],"description":"`expression`: start-time data names the bundle."},"expr":{"type":"string","minLength":1,"description":"A reference to start-time data that names the bundle."},"matchBy":{"oneOf":[{"type":"object","properties":{"by":{"type":"string","enum":["key"],"description":"`key`: the value is a bundle's key."}},"required":["by"],"additionalProperties":{}},{"type":"object","properties":{"by":{"type":"string","enum":["externalRef"],"description":"`externalRef`: the value is the bundle's id in an app."},"provider":{"type":"string","minLength":1,"description":"The app whose id the value is."}},"required":["by","provider"],"additionalProperties":{}}],"description":"What the value matches: a bundle's `key`, or its id in an app (`externalRef` with the app's `provider`)."}},"required":["kind","expr","matchBy"],"additionalProperties":{}},{"type":"object","properties":{"kind":{"type":"string","enum":["caller"],"description":"`caller`: the call that starts the flow names the bundle."}},"required":["kind"],"additionalProperties":{}},{"type":"object","properties":{"kind":{"type":"string","enum":["inherit"],"description":"`inherit`: the flow that starts this one passes its bundle on."}},"required":["kind"],"additionalProperties":{}}],"description":"How a flow picks its bundle: `picker` (the person starting it), `pinned` (one bundle, `setId`), `expression` (from start-time data, `expr` and `matchBy`), `caller` (the starting call names it) or `inherit` (from the flow that starts it)."},"allowedSetIds":{"type":"array","items":{"type":"string","format":"uuid"},"default":[],"description":"Ids of this organization's connection bundles a flow may use."},"allowedSetTags":{"type":"array","items":{"type":"string"},"default":[],"description":"Bundle tags: every bundle carrying one may be used."}},"required":["source"],"additionalProperties":{},"description":"The whole policy, or `null` to remove it."}},"required":["op","connectionPolicy"],"additionalProperties":false,"title":"update_connection_policy","description":"Set which connection bundles a flow may use, and how a flow picks one. `null` removes the policy.","example":{"op":"update_connection_policy","connectionPolicy":null}},"Change_update_custom_agents":{"type":"object","properties":{"op":{"type":"string","enum":["update_custom_agents"],"description":"Set the agents attached to the template, each by its id. An agent no action uses is left out when the template is saved."},"customAgents":{"type":"array","items":{"type":"object","properties":{"agentId":{"type":"string","minLength":1,"description":"An agent of this organization, by id."},"agentType":{"type":"string","enum":["prepare","review","advise","automation","chat"],"description":"How it is attached."}},"required":["agentId","agentType"],"additionalProperties":false},"description":"The whole roster."}},"required":["op","customAgents"],"additionalProperties":false,"title":"update_custom_agents","description":"Set the agents attached to the template, each by its id. An agent no action uses is left out when the template is saved.","example":{"op":"update_custom_agents","customAgents":[]}},"TemplateAuthoringResult":{"type":"object","properties":{"changeSchemaVersion":{"type":"number","enum":[1]},"status":{"type":"string","enum":["ready","has_issues","published"]},"saved":{"type":"boolean"},"draft":{"type":["object","null"],"properties":{"templateId":{"type":"string"},"name":{"type":"string"},"version":{"type":"integer","description":"The published version number, as on the template and in its version history. A template never published is 1."},"draftRevision":{"type":"integer","description":"Counts saves to the draft. Send it as `baseVersion` on your next change."}},"required":["templateId","name","version","draftRevision"]},"ids":{"type":"object","additionalProperties":{"type":"string"}},"changed":{"type":"array","items":{"type":"string"}},"liveChanges":{"type":"array","items":{"type":"object","properties":{"setting":{"type":"string","enum":["permissions","startModes","notifications","chatAssistant","aiVisibility","aiEscalations","coverImage"],"description":"Which live setting changed."},"what":{"type":"string","description":"The setting in words."}},"required":["setting","what"]},"description":"The live settings this call changed: who may run, change and own the template, how flows start, notifications and reminders, the chat assistant, whether people see AI at work, the cover image. They are not part of the draft: they apply at once, to running flows too, Discard does not undo them, and they need no publish."},"fixedForYou":{"type":"array","items":{"type":"string"},"description":"Anything this save stored differently from what was sent, one sentence each, with why: a setting the organization isn't entitled to left off, a published key kept, a person who isn't a member of the organization left out. Empty when the template is stored as written. Nothing is added that the request did not write."},"issues":{"type":"array","items":{"type":"object","properties":{"severity":{"type":"string","enum":["error","warning"]},"code":{"type":"string","description":"A stable code. For an action's connected account: `CONNECTION_REQUIRED` (your organization has no account with that id; `connectUrl` is where a person connects the app), `STEP_CONNECTION_WRONG_APP` (the account is for another app, such as a HubSpot account on a Stripe payment, or on a REST API action, which takes a saved Secret or a signing account such as a Sumsub account) and `STEP_CONNECTION_FOREIGN` (the account was removed from your organization)."},"where":{"type":"object","properties":{"change":{"type":"integer"},"action":{"type":"string"},"stepId":{"type":"string"},"path":{"type":"string"}}},"problem":{"type":"string"},"fix":{"type":"string"},"suggestedChange":{"type":"object","additionalProperties":{}},"guide":{"type":"string","description":"A build guide topic about this problem, such as `step:form`. Read it with `GET /v1/build-guides/{topic}` (MCP: `search_moxo_docs` view `guide`)."},"guidePath":{"type":"string","description":"The path that serves `guide`, ready to call, such as `/v1/build-guides/step:form`."},"connectUrl":{"type":"string","description":"On `CONNECTION_REQUIRED`: where a person connects the app the action needs (Manage → Connected apps). Share it with them, then send the change again."}},"required":["severity","where","problem","fix"]},"description":"Problems this request leaves, each with where it is and its fix. A draft is saved even when it is not complete yet: these are what publishing and a test run still need."},"existingIssues":{"type":"array","items":{"type":"object","properties":{"severity":{"type":"string","enum":["error","warning"]},"code":{"type":"string","description":"A stable code. For an action's connected account: `CONNECTION_REQUIRED` (your organization has no account with that id; `connectUrl` is where a person connects the app), `STEP_CONNECTION_WRONG_APP` (the account is for another app, such as a HubSpot account on a Stripe payment, or on a REST API action, which takes a saved Secret or a signing account such as a Sumsub account) and `STEP_CONNECTION_FOREIGN` (the account was removed from your organization)."},"where":{"type":"object","properties":{"change":{"type":"integer"},"action":{"type":"string"},"stepId":{"type":"string"},"path":{"type":"string"}}},"problem":{"type":"string"},"fix":{"type":"string"},"suggestedChange":{"type":"object","additionalProperties":{}},"guide":{"type":"string","description":"A build guide topic about this problem, such as `step:form`. Read it with `GET /v1/build-guides/{topic}` (MCP: `search_moxo_docs` view `guide`)."},"guidePath":{"type":"string","description":"The path that serves `guide`, ready to call, such as `/v1/build-guides/step:form`."},"connectUrl":{"type":"string","description":"On `CONNECTION_REQUIRED`: where a person connects the app the action needs (Manage → Connected apps). Share it with them, then send the change again."}},"required":["severity","where","problem","fix"]},"description":"Problems the template already had, on steps this request didn't touch. Each is a warning, with its fix."},"needsAPerson":{"type":"array","items":{"type":"object","properties":{"what":{"type":"string"},"link":{"type":"string"}},"required":["what","link"]}},"links":{"type":["object","null"],"properties":{"view":{"type":"string"},"edit":{"type":"string"}},"required":["view","edit"]},"outline":{"type":"string"}},"required":["changeSchemaVersion","status","saved","draft","ids","changed","liveChanges","fixedForYou","issues","existingIssues","needsAPerson","links","outline"]},"TemplateAuthoringCheckResult":{"allOf":[{"$ref":"#/components/schemas/TemplateAuthoringResult"},{"type":"object","properties":{"check":{"$ref":"#/components/schemas/TemplateCheckLevels"}},"required":["check"]}]},"TemplateCheckLevels":{"type":"object","properties":{"result":{"type":"string","enum":["OK","FAIL"],"description":"`FAIL` when any diagnostic is an error. Warnings alone are `OK`."},"diagnostics":{"type":"array","items":{"type":"object","properties":{"severity":{"type":"string","enum":["error","warning"]},"code":{"type":"string","description":"The check's code for the finding, as in `issues`."},"message":{"type":"string"},"location":{"type":"string","description":"A JSON pointer into the template definition. An empty string is the whole template."}},"required":["severity","code","message","location"]},"description":"Errors first, then warnings. At most 100."},"truncated":{"type":"boolean","description":"True when there were more diagnostics than were returned."}},"required":["result","diagnostics","truncated"]},"TemplateFile":{"type":"object","properties":{"templateId":{"type":"string","description":"The template's id."},"name":{"type":"string","description":"The template's name."},"draftRevision":{"type":"integer","description":"The draft revision the file was read at. The file carries it as its `revision:` line, which a push is judged by."},"fileName":{"type":"string","description":"A file name to save it under."},"file":{"type":"string","description":"The template as a `.yaml` file (`apiVersion: moxo/v1`, `kind: Template`), its first line naming the file's JSON Schema."}},"required":["templateId","name","draftRevision","fileName","file"],"description":"The file and the draft revision it was read at."},"TemplateFilePushResult":{"type":"object","properties":{"applied":{"type":"boolean","description":"True when the changes were saved."},"accepted":{"type":"boolean","description":"False when the file or its changes were refused: see `issues`, or `result.issues`."},"changes":{"type":"array","items":{"$ref":"#/components/schemas/Change"},"description":"The change list the file makes, as `POST /v1/templates/{id}/changes` takes it. Empty when the file matches the template."},"issues":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string","description":"A stable code for the problem, such as `UNKNOWN_REFERENCE` or `INVALID_REFERENCE`."},"pointer":{"type":"string","description":"Where in the file, as a JSON pointer. An empty string is the whole file."},"problem":{"type":"string","description":"What is wrong, in a sentence."},"fix":{"type":"string","description":"How to resolve it, in a sentence."}},"required":["code","pointer","problem","fix"]},"description":"Why the file can't be pushed. When there are any, nothing is checked or saved."},"draftRevision":{"type":"integer","description":"The template's draft revision now: after a push that saved, the new one. Pull the file again to carry it on."},"result":{"anyOf":[{"$ref":"#/components/schemas/TemplateAuthoringResult"},{"type":"null"}],"description":"What the changes did (or, on a dry run, would do): every check, as a change list answers. Null when nothing changes or the file is refused."}},"required":["applied","accepted","changes","issues","draftRevision","result"],"description":"The plan the file makes, and what it did (with `apply: true`) or would do."}},"parameters":{}},"paths":{"/v1/meetings":{"get":{"x-moxo-person-only":"PERSON_TOKEN_REQUIRED","tags":["Meetings"],"summary":"List your meetings","description":"Returns your meetings, newest first, from two weeks ahead to ninety days back, each with one status.\n\nMeetings come from the calendar and the recorders you connect in Moxo (Settings, My meetings), and only you see yours. Moxo keeps a short recap of each call; it does not keep the transcript. Meetings needs your organization to have the Conductor turned on: otherwise the answer is `403 MEETINGS_NOT_AVAILABLE`.\n\nNeeds a personal access token: an organization API key is not a person, so it gets `403 PERSON_TOKEN_REQUIRED`.\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","enum":["all","needs_you","upcoming"],"description":"`all` (the default), `needs_you` (calls with next steps waiting for you) or `upcoming`."},"required":false,"description":"`all` (the default), `needs_you` (calls with next steps waiting for you) or `upcoming`.","name":"filter","in":"query"},{"schema":{"type":"string","maxLength":200,"description":"Only meetings whose title, or the name of the work they are about, contains this."},"required":false,"description":"Only meetings whose title, or the name of the work they are about, contains this.","name":"q","in":"query"}],"responses":{"200":{"description":"Your meetings.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a 200 response."},"data":{"type":"object","properties":{"meetings":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The meeting."},"title":{"type":"string","description":"Its title from the calendar or the recorder. Can be empty."},"startsAt":{"type":"string","description":"When it starts (ISO 8601)."},"endsAt":{"type":"string","description":"When it ends (ISO 8601)."},"platform":{"type":["string","null"],"enum":["google_meet","teams","zoom","phone","in_person","other","moxo","whatsapp",null],"description":"Where the call happens, when the source says."},"status":{"type":"string","enum":["upcoming","waiting_for_transcript","recap_ready","nothing_to_read","excluded","over_limit","unavailable","recap_failed","draft","scheduled","live","ended","cancelled"],"description":"Where the meeting is: `upcoming` (not over yet), `waiting_for_transcript`, `recap_ready`, `nothing_to_read` (no transcript came, or nothing in it to recap), `over_limit` (past your monthly meeting hours; no recap until the month turns), `unavailable` (its source could not give the transcript) or `recap_failed` (the transcript is there but its summary could not be written)."},"needsYou":{"type":"boolean","description":"The call still holds next steps waiting for you."},"suggestionCount":{"type":"integer","minimum":0,"description":"How many next steps from this call are still waiting for you."},"link":{"type":["object","null"],"properties":{"kind":{"type":"string","enum":["flow","project","conversation"],"description":"What it is linked to: a `flow`, a `project` or a `conversation`."},"id":{"type":"string","description":"The flow, project or conversation."},"name":{"type":["string","null"],"description":"Its name. `null` for a conversation with no title."}},"required":["kind","id","name"],"description":"The work it is about, when you can see it."},"transcriptSource":{"type":["string","null"],"enum":["google_meet","granola","fathom","recorded",null],"description":"Where its transcript is: `google_meet`, `granola` or `fathom` (Moxo reads it from there and does not keep it), or `recorded`, a meeting you recorded in Moxo, whose transcript Moxo keeps for you."}},"required":["id","title","startsAt","endsAt","platform","status","needsYou","suggestionCount","link","transcriptSource"],"additionalProperties":false},"description":"Your meetings, newest first: two weeks ahead and ninety days back."}},"required":["meetings"],"description":"Your meetings."}},"required":["success","data"]}}}},"400":{"description":"A query parameter is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/meetings/{id}":{"get":{"x-moxo-person-only":"PERSON_TOKEN_REQUIRED","tags":["Meetings"],"summary":"Get one of your meetings","description":"Returns one of your meetings with its recap, who was on it, and what it is about. Another person's meeting, and one you removed, answers `404`.\n\nMeetings come from the calendar and the recorders you connect in Moxo (Settings, My meetings), and only you see yours. Moxo keeps a short recap of each call; it does not keep the transcript. Meetings needs your organization to have the Conductor turned on: otherwise the answer is `403 MEETINGS_NOT_AVAILABLE`.\n\nNeeds a personal access token: an organization API key is not a person, so it gets `403 PERSON_TOKEN_REQUIRED`.\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"The meeting."},"required":true,"description":"The meeting.","name":"id","in":"path"}],"responses":{"200":{"description":"The meeting.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a 200 response."},"data":{"type":"object","properties":{"id":{"type":"string","description":"The meeting."},"title":{"type":"string","description":"Its title from the calendar or the recorder. Can be empty."},"startsAt":{"type":"string","description":"When it starts (ISO 8601)."},"endsAt":{"type":"string","description":"When it ends (ISO 8601)."},"platform":{"type":["string","null"],"enum":["google_meet","teams","zoom","phone","in_person","other","moxo","whatsapp",null],"description":"Where the call happens, when the source says."},"status":{"type":"string","enum":["upcoming","waiting_for_transcript","recap_ready","nothing_to_read","excluded","over_limit","unavailable","recap_failed","draft","scheduled","live","ended","cancelled"],"description":"Where the meeting is: `upcoming` (not over yet), `waiting_for_transcript`, `recap_ready`, `nothing_to_read` (no transcript came, or nothing in it to recap), `over_limit` (past your monthly meeting hours; no recap until the month turns), `unavailable` (its source could not give the transcript) or `recap_failed` (the transcript is there but its summary could not be written)."},"needsYou":{"type":"boolean","description":"The call still holds next steps waiting for you."},"suggestionCount":{"type":"integer","minimum":0,"description":"How many next steps from this call are still waiting for you."},"link":{"type":["object","null"],"properties":{"kind":{"type":"string","enum":["flow","project","conversation"],"description":"What it is linked to: a `flow`, a `project` or a `conversation`."},"id":{"type":"string","description":"The flow, project or conversation."},"name":{"type":["string","null"],"description":"Its name. `null` for a conversation with no title."}},"required":["kind","id","name"],"description":"The work it is about, when you can see it."},"transcriptSource":{"type":["string","null"],"enum":["google_meet","granola","fathom","recorded",null],"description":"Where its transcript is: `google_meet`, `granola` or `fathom` (Moxo reads it from there and does not keep it), or `recorded`, a meeting you recorded in Moxo, whose transcript Moxo keeps for you."},"recap":{"type":["string","null"],"description":"Moxo's three or four line recap. `null` until it is read."},"attendees":{"type":"array","items":{"type":"object","properties":{"email":{"type":"string","description":"Their email address, as the calendar or recording has it."},"name":{"type":["string","null"],"description":"Their name, when the source gives one."},"inOrganization":{"type":"boolean","description":"Whether this email is a person in your organization."}},"required":["email","name","inOrganization"],"additionalProperties":false},"description":"Who else was invited or on the call."},"about":{"type":["object","null"],"properties":{"id":{"type":"string","description":"Send it to `DELETE /v1/meetings/{id}/links/{linkId}` when the call is not about this after all."},"kind":{"type":"string","enum":["flow","project","conversation"],"description":"What it is linked to: a `flow`, a `project` or a `conversation`."},"targetId":{"type":"string","description":"The flow, project or conversation."},"name":{"type":["string","null"],"description":"Its name."},"how":{"type":"string","enum":["booked","hosted","linked_by_you","matched"],"description":"How: `booked` by a Time Booking step, `hosted` from the work, `linked_by_you`, or `matched`: Moxo was sure on its own (the one open item the call's people share). You can always change it."}},"required":["id","kind","targetId","name","how"],"additionalProperties":false,"description":"What the call is about, or `null`: not set. Change it with `POST /v1/meetings/{id}/links`."},"calendarSource":{"type":["string","null"],"enum":["google_calendar","microsoft_calendar",null],"description":"The calendar it came from, when it came from one."},"limit":{"type":["object","null"],"properties":{"minutesRead":{"type":"integer","description":"Minutes of your meetings Moxo has read this month."},"limitHours":{"type":["number","null"],"description":"Your monthly meeting hours. `null`: no limit."},"resetsAt":{"type":"string","description":"When the month turns and reading starts again (ISO 8601)."},"resetsTimeZone":{"type":"string","description":"The organization's time zone (IANA). The month turns at `resetsAt`, which is the first of the month there."}},"required":["minutesRead","limitHours","resetsAt","resetsTimeZone"],"description":"When it arrived past your monthly meeting hours: what you used and when the month turns."}},"required":["id","title","startsAt","endsAt","platform","status","needsYou","suggestionCount","link","transcriptSource","recap","attendees","about","calendarSource","limit"],"additionalProperties":false,"description":"The meeting, with its recap and what it is about."}},"required":["success","data"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"x-moxo-person-only":"PERSON_TOKEN_REQUIRED","tags":["Meetings"],"summary":"Remove a meeting, or undo that","description":"\"Remove this call\": with `excluded: true` the call leaves every read at once, its recap goes and its minutes no longer count, and the answer is `null`. `false` within a minute undoes it and its recap is written again; after that it answers `404`, because Moxo keeps nothing of the call but what it needs to recognise it.\n\nMeetings come from the calendar and the recorders you connect in Moxo (Settings, My meetings), and only you see yours. Moxo keeps a short recap of each call; it does not keep the transcript. Meetings needs your organization to have the Conductor turned on: otherwise the answer is `403 MEETINGS_NOT_AVAILABLE`.\n\nNeeds a personal access token: an organization API key is not a person, so it gets `403 PERSON_TOKEN_REQUIRED`.\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"The meeting."},"required":true,"description":"The meeting.","name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"excluded":{"type":"boolean","description":"`true`: remove this call from Moxo. Its recap goes and its minutes no longer count; no read returns it any more. `false`, within a minute: undo that, and its recap is written again. On a meeting you recorded in Moxo, removing it deletes the recording, its transcript and its next steps for good: there is no undo (`409 RECORDING_DELETED`)."}},"required":["excluded"],"additionalProperties":false}}}},"responses":{"200":{"description":"The meeting, or `null` once removed.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a 200 response."},"data":{"type":["object","null"],"properties":{"id":{"type":"string","description":"The meeting."},"title":{"type":"string","description":"Its title from the calendar or the recorder. Can be empty."},"startsAt":{"type":"string","description":"When it starts (ISO 8601)."},"endsAt":{"type":"string","description":"When it ends (ISO 8601)."},"platform":{"type":["string","null"],"enum":["google_meet","teams","zoom","phone","in_person","other","moxo","whatsapp",null],"description":"Where the call happens, when the source says."},"status":{"type":"string","enum":["upcoming","waiting_for_transcript","recap_ready","nothing_to_read","excluded","over_limit","unavailable","recap_failed","draft","scheduled","live","ended","cancelled"],"description":"Where the meeting is: `upcoming` (not over yet), `waiting_for_transcript`, `recap_ready`, `nothing_to_read` (no transcript came, or nothing in it to recap), `over_limit` (past your monthly meeting hours; no recap until the month turns), `unavailable` (its source could not give the transcript) or `recap_failed` (the transcript is there but its summary could not be written)."},"needsYou":{"type":"boolean","description":"The call still holds next steps waiting for you."},"suggestionCount":{"type":"integer","minimum":0,"description":"How many next steps from this call are still waiting for you."},"link":{"type":["object","null"],"properties":{"kind":{"type":"string","enum":["flow","project","conversation"],"description":"What it is linked to: a `flow`, a `project` or a `conversation`."},"id":{"type":"string","description":"The flow, project or conversation."},"name":{"type":["string","null"],"description":"Its name. `null` for a conversation with no title."}},"required":["kind","id","name"],"description":"The work it is about, when you can see it."},"transcriptSource":{"type":["string","null"],"enum":["google_meet","granola","fathom","recorded",null],"description":"Where its transcript is: `google_meet`, `granola` or `fathom` (Moxo reads it from there and does not keep it), or `recorded`, a meeting you recorded in Moxo, whose transcript Moxo keeps for you."},"recap":{"type":["string","null"],"description":"Moxo's three or four line recap. `null` until it is read."},"attendees":{"type":"array","items":{"type":"object","properties":{"email":{"type":"string","description":"Their email address, as the calendar or recording has it."},"name":{"type":["string","null"],"description":"Their name, when the source gives one."},"inOrganization":{"type":"boolean","description":"Whether this email is a person in your organization."}},"required":["email","name","inOrganization"],"additionalProperties":false},"description":"Who else was invited or on the call."},"about":{"type":["object","null"],"properties":{"id":{"type":"string","description":"Send it to `DELETE /v1/meetings/{id}/links/{linkId}` when the call is not about this after all."},"kind":{"type":"string","enum":["flow","project","conversation"],"description":"What it is linked to: a `flow`, a `project` or a `conversation`."},"targetId":{"type":"string","description":"The flow, project or conversation."},"name":{"type":["string","null"],"description":"Its name."},"how":{"type":"string","enum":["booked","hosted","linked_by_you","matched"],"description":"How: `booked` by a Time Booking step, `hosted` from the work, `linked_by_you`, or `matched`: Moxo was sure on its own (the one open item the call's people share). You can always change it."}},"required":["id","kind","targetId","name","how"],"additionalProperties":false,"description":"What the call is about, or `null`: not set. Change it with `POST /v1/meetings/{id}/links`."},"calendarSource":{"type":["string","null"],"enum":["google_calendar","microsoft_calendar",null],"description":"The calendar it came from, when it came from one."},"limit":{"type":["object","null"],"properties":{"minutesRead":{"type":"integer","description":"Minutes of your meetings Moxo has read this month."},"limitHours":{"type":["number","null"],"description":"Your monthly meeting hours. `null`: no limit."},"resetsAt":{"type":"string","description":"When the month turns and reading starts again (ISO 8601)."},"resetsTimeZone":{"type":"string","description":"The organization's time zone (IANA). The month turns at `resetsAt`, which is the first of the month there."}},"required":["minutesRead","limitHours","resetsAt","resetsTimeZone"],"description":"When it arrived past your monthly meeting hours: what you used and when the month turns."}},"required":["id","title","startsAt","endsAt","platform","status","needsYou","suggestionCount","link","transcriptSource","recap","attendees","about","calendarSource","limit"],"additionalProperties":false,"description":"`null` after removing it (no read returns it any more); the meeting after undoing that."}},"required":["success","data"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/meetings/{id}/links":{"post":{"x-moxo-person-only":"PERSON_TOKEN_REQUIRED","tags":["Meetings"],"summary":"Say what a meeting is about","description":"Says which flow, project or conversation one of your meetings is about, as \"This call is about · Change\" does in the app. It replaces what was there, Moxo's own match included. You need to see it: a flow you can open, a project you are a member of, a conversation you are in; anything else answers `404 LINK_TARGET_NOT_FOUND`. Sending the same work twice changes nothing. A recurring meeting keeps your choice: its next meetings are about the same work.\n\nMeetings come from the calendar and the recorders you connect in Moxo (Settings, My meetings), and only you see yours. Moxo keeps a short recap of each call; it does not keep the transcript. Meetings needs your organization to have the Conductor turned on: otherwise the answer is `403 MEETINGS_NOT_AVAILABLE`.\n\nNeeds a personal access token: an organization API key is not a person, so it gets `403 PERSON_TOKEN_REQUIRED`.\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"The meeting."},"required":true,"description":"The meeting.","name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"type":"string","enum":["flow","project","conversation"],"description":"What it is linked to: a `flow`, a `project` or a `conversation`."},"targetId":{"type":"string","minLength":1,"maxLength":200,"description":"The flow, project or conversation it is about. You need to see it: a flow you can open, a project you are a member of, a conversation you are in."}},"required":["kind","targetId"],"additionalProperties":false}}}},"responses":{"201":{"description":"The meeting, with what it is about.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a 200 response."},"data":{"type":"object","properties":{"id":{"type":"string","description":"The meeting."},"title":{"type":"string","description":"Its title from the calendar or the recorder. Can be empty."},"startsAt":{"type":"string","description":"When it starts (ISO 8601)."},"endsAt":{"type":"string","description":"When it ends (ISO 8601)."},"platform":{"type":["string","null"],"enum":["google_meet","teams","zoom","phone","in_person","other","moxo","whatsapp",null],"description":"Where the call happens, when the source says."},"status":{"type":"string","enum":["upcoming","waiting_for_transcript","recap_ready","nothing_to_read","excluded","over_limit","unavailable","recap_failed","draft","scheduled","live","ended","cancelled"],"description":"Where the meeting is: `upcoming` (not over yet), `waiting_for_transcript`, `recap_ready`, `nothing_to_read` (no transcript came, or nothing in it to recap), `over_limit` (past your monthly meeting hours; no recap until the month turns), `unavailable` (its source could not give the transcript) or `recap_failed` (the transcript is there but its summary could not be written)."},"needsYou":{"type":"boolean","description":"The call still holds next steps waiting for you."},"suggestionCount":{"type":"integer","minimum":0,"description":"How many next steps from this call are still waiting for you."},"link":{"type":["object","null"],"properties":{"kind":{"type":"string","enum":["flow","project","conversation"],"description":"What it is linked to: a `flow`, a `project` or a `conversation`."},"id":{"type":"string","description":"The flow, project or conversation."},"name":{"type":["string","null"],"description":"Its name. `null` for a conversation with no title."}},"required":["kind","id","name"],"description":"The work it is about, when you can see it."},"transcriptSource":{"type":["string","null"],"enum":["google_meet","granola","fathom","recorded",null],"description":"Where its transcript is: `google_meet`, `granola` or `fathom` (Moxo reads it from there and does not keep it), or `recorded`, a meeting you recorded in Moxo, whose transcript Moxo keeps for you."},"recap":{"type":["string","null"],"description":"Moxo's three or four line recap. `null` until it is read."},"attendees":{"type":"array","items":{"type":"object","properties":{"email":{"type":"string","description":"Their email address, as the calendar or recording has it."},"name":{"type":["string","null"],"description":"Their name, when the source gives one."},"inOrganization":{"type":"boolean","description":"Whether this email is a person in your organization."}},"required":["email","name","inOrganization"],"additionalProperties":false},"description":"Who else was invited or on the call."},"about":{"type":["object","null"],"properties":{"id":{"type":"string","description":"Send it to `DELETE /v1/meetings/{id}/links/{linkId}` when the call is not about this after all."},"kind":{"type":"string","enum":["flow","project","conversation"],"description":"What it is linked to: a `flow`, a `project` or a `conversation`."},"targetId":{"type":"string","description":"The flow, project or conversation."},"name":{"type":["string","null"],"description":"Its name."},"how":{"type":"string","enum":["booked","hosted","linked_by_you","matched"],"description":"How: `booked` by a Time Booking step, `hosted` from the work, `linked_by_you`, or `matched`: Moxo was sure on its own (the one open item the call's people share). You can always change it."}},"required":["id","kind","targetId","name","how"],"additionalProperties":false,"description":"What the call is about, or `null`: not set. Change it with `POST /v1/meetings/{id}/links`."},"calendarSource":{"type":["string","null"],"enum":["google_calendar","microsoft_calendar",null],"description":"The calendar it came from, when it came from one."},"limit":{"type":["object","null"],"properties":{"minutesRead":{"type":"integer","description":"Minutes of your meetings Moxo has read this month."},"limitHours":{"type":["number","null"],"description":"Your monthly meeting hours. `null`: no limit."},"resetsAt":{"type":"string","description":"When the month turns and reading starts again (ISO 8601)."},"resetsTimeZone":{"type":"string","description":"The organization's time zone (IANA). The month turns at `resetsAt`, which is the first of the month there."}},"required":["minutesRead","limitHours","resetsAt","resetsTimeZone"],"description":"When it arrived past your monthly meeting hours: what you used and when the month turns."}},"required":["id","title","startsAt","endsAt","platform","status","needsYou","suggestionCount","link","transcriptSource","recap","attendees","about","calendarSource","limit"],"additionalProperties":false,"description":"The meeting, with its recap and what it is about."}},"required":["success","data"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/meetings/{id}/links/{linkId}":{"delete":{"x-moxo-person-only":"PERSON_TOKEN_REQUIRED","tags":["Meetings"],"summary":"Say a meeting is not about that work","description":"Clears what one of your meetings is about (\"Not about any of these\"). The work itself is not changed.\n\nMeetings come from the calendar and the recorders you connect in Moxo (Settings, My meetings), and only you see yours. Moxo keeps a short recap of each call; it does not keep the transcript. Meetings needs your organization to have the Conductor turned on: otherwise the answer is `403 MEETINGS_NOT_AVAILABLE`.\n\nNeeds a personal access token: an organization API key is not a person, so it gets `403 PERSON_TOKEN_REQUIRED`.\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"The meeting."},"required":true,"description":"The meeting.","name":"id","in":"path"},{"schema":{"type":"string","description":"The meeting's `about.id`."},"required":true,"description":"The meeting's `about.id`.","name":"linkId","in":"path"}],"responses":{"200":{"description":"The meeting.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a 200 response."},"data":{"type":"object","properties":{"id":{"type":"string","description":"The meeting."},"title":{"type":"string","description":"Its title from the calendar or the recorder. Can be empty."},"startsAt":{"type":"string","description":"When it starts (ISO 8601)."},"endsAt":{"type":"string","description":"When it ends (ISO 8601)."},"platform":{"type":["string","null"],"enum":["google_meet","teams","zoom","phone","in_person","other","moxo","whatsapp",null],"description":"Where the call happens, when the source says."},"status":{"type":"string","enum":["upcoming","waiting_for_transcript","recap_ready","nothing_to_read","excluded","over_limit","unavailable","recap_failed","draft","scheduled","live","ended","cancelled"],"description":"Where the meeting is: `upcoming` (not over yet), `waiting_for_transcript`, `recap_ready`, `nothing_to_read` (no transcript came, or nothing in it to recap), `over_limit` (past your monthly meeting hours; no recap until the month turns), `unavailable` (its source could not give the transcript) or `recap_failed` (the transcript is there but its summary could not be written)."},"needsYou":{"type":"boolean","description":"The call still holds next steps waiting for you."},"suggestionCount":{"type":"integer","minimum":0,"description":"How many next steps from this call are still waiting for you."},"link":{"type":["object","null"],"properties":{"kind":{"type":"string","enum":["flow","project","conversation"],"description":"What it is linked to: a `flow`, a `project` or a `conversation`."},"id":{"type":"string","description":"The flow, project or conversation."},"name":{"type":["string","null"],"description":"Its name. `null` for a conversation with no title."}},"required":["kind","id","name"],"description":"The work it is about, when you can see it."},"transcriptSource":{"type":["string","null"],"enum":["google_meet","granola","fathom","recorded",null],"description":"Where its transcript is: `google_meet`, `granola` or `fathom` (Moxo reads it from there and does not keep it), or `recorded`, a meeting you recorded in Moxo, whose transcript Moxo keeps for you."},"recap":{"type":["string","null"],"description":"Moxo's three or four line recap. `null` until it is read."},"attendees":{"type":"array","items":{"type":"object","properties":{"email":{"type":"string","description":"Their email address, as the calendar or recording has it."},"name":{"type":["string","null"],"description":"Their name, when the source gives one."},"inOrganization":{"type":"boolean","description":"Whether this email is a person in your organization."}},"required":["email","name","inOrganization"],"additionalProperties":false},"description":"Who else was invited or on the call."},"about":{"type":["object","null"],"properties":{"id":{"type":"string","description":"Send it to `DELETE /v1/meetings/{id}/links/{linkId}` when the call is not about this after all."},"kind":{"type":"string","enum":["flow","project","conversation"],"description":"What it is linked to: a `flow`, a `project` or a `conversation`."},"targetId":{"type":"string","description":"The flow, project or conversation."},"name":{"type":["string","null"],"description":"Its name."},"how":{"type":"string","enum":["booked","hosted","linked_by_you","matched"],"description":"How: `booked` by a Time Booking step, `hosted` from the work, `linked_by_you`, or `matched`: Moxo was sure on its own (the one open item the call's people share). You can always change it."}},"required":["id","kind","targetId","name","how"],"additionalProperties":false,"description":"What the call is about, or `null`: not set. Change it with `POST /v1/meetings/{id}/links`."},"calendarSource":{"type":["string","null"],"enum":["google_calendar","microsoft_calendar",null],"description":"The calendar it came from, when it came from one."},"limit":{"type":["object","null"],"properties":{"minutesRead":{"type":"integer","description":"Minutes of your meetings Moxo has read this month."},"limitHours":{"type":["number","null"],"description":"Your monthly meeting hours. `null`: no limit."},"resetsAt":{"type":"string","description":"When the month turns and reading starts again (ISO 8601)."},"resetsTimeZone":{"type":"string","description":"The organization's time zone (IANA). The month turns at `resetsAt`, which is the first of the month there."}},"required":["minutesRead","limitHours","resetsAt","resetsTimeZone"],"description":"When it arrived past your monthly meeting hours: what you used and when the month turns."}},"required":["id","title","startsAt","endsAt","platform","status","needsYou","suggestionCount","link","transcriptSource","recap","attendees","about","calendarSource","limit"],"additionalProperties":false,"description":"The meeting, with its recap and what it is about."}},"required":["success","data"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/{id}/artifacts":{"get":{"tags":["Flows"],"summary":"List a flow's artifacts","description":"Returns the flow's artifacts (its deliverables), with the flow's values filled in, as the app shows them to the person the token belongs to: a flow manager reads every artifact, anyone else only the ones shared with their role, and no one reads a block of a step they can't see. Files carry short-lived download links. An organization API key reads them as a flow manager does. Artifacts must be on for your organization's plan (`403 FEATURE_DISABLED`).\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `flows:read`","security":[{"bearerAuth":["flows:read"]}],"parameters":[{"schema":{"type":"string","description":"The flow's id."},"required":true,"description":"The flow's id.","name":"id","in":"path"}],"responses":{"200":{"description":"The artifacts you may read, and what you may do with them.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."},"data":{"type":"object","properties":{"artifacts":{"type":"array","items":{"$ref":"#/components/schemas/FlowArtifact"},"description":"The artifacts, in the template's order."},"access":{"type":"string","enum":["full","participant","viewer","none"],"description":"`full`: you manage the flow and may change every artifact. `participant`: you may change the blocks shared with you to edit (each says `editable`). `viewer`: you read only."}},"required":["artifacts","access"],"additionalProperties":false,"description":"The artifacts you may read, and what you may do with them."}},"required":["success","data"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/{id}/artifacts/blocks/{blockId}":{"patch":{"x-moxo-person-only":"ASSIGNEE_REQUIRED","tags":["Flows"],"summary":"Fill in an artifact block","description":"Fills in a field block (`kind: \"input\"`), or edits an AI block's text (`kind: \"ai\"`, which then counts as edited by a person). A manager may change any; anyone else only a block shared with them to edit, and not after the flow finished. A block that can't be filled in returns `400`, one you may not change `403`. Artifacts must be on for your organization's plan (`403 FEATURE_DISABLED`).\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"The flow's id."},"required":true,"description":"The flow's id.","name":"id","in":"path"},{"schema":{"type":"string","description":"The block's `id`, from `GET /v1/flows/{id}/artifacts`."},"required":true,"description":"The block's `id`, from `GET /v1/flows/{id}/artifacts`.","name":"blockId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"value":{"anyOf":[{"type":"string","maxLength":1000000},{"type":"null"}],"description":"The block's new value as text, in the form the field takes (a list or a table as JSON text), or `null` to clear it."}},"required":["value"],"additionalProperties":false}}}},"responses":{"200":{"description":"The block's value now.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."},"data":{"type":"object","properties":{"blockId":{"type":"string","description":"The block."},"value":{"type":["string","null"],"description":"The value now stored."},"source":{"type":"string","enum":["manual","ai"],"description":"`manual`: a person wrote it. `ai`: the AI did."},"edited":{"type":"object","properties":{"at":{"type":"string","description":"When (ISO 8601)."},"by":{"type":"string","description":"Who, by name."}},"required":["at"],"additionalProperties":false,"description":"Who wrote it, and when."}},"required":["blockId","value","source","edited"],"additionalProperties":false,"description":"The block's value now."}},"required":["success","data"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/{id}/artifacts/blocks/{blockId}/generate":{"post":{"x-moxo-person-only":"ASSIGNEE_REQUIRED","tags":["Flows"],"summary":"Have AI write an artifact block","description":"Has the AI write an AI block's text from the flow's data, replacing what it held. Only a flow manager can do this (`403`). A block that is not an AI block returns `400`. When the AI can't answer, nothing is written and the call returns `503 AI_UNAVAILABLE` with `Retry-After`: try again. Artifacts must be on for your organization's plan (`403 FEATURE_DISABLED`).\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"The flow's id."},"required":true,"description":"The flow's id.","name":"id","in":"path"},{"schema":{"type":"string","description":"The block's `id`, from `GET /v1/flows/{id}/artifacts`."},"required":true,"description":"The block's `id`, from `GET /v1/flows/{id}/artifacts`.","name":"blockId","in":"path"}],"responses":{"200":{"description":"The text the AI wrote.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."},"data":{"type":"object","properties":{"blockId":{"type":"string","description":"The block."},"value":{"type":["string","null"],"description":"The value now stored."},"source":{"type":"string","enum":["manual","ai"],"description":"`manual`: a person wrote it. `ai`: the AI did."},"edited":{"type":"object","properties":{"at":{"type":"string","description":"When (ISO 8601)."},"by":{"type":"string","description":"Who, by name."}},"required":["at"],"additionalProperties":false,"description":"Who wrote it, and when."}},"required":["blockId","value","source","edited"],"additionalProperties":false,"description":"The text the AI wrote."}},"required":["success","data"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"The AI could not answer just now (`AI_UNAVAILABLE`), and nothing was saved. Usually `error.retryable` is `true`: try again after the number of seconds in `Retry-After`. When `error.retryable` is `false` (there is no `Retry-After`), a retry will not help until the AI account is fixed on the Moxo side: contact support with the `requestId`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/{id}/artifacts/docs/{blockId}":{"patch":{"x-moxo-person-only":"ASSIGNEE_REQUIRED","tags":["Flows"],"summary":"Save an artifact document","description":"Saves the whole document of a document block (`kind: \"richtext\"`). Send the `rev` you read as `baseRev`: when someone saved since, it returns `409 STALE_WRITE` with `data.currentRev`; read it again and merge. A document that isn't in the editor's form returns `400 INVALID_DOCUMENT`. A manager may edit any; anyone else only one shared with them to edit, and not after the flow finished. Artifacts must be on for your organization's plan (`403 FEATURE_DISABLED`).\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"The flow's id."},"required":true,"description":"The flow's id.","name":"id","in":"path"},{"schema":{"type":"string","description":"The block's `id`, from `GET /v1/flows/{id}/artifacts`."},"required":true,"description":"The block's `id`, from `GET /v1/flows/{id}/artifacts`.","name":"blockId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"doc":{"type":"object","additionalProperties":{},"description":"The whole document, as `GET /v1/flows/{id}/artifacts` returns it in the block's `doc` (the editor's JSON form). Moxo cleans it before it is saved."},"baseRev":{"type":"integer","minimum":0,"description":"The `rev` you last read. Required once the document has been saved: a save from an older `rev` returns `409 STALE_WRITE` with the current one, so it never overwrites someone else's edit. Leave it out only for the first save."}},"required":["doc"],"additionalProperties":false}}}},"responses":{"200":{"description":"The document as saved.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."},"data":{"type":"object","properties":{"blockId":{"type":"string","description":"The block."},"doc":{"description":"The document as saved, after Moxo cleaned it."},"rev":{"type":"integer","description":"Its new revision: send it as `baseRev` next time."},"edited":{"type":"object","properties":{"at":{"type":"string","description":"When (ISO 8601)."},"by":{"type":"string","description":"Who, by name."}},"required":["at"],"additionalProperties":false,"description":"Who saved it, and when."}},"required":["blockId","rev","edited"],"additionalProperties":false,"description":"The document as saved."}},"required":["success","data"]}}}},"400":{"description":"Refused: `INVALID_DOCUMENT`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Refused: `STALE_WRITE`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/{id}/artifacts/docs/{blockId}/history":{"get":{"x-moxo-person-only":"PERSON_TOKEN_REQUIRED","tags":["Flows"],"summary":"List an artifact document's versions","description":"Lists the versions kept of a document block, newest first. Only a flow manager can do this (`403`). Artifacts must be on for your organization's plan (`403 FEATURE_DISABLED`). Needs a personal access token: a document's versions are read by a person (`403 PERSON_TOKEN_REQUIRED` for an organization API key).\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"The flow's id."},"required":true,"description":"The flow's id.","name":"id","in":"path"},{"schema":{"type":"string","description":"The block's `id`, from `GET /v1/flows/{id}/artifacts`."},"required":true,"description":"The block's `id`, from `GET /v1/flows/{id}/artifacts`.","name":"blockId","in":"path"}],"responses":{"200":{"description":"The versions.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."},"data":{"type":"object","properties":{"snapshots":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The version's id."},"label":{"type":["string","null"],"description":"Its name, for a version someone named."},"kind":{"type":"string","description":"`named`: someone saved it with a name. Otherwise Moxo kept it on its own, such as before a restore."},"createdAt":{"type":"string","description":"When it was kept (ISO 8601)."},"by":{"type":"string","description":"Who kept it, by name."}},"required":["id","label","kind","createdAt"],"additionalProperties":false},"description":"The versions, newest first."}},"required":["snapshots"],"additionalProperties":false,"description":"The versions."}},"required":["success","data"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"x-moxo-person-only":"ASSIGNEE_REQUIRED","tags":["Flows"],"summary":"Name a version of an artifact document","description":"Keeps the document as it is now, under a name. An empty document returns `400`. Only a flow manager can do this (`403`). Artifacts must be on for your organization's plan (`403 FEATURE_DISABLED`).\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"The flow's id."},"required":true,"description":"The flow's id.","name":"id","in":"path"},{"schema":{"type":"string","description":"The block's `id`, from `GET /v1/flows/{id}/artifacts`."},"required":true,"description":"The block's `id`, from `GET /v1/flows/{id}/artifacts`.","name":"blockId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"label":{"type":"string","minLength":1,"maxLength":120,"description":"A name for this version, up to 120 characters."}},"required":["label"],"additionalProperties":false}}}},"responses":{"200":{"description":"The version kept.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."},"data":{"type":"object","properties":{"id":{"type":"string","description":"The version's id."}},"required":["id"],"additionalProperties":false,"description":"The version kept."}},"required":["success","data"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/{id}/artifacts/docs/{blockId}/history/{snapshotId}":{"get":{"x-moxo-person-only":"PERSON_TOKEN_REQUIRED","tags":["Flows"],"summary":"Read an artifact document's version","description":"Returns one kept version of a document block. Only a flow manager can do this (`403`). Artifacts must be on for your organization's plan (`403 FEATURE_DISABLED`). Needs a personal access token: a document's versions are read by a person (`403 PERSON_TOKEN_REQUIRED` for an organization API key).\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"The flow's id."},"required":true,"description":"The flow's id.","name":"id","in":"path"},{"schema":{"type":"string","description":"The block's `id`, from `GET /v1/flows/{id}/artifacts`."},"required":true,"description":"The block's `id`, from `GET /v1/flows/{id}/artifacts`.","name":"blockId","in":"path"},{"schema":{"type":"string","description":"The version's id."},"required":true,"description":"The version's id.","name":"snapshotId","in":"path"}],"responses":{"200":{"description":"The version.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."},"data":{"type":"object","properties":{"id":{"type":"string","description":"The version's id."},"doc":{"description":"The document as it was, in the editor's JSON form."},"createdAt":{"type":"string","description":"When it was kept (ISO 8601)."}},"required":["id","createdAt"],"additionalProperties":false,"description":"The version."}},"required":["success","data"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/{id}/artifacts/docs/{blockId}/restore":{"post":{"x-moxo-person-only":"ASSIGNEE_REQUIRED","tags":["Flows"],"summary":"Restore a version of an artifact document","description":"Puts a kept version back as the document. What it held before is kept as a version too. Only a flow manager can do this (`403`). Artifacts must be on for your organization's plan (`403 FEATURE_DISABLED`).\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"The flow's id."},"required":true,"description":"The flow's id.","name":"id","in":"path"},{"schema":{"type":"string","description":"The block's `id`, from `GET /v1/flows/{id}/artifacts`."},"required":true,"description":"The block's `id`, from `GET /v1/flows/{id}/artifacts`.","name":"blockId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"snapshotId":{"type":"string","minLength":1,"description":"The version's `id`, from `GET /v1/flows/{id}/artifacts/docs/{blockId}/history`."}},"required":["snapshotId"],"additionalProperties":false}}}},"responses":{"200":{"description":"The document's revision after the restore.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."},"data":{"type":"object","properties":{"rev":{"type":"integer","description":"Its new revision: send it as `baseRev` next time."}},"required":["rev"],"additionalProperties":false,"description":"The document's revision after the restore."}},"required":["success","data"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/health":{"get":{"tags":["System"],"summary":"Check service health","description":"Returns the service status. Use it for uptime monitoring and heartbeat checks.\n\n**Tokens:** none. Anyone may call it.","security":[],"responses":{"200":{"description":"The service is up.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok"],"example":"ok"},"timestamp":{"type":"string","description":"When the response was sent, in ISO 8601.","example":"2026-04-28T10:00:00.000Z"},"version":{"type":"string","description":"The public API version. It changes only when the shape of `/v1` changes, not with each release.","example":"3.0.0"},"buildSha":{"type":["string","null"],"description":"The build of the service that handled this request, or `null` when unknown. Include it in a support request to identify the release.","example":"9da95403bc1783dd0e01e587a32ac6393b827b3d"}},"required":["status","timestamp","version","buildSha"]}}}}}}},"/v1/users":{"get":{"tags":["Users"],"summary":"List users","description":"Returns the users in your organization, internal and external together. Each row includes `customFields`, your organization's current profile fields for the person (the same map as on `GET /v1/users/{id}`). Send `kind=external` or `kind=internal` to get one kind, and optionally `status`, `personaId`, `accountId`, `uniqueId` or `search`. `uniqueId` finds the people your system knows by those IDs, exactly (any letter case); `search` matches part of a name, email, unique ID or phone. To see internal users, an organization API key needs `team:read`, and a personal access token's person must be able to see the People roster in the app; every default group can. Each half stands alone: a caller with only `external_users:read` gets external users only (the list without `kind` leaves out internal users, and `kind=internal` returns `403 FORBIDDEN`), and one with only `team:read` gets internal users only (`kind=external` returns `403 FORBIDDEN`).\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `external_users:read` or `team:read`","security":[{"bearerAuth":["external_users:read"]},{"bearerAuth":["team:read"]}],"parameters":[{"schema":{"type":"string","description":"The previous page's `nextCursor`. The next page starts right after that person, even if they were deactivated or removed from the organization since. A value this list did not return is refused with `400 INVALID_CURSOR`."},"required":false,"description":"The previous page's `nextCursor`. The next page starts right after that person, even if they were deactivated or removed from the organization since. A value this list did not return is refused with `400 INVALID_CURSOR`.","name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":200,"description":"Users per page, 1 to 200. Defaults to 50."},"required":false,"description":"Users per page, 1 to 200. Defaults to 50.","name":"limit","in":"query"},{"schema":{"type":"string","enum":["internal","external"]},"required":false,"name":"kind","in":"query"},{"schema":{"type":"string","description":"`ACTIVE`, `INVITED` or `DEACTIVATED`, or several comma-separated: `ACTIVE,INVITED` lists everyone who can still be given work. Leave it out for all three.","example":"ACTIVE,INVITED"},"required":false,"description":"`ACTIVE`, `INVITED` or `DEACTIVATED`, or several comma-separated: `ACTIVE,INVITED` lists everyone who can still be given work. Leave it out for all three.","name":"status","in":"query"},{"schema":{"type":"string"},"required":false,"name":"personaId","in":"query"},{"schema":{"type":"string"},"required":false,"name":"accountId","in":"query"},{"schema":{"type":"string","description":"Only the people with these organization-scoped unique IDs: an exact match in any letter case, one or up to 100 comma-separated. Unlike `search`, `EMP-1` does not also find `EMP-10`. More than 100 returns `400 BAD_REQUEST`.","example":"EMP-1,EMP-2"},"required":false,"description":"Only the people with these organization-scoped unique IDs: an exact match in any letter case, one or up to 100 comma-separated. Unlike `search`, `EMP-1` does not also find `EMP-10`. More than 100 returns `400 BAD_REQUEST`.","name":"uniqueId","in":"query"},{"schema":{"type":"string"},"required":false,"name":"search","in":"query"}],"responses":{"200":{"description":"The users.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"array","items":{"$ref":"#/components/schemas/UserSummary"}},"nextCursor":{"type":["string","null"]}},"required":["success","data","nextCursor"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"tags":["Users"],"summary":"Create user","description":"Invites an internal user (someone on your team) or an external user (a client, vendor or partner) to your organization. The persona decides where they work, in the orchestrator portal, a named portal or magic links only, and must match the user's `kind`. An organization API key needs `team:write` for `kind=internal` and `external_users:write` for `kind=external`; a key with one of these scopes can't do the other. `kind=internal` sends a team invitation email. Personal access tokens, organization API keys and partner delegation keys can all invite. An invitation sent with a key is recorded under the key in the audit trail, and the email names the key's owner (for a partner delegation key, the partner). Only a person can invite someone to an admin persona: a key gets `SERVICE_KEY_CANNOT_INVITE_ADMIN`. `kind=external` creates the user at once, with status `ACTIVE`. `data.invitationSent` is `true` only when the person can sign in to a portal and an invitation email is being sent. A user with a magic-link-only persona is created with `invitationSent: false` and gets no email; they hear from Moxo when they have something to do. To onboard your first client, make this call, then give them work (start a flow) or create an SDK session for them. The response carries the new user's id and `invitationSent`; call `GET /v1/users/{id}` for the full user.\n\nIdentify the person with `email`, an organization-scoped `uniqueId`, or both. When both are sent, `uniqueId` is the durable key and the email is where they sign in and get mail. Someone added by `uniqueId` alone gets no email (`invitationSent: false`), and `sendInvitation: true` without an email is refused.\n\nThe email and the unique ID are each unique in your organization, for both kinds. A `uniqueId` someone already holds returns `409 UNIQUE_ID_CONFLICT`, whatever email was sent with it: `error.existingUserId` is that person's id when you may read them, so to make sure someone exists, add them and on this answer use that id. An email someone already has, or is invited with, returns `409 DUPLICATE`: the message names the person, `error.existingUserId` is their id when you may read them. An inactive internal user is that same `409 DUPLICATE`, and `error.reason` is `deactivated_member`. Reactivate them with `POST /v1/users/{id}/activate`. Inviting them again does not make them active. Either way nothing is changed or sent. To send an invitation again, use `POST /v1/users/{id}/resend-invite`. An external user who was deactivated or removed is added back instead, with `200`.\n\nWhen your identity provider gives people their personas (single sign-on role mapping, or your directory's groups on Provisioning) and your organization has turned off adding personas in Moxo, an invitation that would give a person it manages a persona returns `409 PERSONAS_FROM_IDP_ONLY`, and nothing is sent.\n\n**Idempotent.** Send an `Idempotency-Key` header to make retries safe. A retry with the same key within 10 minutes returns the first result and sends no second email. After 10 minutes a retry is answered as any second add is: `409 DUPLICATE` for an email, or `409 UNIQUE_ID_CONFLICT` for a `uniqueId`, each with the person's id. See Idempotency in the Introduction.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `external_users:write`","security":[{"bearerAuth":["external_users:write"]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":256,"pattern":"^[A-Za-z0-9_\\-:.]+$","description":"An optional key that makes this request safe to retry. Send a new UUID for each request. A key is up to 256 letters, digits, `-`, `_`, `:` or `.`; any other key is refused with `400 INVALID_IDEMPOTENCY_KEY` and nothing runs. A retry with the same key within 10 minutes returns the first response and changes nothing again. After 10 minutes, the same key runs the request again, so use a new key for a late retry. See Idempotency in the Introduction.","example":"6f2c4a5e-3b8d-4c7f-9a1e-2d6b8e0f4c5a"},"required":false,"description":"An optional key that makes this request safe to retry. Send a new UUID for each request. A key is up to 256 letters, digits, `-`, `_`, `:` or `.`; any other key is refused with `400 INVALID_IDEMPOTENCY_KEY` and nothing runs. A retry with the same key within 10 minutes returns the first response and changes nothing again. After 10 minutes, the same key runs the request again, so use a new key for a late retry. See Idempotency in the Introduction.","name":"Idempotency-Key","in":"header"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateUserRequest"}}}},"responses":{"200":{"description":"For an external user only: a deactivated or removed external user with this email was added back. The body is the same as for `201`.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"id":{"type":"string"},"uniqueId":{"type":["string","null"],"description":"Org-scoped partner identity stamped on create when supplied (or already held). `null` when the person has none."},"invitationSent":{"type":"boolean"}},"required":["id","uniqueId","invitationSent"]}},"required":["success","data"]}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"id":{"type":"string"},"uniqueId":{"type":["string","null"],"description":"Org-scoped partner identity stamped on create when supplied (or already held). `null` when the person has none."},"invitationSent":{"type":"boolean","description":"`true` when an invitation email is being sent with this response. `false` for an external user with a magic-link-only persona, and for an internal invitation that didn't send a new email."}},"required":["id","uniqueId","invitationSent"]}},"required":["success","data"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Refused: `DUPLICATE`, `PERSONAS_FROM_IDP_ONLY`, `UNIQUE_ID_CONFLICT`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"410":{"description":"The first result for this `Idempotency-Key` can no longer be returned, because what it created was deleted. Use a new key for the next attempt.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"425":{"description":"A request with this `Idempotency-Key` is still running. Retry after `Retry-After` seconds. If the first request failed with a `5xx`, the key stays held for 10 minutes; to retry sooner, use a new key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"The first result for this `Idempotency-Key` couldn't be checked. Retry with the same key after a short wait. If it keeps happening, contact support with the `requestId`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/users/{id}":{"get":{"tags":["Users"],"summary":"Get user","description":"Returns the user's full profile in this organization: name, contact details, persona, account (for an external user), when they were invited, joined or deactivated, time zone, and `customFields` (your organization's current profile fields; deleted fields are left out). To read an internal user, an organization API key needs `team:read`, and a personal access token's person must be able to see the People roster in the app; every default group can. To read an external user, it needs `external_users:read`, or for a person, permission to see or invite external users. A caller without the right one gets `404`, so the endpoint never confirms that someone exists. Read your own profile with `GET /v1/users/me`.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `external_users:read` or `team:read`","security":[{"bearerAuth":["external_users:read"]},{"bearerAuth":["team:read"]}],"parameters":[{"schema":{"type":"string","description":"Person lookup key. Prefer the opaque `usr_…` id. When your organization has Partner unique ID on, a `uniqueId` resolves next (ignoring case), then an email address; a value that is one person's unique ID and another person's email names no one (`404`). A legacy UUID still works. Path-encode `@` (`%40`).","example":"usr_7Kd2mQxWnR4vT9pLcYb3Ae"},"required":true,"description":"Person lookup key. Prefer the opaque `usr_…` id. When your organization has Partner unique ID on, a `uniqueId` resolves next (ignoring case), then an email address; a value that is one person's unique ID and another person's email names no one (`404`). A legacy UUID still works. Path-encode `@` (`%40`).","name":"id","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/UserDetail"}},"required":["success","data"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"tags":["Users"],"summary":"Update user profile","description":"Updates a user's profile in this organization: name, phone, picture, time zone and, optionally, `customFields`, a partial map of your organization's profile fields. It can also change their persona or link them to an account. Profile changes apply only to this organization; the same person can have different settings in another organization they belong to. Writing `customFields` needs no more access than the rest of this request. An unknown field key returns `400 UNKNOWN_KEY`, and a value over 256 characters returns `400 VALUE_TOO_LONG`.\n\nChanging an **internal** user also needs `team:write` for an organization API key, or, for a personal access token, a person with **Invite internal users** (People → Orchestrator permissions), on top of `external_users:write`. A caller without it gets `404` for an internal user, so the endpoint never confirms that one exists, as on `GET /v1/users/{id}` and `POST /v1/users`.\n\nSetting your own `title` (when the token belongs to this user) follows your organization's setting for people setting their own title: while it is off, the request returns `403 TITLE_EDIT_DISABLED` and nothing is changed. A change to an external user's profile is recorded in the audit log as `external_user.updated`, and a change to an internal user's name as `member.name_changed`.\n\nWhen your organization's directory provisions people (SCIM), the fields it sends for a person can only be changed there: setting one of them (`name`, `title`, `department`, `managerId` or a `customFields` key) returns `409 DIRECTORY_MANAGED`, and nothing in the request is changed. Sending the value the person already has is not a change.\n\nWhen your identity provider gives people their personas (single sign-on role mapping, or your directory's groups on Provisioning), a persona it gave can't be replaced here: the request returns `409 IDP_PERSONA_LOCKED` with `error.details.personaId`. When adding personas in Moxo is turned off, a new persona for a person it manages returns `409 PERSONAS_FROM_IDP_ONLY`. Either way, nothing in the request is changed; change the person's groups in your identity provider instead.\n\nTo change the email an external user signs in with, send `email` from an organization API key that also holds `users:email`, for someone your organization knows by a unique ID. Send `email` alone. It is the same change a person makes for themselves, for your organization only: they keep their id, unique ID and history here, another organization they belong to keeps the email it knows them by, and their open sessions end. An internal user's email is never changed this way. Moxo emails the previous address to say the sign-in email changed, without naming the new one. The change is recorded in the audit log as `member.email_changed`, and a refused one as `member.email_change_refused`.\n\nThe answer is the user as `GET /v1/users/{id}` returns them after the change.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `external_users:write`","security":[{"bearerAuth":["external_users:write"]}],"parameters":[{"schema":{"type":"string","description":"Person lookup key. Prefer the opaque `usr_…` id. When your organization has Partner unique ID on, a `uniqueId` resolves next (ignoring case), then an email address; a value that is one person's unique ID and another person's email names no one (`404`). A legacy UUID still works. Path-encode `@` (`%40`).","example":"usr_7Kd2mQxWnR4vT9pLcYb3Ae"},"required":true,"description":"Person lookup key. Prefer the opaque `usr_…` id. When your organization has Partner unique ID on, a `uniqueId` resolves next (ignoring case), then an email address; a value that is one person's unique ID and another person's email names no one (`404`). A legacy UUID still works. Path-encode `@` (`%40`).","name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateUserRequest"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"allOf":[{"$ref":"#/components/schemas/UserDetail"},{"description":"The user after the change, as `GET /v1/users/{id}` returns them. Left out when your organization limits who you can see to your relationships and this person is not on them: the change is still saved."}]}},"required":["success"]}}}},"400":{"description":"Refused: `UNKNOWN_KEY`, `VALUE_TOO_LONG`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict. Nothing in the request was changed. `DIRECTORY_MANAGED`: your organization's directory sets this for this person, so change it there; `error.field` names the field (`name`, `title`, `department`, `manager`, `email`, or `custom:<key>`). `EMAIL_CHANGE_NOT_ALLOWED`: `error.reason` is `org_key_only`, `internal_member`, `no_unique_id` or `sign_in_provider`. `EMAIL_BELONGS_TO_ANOTHER_ACCOUNT`: that email already signs in to Moxo.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"tags":["Users"],"summary":"Delete user","description":"Deactivates the user in this organization (an `INVITED` user too: their invitation stops working). Deleting someone already deactivated changes nothing. Their name stays on past assignments, so the audit trail stays complete. This is the same deactivation as `/deactivate`, with the same rules: only another Owner, using their own personal access token (not an organization API key), can deactivate an Owner, and never the last one (`400 LAST_OWNER`). You can't deactivate yourself with your personal access token (`400 CANNOT_DEACTIVATE_SELF`). An organization API key can still delete a user. It is recorded as `user.deactivated`.\n\nRemoving an **internal** user also needs `team:write` for an organization API key, or, for a personal access token, a person with **Invite internal users** (People → Orchestrator permissions). A caller with only `external_users:write` gets `404` for an internal user.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `external_users:write`","security":[{"bearerAuth":["external_users:write"]}],"parameters":[{"schema":{"type":"string","description":"Person lookup key. Prefer the opaque `usr_…` id. When your organization has Partner unique ID on, a `uniqueId` resolves next (ignoring case), then an email address; a value that is one person's unique ID and another person's email names no one (`404`). A legacy UUID still works. Path-encode `@` (`%40`).","example":"usr_7Kd2mQxWnR4vT9pLcYb3Ae"},"required":true,"description":"Person lookup key. Prefer the opaque `usr_…` id. When your organization has Partner unique ID on, a `uniqueId` resolves next (ignoring case), then an email address; a value that is one person's unique ID and another person's email names no one (`404`). A legacy UUID still works. Path-encode `@` (`%40`).","name":"id","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]}},"required":["success"]}}}},"400":{"description":"Refused: `CANNOT_DEACTIVATE_SELF`, `LAST_OWNER`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/users/me":{"get":{"tags":["Users"],"summary":"Get my details","x-moxo-person-only":"PERSON_TOKEN_REQUIRED","description":"Returns your own full profile in this organization: name, contact details, persona, account (for an external user), when you were invited and joined, time zone, and `customFields`. The response is the same as `GET /v1/users/{id}` for your own id. An organization API key has no person behind it, so it gets `403 PERSON_TOKEN_REQUIRED`; it reads a person with `GET /v1/users/{id}`.\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/UserDetail"}},"required":["success","data"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/users/{id}/deactivate":{"post":{"tags":["Users"],"summary":"Deactivate user","description":"Suspends the user in this organization. They can no longer sign in or be assigned new work, but their name stays on past assignments, so the audit trail stays complete. Reverse it with `/activate`. On a deactivated user, it changes nothing. An invited user who hasn't accepted yet returns `400`: withdraw the invitation with `DELETE /v1/users/{id}`. You can't deactivate yourself with your personal access token (`400 CANNOT_DEACTIVATE_SELF`). An organization API key can still deactivate a user. A person your organization's directory provisions can still be deactivated here, as an emergency hold: the directory can't reactivate them until someone reactivates them in Moxo.\n\nDeactivating an **internal** user also needs `team:write` for an organization API key, or, for a personal access token, a person with **Invite internal users** (People → Orchestrator permissions). A caller with only `external_users:write` gets `404` for an internal user.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `external_users:write`","security":[{"bearerAuth":["external_users:write"]}],"parameters":[{"schema":{"type":"string","description":"Person lookup key. Prefer the opaque `usr_…` id. When your organization has Partner unique ID on, a `uniqueId` resolves next (ignoring case), then an email address; a value that is one person's unique ID and another person's email names no one (`404`). A legacy UUID still works. Path-encode `@` (`%40`).","example":"usr_7Kd2mQxWnR4vT9pLcYb3Ae"},"required":true,"description":"Person lookup key. Prefer the opaque `usr_…` id. When your organization has Partner unique ID on, a `uniqueId` resolves next (ignoring case), then an email address; a value that is one person's unique ID and another person's email names no one (`404`). A legacy UUID still works. Path-encode `@` (`%40`).","name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string","description":"Why the user is deactivated, recorded with the deactivation in the audit log.","example":"Left the company"}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]}},"required":["success"]}}}},"400":{"description":"Refused: `CANNOT_DEACTIVATE_SELF`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/users/{id}/activate":{"post":{"tags":["Users"],"summary":"Activate user","description":"Moves an `INVITED` or `DEACTIVATED` user to `ACTIVE`. An invited internal user gets the persona their invitation gives them (the one chosen at invite, or the default for its tier), as accepting the invitation would, and the invitation is used up. That is the same for an internal user deactivated before they accepted. You can only give that persona if you could invite them with it: an admin persona needs an admin (a key gets `403 SERVICE_KEY_CANNOT_INVITE_ADMIN`, anyone else `403 ADMIN_INVITE_REQUIRES_ADMIN`), a key gives only the default member persona (`403 SERVICE_KEY_CANNOT_CHOOSE_PERSONA`), a person can't give permissions they don't have (`403 OVER_GRANT`), and a persona your plan doesn't include is refused (`403 FEATURE_DISABLED`, `error.feature` naming it). Nothing changes, and the invitee can still accept the invitation themselves. Someone who already holds that persona, or another orchestrator-portal persona when the invitation gives one, keeps what they hold, as accepting would; so does someone whose personas come from your identity provider while adding them in Moxo is off. On someone who became active since, it changes nothing (`changed: false`). On an active user, it changes nothing, and the answer says `changed: false`. A person your organization's directory deactivated returns `409 DIRECTORY_MANAGED`: reactivate them in the directory. A person deactivated in Moxo while the directory provisions them is reactivated, and the directory manages them again.\n\nActivating an **internal** user also needs `team:write` for an organization API key, or, for a personal access token, a person with **Invite internal users** (People → Orchestrator permissions). A caller with only `external_users:write` gets `404` for an internal user.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `external_users:write`","security":[{"bearerAuth":["external_users:write"]}],"parameters":[{"schema":{"type":"string","description":"Person lookup key. Prefer the opaque `usr_…` id. When your organization has Partner unique ID on, a `uniqueId` resolves next (ignoring case), then an email address; a value that is one person's unique ID and another person's email names no one (`404`). A legacy UUID still works. Path-encode `@` (`%40`).","example":"usr_7Kd2mQxWnR4vT9pLcYb3Ae"},"required":true,"description":"Person lookup key. Prefer the opaque `usr_…` id. When your organization has Partner unique ID on, a `uniqueId` resolves next (ignoring case), then an email address; a value that is one person's unique ID and another person's email names no one (`404`). A legacy UUID still works. Path-encode `@` (`%40`).","name":"id","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."},"changed":{"type":"boolean","description":"`true` when this call changed what you asked it to. `false` when that was already so, and the call changed nothing of it."},"message":{"type":"string","description":"Only with `changed: false`: what was already so.","example":"Nothing changed: this person already holds this role."}},"required":["success","changed"],"additionalProperties":false}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict. `DIRECTORY_MANAGED`: your organization's directory sets this for this person, so change it there. `error.field` names the field (`name`, `title`, `department`, `manager`, `active`, or `custom:<key>`). Nothing in the request was changed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/users/{id}/resend-invite":{"post":{"tags":["Users"],"summary":"Resend an invitation","description":"Sends the invitation email again. It works only while the user is `INVITED`, and at most once a minute. For an **internal** user, it also needs `team:write` for an organization API key, or, for a personal access token, a person with **Invite internal users** (People → Orchestrator permissions). A caller with only `external_users:write` gets `404` for an internal user.\n\n**Idempotent.** Send an `Idempotency-Key` to make retries safe: a retry with the same key within 10 minutes returns the first result and sends no second email. After 10 minutes the invitation is sent again, and for an internal user the new link replaces the earlier one. Use a new key for a late retry.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `external_users:write`","security":[{"bearerAuth":["external_users:write"]}],"parameters":[{"schema":{"type":"string","description":"Person lookup key. Prefer the opaque `usr_…` id. When your organization has Partner unique ID on, a `uniqueId` resolves next (ignoring case), then an email address; a value that is one person's unique ID and another person's email names no one (`404`). A legacy UUID still works. Path-encode `@` (`%40`).","example":"usr_7Kd2mQxWnR4vT9pLcYb3Ae"},"required":true,"description":"Person lookup key. Prefer the opaque `usr_…` id. When your organization has Partner unique ID on, a `uniqueId` resolves next (ignoring case), then an email address; a value that is one person's unique ID and another person's email names no one (`404`). A legacy UUID still works. Path-encode `@` (`%40`).","name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":256,"pattern":"^[A-Za-z0-9_\\-:.]+$","description":"An optional key that makes this request safe to retry. Send a new UUID for each request. A key is up to 256 letters, digits, `-`, `_`, `:` or `.`; any other key is refused with `400 INVALID_IDEMPOTENCY_KEY` and nothing runs. A retry with the same key within 10 minutes returns the first response and changes nothing again. After 10 minutes, the same key runs the request again, so use a new key for a late retry. See Idempotency in the Introduction.","example":"6f2c4a5e-3b8d-4c7f-9a1e-2d6b8e0f4c5a"},"required":false,"description":"An optional key that makes this request safe to retry. Send a new UUID for each request. A key is up to 256 letters, digits, `-`, `_`, `:` or `.`; any other key is refused with `400 INVALID_IDEMPOTENCY_KEY` and nothing runs. A retry with the same key within 10 minutes returns the first response and changes nothing again. After 10 minutes, the same key runs the request again, so use a new key for a late retry. See Idempotency in the Introduction.","name":"Idempotency-Key","in":"header"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]}},"required":["success"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"410":{"description":"The first result for this `Idempotency-Key` can no longer be returned, because what it created was deleted. Use a new key for the next attempt.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"425":{"description":"A request with this `Idempotency-Key` is still running. Retry after `Retry-After` seconds. If the first request failed with a `5xx`, the key stays held for 10 minutes; to retry sooner, use a new key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"The first result for this `Idempotency-Key` couldn't be checked. Retry with the same key after a short wait. If it keeps happening, contact support with the `requestId`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/personas":{"get":{"tags":["Personas"],"summary":"List personas","description":"Lists the personas in your organization. When you invite a user with `POST /v1/users`, choose a persona from this list: it decides where the user works, in the orchestrator portal, a named portal or magic links only.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `team:read`","security":[{"bearerAuth":["team:read"]}],"parameters":[{"schema":{"type":"string","enum":["internal","external"]},"required":false,"name":"userType","in":"query"},{"schema":{"type":"string","enum":["orchestrator_portal","portal","magic_link"]},"required":false,"name":"access","in":"query"},{"schema":{"type":"string"},"required":false,"name":"search","in":"query"}],"responses":{"200":{"description":"The personas.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."},"data":{"type":"array","items":{"$ref":"#/components/schemas/Persona"},"description":"The personas."}},"required":["success","data"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"tags":["Personas"],"summary":"Create a persona","description":"Creates a persona, as the Personas page does: the same checks and the same record. A persona says where the people who hold it work: the orchestrator portal with a permission group's capabilities, one or more portals, or magic links only. Give it to people when you invite them (`POST /v1/users`) or later (`POST /v1/users/{id}/personas`).\n\nA name another persona has answers `400`. A `portal` persona needs the Portals feature on your plan.\n\nCreating and changing personas needs the Personas feature on your plan; without it, the response is `403 FEATURE_DISABLED` with `error.feature`.\n\nThis runs as the person who owns the token, with exactly their permissions in Moxo, and is recorded as theirs. An organization API key gets `403 PERSON_TOKEN_REQUIRED`.\n\n**Permission:** Manage personas.\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"x-moxo-person-only":"PERSON_TOKEN_REQUIRED","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":255,"description":"The persona's name, unique in your organization."},"access":{"type":"string","enum":["orchestrator_portal","portal","magic_link"],"description":"Where people with this persona work: `orchestrator_portal` (with a `permissionGroupId`; internal users only), `portal` (with `portalIds`), or `magic_link` (magic links only, no portal). Defaults to `portal`."},"userType":{"type":"string","enum":["internal","external"],"description":"Who can hold it. It never changes after the persona is created. Defaults to `internal` for `orchestrator_portal`, otherwise `external`."},"portalIds":{"type":"array","items":{"type":"string","minLength":1},"maxItems":50,"description":"The portals people with this persona can open, when `access` is `portal`: at least one. Leave it out for any other `access`."},"permissionGroupId":{"type":["string","null"],"minLength":1,"description":"The permission group people with this persona get, when `access` is `orchestrator_portal` (required then). Leave it out for any other `access`. You can only give a group whose capabilities you hold yourself."},"description":{"type":["string","null"],"maxLength":2000,"description":"What the persona is for, shown on the Personas page."},"color":{"type":["string","null"],"maxLength":32,"description":"The colour of the persona's badge."},"isDefault":{"type":"boolean","description":"`true`: new people of this `userType` get this persona when they are invited without one. One persona per user type is the default."},"sortOrder":{"type":"integer","description":"Where the persona appears in lists; lower comes first."}},"required":["name"],"additionalProperties":false}}}},"responses":{"201":{"description":"The persona.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."},"data":{"allOf":[{"$ref":"#/components/schemas/Persona"},{"description":"The persona."}]}},"required":["success","data"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/personas/{id}":{"put":{"tags":["Personas"],"summary":"Change a persona","description":"Changes the settings you send; the rest stay as they are. A change of permission group or `access` reaches everyone who holds the persona at once. The built-in Owner and Admin personas can't be changed.\n\nCreating and changing personas needs the Personas feature on your plan; without it, the response is `403 FEATURE_DISABLED` with `error.feature`.\n\nThis runs as the person who owns the token, with exactly their permissions in Moxo, and is recorded as theirs. An organization API key gets `403 PERSON_TOKEN_REQUIRED`.\n\n**Permission:** Manage personas.\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"x-moxo-person-only":"PERSON_TOKEN_REQUIRED","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":255,"description":"A new name, unique in your organization. The Owner and Admin personas keep theirs."},"access":{"type":"string","enum":["orchestrator_portal","portal","magic_link"],"description":"Where people with this persona work from now on. Moving to `orchestrator_portal` needs a `permissionGroupId`, and is refused when someone who holds it already has another orchestrator-portal persona."},"userType":{"type":"string","enum":["internal","external"],"description":"Can't change: send the persona's own, or leave it out. To give other people this access, duplicate the persona."},"portalIds":{"type":"array","items":{"type":"string","minLength":1},"maxItems":50,"description":"The portals people with this persona can open, when `access` is `portal`: at least one. Leave it out for any other `access`."},"permissionGroupId":{"type":["string","null"],"minLength":1,"description":"The permission group people with this persona get, when `access` is `orchestrator_portal` (required then). Leave it out for any other `access`. You can only give a group whose capabilities you hold yourself."},"description":{"type":["string","null"],"maxLength":2000,"description":"What the persona is for, shown on the Personas page."},"color":{"type":["string","null"],"maxLength":32,"description":"The colour of the persona's badge."},"isDefault":{"type":"boolean","description":"`true`: new people of this `userType` get this persona when they are invited without one. One persona per user type is the default."},"sortOrder":{"type":"integer","description":"Where the persona appears in lists; lower comes first."}},"additionalProperties":false}}}},"responses":{"200":{"description":"The persona.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."},"data":{"allOf":[{"$ref":"#/components/schemas/Persona"},{"description":"The persona."}]}},"required":["success","data"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"tags":["Personas"],"summary":"Delete a persona","description":"Deletes a persona. When people hold it, send `reassignToPersonaId`: they get that persona instead, in the same change. The Owner and Admin personas can't be deleted.\n\nCreating and changing personas needs the Personas feature on your plan; without it, the response is `403 FEATURE_DISABLED` with `error.feature`.\n\nThis runs as the person who owns the token, with exactly their permissions in Moxo, and is recorded as theirs. An organization API key gets `403 PERSON_TOKEN_REQUIRED`.\n\n**Permission:** Manage personas.\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"x-moxo-person-only":"PERSON_TOKEN_REQUIRED","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"reassignToPersonaId":{"type":"string","description":"The persona the people who hold this one get instead. Required when anyone holds it."}},"additionalProperties":false}}}},"responses":{"200":{"description":"Done.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."}},"required":["success"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/personas/{id}/duplicate":{"post":{"tags":["Personas"],"summary":"Duplicate a persona","description":"Copies a persona: where its people work, its portals, its permission group, colour and description, with any setting you send changed. Nobody holds the copy, and it is never the default. The Owner persona can't be copied.\n\nCreating and changing personas needs the Personas feature on your plan; without it, the response is `403 FEATURE_DISABLED` with `error.feature`.\n\nThis runs as the person who owns the token, with exactly their permissions in Moxo, and is recorded as theirs. An organization API key gets `403 PERSON_TOKEN_REQUIRED`.\n\n**Permission:** Manage personas.\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"x-moxo-person-only":"PERSON_TOKEN_REQUIRED","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":["object","null"],"properties":{"name":{"type":"string","maxLength":255,"description":"The copy's name. Defaults to \"Copy of\" and the original's name."},"description":{"type":["string","null"],"maxLength":2000,"description":"The copy's description. Defaults to the original's."},"color":{"type":["string","null"],"maxLength":32,"description":"The colour of the copy's badge. Defaults to the original's."},"access":{"type":"string","enum":["orchestrator_portal","portal","magic_link"],"description":"Where people with the copy work. Defaults to the original's."},"userType":{"type":"string","enum":["internal","external"],"description":"Who can hold the copy. Defaults to the original's."},"portalIds":{"type":"array","items":{"type":"string","minLength":1},"maxItems":50,"description":"The portals the copy opens, when its `access` is `portal`. Defaults to the original's."},"permissionGroupId":{"type":["string","null"],"minLength":1,"description":"The permission group the copy carries, when its `access` is `orchestrator_portal`. Defaults to the original's. You can only give a group whose capabilities you hold yourself."}},"additionalProperties":false}}}},"responses":{"201":{"description":"The copy.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."},"data":{"allOf":[{"$ref":"#/components/schemas/Persona"},{"description":"The copy."}]}},"required":["success","data"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/personas/{id}/members/{userId}":{"delete":{"tags":["Personas"],"summary":"Take a persona from a person","description":"Takes this persona from one person who holds it, internal or external (`userId` is their id from `GET /v1/users`). A person keeps at least one persona: taking their last answers `400 LAST_PERSONA`. The organization keeps at least one owner.\n\nCreating and changing personas needs the Personas feature on your plan; without it, the response is `403 FEATURE_DISABLED` with `error.feature`.\n\nThis runs as the person who owns the token, with exactly their permissions in Moxo, and is recorded as theirs. An organization API key gets `403 PERSON_TOKEN_REQUIRED`.\n\n**Permission:** Manage personas.\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"x-moxo-person-only":"PERSON_TOKEN_REQUIRED","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":true,"name":"userId","in":"path"}],"responses":{"200":{"description":"Done.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."}},"required":["success"]}}}},"400":{"description":"Refused: `LAST_PERSONA`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/users/{id}/personas":{"post":{"tags":["Personas"],"summary":"Give an external user a persona","description":"Gives an external user one more persona, as their page in People does. Only an external persona (`GET /v1/personas?userType=external`): an internal one answers `400 PERSONA_TYPE_MISMATCH`. A `portal` persona needs the Portals feature on your plan. With a personal access token you can only give access you hold yourself.\n\n**Permission for a personal access token:** Invite external users.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `external_users:write`","security":[{"bearerAuth":["external_users:write"]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"personaId":{"type":"string","minLength":1,"description":"The persona to give: an external persona of your organization (`GET /v1/personas?userType=external`)."}},"required":["personaId"],"additionalProperties":false}}}},"responses":{"200":{"description":"Done.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."}},"required":["success"]}}}},"400":{"description":"Refused: `PERSONA_TYPE_MISMATCH`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/users/{id}/personas/{personaId}":{"delete":{"tags":["Personas"],"summary":"Take a persona from an external user","description":"Takes one persona from an external user. They keep at least one: taking their last answers `400`.\n\n**Permission for a personal access token:** Invite external users.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `external_users:write`","security":[{"bearerAuth":["external_users:write"]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":true,"name":"personaId","in":"path"}],"responses":{"200":{"description":"Done.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."}},"required":["success"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/permission-groups":{"get":{"tags":["Personas"],"summary":"List permission groups","description":"Lists your organization's permission groups: what the people who hold an orchestrator-portal persona may do. A persona names its group in `permissionGroupId`.\n\n**Permission for a personal access token:** Manage permission groups.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `team:read`","security":[{"bearerAuth":["team:read"]}],"responses":{"200":{"description":"The permission groups.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."},"data":{"type":"array","items":{"$ref":"#/components/schemas/PermissionGroup"},"description":"The permission groups."}},"required":["success","data"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"tags":["Personas"],"summary":"Create a permission group","description":"Creates a permission group from capability bundles, as the Permission groups page does. You can only grant capabilities you hold yourself: a bundle beyond them answers `403`. A name another group has answers `409 DUPLICATE`. Give the group to people through a persona's `permissionGroupId`.\n\nCreating and changing personas needs the Personas feature on your plan; without it, the response is `403 FEATURE_DISABLED` with `error.feature`.\n\nThis runs as the person who owns the token, with exactly their permissions in Moxo, and is recorded as theirs. An organization API key gets `403 PERSON_TOKEN_REQUIRED`.\n\n**Permission:** Manage permission groups.\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"x-moxo-person-only":"PERSON_TOKEN_REQUIRED","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":255,"description":"The group's name, unique in your organization."},"description":{"type":["string","null"],"maxLength":2000,"description":"What the group is for, shown on the Permission groups page."},"bundles":{"type":"array","items":{"type":"string"},"maxItems":64,"description":"The capability bundles it grants (`run.start_flows`, `run.view_all_flows`, `manage.invite_external`, …): the ones on the Permission groups page. You can only grant capabilities you hold yourself."}},"required":["name","bundles"],"additionalProperties":false}}}},"responses":{"201":{"description":"The permission group.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."},"data":{"allOf":[{"$ref":"#/components/schemas/PermissionGroup"},{"description":"The permission group."}]}},"required":["success","data"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Refused: `DUPLICATE`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/permission-groups/{id}":{"put":{"tags":["Personas"],"summary":"Change a permission group","description":"Changes a group's name, description or bundles. Everyone whose persona carries the group gets the change at once. You can only grant capabilities you hold yourself. The Owner group can't be changed, and the Admin group keeps its name and description.\n\nCreating and changing personas needs the Personas feature on your plan; without it, the response is `403 FEATURE_DISABLED` with `error.feature`.\n\nThis runs as the person who owns the token, with exactly their permissions in Moxo, and is recorded as theirs. An organization API key gets `403 PERSON_TOKEN_REQUIRED`.\n\n**Permission:** Manage permission groups.\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"x-moxo-person-only":"PERSON_TOKEN_REQUIRED","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":255,"description":"A new name, unique in your organization."},"description":{"type":["string","null"],"maxLength":2000,"description":"A new description; `null` clears it."},"bundles":{"type":"array","items":{"type":"string"},"maxItems":64,"description":"The bundles it grants from now on. A bundle partly granted before stays as it is unless it is in `clearedBundles`."},"clearedBundles":{"type":"array","items":{"type":"string"},"maxItems":64,"description":"Bundles to turn off completely, including any part of them granted before."}},"additionalProperties":false}}}},"responses":{"200":{"description":"The permission group.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."},"data":{"allOf":[{"$ref":"#/components/schemas/PermissionGroup"},{"description":"The permission group."}]}},"required":["success","data"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"tags":["Personas"],"summary":"Delete a permission group","description":"Deletes a group your organization made. A built-in group, or one a persona or a person still has, can't be deleted: move them to another group first.\n\nCreating and changing personas needs the Personas feature on your plan; without it, the response is `403 FEATURE_DISABLED` with `error.feature`.\n\nThis runs as the person who owns the token, with exactly their permissions in Moxo, and is recorded as theirs. An organization API key gets `403 PERSON_TOKEN_REQUIRED`.\n\n**Permission:** Manage permission groups.\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"x-moxo-person-only":"PERSON_TOKEN_REQUIRED","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Done.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."}},"required":["success"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/permission-groups/{id}/duplicate":{"post":{"tags":["Personas"],"summary":"Duplicate a permission group","description":"Copies a group's capabilities into a new group nobody has yet. The Owner group can't be copied.\n\nCreating and changing personas needs the Personas feature on your plan; without it, the response is `403 FEATURE_DISABLED` with `error.feature`.\n\nThis runs as the person who owns the token, with exactly their permissions in Moxo, and is recorded as theirs. An organization API key gets `403 PERSON_TOKEN_REQUIRED`.\n\n**Permission:** Manage permission groups.\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"x-moxo-person-only":"PERSON_TOKEN_REQUIRED","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":["object","null"],"properties":{"name":{"type":"string","maxLength":255,"description":"The copy's name. Defaults to \"Copy of\" and the original's name."},"description":{"type":["string","null"],"maxLength":2000,"description":"The copy's description. Defaults to the original's."}},"additionalProperties":false}}}},"responses":{"201":{"description":"The copy.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."},"data":{"allOf":[{"$ref":"#/components/schemas/PermissionGroup"},{"description":"The copy."}]}},"required":["success","data"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/permission-groups/{id}/reset-to-default":{"post":{"tags":["Personas"],"summary":"Reset a built-in permission group","description":"Puts the Owner, Admin or Member group back to the capabilities it comes with. Any other group answers `400 NOT_SYSTEM_GROUP`. You can only reset a group to capabilities you hold yourself.\n\nCreating and changing personas needs the Personas feature on your plan; without it, the response is `403 FEATURE_DISABLED` with `error.feature`.\n\nThis runs as the person who owns the token, with exactly their permissions in Moxo, and is recorded as theirs. An organization API key gets `403 PERSON_TOKEN_REQUIRED`.\n\n**Permission:** Manage permission groups.\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"x-moxo-person-only":"PERSON_TOKEN_REQUIRED","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The permission group.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."},"data":{"allOf":[{"$ref":"#/components/schemas/PermissionGroup"},{"description":"The permission group."}]}},"required":["success","data"]}}}},"400":{"description":"Refused: `NOT_SYSTEM_GROUP`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/accounts":{"get":{"tags":["Accounts"],"summary":"List accounts","description":"Returns the accounts in your organization. Filter by `status` (`ACTIVE` or `INACTIVE`), or send `search` to match part of a name or domain.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `external_users:read`","security":[{"bearerAuth":["external_users:read"]}],"parameters":[{"schema":{"type":"string","enum":["ACTIVE","INACTIVE"]},"required":false,"name":"status","in":"query"},{"schema":{"type":"string"},"required":false,"name":"search","in":"query"}],"responses":{"200":{"description":"The accounts.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"array","items":{"$ref":"#/components/schemas/AccountSummary"}}},"required":["success","data"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"tags":["Accounts"],"summary":"Create account","description":"Creates an account. The response carries only the new id; call `GET /v1/accounts/{id}` for the full account.\n\n**A domain another account has** is saved, as in the app, and `data.warnings` carries `ACCOUNT_DOMAIN_SHARED`: people are no longer matched to an account by that domain.\n\n**Idempotent.** Send an `Idempotency-Key` header to make retries safe: a retry within 10 minutes returns the same account id and creates no second account. See Idempotency in the Introduction.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `external_users:write`","security":[{"bearerAuth":["external_users:write"]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":256,"pattern":"^[A-Za-z0-9_\\-:.]+$","description":"An optional key that makes this request safe to retry. Send a new UUID for each request. A key is up to 256 letters, digits, `-`, `_`, `:` or `.`; any other key is refused with `400 INVALID_IDEMPOTENCY_KEY` and nothing runs. A retry with the same key within 10 minutes returns the first response and changes nothing again. After 10 minutes, the same key runs the request again, so use a new key for a late retry. See Idempotency in the Introduction.","example":"6f2c4a5e-3b8d-4c7f-9a1e-2d6b8e0f4c5a"},"required":false,"description":"An optional key that makes this request safe to retry. Send a new UUID for each request. A key is up to 256 letters, digits, `-`, `_`, `:` or `.`; any other key is refused with `400 INVALID_IDEMPOTENCY_KEY` and nothing runs. A retry with the same key within 10 minutes returns the first response and changes nothing again. After 10 minutes, the same key runs the request again, so use a new key for a late retry. See Idempotency in the Introduction.","name":"Idempotency-Key","in":"header"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAccountRequest"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"id":{"type":"string"},"warnings":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string","enum":["ACCOUNT_DOMAIN_SHARED"],"description":"Another account in your organization already has this domain."},"message":{"type":"string","description":"The warning in a sentence for people, naming the other account.","example":"Another account (\"Acme\") already uses this domain. Auto-matching will be disabled for contacts with this domain."}},"required":["code","message"]},"description":"What saved but may not do what you expect. `ACCOUNT_DOMAIN_SHARED`: another account already has this domain; it is saved, and people are no longer matched to an account by that domain. Left out when there is none. A replay with the same `Idempotency-Key` answers it again."}},"required":["id"]}},"required":["success","data"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"410":{"description":"The first result for this `Idempotency-Key` can no longer be returned, because what it created was deleted. Use a new key for the next attempt.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"425":{"description":"A request with this `Idempotency-Key` is still running. Retry after `Retry-After` seconds. If the first request failed with a `5xx`, the key stays held for 10 minutes; to retry sooner, use a new key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"The first result for this `Idempotency-Key` couldn't be checked. Retry with the same key after a short wait. If it keeps happening, contact support with the `requestId`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/accounts/{id}":{"get":{"tags":["Accounts"],"summary":"Get account","description":"Returns the account and every external user linked to it.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `external_users:read`","security":[{"bearerAuth":["external_users:read"]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/AccountDetail"}},"required":["success","data"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"tags":["Accounts"],"summary":"Update account","description":"Updates the account's name, domain or status. A domain another account in your organization already has is saved, as in the app, and `data.warnings` carries `ACCOUNT_DOMAIN_SHARED`: people are no longer matched to an account by that domain.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `external_users:write`","security":[{"bearerAuth":["external_users:write"]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAccountRequest"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"warnings":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string","enum":["ACCOUNT_DOMAIN_SHARED"],"description":"Another account in your organization already has this domain."},"message":{"type":"string","description":"The warning in a sentence for people, naming the other account.","example":"Another account (\"Acme\") already uses this domain. Auto-matching will be disabled for contacts with this domain."}},"required":["code","message"]},"description":"What saved but may not do what you expect. `ACCOUNT_DOMAIN_SHARED`: another account already has this domain; it is saved, and people are no longer matched to an account by that domain. Left out when there is none. A replay with the same `Idempotency-Key` answers it again."}},"description":"What the update says beyond success: `warnings`, when there is one."}},"required":["success","data"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"tags":["Accounts"],"summary":"Delete account","description":"Deletes the account. External users linked to it are kept, still with `kind=external`; the account no longer appears on their details.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `external_users:write`","security":[{"bearerAuth":["external_users:write"]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The account was deleted.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"connectionBundlesUnlinked":{"type":"integer","description":"How many sets of app connections the account held; they no longer belong to it."},"connectionsDeactivated":{"type":"integer","description":"How many app connections in those sets were turned off."}},"required":["success","connectionBundlesUnlinked","connectionsDeactivated"],"additionalProperties":false}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/actions":{"get":{"tags":["Actions"],"summary":"List actions","description":"Returns every action your organization has sent or received: a signature, an approval, a form or a file. Flows are not listed here; they are on `/v1/flows`.\n\nYou see only what you may see. `scope=all` returns the whole organization only to a caller who can see every action in it; anyone else gets the actions they have a part in: sent, asked, preparing or reviewing, as the Actions page shows them.\n\nActions must be on for your organization's plan (`403 FEATURE_DISABLED`, `error.feature: \"actions\"`), for every caller.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `actions:read`","security":[{"bearerAuth":["actions:read"]}],"parameters":[{"schema":{"type":"string","enum":["waiting_on_them","waiting_on_me","done","all"],"description":"Which actions to return: `waiting_on_them` is what you asked of others and are still waiting for, and `waiting_on_me` is what others asked of you. Defaults to `all`."},"required":false,"description":"Which actions to return: `waiting_on_them` is what you asked of others and are still waiting for, and `waiting_on_me` is what others asked of you. Defaults to `all`.","name":"scope","in":"query"},{"schema":{"type":"string","maxLength":200,"description":"Text to search for in the title."},"required":false,"description":"Text to search for in the title.","name":"q","in":"query"},{"schema":{"type":"integer","exclusiveMinimum":0,"maximum":50},"required":false,"name":"limit","in":"query"},{"schema":{"type":["integer","null"],"minimum":0},"required":false,"name":"offset","in":"query"}],"responses":{"200":{"description":"A page of actions","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"array","items":{"$ref":"#/components/schemas/Action"}},"pagination":{"type":"object","properties":{"total":{"type":"integer"},"limit":{"type":"integer"},"offset":{"type":"integer"},"hasMore":{"type":"boolean"}},"required":["total","limit","offset","hasMore"]}},"required":["success","data","pagination"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"x-moxo-person-only":"ORG_KEY_NOT_SUPPORTED","tags":["Actions"],"summary":"Send an action","description":"Sends one request to one or more people, such as a signature, an approval, a form or a file. They get an email with a link and need no account, portal or app. When it is answered, they get a copy, and both sides keep the record. Sent from no conversation, Actions must be on for your organization's plan (`403 FEATURE_DISABLED`, `error.feature: \"actions\"`); sent into a conversation, its own features decide instead (below).\n\nNo template or setup is needed. The email comes from your organization. The action belongs to the person behind the token: it is on their Actions list, and they can remind people about it or cancel it.\n\nTo send it in a group conversation, as Request in a conversation does in Moxo, name the conversation in `conversationId`. It is then listed in the conversation (`GET /v1/conversations/{id}/actions`), and the conversation's rules apply instead of the permission to send actions: the token's person must be in the conversation (otherwise `404`), it must not be archived (`409 CONVERSATION_UNAVAILABLE`), everyone asked must be in it (`400 ASSIGNEE_NOT_IN_CONVERSATION`), and where your organization lets only conversation managers send actions, the person must be one (`403 ACTIONS_LIMITED_TO_MANAGERS`). Your plan must include group conversations and actions in them (`403 FEATURE_DISABLED`).\n\nWhat runs once the action is done is `config.automations`: an app (`kind: \"app\"`) or an agent (`kind: \"agent\"`). An AI instruction (`kind: \"ai\"`) is no longer taken (`400 AUTOMATION_AI_INSTRUCTION_RETIRED`).\n\n**An hourly limit.** One person can send 20 actions an hour into each conversation, and 20 from no conversation. Past it, the call returns `429 TOO_MANY_REQUESTS` with `Retry-After`: `error.limit` is the number an hour, `error.home` is where they were counted (`conversation` or `standalone`), `error.retryAt` is when sending works again, and `error.retryAfterSeconds` is the wait.\n\n**Idempotent.** An action emails the people asked, so send an `Idempotency-Key` header to make retries safe: a retry with the same key within 10 minutes answers the action the first call sent, and nobody is asked twice. See Idempotency in the Introduction.\n\n**Products.** An organization without the Actions product can't send new actions: the response is `403 FEATURE_DISABLED` with `error.feature: \"haiActions\"`. An organization that sends actions in its chats today keeps doing so, and actions already sent carry on.\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":256,"pattern":"^[A-Za-z0-9_\\-:.]+$","description":"An optional key that makes this request safe to retry. Send a new UUID for each request. A key is up to 256 letters, digits, `-`, `_`, `:` or `.`; any other key is refused with `400 INVALID_IDEMPOTENCY_KEY` and nothing runs. A retry with the same key within 10 minutes returns the first response and changes nothing again. After 10 minutes, the same key runs the request again, so use a new key for a late retry. See Idempotency in the Introduction.","example":"6f2c4a5e-3b8d-4c7f-9a1e-2d6b8e0f4c5a"},"required":false,"description":"An optional key that makes this request safe to retry. Send a new UUID for each request. A key is up to 256 letters, digits, `-`, `_`, `:` or `.`; any other key is refused with `400 INVALID_IDEMPOTENCY_KEY` and nothing runs. A retry with the same key within 10 minutes returns the first response and changes nothing again. After 10 minutes, the same key runs the request again, so use a new key for a late retry. See Idempotency in the Introduction.","name":"Idempotency-Key","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAction"}}}},"responses":{"201":{"description":"The action, as sent","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/Action"}},"required":["success","data"]}}}},"400":{"description":"Refused: `ASSIGNEE_NOT_IN_CONVERSATION`, `AUTOMATION_AI_INSTRUCTION_RETIRED`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Refused: `CONVERSATION_UNAVAILABLE`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"410":{"description":"The first result for this `Idempotency-Key` can no longer be returned, because what it created was deleted. Use a new key for the next attempt.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"425":{"description":"A request with this `Idempotency-Key` is still running. Retry after `Retry-After` seconds. If the first request failed with a `5xx`, the key stays held for 10 minutes; to retry sooner, use a new key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"The first result for this `Idempotency-Key` couldn't be checked. Retry with the same key after a short wait. If it keeps happening, contact support with the `requestId`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/actions/{id}":{"get":{"tags":["Actions"],"summary":"Get action","description":"Returns one action: who it went to, where each of them stands and whether each has opened it.\n\nActions must be on for your organization's plan (`403 FEATURE_DISABLED`, `error.feature: \"actions\"`), for every caller.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `actions:read`","security":[{"bearerAuth":["actions:read"]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The action","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/Action"}},"required":["success","data"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/actions/{id}/remind":{"post":{"x-moxo-person-only":"ORG_KEY_NOT_SUPPORTED","tags":["Actions"],"summary":"Send a reminder","description":"Reminds everyone who hasn't answered. Nobody who has answered is contacted.\n\nThis sends one reminder now, on top of the action's own reminders: your organization's defaults (Settings → Defaults), or the schedule set when it was sent.\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"How many people were reminded","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"reminded":{"type":"integer"}},"required":["reminded"]}},"required":["success","data"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/actions/{id}/cancel":{"post":{"x-moxo-person-only":"ORG_KEY_NOT_SUPPORTED","tags":["Actions"],"summary":"Cancel an action","description":"Withdraws an action, as **Delete** does in the app. It is removed from every list and read: a later `GET /v1/actions/{id}` answers 404, and so does a second cancel. When it was still open (or paused), it is also canceled, so the people it was sent to are told it was withdrawn: `cancelled: true`. When it was already done, nothing more happens to it and nobody is told: `cancelled: false`. `deleted` is always `true`.\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"What happened to the action.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"deleted":{"type":"boolean","description":"Always `true`: the action is gone from every list and read."},"cancelled":{"type":"boolean","description":"`true` when the action was still open (or paused), so it was canceled and the people it was sent to were told. `false` when it was already done: nobody is told."}},"required":["deleted","cancelled"]}},"required":["success","data"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/ai/generations":{"post":{"tags":["AI"],"summary":"Generate or edit a template","description":"Asks the AI builder to create a draft template, with any draft AI agents it uses, from a plain-language `prompt`. With `mode: \"edit\"` and a `templateId`, it changes that template's draft instead. The work runs in the background: the call returns **202** with a `generationId`, and you poll `GET /v1/ai/generations/{generationId}` for the result. In decisive mode (the default), the AI builder never asks questions: it fills gaps with sensible defaults and lists what it assumed in the result's `assumptions`. Send `publish: true` to publish the result at once; it stays a draft if it fails the publish checks. Send an `idempotencyKey` to make retries safe: a repeat returns the same generation. Each credential has a monthly generation quota (429 `GENERATION_QUOTA_EXCEEDED` when it is used up). An organization with AI turned off gets 403 `AI_DISABLED`.\n\n**With a personal access token** (`mxo_pat_…`), the person is the author: they become the template's creator and owner and appear in its history. The call needs their own permission to build templates with the AI builder (403 `CAPABILITY_DENIED` otherwise), and `publish: true` also needs permission to publish. With `mode: \"edit\"`, the person must be able to edit the template: 404 when they can't see it, 403 when they can see it but not edit it.\n\nA template has owners, so only a person builds one: an organization API key gets 403 `PERSON_TOKEN_REQUIRED` in every mode, and so does a partner delegation key. A key may still poll the organization's generations. The AI builder edits process templates only (400 `WRONG_TEMPLATE_KIND` for an action template).\n\nAn edit changes the template's draft only; new flows keep starting from the published version until the draft is published. If someone changes the template while the AI builder is working, the template is left unchanged and the generation fails with `TEMPLATE_CHANGED`.\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"type":"string","enum":["template"],"default":"template"},"mode":{"type":"string","enum":["create","edit"],"default":"create","description":"`create` builds a new draft template. `edit` changes the template named by `templateId`: the AI works on its draft, and the published version keeps running until it is published. With a personal access token, its person must be able to edit that template; an organization API key or partner delegation key can edit any process template in its organization.","example":"create"},"templateId":{"type":"string","minLength":1,"description":"The template to change. Required with `mode: \"edit\"`, refused with `mode: \"create\"`."},"prompt":{"type":"string","minLength":1,"maxLength":10000},"decisive":{"type":"boolean","default":true},"publish":{"type":"boolean","default":false},"idempotencyKey":{"type":"string","minLength":1,"maxLength":255}},"required":["prompt"]}}}},"responses":{"202":{"description":"Accepted: the generation is queued. Poll `GET /v1/ai/generations/{generationId}` for the result.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"generationId":{"type":"string"},"status":{"type":"string","enum":["PENDING","IN_PROGRESS","COMPLETED","FAILED"]}},"required":["generationId","status"]}},"required":["success","data"]}}}},"400":{"description":"Refused: `WRONG_TEMPLATE_KIND`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-moxo-person-only":"PERSON_TOKEN_REQUIRED"}},"/v1/ai/generations/{generationId}":{"get":{"tags":["AI"],"summary":"Get a generation","description":"Returns a generation's status. Once it is `COMPLETED`, it also returns `resultTemplateId` (the template created, or for an edit, changed), any `mintedAgentIds` and the AI builder's `assumptions`. A `FAILED` generation has an `errorCode` and an `errorDetail`. A personal access token reads the generations its person started; an organization API key reads its organization's.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `ai:generate`","security":[{"bearerAuth":["ai:generate"]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"generationId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["PENDING","IN_PROGRESS","COMPLETED","FAILED"]},"kind":{"type":"string","enum":["template"]},"mode":{"type":"string","enum":["create","edit"]},"templateId":{"type":["string","null"]},"prompt":{"type":"string"},"decisive":{"type":"boolean"},"publish":{"type":"boolean"},"resultTemplateId":{"type":["string","null"]},"resultPublished":{"type":"boolean"},"mintedAgentIds":{"type":"array","items":{"type":"string"}},"assumptions":{"type":"array","items":{"type":"string"}},"errorCode":{"type":["string","null"]},"errorDetail":{"type":["string","null"]},"createdAt":{"type":"string"},"completedAt":{"type":["string","null"]}},"required":["id","status","kind","mode","templateId","prompt","decisive","publish","resultTemplateId","resultPublished","mintedAgentIds","assumptions","errorCode","errorDetail","createdAt","completedAt"]}},"required":["success","data"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/organization":{"get":{"tags":["Organization"],"summary":"Get your organization","description":"Returns the organization the token belongs to: its id, name, slug, and the company name external users see on emails and portals. Call it first to confirm which organization a token reaches. Any valid token can call it.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** none","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"The organization.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a 200 response."},"data":{"type":"object","properties":{"id":{"type":"string","description":"The organization's id."},"name":{"type":"string","description":"The organization's name."},"slug":{"type":"string","description":"The short name in the organization's web address."},"companyName":{"type":"string","description":"The name external users see on emails and portals (Experience → Branding). The organization's name when none is set."},"timezone":{"type":"string","description":"The IANA time zone every date in this organization is read in (Settings → Defaults → Organization time zone): a due date on a calendar day is noon of that day here, a Wait until a date ends when the day starts here, and days and working days are counted on this calendar. `UTC` when the organization never set one.","example":"America/Los_Angeles"}},"required":["id","name","slug","companyName","timezone"],"additionalProperties":false,"description":"The organization the token belongs to."}},"required":["success","data"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/search":{"get":{"tags":["Organization"],"summary":"Search","description":"Finds flows, templates and external users whose name contains `query`, not case-sensitive. Flows also match on their number and on the values of their flow fields (`customFields` on `GET /v1/flows/{id}`: what was given at the start, or a form answer saved to a flow field, for example a company name; an answer kept only on its step is not searched), templates on their description, and external users on their email. Up to `limit` results in all, shared across the three kinds, each with its `type` and the `id` the other endpoints take; a flow says whether it matched on its name or its answers (`matchedIn`).\n\nA personal access token finds what its person sees in the app: the flows on their Flows list, matched only on the field values their flow page shows them, the templates they may open, and external users only when they may view the external user directory. An organization API key finds each kind its scopes can read: flows with `flows:read`, templates with `templates:read`, external users with `external_users:read`. A key with none of them gets `403 INSUFFICIENT_SCOPE`.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `flows:read` or `templates:read` or `external_users:read`","security":[{"bearerAuth":["flows:read"]},{"bearerAuth":["templates:read"]},{"bearerAuth":["external_users:read"]}],"parameters":[{"schema":{"type":"string","minLength":2,"maxLength":200,"description":"Text to find in names (and a flow's field values), at least 2 characters. Not case-sensitive.","example":"Acme"},"required":true,"description":"Text to find in names (and a flow's field values), at least 2 characters. Not case-sensitive.","name":"query","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":50,"description":"Results in all, 1 to 50. Defaults to 30, shared across the three kinds."},"required":false,"description":"Results in all, 1 to 50. Defaults to 30, shared across the three kinds.","name":"limit","in":"query"}],"responses":{"200":{"description":"The matches: flows first, then templates, then external users.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a 200 response."},"data":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["flow","template","contact"],"description":"What it is. `contact` is an external user."},"id":{"type":"string","description":"The flow's or template's id, or the external user's `usr_` id."},"name":{"type":"string","description":"Its name. An external user without one shows their email."},"description":{"type":["string","null"],"description":"A template's description."},"matchedIn":{"type":"string","enum":["name","answers"],"description":"A flow's: `name` when its name or number contains `query`, `answers` when only a value in its fields does (an answer you can see on the flow)."}},"required":["type","id","name"],"additionalProperties":false},"description":"The matches: flows first, then templates, then external users."}},"required":["success","data"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/audit-log":{"get":{"tags":["Organization"],"summary":"List audit events","description":"Returns the organization's audit events, newest first: flows started and finished, steps done, people assigned, and more. Narrow them by flow, event type, who caused them, or time. One flow's activity, as its page shows it, is `GET /v1/flows/{id}/audit-log`.\n\nA personal access token reads the events of flows its person can see, and only the notes they may read on each. Events on no flow, such as sign-ins, invitations and key changes, need the audit log on the organization's plan and the person's permission to view it. An organization API key reads every flow's events, and events on no flow only with `audit:read` too.\n\n`total` counts the matching events you can read. An empty page with `incomplete: true` means the call stopped reading before it found one you can read, not that nothing happened: narrow the filters.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `reports:read`","security":[{"bearerAuth":["reports:read"]}],"parameters":[{"schema":{"type":"string","format":"uuid","description":"Only events on this flow."},"required":false,"description":"Only events on this flow.","name":"flowId","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":200,"description":"Only events of this type.","example":"step.completed"},"required":false,"description":"Only events of this type.","name":"eventType","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":200,"description":"Only events caused by this user (`usr_` id)."},"required":false,"description":"Only events caused by this user (`usr_` id).","name":"actorId","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":200,"description":"Only events about one person: what they did and what was done to them, under any email they had. Takes their `usr_` id or, with Partner unique ID on, their unique ID; never an email. An ID that names no one matches nothing.","example":"CUST-50817"},"required":false,"description":"Only events about one person: what they did and what was done to them, under any email they had. Takes their `usr_` id or, with Partner unique ID on, their unique ID; never an email. An ID that names no one matches nothing.","name":"person","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":200,"description":"Only events caused by these kinds of actor, comma-separated: `internal` and `external` users, `system`, `agent` (an AI agent) or `api` (an API key). Any listed kind matches. A user's kind is the one they have now, so a deactivated or removed internal user's events stay `internal`. With `actorId`, both must match.","example":"internal"},"required":false,"description":"Only events caused by these kinds of actor, comma-separated: `internal` and `external` users, `system`, `agent` (an AI agent) or `api` (an API key). Any listed kind matches. A user's kind is the one they have now, so a deactivated or removed internal user's events stay `internal`. With `actorId`, both must match.","name":"actorKinds","in":"query"},{"schema":{"type":"string","enum":["7d","30d","90d","180d"],"description":"Only events in the last 7, 30, 90 or 180 days."},"required":false,"description":"Only events in the last 7, 30, 90 or 180 days.","name":"dateRange","in":"query"},{"schema":{"type":"string","format":"date-time","description":"Only events on or after this time (ISO 8601). With `dateRange`, the later of the two applies."},"required":false,"description":"Only events on or after this time (ISO 8601). With `dateRange`, the later of the two applies.","name":"since","in":"query"},{"schema":{"type":"string","format":"date-time","description":"Only events on or before this time (ISO 8601). With `since`, a window between the two."},"required":false,"description":"Only events on or before this time (ISO 8601). With `since`, a window between the two.","name":"until","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"description":"Events to return, 1 to 100. Defaults to 25."},"required":false,"description":"Events to return, 1 to 100. Defaults to 25.","name":"limit","in":"query"}],"responses":{"200":{"description":"The events.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a 200 response."},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The event's id."},"eventType":{"type":"string","description":"What happened.","example":"flow.started"},"actorType":{"type":["string","null"],"description":"What kind of actor caused it, such as a user or the system."},"actorId":{"type":["string","null"],"description":"Who caused it: a user's `usr_` id, or another actor's id."},"flowId":{"type":["string","null"],"description":"The flow it happened on. `null` for an organization event, such as a sign-in or an invitation."},"stepExecutionId":{"type":["string","null"],"description":"The step run it happened on, if any."},"templateId":{"type":["string","null"],"description":"The template it concerns, if any."},"data":{"description":"What the event recorded. Its fields depend on `eventType`."},"occurredAt":{"type":["string","null"],"description":"When it happened (ISO 8601)."}},"required":["id","eventType","actorType","actorId","flowId","stepExecutionId","templateId","occurredAt"],"additionalProperties":false},"description":"The events, newest first."},"total":{"type":"integer","description":"How many matching events you can read."},"incomplete":{"type":"boolean","enum":[true],"description":"Present when the call stopped reading before it filled the page. An empty page with it is not \"nothing happened\": narrow the filters."}},"required":["success","data","total"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/sdk/auth/sessions":{"post":{"tags":["Web SDK","Headless SDK"],"summary":"Create an SDK session token","description":"Call this from your server only. Your backend exchanges its organization API key or personal access token for a 15-minute session token tied to your page's origin, so the browser never sees the long-lived token. The request must carry an `Origin` header that matches one of your organization's SDK `allowedOrigins` (**Settings → Web SDK**: admins only; it appears once the Web SDK is on for your organization). Server frameworks don't send one by default, so set it yourself. Name the person with `uniqueId`, or with exactly one of `email` and `userId`. With `uniqueId` you may also send the person's `email`: it is checked against them, never used to pick someone else. A session minted by `uniqueId` returns the person's stored email, or `null` for someone with a Unique ID only. A personal access token can only create sessions for its own person.\n\nA session works only in the embedded Moxo screens and the `/sdk` calls. It has the person's own permissions for running and building work, never an admin's, even when the person is an admin: Settings, the access model, credentials and the audit log stay in the app. Every other call, including `/v1` and the MCP server, refuses it with `403 SDK_SESSION_NOT_ALLOWED_HERE`; call those from your server with your API key. Each session is recorded in the audit log with this key as the actor.\n\n**When it is refused.**\n\n- The SDK is not set up: `403 SDK_NOT_ENABLED` (an admin turns it on in **Settings → Web SDK**), `403 SDK_NO_ALLOWED_ORIGINS` (an admin adds your page's origin there).\n- The origin: no `Origin` header is `400 ORIGIN_HEADER_REQUIRED`; one not in `allowedOrigins` is `403 ORIGIN_NOT_ALLOWED`.\n- The token: a signed-in browser session is `403 SDK_MINT_REQUIRES_API_KEY` (call from your server with a token); a personal access token naming someone else is `403 PAT_CANNOT_IMPERSONATE` (use an organization API key with `sdk:mint`).\n- The person: no `uniqueId`, `email` or `userId` is `400 IDENTITY_REQUIRED`; `userId` with `email` or with `uniqueId` is `400 IDENTITY_AMBIGUOUS`; no such user in your organization is `404 USER_NOT_FOUND`; with `uniqueId`, an `email` that belongs to someone else in your organization is `409 EMAIL_BELONGS_TO_ANOTHER_USER`; a `uniqueId` when your organization's plan does not include unique IDs is `403 FEATURE_DISABLED`.\n- The persona: both `personaId` and `personaName` is `400 PERSONA_AMBIGUOUS`, as is a `personaName` that matches more than one; a persona the person does not hold is `403 PERSONA_NOT_HELD`; a person with no persona is `422 NO_PERSONA`; a person with several and no default is `422 PERSONA_REQUIRED` (send `personaId`).\n- The portal: a persona with several portals and no default is `400 PORTAL_REQUIRED` (send `portalId`); a portal the persona does not give is `403 PORTAL_NOT_GRANTED_BY_PERSONA`; `portalId` with a persona that is not for a portal is `400 PORTAL_ID_IGNORED_FOR_NON_PORTAL_PERSONA`.\n- The plan: a plan with a daily session limit answers `429 MINT_QUOTA_EXCEEDED` once it is reached (it resets at midnight UTC), and `503 MINT_QUOTA_UNAVAILABLE` when the count can't be read (retry).\n- The audit record: if the record of the new session cannot be written, `503 SDK_SESSION_AUDIT_UNAVAILABLE` and nothing is created; retry after `Retry-After`.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `sdk:mint`","security":[{"bearerAuth":["sdk:mint"]}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SdkSessionMintRequest"}}}},"responses":{"200":{"description":"The new session. The response is not wrapped in `{ success, data }`, and its token fields are snake_case: read `session_token`, not `token` or `data.token`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SdkSessionMintResponse"}}}},"400":{"description":"Refused: `IDENTITY_AMBIGUOUS`, `IDENTITY_REQUIRED`, `ORIGIN_HEADER_REQUIRED`, `PERSONA_AMBIGUOUS`, `PORTAL_ID_IGNORED_FOR_NON_PORTAL_PERSONA`, `PORTAL_REQUIRED`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Refused: `EMAIL_BELONGS_TO_ANOTHER_USER`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Refused: `NO_PERSONA`, `PERSONA_REQUIRED`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Refused: `MINT_QUOTA_UNAVAILABLE`, `SDK_SESSION_AUDIT_UNAVAILABLE`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/sdk/auth/sessions/{jti}":{"delete":{"tags":["Web SDK","Headless SDK"],"summary":"Revoke an SDK session","description":"Ends a session early, by the `jti` from the response that created it. Later calls with that token are refused. The session itself, the key that created it, or an admin of its organization can revoke it; for anyone else the call does nothing. The `sdk:mint` scope is needed only to create a session. Use it when a person signs out.\n\n**Tokens:** personal access token, organization API key, SDK session token\n**Scope required:** none","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"jti","in":"path"}],"responses":{"204":{"description":"Revoked. No body. An expired or unknown `jti`, or a session this caller may not end, does nothing and gets the same answer."},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/data-tables":{"get":{"tags":["Data tables"],"summary":"List data tables","description":"Returns every active table in your organization, with its columns. Records are not included: read one table's records with `GET /v1/data-tables/{tableId}/records`.\n\nThese entries have no `recordCount`. To get it, read one table with `GET /v1/data-tables/{tableId}`.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `data_tables:read`","security":[{"bearerAuth":["data_tables:read"]}],"parameters":[{"schema":{"type":"string","description":"Finds a table by `id`, `slug` or `name`. `id` must match exactly; `slug` and `name` match any part of the value and ignore case.","example":"vendors"},"required":false,"description":"Finds a table by `id`, `slug` or `name`. `id` must match exactly; `slug` and `name` match any part of the value and ignore case.","name":"search","in":"query"}],"responses":{"200":{"description":"Tables in your organization.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"array","items":{"$ref":"#/components/schemas/DataTableSummary"}}},"required":["success","data"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"tags":["Data tables"],"summary":"Create a data table","description":"Creates the table and its columns in one call. The response carries each column's `key` and `id`; keep the `key` if you plan to write records or update the columns later.\n\nEach column needs a `name` and a `type`. Only four types take `config`: a dropdown needs its options, and `number`, `timestamp` and `file` have optional settings. The other six types take no `config`, so leave it out:\n\n```json\n{\n  \"name\": \"Vendors\",\n  \"columns\": [\n    { \"name\": \"Vendor Name\", \"type\": \"text\", \"required\": true },\n    { \"name\": \"Spend\", \"type\": \"number\", \"config\": { \"precision\": 2 } },\n    { \"name\": \"Status\", \"type\": \"single_select\",\n      \"config\": { \"options\": [\n        { \"id\": \"active\", \"label\": \"Active\" },\n        { \"id\": \"review\", \"label\": \"Under review\" }\n      ] } }\n  ]\n}\n```\n\nDon't send `id` or `key` on a column here: the table doesn't exist yet, and Moxo creates both.\n\nThe table's `slug` comes from its name and is made unique, so a second \"Vendors\" table gets `vendors_2`.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `data_tables:write`","security":[{"bearerAuth":["data_tables:write"]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":256,"pattern":"^[A-Za-z0-9_\\-:.]+$","description":"An optional key that makes this request safe to retry. Send a new UUID for each request. A key is up to 256 letters, digits, `-`, `_`, `:` or `.`; any other key is refused with `400 INVALID_IDEMPOTENCY_KEY` and nothing runs. A retry with the same key within 10 minutes returns the first response and changes nothing again. After 10 minutes, the same key runs the request again, so use a new key for a late retry. See Idempotency in the Introduction.","example":"6f2c4a5e-3b8d-4c7f-9a1e-2d6b8e0f4c5a"},"required":false,"description":"An optional key that makes this request safe to retry. Send a new UUID for each request. A key is up to 256 letters, digits, `-`, `_`, `:` or `.`; any other key is refused with `400 INVALID_IDEMPOTENCY_KEY` and nothing runs. A retry with the same key within 10 minutes returns the first response and changes nothing again. After 10 minutes, the same key runs the request again, so use a new key for a late retry. See Idempotency in the Introduction.","name":"Idempotency-Key","in":"header"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateDataTableRequest"}}}},"responses":{"201":{"description":"The new table.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/DataTable"}},"required":["success","data"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"410":{"description":"The first result for this `Idempotency-Key` can no longer be returned, because what it created was deleted. Use a new key for the next attempt.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"425":{"description":"A request with this `Idempotency-Key` is still running. Retry after `Retry-After` seconds. If the first request failed with a `5xx`, the key stays held for 10 minutes; to retry sooner, use a new key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"The first result for this `Idempotency-Key` couldn't be checked. Retry with the same key after a short wait. If it keeps happening, contact support with the `requestId`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/data-tables/{tableId}":{"get":{"tags":["Data tables"],"summary":"Get a data table","description":"Returns one table's columns and its record count, without the records themselves. Use it to look up the column keys you need before a write.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `data_tables:read`","security":[{"bearerAuth":["data_tables:read"]}],"parameters":[{"schema":{"type":"string","description":"The table's id."},"required":true,"description":"The table's id.","name":"tableId","in":"path"}],"responses":{"200":{"description":"The table","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/DataTable"}},"required":["success","data"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"put":{"tags":["Data tables"],"summary":"Update a data table","description":"Takes the same body as create. `columns` is the full list: the columns you send become the table's columns, in that order, and any active column the list doesn't name is archived.\n\n**Archiving can't be undone.** The column disappears from `columns[]` and from every record's `values`, and it can't be brought back through this API or in Moxo. For a `file` column, the stored files are deleted. Send the full list you want the table to have, and check it before you send it.\n\n**To rename a column, name it by `id` or `key`.** An entry with a new `name` and neither `id` nor `key` reads as \"archive that column and add a new one\", and that is what happens.\n\n**An archived column keeps its key.** A live column can't take the `key` of an archived one, so a record, a step or a report that named the old column never reads the new one by mistake. Give the new column a key of its own.\n\n**A column's `type` can't change.** Send the type it already has. A different type returns `400`, naming the column. To store a different type, leave the column out of the list, which archives it, and add a new one.\n\nLeave out `columns` to rename the table or change its description without changing its columns.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `data_tables:write`","security":[{"bearerAuth":["data_tables:write"]}],"parameters":[{"schema":{"type":"string","description":"The table's id."},"required":true,"description":"The table's id.","name":"tableId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReplaceDataTableRequest"}}}},"responses":{"200":{"description":"The updated table","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/DataTable"}},"required":["success","data"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"The table's columns changed while this request was being prepared. Re-read the table and apply the change again.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[false]}},"required":["success"]}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"tags":["Data tables"],"summary":"Delete a data table","description":"Deletes the table and its records. This is the same action as **Archive** in the Moxo app: the table and its records stop being readable everywhere (this API, the app, flow Look-up steps, pickers, reports), and the table is gone from `GET /v1/data-tables`.\n\nFiles in `file` columns are deleted and can't be recovered. The table's `slug` stays taken, so a new table with the same name gets a new slug (`vendors_2`).\n\nSteps in already-published templates that point at this table will fail when they next run. Check what references a table before deleting it.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `data_tables:write`","security":[{"bearerAuth":["data_tables:write"]}],"parameters":[{"schema":{"type":"string","description":"The table's id."},"required":true,"description":"The table's id.","name":"tableId","in":"path"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]}},"required":["success"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/data-tables/{tableId}/fields/{fieldId}":{"delete":{"tags":["Data tables"],"summary":"Delete an archived column","description":"Deletes one archived column for good. A column that is still on the table is refused. The column's key stays taken, so a new column with the same name gets a suffixed key (`billing_contact_2`).\n\nValues in that column are cleared. Files were already removed when the column was archived. A template that still points at the column shows the column as removed and cannot be published until the reference is fixed.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `data_tables:write`","security":[{"bearerAuth":["data_tables:write"]}],"parameters":[{"schema":{"type":"string","description":"The table's id."},"required":true,"description":"The table's id.","name":"tableId","in":"path"},{"schema":{"type":"string","format":"uuid","description":"The archived column's id."},"required":true,"description":"The archived column's id.","name":"fieldId","in":"path"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Whether the archived column was deleted."}},"required":["success"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/data-tables/{tableId}/records":{"get":{"tags":["Data tables"],"summary":"List records in a data table","description":"Returns a page of the table's records. The response also includes the table, so you have the column list without a second call.\n\nEach record's `values` is keyed by column `key`, so a row reads on its own: `{\"vendor_name\": \"Acme\", \"spend\": 1200}`. Keys never change, including when someone renames the column in Moxo.\n\n**Order:** by the table's primary text column, A to Z, then by record id. This is the order the Moxo app shows, not the order records were added. A text column sorts as text, so `\"200\"` comes before `\"50\"`; for numeric order, use a `number` column.\n\nRecords are paginated: read `pagination.hasMore` and advance `offset` until it is false. Because the order is by column value, adding or editing a record can move an existing one to a different page. If you are reading the whole table and cannot tolerate that, read it in one pass rather than spreading the pages over a long window.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `data_tables:read`","security":[{"bearerAuth":["data_tables:read"]}],"parameters":[{"schema":{"type":"string","description":"The table's id."},"required":true,"description":"The table's id.","name":"tableId","in":"path"},{"schema":{"type":"integer","minimum":1,"maximum":200,"description":"Records per page, 1 to 200. Defaults to 50."},"required":false,"description":"Records per page, 1 to 200. Defaults to 50.","name":"limit","in":"query"},{"schema":{"type":["integer","null"],"minimum":0,"description":"How many records to skip. Defaults to 0."},"required":false,"description":"How many records to skip. Defaults to 0.","name":"offset","in":"query"},{"schema":{"type":"string","description":"Matches any part of the value, ignoring case, in every text, email, phone, URL, number, and dropdown column. A dropdown matches by its option label. Date, date and time, checkbox, and file columns are not searched. To narrow on one of those, or on one column only, read the page and filter `values` yourself."},"required":false,"description":"Matches any part of the value, ignoring case, in every text, email, phone, URL, number, and dropdown column. A dropdown matches by its option label. Date, date and time, checkbox, and file columns are not searched. To narrow on one of those, or on one column only, read the page and filter `values` yourself.","name":"search","in":"query"}],"responses":{"200":{"description":"A page of records, with the table.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"table":{"$ref":"#/components/schemas/DataTable"},"data":{"type":"array","items":{"$ref":"#/components/schemas/DataTableRecord"}},"pagination":{"type":"object","properties":{"total":{"type":"integer"},"limit":{"type":"integer"},"offset":{"type":"integer"},"hasMore":{"type":"boolean"}},"required":["total","limit","offset","hasMore"]}},"required":["success","table","data","pagination"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"tags":["Data tables"],"summary":"Add records to a data table","description":"Adds records in bulk, up to 1000 per request.\n\nEach record succeeds or fails on its own: a record that fails validation, including one that names a column the table doesn't have, is rolled back and reported in `errors` with its index, and every other record in the request is still added. Check `failed` before treating the call as complete.\n\nEach entry's `values` can name its columns by id, key or name. This endpoint only adds records; to change one, use `PATCH .../records/{recordId}`.\n\n**Send an `Idempotency-Key`.** Within 10 minutes, a retry with the same key never adds the batch twice. If the first call finished, you get its original response back, byte for byte. If it is still running, you get `425 Too Early`: wait a moment and send it again. If the first response can no longer be returned, you get `410`: retry with a new key. After 10 minutes the key is free again and a retry does add the batch, so read `GET /v1/data-tables/{tableId}` and compare `recordCount` first.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `data_tables:write`","security":[{"bearerAuth":["data_tables:write"]}],"parameters":[{"schema":{"type":"string","description":"The table's id."},"required":true,"description":"The table's id.","name":"tableId","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":256,"pattern":"^[A-Za-z0-9_\\-:.]+$","description":"An optional key that makes this request safe to retry. Send a new UUID for each request. A key is up to 256 letters, digits, `-`, `_`, `:` or `.`; any other key is refused with `400 INVALID_IDEMPOTENCY_KEY` and nothing runs. A retry with the same key within 10 minutes returns the first response and changes nothing again. After 10 minutes, the same key runs the request again, so use a new key for a late retry. See Idempotency in the Introduction.","example":"6f2c4a5e-3b8d-4c7f-9a1e-2d6b8e0f4c5a"},"required":false,"description":"An optional key that makes this request safe to retry. Send a new UUID for each request. A key is up to 256 letters, digits, `-`, `_`, `:` or `.`; any other key is refused with `400 INVALID_IDEMPOTENCY_KEY` and nothing runs. A retry with the same key within 10 minutes returns the first response and changes nothing again. After 10 minutes, the same key runs the request again, so use a new key for a late retry. See Idempotency in the Introduction.","name":"Idempotency-Key","in":"header"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateDataTableRecordsRequest"}}}},"responses":{"200":{"description":"The result for each record.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/DataTableWriteResult"}},"required":["success","data"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"410":{"description":"The first result for this `Idempotency-Key` can no longer be returned, because what it created was deleted. Use a new key for the next attempt.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"425":{"description":"A request with this `Idempotency-Key` is still running. Retry after `Retry-After` seconds. If the first request failed with a `5xx`, the key stays held for 10 minutes; to retry sooner, use a new key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"The first result for this `Idempotency-Key` couldn't be checked. Retry with the same key after a short wait. If it keeps happening, contact support with the `requestId`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/data-tables/{tableId}/records/{recordId}":{"patch":{"tags":["Data tables"],"summary":"Update a record","description":"Updates one record. Only the columns you name in `values` change: every other column keeps its value, so you can update one column without reading the record first, and two systems writing different columns never overwrite each other.\n\nTo clear a column, send it as `null`.\n\n`version` is optional and most integrations should leave it out. Send it when your new value was worked out from the old one, such as adding to a running total, and the update is refused with 409 if someone changed the record after you read it.\n\nSending only values the record already has changes nothing: the answer says `changed: false`, and `recordVersion` stays as it was.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `data_tables:write`","security":[{"bearerAuth":["data_tables:write"]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"tableId","in":"path"},{"schema":{"type":"string"},"required":true,"name":"recordId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateDataTableRecordRequest"}}}},"responses":{"200":{"description":"The record, as it is now","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."},"data":{"$ref":"#/components/schemas/DataTableRecord"},"changed":{"type":"boolean","description":"`true` when this call changed what you asked it to. `false` when that was already so, and the call changed nothing of it."},"message":{"type":"string","description":"Only with `changed: false`: what was already so.","example":"Nothing changed: this person already holds this role."}},"required":["success","data","changed"],"additionalProperties":false}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"The record changed since the `version` you sent. Re-read it and retry.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[false]}},"required":["success"]}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"tags":["Data tables"],"summary":"Delete a record","description":"Deletes one record. It stops being readable everywhere (this API, the app, flow Look-up steps and pickers) and stops counting toward `recordCount`.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `data_tables:write`","security":[{"bearerAuth":["data_tables:write"]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"tableId","in":"path"},{"schema":{"type":"string"},"required":true,"name":"recordId","in":"path"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]}},"required":["success"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/data-tables/{tableId}/records/import":{"post":{"tags":["Data tables"],"summary":"Import records from a CSV","description":"**Adds** the file's rows to an existing table, up to 500 per request. Send it as `multipart/form-data` with the file in a `file` part, or as JSON with the text in `csv`.\n\nThis endpoint only adds records, which is what CSV import does in the Moxo app. It never edits or removes a record that is already there. Nothing in a CSV identifies an existing row, so there is no way to tell which record a line was meant to update; to change specific records, read them and use `PATCH .../records/{recordId}`.\n\nA row that fails validation is reported in `errors` with its line number, and the rest of the file still imports, so check `failed` before treating the call as done.\n\n**The first row is a header** naming the table's columns: each column's name or `key`, in any order, ignoring case. A header that matches no column is reported as a warning on row 1, and its data is skipped; the rest of the file still imports. The **Download a template** button on the table in Moxo gives a file with exactly the right header.\n\n`file` columns can't be set from a CSV and are skipped.\n\nA file over the size limit for one import returns `413 FILE_TOO_LARGE`, naming the limit: split it into smaller files.\n\nThe import finishes before the response comes back, so there is no job to poll. It can take a while on a full file, and each imported row can start a flow if the table has triggers on it, so prefer several smaller files over one large one.\n\n**Send an `Idempotency-Key`.** Within 10 minutes, a retry with the same key never imports the file twice. If the first import finished, you get its original response back, byte for byte. If it is still running, you get `425 Too Early`: wait a moment and send it again. If the first response can no longer be returned, you get `410`: retry with a new key. After 10 minutes the key is free again and a retry does import the file, starting any triggers on the table again for the duplicate rows, so read `GET /v1/data-tables/{tableId}` and compare `recordCount` first.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `data_tables:write`","security":[{"bearerAuth":["data_tables:write"]}],"parameters":[{"schema":{"type":"string","description":"The table's id."},"required":true,"description":"The table's id.","name":"tableId","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":256,"pattern":"^[A-Za-z0-9_\\-:.]+$","description":"An optional key that makes this request safe to retry. Send a new UUID for each request. A key is up to 256 letters, digits, `-`, `_`, `:` or `.`; any other key is refused with `400 INVALID_IDEMPOTENCY_KEY` and nothing runs. A retry with the same key within 10 minutes returns the first response and changes nothing again. After 10 minutes, the same key runs the request again, so use a new key for a late retry. See Idempotency in the Introduction.","example":"6f2c4a5e-3b8d-4c7f-9a1e-2d6b8e0f4c5a"},"required":false,"description":"An optional key that makes this request safe to retry. Send a new UUID for each request. A key is up to 256 letters, digits, `-`, `_`, `:` or `.`; any other key is refused with `400 INVALID_IDEMPOTENCY_KEY` and nothing runs. A retry with the same key within 10 minutes returns the first response and changes nothing again. After 10 minutes, the same key runs the request again, so use a new key for a late retry. See Idempotency in the Introduction.","name":"Idempotency-Key","in":"header"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportDataTableCsvRequest"}},"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","format":"binary","description":"The CSV file."}},"required":["file"],"additionalProperties":false}}}},"responses":{"200":{"description":"The result of the import.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/DataTableImportResult"}},"required":["success","data"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"410":{"description":"The first result for this `Idempotency-Key` can no longer be returned, because what it created was deleted. Use a new key for the next attempt.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"413":{"description":"Refused: `FILE_TOO_LARGE`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"425":{"description":"A request with this `Idempotency-Key` is still running. Retry after `Retry-After` seconds. If the first request failed with a `5xx`, the key stays held for 10 minutes; to retry sooner, use a new key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"The first result for this `Idempotency-Key` couldn't be checked. Retry with the same key after a short wait. If it keeps happening, contact support with the `requestId`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/relationships":{"get":{"tags":["Relationships"],"summary":"List relationships","description":"Returns the organization's relationships, one page at a time. Narrow by who is on them: `partyUserIds` for the people a relationship is for, `teamUserIds` for the people at your organization who look after it, `accountIds` for the accounts they are built on. `party` keeps only relationships built on people, or only those built on an account. The filters combine, so `partyUserIds` and `teamUserIds` together answer \"what do we hold for this client that this banker looks after\". A personal access token needs permission to see every relationship.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `relationships:read`","security":[{"bearerAuth":["relationships:read"]}],"parameters":[{"schema":{"type":"string","enum":["people","account"],"description":"Keep only relationships built on `people`, or only those built on an `account`."},"required":false,"description":"Keep only relationships built on `people`, or only those built on an `account`.","name":"party","in":"query"},{"schema":{"type":"string","description":"Only relationships any of these people are the party of — the client side — as a comma-separated list of people, each a user id, an email or a unique ID (up to 200). An id that is nobody here matches nothing; it never widens the answer.","example":"usr_4Q7x3gsbCHaNuCyM5IQGIF,usr_3hJnW9hMwGAUxXTE2tK4Gq"},"required":false,"description":"Only relationships any of these people are the party of — the client side — as a comma-separated list of people, each a user id, an email or a unique ID (up to 200). An id that is nobody here matches nothing; it never widens the answer.","name":"partyUserIds","in":"query"},{"schema":{"type":"string","description":"Only relationships any of these people hold a seat on — your organization's side, lead or not — as a comma-separated list of people, each a user id, an email or a unique ID (up to 200).","example":"usr_4Q7x3gsbCHaNuCyM5IQGIF"},"required":false,"description":"Only relationships any of these people hold a seat on — your organization's side, lead or not — as a comma-separated list of people, each a user id, an email or a unique ID (up to 200).","name":"teamUserIds","in":"query"},{"schema":{"type":"string","description":"Only relationships built on any of these accounts, as a comma-separated list of account ids (up to 200), the same ids `GET /v1/accounts` returns.","example":"acc_hartwell"},"required":false,"description":"Only relationships built on any of these accounts, as a comma-separated list of account ids (up to 200), the same ids `GET /v1/accounts` returns.","name":"accountIds","in":"query"},{"schema":{"type":"string","description":"The previous page's `nextCursor`."},"required":false,"description":"The previous page's `nextCursor`.","name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"description":"How many to return, 1 to 100. Defaults to 50."},"required":false,"description":"How many to return, 1 to 100. Defaults to 50.","name":"limit","in":"query"}],"responses":{"200":{"description":"A page of relationships.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."},"data":{"allOf":[{"$ref":"#/components/schemas/RelationshipList"},{"description":"A page of relationships."}]}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"tags":["Relationships"],"summary":"Create a relationship","description":"Creates a relationship. `party` says who it is for; without it the call answers 400 `RELATIONSHIP_INCOMPLETE`. A reference already in use answers 409 `ALREADY_EXISTS` — send `PATCH` to change the one that is there. A person named in `party` who is on your own team answers 400 `PERSON_NOT_EXTERNAL`, and an id or email that is nobody here answers 400 `UNKNOWN_PERSON`. `externalRef` is optional: leave it out and Moxo mints one, so every relationship is addressable here however it was made. `name` is optional too — left out or blank, it is worked out from the party (the account’s name, or the people’s names). An email that is not yet a person here becomes an external user, and no invitation is sent. Send `Idempotency-Key` to make a retry return the first answer.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `relationships:write`","security":[{"bearerAuth":["relationships:write"]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":256,"pattern":"^[A-Za-z0-9_\\-:.]+$","description":"An optional key that makes this request safe to retry. Send a new UUID for each request. A key is up to 256 letters, digits, `-`, `_`, `:` or `.`; any other key is refused with `400 INVALID_IDEMPOTENCY_KEY` and nothing runs. A retry with the same key within 10 minutes returns the first response and changes nothing again. After 10 minutes, the same key runs the request again, so use a new key for a late retry. See Idempotency in the Introduction.","example":"6f2c4a5e-3b8d-4c7f-9a1e-2d6b8e0f4c5a"},"required":false,"description":"An optional key that makes this request safe to retry. Send a new UUID for each request. A key is up to 256 letters, digits, `-`, `_`, `:` or `.`; any other key is refused with `400 INVALID_IDEMPOTENCY_KEY` and nothing runs. A retry with the same key within 10 minutes returns the first response and changes nothing again. After 10 minutes, the same key runs the request again, so use a new key for a late retry. See Idempotency in the Introduction.","name":"Idempotency-Key","in":"header"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateRelationshipRequest"}}}},"responses":{"201":{"description":"The relationship that was created.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."},"data":{"allOf":[{"$ref":"#/components/schemas/PublicRelationship"},{"description":"The relationship that was created."}]}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Refused: `PERSON_NOT_EXTERNAL`, `RELATIONSHIP_INCOMPLETE`, `UNKNOWN_PERSON`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Refused: `ALREADY_EXISTS`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"410":{"description":"The first result for this `Idempotency-Key` can no longer be returned, because what it created was deleted. Use a new key for the next attempt.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"425":{"description":"A request with this `Idempotency-Key` is still running. Retry after `Retry-After` seconds. If the first request failed with a `5xx`, the key stays held for 10 minutes; to retry sooner, use a new key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"The first result for this `Idempotency-Key` couldn't be checked. Retry with the same key after a short wait. If it keeps happening, contact support with the `requestId`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/relationships/{id}":{"get":{"tags":["Relationships"],"summary":"Get a relationship","description":"Returns the relationship this path names, by its `id` or by your own `externalRef`. One in another organization is not found.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `relationships:read`","security":[{"bearerAuth":["relationships:read"]}],"parameters":[{"schema":{"type":"string","description":"The relationship’s `id`, as every answer carries it. Your own `externalRef` works here too, so a system that keys this relationship on its own reference can use that instead."},"required":true,"description":"The relationship’s `id`, as every answer carries it. Your own `externalRef` works here too, so a system that keys this relationship on its own reference can use that instead.","name":"id","in":"path"}],"responses":{"200":{"description":"The relationship.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."},"data":{"allOf":[{"$ref":"#/components/schemas/PublicRelationship"},{"description":"The relationship."}]}},"required":["success","data"],"additionalProperties":false}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"tags":["Relationships"],"summary":"Update a relationship","description":"Changes the relationship this path names, by its `id` or by your own `externalRef`. An omitted field keeps its current value, and a blank `name` counts as omitted; `team` and `party` replace what is there rather than adding to it. Unlike the upsert, this names one relationship you chose, so it changes one made in Moxo as readily as one made here. A key that is not here answers 404.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `relationships:write`","security":[{"bearerAuth":["relationships:write"]}],"parameters":[{"schema":{"type":"string","description":"The relationship’s `id`, as every answer carries it. Your own `externalRef` works here too, so a system that keys this relationship on its own reference can use that instead."},"required":true,"description":"The relationship’s `id`, as every answer carries it. Your own `externalRef` works here too, so a system that keys this relationship on its own reference can use that instead.","name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":256,"pattern":"^[A-Za-z0-9_\\-:.]+$","description":"An optional key that makes this request safe to retry. Send a new UUID for each request. A key is up to 256 letters, digits, `-`, `_`, `:` or `.`; any other key is refused with `400 INVALID_IDEMPOTENCY_KEY` and nothing runs. A retry with the same key within 10 minutes returns the first response and changes nothing again. After 10 minutes, the same key runs the request again, so use a new key for a late retry. See Idempotency in the Introduction.","example":"6f2c4a5e-3b8d-4c7f-9a1e-2d6b8e0f4c5a"},"required":false,"description":"An optional key that makes this request safe to retry. Send a new UUID for each request. A key is up to 256 letters, digits, `-`, `_`, `:` or `.`; any other key is refused with `400 INVALID_IDEMPOTENCY_KEY` and nothing runs. A retry with the same key within 10 minutes returns the first response and changes nothing again. After 10 minutes, the same key runs the request again, so use a new key for a late retry. See Idempotency in the Introduction.","name":"Idempotency-Key","in":"header"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateRelationshipRequest"}}}},"responses":{"200":{"description":"The relationship as it now stands.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."},"data":{"allOf":[{"$ref":"#/components/schemas/PublicRelationship"},{"description":"The relationship as it now stands."}]}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"410":{"description":"The first result for this `Idempotency-Key` can no longer be returned, because what it created was deleted. Use a new key for the next attempt.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"425":{"description":"A request with this `Idempotency-Key` is still running. Retry after `Retry-After` seconds. If the first request failed with a `5xx`, the key stays held for 10 minutes; to retry sooner, use a new key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"The first result for this `Idempotency-Key` couldn't be checked. Retry with the same key after a short wait. If it keeps happening, contact support with the `requestId`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"tags":["Relationships"],"summary":"Delete a relationship","description":"Removes the relationship this path names, by its `id` or by your own `externalRef`. Like the update, it removes one made in Moxo as readily as one made here. Nothing inside it is touched: every flow keeps running, every project stays open, and the conversation stays as an ordinary conversation under the name the people in it already saw.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `relationships:write`","security":[{"bearerAuth":["relationships:write"]}],"parameters":[{"schema":{"type":"string","description":"The relationship’s `id`, as every answer carries it. Your own `externalRef` works here too, so a system that keys this relationship on its own reference can use that instead."},"required":true,"description":"The relationship’s `id`, as every answer carries it. Your own `externalRef` works here too, so a system that keys this relationship on its own reference can use that instead.","name":"id","in":"path"}],"responses":{"200":{"description":"The relationship is gone.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."},"data":{"allOf":[{"$ref":"#/components/schemas/RelationshipDeleted"},{"description":"The relationship is gone."}]}},"required":["success","data"],"additionalProperties":false}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/relationships/bulk":{"post":{"tags":["Relationships"],"summary":"Create relationships in bulk","description":"Creates up to 100 relationships in one call, each keyed by your own `externalRef`. A row whose reference is already here updates that relationship instead, so a core system can send the rows it holds and let Moxo work out which are new. One refused row does not stop the others, and each refusal is in `errors` with its code. `dry_run=true` counts what would happen and writes nothing. A relationship made in Moxo is counted in `failed` with 409 `NOT_FEED_OWNED` and left as it is — a bulk sync must not overwrite hand-built work on a collision, while `PATCH` and `DELETE` name one relationship you chose and act on any of them. An unknown email on a row that is written becomes an external user, and no invitation is sent.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `relationships:write`","security":[{"bearerAuth":["relationships:write"]}],"parameters":[{"schema":{"type":"string","enum":["true","false"],"description":"When `true`, nothing is written."},"required":false,"description":"When `true`, nothing is written.","name":"dry_run","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":256,"pattern":"^[A-Za-z0-9_\\-:.]+$","description":"An optional key that makes this request safe to retry. Send a new UUID for each request. A key is up to 256 letters, digits, `-`, `_`, `:` or `.`; any other key is refused with `400 INVALID_IDEMPOTENCY_KEY` and nothing runs. A retry with the same key within 10 minutes returns the first response and changes nothing again. After 10 minutes, the same key runs the request again, so use a new key for a late retry. See Idempotency in the Introduction.","example":"6f2c4a5e-3b8d-4c7f-9a1e-2d6b8e0f4c5a"},"required":false,"description":"An optional key that makes this request safe to retry. Send a new UUID for each request. A key is up to 256 letters, digits, `-`, `_`, `:` or `.`; any other key is refused with `400 INVALID_IDEMPOTENCY_KEY` and nothing runs. A retry with the same key within 10 minutes returns the first response and changes nothing again. After 10 minutes, the same key runs the request again, so use a new key for a late retry. See Idempotency in the Introduction.","name":"Idempotency-Key","in":"header"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkRelationshipsRequest"}}}},"responses":{"200":{"description":"How many rows were created, updated, unchanged or refused.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."},"data":{"allOf":[{"$ref":"#/components/schemas/BulkRelationshipsResult"},{"description":"How many rows were created, updated, unchanged or refused."}]}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Refused: `NOT_FEED_OWNED`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"410":{"description":"The first result for this `Idempotency-Key` can no longer be returned, because what it created was deleted. Use a new key for the next attempt.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"425":{"description":"A request with this `Idempotency-Key` is still running. Retry after `Retry-After` seconds. If the first request failed with a `5xx`, the key stays held for 10 minutes; to retry sooner, use a new key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"The first result for this `Idempotency-Key` couldn't be checked. Retry with the same key after a short wait. If it keeps happening, contact support with the `requestId`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/relationships/{id}/conversation":{"post":{"tags":["Relationships"],"summary":"Open the relationship’s conversation","x-moxo-person-only":"ORG_KEY_NOT_SUPPORTED","description":"Opens the one conversation a relationship has — the team on your side with the people it is for — and returns its `conversationId`. **This is the only conversation call that lives under a relationship.** It exists because until someone writes there is no room and so no id to address; from the id onwards the room is an ordinary conversation, so sending more messages, uploading files, adding actions, reading participants and everything else is `/v1/conversations/{conversationId}/…`. `GET /v1/relationships/{id}` carries the same `conversationId` once the room is open, so a caller that already has it never needs this call.\n\nThe room is made by its first message, as it is in the app, so `body` is what opens it. Calling this again once the room is open posts that message and answers the same `conversationId` with `created: false`.\n\nA personal access token only: a message has an author, and an organization key has no person behind it. The token’s owner must be on the relationship’s team — this conversation is theirs with the people it is for, and nobody else writes in it. When the organization has turned off the firm writing first, a room that does not exist yet answers 403 `AWAIT_FIRST_WORD`: wait for them to write.\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"The relationship’s `id`, as every answer carries it. Your own `externalRef` works here too, so a system that keys this relationship on its own reference can use that instead."},"required":true,"description":"The relationship’s `id`, as every answer carries it. Your own `externalRef` works here too, so a system that keys this relationship on its own reference can use that instead.","name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":256,"pattern":"^[A-Za-z0-9_\\-:.]+$","description":"An optional key that makes this request safe to retry. Send a new UUID for each request. A key is up to 256 letters, digits, `-`, `_`, `:` or `.`; any other key is refused with `400 INVALID_IDEMPOTENCY_KEY` and nothing runs. A retry with the same key within 10 minutes returns the first response and changes nothing again. After 10 minutes, the same key runs the request again, so use a new key for a late retry. See Idempotency in the Introduction.","example":"6f2c4a5e-3b8d-4c7f-9a1e-2d6b8e0f4c5a"},"required":false,"description":"An optional key that makes this request safe to retry. Send a new UUID for each request. A key is up to 256 letters, digits, `-`, `_`, `:` or `.`; any other key is refused with `400 INVALID_IDEMPOTENCY_KEY` and nothing runs. A retry with the same key within 10 minutes returns the first response and changes nothing again. After 10 minutes, the same key runs the request again, so use a new key for a late retry. See Idempotency in the Introduction.","name":"Idempotency-Key","in":"header"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RelationshipMessageRequest"}}}},"responses":{"200":{"description":"The conversation, and the message in it.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."},"data":{"allOf":[{"$ref":"#/components/schemas/RelationshipMessage"},{"description":"The conversation, and the message in it."}]}},"required":["success","data"],"additionalProperties":false}}}},"201":{"description":"The conversation was opened.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."},"data":{"allOf":[{"$ref":"#/components/schemas/RelationshipMessage"},{"description":"The conversation this call opened, and the first message in it."}]}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"410":{"description":"The first result for this `Idempotency-Key` can no longer be returned, because what it created was deleted. Use a new key for the next attempt.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"425":{"description":"A request with this `Idempotency-Key` is still running. Retry after `Retry-After` seconds. If the first request failed with a `5xx`, the key stays held for 10 minutes; to retry sooner, use a new key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"The first result for this `Idempotency-Key` couldn't be checked. Retry with the same key after a short wait. If it keeps happening, contact support with the `requestId`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/external-tasks/claim":{"post":{"tags":["External tasks"],"summary":"Claim tasks","description":"Claims open tasks in one call: up to `max` tasks with this `taskName` (default 10, at most 50), each held for you for `lockMinutes` (1 to 60; defaults to the Wait’s own setting, 15). Send an optional `workerName` to say which of your workers holds them; the flow shows it, or the API key’s name if you send none. Returns each task’s `id`, its flow, its `values`, `attempt`, `lockedUntil` and its `lockToken`: keep the token and send it with extend, complete and fail. Two workers claiming at once never get the same task. An empty list means nothing is waiting.\n\nA claim isn’t replayed for an `Idempotency-Key`, because its response carries lock tokens, which Moxo keeps only as hashes. If you lose a response, the tasks go back to the queue when their hold runs out.\n\nNeeds an organization API key. A personal access token gets `403 ORG_KEY_REQUIRED`.\n\n**Tokens:** organization API key\n**Scope required:** `flows:write`","security":[{"bearerAuth":["flows:write"]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"taskName":{"type":"string","maxLength":64,"pattern":"^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$"},"max":{"type":"integer","minimum":1,"maximum":50},"lockMinutes":{"type":"integer","minimum":1,"maximum":60},"workerName":{"type":"string","minLength":1,"maxLength":100}},"required":["taskName"],"additionalProperties":false}}}},"responses":{"200":{"description":"The tasks claimed for you. The list can be empty.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"array","items":{"$ref":"#/components/schemas/ClaimedExternalTask"}}},"required":["success","data"]}}}},"400":{"description":"The body is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/external-tasks/{id}/extend":{"post":{"tags":["External tasks"],"summary":"Extend a claim","description":"Holds a claimed task for another `lockMinutes`. Send the `lockToken` from your claim. After the hold has run out, or once the task was claimed again, this returns `409 LOCK_EXPIRED`; claim again.\n\nNeeds an organization API key. A personal access token gets `403 ORG_KEY_REQUIRED`.\n\n**Tokens:** organization API key\n**Scope required:** `flows:write`","security":[{"bearerAuth":["flows:write"]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":256,"pattern":"^[A-Za-z0-9_\\-:.]+$","description":"An optional key that makes this request safe to retry. Send a new UUID for each request. A key is up to 256 letters, digits, `-`, `_`, `:` or `.`; any other key is refused with `400 INVALID_IDEMPOTENCY_KEY` and nothing runs. A retry with the same key within 10 minutes returns the first response and changes nothing again. After 10 minutes, the same key runs the request again, so use a new key for a late retry. See Idempotency in the Introduction.","example":"6f2c4a5e-3b8d-4c7f-9a1e-2d6b8e0f4c5a"},"required":false,"description":"An optional key that makes this request safe to retry. Send a new UUID for each request. A key is up to 256 letters, digits, `-`, `_`, `:` or `.`; any other key is refused with `400 INVALID_IDEMPOTENCY_KEY` and nothing runs. A retry with the same key within 10 minutes returns the first response and changes nothing again. After 10 minutes, the same key runs the request again, so use a new key for a late retry. See Idempotency in the Introduction.","name":"Idempotency-Key","in":"header"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"lockToken":{"type":"string","minLength":1,"maxLength":200},"lockMinutes":{"type":"integer","minimum":1,"maximum":60}},"required":["lockToken"],"additionalProperties":false}}}},"responses":{"200":{"description":"The new end of the hold","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"lockedUntil":{"type":"string"}},"required":["lockedUntil"]}},"required":["success","data"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"`LOCK_EXPIRED` (your hold ran out; claim again), `TASK_NOT_CLAIMED`, `STEP_NOT_ACTIVE` (the task is done, or the flow moved on, was reopened or was canceled) or `FLOW_PAUSED`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/external-tasks/{id}/complete":{"post":{"tags":["External tasks"],"summary":"Complete a task","description":"Completes the task with `values`, the ones the Wait’s output mappings expect; later steps read them. Send your answer as values, for example `verified: false`, and branch on it with a Decision. Send the `lockToken` from your claim, and an `Idempotency-Key` so a retry completes the task once (a key belongs to one task). Returns `409 LOCK_EXPIRED` when your hold has run out or the task was claimed again, and `409 STEP_NOT_ACTIVE` when the task is done, or the flow moved on, was reopened or was canceled.\n\nNeeds an organization API key. A personal access token gets `403 ORG_KEY_REQUIRED`.\n\n**Tokens:** organization API key\n**Scope required:** `flows:write`","security":[{"bearerAuth":["flows:write"]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":256,"pattern":"^[A-Za-z0-9_\\-:.]+$","description":"An optional key that makes this request safe to retry. Send a new UUID for each request. A key is up to 256 letters, digits, `-`, `_`, `:` or `.`; any other key is refused with `400 INVALID_IDEMPOTENCY_KEY` and nothing runs. A retry with the same key within 10 minutes returns the first response and changes nothing again. After 10 minutes, the same key runs the request again, so use a new key for a late retry. See Idempotency in the Introduction.","example":"6f2c4a5e-3b8d-4c7f-9a1e-2d6b8e0f4c5a"},"required":false,"description":"An optional key that makes this request safe to retry. Send a new UUID for each request. A key is up to 256 letters, digits, `-`, `_`, `:` or `.`; any other key is refused with `400 INVALID_IDEMPOTENCY_KEY` and nothing runs. A retry with the same key within 10 minutes returns the first response and changes nothing again. After 10 minutes, the same key runs the request again, so use a new key for a late retry. See Idempotency in the Introduction.","name":"Idempotency-Key","in":"header"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"lockToken":{"type":"string","minLength":1,"maxLength":200},"values":{"type":"object","additionalProperties":{}}},"required":["lockToken"],"additionalProperties":false}}}},"responses":{"200":{"description":"The task is complete.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]}},"required":["success"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"`LOCK_EXPIRED` (your hold ran out; claim again), `TASK_NOT_CLAIMED`, `STEP_NOT_ACTIVE` (the task is done, or the flow moved on, was reopened or was canceled) or `FLOW_PAUSED`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/external-tasks/{id}/fail":{"post":{"tags":["External tasks"],"summary":"Fail a task","description":"Fails the task. Use it only when your system couldn’t do the work, with a `reason` people can read and the `lockToken` from your claim; a negative answer is values, not a failure. While tries are left, the task can be claimed again after `retryInMinutes` (default 1). After the last try, the step fails with your reason and the flow waits at it: the flow stays open, but the steps after it don’t start until a flow manager chooses Retry, which opens a new task.\n\nNeeds an organization API key. A personal access token gets `403 ORG_KEY_REQUIRED`.\n\n**Tokens:** organization API key\n**Scope required:** `flows:write`","security":[{"bearerAuth":["flows:write"]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":256,"pattern":"^[A-Za-z0-9_\\-:.]+$","description":"An optional key that makes this request safe to retry. Send a new UUID for each request. A key is up to 256 letters, digits, `-`, `_`, `:` or `.`; any other key is refused with `400 INVALID_IDEMPOTENCY_KEY` and nothing runs. A retry with the same key within 10 minutes returns the first response and changes nothing again. After 10 minutes, the same key runs the request again, so use a new key for a late retry. See Idempotency in the Introduction.","example":"6f2c4a5e-3b8d-4c7f-9a1e-2d6b8e0f4c5a"},"required":false,"description":"An optional key that makes this request safe to retry. Send a new UUID for each request. A key is up to 256 letters, digits, `-`, `_`, `:` or `.`; any other key is refused with `400 INVALID_IDEMPOTENCY_KEY` and nothing runs. A retry with the same key within 10 minutes returns the first response and changes nothing again. After 10 minutes, the same key runs the request again, so use a new key for a late retry. See Idempotency in the Introduction.","name":"Idempotency-Key","in":"header"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"lockToken":{"type":"string","minLength":1,"maxLength":200},"reason":{"type":"string","minLength":1,"maxLength":1000},"retryInMinutes":{"type":"integer","minimum":0,"maximum":1440}},"required":["lockToken","reason"],"additionalProperties":false}}}},"responses":{"200":{"description":"The try is recorded","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"status":{"type":"string","enum":["open","FAILED"],"description":"`open`: back in the queue from `availableAt`. `FAILED`: that was the last try, and the step failed."},"triesLeft":{"type":"integer"},"availableAt":{"type":"string"}},"required":["status","triesLeft"]}},"required":["success","data"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"`LOCK_EXPIRED` (your hold ran out; claim again), `TASK_NOT_CLAIMED`, `STEP_NOT_ACTIVE` (the task is done, or the flow moved on, was reopened or was canceled) or `FLOW_PAUSED`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/external-tasks":{"get":{"tags":["External tasks"],"summary":"List tasks","description":"Lists open, claimed and failed external tasks, filtered by `taskName`, `status` or `flowId`, with each task’s `values`. Read-only.\n\nNeeds an organization API key. A personal access token gets `403 ORG_KEY_REQUIRED`.\n\n**Tokens:** organization API key\n**Scope required:** `flows:read`","security":[{"bearerAuth":["flows:read"]}],"parameters":[{"schema":{"type":"string"},"required":false,"name":"taskName","in":"query"},{"schema":{"type":"string","description":"One or more of `open`, `claimed`, `completed`, `failed`, `closed`, separated by commas. Defaults to `open,claimed,failed`."},"required":false,"description":"One or more of `open`, `claimed`, `completed`, `failed`, `closed`, separated by commas. Defaults to `open,claimed,failed`.","name":"status","in":"query"},{"schema":{"type":"string"},"required":false,"name":"flowId","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"description":"Tasks per page, 1 to 100. Defaults to 50."},"required":false,"description":"Tasks per page, 1 to 100. Defaults to 50.","name":"limit","in":"query"},{"schema":{"type":"integer","minimum":0,"description":"How many tasks to skip: the previous `offset` plus `limit`."},"required":false,"description":"How many tasks to skip: the previous `offset` plus `limit`.","name":"offset","in":"query"}],"responses":{"200":{"description":"The tasks, newest first.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"array","items":{"$ref":"#/components/schemas/ExternalTask"}},"pagination":{"type":"object","properties":{"limit":{"type":"integer"},"offset":{"type":"integer"},"hasMore":{"type":"boolean"}},"required":["limit","offset","hasMore"]}},"required":["success","data","pagination"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows":{"get":{"tags":["Flows"],"summary":"List flows","description":"Returns a paginated list of flows. Filter by status, template, account, people, the current step, the current step's type (`stepType`), health, dates, flow fields, a name or number, what changed since a time, or the flow that started them (`originFlowId`, `rootFlowId`). These filters mean the same thing in the app, here and in the MCP tool list_flows.\n\nFilters about a person take that person’s id (usr_…) from any caller. “me” means the caller, so it works only with a personal access token; with an organization API key it returns 400.\n\nA personal access token lists only the flows its person can open, and never matches a value that **Show progress only** hides from them. An organization API key sees what an admin sees.\n\n**Test runs are never listed**, in any `lifecycle`, archived or not. Read one with `GET /v1/flows/{id}`, by the `flowId` that `POST /v1/templates/{id}/test-runs` returned.\n\nA parameter this list doesn’t know returns `400 UNKNOWN_PARAMETER`, naming it. A template id that names nothing you can see returns `404`, naming the parameter.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `flows:read`","security":[{"bearerAuth":["flows:read"]}],"parameters":[{"schema":{"type":"string","description":"Filter by flow status. One value, or several as a comma-separated list (a flow matching any of them), for example `IN_PROGRESS,PAUSED`. Supported: `NEW`, `IN_PROGRESS`, `PAUSED`, `COMPLETED`, `CANCELLED`, `WAITING_FOR_ASSIGNEE`, `LIVE`. `NEW` (started, and nobody has opened a step yet), `WAITING_FOR_ASSIGNEE` (an active step with no assignee) and `LIVE` (in progress or paused) are worked out from the flow, so a response never contains them. An unsupported value returns 400 instead of an empty page. To select archived flows, use `lifecycle`.","example":"IN_PROGRESS,PAUSED"},"required":false,"description":"Filter by flow status. One value, or several as a comma-separated list (a flow matching any of them), for example `IN_PROGRESS,PAUSED`. Supported: `NEW`, `IN_PROGRESS`, `PAUSED`, `COMPLETED`, `CANCELLED`, `WAITING_FOR_ASSIGNEE`, `LIVE`. `NEW` (started, and nobody has opened a step yet), `WAITING_FOR_ASSIGNEE` (an active step with no assignee) and `LIVE` (in progress or paused) are worked out from the flow, so a response never contains them. An unsupported value returns 400 instead of an empty page. To select archived flows, use `lifecycle`.","name":"status","in":"query"},{"schema":{"type":"string","description":"Only return flows started from this template."},"required":false,"description":"Only return flows started from this template.","name":"templateId","in":"query"},{"schema":{"type":"string","description":"Only return flows started from any of these templates, as a comma-separated list (up to 200)."},"required":false,"description":"Only return flows started from any of these templates, as a comma-separated list (up to 200).","name":"templateIds","in":"query"},{"schema":{"type":"string","description":"Only return flows started from this template version."},"required":false,"description":"Only return flows started from this template version.","name":"templateVersionId","in":"query"},{"schema":{"type":"string","description":"Only return flows linked to this account. A flow is linked to an account whenever an external participant on the flow belongs to it; the link is automatic."},"required":false,"description":"Only return flows linked to this account. A flow is linked to an account whenever an external participant on the flow belongs to it; the link is automatic.","name":"accountId","in":"query"},{"schema":{"type":"string","description":"Part of the flow’s name or number, not case-sensitive."},"required":false,"description":"Part of the flow’s name or number, not case-sensitive.","name":"search","in":"query"},{"schema":{"type":"string","enum":["active","archived","all"],"description":"Whether to return active or archived flows. `active` (the default) leaves out archived flows, `archived` returns only archived flows, and `all` returns both. `includeArchived=true` also means `all`."},"required":false,"description":"Whether to return active or archived flows. `active` (the default) leaves out archived flows, `archived` returns only archived flows, and `all` returns both. `includeArchived=true` also means `all`.","name":"lifecycle","in":"query"},{"schema":{"type":"string","description":"Only return the flows this flow started directly: its sub-flows, and the flows its Start a flow and Schedule a flow steps started. A flow you can't open returns `404`: \"originFlowId: no flow flow_2210 that you can see.\" Flows below it that you can't open are left out. This is not the same as cancellation: only flows with `startedByKind: sub_flow` are canceled with the flow that started them."},"required":false,"description":"Only return the flows this flow started directly: its sub-flows, and the flows its Start a flow and Schedule a flow steps started. A flow you can't open returns `404`: \"originFlowId: no flow flow_2210 that you can see.\" Flows below it that you can't open are left out. This is not the same as cancellation: only flows with `startedByKind: sub_flow` are canceled with the flow that started them.","name":"originFlowId","in":"query"},{"schema":{"type":"string","description":"Return every flow this flow started, at any depth up to 5 levels, as one flat list. Each row's `originFlowId` and `depth` place it in the tree (1 is a direct child; `depth` is null on lists without `rootFlowId`), `startedByKind` says how it was started and `startedByStepId` which step started it. A flow you can't open returns `404`: \"rootFlowId: no flow flow_2210 that you can see.\" Flows you can't open are left out; a flow below one of them still comes back, with that parent's id."},"required":false,"description":"Return every flow this flow started, at any depth up to 5 levels, as one flat list. Each row's `originFlowId` and `depth` place it in the tree (1 is a direct child; `depth` is null on lists without `rootFlowId`), `startedByKind` says how it was started and `startedByStepId` which step started it. A flow you can't open returns `404`: \"rootFlowId: no flow flow_2210 that you can see.\" Flows you can't open are left out; a flow below one of them still comes back, with that parent's id.","name":"rootFlowId","in":"query"},{"schema":{"type":"string","description":"Only these flows, as a comma-separated list (up to 200). Returns every match on one page."},"required":false,"description":"Only these flows, as a comma-separated list (up to 200). Returns every match on one page.","name":"flowIds","in":"query"},{"schema":{"type":"string","enum":["recent","newest","oldest","due-date","due-date-latest","completed-newest","completed-oldest","auto-number"],"description":"`recent` (default): latest activity first, the time each row shows as `lastActivityAt`. `newest`: start date, newest first. `oldest`: start date, oldest first. `due-date`: earliest due first, flows with no due date last. `due-date-latest`: latest due first, no due date last. `completed-newest` / `completed-oldest`: by completed date, flows with none last. `auto-number`: by flow number. Not with `updatedSince`."},"required":false,"description":"`recent` (default): latest activity first, the time each row shows as `lastActivityAt`. `newest`: start date, newest first. `oldest`: start date, oldest first. `due-date`: earliest due first, flows with no due date last. `due-date-latest`: latest due first, no due date last. `completed-newest` / `completed-oldest`: by completed date, flows with none last. `auto-number`: by flow number. Not with `updatedSince`.","name":"sort","in":"query"},{"schema":{"type":"string","enum":["true","false"],"description":"Only flows you started, hold a role on, own the template of, or have a step in. Needs a personal access token."},"required":false,"description":"Only flows you started, hold a role on, own the template of, or have a step in. Needs a personal access token.","name":"involved","in":"query"},{"schema":{"type":"string","description":"Only return flows with an open step assigned to this person. A person’s id (`usr_…`), or `me` for you; `me` needs a personal access token."},"required":false,"description":"Only return flows with an open step assigned to this person. A person’s id (`usr_…`), or `me` for you; `me` needs a personal access token.","name":"assigneeId","in":"query"},{"schema":{"type":"string","description":"Only return flows where this person holds a role. Add `roleId` for one role. A person’s id (`usr_…`), or `me` for you; `me` needs a personal access token."},"required":false,"description":"Only return flows where this person holds a role. Add `roleId` for one role. A person’s id (`usr_…`), or `me` for you; `me` needs a personal access token.","name":"roleHolderId","in":"query"},{"schema":{"type":"string","description":"With `roleHolderId`: that person in this role (a `roleId` from the template)."},"required":false,"description":"With `roleHolderId`: that person in this role (a `roleId` from the template).","name":"roleId","in":"query"},{"schema":{"type":"string","description":"Only flows where someone holds a role with this name, such as `Reviewer`, on any template."},"required":false,"description":"Only flows where someone holds a role with this name, such as `Reviewer`, on any template.","name":"roleName","in":"query"},{"schema":{"type":"string","description":"Only return flows this person started, holds a role on, or has a step in. A person’s id (`usr_…`), or `me` for you; `me` needs a personal access token."},"required":false,"description":"Only return flows this person started, holds a role on, or has a step in. A person’s id (`usr_…`), or `me` for you; `me` needs a personal access token.","name":"involvedUserId","in":"query"},{"schema":{"type":"string","description":"Only flows at this step (the template’s step id)."},"required":false,"description":"Only flows at this step (the template’s step id).","name":"currentStepId","in":"query"},{"schema":{"type":"string","description":"Only flows whose current step is this type. A step type such as `FORM` or `DOCUSIGN`, a group (`group:actions`, `group:ai-utilities`, `group:controls`, `group:automations`, `group:connected-app`), or one connected app (`app:` plus the app id). An External app step matches `config.externalApp.appId`, or `config.appId` when that is absent. An MCP server step for that app matches too. A step with no stored type matches the type on the flow definition. Any step in progress counts, including one of several running together. A finished or upcoming step does not. The same value narrows the app's list and its export."},"required":false,"description":"Only flows whose current step is this type. A step type such as `FORM` or `DOCUSIGN`, a group (`group:actions`, `group:ai-utilities`, `group:controls`, `group:automations`, `group:connected-app`), or one connected app (`app:` plus the app id). An External app step matches `config.externalApp.appId`, or `config.appId` when that is absent. An MCP server step for that app matches too. A step with no stored type matches the type on the flow definition. Any step in progress counts, including one of several running together. A finished or upcoming step does not. The same value narrows the app's list and its export.","name":"stepType","in":"query"},{"schema":{"type":"string","enum":["true","false"],"description":"Only flows that need your attention. Needs a personal access token."},"required":false,"description":"Only flows that need your attention. Needs a personal access token.","name":"needsAttention","in":"query"},{"schema":{"type":"string","description":"Only flows that need your attention for one of these reasons, comma-separated, for example `YOUR_TURN,STEP_OVERDUE`. Needs a personal access token."},"required":false,"description":"Only flows that need your attention for one of these reasons, comma-separated, for example `YOUR_TURN,STEP_OVERDUE`. Needs a personal access token.","name":"attentionReasons","in":"query"},{"schema":{"type":"string","enum":["on-track","off-track","overdue"],"description":"On track, off track, or overdue, as the Process Report computes it."},"required":false,"description":"On track, off track, or overdue, as the Process Report computes it.","name":"health","in":"query"},{"schema":{"type":"string","enum":["true","false"],"description":"Only flows with at least one failed step."},"required":false,"description":"Only flows with at least one failed step.","name":"hasFailed","in":"query"},{"schema":{"type":"string","format":"date-time","description":"Only flows started at or after this time."},"required":false,"description":"Only flows started at or after this time.","name":"startedAfter","in":"query"},{"schema":{"type":"string","format":"date-time","description":"Only flows started before this time."},"required":false,"description":"Only flows started before this time.","name":"startedBefore","in":"query"},{"schema":{"type":"string","format":"date-time","description":"Only flows completed at or after this time."},"required":false,"description":"Only flows completed at or after this time.","name":"completedSince","in":"query"},{"schema":{"type":"string","format":"date-time","description":"Only flows completed at or before this time. Inclusive: a flow completed at this instant is included."},"required":false,"description":"Only flows completed at or before this time. Inclusive: a flow completed at this instant is included.","name":"completedUntil","in":"query"},{"schema":{"type":"string","enum":["true","false"],"description":"With a completed-date window: `true` keeps only flows whose status is Completed. A canceled flow also records a completed time. Omit it to count every flow that finished in the window."},"required":false,"description":"With a completed-date window: `true` keeps only flows whose status is Completed. A canceled flow also records a completed time. Omit it to count every flow that finished in the window.","name":"completedStatusOnly","in":"query"},{"schema":{"type":"string","format":"date-time","description":"Only flows due at or after this time. The flow’s own due date, not a step’s."},"required":false,"description":"Only flows due at or after this time. The flow’s own due date, not a step’s.","name":"dueAfter","in":"query"},{"schema":{"type":"string","format":"date-time","description":"Only flows due before this time."},"required":false,"description":"Only flows due before this time.","name":"dueBefore","in":"query"},{"schema":{"type":"string","enum":["true","false"],"description":"`false`: only flows with no due date. `true`: only flows that have one."},"required":false,"description":"`false`: only flows with no due date. `true`: only flows that have one.","name":"hasDueDate","in":"query"},{"schema":{"type":"string","description":"Only flows where this step (the template’s step id) was reopened."},"required":false,"description":"Only flows where this step (the template’s step id) was reopened.","name":"reopenedStepId","in":"query"},{"schema":{"type":"string","format":"date-time","description":"Only flows with a step reopened at or after this time."},"required":false,"description":"Only flows with a step reopened at or after this time.","name":"reopenedSince","in":"query"},{"schema":{"type":"string","format":"date-time","description":"Only flows with a step reopened at or before this time."},"required":false,"description":"Only flows with a step reopened at or before this time.","name":"reopenedUntil","in":"query"},{"schema":{"type":"string","enum":["true","false"],"description":"The old spelling of `lifecycle=all`: `true` returns active and archived flows. `lifecycle` wins when both are sent.","deprecated":true},"required":false,"description":"The old spelling of `lifecycle=all`: `true` returns active and archived flows. `lifecycle` wins when both are sent.","name":"includeArchived","in":"query"},{"schema":{"type":"string","enum":["true","false"],"description":"Has no effect: sub-flows are always listed. Kept so older requests still work.","deprecated":true},"required":false,"description":"Has no effect: sub-flows are always listed. Kept so older requests still work.","name":"includeSubFlows","in":"query"},{"schema":{"type":"string","description":"Only return flows whose field with this key has exactly this value, for example `field[account_id]=ACC-4471`. For a choice field, send the option’s id. Field keys are on `GET /v1/templates/{id}`. A field hidden from you by Show progress only never matches. If no template you can see has the key, the call returns `400 UNKNOWN_FIELD`."},"required":false,"description":"Only return flows whose field with this key has exactly this value, for example `field[account_id]=ACC-4471`. For a choice field, send the option’s id. Field keys are on `GET /v1/templates/{id}`. A field hidden from you by Show progress only never matches. If no template you can see has the key, the call returns `400 UNKNOWN_FIELD`.","name":"field[key]","in":"query"},{"schema":{"type":"string","format":"date-time","description":"Only flows with a change at or after this time: a field, an answer, a step, a person or a status. Opening or viewing a flow is not a change. For people who can’t see every part of a flow, only changes they can see count, and it errs toward fewer: a change the app shows them may not count. An archived flow is returned with its `archivedAt`, and a deleted one as `{ id, deleted: true, lastChangedAt }`, only to someone who could see it. Rows come oldest change first, each with its `lastChangedAt`. Page with `cursor`: send `pagination.nextCursor` back as it is, with the same filters, and keep the last one for your next run. Delivery is at least once: a flow can repeat within 5 minutes of your previous run’s end. Rarely, a change is missed: one saved by a background process in Moxo that ran longer than 5 minutes, or by any save that ran longer than 15 minutes. On `GET /v1/templates`, a change is a publish."},"required":false,"description":"Only flows with a change at or after this time: a field, an answer, a step, a person or a status. Opening or viewing a flow is not a change. For people who can’t see every part of a flow, only changes they can see count, and it errs toward fewer: a change the app shows them may not count. An archived flow is returned with its `archivedAt`, and a deleted one as `{ id, deleted: true, lastChangedAt }`, only to someone who could see it. Rows come oldest change first, each with its `lastChangedAt`. Page with `cursor`: send `pagination.nextCursor` back as it is, with the same filters, and keep the last one for your next run. Delivery is at least once: a flow can repeat within 5 minutes of your previous run’s end. Rarely, a change is missed: one saved by a background process in Moxo that ran longer than 5 minutes, or by any save that ran longer than 15 minutes. On `GET /v1/templates`, a change is a publish.","name":"updatedSince","in":"query"},{"schema":{"type":"string","description":"`cursor` pages a list filtered by `updatedSince`: send `pagination.nextCursor` back as it is. Every other list pages with `offset`: how many flows to skip, the previous `offset` plus `limit`. A cursor that can’t be read returns `400 INVALID_CURSOR`."},"required":false,"description":"`cursor` pages a list filtered by `updatedSince`: send `pagination.nextCursor` back as it is. Every other list pages with `offset`: how many flows to skip, the previous `offset` plus `limit`. A cursor that can’t be read returns `400 INVALID_CURSOR`.","name":"cursor","in":"query"},{"schema":{"type":"number","minimum":1,"maximum":100,"description":"Flows per page, 1 to 100. Defaults to 50. Any other value returns 400."},"required":false,"description":"Flows per page, 1 to 100. Defaults to 50. Any other value returns 400.","name":"limit","in":"query"},{"schema":{"type":["number","null"],"minimum":0,"description":"How many flows to skip. Defaults to 0. Not with `updatedSince`, which pages with `cursor`."},"required":false,"description":"How many flows to skip. Defaults to 0. Not with `updatedSince`, which pages with `cursor`.","name":"offset","in":"query"}],"responses":{"200":{"description":"A page of flows. With `updatedSince` or `cursor`, `pagination` is `{ limit, hasMore, nextCursor }` and `nextCursor` is always set: keep the last one for your next run.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"array","items":{"anyOf":[{"$ref":"#/components/schemas/FlowSummary"},{"$ref":"#/components/schemas/FlowTombstone"}]}},"pagination":{"anyOf":[{"type":"object","properties":{"total":{"type":"number"},"limit":{"type":"number"},"offset":{"type":"number"},"hasMore":{"type":"boolean"}},"required":["total","limit","offset","hasMore"]},{"type":"object","properties":{"limit":{"type":"number"},"hasMore":{"type":"boolean"},"nextCursor":{"type":"string"}},"required":["limit","hasMore","nextCursor"]}]}},"required":["success","data","pagination"]}}}},"400":{"description":"Refused: `UNKNOWN_PARAMETER`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/counts":{"get":{"tags":["Flows"],"summary":"Count flows","description":"Returns how many flows match, in all and per template, with the same filters and the same visibility as `GET /v1/flows`, in one call instead of paging the list. For example, `GET /v1/flows/counts?status=IN_PROGRESS` counts running flows by template, most first.\n\nFilters about a person take that person’s id (usr_…) from any caller. “me” means the caller, so it works only with a personal access token; with an organization API key it returns 400.\n\nA personal access token counts only the flows its person can open. `updatedSince` is not taken here; page `GET /v1/flows?updatedSince=` for what changed.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `flows:read`","security":[{"bearerAuth":["flows:read"]}],"parameters":[{"schema":{"type":"string","description":"Filter by flow status. One value, or several as a comma-separated list (a flow matching any of them), for example `IN_PROGRESS,PAUSED`. Supported: `NEW`, `IN_PROGRESS`, `PAUSED`, `COMPLETED`, `CANCELLED`, `WAITING_FOR_ASSIGNEE`, `LIVE`. `NEW` (started, and nobody has opened a step yet), `WAITING_FOR_ASSIGNEE` (an active step with no assignee) and `LIVE` (in progress or paused) are worked out from the flow, so a response never contains them. An unsupported value returns 400 instead of an empty page. To select archived flows, use `lifecycle`.","example":"IN_PROGRESS,PAUSED"},"required":false,"description":"Filter by flow status. One value, or several as a comma-separated list (a flow matching any of them), for example `IN_PROGRESS,PAUSED`. Supported: `NEW`, `IN_PROGRESS`, `PAUSED`, `COMPLETED`, `CANCELLED`, `WAITING_FOR_ASSIGNEE`, `LIVE`. `NEW` (started, and nobody has opened a step yet), `WAITING_FOR_ASSIGNEE` (an active step with no assignee) and `LIVE` (in progress or paused) are worked out from the flow, so a response never contains them. An unsupported value returns 400 instead of an empty page. To select archived flows, use `lifecycle`.","name":"status","in":"query"},{"schema":{"type":"string","description":"Only return flows started from this template."},"required":false,"description":"Only return flows started from this template.","name":"templateId","in":"query"},{"schema":{"type":"string","description":"Only return flows started from any of these templates, as a comma-separated list (up to 200)."},"required":false,"description":"Only return flows started from any of these templates, as a comma-separated list (up to 200).","name":"templateIds","in":"query"},{"schema":{"type":"string","description":"Only return flows started from this template version."},"required":false,"description":"Only return flows started from this template version.","name":"templateVersionId","in":"query"},{"schema":{"type":"string","description":"Only return flows linked to this account. A flow is linked to an account whenever an external participant on the flow belongs to it; the link is automatic."},"required":false,"description":"Only return flows linked to this account. A flow is linked to an account whenever an external participant on the flow belongs to it; the link is automatic.","name":"accountId","in":"query"},{"schema":{"type":"string","description":"Part of the flow’s name or number, not case-sensitive."},"required":false,"description":"Part of the flow’s name or number, not case-sensitive.","name":"search","in":"query"},{"schema":{"type":"string","enum":["active","archived","all"],"description":"Whether to return active or archived flows. `active` (the default) leaves out archived flows, `archived` returns only archived flows, and `all` returns both. `includeArchived=true` also means `all`."},"required":false,"description":"Whether to return active or archived flows. `active` (the default) leaves out archived flows, `archived` returns only archived flows, and `all` returns both. `includeArchived=true` also means `all`.","name":"lifecycle","in":"query"},{"schema":{"type":"string","description":"Only return the flows this flow started directly: its sub-flows, and the flows its Start a flow and Schedule a flow steps started. A flow you can't open returns `404`: \"originFlowId: no flow flow_2210 that you can see.\" Flows below it that you can't open are left out. This is not the same as cancellation: only flows with `startedByKind: sub_flow` are canceled with the flow that started them."},"required":false,"description":"Only return the flows this flow started directly: its sub-flows, and the flows its Start a flow and Schedule a flow steps started. A flow you can't open returns `404`: \"originFlowId: no flow flow_2210 that you can see.\" Flows below it that you can't open are left out. This is not the same as cancellation: only flows with `startedByKind: sub_flow` are canceled with the flow that started them.","name":"originFlowId","in":"query"},{"schema":{"type":"string","description":"Return every flow this flow started, at any depth up to 5 levels, as one flat list. Each row's `originFlowId` and `depth` place it in the tree (1 is a direct child; `depth` is null on lists without `rootFlowId`), `startedByKind` says how it was started and `startedByStepId` which step started it. A flow you can't open returns `404`: \"rootFlowId: no flow flow_2210 that you can see.\" Flows you can't open are left out; a flow below one of them still comes back, with that parent's id."},"required":false,"description":"Return every flow this flow started, at any depth up to 5 levels, as one flat list. Each row's `originFlowId` and `depth` place it in the tree (1 is a direct child; `depth` is null on lists without `rootFlowId`), `startedByKind` says how it was started and `startedByStepId` which step started it. A flow you can't open returns `404`: \"rootFlowId: no flow flow_2210 that you can see.\" Flows you can't open are left out; a flow below one of them still comes back, with that parent's id.","name":"rootFlowId","in":"query"},{"schema":{"type":"string","description":"Only these flows, as a comma-separated list (up to 200). Returns every match on one page."},"required":false,"description":"Only these flows, as a comma-separated list (up to 200). Returns every match on one page.","name":"flowIds","in":"query"},{"schema":{"type":"string","enum":["true","false"],"description":"Only flows you started, hold a role on, own the template of, or have a step in. Needs a personal access token."},"required":false,"description":"Only flows you started, hold a role on, own the template of, or have a step in. Needs a personal access token.","name":"involved","in":"query"},{"schema":{"type":"string","description":"Only return flows with an open step assigned to this person. A person’s id (`usr_…`), or `me` for you; `me` needs a personal access token."},"required":false,"description":"Only return flows with an open step assigned to this person. A person’s id (`usr_…`), or `me` for you; `me` needs a personal access token.","name":"assigneeId","in":"query"},{"schema":{"type":"string","description":"Only return flows where this person holds a role. Add `roleId` for one role. A person’s id (`usr_…`), or `me` for you; `me` needs a personal access token."},"required":false,"description":"Only return flows where this person holds a role. Add `roleId` for one role. A person’s id (`usr_…`), or `me` for you; `me` needs a personal access token.","name":"roleHolderId","in":"query"},{"schema":{"type":"string","description":"With `roleHolderId`: that person in this role (a `roleId` from the template)."},"required":false,"description":"With `roleHolderId`: that person in this role (a `roleId` from the template).","name":"roleId","in":"query"},{"schema":{"type":"string","description":"Only flows where someone holds a role with this name, such as `Reviewer`, on any template."},"required":false,"description":"Only flows where someone holds a role with this name, such as `Reviewer`, on any template.","name":"roleName","in":"query"},{"schema":{"type":"string","description":"Only return flows this person started, holds a role on, or has a step in. A person’s id (`usr_…`), or `me` for you; `me` needs a personal access token."},"required":false,"description":"Only return flows this person started, holds a role on, or has a step in. A person’s id (`usr_…`), or `me` for you; `me` needs a personal access token.","name":"involvedUserId","in":"query"},{"schema":{"type":"string","description":"Only flows at this step (the template’s step id)."},"required":false,"description":"Only flows at this step (the template’s step id).","name":"currentStepId","in":"query"},{"schema":{"type":"string","description":"Only flows whose current step is this type. A step type such as `FORM` or `DOCUSIGN`, a group (`group:actions`, `group:ai-utilities`, `group:controls`, `group:automations`, `group:connected-app`), or one connected app (`app:` plus the app id). An External app step matches `config.externalApp.appId`, or `config.appId` when that is absent. An MCP server step for that app matches too. A step with no stored type matches the type on the flow definition. Any step in progress counts, including one of several running together. A finished or upcoming step does not. The same value narrows the app's list and its export."},"required":false,"description":"Only flows whose current step is this type. A step type such as `FORM` or `DOCUSIGN`, a group (`group:actions`, `group:ai-utilities`, `group:controls`, `group:automations`, `group:connected-app`), or one connected app (`app:` plus the app id). An External app step matches `config.externalApp.appId`, or `config.appId` when that is absent. An MCP server step for that app matches too. A step with no stored type matches the type on the flow definition. Any step in progress counts, including one of several running together. A finished or upcoming step does not. The same value narrows the app's list and its export.","name":"stepType","in":"query"},{"schema":{"type":"string","enum":["true","false"],"description":"Only flows that need your attention. Needs a personal access token."},"required":false,"description":"Only flows that need your attention. Needs a personal access token.","name":"needsAttention","in":"query"},{"schema":{"type":"string","description":"Only flows that need your attention for one of these reasons, comma-separated, for example `YOUR_TURN,STEP_OVERDUE`. Needs a personal access token."},"required":false,"description":"Only flows that need your attention for one of these reasons, comma-separated, for example `YOUR_TURN,STEP_OVERDUE`. Needs a personal access token.","name":"attentionReasons","in":"query"},{"schema":{"type":"string","enum":["on-track","off-track","overdue"],"description":"On track, off track, or overdue, as the Process Report computes it."},"required":false,"description":"On track, off track, or overdue, as the Process Report computes it.","name":"health","in":"query"},{"schema":{"type":"string","enum":["true","false"],"description":"Only flows with at least one failed step."},"required":false,"description":"Only flows with at least one failed step.","name":"hasFailed","in":"query"},{"schema":{"type":"string","format":"date-time","description":"Only flows started at or after this time."},"required":false,"description":"Only flows started at or after this time.","name":"startedAfter","in":"query"},{"schema":{"type":"string","format":"date-time","description":"Only flows started before this time."},"required":false,"description":"Only flows started before this time.","name":"startedBefore","in":"query"},{"schema":{"type":"string","format":"date-time","description":"Only flows completed at or after this time."},"required":false,"description":"Only flows completed at or after this time.","name":"completedSince","in":"query"},{"schema":{"type":"string","format":"date-time","description":"Only flows completed at or before this time. Inclusive: a flow completed at this instant is included."},"required":false,"description":"Only flows completed at or before this time. Inclusive: a flow completed at this instant is included.","name":"completedUntil","in":"query"},{"schema":{"type":"string","enum":["true","false"],"description":"With a completed-date window: `true` keeps only flows whose status is Completed. A canceled flow also records a completed time. Omit it to count every flow that finished in the window."},"required":false,"description":"With a completed-date window: `true` keeps only flows whose status is Completed. A canceled flow also records a completed time. Omit it to count every flow that finished in the window.","name":"completedStatusOnly","in":"query"},{"schema":{"type":"string","format":"date-time","description":"Only flows due at or after this time. The flow’s own due date, not a step’s."},"required":false,"description":"Only flows due at or after this time. The flow’s own due date, not a step’s.","name":"dueAfter","in":"query"},{"schema":{"type":"string","format":"date-time","description":"Only flows due before this time."},"required":false,"description":"Only flows due before this time.","name":"dueBefore","in":"query"},{"schema":{"type":"string","enum":["true","false"],"description":"`false`: only flows with no due date. `true`: only flows that have one."},"required":false,"description":"`false`: only flows with no due date. `true`: only flows that have one.","name":"hasDueDate","in":"query"},{"schema":{"type":"string","description":"Only flows where this step (the template’s step id) was reopened."},"required":false,"description":"Only flows where this step (the template’s step id) was reopened.","name":"reopenedStepId","in":"query"},{"schema":{"type":"string","format":"date-time","description":"Only flows with a step reopened at or after this time."},"required":false,"description":"Only flows with a step reopened at or after this time.","name":"reopenedSince","in":"query"},{"schema":{"type":"string","format":"date-time","description":"Only flows with a step reopened at or before this time."},"required":false,"description":"Only flows with a step reopened at or before this time.","name":"reopenedUntil","in":"query"},{"schema":{"type":"string","enum":["true","false"],"description":"The old spelling of `lifecycle=all`: `true` returns active and archived flows. `lifecycle` wins when both are sent.","deprecated":true},"required":false,"description":"The old spelling of `lifecycle=all`: `true` returns active and archived flows. `lifecycle` wins when both are sent.","name":"includeArchived","in":"query"},{"schema":{"type":"string","enum":["true","false"],"description":"Has no effect: sub-flows are always listed. Kept so older requests still work.","deprecated":true},"required":false,"description":"Has no effect: sub-flows are always listed. Kept so older requests still work.","name":"includeSubFlows","in":"query"},{"schema":{"type":"string","description":"Only return flows whose field with this key has exactly this value, for example `field[account_id]=ACC-4471`. For a choice field, send the option’s id. Field keys are on `GET /v1/templates/{id}`. A field hidden from you by Show progress only never matches. If no template you can see has the key, the call returns `400 UNKNOWN_FIELD`."},"required":false,"description":"Only return flows whose field with this key has exactly this value, for example `field[account_id]=ACC-4471`. For a choice field, send the option’s id. Field keys are on `GET /v1/templates/{id}`. A field hidden from you by Show progress only never matches. If no template you can see has the key, the call returns `400 UNKNOWN_FIELD`.","name":"field[key]","in":"query"}],"responses":{"200":{"description":"The counts.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on success."},"data":{"type":"object","properties":{"total":{"type":"integer","description":"How many flows match."},"byTemplate":{"type":"array","items":{"type":"object","properties":{"template":{"type":"object","properties":{"id":{"type":"string","description":"The template's id."},"name":{"type":"string","description":"The template's name."}},"required":["id","name"],"description":"The template the flows started from."},"count":{"type":"integer","description":"How many of the matching flows started from it."}},"required":["template","count"]},"description":"The matching flows per template, most first. A flow started without a template (a blank flow) is counted in `total` only."}},"required":["total","byTemplate"],"description":"The counts."}},"required":["success","data"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/{id}":{"get":{"tags":["Flows"],"summary":"Get flow","description":"Returns the full flow: its members, roles, every step with its assignee, the current values of its flow fields, and the version of the template it runs on.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `flows:read`","security":[{"bearerAuth":["flows:read"]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/FlowDetail"}},"required":["success","data"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"tags":["Flows"],"summary":"Update flow info","description":"Updates a flow's name, due date or flow field values. Send at least one of `name`, `dueAt` or `customFields`. Send each field by its `key` (`[{ key, value }]`), as `customFields[]` on `GET /v1/flows/{id}` lists it; an id there is refused, naming the key. Sending only values the flow already has changes nothing: the answer says `changed: false`.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `flows:write`","security":[{"bearerAuth":["flows:write"]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateFlowInfoRequest"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."},"changed":{"type":"boolean","description":"`true` when this call changed what you asked it to. `false` when that was already so, and the call changed nothing of it."},"message":{"type":"string","description":"Only with `changed: false`: what was already so.","example":"Nothing changed: this person already holds this role."}},"required":["success","changed"],"additionalProperties":false}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"tags":["Flows"],"summary":"Delete a flow","description":"Permanently deletes a flow and its history. A deleted flow can't be recovered. To hide a flow instead, archive it.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `flows:write`","security":[{"bearerAuth":["flows:write"]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]}},"required":["success"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/{id}/tree":{"get":{"tags":["Flows"],"summary":"Get flow tree","description":"Returns the flow and every sub-flow in it as one list of rows, in order, with progress counted with its sub-flows. It shows what the flow page shows you: a step hidden from you is left out, and a sub-flow you can't open is one `locked` row with its template's name and status, not counted. Progress counts people's actions only, and a sub-flow only when the flow waits for it. Needs the Sub-flow tree view on your plan (`403 FEATURE_DISABLED` otherwise).\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `flows:read`","security":[{"bearerAuth":["flows:read"]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The flow and its sub-flows as one tree.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on success."},"data":{"allOf":[{"$ref":"#/components/schemas/FlowTree"},{"description":"The tree, as you can see it."}]}},"required":["success","data"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/{id}/messages":{"get":{"tags":["Flows"],"summary":"List flow chat messages","description":"Returns the flow's chat: the messages people exchanged inside the flow (your team, external clients and AI agents), newest first, with threaded replies. What you see follows your access to the flow, and view-only access includes no chat. `internal_only` messages are notes for your team only. This is the flow's chat only, not group conversations or the AI builder's conversation.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `chat:read`","security":[{"bearerAuth":["chat:read"]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"integer","minimum":1,"maximum":200,"description":"How many top-level messages to return, up to 200. Defaults to 100. Replies are nested inside their message and don't count toward this."},"required":false,"description":"How many top-level messages to return, up to 200. Defaults to 100. Replies are nested inside their message and don't count toward this.","name":"limit","in":"query"},{"schema":{"type":"string","description":"The previous page's `pagination.nextCursor`. Leave it out for the first page."},"required":false,"description":"The previous page's `pagination.nextCursor`. Leave it out for the first page.","name":"cursor","in":"query"}],"responses":{"200":{"description":"A page of chat messages, newest first.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"array","items":{"$ref":"#/components/schemas/FlowChatMessage"}},"pagination":{"type":"object","properties":{"nextCursor":{"type":["string","null"]}},"required":["nextCursor"]}},"required":["success","data","pagination"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"x-moxo-person-only":"ASSIGNEE_REQUIRED","tags":["Flows"],"summary":"Post a flow chat message","description":"Posts a message, with or without files, in the flow's chat as the person the token belongs to, with exactly the reach they have in the app: they need participate access to the flow, the flow must not be canceled, and comments must be on for the flow.\n\n**Where it goes.** With `targetStepExecutionId` (`steps[].id` from `GET /v1/flows/{id}`), the message is on that step and its participants see it (`visibility: \"all\"`). Without it, a team member's message goes to the conversation for the whole flow, which only your team sees (`visibility: \"internal_only\"`), and an external person's goes on a step they can see. An external person can only choose a step they can see (`403 STEP_NOT_VISIBLE`).\n\n**Files.** Get an upload link from `POST /v1/flows/{id}/messages/upload-init`, `PUT` the file to it, then send its `fileId` in `attachmentFileIds`. Files from the flow's project come from `POST /v1/flows/{id}/messages/from-project`. A message with files can have empty text. A file the message can't carry is refused: not found `404 ATTACHMENT_NOT_FOUND`, uploaded for another flow `400 ATTACHMENT_WRONG_FLOW`, not uploaded yet `400 ATTACHMENT_BAD_STATUS`, already on a message `409 ATTACHMENT_ALREADY_BOUND`, uploaded by someone else `403 ATTACHMENT_NOT_OWNED`, blocked by the virus scan `400 ATTACHMENT_SCAN_FAILED`, or an outside person's file in a message only your team sees `403 ATTACHMENT_VISIBILITY_MISMATCH`.\n\nNeeds a personal access token. An organization API key has no person to post as, so it gets `403 ASSIGNEE_REQUIRED`.\n\n**Refusals:** `403 FEATURE_DISABLED` (chat is not on the organization's plan), `403 FLOW_CANCELLED` (the flow was canceled, so its chat is read-only), `403 PROGRESS_ONLY` (the flow is shared with this person to follow its progress only), `403 COMMENTS_DISABLED` (comments are off for this flow; reading still works), `403 STEP_NOT_VISIBLE` (`targetStepExecutionId` names a step this person can't see), `403 FORBIDDEN` (an external participant sent no `targetStepExecutionId` and has no step open on this flow, so name the step they are writing about; also a step that has no chat, such as an automation), `400 BAD_REQUEST` (`targetStepExecutionId` is not a step of this flow), `403 MENTION_NOT_ALLOWED` (`mentions` names someone who isn't on the flow, and this person isn't a flow manager, sent no `targetStepExecutionId`, or the template's Tag anyone in the organization setting is off), `400 MENTION_UNKNOWN` (`mentions` names someone who is not in this organization), `400 MENTION_EXTERNAL` (`mentions` names someone outside the organization who isn't on the flow), `400 MENTION_INACTIVE` (`mentions` names someone who is deactivated), `400 TOO_MANY_MENTIONS` (`mentions` names more than 10 people who aren't on the flow).\n\n**Idempotent.** Send an `Idempotency-Key` header to make retries safe: a retry within 10 minutes returns `201` with the original message instead of posting twice, or `410 IDEMPOTENCY_RESULT_LOST` when that message was deleted since. A retry while the first request is still running returns `425 IDEMPOTENT_REQUEST_PENDING`; wait `Retry-After` seconds and send it again.\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":256,"pattern":"^[A-Za-z0-9_\\-:.]+$","description":"An optional key that makes this request safe to retry. Send a new UUID for each request. A key is up to 256 letters, digits, `-`, `_`, `:` or `.`; any other key is refused with `400 INVALID_IDEMPOTENCY_KEY` and nothing runs. A retry with the same key within 10 minutes returns the first response and changes nothing again. After 10 minutes, the same key runs the request again, so use a new key for a late retry. See Idempotency in the Introduction.","example":"6f2c4a5e-3b8d-4c7f-9a1e-2d6b8e0f4c5a"},"required":false,"description":"An optional key that makes this request safe to retry. Send a new UUID for each request. A key is up to 256 letters, digits, `-`, `_`, `:` or `.`; any other key is refused with `400 INVALID_IDEMPOTENCY_KEY` and nothing runs. A retry with the same key within 10 minutes returns the first response and changes nothing again. After 10 minutes, the same key runs the request again, so use a new key for a late retry. See Idempotency in the Introduction.","name":"Idempotency-Key","in":"header"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"body":{"type":"string","maxLength":10000,"description":"The message text. It can be empty when the message carries files.","example":"The signed copy is uploaded."},"targetStepExecutionId":{"type":"string","minLength":1,"description":"Attach the message to this step (`steps[].id` from `GET /v1/flows/{id}`). An external person can only choose a step they can see. Leave it out rather than sending an empty string, which is refused."},"attachmentFileIds":{"type":"array","items":{"type":"string","minLength":1},"maxItems":10,"description":"Up to 10 files to send with the message: each `fileId` from `POST /v1/flows/{id}/messages/upload-init` (after the upload) or `POST /v1/flows/{id}/messages/from-project`. A file that is not yours, not on this flow, or already sent is refused."},"mentions":{"type":"array","items":{"type":"string","minLength":1},"maxItems":10,"description":"People to mention, by `usr_` id (up to 10). Each is told, as an @mention in the app tells them. Someone on the flow is mentioned as is. Someone in your organization who is not on the flow is added as a viewer first, so they can read the conversation and reply on that step: only a flow manager can do that, only with `targetStepExecutionId`, and only while the template's Tag anyone in the organization setting is on (`MENTION_NOT_ALLOWED` otherwise). Someone outside your organization is refused (`MENTION_EXTERNAL`)."}},"required":["body"],"additionalProperties":false}}}},"responses":{"201":{"description":"The message: the new one, or the original one when this is a retry with the same `Idempotency-Key`.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/FlowChatMessage"}},"required":["success","data"]}}}},"400":{"description":"Refused: `ATTACHMENT_BAD_STATUS`, `ATTACHMENT_SCAN_FAILED`, `ATTACHMENT_WRONG_FLOW`, `BAD_REQUEST`, `MENTION_EXTERNAL`, `MENTION_INACTIVE`, `MENTION_UNKNOWN`, `TOO_MANY_MENTIONS`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Refused: `ATTACHMENT_ALREADY_BOUND`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"410":{"description":"The first result for this `Idempotency-Key` can no longer be returned, because what it created was deleted. Use a new key for the next attempt.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"425":{"description":"The first request with this `Idempotency-Key` is still running (`IDEMPOTENT_REQUEST_PENDING`). Retry after `Retry-After` seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/templates/{id}/start":{"post":{"tags":["Flows"],"summary":"Start a flow","description":"Starts a flow from a published template. Send `roleAssignments`, giving each role (by its `key`, id or name) a person by `uniqueId`, `userId` or `email`, and optionally `name`, `dueAt` and `customFields` (`[{ key, value }]`, each field by its `key`; an id there is refused, naming the key). Returns the new flow, as `GET /v1/flows/{id}` returns it.\n\nSome templates ask for values at the start: the `customFields` with `collectAtStart: true` on `GET /v1/templates/{id}` (`required: true` when the flow can't start without one). A required value left out returns `400 VALIDATION_ERROR`, naming the field.\n\n**Who may hold a role** is the same rule as the incoming webhook and MCP `start_flow`. Someone already in your organization, by `userId` or `email`, is used. An email no one here has adds that person as an external user, or reactivates a deactivated one, when you may add external users (`external_users:write` for an organization key, Invite external users for a person); the answer lists them under `addedUsers`. Without that permission the request returns `403 INSUFFICIENT_SCOPE` and nobody is added. A role internal users fill (a flow manager or meeting host role) takes no one new: a new email there returns `400 ROLE_NEEDS_INTERNAL_USER`. A `uniqueId` or `userId` that is no one here returns `404 USER_NOT_FOUND`. A `uniqueId` returns `403 FEATURE_DISABLED` (`error.feature` is `userUniqueId`) when your organization's plan does not include unique IDs. If someone with an email the start was adding joins your organization while the flow is starting, it returns `409 START_PEOPLE_CHANGED` and nothing is started or added: send it again (the same `Idempotency-Key` is fine).\n\n**An organization API key starts the flow as itself.** No person is the starter: `startedBy` is `{ \"method\": \"api\", \"apiKey\": { … } }`, and a role filled by the person who starts the flow stays empty. To seat a person in that role, name them in `roleAssignments`. A personal access token starts as its person.\n\n**A role filled from the org chart is not set here.** Sending a person for it returns `400 ROLE_FILLED_FROM_ORG_CHART`. When neither a manager nor the template's fallback person can take the role, the flow doesn't start and the response is `422 ORG_CHART_NO_APPROVER`, with the reason.\n\n**Every Custom action step needs an approved page.** A version with one that has none doesn't start: the response is `409 CUSTOM_ACTION_PAGE_NOT_APPROVED`, naming the step. Approve the page in the builder and publish again.\n\n**Idempotent.** Send an `Idempotency-Key` header to make retries safe: a retry within 10 minutes returns the same flow and starts no second flow. See Idempotency in the Introduction.\n\n**Products.** An organization without the Flow product can't start new flows: the response is `403 FEATURE_DISABLED` with `error.feature: \"haiFlow\"`. Flows already running carry on.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `flows:write`","security":[{"bearerAuth":["flows:write"]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":256,"pattern":"^[A-Za-z0-9_\\-:.]+$","description":"An optional key that makes this request safe to retry. Send a new UUID for each request. A key is up to 256 letters, digits, `-`, `_`, `:` or `.`; any other key is refused with `400 INVALID_IDEMPOTENCY_KEY` and nothing runs. A retry with the same key within 10 minutes returns the first response and changes nothing again. After 10 minutes, the same key runs the request again, so use a new key for a late retry. See Idempotency in the Introduction.","example":"6f2c4a5e-3b8d-4c7f-9a1e-2d6b8e0f4c5a"},"required":false,"description":"An optional key that makes this request safe to retry. Send a new UUID for each request. A key is up to 256 letters, digits, `-`, `_`, `:` or `.`; any other key is refused with `400 INVALID_IDEMPOTENCY_KEY` and nothing runs. A retry with the same key within 10 minutes returns the first response and changes nothing again. After 10 minutes, the same key runs the request again, so use a new key for a late retry. See Idempotency in the Introduction.","name":"Idempotency-Key","in":"header"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartFlowRequest"},"examples":{"minimal":{"summary":"Minimal","value":{"name":"Acme onboarding","roleAssignments":[{"roleId":"role-customer","email":"ana@example.com"}]}},"withStartValues":{"summary":"With the values a template asks for","value":{"name":"Acme onboarding","roleAssignments":[{"roleId":"role-customer","email":"ana@example.com"}],"customFields":[{"key":"deal_size","value":250000}]}}}}}},"responses":{"200":{"description":"The flow started, as `GET /v1/flows/{id}` returns it.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/FlowDetail"},"addedUsers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The person's user id (`usr_…`)."},"email":{"type":"string","description":"The email the request named them by."},"roleId":{"type":"string","description":"The role they hold on the new flow."},"reactivated":{"type":"boolean","description":"`true` when they were a deactivated external user, now active again."}},"required":["id","email","roleId","reactivated"],"additionalProperties":false},"description":"The people this start added to your organization as external users, or reactivated. Absent when it added no one. A retry with the same `Idempotency-Key` answers the same list."}},"required":["success","data"]}}}},"400":{"description":"Refused: `ROLE_FILLED_FROM_ORG_CHART`, `ROLE_NEEDS_INTERNAL_USER`, `VALIDATION_ERROR`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Refused: `CUSTOM_ACTION_PAGE_NOT_APPROVED`, `START_PEOPLE_CHANGED`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"410":{"description":"The first result for this `Idempotency-Key` can no longer be returned, because what it created was deleted. Use a new key for the next attempt.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Refused: `ORG_CHART_NO_APPROVER`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"425":{"description":"A request with this `Idempotency-Key` is still running. Retry after `Retry-After` seconds. If the first request failed with a `5xx`, the key stays held for 10 minutes; to retry sooner, use a new key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"The first result for this `Idempotency-Key` couldn't be checked. Retry with the same key after a short wait. If it keeps happening, contact support with the `requestId`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/{id}/cancel":{"post":{"tags":["Flows"],"summary":"Cancel a flow","description":"Cancels a flow in progress. Its pending steps are dropped and its status becomes `CANCELLED`. The body is optional. Returns the cancelled flow.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `flows:write`","security":[{"bearerAuth":["flows:write"]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":["object","null"],"properties":{"reason":{"type":"string","maxLength":500,"description":"Why the flow is canceled, up to 500 characters. It is recorded with the cancellation."}},"additionalProperties":false}}}},"responses":{"200":{"description":"The flow after the change, as `GET /v1/flows/{id}` returns it, so you don't need to read it again.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"allOf":[{"$ref":"#/components/schemas/FlowDetail"},{"description":"The flow after the change."}]}},"required":["success","data"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/{id}/archive":{"post":{"tags":["Flows"],"summary":"Archive a flow","description":"Hides the flow from the default list and keeps its data. Only a completed or cancelled flow can be archived: cancel a running one first (`POST /v1/flows/{id}/cancel`), or the response is `400 INVALID_STATE`. List archived flows with `GET /v1/flows?lifecycle=archived`. Returns the archived flow.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `flows:write`","security":[{"bearerAuth":["flows:write"]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The flow after the change, as `GET /v1/flows/{id}` returns it, so you don't need to read it again.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"allOf":[{"$ref":"#/components/schemas/FlowDetail"},{"description":"The flow after the change."}]}},"required":["success","data"]}}}},"400":{"description":"Refused: `INVALID_STATE`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/{id}/unarchive":{"post":{"tags":["Flows"],"summary":"Unarchive a flow","description":"Returns an archived flow to the default list. Returns the flow.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `flows:write`","security":[{"bearerAuth":["flows:write"]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The flow after the change, as `GET /v1/flows/{id}` returns it, so you don't need to read it again.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"allOf":[{"$ref":"#/components/schemas/FlowDetail"},{"description":"The flow after the change."}]}},"required":["success","data"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/{id}/chat-assistant":{"patch":{"tags":["Flows"],"summary":"Turn the AI assistant on or off in a flow","description":"Turns the template's AI assistant on or off in this one running flow. Needs manage access to the flow, as in the app. Off stays off when the template's assistant is turned off and on again, and when someone turns it on in running flows. The template's own assistant still decides whether it answers at all, and which assistant answers. A finished flow returns `409 FLOW_NOT_RUNNING`. Read the switch as `chatAssistantEnabled` on `GET /v1/flows/{id}`. Turning it to the state it is already in changes nothing: the answer says `changed: false`.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `flows:write`","security":[{"bearerAuth":["flows:write"]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"}},"required":["enabled"],"additionalProperties":false}}}},"responses":{"200":{"description":"The flow's switch after the call.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."},"data":{"type":"object","properties":{"chatAssistantEnabled":{"type":"boolean","description":"Whether the assistant is on in this flow now."}},"required":["chatAssistantEnabled"],"description":"The flow's switch after the call."},"changed":{"type":"boolean","description":"`true` when this call changed what you asked it to. `false` when that was already so, and the call changed nothing of it."},"message":{"type":"string","description":"Only with `changed: false`: what was already so.","example":"Nothing changed: this person already holds this role."}},"required":["success","data","changed"],"additionalProperties":false}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Refused: `FLOW_NOT_RUNNING`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/{id}/building-blocks":{"post":{"tags":["Flows"],"summary":"Add a building block to a running flow","description":"**Acting as a flow manager.** Adds a published building block to a running flow. The block's steps are added in this save. A new role needs a person (`holderUserId`, a `usr_…` id from List users). An alias names a role of this flow by id. A block that is not published is refused.\n\nThe answer names this insert (`data.insertId`) and the steps it added (`data.stepIds`). Undo uses `insertId`.\n\n**Idempotent.** Send an `Idempotency-Key` header. A retry within 10 minutes returns the same insert and adds nothing again. The key belongs to this flow: the same key on another flow adds that flow's own block.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `flows:write`","security":[{"bearerAuth":["flows:write"]}],"parameters":[{"schema":{"type":"string","description":"The flow."},"required":true,"description":"The flow.","name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":256,"pattern":"^[A-Za-z0-9_\\-:.]+$","description":"An optional key that makes this request safe to retry. Send a new UUID for each request. A key is up to 256 letters, digits, `-`, `_`, `:` or `.`; any other key is refused with `400 INVALID_IDEMPOTENCY_KEY` and nothing runs. A retry with the same key within 10 minutes returns the first response and changes nothing again. After 10 minutes, the same key runs the request again, so use a new key for a late retry. See Idempotency in the Introduction.","example":"6f2c4a5e-3b8d-4c7f-9a1e-2d6b8e0f4c5a"},"required":false,"description":"An optional key that makes this request safe to retry. Send a new UUID for each request. A key is up to 256 letters, digits, `-`, `_`, `:` or `.`; any other key is refused with `400 INVALID_IDEMPOTENCY_KEY` and nothing runs. A retry with the same key within 10 minutes returns the first response and changes nothing again. After 10 minutes, the same key runs the request again, so use a new key for a late retry. See Idempotency in the Introduction.","name":"Idempotency-Key","in":"header"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InsertBuildingBlockRequest"}}}},"responses":{"200":{"description":"The insert that was added.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."},"data":{"type":"object","properties":{"insertId":{"type":"string","description":"This insert. Undo uses it."},"stepIds":{"type":"array","items":{"type":"string"},"description":"The steps this insert added."}},"required":["insertId","stepIds"],"description":"The insert that was added."}},"required":["success","data"],"description":"The insert that was added."}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"410":{"description":"The first result for this `Idempotency-Key` can no longer be returned, because what it created was deleted. Use a new key for the next attempt.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"425":{"description":"A request with this `Idempotency-Key` is still running. Retry after `Retry-After` seconds. If the first request failed with a `5xx`, the key stays held for 10 minutes; to retry sooner, use a new key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"The first result for this `Idempotency-Key` couldn't be checked. Retry with the same key after a short wait. If it keeps happening, contact support with the `requestId`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/{id}/pause":{"post":{"tags":["Flows"],"summary":"Pause a flow","description":"**Acting as a flow manager.** Stops a running flow until someone resumes it. Nothing moves while it is paused: no step completes, reminders and timers wait, and what arrives from connected apps is kept and applied when the flow resumes. `reason` is required; everyone who opens the flow sees it.\n\nA flow that is not running (finished or canceled) returns `400 INVALID_STATE`. A flow that is already paused returns `409 ALREADY_PAUSED` with `error.pauseEpisodeId`. Returns 403 if you don't manage the flow.\n\n**Idempotent.** Send an `Idempotency-Key` header to make retries safe: a retry within 10 minutes returns `{ success: true }` again instead of `409 ALREADY_PAUSED`.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `flows:write`","security":[{"bearerAuth":["flows:write"]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":256,"pattern":"^[A-Za-z0-9_\\-:.]+$","description":"An optional key that makes this request safe to retry. Send a new UUID for each request. A key is up to 256 letters, digits, `-`, `_`, `:` or `.`; any other key is refused with `400 INVALID_IDEMPOTENCY_KEY` and nothing runs. A retry with the same key within 10 minutes returns the first response and changes nothing again. After 10 minutes, the same key runs the request again, so use a new key for a late retry. See Idempotency in the Introduction.","example":"6f2c4a5e-3b8d-4c7f-9a1e-2d6b8e0f4c5a"},"required":false,"description":"An optional key that makes this request safe to retry. Send a new UUID for each request. A key is up to 256 letters, digits, `-`, `_`, `:` or `.`; any other key is refused with `400 INVALID_IDEMPOTENCY_KEY` and nothing runs. A retry with the same key within 10 minutes returns the first response and changes nothing again. After 10 minutes, the same key runs the request again, so use a new key for a late retry. See Idempotency in the Introduction.","name":"Idempotency-Key","in":"header"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PauseFlowRequest"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]}},"required":["success"]}}}},"400":{"description":"Refused: `INVALID_STATE`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Refused: `ALREADY_PAUSED`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"410":{"description":"The first result for this `Idempotency-Key` can no longer be returned, because what it created was deleted. Use a new key for the next attempt.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"425":{"description":"A request with this `Idempotency-Key` is still running. Retry after `Retry-After` seconds. If the first request failed with a `5xx`, the key stays held for 10 minutes; to retry sooner, use a new key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"The first result for this `Idempotency-Key` couldn't be checked. Retry with the same key after a short wait. If it keeps happening, contact support with the `requestId`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/{id}/resume":{"post":{"tags":["Flows"],"summary":"Resume a flow","description":"**Acting as a flow manager.** Starts a paused flow again. Timers and reminders pick up where they stopped, and what arrived from connected apps while it was paused is applied now. No body.\n\nA flow that is not paused returns `409 NOT_PAUSED`. Returns 403 if you don't manage the flow.\n\n**Idempotent.** Send an `Idempotency-Key` header to make retries safe: a retry within 10 minutes returns `{ success: true }` again instead of `409 NOT_PAUSED`.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `flows:write`","security":[{"bearerAuth":["flows:write"]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":256,"pattern":"^[A-Za-z0-9_\\-:.]+$","description":"An optional key that makes this request safe to retry. Send a new UUID for each request. A key is up to 256 letters, digits, `-`, `_`, `:` or `.`; any other key is refused with `400 INVALID_IDEMPOTENCY_KEY` and nothing runs. A retry with the same key within 10 minutes returns the first response and changes nothing again. After 10 minutes, the same key runs the request again, so use a new key for a late retry. See Idempotency in the Introduction.","example":"6f2c4a5e-3b8d-4c7f-9a1e-2d6b8e0f4c5a"},"required":false,"description":"An optional key that makes this request safe to retry. Send a new UUID for each request. A key is up to 256 letters, digits, `-`, `_`, `:` or `.`; any other key is refused with `400 INVALID_IDEMPOTENCY_KEY` and nothing runs. A retry with the same key within 10 minutes returns the first response and changes nothing again. After 10 minutes, the same key runs the request again, so use a new key for a late retry. See Idempotency in the Introduction.","name":"Idempotency-Key","in":"header"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]}},"required":["success"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Refused: `NOT_PAUSED`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"410":{"description":"The first result for this `Idempotency-Key` can no longer be returned, because what it created was deleted. Use a new key for the next attempt.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"425":{"description":"A request with this `Idempotency-Key` is still running. Retry after `Retry-After` seconds. If the first request failed with a `5xx`, the key stays held for 10 minutes; to retry sooner, use a new key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"The first result for this `Idempotency-Key` couldn't be checked. Retry with the same key after a short wait. If it keeps happening, contact support with the `requestId`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/{id}/monitors":{"get":{"tags":["Flows"],"summary":"List a flow's flow monitors","description":"**Acting as a flow manager.** The monitors on this flow: waiting, fired, failed, or turned off. Empty when flow monitors are off for the organization. Returns 403 if you don't manage the flow.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `flows:read`","security":[{"bearerAuth":["flows:read"]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The flow's monitors.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"The call worked."},"data":{"type":"object","properties":{"monitors":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The monitor. The same id it has on the template."},"name":{"type":"string","description":"Its name."},"when":{"type":"string","description":"When it runs, in words."},"actions":{"type":"string","description":"What it does, in words."},"state":{"type":"string","enum":["waiting","fired","failed","turned_off","ended"],"description":"`waiting`: it has not run. `fired`: it ran. `failed`: it ran and an action failed. `turned_off`: a flow manager turned it off for this flow. `ended`: the flow ended before it ran."}},"required":["id","name","when","actions","state"],"description":"One monitor on this flow."},"description":"The monitors on this flow. Empty when flow monitors are off for the organization."}},"required":["monitors"],"description":"The flow's monitors."}},"required":["success","data"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/{id}/monitors/{monitorId}/turn-off":{"post":{"tags":["Flows"],"summary":"Turn off a flow monitor","description":"**Acting as a flow manager.** Turns this monitor off for this flow only. It cannot be turned back on. A monitor that already fired returns `409 ALREADY_FIRED`. One that is not waiting returns `400`. Flow monitors off for the organization returns `403 FEATURE_DISABLED`.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `flows:write`","security":[{"bearerAuth":["flows:write"]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":true,"name":"monitorId","in":"path"}],"responses":{"200":{"description":"The monitor is off for this flow.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"The monitor is off for this flow. It stays on the template for new flows."}},"required":["success"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Refused: `ALREADY_FIRED`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/{id}/roles/{roleId}/assign":{"post":{"tags":["Flows"],"summary":"Assign a role","description":"Gives a role on the flow to a user. The `roleId` comes from `roles[]` on `GET /v1/flows/{id}`, which lists every role on the template, including unassigned ones. Name the person with exactly one of `uniqueId`, `userId` or `email`. They replace whoever held the role, and are notified. Naming the person who already holds it changes nothing: the answer says `changed: false`.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `flows:write`","security":[{"bearerAuth":["flows:write"]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":true,"name":"roleId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssignRoleRequest"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."},"changed":{"type":"boolean","description":"`true` when this call changed what you asked it to. `false` when that was already so, and the call changed nothing of it."},"message":{"type":"string","description":"Only with `changed: false`: what was already so.","example":"Nothing changed: this person already holds this role."}},"required":["success","changed"],"additionalProperties":false}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/{id}/members":{"post":{"tags":["Flows"],"summary":"Add a member","description":"Adds a user to the flow. Name the user with exactly one of `uniqueId`, `userId` or `email`. The body decides what access they get:\n\n- `{userId}`: viewer (read-only)\n- `{userId, roles:[...]}`: participant in those roles (they do the assigned work)\n- `{userId, access:\"manager\"}`: flow manager (full control)\n\n`role` is accepted as another name for `access`.\n\nAdds one member per call. If the user is already on the flow, the request returns 409: remove them first with `/members/remove`, then add them back with the new access.\n\n**The person must already be a user in your organization.** An `email` that matches nobody returns `USER_NOT_FOUND` instead of inviting anyone. Create new people with `POST /v1/users` first.\n\n**Idempotent.** Send an `Idempotency-Key` header to make retries safe: a retry within 10 minutes returns the same response, without adding the member twice or sending notifications again.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `flows:write`","security":[{"bearerAuth":["flows:write"]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":256,"pattern":"^[A-Za-z0-9_\\-:.]+$","description":"An optional key that makes this request safe to retry. Send a new UUID for each request. A key is up to 256 letters, digits, `-`, `_`, `:` or `.`; any other key is refused with `400 INVALID_IDEMPOTENCY_KEY` and nothing runs. A retry with the same key within 10 minutes returns the first response and changes nothing again. After 10 minutes, the same key runs the request again, so use a new key for a late retry. See Idempotency in the Introduction.","example":"6f2c4a5e-3b8d-4c7f-9a1e-2d6b8e0f4c5a"},"required":false,"description":"An optional key that makes this request safe to retry. Send a new UUID for each request. A key is up to 256 letters, digits, `-`, `_`, `:` or `.`; any other key is refused with `400 INVALID_IDEMPOTENCY_KEY` and nothing runs. A retry with the same key within 10 minutes returns the first response and changes nothing again. After 10 minutes, the same key runs the request again, so use a new key for a late retry. See Idempotency in the Introduction.","name":"Idempotency-Key","in":"header"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddMemberRequest"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]}},"required":["success"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict: the request can't be applied to the resource as it is now. `error.code` says why.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"410":{"description":"The first result for this `Idempotency-Key` can no longer be returned, because what it created was deleted. Use a new key for the next attempt.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"425":{"description":"A request with this `Idempotency-Key` is still running. Retry after `Retry-After` seconds. If the first request failed with a `5xx`, the key stays held for 10 minutes; to retry sooner, use a new key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"The first result for this `Idempotency-Key` couldn't be checked. Retry with the same key after a short wait. If it keeps happening, contact support with the `requestId`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/{id}/members/remove":{"post":{"tags":["Flows"],"summary":"Remove a member","description":"Removes a user from the flow in one call: their flow manager or viewer access and every role they hold. Name the user with exactly one of `uniqueId`, `userId` or `email`.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `flows:write`","security":[{"bearerAuth":["flows:write"]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RemoveMemberRequest"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]}},"required":["success"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/{id}/summary":{"get":{"tags":["Flows"],"summary":"Get the AI summary of a flow","description":"Returns an AI-written summary of the flow. For a completed flow, it covers the outcome, key decisions and timeline. For a flow in progress, it says what is done, what is blocked and what comes next. For a canceled flow, or one that ended another way, `data` is `null`. When the AI can't write the summary, the call returns `503 AI_UNAVAILABLE` with `Retry-After`: try again.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `flows:read`","security":[{"bearerAuth":["flows:read"]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The summary.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"anyOf":[{"type":"object","properties":{"summary":{"type":"string","description":"The summary text: an overview of a completed flow, or the current status of a flow in progress."},"generatedAt":{"type":"string","format":"date-time","description":"When this summary was generated (ISO 8601)."},"keyDecisions":{"type":"array","items":{"type":"string"},"description":"Key decisions or outcomes (completed flows only)."},"timeline":{"type":"array","items":{"type":"object","properties":{"step":{"type":"string"},"completedAt":{"type":"string"},"outcome":{"type":"string"}},"required":["step","completedAt","outcome"]},"description":"Step-by-step timeline (completed flows only)."},"stale":{"type":"boolean","enum":[true],"description":"Present when the flow moved on after this text was written. The recent text is returned at once while a new version is written; call again later for it. Flows in progress only."},"retryAfterMs":{"type":"integer","exclusiveMinimum":0,"description":"With `stale`, when a new version is already being written: how many milliseconds to wait before calling again. Calling sooner returns the same text."},"notDoubleChecked":{"type":"boolean","enum":[true],"description":"Present when this text could not be checked against the flow's records before it was returned. The text is still the AI's answer; the next version that is checked comes without it."}},"required":["summary","generatedAt"]},{"type":"null"}],"description":"The summary, or `null` for a flow that ended without completing."}},"required":["success","data"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"The AI could not answer just now (`AI_UNAVAILABLE`), and nothing was saved. Usually `error.retryable` is `true`: try again after the number of seconds in `Retry-After`. When `error.retryable` is `false` (there is no `Retry-After`), a retry will not help until the AI account is fixed on the Moxo side: contact support with the `requestId`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/{id}/audit-log":{"get":{"tags":["Flows"],"summary":"Get flow audit trail","description":"Returns what happened on the flow, newest first: who did what, and when. By default this is the flow's activity, as Moxo shows it: steps started and finished, decisions, files, notes, and every change a person made to the running flow (adding, editing, moving or removing a step, pausing and resuming, giving a step to someone, adding a member, changing who holds a role, the flow's settings), each naming what changed. The structural changes reach the flow's managers only; everyone on the flow reads pauses and resumes. Work the system does on its own, such as filling a role when the flow starts, is not on it.\n\n**The full record.** `surface=audit` returns every recorded event instead, the system's own work included (opening links, notifications, reminders, the engine's bookkeeping). Only the flow's managers can read it (`403` otherwise).\n\nPage with `cursor`: pass `nextCursor` back until it is `null`.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `flows:read`","security":[{"bearerAuth":["flows:read"]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","enum":["activity","audit"],"description":"`activity` (default): the flow's activity, as Moxo shows it. `audit`: every recorded event, for the flow's managers."},"required":false,"description":"`activity` (default): the flow's activity, as Moxo shows it. `audit`: every recorded event, for the flow's managers.","name":"surface","in":"query"},{"schema":{"type":"string","description":"Only what happened on this step run (`steps[].id`)."},"required":false,"description":"Only what happened on this step run (`steps[].id`).","name":"stepExecutionId","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":200,"description":"Entries per page, 1 to 200. Default 50."},"required":false,"description":"Entries per page, 1 to 200. Default 50.","name":"limit","in":"query"},{"schema":{"type":"string","description":"The `nextCursor` of the previous page."},"required":false,"description":"The `nextCursor` of the previous page.","name":"cursor","in":"query"}],"responses":{"200":{"description":"The audit entries.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The entry's id."},"action":{"type":"string"},"eventType":{"type":["string","null"],"description":"What happened, as a stable name your code can match (for example `step.completed`). `null` on older entries."},"stepExecutionId":{"type":["string","null"],"description":"The step run this is about (`steps[].id`), or `null` when it is about the flow."},"actorEmail":{"type":["string","null"]},"actorName":{"type":["string","null"]},"details":{"type":["object","null"],"additionalProperties":{}},"createdAt":{"type":"string","format":"date-time"}},"required":["id","action","eventType","stepExecutionId","actorEmail","actorName","details","createdAt"],"additionalProperties":false}},"nextCursor":{"type":["string","null"],"description":"Pass as `cursor` for the next page. `null` on the last page."}},"required":["success","data","nextCursor"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/bulk-remind":{"post":{"tags":["Flows"],"summary":"Send bulk reminders","description":"Reminds everyone each flow is waiting on, as **Remind** does on the flows list in the app: every person assigned to a step that is open now, whether or not it is overdue. Up to 50 flows per call; you need to be able to manage each flow.\n\nThere is no overdue-only mode, as there is none in the app. To remind only the flows that are late, list them first with `GET /v1/flows?health=overdue` and send those ids.\n\n`results` answers each id, in the order you sent them: `reminded` (with how many steps), `not_found` (no such flow in your organization, or one you can't see), `no_access` (you can see it but can't manage it, whatever its state), `finished` or `paused` (nothing is waiting), `held` (an action reminded in the last 24 hours; this hold applies to a person signed in to the app, not to a token, and `availableAt` says when), `nothing_to_remind` (open, but no one to remind now) or `failed`.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `flows:write`","security":[{"bearerAuth":["flows:write"]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"flowIds":{"type":"array","items":{"type":"string"},"maxItems":50,"description":"The flows to send reminders for, up to 50."}},"required":["flowIds"]}}}},"responses":{"200":{"description":"What happened to each flow.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"remindedCount":{"type":"number","description":"Steps reminded, across every flow."},"skippedNoAccess":{"type":"number","description":"How many flows you can see but can't manage (`no_access` in `results`)."},"results":{"type":"array","items":{"type":"object","properties":{"flowId":{"type":"string","description":"The id you sent."},"outcome":{"type":"string","enum":["reminded","not_found","no_access","finished","paused","held","nothing_to_remind","failed"],"description":"What happened to this flow; the description above says what each means."},"remindedCount":{"type":"number","description":"Steps reminded in this flow; `0` unless `reminded`."},"availableAt":{"type":"string","format":"date-time","description":"Only for `held`: when this flow can be reminded again."}},"required":["flowId","outcome","remindedCount"],"additionalProperties":false},"description":"One entry per id you sent, in the same order."},"held":{"type":"array","items":{"type":"object","properties":{"flowId":{"type":"string","description":"A flow that was held."},"availableAt":{"type":"string","format":"date-time","description":"When it can be reminded again."}},"required":["flowId","availableAt"],"additionalProperties":false},"description":"The `held` flows again, as before `results`. Left out when none was held."}},"required":["remindedCount","skippedNoAccess","results"],"additionalProperties":false}},"required":["success","data"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/templates/{templateId}/flows/bulk":{"post":{"tags":["Flows"],"summary":"Bulk start flows","description":"Starts many flows from one template in one background job, one flow per recipient. Use `bulkRoleId` and `recipients[]` to give one role to many people, each in their own flow, and `sharedRoleAssignments` for roles that are the same in every flow. Returns a `jobId`; poll `GET /v1/bulk-start-jobs/{jobId}` for progress.\n\nAs for a single start, permission comes first: a caller who may not run the template gets `403`. A draft or archived template, or one with no steps, returns `400 INVALID_STATE`. A person listed more than once (the same `userId`, the same email in any letter case, or a `userId` and the email of that same person) returns `400 VALIDATION_FAILED` naming them, and nothing starts: each recipient gets one flow.\n\n**Idempotent.** Send an `Idempotency-Key` header to make retries safe: a retry within 10 minutes returns the same job id and starts no second job. See Idempotency in the Introduction.\n\n**Products.** An organization without the Flow product can't start new flows: the response is `403 FEATURE_DISABLED` with `error.feature: \"haiFlow\"`. Flows already running carry on.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `flows:write`","security":[{"bearerAuth":["flows:write"]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"templateId","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":256,"pattern":"^[A-Za-z0-9_\\-:.]+$","description":"An optional key that makes this request safe to retry. Send a new UUID for each request. A key is up to 256 letters, digits, `-`, `_`, `:` or `.`; any other key is refused with `400 INVALID_IDEMPOTENCY_KEY` and nothing runs. A retry with the same key within 10 minutes returns the first response and changes nothing again. After 10 minutes, the same key runs the request again, so use a new key for a late retry. See Idempotency in the Introduction.","example":"6f2c4a5e-3b8d-4c7f-9a1e-2d6b8e0f4c5a"},"required":false,"description":"An optional key that makes this request safe to retry. Send a new UUID for each request. A key is up to 256 letters, digits, `-`, `_`, `:` or `.`; any other key is refused with `400 INVALID_IDEMPOTENCY_KEY` and nothing runs. A retry with the same key within 10 minutes returns the first response and changes nothing again. After 10 minutes, the same key runs the request again, so use a new key for a late retry. See Idempotency in the Introduction.","name":"Idempotency-Key","in":"header"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkStartFlowsRequest"}}}},"responses":{"202":{"description":"The job was accepted and runs in the background. Poll `GET /v1/bulk-start-jobs/{jobId}` until it finishes.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"jobId":{"type":"string"},"status":{"type":"string"},"totalCount":{"type":"number"}},"required":["jobId","status","totalCount"]}},"required":["success","data"]}}}},"400":{"description":"Refused: `INVALID_STATE`, `VALIDATION_FAILED`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"410":{"description":"The first result for this `Idempotency-Key` can no longer be returned, because what it created was deleted. Use a new key for the next attempt.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"425":{"description":"A request with this `Idempotency-Key` is still running. Retry after `Retry-After` seconds. If the first request failed with a `5xx`, the key stays held for 10 minutes; to retry sooner, use a new key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"The first result for this `Idempotency-Key` couldn't be checked. Retry with the same key after a short wait. If it keeps happening, contact support with the `requestId`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/bulk-start-jobs/{jobId}":{"get":{"tags":["Flows"],"summary":"Get a bulk start job","description":"Returns the progress and results of a bulk start job: what succeeded, what failed and which flows were started.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `flows:read`","security":[{"bearerAuth":["flows:read"]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"jobId","in":"path"}],"responses":{"200":{"description":"The job.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["PENDING","IN_PROGRESS","COMPLETED","FAILED"]},"totalCount":{"type":"number"},"completedCount":{"type":"number"},"failedCount":{"type":"number"},"results":{"type":["object","null"],"properties":{"succeeded":{"type":"array","items":{"type":"object","properties":{"flowId":{"type":"string"},"name":{"type":"string"},"userId":{"type":"string"}},"required":["flowId","name","userId"]}},"failed":{"type":"array","items":{"type":"object","properties":{"userId":{"type":["string","null"]},"email":{"type":["string","null"]},"name":{"type":"string","description":"The person's name in your organization, or their email when they have no name. \"Unknown\" when they are no longer in your organization."},"error":{"type":"string"}},"required":["userId","email","error"]}}},"required":["succeeded","failed"]}},"required":["id","status","totalCount","completedCount","failedCount","results"]}},"required":["success","data"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/{id}/export":{"get":{"tags":["Flows"],"summary":"Export a flow as a ZIP file","description":"Downloads the flow's data and attachments as a ZIP file, for records, compliance or moving them to another system. The file holds the flow's activity log, so it needs the permission to see the audit trail (`audit:read` for an organization API key) and to manage the flow.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `flows:read` and `audit:read`","security":[{"bearerAuth":["flows:read","audit:read"]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The ZIP file."},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/{id}/steps/{stepId}":{"get":{"tags":["Steps"],"summary":"Get step","description":"Returns one step with its assignees, current state and result data, plus a `flow` block with context. `stepId` takes the execution id or the template step id of any step that has started, inside branches and paths too. A template step id with more than one run in the flow (the rounds of a For each, or a repeated step) returns `409 AMBIGUOUS_STEP` with the runs’ ids; send one of them.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `flows:read`","security":[{"bearerAuth":["flows:read"]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","description":"The step to act on. Takes either id from `GET /v1/flows/{id}`: `steps[].stepId`, which names the step on the flow and exists before it starts, or `steps[].id`, which names one run of it. A step that hasn't started (listed only inside `steps[].paths[]`) returns `404`. Its id still works as `afterStepId` on Add a step. A bare step id is accepted only while exactly one run has it; once a step has more than one run, it returns `409 AMBIGUOUS_STEP` with the runs' ids in `error.runIds`.","example":"step-2"},"required":true,"description":"The step to act on. Takes either id from `GET /v1/flows/{id}`: `steps[].stepId`, which names the step on the flow and exists before it starts, or `steps[].id`, which names one run of it. A step that hasn't started (listed only inside `steps[].paths[]`) returns `404`. Its id still works as `afterStepId` on Add a step. A bare step id is accepted only while exactly one run has it; once a step has more than one run, it returns `409 AMBIGUOUS_STEP` with the runs' ids in `error.runIds`.","name":"stepId","in":"path"}],"responses":{"200":{"description":"The step.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/StepDetail"}},"required":["success","data"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Refused: `AMBIGUOUS_STEP`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"tags":["Steps"],"summary":"Edit a step (manager)","description":"**Acting as a flow manager.** Changes a step that hasn't finished, including one that has started. Send any of `name`, `description`, `dueAt` or `stepDue`, `config` and `signers`. Before the step starts, you can also change who it is for: `assignee` gives it to one person (`null` gives it back to its roles), or `roleIds` gives it to roles. These are the changes the step editor in Moxo makes, with the same checks.\n\n**Settings (`config`).** Read them first with Get step settings, then send only what changes, with the same keys. Moxo changes the settings of these step types on a running flow: to-dos, forms, questionnaires, file requests, checklists, web apps, custom actions, e-signatures, acknowledgements, decisions, approvals, polls and PDF forms until the person doing the step submits it; document reviews and document collaborations until the step starts (`editable` in Get step settings). What the step asks changes until the first answer (`locks.content.until`; `locks` says what is locked now and why). Another step type returns `400 STEP_SETTINGS_NOT_EDITABLE`, and a step past its window returns `400 STEP_NOT_EDITABLE`. The step's document changes with Replace a step's document (`POST /v1/flows/{id}/steps/{stepId}/document`): a different document in `config` returns `400 DOCUMENT_REPLACE_REQUIRED`. When the step starts (`skipSequentialOrder`, `dependsOnStepIds`) can't change once it has started (`409 EXECUTION_ORDER_STARTED`). The rules Moxo keeps on a running step apply: a decision keeps at least 2 options, an acknowledgement someone gave can't change (`400 ACK_ALREADY_ACKNOWLEDGED`), and an e-signature can't change once anyone has signed (`400 ESIGN_ALREADY_SIGNED`); before then, a change to its fields or signers sends the signers new links. Once someone has answered, what was asked is fixed: an approval someone decided (its description too), a poll someone voted in, a file request, checklist or to-do someone finished (`409 STEP_ALREADY_ANSWERED`, `error.details.lockReason` says why), and a form, questionnaire or PDF form someone answered or saved a draft of, even when it was sent to several people (`400 FORM_QUESTIONS_LOCKED`). A poll's voter names can still be hidden after a vote. Whether anyone or everyone must answer is fixed once someone responded (`409 COMPLETION_MODE_LOCKED`), and an e-signature's document and fields once a preparer placed the fields (`409 ESIGN_PREPARER_PLACED`). AI help is fixed at send: turning Assist on or off, its agent and what it may read of earlier steps, AI preparation, Advise and Rename files (`config.aiRename`: on or off, AI naming or a naming pattern, and its wording) (`400 LIVE_AI_NOT_EDITABLE`, `error.details.lockReason` is `ai_set_at_send`), and who prepares once the step has started (`400 LIVE_PREPARERS_STARTED`, `error.details.lockReason` is `set_at_send`). AI Review, as on a sent action: an AI reviewer can be added, its agent swapped or the AI swapped out for a person until the step is in review; on a step with several live runs (a For each's items) until any of them is in review or renaming its files. Each live run's reviewer seats then follow, and a finished run keeps its own. After that it returns `400 STEP_NOT_EDITABLE` (`error.details.lockReason` is `under_review`). Switching Review off while the reviewer is AI returns `400 LIVE_AI_NOT_EDITABLE` (`error.details.settings` is `[\"ai_review\"]`). Both list what the save changed in `error.details.settings`, by the names `locks.aiHelp` uses (`prepare`, `preparers`, `assist_switch`, `assist_agent`, `assist_grants`, `advise`, `ai_review`, `ai_rename`). What Assist knows and how it answers still change. A file Assist reads (`config.assist.faqFiles`) must be a file of your organization (`400 ACTION_ASSIST_FILE_NOT_IN_ORG`) and either one the step's Assist already reads or an upload of the token's person (`409 ACTION_ASSIST_FILE_UNAVAILABLE`). A poll has no Anyone or Everyone to set (`400 COMPLETION_MODE_NOT_ALLOWED`). The name, due date and reminders always change, also when the save sends the unchanged settings with them, and the reminders also when they are sent in `config` (`config.customReminders`). A change to what a to-do, acknowledgement, approval or decision asks takes back the one-tap buttons in the email its people have and sends them new ones; a change to what is signed sends the signers new links. `effects` says how many people were sent one. Two saves at once are applied in turn, the later one setting what it sends.\n\n**A started step keeps its assignees here.** Sending `assignee` or `roleIds` for a step that has started returns `409 STEP_STARTED`, unless it started with nobody on it and is waiting for someone: it can still be given its first assignee. Use Reassign a step instead: it gives a person's part to someone else, adds a person beside the current assignees (`addSeat`) or takes one off (`unassign`).\n\n**Refusals.** A finished step returns `400 INVALID_STATE` (`error.details.lockReason` is `finished`; `locks.content` in Get step settings says the same). A due date that has already passed returns `400 DUE_DATE_IN_PAST`. A role id that names no role of this flow returns `404 ROLE_NOT_FOUND`; an e-sign, DocuSign, Adobe Sign or document collaboration step returns `400 ROLE_ASSIGNMENT_NOT_SUPPORTED` for `roleIds`; a step type whose settings Moxo doesn't edit on a running flow (identity verification, an automation) returns `400 ASSIGNMENT_NOT_SUPPORTED` for either: use Reassign. An organization API key counts as a flow manager. Without flow manager access, the call returns 403, and for a flow outside your organization, 404.\n\nReturns the edited step in the shape Get step returns.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `flows:write`","security":[{"bearerAuth":["flows:write"]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","description":"The step to act on. Takes either id from `GET /v1/flows/{id}`: `steps[].stepId`, which names the step on the flow and exists before it starts, or `steps[].id`, which names one run of it. A bare step id means the run in progress; while more than one run is open, the call returns `409 AMBIGUOUS_STEP` instead of guessing.","example":"step-2"},"required":true,"description":"The step to act on. Takes either id from `GET /v1/flows/{id}`: `steps[].stepId`, which names the step on the flow and exists before it starts, or `steps[].id`, which names one run of it. A bare step id means the run in progress; while more than one run is open, the call returns `409 AMBIGUOUS_STEP` instead of guessing.","name":"stepId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EditStepRequest"}}}},"responses":{"200":{"description":"The edited step.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"allOf":[{"$ref":"#/components/schemas/StepDetail"},{"description":"The edited step, as Get a step shows it to you. Absent only when you can no longer see the step after the edit."}]},"effects":{"allOf":[{"$ref":"#/components/schemas/StepEditEffects"},{"description":"How many people this save sent a new link."}]}},"required":["success","effects"]}}}},"400":{"description":"Refused: `ACK_ALREADY_ACKNOWLEDGED`, `ACTION_ASSIST_FILE_NOT_IN_ORG`, `ASSIGNMENT_NOT_SUPPORTED`, `COMPLETION_MODE_NOT_ALLOWED`, `DOCUMENT_REPLACE_REQUIRED`, `DUE_DATE_IN_PAST`, `ESIGN_ALREADY_SIGNED`, `FORM_QUESTIONS_LOCKED`, `INVALID_STATE`, `LIVE_AI_NOT_EDITABLE`, `LIVE_PREPARERS_STARTED`, `ROLE_ASSIGNMENT_NOT_SUPPORTED`, `STEP_NOT_EDITABLE`, `STEP_SETTINGS_NOT_EDITABLE`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Refused: `ACTION_ASSIST_FILE_UNAVAILABLE`, `COMPLETION_MODE_LOCKED`, `ESIGN_PREPARER_PLACED`, `EXECUTION_ORDER_STARTED`, `STEP_ALREADY_ANSWERED`, `STEP_STARTED`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"tags":["Steps"],"summary":"Remove a step (manager)","description":"**Acting as a flow manager.** Takes a step that hasn't finished off a running flow, as Remove on a step does in Moxo.\n\n**What stays.** A step added to this flow (Add a step) at the top level that the flow hasn't reached yet (its status is still `PENDING`) is deleted: `outcome: \"deleted\"`. Any other step (one from the template, one the flow has reached, even if nobody has acted on it yet, or one added inside a branch path, as in Moxo) stays in the flow's steps as `SKIPPED` (\"Removed by owner\"), and the flow moves on past it: `outcome: \"skipped\"`. A failed automation step can be removed the same way, which lets the flow go on. Links already sent for the step stop working.\n\n**Reason.** The body is optional. Send `{ \"reason\": \"...\" }` (1 to 5000 characters) to say why: the audit trail keeps it with the removal.\n\n**Refusals.** A finished step returns `400 INVALID_STATE`. While the flow is paused, only a step that hasn't started can be removed: removing the step it is on would move it forward (`409 FLOW_PAUSED`). The person a review is about can't remove that step (`403 OWN_REVIEW`). Removing a waiting e-signature or PDF form step on a path while its document is being changed returns `503 SIGNING_BUSY`: try again. An organization API key counts as a flow manager. Without flow manager access, the call returns 403, and for a flow outside your organization, 404.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `flows:write`","security":[{"bearerAuth":["flows:write"]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","description":"The step to act on. Takes either id from `GET /v1/flows/{id}`: `steps[].stepId`, which names the step on the flow and exists before it starts, or `steps[].id`, which names one run of it. A bare step id means the run in progress; while more than one run is open, the call returns `409 AMBIGUOUS_STEP` instead of guessing.","example":"step-2"},"required":true,"description":"The step to act on. Takes either id from `GET /v1/flows/{id}`: `steps[].stepId`, which names the step on the flow and exists before it starts, or `steps[].id`, which names one run of it. A bare step id means the run in progress; while more than one run is open, the call returns `409 AMBIGUOUS_STEP` instead of guessing.","name":"stepId","in":"path"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RemoveStepRequest"}}}},"responses":{"200":{"description":"The step is removed.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/RemovedStep"}},"required":["success","data"]}}}},"400":{"description":"Refused: `INVALID_STATE`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Refused: `FLOW_PAUSED`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Refused: `SIGNING_BUSY`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/{id}/steps":{"post":{"tags":["Steps"],"summary":"Add a step to a running flow","description":"**Acting as a flow manager.** Adds one new step to a running flow.\n\n**Where it goes, and what it waits for.** To make the step wait for another step, place it after that step with `afterStepId`. It starts when that step is done, like every step in the flow. `config.dependsOnStepIds` is different: the step may start sooner, once these are done, even while the step before it is still open. It never makes the step wait longer, so a step listed there that comes after this one's place is refused.\n\nSend `type` and `name`. Everything else is optional. The step is added at the end unless you send `afterStepId` (`steps[].stepId` or `steps[].id` from `GET /v1/flows/{id}`). An id that names no step of this flow returns `404`, so a typo never adds the step at the end. `afterStepId` can also name a step inside a path. On a path that is running, the new step goes immediately after that step, which has to be the last action that has started or a later action that has not, and the path has to still be open. A finished path, a path the flow didn't take, a Decision that has started and not been answered, a path of a Decision the flow did not take, an approval that has started, an anchor before the last action that has started, or a path nested more than one level deep returns `409 PATH_CLOSED`. On the path a Decision chose, while that path is still open, the new step goes after the last action that has started, the same as on an open parallel path, including a Decision inside a parallel branch, a single choice branch, or a multi choice branch. A repeating section can't be used as `afterStepId`.\n\n**A path that hasn't started.** In a branch, decision or approval that hasn't started yet, the step goes into the path wherever you name, as Edit process places it in Moxo. Its path has no runs yet, so the step has none either: the response has `started: false`, `id: null` and `status: null`, and the step gets its run when its path starts. Its assignees can be roles or people: a person is kept as a role that always goes to them, by the same rule as below. It goes live as an Edit process change does, with the same checks (`422`).\n\n**A branch.** `type: \"PARALLEL_BRANCH\"` with `paths` adds a branch whose paths all start together when the flow reaches it; the step after it waits for every path. Each path has a `name` and its `steps`: steps of the eight types below, or a sub-flow (`subFlow` with `start: \"later\"`). The branch goes at the top level of the flow, before or after a step the flow hasn't reached, and goes live as an Edit process change does: a place in front of a step that has started returns `422 STRAND`, an anchor inside a path `400 VALIDATION_FAILED`. `paths[].steps` in the response lists each step's `stepId`. A path can't be added to a branch that has already started.\n\n**A sub-flow on a running path.** `subFlow` with `start: \"later\"` and an `afterStepId` naming the last action that has started on a running path, or a later action that has not: the sub-flow starts when the step before it is done, and the step after the branch waits for it. A decision or approval can't join a running path.\n\n**Before a step.** `beforeStepId` (not with `afterStepId`) puts the new step right before a top-level step instead, as Edit process does in Moxo. That step must not have started, and the flow must not have moved past it; otherwise the call returns `409 INSERT_BEFORE_STARTED_STEP` and adds nothing, instead of placing the step somewhere else. An id that names no top-level step returns `404`.\n\n**Assignee.** Prefer `assignees`: each entry is exactly one of `{ \"uniqueId\" }`, `{ \"userId\" }`, `{ \"email\" }`, or `{ \"roleId\" }`. A `uniqueId` must already belong to someone in your organization. An email no one in your organization has adds that person as an external user, which needs the right to add external users (`external_users:write`). A role id comes from `roles[].id` on `GET /v1/flows/{id}`. One person is a list of one. With two or more people, set `completion` to `{ \"mode\": \"ONE\" }` or `{ \"mode\": \"ALL\" }` (an older flat `completionMode` is still read as it). A deactivated person, an AI agent or a service account is refused. Leave it out to leave the step unassigned.\n\n**Preparers and reviewers.** Optional `preparers` and `reviewers` name people the same way, under `people`, each with an optional `completionMode` (`ONE`: any one person; `ALL`: everyone). Preparers go on `FORM`, `TODO`, `APPROVAL`, `FILE_REQUEST`, `ACKNOWLEDGEMENT`, `DECISION`, `QUESTIONNAIRE` and `CHECKLIST`; reviewers on `FORM`, `FILE_REQUEST` and `QUESTIONNAIRE`. On any other type, either returns `400 VALIDATION_FAILED` naming it.\n\n**The two ids in the response.** `data.id` is this run of the step (also `steps[].id` on Get flow). `data.stepId` is the step on the flow (also `steps[].stepId`). Complete, Decline, Get step, Skip, Reassign, Remind, and Reopen accept either id. Prefer `stepId` as `afterStepId` when you add another step later. `placement` says where the step landed (`reanchored` is true when the requested spot had to move forward).\n\n**Paused, finished, canceled, removed.** A paused flow can take a new step, except one placed before the step the flow is on (`409 FLOW_PAUSED_INSERT_BEFORE_CURRENT`). A finished flow returns `400 INVALID_STATE` unless you send `continueIfCompleted: true`, which continues the flow and then adds the step (`flowReopened: true` on the response). That doesn't continue a flow that was removed (`404`), an organization that is paused (`402 ORG_FROZEN`) or a finished one-off action (`409 ACTION_ENDED`: send a new action instead). A canceled flow returns `403 FLOW_CANCELLED`. A flow that was removed returns `404`.\n\n**Retries.** Send an `Idempotency-Key` (a new UUID). A retry within 10 minutes returns this response again and adds no second step.\n\n**Not on this endpoint.** Inserting inside a repeating section, a For each or another branch inside a path, a new path on an existing branch, and copying a step from a template. Edit a step with `PATCH /v1/flows/{id}/steps/{stepId}`, remove one with `DELETE /v1/flows/{id}/steps/{stepId}`, and reorder with `POST /v1/flows/{id}/steps/{stepId}/move`.\n\n**Step types.** `FORM`, `TODO`, `APPROVAL`, `FILE_REQUEST`, `ACKNOWLEDGEMENT`, `DECISION`, `QUESTIONNAIRE`, `CHECKLIST`. Anything else, including a signature step, is refused. A decision or approval added here is one step and cannot contain other steps (`400 NESTED_STEPS_NOT_ALLOWED`).\n\n**Why only these eight.** They are work a person does, so adding one to work already under way changes nothing else in the flow. Automations (REST API, Code, Wait, AI actions, sending email, updating data) and the rest of the logic (loops, jumps, choice branches) are different: they act on their own, read earlier answers and connections that the publish checks prove exist, and logic changes the route a running flow has already planned. Dropping one into a live flow would skip those checks. Build them into the template instead: author or change it (`POST /v1/ai/generations`, including `mode: \"edit\"`, or the template builder), publish it, and every flow started afterwards runs them. `GET /v1/templates/{id}` describes each step type's settings.\n\n### Shared `config` keys\n\nThese work on every type below when the step supports them:\n\n- `stepDue`: when the step is due. Relative: `{ \"type\": \"RELATIVE\", \"value\": 3, \"unit\": \"DAYS\", \"dayType\": \"calendar\" }`. Fixed: `{ \"type\": \"FIXED\", \"date\": \"2026-10-20\" }`. Units: `MINUTES`, `HOURS`, `DAYS`, `WEEKS`.\n- `skipSequentialOrder`: `true` starts this step with the previous one when your plan includes Start without waiting.\n- `dependsOnStepIds`: `steps[].stepId` values from `GET /v1/flows/{id}`. The step may start sooner, once these steps are done, even while the step before it is still open. It never makes the step wait longer: to make it wait for a task, use `afterStepId`. Needs the same plan feature as `skipSequentialOrder`, and not with it.\n- `attachments`: reference materials already in Moxo, or a web link: `{ \"kind\": \"link\", \"url\": \"https://example.com/checklist.pdf\", \"title\": \"Checklist\" }`. Uploading a new file is a second call to Upload an attachment to a step.\n\n### Examples by step type\n\n#### To-do (`TODO`)\n\n```json\n{\n  \"type\": \"TODO\",\n  \"name\": \"Call the client\",\n  \"description\": \"Confirm the wire instructions before we fund.\",\n  \"assignees\": [{ \"userId\": \"usr_123\" }],\n  \"afterStepId\": \"s-kickoff\",\n  \"reason\": \"Ops asked for a phone confirm.\",\n  \"config\": {\n    \"stepDue\": { \"type\": \"RELATIVE\", \"value\": 1, \"unit\": \"DAYS\", \"dayType\": \"business\" }\n  }\n}\n```\n\n#### File request (`FILE_REQUEST`)\n\n```json\n{\n  \"type\": \"FILE_REQUEST\",\n  \"name\": \"Additional documents\",\n  \"description\": \"Upload your last two business bank statements.\",\n  \"assignees\": [{ \"userId\": \"usr_123\" }],\n  \"config\": {\n    \"fileRequest\": {\n      \"maxFiles\": 3,\n      \"maxFileSizeMB\": 25,\n      \"instructions\": \"PDF preferred\"\n    },\n    \"stepDue\": { \"type\": \"RELATIVE\", \"value\": 3, \"unit\": \"DAYS\", \"dayType\": \"calendar\" },\n    \"attachments\": [\n      {\n        \"kind\": \"link\",\n        \"url\": \"https://example.com/document-checklist.pdf\",\n        \"title\": \"Document checklist\"\n      }\n    ]\n  }\n}\n```\n\n`fileRequest.maxFiles` is 1 to 50 (default 5). `maxFileSizeMB` is 1 to 100.\n\n#### Form (`FORM`)\n\n```json\n{\n  \"type\": \"FORM\",\n  \"name\": \"Client details\",\n  \"assignees\": [{ \"userId\": \"usr_123\" }],\n  \"config\": {\n    \"formFields\": [\n      {\n        \"key\": \"legal_name\",\n        \"label\": \"Legal name\",\n        \"type\": \"TEXT_SINGLE_LINE\",\n        \"required\": true\n      },\n      {\n        \"key\": \"entity_type\",\n        \"label\": \"Entity type\",\n        \"type\": \"DROPDOWN\",\n        \"required\": true,\n        \"options\": [\n          { \"label\": \"LLC\", \"value\": \"llc\" },\n          { \"label\": \"Corporation\", \"value\": \"corporation\" },\n          { \"label\": \"Partnership\", \"value\": \"partnership\" }\n        ]\n      },\n      {\n        \"key\": \"incorporation_date\",\n        \"label\": \"Date of incorporation\",\n        \"type\": \"DATE\"\n      }\n    ]\n  }\n}\n```\n\nCommon field `type` values: `TEXT_SINGLE_LINE`, `TEXT_MULTI_LINE`, `EMAIL`, `PHONE`, `NUMBER`, `DATE`, `DROPDOWN`, `MULTI_SELECT`, `YES_NO`, `FILE_UPLOAD`, `HEADING`, `PAGE_BREAK`. Give each field a stable `key`. A dropdown or multi-select lists its choices in `options` as `{ \"label\", \"value\" }`.\n\n#### Approval (`APPROVAL`)\n\n```json\n{\n  \"type\": \"APPROVAL\",\n  \"name\": \"Credit review\",\n  \"description\": \"Approve funding for this account opening.\",\n  \"assignees\": [{ \"userId\": \"usr_123\" }],\n  \"config\": {\n    \"completion\": { \"mode\": \"ONE\" },\n    \"approval\": { \"assigneeOrder\": \"PARALLEL\" },\n    \"stepDue\": { \"type\": \"RELATIVE\", \"value\": 2, \"unit\": \"DAYS\", \"dayType\": \"business\" }\n  }\n}\n```\n\n`completion.mode` is `ONE`, `MAJORITY`, or `ALL`. `assigneeOrder` is `PARALLEL` or `SEQUENTIAL`. Don't put other steps under the approve or reject branches on this call.\n\n#### Acknowledgement (`ACKNOWLEDGEMENT`)\n\n```json\n{\n  \"type\": \"ACKNOWLEDGEMENT\",\n  \"name\": \"Acknowledge fee schedule\",\n  \"description\": \"Confirm you have read the attached fee schedule.\",\n  \"assignees\": [{ \"userId\": \"usr_123\" }],\n  \"config\": {\n    \"attachments\": [\n      {\n        \"kind\": \"link\",\n        \"url\": \"https://example.com/fee-schedule.pdf\",\n        \"title\": \"Fee schedule\"\n      }\n    ],\n    \"options\": { \"requireAttachmentReview\": true }\n  }\n}\n```\n\n#### Decision (`DECISION`)\n\nA decision needs at least 2 options in `config.outcomes`, each with a `label` (`400 DECISION_MIN_OUTCOMES` / `DECISION_OPTION_LABEL_REQUIRED`). Leave `outcomeId` out and one is created. Don't put steps inside an option on this call.\n\n```json\n{\n  \"type\": \"DECISION\",\n  \"name\": \"Route the application\",\n  \"assignees\": [{ \"userId\": \"usr_123\" }],\n  \"config\": {\n    \"outcomes\": [\n      { \"label\": \"Approve\" },\n      { \"label\": \"Send back\" },\n      { \"label\": \"Decline\" }\n    ],\n    \"decision\": {\n      \"completion\": { \"mode\": \"ONE\" }\n    }\n  }\n}\n```\n\n#### Questionnaire (`QUESTIONNAIRE`)\n\n```json\n{\n  \"type\": \"QUESTIONNAIRE\",\n  \"name\": \"Risk questionnaire\",\n  \"assignees\": [{ \"userId\": \"usr_123\" }],\n  \"config\": {\n    \"questionnaire\": {\n      \"questions\": [\n        {\n          \"questionId\": \"q-source-of-funds\",\n          \"question\": \"What is the source of funds?\",\n          \"answerType\": \"SINGLE_SELECT\",\n          \"options\": [\n            { \"value\": \"Salary\", \"label\": \"Salary\" },\n            { \"value\": \"Investment\", \"label\": \"Investment\" },\n            { \"value\": \"Inheritance\", \"label\": \"Inheritance\" },\n            { \"value\": \"Other\", \"label\": \"Other\" }\n          ],\n          \"required\": true\n        },\n        {\n          \"questionId\": \"q-pep\",\n          \"question\": \"Any politically exposed persons?\",\n          \"answerType\": \"YES_NO\",\n          \"required\": true\n        },\n        {\n          \"questionId\": \"q-notes\",\n          \"question\": \"Additional notes\",\n          \"answerType\": \"TEXT\"\n        }\n      ]\n    }\n  }\n}\n```\n\n`answerType` values: `SINGLE_SELECT`, `MULTI_SELECT`, `TEXT`, `YES_NO`, `DATE`, `TIME`.\n\n#### Checklist (`CHECKLIST`)\n\n```json\n{\n  \"type\": \"CHECKLIST\",\n  \"name\": \"Onboarding checklist\",\n  \"assignees\": [{ \"userId\": \"usr_123\" }],\n  \"config\": {\n    \"checklist\": {\n      \"items\": [\n        { \"itemId\": \"id-check\", \"label\": \"Verify government ID\" },\n        { \"itemId\": \"address-check\", \"label\": \"Confirm residential address\", \"description\": \"Utility bill within 90 days\" },\n        { \"itemId\": \"sanctions\", \"label\": \"Run sanctions screen\" }\n      ],\n      \"completionStatuses\": [\"DONE\", \"SKIPPED\"]\n    }\n  }\n}\n```\n\nGive each item a stable `itemId`. `completionStatuses` defaults to `[\"DONE\",\"SKIPPED\"]`. Use `[\"DONE\"]` when skipping is not allowed.\n\n#### Parallel branch (`PARALLEL_BRANCH`)\n\nThree forms worked on at the same time, before the review. Each path runs its own steps in order; the review waits for every path.\n\n```json\n{\n  \"type\": \"PARALLEL_BRANCH\",\n  \"name\": \"Process forms\",\n  \"beforeStepId\": \"s-review\",\n  \"paths\": [\n    {\n      \"name\": \"W-8BEN-E\",\n      \"steps\": [\n        { \"type\": \"TODO\", \"name\": \"Process W-8BEN-E\", \"assignees\": [{ \"email\": \"tax.owner@example.com\" }] }\n      ]\n    },\n    {\n      \"name\": \"KYC questionnaire\",\n      \"steps\": [\n        { \"type\": \"TODO\", \"name\": \"Process KYC questionnaire\", \"assignees\": [{ \"roleId\": \"role-onboarding-lead\" }] },\n        { \"type\": \"APPROVAL\", \"name\": \"Approve KYC questionnaire\", \"assignees\": [{ \"roleId\": \"role-compliance\" }] }\n      ]\n    },\n    {\n      \"name\": \"ISDA schedule\",\n      \"steps\": [\n        { \"type\": \"TODO\", \"name\": \"Process ISDA schedule\", \"assignees\": [{ \"roleId\": \"role-onboarding-lead\" }] }\n      ]\n    }\n  ]\n}\n```\n\nThe response names the branch and, for each path, its `pathId` and its steps' `stepId`s. Use a path's last `stepId` as `afterStepId` to add a step to that path later, while it is still open.\n\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"id\": \"2cf97387-e5e7-4814-8ff1-0a9e128e52e1\",\n    \"stepId\": \"dynamic_1e06e4c7\",\n    \"type\": \"PARALLEL_BRANCH\",\n    \"name\": \"Process forms\",\n    \"status\": \"PENDING\",\n    \"placement\": { \"afterStepId\": \"s-form\", \"stepIndex\": 2, \"reanchored\": false },\n    \"paths\": [\n      { \"pathId\": \"4acacafc-4fc5-4de0-9a3a-987b655e4969\", \"name\": \"W-8BEN-E\", \"steps\": [{ \"stepId\": \"dynamic_09d852da\", \"type\": \"TODO\", \"name\": \"Process W-8BEN-E\" }] },\n      { \"pathId\": \"deef8af7-401b-40b3-8988-c19e953131bc\", \"name\": \"KYC questionnaire\", \"steps\": [{ \"stepId\": \"dynamic_86999229\", \"type\": \"TODO\", \"name\": \"Process KYC questionnaire\" }, { \"stepId\": \"dynamic_aa1692a5\", \"type\": \"APPROVAL\", \"name\": \"Approve KYC questionnaire\" }] },\n      { \"pathId\": \"ed105b26-58dd-468d-ba3a-9256e3a57fe0\", \"name\": \"ISDA schedule\", \"steps\": [{ \"stepId\": \"dynamic_ff23e60e\", \"type\": \"TODO\", \"name\": \"Process ISDA schedule\" }] }\n    ]\n  }\n}\n```\n\nSend 2 to 10 paths. A path's steps take roles (`{ \"roleId\" }`, from `roles[].id` on `GET /v1/flows/{id}`) or people (`{ \"userId\" }` or `{ \"email\" }`, by the same rule as Assignee above); a path has no runs until the branch starts. The branch starts when the flow reaches it, so its steps get their runs (`steps[].id` on `GET /v1/flows/{id}`) only then. A path can be a sub-flow instead: `{ \"subFlow\": { ..., \"start\": \"later\" } }` on its own as the path's step.\n\n### Minimal call\n\n```\ncurl -X POST \"$MOXO/v1/flows/$FLOW/steps\" \\\n  -H \"Authorization: Bearer $TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Idempotency-Key: 6f2c4a5e-3b8d-4c7f-9a1e-2d6b8e0f4c5a\" \\\n  -d '{\"type\":\"TODO\",\"name\":\"Collect the signed W-9\"}'\n```\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `flows:write`","security":[{"bearerAuth":["flows:write"]}],"parameters":[{"schema":{"type":"string","description":"The flow's id.","example":"flow_123"},"required":true,"description":"The flow's id.","name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":256,"pattern":"^[A-Za-z0-9_\\-:.]+$","description":"An optional key that makes this request safe to retry. Send a new UUID for each request. A key is up to 256 letters, digits, `-`, `_`, `:` or `.`; any other key is refused with `400 INVALID_IDEMPOTENCY_KEY` and nothing runs. A retry with the same key within 10 minutes returns the first response and changes nothing again. After 10 minutes, the same key runs the request again, so use a new key for a late retry. See Idempotency in the Introduction.","example":"6f2c4a5e-3b8d-4c7f-9a1e-2d6b8e0f4c5a"},"required":false,"description":"An optional key that makes this request safe to retry. Send a new UUID for each request. A key is up to 256 letters, digits, `-`, `_`, `:` or `.`; any other key is refused with `400 INVALID_IDEMPOTENCY_KEY` and nothing runs. A retry with the same key within 10 minutes returns the first response and changes nothing again. After 10 minutes, the same key runs the request again, so use a new key for a late retry. See Idempotency in the Introduction.","name":"Idempotency-Key","in":"header"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddFlowStepRequest"}}}},"responses":{"201":{"description":"The step was added.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/AddFlowStepResponse"}},"required":["success","data"]}}}},"400":{"description":"The body or the flow cannot take this step. `VALIDATION_FAILED` when `type` is missing or not one of the types listed above, when `name` is missing, or when the body contains a field this endpoint does not accept. `NESTED_STEPS_NOT_ALLOWED` when `config` contains other steps. `DECISION_MIN_OUTCOMES` when a decision has fewer than 2 options. `DECISION_OPTION_LABEL_REQUIRED` when a decision option has no label. `DECISION_OPTION_ID_INVALID` when two decision options share an `outcomeId` or `id`, or an id is not text. `ASSIGNEE_NOT_INVITABLE` when a person in `assignees` was deactivated or removed. `ASSIGNEE_NOT_HUMAN` when a person in `assignees` is an AI agent or a service account. `INVALID_STATE` when the flow is not running (it has finished). `ACTION_TEST_ONE_STEP` when the flow is a test its sender sent to themselves: a test is a single request and takes no more steps. `CAPABILITY_DISABLED` when your organization cannot use that step type. `INVALID_STEP_SETTINGS` when a setting cannot be used, including a `config.dependsOnStepIds` step that comes after this one's place (`WAITS_FOR_LATER_STEP` in `error.details`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"`ORG_FROZEN` when `subFlow.start` is `now` and your organization is over its flow quota: no step of the flow can start, so nothing is added. Top up first, or send `start: \"later\"`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found. `NOT_FOUND` when the flow does not exist, was removed, or is not visible to you, or when `afterStepId`, `beforeStepId` or `config.dependsOnStepIds` names no step of this flow; the message names the parameter. `USER_NOT_FOUND` when a person in `assignees` is not a member of your organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"The flow is paused and the requested position is before the step the flow is on (`FLOW_PAUSED_INSERT_BEFORE_CURRENT`). Add the step after that step, or resume the flow first. `PATH_CLOSED` when `afterStepId` names a step in a path that can no longer take one: the path has finished, the flow took another path, a Decision has started and not been answered, a path of a Decision the flow did not take, an approval has started, the anchor is before the last action that has started, the step type cannot be added to a running path, or the path is nested more than one level deep. On the path a Decision chose, the new step goes after the last action that has started. `PATH_NOT_STARTED` when a sub-flow with uploaded start details would go into a path that has not started: its uploads need a run to belong to. `CHANGES_OTHER_STEPS` when a branch or a step into a path that has not started would change other steps of the flow: nothing is added. `INSERT_BEFORE_STARTED_STEP` when `beforeStepId` names a step that has started, or one the flow has moved past: nothing is added. `NOTHING_IN_PROGRESS` when `subFlow.start` is `now` and nothing is in progress on the flow to start beside, and `START_NOW_UNAVAILABLE` when it would wait where it goes instead of starting: nothing is added. Send `start: \"later\"` with `afterStepId`. `FLOW_PAUSED_START_NOW` when `subFlow.start` is `now` and the flow is paused: a sub-flow never starts under a paused flow, so nothing is added. Resume the flow first, or send `start: \"later\"`. `ACTION_ONE_ASK` when the flow is a one-off action (`kind: \"action\"`): an action is one ask, so nothing is added, on any plan. Send a new action instead, or start a flow.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"410":{"description":"The first result for this `Idempotency-Key` can no longer be returned, because what it created was deleted. Use a new key for the next attempt.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"A branch, or a step into a path that has not started, goes live as an Edit process change does, and is refused as Edit process refuses it: nothing is added. `STRAND` when it would go in front of a step that has started. `VIOLATIONS` when it would change a branch, decision or loop that has started. `VALIDATION` when a step it adds fails the checks a step added in Edit process passes (a reference to a step or field this flow does not have, a sub-flow that cannot start). `NOT_EDITABLE` when the flow is not running (paused or finished).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"425":{"description":"A request with this `Idempotency-Key` is still running. Retry after `Retry-After` seconds. If the first request failed with a `5xx`, the key stays held for 10 minutes; to retry sooner, use a new key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"The first result for this `Idempotency-Key` couldn't be checked. Retry with the same key after a short wait. If it keeps happening, contact support with the `requestId`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"get":{"tags":["Steps"],"summary":"List a flow's steps","description":"Returns the step runs of one flow as a flat list, in flow order: each run's ids, name, type, status, the branch or loop run it sits inside, and when it started, finished and is due. Lighter than `GET /v1/flows/{id}` when you only need the steps. Use `status` for what is open now, and send a run's `id` as `{stepId}` to the step endpoints.\n\nA personal access token lists the runs the flow's page shows its person; an organization API key lists every run. Page with `cursor`: send the previous page's `nextCursor` as it is.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `flows:read`","security":[{"bearerAuth":["flows:read"]}],"parameters":[{"schema":{"type":"string","description":"The flow's id."},"required":true,"description":"The flow's id.","name":"id","in":"path"},{"schema":{"type":"string","description":"Only runs in these statuses, comma-separated, such as `IN_PROGRESS,WAITING_FOR_ASSIGNEE` for what is open now."},"required":false,"description":"Only runs in these statuses, comma-separated, such as `IN_PROGRESS,WAITING_FOR_ASSIGNEE` for what is open now.","name":"status","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":200,"description":"Runs per page, 1 to 200. Defaults to 100."},"required":false,"description":"Runs per page, 1 to 200. Defaults to 100.","name":"limit","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":2000,"description":"The previous page's `nextCursor`. Omit for the first page."},"required":false,"description":"The previous page's `nextCursor`. Omit for the first page.","name":"cursor","in":"query"}],"responses":{"200":{"description":"A page of the flow's step runs.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a 200 response."},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The run. Send it as `{stepId}` to the step endpoints."},"stepId":{"type":"string","description":"The step on the flow. A step inside a loop runs once per item, each run with its own `id`."},"key":{"type":["string","null"],"description":"The step's key: what the template's file calls it. `null` for a step from a flow started before steps had keys."},"stepIndex":{"type":"integer","description":"Its place in the flow, from 0."},"name":{"type":["string","null"],"description":"The step's name."},"type":{"type":["string","null"],"description":"The step type."},"executionId":{"type":"string","deprecated":true,"description":"Deprecated: this run of the step, the same as `id`. Read `id`; this field is still sent so integrations built on it keep working."},"stepName":{"type":["string","null"],"deprecated":true,"description":"Deprecated: the step's name, the same as `name`. Read `name`; this field is still sent so integrations built on it keep working."},"stepType":{"type":["string","null"],"deprecated":true,"description":"Deprecated: the step's type, the same as `type`. Read `type`; this field is still sent so integrations built on it keep working."},"status":{"type":"string","enum":["PENDING","AWAITING_HOST_SETUP","AWAITING_CONNECTION","AWAITING_BUNDLE","WAITING_FOR_ASSIGNEE","PREPARING","IN_PROGRESS","REVIEWING","PAUSED","COMPLETED","SKIPPED","CANCELLED","FAILED","SUPERSEDED"],"description":"The run's status."},"viewerTurn":{"$ref":"#/components/schemas/ViewerTurn"},"viewerManages":{"$ref":"#/components/schemas/ViewerManages"},"parentExecutionId":{"type":["string","null"],"description":"The run of the branch or loop this run is inside. `null` at the top level."},"startedAt":{"type":["string","null"],"description":"When it started (ISO 8601). `null` when it has not."},"completedAt":{"type":["string","null"],"description":"When it finished (ISO 8601). `null` when it has not."},"dueAt":{"type":["string","null"],"description":"When it is due (ISO 8601). `null` when it has no due date."},"customStatus":{"anyOf":[{"$ref":"#/components/schemas/StepStatus"},{"type":"null"}],"description":"The step status someone put on this run from the template's list, beside `status`. `null` when none is set, once the step is finished, or when the organization's plan does not have Custom step statuses."},"reopenCount":{"type":"integer","description":"How many times it was reopened."},"reopenReason":{"type":["string","null"],"description":"Why the step was last reopened: a send back's reason, as its reader may see it. `null` when it was never reopened, or none was given."},"reopenedAt":{"type":["string","null"],"format":"date-time","description":"When the step was last reopened. `null` when it was never reopened."},"reopenedBy":{"anyOf":[{"$ref":"#/components/schemas/User"},{"type":"null"}],"description":"The person who last reopened the step. `null` when it was never reopened, or when an AI agent or the system reopened it (`reopenedByKind`)."},"reopenedByKind":{"type":["string","null"],"enum":["person","agent","system",null],"description":"Who last reopened the step: `person` (named in `reopenedBy`), `agent` (an AI agent sent it back, named in `reopenedByAgent`), or `system` (an API key, a loop back, or Moxo itself). Read it with `reopenReason` and `reopenedAt` to tell a step sent back for changes from one still waiting on its first round. `null` when it was never reopened.","example":"agent"},"reopenedByAgent":{"type":["object","null"],"properties":{"id":{"type":"string","description":"The agent's id."},"name":{"type":"string","description":"The agent's name."}},"required":["id","name"],"additionalProperties":false,"description":"The AI agent that last sent the step back, when `reopenedByKind` is `agent`. `null` otherwise."}},"required":["id","stepId","key","stepIndex","name","type","status","viewerTurn","viewerManages","parentExecutionId","startedAt","completedAt","dueAt","customStatus","reopenCount","reopenReason","reopenedAt","reopenedBy","reopenedByKind","reopenedByAgent"],"additionalProperties":false},"description":"The runs on this page, in flow order."},"pagination":{"type":"object","properties":{"nextCursor":{"type":["string","null"],"description":"Send it as `cursor` for the next page. `null` on the last page."},"limit":{"type":"integer","description":"The page size this call used."},"hasMore":{"type":"boolean","description":"Whether there is another page."}},"required":["nextCursor","limit","hasMore"],"description":"Where the next page starts."}},"required":["success","data","pagination"]}}}},"400":{"description":"A query parameter is not valid (`VALIDATION_FAILED`), or `cursor` is not one this list issued (`INVALID_CURSOR`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/{id}/steps/{stepId}/complete":{"post":{"x-moxo-person-only":"ASSIGNEE_REQUIRED","tags":["Steps"],"summary":"Complete a step","description":"Records that the person whose turn it is finished their work, and advances the flow. The body depends on the step type; see \"Completing a step\" at the top of this section.\n\n**`{stepId}`.** Send `steps[].id` / Add-step `data.id` (one run), or `steps[].stepId` / Add-step `data.stepId` (the step on the flow). A run's `id` names that run. A `stepId` means the run in progress; while more than one run of a repeating step is open, it returns `409 AMBIGUOUS_STEP` instead of guessing.\n\nCall `complete` as the person whose turn it is, with their personal access token, or as someone covering for them. A flow manager, the flow's owner or an admin who holds no part in the step can also complete it with `complete`: it is recorded as done by them on behalf of the step's assignee (`completedOnBehalfOf` on the step, and \"on behalf of\" in the audit log). To close a step without its work and show that it was forced, use `POST /v1/flows/{id}/steps/{stepId}/force-complete` with a `reason`.\n\n**What you send is checked.** Answers are `resultData`, keyed by field id (a key or label there is refused, naming the id). A key that is not a field of the step, a choice that is not one of the field's options, or a value of the wrong kind (an object where text belongs, words in a number field) returns `400 VALIDATION_FAILED`, naming the field and listing the field ids or options it takes; nothing is saved.\n\n**Refusals.** A step that is already completed, or your part of it, returns `409 ALREADY_COMPLETED`: on a retry, treat it as success. When two people complete the same step at once, one answer is saved and the other request returns `409 ALREADY_COMPLETED`, never a success whose answer was thrown away. A step in its review (an AI review included) returns `409 STEP_AWAITING_REVIEW`; a step that changed during the request, `409 STALE_ACTION`; an answer to a step whose question changed since you read it (send `askedFingerprint` from `GET /v1/flows/{id}/steps/{stepId}` beside `resultData`; an answer without it is not checked), `409 STEP_CHANGED`, nothing recorded; an answer that met a change of who reviews the step while it was on its way (a reviewer, AI or person, added, swapped or taken away), `409 REVIEW_CHANGED`, nothing recorded: a retry is safe, and the same answer sent again goes to the review as it now stands; a file rename that couldn't be scheduled, `503 SERVICE_UNAVAILABLE` (try again). An e-signature step is finished by signing the document, so completing it here returns `409 ESIGN_SIGNATURE_REQUIRED` (a flow manager can still `/force-complete` it, recorded as forced). The same holds for every step its own event closes (signed in DocuSign or Adobe Sign, an identity verified, a payment made, a Jotform submitted, a time booked): completing it here returns `409 STEP_COMPLETES_ON_ITS_OWN`, naming what closes it, and a flow manager can `/force-complete` it. A Goal step completed without one of its required outputs (keyed by output id in `resultData`) returns `400 REQUIRED_OUTPUTS_MISSING`, naming each, and one with a key it declares no output for returns `400 OUTPUT_NOT_DECLARED`. A paused flow returns `409 FLOW_PAUSED` (don't retry; a person must resume the flow). A step that closes at its due date (`closeAtDue`) and whose close has passed returns `409 ACTION_CLOSED`: what was saved has been sent on, and a flow manager can reopen it. An upload on the step that was flagged as harmful returns `422 FILE_INFECTED`; one the safety check couldn't check, `409 SCAN_UNAVAILABLE`; and one a form answer names that is still being checked, `425 SCAN_PENDING` (try again). A Web App step the team confirms returns `403 COMPLETION_REQUIRES_MEMBER` to anyone who is not an internal user of the organization. If you have no open part in the step and are not one of its flow managers, the call returns `403 NOT_STEP_ASSIGNEE`. A flow busy with another change past a few seconds returns `503 FLOW_BUSY` with a `Retry-After` header: nothing was saved, so send the same request again (the same `Idempotency-Key` is accepted).\n\n**What happens next.** The answer comes once your completion is saved. The steps that follow it normally start before the answer, and always within seconds: a step after it can still read `PENDING` in this answer. Read the flow again, or listen for `step.started`, to see them start.\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","description":"The step to act on. Takes either id from `GET /v1/flows/{id}`: `steps[].stepId`, which names the step on the flow and exists before it starts, or `steps[].id`, which names one run of it. A bare step id means the run in progress; while more than one run is open, the call returns `409 AMBIGUOUS_STEP` instead of guessing.","example":"step-2"},"required":true,"description":"The step to act on. Takes either id from `GET /v1/flows/{id}`: `steps[].stepId`, which names the step on the flow and exists before it starts, or `steps[].id`, which names one run of it. A bare step id means the run in progress; while more than one run is open, the call returns `409 AMBIGUOUS_STEP` instead of guessing.","name":"stepId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompleteStepRequest"}}}},"responses":{"200":{"description":"The step after your completion (the run it completed, when you named a template step id), as `GET /v1/flows/{id}/steps/{stepId}` returns it. A step with an AI reviewer answers `202` with the same body, its status showing the review.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."},"data":{"allOf":[{"$ref":"#/components/schemas/StepDetail"},{"description":"The step after your completion, as Get a step shows it to you. Absent only when you can no longer see the step after completing it, for example a step you completed while covering for someone who is out of office."}]}},"required":["success"]}}}},"202":{"description":"Sent to its AI review: your answer is saved and the reviewer decides. The step as `GET /v1/flows/{id}/steps/{stepId}` returns it, its status showing the review.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."},"data":{"allOf":[{"$ref":"#/components/schemas/StepDetail"},{"description":"The step after your completion, as Get a step shows it to you. Absent only when you can no longer see the step after completing it, for example a step you completed while covering for someone who is out of office."}]}},"required":["success"]}}}},"400":{"description":"Refused: `OUTPUT_NOT_DECLARED`, `REQUIRED_OUTPUTS_MISSING`, `VALIDATION_FAILED`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Refused: `ACTION_CLOSED`, `ALREADY_COMPLETED`, `AMBIGUOUS_STEP`, `ESIGN_SIGNATURE_REQUIRED`, `FLOW_PAUSED`, `REVIEW_CHANGED`, `SCAN_UNAVAILABLE`, `STALE_ACTION`, `STEP_AWAITING_REVIEW`, `STEP_CHANGED`, `STEP_COMPLETES_ON_ITS_OWN`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Refused: `FILE_INFECTED`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"425":{"description":"Refused: `SCAN_PENDING`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Refused: `FLOW_BUSY`, `SERVICE_UNAVAILABLE`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/{id}/steps/{stepId}/decline":{"post":{"x-moxo-person-only":"ASSIGNEE_REQUIRED","tags":["Steps"],"summary":"Decline a step","description":"Declines an approval step: sends it back for changes, or rejects it, as the approval's `onReject` setting allows. Send a `reason`: the audit trail and the requester show it. See \"Declining an approval\" at the top of this section. Call `decline` as an approver whose turn it is, with their personal access token: the decline is recorded on their seat. An approver may decline their own approval whether or not they manage the flow. A flow manager, the flow's owner or an admin who isn't one of the step's open approvers gets `410 NO_ACTIVE_SLOT`, and anyone else gets `403 FORBIDDEN`.\n\n**Already decided.** Sending the decision this round already made again changes nothing: the answer says `changed: false`, and the decision stands. An approval decided another way this round (approved, or declined the other way) returns `409 APPROVAL_DECIDED_OTHERWISE` with `error.decision`, and nothing changes.\n\n**Changed since you read it.** Send the approval's `askedFingerprint` from `GET /v1/flows/{id}/steps/{stepId}`: when what it asks changed since, nothing is saved and the call returns `409 STEP_CHANGED`.\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","description":"The step to act on. Takes either id from `GET /v1/flows/{id}`: `steps[].stepId`, which names the step on the flow and exists before it starts, or `steps[].id`, which names one run of it. A bare step id means the run in progress; while more than one run is open, the call returns `409 AMBIGUOUS_STEP` instead of guessing.","example":"step-2"},"required":true,"description":"The step to act on. Takes either id from `GET /v1/flows/{id}`: `steps[].stepId`, which names the step on the flow and exists before it starts, or `steps[].id`, which names one run of it. A bare step id means the run in progress; while more than one run is open, the call returns `409 AMBIGUOUS_STEP` instead of guessing.","name":"stepId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeclineStepRequest"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."},"changed":{"type":"boolean","description":"`true` when this call changed what you asked it to. `false` when that was already so, and the call changed nothing of it."},"message":{"type":"string","description":"Only with `changed: false`: what was already so.","example":"Nothing changed: this person already holds this role."}},"required":["success","changed"],"additionalProperties":false}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Refused: `APPROVAL_DECIDED_OTHERWISE`, `STEP_CHANGED`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"410":{"description":"Refused: `NO_ACTIVE_SLOT`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/{id}/steps/{stepId}/prepare-complete":{"post":{"x-moxo-person-only":"ASSIGNEE_REQUIRED","tags":["Steps"],"summary":"Complete a step's preparation","description":"Some steps are set up by one person before another acts on them: someone supplies the contract to be signed, or fills in part of a form. This marks that setup done and hands the step on. It applies only to steps with a preparer. Needs a personal access token (`403 ASSIGNEE_REQUIRED` for an organization API key).\n\n**A step that runs once for each item** has one copy per item, and all of them share `stepId`. Send `stepExecutionId` (`steps[].id` from `GET /v1/flows/{id}`) to name the copy you are preparing. Without it, the one copy still waiting to be prepared is used. When two or more are waiting, the call returns `400 EXECUTION_REQUIRED` instead of guessing.\n\n**An e-sign step whose template turned on Prevent PDF replacement** keeps its PDF: sending a different document in `overrides.setup.documentRef` returns `409 ESIGN_SOURCE_DOCUMENT_LOCKED`, and nothing is saved. Checking signers and signing fields still works.\n\n**A preparer changes the step for this run, not what the rest of the flow depends on.** Renaming a decision option is fine. Sending an option the step doesn't have returns `422 PREPARE_EDIT_LOCKED`, and so does a custom action file the template doesn't list, a web address for a Web App that runs an uploaded page, or a newer `setup` field meant for a different kind of step. Nothing is saved, and the preparer can send again.\n\n**Not yet, or not as sent.** A step still being set up returns `409 PREPARE_ACTIVATION_PENDING`: try again in a moment. A step whose assignee works on a document (a document review, a PDF form) needs one before its preparation is done: the template's, an earlier step's file, or the preparer's own in `overrides.setup.documentRef`. Without one the call returns `422 PREPARATION_INCOMPLETE`, with what is missing in `error.missing` (`[\"document\"]`), and nothing is saved: the same rule the preparer screen follows. A preparation that can't be completed as sent returns `400 PREPARE_FAILED`, and the message says why. A preparer whose turn has not come yet gets `409 NOT_YOUR_TURN`: on a step whose preparers take turns, another preparer goes first, or the AI is still preparing it.\n\n`stepId` takes the template step id or one copy's own id (`steps[].id`), as the step reads do.\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","description":"The step to act on. Takes either id from `GET /v1/flows/{id}`: `steps[].stepId`, which names the step on the flow and exists before it starts, or `steps[].id`, which names one run of it. An execution id names its run. With the template step id, name one run of a repeating step with `?stepExecutionId=`; with two or more still waiting and none named, the call returns `400 EXECUTION_REQUIRED`.","example":"step-2"},"required":true,"description":"The step to act on. Takes either id from `GET /v1/flows/{id}`: `steps[].stepId`, which names the step on the flow and exists before it starts, or `steps[].id`, which names one run of it. An execution id names its run. With the template step id, name one run of a repeating step with `?stepExecutionId=`; with two or more still waiting and none named, the call returns `400 EXECUTION_REQUIRED`.","name":"stepId","in":"path"},{"schema":{"type":"string","description":"The copy of a step that runs once for each item. `steps[].id` from `GET /v1/flows/{id}`."},"required":false,"description":"The copy of a step that runs once for each item. `steps[].id` from `GET /v1/flows/{id}`.","name":"stepExecutionId","in":"query"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PrepareCompleteRequest"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]}},"required":["success"]}}}},"400":{"description":"Refused: `EXECUTION_REQUIRED`, `PREPARE_FAILED`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Refused: `ESIGN_SOURCE_DOCUMENT_LOCKED`, `NOT_YOUR_TURN`, `PREPARE_ACTIVATION_PENDING`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Refused: `PREPARATION_INCOMPLETE`, `PREPARE_EDIT_LOCKED`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/{id}/steps/{stepId}/review-approve":{"post":{"x-moxo-person-only":"ASSIGNEE_REQUIRED","tags":["Steps"],"summary":"Approve a review","description":"Signs off on what the assignee submitted, so the flow can move on. It applies only to steps with a reviewer. The caller must be the reviewer.\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","description":"The step to act on. Takes either id from `GET /v1/flows/{id}`: `steps[].stepId`, which names the step on the flow and exists before it starts, or `steps[].id`, which names one run of it. A bare step id means the run that is waiting for review; if none is waiting, the call returns `404` instead of acting on a finished run.","example":"step-2"},"required":true,"description":"The step to act on. Takes either id from `GET /v1/flows/{id}`: `steps[].stepId`, which names the step on the flow and exists before it starts, or `steps[].id`, which names one run of it. A bare step id means the run that is waiting for review; if none is waiting, the call returns `404` instead of acting on a finished run.","name":"stepId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewApproveRequest"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]}},"required":["success"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/{id}/steps/{stepId}/resolve-output":{"post":{"x-moxo-person-only":"ASSIGNEE_REQUIRED","tags":["Steps"],"summary":"Pick a record","description":"Chooses one record when a Look up a record step found more than one, so the flow can continue. The caller must be the person asked to pick. `choice` `record` sends `recordId` from the waiting list. `choice` `none` follows the step's no-match setting. Send `round` from that list. When the records changed, the call returns `409 CANDIDATES_CHANGED` and the current list, and nothing is saved. Needs a personal access token (`403 ASSIGNEE_REQUIRED` for an organization API key). `stepId` is the run's id (`steps[].id`).\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","description":"The step to act on. Takes only a run's `steps[].id` from `GET /v1/flows/{id}`. Unlike the other step endpoints, it doesn't take a `stepId`. Send the run's id (`steps[].id`). A template step id returns `404`. The path names one run, so a repeated step is never guessed.","example":"step-2"},"required":true,"description":"The step to act on. Takes only a run's `steps[].id` from `GET /v1/flows/{id}`. Unlike the other step endpoints, it doesn't take a `stepId`. Send the run's id (`steps[].id`). A template step id returns `404`. The path names one run, so a repeated step is never guessed.","name":"stepId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResolveOutputRequest"}}}},"responses":{"200":{"description":"The pick was saved.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` when the pick was saved."}},"required":["success"],"description":"The pick was saved and the flow continued."}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Refused: `CANDIDATES_CHANGED`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/{id}/steps/{stepId}/review-decline":{"post":{"x-moxo-person-only":"ASSIGNEE_REQUIRED","tags":["Steps"],"summary":"Send a submission back for changes","description":"Returns the step to the person who submitted it so they can change their answer. `reason` is required: it tells them what to fix. The caller must be the reviewer.\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","description":"The step to act on. Takes either id from `GET /v1/flows/{id}`: `steps[].stepId`, which names the step on the flow and exists before it starts, or `steps[].id`, which names one run of it. A bare step id means the run that is waiting for review; if none is waiting, the call returns `404` instead of acting on a finished run.","example":"step-2"},"required":true,"description":"The step to act on. Takes either id from `GET /v1/flows/{id}`: `steps[].stepId`, which names the step on the flow and exists before it starts, or `steps[].id`, which names one run of it. A bare step id means the run that is waiting for review; if none is waiting, the call returns `404` instead of acting on a finished run.","name":"stepId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewDeclineRequest"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]}},"required":["success"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/{id}/steps/{stepExecutionId}/review-group":{"get":{"x-moxo-person-only":"ASSIGNEE_REQUIRED","tags":["Steps"],"summary":"Read the items reviewed together","description":"For a step whose reviewers review all items together, the list of every item's copy of the step in that loop: where each stands and what you can do. An item appears only to a reviewer of that item or a flow manager. A run whose step is not reviewed together returns `404 NOT_IN_REVIEW_GROUP`; a caller who reviews no item and does not manage the flow gets `403 REVIEW_GROUP_FORBIDDEN`.\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","description":"Any item's run of the step in the loop: a `steps[].id` from `GET /v1/flows/{id}`. Takes only a run's id.","example":"se_123"},"required":true,"description":"Any item's run of the step in the loop: a `steps[].id` from `GET /v1/flows/{id}`. Takes only a run's id.","name":"stepExecutionId","in":"path"}],"responses":{"200":{"description":"The list.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."},"data":{"$ref":"#/components/schemas/ReviewGroup"}},"required":["success","data"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/{id}/steps/{stepExecutionId}/review-group/mark":{"post":{"x-moxo-person-only":"ASSIGNEE_REQUIRED","tags":["Steps"],"summary":"Mark an item reviewed","description":"Marks (or unmarks) one item's current submission reviewed, as your own progress through the list. It is not an approval and tells nobody. Only while the loop moves items on together, and only on your turn: an item that moved since you read it returns `409 REVIEW_ITEM_CHANGED`, a loop whose items move on one by one `400 REVIEW_GROUP_NOT_APPROVE_ALL`, someone else's turn `403 NOT_ACTIVE_REVIEWER`. `stepExecutionId` is the item's own run.\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","description":"Any item's run of the step in the loop: a `steps[].id` from `GET /v1/flows/{id}`. Takes only a run's id.","example":"se_123"},"required":true,"description":"Any item's run of the step in the loop: a `steps[].id` from `GET /v1/flows/{id}`. Takes only a run's id.","name":"stepExecutionId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewGroupMarkRequest"}}}},"responses":{"200":{"description":"The item as it stands now.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."},"data":{"type":"object","properties":{"item":{"allOf":[{"$ref":"#/components/schemas/ReviewGroupItem"},{"description":"The item, with `marked` as saved."}]}},"required":["item"],"description":"The item."}},"required":["success","data"]}}}},"400":{"description":"Refused: `REVIEW_GROUP_NOT_APPROVE_ALL`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Refused: `REVIEW_ITEM_CHANGED`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/{id}/steps/{stepExecutionId}/review-group/approve":{"post":{"x-moxo-person-only":"ASSIGNEE_REQUIRED","tags":["Steps"],"summary":"Approve the items reviewed together","description":"Approves the items you name, each with the `invocationEpoch` you read, in a background job, each through its own review approval. Returns `202` with a `jobId`; read the list again for where each item stands: an approved item reads `approved`, and an item that changed since you read it is left for you to review again. While the loop moves items on together, every item must be in first, or the call returns `409 REVIEW_GROUP_NOT_READY`. One approval runs at a time for you (`409 REVIEW_GROUP_APPROVE_IN_PROGRESS`). A job that cannot start returns `503 REVIEW_GROUP_APPROVE_NOT_STARTED`; nothing was approved, so retry.\n\n**Idempotent.** Send an `Idempotency-Key` header to make retries safe: a retry returns the same job.\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","description":"Any item's run of the step in the loop: a `steps[].id` from `GET /v1/flows/{id}`. Takes only a run's id.","example":"se_123"},"required":true,"description":"Any item's run of the step in the loop: a `steps[].id` from `GET /v1/flows/{id}`. Takes only a run's id.","name":"stepExecutionId","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":256,"pattern":"^[A-Za-z0-9_\\-:.]+$","description":"An optional key that makes this request safe to retry. Send a new UUID for each request. A key is up to 256 letters, digits, `-`, `_`, `:` or `.`; any other key is refused with `400 INVALID_IDEMPOTENCY_KEY` and nothing runs. A retry with the same key within 10 minutes returns the first response and changes nothing again. After 10 minutes, the same key runs the request again, so use a new key for a late retry. See Idempotency in the Introduction.","example":"6f2c4a5e-3b8d-4c7f-9a1e-2d6b8e0f4c5a"},"required":false,"description":"An optional key that makes this request safe to retry. Send a new UUID for each request. A key is up to 256 letters, digits, `-`, `_`, `:` or `.`; any other key is refused with `400 INVALID_IDEMPOTENCY_KEY` and nothing runs. A retry with the same key within 10 minutes returns the first response and changes nothing again. After 10 minutes, the same key runs the request again, so use a new key for a late retry. See Idempotency in the Introduction.","name":"Idempotency-Key","in":"header"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewGroupApproveRequest"}}}},"responses":{"202":{"description":"The approval runs in the background. Read the list again for where each item stands.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."},"data":{"type":"object","properties":{"jobId":{"type":"string","description":"The approval job. Read the list again for where each item stands."}},"required":["jobId"],"description":"The job that approves the items."}},"required":["success","data"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Refused: `REVIEW_GROUP_APPROVE_IN_PROGRESS`, `REVIEW_GROUP_NOT_READY`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"410":{"description":"The first result for this `Idempotency-Key` can no longer be returned, because what it created was deleted. Use a new key for the next attempt.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"425":{"description":"A request with this `Idempotency-Key` is still running. Retry after `Retry-After` seconds. If the first request failed with a `5xx`, the key stays held for 10 minutes; to retry sooner, use a new key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"The first result for this `Idempotency-Key` couldn't be checked. Retry with the same key after a short wait. If it keeps happening, contact support with the `requestId`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/{flowId}/steps/{stepId}/files":{"post":{"tags":["Steps"],"summary":"Upload a file to a step","description":"Uploads a file as part of the assignee's own submission on this step. Only the person who uploaded the file can see it until the step is completed, so this endpoint can't give the assignee a document to read: they never see it. Use `POST .../steps/{stepId}/attachments` for that.\n\nAfter this call, finish the upload:\n1. `PUT` the bytes to `uploadUrl`, with every header in `requiredHeaders` exactly as returned. They are covered by the URL's signature, so a `PUT` without them is refused.\n2. If the response included `completionUrl`, `POST` to it with no body. That starts the file's safety check; without it, the file is never shown to anyone.\n\nThe file is left out of the list and download endpoints until that check passes.\n\n**Where an upload is used:**\n- **File request**: the upload is the submission. Pass the returned ids to `/complete` as `resultData.files`.\n- **Form**: it becomes a field's value. Send its id under the `FILE_UPLOAD` field's id when you complete the step. The upload alone does nothing.\n- **E-sign, PDF form and document review**: only while the step is being prepared, as the document to sign, fill in or review.\n- **Any other step**: the upload is accepted but not used. Nobody is shown the file and no step refers to it. The call still returns `201`, so check the step type before you upload.\n\nA step takes files while it is worked on: being prepared, waiting for its assignee, in progress or in review. Refusals: `409 STEP_ALREADY_FINISHED` for a finished step; `409 STEP_NOT_REACHED` for a step the flow hasn't reached yet; `409 STEP_ON_HOLD` for a step on hold (a connection still to make, a paused wait) until it resumes.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `flows:write`","security":[{"bearerAuth":["flows:write"]}],"parameters":[{"schema":{"type":"string","example":"flow_123"},"required":true,"name":"flowId","in":"path"},{"schema":{"type":"string","example":"step-intake","description":"Either the step on the flow (`step.stepId` in a webhook payload, or `steps[].stepId` from `GET /v1/flows/{id}`, for example `step-1`) or one run of it (`step.stepExecutionId` in a webhook payload, or `steps[].id`); both name the same step."},"required":true,"description":"Either the step on the flow (`step.stepId` in a webhook payload, or `steps[].stepId` from `GET /v1/flows/{id}`, for example `step-1`) or one run of it (`step.stepExecutionId` in a webhook payload, or `steps[].id`); both name the same step.","name":"stepId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"fileName":{"type":"string","minLength":1,"maxLength":500,"example":"invoice-acme.pdf"},"fileSize":{"type":"integer","exclusiveMinimum":0,"description":"The file size in bytes.","example":24576},"mimeType":{"type":"string","minLength":1,"example":"application/pdf"}},"required":["fileName","fileSize","mimeType"]}}}},"responses":{"201":{"description":"The upload is ready: send the bytes to `uploadUrl`.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/UploadEnvelope"}},"required":["success","data"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Refused: `STEP_ALREADY_FINISHED`, `STEP_NOT_REACHED`, `STEP_ON_HOLD`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"get":{"tags":["Steps"],"summary":"List files for a step","description":"Lists the files on this step. A file whose safety check hasn't passed is left out, so a file that was uploaded but never completed (see the upload endpoint) doesn't appear. A completed custom action step lists one PDF per person who sent its page, with their answers.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `flows:read`","security":[{"bearerAuth":["flows:read"]}],"parameters":[{"schema":{"type":"string","example":"flow_123"},"required":true,"name":"flowId","in":"path"},{"schema":{"type":"string","example":"step-intake","description":"Either the step on the flow (`step.stepId` in a webhook payload, or `steps[].stepId` from `GET /v1/flows/{id}`, for example `step-1`) or one run of it (`step.stepExecutionId` in a webhook payload, or `steps[].id`); both name the same step."},"required":true,"description":"Either the step on the flow (`step.stepId` in a webhook payload, or `steps[].stepId` from `GET /v1/flows/{id}`, for example `step-1`) or one run of it (`step.stepExecutionId` in a webhook payload, or `steps[].id`); both name the same step.","name":"stepId","in":"path"}],"responses":{"200":{"description":"The files.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"array","items":{"$ref":"#/components/schemas/File"}}},"required":["success","data"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/{flowId}/steps/{stepId}/files/{fileId}":{"get":{"tags":["Steps"],"summary":"Download a step file","description":"Returns a short-lived download URL for the file. `flowId`, `stepId` and `fileId` must match: a file from one step can't be fetched through another step's URL.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `flows:read`","security":[{"bearerAuth":["flows:read"]}],"parameters":[{"schema":{"type":"string","example":"flow_123"},"required":true,"name":"flowId","in":"path"},{"schema":{"type":"string","example":"step-intake","description":"Either the step on the flow (`step.stepId` in a webhook payload, or `steps[].stepId` from `GET /v1/flows/{id}`, for example `step-1`) or one run of it (`step.stepExecutionId` in a webhook payload, or `steps[].id`); both name the same step."},"required":true,"description":"Either the step on the flow (`step.stepId` in a webhook payload, or `steps[].stepId` from `GET /v1/flows/{id}`, for example `step-1`) or one run of it (`step.stepExecutionId` in a webhook payload, or `steps[].id`); both name the same step.","name":"stepId","in":"path"},{"schema":{"type":"string","example":"file_123"},"required":true,"name":"fileId","in":"path"}],"responses":{"200":{"description":"A short-lived download URL.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"id":{"type":"string"},"fileName":{"type":"string"},"mimeType":{"type":"string"},"fileSize":{"type":"number"},"downloadUrl":{"type":"string"}},"required":["id","fileName","mimeType","fileSize","downloadUrl"]}},"required":["success","data"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"tags":["Steps"],"summary":"Delete a step file","description":"Removes a file from a step.\n\nReturns `409` while anything still uses the file, so a deletion never leaves a broken reference behind. The error code names what uses it:\n- `FILE_REFERENCED_BY_STEP`: a completed step's answer includes it. Reopen that step, or archive the flow.\n- `FILE_IN_DOCUMENT_COLLABORATION`: the file belongs to a Document collaboration step (a draft, a file held there for someone to use or dismiss, or a sent version and its PDFs). It can't be deleted with this endpoint.\n- `FILE_REFERENCED_BY_ATTACHMENT`: it is shown to someone as reference material. Remove it with `DELETE .../steps/{stepId}/attachments/{attachmentId}`.\n- `FILE_REFERENCED_BY_CHAT_MESSAGE`: it is attached to a message. Delete the message.\n- `FILE_REFERENCED_BY_FIELD`: a flow field points at it. Clear or replace that field.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `flows:write`","security":[{"bearerAuth":["flows:write"]}],"parameters":[{"schema":{"type":"string","example":"flow_123"},"required":true,"name":"flowId","in":"path"},{"schema":{"type":"string","example":"step-intake","description":"Either the step on the flow (`step.stepId` in a webhook payload, or `steps[].stepId` from `GET /v1/flows/{id}`, for example `step-1`) or one run of it (`step.stepExecutionId` in a webhook payload, or `steps[].id`); both name the same step."},"required":true,"description":"Either the step on the flow (`step.stepId` in a webhook payload, or `steps[].stepId` from `GET /v1/flows/{id}`, for example `step-1`) or one run of it (`step.stepExecutionId` in a webhook payload, or `steps[].id`); both name the same step.","name":"stepId","in":"path"},{"schema":{"type":"string","example":"file_123"},"required":true,"name":"fileId","in":"path"}],"responses":{"200":{"description":"The file was deleted.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"id":{"type":"string","description":"The deleted file's id."},"deleted":{"type":"boolean","enum":[true],"description":"Always `true`: the file is deleted."}},"required":["id","deleted"],"additionalProperties":false,"description":"The file that was deleted."}},"required":["success","data"],"additionalProperties":false}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict: the request can't be applied to the resource as it is now. `error.code` says why.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/{flowId}/steps/{stepId}/files/{fileId}/pages":{"get":{"tags":["Steps"],"summary":"Download pages of a step file","description":"Returns the pages you ask for of a PDF on this step, in page order, as one PDF. Ask with `pages`: one page (`12`), a range (`12-14`), or a list (`3,7,12-14`), at most 50 pages in all. The `X-Moxo-Pages` header names the pages it holds and `X-Moxo-Page-Count` the pages the whole file has. The same rules as downloading the file apply: a file you can only view answers 403 `VIEW_ONLY`, and a file a step watermarks is stamped with your name, or answers 422 `WATERMARK_UNAVAILABLE` for a key that names no person.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `flows:read`","security":[{"bearerAuth":["flows:read"]}],"parameters":[{"schema":{"type":"string","example":"flow_123"},"required":true,"name":"flowId","in":"path"},{"schema":{"type":"string","example":"step-intake","description":"Either the step on the flow (`step.stepId` in a webhook payload, or `steps[].stepId` from `GET /v1/flows/{id}`, for example `step-1`) or one run of it (`step.stepExecutionId` in a webhook payload, or `steps[].id`); both name the same step."},"required":true,"description":"Either the step on the flow (`step.stepId` in a webhook payload, or `steps[].stepId` from `GET /v1/flows/{id}`, for example `step-1`) or one run of it (`step.stepExecutionId` in a webhook payload, or `steps[].id`); both name the same step.","name":"stepId","in":"path"},{"schema":{"type":"string","example":"file_123"},"required":true,"name":"fileId","in":"path"},{"schema":{"type":"string","example":"3,7,12-14","description":"Pages and ranges, separated by commas. Pages are numbered from 1."},"required":true,"description":"Pages and ranges, separated by commas. Pages are numbered from 1.","name":"pages","in":"query"}],"responses":{"200":{"description":"The pages, as a PDF.","content":{"application/pdf":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"`pages` is missing or not written as pages and ranges (`PAGE_RANGE_INVALID`), or names a page the file does not have (`PAGE_RANGE_OUTSIDE_DOCUMENT`, with `pageCount`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PageRangeErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"410":{"description":"The file was deleted under the organization's retention rules.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"The file is not a PDF (`PAGES_NOT_A_PDF`), its pages could not be opened (`PAGES_UNREADABLE`), or it must be watermarked and cannot be (`WATERMARK_UNAVAILABLE`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/{flowId}/files":{"get":{"tags":["Flows"],"summary":"List files in a flow","description":"Lists every file you can see in this flow: what people uploaded, what steps produced and files attached in chat. Files on steps you can't see are left out, as are files whose safety check hasn't passed. To download a file a step produced, call `GET /v1/flows/{flowId}/steps/{stepId}/files/{fileId}`. Its `downloadUrl` works for one hour; ask for a new one after that.\n\nEach file says where it came from. `stepId` and `stepName` name the step that produced it, and `fileRole` is `signed` or `certificate` when that step recorded the file as its signed document or signing certificate. `fileRole` comes from what the step recorded, never from the file name.\n\n**Reference files.** Documents that steps show without producing them, such as the document an e-sign step asks people to sign and files attached to a step, are a separate view. Send `folderId=__attachments__` to get them, for example `GET /v1/flows/{flowId}/files?folderId=__attachments__`. `__attachments__` selects that view; it is not a real folder. Each file appears once in that view, and `references` lists every step that shows it. Without `folderId`, `references` is always an empty array.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `flows:read`","security":[{"bearerAuth":["flows:read"]}],"parameters":[{"schema":{"type":"string","example":"flow_123"},"required":true,"name":"flowId","in":"path"},{"schema":{"type":"string","description":"Send `__attachments__` to list the files steps show as reference material, instead of the flow's own files. Any other value is ignored; the list isn't filtered by folder.","example":"__attachments__"},"required":false,"description":"Send `__attachments__` to list the files steps show as reference material, instead of the flow's own files. Any other value is ignored; the list isn't filtered by folder.","name":"folderId","in":"query"}],"responses":{"200":{"description":"The files.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"array","items":{"$ref":"#/components/schemas/FlowFileListItem"}}},"required":["success","data"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/{id}/steps/{stepId}/skip":{"post":{"tags":["Steps"],"summary":"Skip a step (manager)","description":"**Acting as a flow manager.** Passes over a step that is waiting or in progress, without anyone finishing it, and moves the flow on. Nothing is recorded as completed. A failed automation step can be skipped to unblock the flow; a step that is already completed or skipped returns `400 INVALID_STATE`. A skipped step can't be reopened, and skipping the last open step finishes the flow. When the same step is skipped twice at once, the second request returns `409 CONFLICT`.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `flows:write`","security":[{"bearerAuth":["flows:write"]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","description":"The step to act on. Takes either id from `GET /v1/flows/{id}`: `steps[].stepId`, which names the step on the flow and exists before it starts, or `steps[].id`, which names one run of it. A bare step id means the run in progress; while more than one run is open, the call returns `409 AMBIGUOUS_STEP` instead of guessing.","example":"step-2"},"required":true,"description":"The step to act on. Takes either id from `GET /v1/flows/{id}`: `steps[].stepId`, which names the step on the flow and exists before it starts, or `steps[].id`, which names one run of it. A bare step id means the run in progress; while more than one run is open, the call returns `409 AMBIGUOUS_STEP` instead of guessing.","name":"stepId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SkipStepRequest"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]}},"required":["success"]}}}},"400":{"description":"Refused: `INVALID_STATE`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Refused: `CONFLICT`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/{id}/steps/{stepId}/settings":{"get":{"tags":["Steps"],"summary":"Get step settings (manager)","description":"**Acting as a flow manager.** Returns a step's settings as Moxo's step editor shows them: `config` with the keys Edit a step takes, the due-date rule as `stepDue`, whether the settings can change now and until when (`editable`), what a save would refuse now and why (`locks`: what the step asks, anyone or everyone, and AI help), and for an e-sign step its signers and who can be added. A file is named by its `fileId`, a person by their id. Send a setting back unchanged and nothing changes. An organization API key counts as a flow manager. Without flow manager access, the call returns 403, and for a flow outside your organization, 404.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `flows:read`","security":[{"bearerAuth":["flows:read"]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","description":"The step to act on. Takes either id from `GET /v1/flows/{id}`: `steps[].stepId`, which names the step on the flow and exists before it starts, or `steps[].id`, which names one run of it. A bare step id means the run in progress; while more than one run is open, the call returns `409 AMBIGUOUS_STEP` instead of guessing.","example":"step-2"},"required":true,"description":"The step to act on. Takes either id from `GET /v1/flows/{id}`: `steps[].stepId`, which names the step on the flow and exists before it starts, or `steps[].id`, which names one run of it. A bare step id means the run in progress; while more than one run is open, the call returns `409 AMBIGUOUS_STEP` instead of guessing.","name":"stepId","in":"path"}],"responses":{"200":{"description":"The step's settings.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on success."},"data":{"allOf":[{"$ref":"#/components/schemas/RunningStepSettings"},{"description":"The step's settings."}]}},"required":["success","data"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/{id}/steps/{stepId}/monitors":{"get":{"tags":["Steps"],"summary":"Get step monitors (manager)","description":"**Acting as a flow manager.** Returns each monitor on a step (its escalation and the other automatic actions set on it): whether it is armed, when it checks next (`nextCheckAt`) and what it last did on this round of the step (`lastFired`). A monitor whose kind is not turned on for your organization reads `off`: it is never armed and never fires. Escalation needs escalation turned on for your organization; the other monitors need monitors turned on. An overdue timer arms when the step has a due date, and moves when the due date does. An organization API key counts as a flow manager. Without flow manager access, the call returns 403, and for a flow outside your organization, 404.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `flows:read`","security":[{"bearerAuth":["flows:read"]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","description":"The step to act on. Takes either id from `GET /v1/flows/{id}`: `steps[].stepId`, which names the step on the flow and exists before it starts, or `steps[].id`, which names one run of it. A bare step id means the run in progress; while more than one run is open, the call returns `409 AMBIGUOUS_STEP` instead of guessing.","example":"step-2"},"required":true,"description":"The step to act on. Takes either id from `GET /v1/flows/{id}`: `steps[].stepId`, which names the step on the flow and exists before it starts, or `steps[].id`, which names one run of it. A bare step id means the run in progress; while more than one run is open, the call returns `409 AMBIGUOUS_STEP` instead of guessing.","name":"stepId","in":"path"}],"responses":{"200":{"description":"The step's monitors.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on success."},"data":{"allOf":[{"$ref":"#/components/schemas/StepMonitors"},{"description":"The step's monitors."}]}},"required":["success","data"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/{id}/steps/{stepId}/items":{"post":{"tags":["Steps"],"summary":"Add an item to a running For each (manager)","description":"**Acting as a flow manager.** Adds one item to a For each that is running. The item gets its own run of the loop's steps, and the step after the loop waits for it too. A parallel loop starts it now (with a start interval, at its slot); a one-at-a-time loop starts it after the items before it; a loop with Sync steps across items starts it at its first step, and the other items wait for it before their next step. The item is not added to the list the loop came from. **Refusals.** `409 LOOP_NOT_STARTED`: the loop has not started. `409 LOOP_CLOSED`: every item finished and the flow moved on; add a step instead. `409 LOOP_LIMIT_REACHED`: the loop is at its limit. `409 FLOW_PAUSED`: resume the flow first. `409 LOOP_ITEM_UNSUPPORTED`: a loop over uploaded files. `400 INVALID_ITEM`: the item does not match the loop's item fields. `400 NOT_A_LOOP`: the step is not a For each.\n\n**Idempotent.** Send an `Idempotency-Key` header to make retries safe: a retry within 10 minutes returns the same answer and adds no second item.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `flows:write`","security":[{"bearerAuth":["flows:write"]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","description":"The step to act on. Takes either id from `GET /v1/flows/{id}`: `steps[].stepId`, which names the step on the flow and exists before it starts, or `steps[].id`, which names one run of it. A bare step id means the run in progress; while more than one run is open, the call returns `409 AMBIGUOUS_STEP` instead of guessing.","example":"step-2"},"required":true,"description":"The step to act on. Takes either id from `GET /v1/flows/{id}`: `steps[].stepId`, which names the step on the flow and exists before it starts, or `steps[].id`, which names one run of it. A bare step id means the run in progress; while more than one run is open, the call returns `409 AMBIGUOUS_STEP` instead of guessing.","name":"stepId","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":256,"pattern":"^[A-Za-z0-9_\\-:.]+$","description":"An optional key that makes this request safe to retry. Send a new UUID for each request. A key is up to 256 letters, digits, `-`, `_`, `:` or `.`; any other key is refused with `400 INVALID_IDEMPOTENCY_KEY` and nothing runs. A retry with the same key within 10 minutes returns the first response and changes nothing again. After 10 minutes, the same key runs the request again, so use a new key for a late retry. See Idempotency in the Introduction.","example":"6f2c4a5e-3b8d-4c7f-9a1e-2d6b8e0f4c5a"},"required":false,"description":"An optional key that makes this request safe to retry. Send a new UUID for each request. A key is up to 256 letters, digits, `-`, `_`, `:` or `.`; any other key is refused with `400 INVALID_IDEMPOTENCY_KEY` and nothing runs. A retry with the same key within 10 minutes returns the first response and changes nothing again. After 10 minutes, the same key runs the request again, so use a new key for a late retry. See Idempotency in the Introduction.","name":"Idempotency-Key","in":"header"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddLoopItemRequest"}}}},"responses":{"201":{"description":"The item was added.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always true on success."},"data":{"allOf":[{"$ref":"#/components/schemas/AddedLoopItem"},{"description":"The added item."}]}},"required":["success","data"]}}}},"400":{"description":"Refused: `INVALID_ITEM`, `NOT_A_LOOP`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Refused: `FLOW_PAUSED`, `LOOP_CLOSED`, `LOOP_ITEM_UNSUPPORTED`, `LOOP_LIMIT_REACHED`, `LOOP_NOT_STARTED`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"410":{"description":"The first result for this `Idempotency-Key` can no longer be returned, because what it created was deleted. Use a new key for the next attempt.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"425":{"description":"A request with this `Idempotency-Key` is still running. Retry after `Retry-After` seconds. If the first request failed with a `5xx`, the key stays held for 10 minutes; to retry sooner, use a new key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"The first result for this `Idempotency-Key` couldn't be checked. Retry with the same key after a short wait. If it keeps happening, contact support with the `requestId`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/{id}/steps/{stepId}/move":{"post":{"tags":["Steps"],"summary":"Move a step (manager)","description":"**Acting as a flow manager.** Puts a step that hasn't started right after (`afterStepId`) or right before (`beforeStepId`) another step, as dragging it in Edit process does in Moxo, with the same checks.\n\nBoth steps must be at the top level, or inside the same branch, decision or loop while it has not started (any of its paths, as Edit process allows). A step inside one that has not started has no run yet: name it, and the other step, by `steps[].stepId` (listed under `steps[].paths[]`). `data.id` is then `null`.\n\n**Refusals.** A step that has started can't move, and nothing can move in front of a step that has started (`422 STRAND`). Moving a step into or out of a branch, decision or loop, or inside one that has started, returns `422 VIOLATIONS`. A flow that is not running returns `422 NOT_EDITABLE`. A move changes only the order of steps: one that would change anything else returns `409 CHANGES_OTHER_STEPS` (use Edit process). A step moved next to a step inside it returns `409 ANCHOR_INSIDE_MOVED_STEP`. An `afterStepId` or `beforeStepId` that names no step of this flow returns `404 NOT_FOUND`. An organization API key counts as a flow manager. Without flow manager access, the call returns 403, and for a flow outside your organization, 404.\n\nThe step's milestone follows it, as on the canvas in Moxo: it joins the milestone of the step now above it (or below it, when it is first). Moving a step to where it already is changes nothing and returns `moved: false`.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `flows:write`","security":[{"bearerAuth":["flows:write"]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","description":"The step to act on. Takes either id from `GET /v1/flows/{id}`: `steps[].stepId`, which names the step on the flow and exists before it starts, or `steps[].id`, which names one run of it. A bare step id means the run in progress; while more than one run is open, the call returns `409 AMBIGUOUS_STEP` instead of guessing.","example":"step-2"},"required":true,"description":"The step to act on. Takes either id from `GET /v1/flows/{id}`: `steps[].stepId`, which names the step on the flow and exists before it starts, or `steps[].id`, which names one run of it. A bare step id means the run in progress; while more than one run is open, the call returns `409 AMBIGUOUS_STEP` instead of guessing.","name":"stepId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MoveStepRequest"}}}},"responses":{"200":{"description":"The step is in its new place.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/MovedStep"}},"required":["success","data"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Refused: `ANCHOR_INSIDE_MOVED_STEP`, `CHANGES_OTHER_STEPS`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Refused: `NOT_EDITABLE`, `STRAND`, `VIOLATIONS`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/{id}/steps/{stepId}/reassign":{"post":{"tags":["Steps"],"summary":"Reassign a step (manager)","description":"**Acting as a flow manager.** Gives a waiting or in-progress step to someone else. Name the new assignee with `toUserId` or `toEmail`. On a step with several assignees, also send `fromUserId` to say who is being replaced. `role` defaults to `executor`.\n\n**Add or remove one person.** `addSeat: true` adds `toUserId` or `toEmail` beside the current assignees, on this step only, as **Add to this step only** does in Moxo. It is refused on e-sign, DocuSign, Adobe Sign and identity verification steps, and on a document collaboration step (`400 ADD_SEAT_NOT_SUPPORTED`): add the person to a side's role there. `fillLoopItem: true` puts that person on the step as the person for the current row of a parallel For each, beside the roles already on it, as **Assign** does on a row that still needs a person. It is refused when the step is not assigned to the current person (`400 NOT_A_LOOP_ITEM_STEP`). `unassign: true` with `fromUserId` takes that person off the step, as **Remove from step** does; everyone else keeps their place. A part they have already done, or that is no longer needed, stays: with nothing else left to take off, `unassign` returns `409 SEAT_ALREADY_DONE`. Giving such a part to someone else is refused the same way (`409 SEAT_ALREADY_DONE`): reopen the step to have it redone. `role: \"reviewer\"` on a step with no review returns `409 STEP_HAS_NO_REVIEW` and seats no one: a reassign never adds a review.\n\n**The person must already be a user in your organization.** An `email` that matches nobody returns `USER_NOT_FOUND` instead of inviting anyone. Create new people with `POST /v1/users` first.\n\n**Already theirs.** Giving the step to the person who already has it changes nothing: the answer says `changed: false`.\n\n**Idempotent.** Send an `Idempotency-Key` header to make retries safe: a retry within 10 minutes returns the same response and doesn't notify the assignee again.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `flows:write`","security":[{"bearerAuth":["flows:write"]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","description":"The step to act on. Takes either id from `GET /v1/flows/{id}`: `steps[].stepId`, which names the step on the flow and exists before it starts, or `steps[].id`, which names one run of it. A bare step id means the run in progress; while more than one run is open, the call returns `409 AMBIGUOUS_STEP` instead of guessing.","example":"step-2"},"required":true,"description":"The step to act on. Takes either id from `GET /v1/flows/{id}`: `steps[].stepId`, which names the step on the flow and exists before it starts, or `steps[].id`, which names one run of it. A bare step id means the run in progress; while more than one run is open, the call returns `409 AMBIGUOUS_STEP` instead of guessing.","name":"stepId","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":256,"pattern":"^[A-Za-z0-9_\\-:.]+$","description":"An optional key that makes this request safe to retry. Send a new UUID for each request. A key is up to 256 letters, digits, `-`, `_`, `:` or `.`; any other key is refused with `400 INVALID_IDEMPOTENCY_KEY` and nothing runs. A retry with the same key within 10 minutes returns the first response and changes nothing again. After 10 minutes, the same key runs the request again, so use a new key for a late retry. See Idempotency in the Introduction.","example":"6f2c4a5e-3b8d-4c7f-9a1e-2d6b8e0f4c5a"},"required":false,"description":"An optional key that makes this request safe to retry. Send a new UUID for each request. A key is up to 256 letters, digits, `-`, `_`, `:` or `.`; any other key is refused with `400 INVALID_IDEMPOTENCY_KEY` and nothing runs. A retry with the same key within 10 minutes returns the first response and changes nothing again. After 10 minutes, the same key runs the request again, so use a new key for a late retry. See Idempotency in the Introduction.","name":"Idempotency-Key","in":"header"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReassignStepRequest"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."},"changed":{"type":"boolean","description":"`true` when this call changed what you asked it to. `false` when that was already so, and the call changed nothing of it."},"message":{"type":"string","description":"Only with `changed: false`: what was already so.","example":"Nothing changed: this person already holds this role."}},"required":["success","changed"],"additionalProperties":false}}}},"400":{"description":"Refused: `ADD_SEAT_NOT_SUPPORTED`, `NOT_A_LOOP_ITEM_STEP`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Refused: `SEAT_ALREADY_DONE`, `STEP_HAS_NO_REVIEW`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"410":{"description":"The first result for this `Idempotency-Key` can no longer be returned, because what it created was deleted. Use a new key for the next attempt.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"425":{"description":"A request with this `Idempotency-Key` is still running. Retry after `Retry-After` seconds. If the first request failed with a `5xx`, the key stays held for 10 minutes; to retry sooner, use a new key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"The first result for this `Idempotency-Key` couldn't be checked. Retry with the same key after a short wait. If it keeps happening, contact support with the `requestId`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/{id}/steps/{stepId}/remind":{"post":{"tags":["Steps"],"summary":"Send a reminder (manager)","description":"**Acting as a flow manager.** Reminds the step's current assignee. A step that is not open (waiting, finished or skipped) returns `400 INVALID_STATE`; a paused flow, `409 FLOW_PAUSED`.\n\n**Or as a participant whose role can send reminders.** A personal access token of someone in a role with **Can send reminders** (and the organization's **Advanced participant permissions** on) may remind on a step they can see that someone else still has to do. Everyone the step waits on is reminded, never the caller; naming one person (`userId`) or one section (`sectionId`) stays a flow manager's and returns `403 SEAT_REMIND_MANAGER_ONLY`. A step id that more than one run shares names the open run, as for a flow manager. Any other step returns `403`.\n\n**Nobody to remind.** When the reminder would reach nobody, nothing is sent or recorded and the answer is `400 NOTHING_TO_REMIND` with `error.reason`: the step is still being prepared (`preparing`), no one has anything to do on it yet (`nobody_acting`), the person named has nothing to do on it (`seat_not_acting`), or everyone on it has turned off their own reminders (`muted`). The template's reminder settings, such as Due date approaching, only turn off automatic reminders: they never stop this one. A reminder that was tried and reached nobody returns `502 REMINDER_NOT_SENT`, and nothing is recorded: try again.\n\n**Remind one person.** With no body, everyone the step is waiting on is reminded. Send `userId` to remind only that person, as the per-person Remind in the app does, or `sectionId` on a document written together in sections to remind only that section's writers. The step and the flow are checked first, as above, whoever is named. A person who is not on the step returns `400 SEAT_NOT_ON_STEP`, the same for an id in no organization and one in another. A person on the step it isn't waiting on (their part is done, or their part comes in another phase or later in a sequence) is not reminded: `400 NOTHING_TO_REMIND` with its `error.reason`, and nothing is recorded. `sectionId` on any other step returns `400 SECTIONS_NOT_SUPPORTED`.\n\n**Idempotent.** Send an `Idempotency-Key` to make retries safe: a retry within 10 minutes sends no second reminder. A retry after 10 minutes sends another one.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `flows:write`","security":[{"bearerAuth":["flows:write"]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","description":"The step to act on. Takes either id from `GET /v1/flows/{id}`: `steps[].stepId`, which names the step on the flow and exists before it starts, or `steps[].id`, which names one run of it. A bare step id means the run in progress; while more than one run is open, the call returns `409 AMBIGUOUS_STEP` instead of guessing.","example":"step-2"},"required":true,"description":"The step to act on. Takes either id from `GET /v1/flows/{id}`: `steps[].stepId`, which names the step on the flow and exists before it starts, or `steps[].id`, which names one run of it. A bare step id means the run in progress; while more than one run is open, the call returns `409 AMBIGUOUS_STEP` instead of guessing.","name":"stepId","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":256,"pattern":"^[A-Za-z0-9_\\-:.]+$","description":"An optional key that makes this request safe to retry. Send a new UUID for each request. A key is up to 256 letters, digits, `-`, `_`, `:` or `.`; any other key is refused with `400 INVALID_IDEMPOTENCY_KEY` and nothing runs. A retry with the same key within 10 minutes returns the first response and changes nothing again. After 10 minutes, the same key runs the request again, so use a new key for a late retry. See Idempotency in the Introduction.","example":"6f2c4a5e-3b8d-4c7f-9a1e-2d6b8e0f4c5a"},"required":false,"description":"An optional key that makes this request safe to retry. Send a new UUID for each request. A key is up to 256 letters, digits, `-`, `_`, `:` or `.`; any other key is refused with `400 INVALID_IDEMPOTENCY_KEY` and nothing runs. A retry with the same key within 10 minutes returns the first response and changes nothing again. After 10 minutes, the same key runs the request again, so use a new key for a late retry. See Idempotency in the Introduction.","name":"Idempotency-Key","in":"header"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":["object","null"],"properties":{"userId":{"type":"string","minLength":1,"description":"Remind only this person (`usr_…`), as the per-person Remind in the app's step panel does. They must be on the step (`400 SEAT_NOT_ON_STEP` otherwise). They are reminded only when the step is waiting on them (`400 NOTHING_TO_REMIND` otherwise, and nothing is sent).","example":"usr_7Kd2mQxWnR4vT9pLcYb3Ae"},"sectionId":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,39}$","description":"On a document written together in sections: remind only the people who write this section (its `sectionId` in the step's settings). Any other step answers `400 SECTIONS_NOT_SUPPORTED`.","example":"pricing"}},"additionalProperties":false}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]}},"required":["success"]}}}},"400":{"description":"Nobody to remind (`NOTHING_TO_REMIND`, with `error.reason`), the step is not open (`INVALID_STATE`), the person named is not on the step (`SEAT_NOT_ON_STEP`), or a section was named on a step without sections (`SECTIONS_NOT_SUPPORTED`).","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[false],"description":"Always `false` on an error."},"error":{"type":"object","properties":{"code":{"type":"string","enum":["NOTHING_TO_REMIND"],"description":"The error code."},"message":{"type":"string","description":"Why nobody was reminded, in a sentence."},"reason":{"type":"string","enum":["preparing","nobody_acting","seat_not_acting","muted"],"description":"Why nobody was reminded: `preparing` (the step is still being prepared), `nobody_acting` (no one has anything to do on the step yet), `seat_not_acting` (the person named has nothing to do on it) or `muted` (everyone on it has turned off their own reminders; a template's or role's reminder settings never cause it). Absent on a document written together whose sides have all had their turn."}},"required":["code","message"],"additionalProperties":false,"description":"What went wrong."}},"required":["success","error"],"additionalProperties":false},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Refused: `FLOW_PAUSED`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"410":{"description":"The first result for this `Idempotency-Key` can no longer be returned, because what it created was deleted. Use a new key for the next attempt.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"425":{"description":"A request with this `Idempotency-Key` is still running. Retry after `Retry-After` seconds. If the first request failed with a `5xx`, the key stays held for 10 minutes; to retry sooner, use a new key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"502":{"description":"The reminder was tried and reached nobody (`REMINDER_NOT_SENT`). Nothing was recorded. Try again.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[false],"description":"Always `false` on an error."},"error":{"type":"object","properties":{"code":{"type":"string","enum":["REMINDER_NOT_SENT"],"description":"The error code."},"message":{"type":"string","description":"What went wrong, in a sentence."}},"required":["code","message"],"additionalProperties":false,"description":"What went wrong."}},"required":["success","error"],"additionalProperties":false}}}},"503":{"description":"The first result for this `Idempotency-Key` couldn't be checked. Retry with the same key after a short wait. If it keeps happening, contact support with the `requestId`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/{id}/remind":{"post":{"tags":["Steps"],"summary":"Remind everyone a flow is waiting on (manager)","description":"**Acting as a flow manager.** Sends the people the flow is waiting on the same reminder as each waiting step's own Remind. No body.\n\nNot idempotent: each call sends another reminder. The app's 24-hour wait between reminders doesn't apply to API calls. A paused flow returns `409 FLOW_PAUSED`. A flow with nobody waiting returns `400 NOTHING_TO_REMIND`. A send that reached nobody returns `502 REMINDER_NOT_SENT`.\n\n`200` returns `data.reminded` (how many waiting steps were reminded) and `data.lastReminderSentAt` (the ISO time of the newest reminder on an active step, or `null`).\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `flows:write`","security":[{"bearerAuth":["flows:write"]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"reminded":{"type":"integer"},"lastReminderSentAt":{"type":["string","null"],"format":"date-time"}},"required":["reminded","lastReminderSentAt"]}},"required":["success","data"]}}}},"400":{"description":"Nobody is waiting on this flow (`NOTHING_TO_REMIND`). People who turned off their own reminders are this case; a role with due-date reminders turned off is not.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[false],"description":"Always `false` on an error."},"error":{"type":"object","properties":{"code":{"type":"string","enum":["NOTHING_TO_REMIND"],"description":"The error code."},"message":{"type":"string","description":"What went wrong, in a sentence."}},"required":["code","message"],"additionalProperties":false,"description":"What went wrong."}},"required":["success","error"],"additionalProperties":false}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"The flow is paused (`FLOW_PAUSED`).","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[false],"description":"Always `false` on an error."},"error":{"type":"object","properties":{"code":{"type":"string","enum":["FLOW_PAUSED"],"description":"The error code."},"message":{"type":"string","description":"What went wrong, in a sentence."}},"required":["code","message"],"additionalProperties":false,"description":"What went wrong."}},"required":["success","error"],"additionalProperties":false}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"502":{"description":"A recipient was tried and the reminder reached nobody (`REMINDER_NOT_SENT`). Nothing was recorded. Try again.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[false],"description":"Always `false` on an error."},"error":{"type":"object","properties":{"code":{"type":"string","enum":["REMINDER_NOT_SENT"],"description":"The error code."},"message":{"type":"string","description":"What went wrong, in a sentence."}},"required":["code","message"],"additionalProperties":false,"description":"What went wrong."}},"required":["success","error"],"additionalProperties":false}}}}}}},"/v1/flows/{id}/steps/{stepExecId}/retry":{"post":{"tags":["Steps"],"summary":"Retry a failed step (manager)","description":"**Acting as a flow manager.** Runs a failed automation step again (an AI step, a webhook or a scheduled email). A step a person does never fails; if someone isn't acting, send a reminder or reassign the step. Send `{ \"omitMissingAttachments\": true }` to send an email that stopped because a file is not available, leaving those files off. That flag is refused for any other step.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `flows:write`","security":[{"bearerAuth":["flows:write"]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","description":"The step to act on. Takes only a run's `steps[].id` from `GET /v1/flows/{id}`. Unlike the other step endpoints, it doesn't take a `stepId`. It names the run that failed, which is why this parameter is named `{stepExecId}`.","example":"step-2"},"required":true,"description":"The step to act on. Takes only a run's `steps[].id` from `GET /v1/flows/{id}`. Unlike the other step endpoints, it doesn't take a `stepId`. It names the run that failed, which is why this parameter is named `{stepExecId}`.","name":"stepExecId","in":"path"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":["object","null"],"properties":{"omitMissingAttachments":{"type":"boolean","description":"Send this email without the files that are not available. Only for an email that stopped because a file is not available."}},"additionalProperties":false}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]}},"required":["success"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/{id}/steps/{stepId}/reopen":{"post":{"tags":["Steps"],"summary":"Reopen a step (manager)","description":"**Acting as a flow manager.** Sends a finished step back so its assignee can change what they submitted. The step returns to `IN_PROGRESS` and they are notified again. With `sendBackTo: \"preparers\"` it goes back to the people preparing it instead (the step returns to `PREPARING`), from a finished step or one still with its assignee.\n\n**Or as a participant whose role can reopen completed actions.** A personal access token of someone in a role with **Can reopen completed actions** (and the organization's **Advanced participant permissions** on) may reopen a finished step they can see on a running flow, except a payment or a signature step. It goes back to whoever did it: `sendBackTo: \"preparers\"` stays a flow manager's and returns `403 SEND_BACK_MANAGER_ONLY`. Any other step returns `403`.\n\n**Every step after it starts over.** The later steps that started or finished go back to waiting, and run again once this step is done again. Three kinds stay as they are: a payment already taken, a signature step everyone signed (one signed part of the way waits with its signatures), and a step a person removed from the flow.\n\n`stepId` is `steps[].id` or `steps[].stepId`. Either works when the step ran once. When the step runs once for each item, every copy shares `stepId`, so that shared id returns `409 AMBIGUOUS_STEP` and reopens nothing. Send `steps[].id` for the copy you want.\n\n**A step that closed at its due date** (`closeAtDue` in its settings) reopens only for a flow manager; a participant gets `403 REOPEN_CLOSED_ACTION_MANAGER_ONLY`.\n\n**An action that has finished stays finished.** A step in a one-off action (`kind: \"action\"`) whose action has completed returns `409 ACTION_ENDED`: send it to someone else instead. A step in an action that is still open can be sent back as before.\n\n**A step that reopens but cannot start** returns `409 REOPENED_STEP_FAILED`: the reopen happened, and the step is now `FAILED` with the reason on the step (a signature step whose signing document can't be opened, say). Fix what the message names. A failed signature step starts over when a step before it is reopened (to send a new document, for example).\n\n**Idempotent.** Send an `Idempotency-Key` header to make retries safe: a retry within 10 minutes doesn't reopen the step a second time, and gets the same answer, `409 REOPENED_STEP_FAILED` included.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `flows:write`","security":[{"bearerAuth":["flows:write"]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","description":"The step to act on. Takes either id from `GET /v1/flows/{id}`: `steps[].stepId`, which names the step on the flow and exists before it starts, or `steps[].id`, which names one run of it. A bare step id is accepted only while exactly one run has it; once a step has more than one run, it returns `409 AMBIGUOUS_STEP` and reopens nothing.","example":"step-2"},"required":true,"description":"The step to act on. Takes either id from `GET /v1/flows/{id}`: `steps[].stepId`, which names the step on the flow and exists before it starts, or `steps[].id`, which names one run of it. A bare step id is accepted only while exactly one run has it; once a step has more than one run, it returns `409 AMBIGUOUS_STEP` and reopens nothing.","name":"stepId","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":256,"pattern":"^[A-Za-z0-9_\\-:.]+$","description":"An optional key that makes this request safe to retry. Send a new UUID for each request. A key is up to 256 letters, digits, `-`, `_`, `:` or `.`; any other key is refused with `400 INVALID_IDEMPOTENCY_KEY` and nothing runs. A retry with the same key within 10 minutes returns the first response and changes nothing again. After 10 minutes, the same key runs the request again, so use a new key for a late retry. See Idempotency in the Introduction.","example":"6f2c4a5e-3b8d-4c7f-9a1e-2d6b8e0f4c5a"},"required":false,"description":"An optional key that makes this request safe to retry. Send a new UUID for each request. A key is up to 256 letters, digits, `-`, `_`, `:` or `.`; any other key is refused with `400 INVALID_IDEMPOTENCY_KEY` and nothing runs. A retry with the same key within 10 minutes returns the first response and changes nothing again. After 10 minutes, the same key runs the request again, so use a new key for a late retry. See Idempotency in the Introduction.","name":"Idempotency-Key","in":"header"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReopenStepRequest"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]}},"required":["success"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Refused: `ACTION_ENDED`, `AMBIGUOUS_STEP`, `REOPENED_STEP_FAILED`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"410":{"description":"The first result for this `Idempotency-Key` can no longer be returned, because what it created was deleted. Use a new key for the next attempt.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"425":{"description":"A request with this `Idempotency-Key` is still running. Retry after `Retry-After` seconds. If the first request failed with a `5xx`, the key stays held for 10 minutes; to retry sooner, use a new key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"The first result for this `Idempotency-Key` couldn't be checked. Retry with the same key after a short wait. If it keeps happening, contact support with the `requestId`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/{id}/steps/{stepId}/custom-status":{"put":{"tags":["Steps"],"summary":"Set a step status","description":"**Acting as a flow manager.** Puts one of the template's own step statuses (like \"Awaiting counterparty\") on an open step, or takes it off with `status: null`. The status shows beside the step's `status` to everyone who sees the step; it never changes `status`. Send the status's `key` from the template's `stepStatuses` (`GET /v1/templates/{id}`) or from a step's `customStatus.key`.\n\n**It belongs to the step's current round.** Reopening the step, or a loop running it again, clears it.\n\n**Or as a participant whose role can update step statuses.** A personal access token of someone in a role with **Can update step statuses** may set it on an open step they can see. Any other step returns `403`.\n\nA key the flow's template doesn't list returns `400 UNKNOWN_STEP_STATUS`; a step that hasn't started or is finished, `409 STEP_NOT_OPEN`; a flow that isn't running, `409 FLOW_NOT_RUNNING`; an organization whose plan doesn't have Custom step statuses, `403 FEATURE_DISABLED`. Setting the status the step already has changes nothing.\n\n**Idempotent.** Send an `Idempotency-Key` header to make retries safe: a retry within 10 minutes answers with the step's status as it is then.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `flows:write`","security":[{"bearerAuth":["flows:write"]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","description":"The step to act on. Takes either id from `GET /v1/flows/{id}`: `steps[].stepId`, which names the step on the flow and exists before it starts, or `steps[].id`, which names one run of it. A bare step id means the run in progress; while more than one run is open, the call returns `409 AMBIGUOUS_STEP` instead of guessing.","example":"step-2"},"required":true,"description":"The step to act on. Takes either id from `GET /v1/flows/{id}`: `steps[].stepId`, which names the step on the flow and exists before it starts, or `steps[].id`, which names one run of it. A bare step id means the run in progress; while more than one run is open, the call returns `409 AMBIGUOUS_STEP` instead of guessing.","name":"stepId","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":256,"pattern":"^[A-Za-z0-9_\\-:.]+$","description":"An optional key that makes this request safe to retry. Send a new UUID for each request. A key is up to 256 letters, digits, `-`, `_`, `:` or `.`; any other key is refused with `400 INVALID_IDEMPOTENCY_KEY` and nothing runs. A retry with the same key within 10 minutes returns the first response and changes nothing again. After 10 minutes, the same key runs the request again, so use a new key for a late retry. See Idempotency in the Introduction.","example":"6f2c4a5e-3b8d-4c7f-9a1e-2d6b8e0f4c5a"},"required":false,"description":"An optional key that makes this request safe to retry. Send a new UUID for each request. A key is up to 256 letters, digits, `-`, `_`, `:` or `.`; any other key is refused with `400 INVALID_IDEMPOTENCY_KEY` and nothing runs. A retry with the same key within 10 minutes returns the first response and changes nothing again. After 10 minutes, the same key runs the request again, so use a new key for a late retry. See Idempotency in the Introduction.","name":"Idempotency-Key","in":"header"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":["string","null"],"minLength":1,"maxLength":60,"description":"The status's `key`, or `null` to take the status off.","example":"awaiting_counterparty"}},"required":["status"],"additionalProperties":false}}}},"responses":{"200":{"description":"The step's status after the call.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on success."},"data":{"type":"object","properties":{"customStatus":{"anyOf":[{"$ref":"#/components/schemas/StepStatus"},{"type":"null"}],"description":"The status now on the step, or `null`."}},"required":["customStatus"],"description":"The step's status after the call."}},"required":["success","data"]}}}},"400":{"description":"Refused: `UNKNOWN_STEP_STATUS`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Refused: `FLOW_NOT_RUNNING`, `STEP_NOT_OPEN`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"410":{"description":"The first result for this `Idempotency-Key` can no longer be returned, because what it created was deleted. Use a new key for the next attempt.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"425":{"description":"A request with this `Idempotency-Key` is still running. Retry after `Retry-After` seconds. If the first request failed with a `5xx`, the key stays held for 10 minutes; to retry sooner, use a new key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"The first result for this `Idempotency-Key` couldn't be checked. Retry with the same key after a short wait. If it keeps happening, contact support with the `requestId`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/{id}/steps/{stepId}/force-complete":{"post":{"x-moxo-person-only":"ORG_KEY_NOT_SUPPORTED","tags":["Steps"],"summary":"Force-complete a step (manager)","description":"**Acting as a flow manager.** Closes the step for the assignee, usually because they are unavailable or the work happened outside Moxo. Records `forceCompleted=true` with your reason, so the audit trail shows that a flow manager closed it instead of the assignee finishing it. Use `/complete` when the assignee really did the work. Send `resultData` to record the step's result, in the same shape as `/complete`, keyed by field id. Fields may be left blank, but every key must be a field of the step and every value one its field can hold, or the call returns `400 VALIDATION_FAILED` and nothing changes; a body key this call doesn't take is refused the same way. A force-complete names the person who closed the step, so an organization API key gets `403 ORG_KEY_NOT_SUPPORTED` before anything else is checked: use a flow manager's personal access token. A step the flow hasn't reached yet returns `409 STEP_NOT_REACHED`: a step is not closed by hand out of order. A step with a reviewer still goes to its reviewer, who approves it or asks for changes; send `skipReview: true` to complete it now without its review. `data.outcome` says which happened: `completed` or `sent_to_review`; a step that could not go to its reviewer yet returns `409 STEP_NOT_SENT_TO_REVIEW` (read it again). A step already with its reviewer returns `409 STEP_AWAITING_REVIEW` unless you send `skipReview: true`. Returns 403 if you don't manage the flow, `409 ALREADY_COMPLETED` if the step was completed first by someone else, `409 FOR_EACH_SOURCE_UNRESOLVABLE` for a For each step that still cannot read the list it repeats over (skip it, or fix its list and retry), `409 SUB_FLOW_OPEN` for a sub-flow step the flow waits for while its sub-flow is still running or paused (finish or cancel the sub-flow first; `error.details` has `childFlowId`, `childFlowName` and `remainingActions` when you can open the sub-flow, else `null`, and `templateName`), and `409 STALE_ACTION` if the step changed while it was being closed (on a document collaboration, a side sent a newer version); re-read the flow and retry.\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","description":"The step to act on. Takes either id from `GET /v1/flows/{id}`: `steps[].stepId`, which names the step on the flow and exists before it starts, or `steps[].id`, which names one run of it. A bare step id means the run in progress; while more than one run is open, the call returns `409 AMBIGUOUS_STEP` instead of guessing.","example":"step-2"},"required":true,"description":"The step to act on. Takes either id from `GET /v1/flows/{id}`: `steps[].stepId`, which names the step on the flow and exists before it starts, or `steps[].id`, which names one run of it. A bare step id means the run in progress; while more than one run is open, the call returns `409 AMBIGUOUS_STEP` instead of guessing.","name":"stepId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForceCompleteStepRequest"}}}},"responses":{"200":{"description":"What happened to the step.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"outcome":{"type":"string","enum":["completed","sent_to_review","failed"],"description":"`completed`: the step is closed, recorded as forced. A Pick the record whose If no record matches is Continue closes with no record. `sent_to_review`: the step has a reviewer and `skipReview` was not sent, so it went to its reviewer, who approves it or asks for changes. `failed`: a Pick the record waiting for a pick whose If no record matches is Stop. The step failed and no record was chosen."}},"required":["outcome"],"description":"What the force-complete did."}},"required":["success","data"]}}}},"400":{"description":"Refused: `VALIDATION_FAILED`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Refused: `ALREADY_COMPLETED`, `FOR_EACH_SOURCE_UNRESOLVABLE`, `STALE_ACTION`, `STEP_AWAITING_REVIEW`, `STEP_NOT_REACHED`, `STEP_NOT_SENT_TO_REVIEW`, `SUB_FLOW_OPEN`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/{id}/steps/{stepId}/close-now":{"post":{"tags":["Steps"],"summary":"Close a step now (manager)","description":"**Acting as a flow manager.** For a form or file request that closes at its due date (`closeAtDue` in its settings): closes it now, exactly as its close would. A form keeps every valid answer saved so far, a file request every uploaded file, and the flow moves on (a step with a reviewer goes to its reviewer). The people who submitted count as done; the rest are no longer needed. `data.outcome` is `completed` or `sent_to_review`. A step that has no close, or isn't open, returns `409 ACTION_NOT_OPEN`; one with its reviewer, `409 STEP_IN_REVIEW`; a paused flow, `409 FLOW_PAUSED`. Returns 403 if you don't manage the flow.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `flows:write`","security":[{"bearerAuth":["flows:write"]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","description":"The step to act on. Takes either id from `GET /v1/flows/{id}`: `steps[].stepId`, which names the step on the flow and exists before it starts, or `steps[].id`, which names one run of it. A bare step id means the run in progress; while more than one run is open, the call returns `409 AMBIGUOUS_STEP` instead of guessing.","example":"step-2"},"required":true,"description":"The step to act on. Takes either id from `GET /v1/flows/{id}`: `steps[].stepId`, which names the step on the flow and exists before it starts, or `steps[].id`, which names one run of it. A bare step id means the run in progress; while more than one run is open, the call returns `409 AMBIGUOUS_STEP` instead of guessing.","name":"stepId","in":"path"}],"responses":{"200":{"description":"What happened to the step.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true`: the step closed."},"data":{"type":"object","properties":{"outcome":{"type":"string","enum":["completed","sent_to_review"],"description":"`completed`: the step closed and the flow moved on. `sent_to_review`: the step has a reviewer, so it went to its reviewer, who approves it or asks for changes."}},"required":["outcome"],"description":"What the close did."}},"required":["success","data"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Refused: `ACTION_NOT_OPEN`, `FLOW_PAUSED`, `STEP_IN_REVIEW`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/{id}/steps/{stepId}/meeting/cancel":{"post":{"tags":["Steps"],"summary":"Cancel a booked meeting","description":"For a Time Booking step that booked a meeting: cancels it before it starts. The host's calendar event is canceled first, which frees the time (and a meeting room booked on it) and tells the guests; if the calendar can't be reached nothing changes and the call returns `409 CALENDAR_RECONNECT_NEEDED` or `503 CALENDAR_UNAVAILABLE`. Then the meeting reads `Canceled` in the step's `meet.status` output, its reminders stop, and its Zoom, Teams or Moxo meeting is removed where Moxo can (`data.onlineMeeting`). When the step is set to end the flow (`onMeetingCanceled: end_flow`) the flow is canceled too. A flow's managers can cancel; with the step's `bookerCanCancel`, so can the host and an internal user who booked. Returns `409 MEETING_NOT_BOOKED`, `409 MEETING_ALREADY_CANCELED` or `409 MEETING_STARTED` when there is nothing to cancel, `409 MEETING_CANCEL_BOOKING_TOO_OLD` for a meeting booked with no calendar before Moxo kept who to tell, and 403 `MEETING_CANCEL_FORBIDDEN` otherwise.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `flows:write`","security":[{"bearerAuth":["flows:write"]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","description":"The step to act on. Takes either id from `GET /v1/flows/{id}`: `steps[].stepId`, which names the step on the flow and exists before it starts, or `steps[].id`, which names one run of it. A bare step id is accepted only while exactly one run has it; once a step has more than one run, it returns `409 AMBIGUOUS_STEP` and cancels nothing.","example":"step-2"},"required":true,"description":"The step to act on. Takes either id from `GET /v1/flows/{id}`: `steps[].stepId`, which names the step on the flow and exists before it starts, or `steps[].id`, which names one run of it. A bare step id is accepted only while exactly one run has it; once a step has more than one run, it returns `409 AMBIGUOUS_STEP` and cancels nothing.","name":"stepId","in":"path"}],"responses":{"200":{"description":"The meeting is canceled.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true`: the meeting is canceled and its time is free."},"data":{"type":"object","properties":{"stepExecutionId":{"type":"string","description":"The run of the Time Booking step whose meeting was canceled."},"onlineMeeting":{"type":"string","enum":["removed","not_needed","left_open","not_possible"],"description":"What happened to the online meeting. `removed`: it is gone. `not_needed`: there was none (in person, a phone call, a shared link). `left_open`: Moxo couldn't remove it (the provider refused, or someone had joined). `not_possible`: the provider has no way to remove it (Google Meet on an Outlook calendar)."},"endedFlow":{"type":"boolean","description":"`true` when the step is set to end the flow with the meeting, and the flow was canceled."}},"required":["stepExecutionId","onlineMeeting","endedFlow"],"description":"What the cancel did."}},"required":["success","data"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Refused: `CALENDAR_RECONNECT_NEEDED`, `MEETING_ALREADY_CANCELED`, `MEETING_CANCEL_BOOKING_TOO_OLD`, `MEETING_NOT_BOOKED`, `MEETING_STARTED`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Refused: `CALENDAR_UNAVAILABLE`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/{id}/steps/{stepId}/meeting/slots":{"get":{"tags":["Steps"],"summary":"List free times to move a booked meeting to","description":"For a Time Booking step that booked a meeting: the host's free times on one day, under the step's booking rules (its hours, booking buffer and length), with the meeting's own time not counted as busy and a booked meeting room free too. Who may read them is who may reschedule: a flow's managers, and with the step's `bookerCanReschedule`, the host and an internal user who booked (403 `MEETING_RESCHEDULE_FORBIDDEN` otherwise). Returns `409 MEETING_RESCHEDULE_NOT_SUPPORTED` for a Calendly or Zoom Scheduler booking, `409 MEETING_RESCHEDULE_BOOKING_TOO_OLD` for a booking made before Moxo kept its host and calendar, and `409 MEETING_RESCHEDULE_NO_HOURS` when the booking has no hours or calendar to read.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `flows:read`","security":[{"bearerAuth":["flows:read"]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","description":"The step to act on. Takes either id from `GET /v1/flows/{id}`: `steps[].stepId`, which names the step on the flow and exists before it starts, or `steps[].id`, which names one run of it. A bare step id is accepted only while exactly one run has it; once a step has more than one run, it returns `409 AMBIGUOUS_STEP` and moves nothing.","example":"step-2"},"required":true,"description":"The step to act on. Takes either id from `GET /v1/flows/{id}`: `steps[].stepId`, which names the step on the flow and exists before it starts, or `steps[].id`, which names one run of it. A bare step id is accepted only while exactly one run has it; once a step has more than one run, it returns `409 AMBIGUOUS_STEP` and moves nothing.","name":"stepId","in":"path"},{"schema":{"type":"string","description":"The day, `YYYY-MM-DD`."},"required":true,"description":"The day, `YYYY-MM-DD`.","name":"date","in":"query"},{"schema":{"type":"string","description":"The IANA time zone the day is read in, such as `Asia/Kuala_Lumpur`."},"required":true,"description":"The IANA time zone the day is read in, such as `Asia/Kuala_Lumpur`.","name":"timezone","in":"query"}],"responses":{"200":{"description":"The host's free times on that day.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true`."},"data":{"type":"object","properties":{"stepExecutionId":{"type":"string","description":"The run of the Time Booking step whose meeting would move."},"date":{"type":"string","description":"The day listed, `YYYY-MM-DD` in `timezone`."},"timezone":{"type":"string","description":"The time zone the day is read in."},"duration":{"type":"integer","description":"The meeting length in minutes."},"earliestBookableDate":{"type":"string","description":"The first day the step's booking buffer allows, `YYYY-MM-DD`."},"current":{"type":"object","properties":{"start":{"type":"string","description":"The start, ISO 8601 in UTC."},"end":{"type":"string","description":"The end, ISO 8601 in UTC."}},"required":["start","end"],"description":"The meeting's time now."},"slots":{"type":"array","items":{"type":"object","properties":{"start":{"type":"string","description":"The start, ISO 8601 in UTC."},"end":{"type":"string","description":"The end, ISO 8601 in UTC."}},"required":["start","end"]},"description":"The times the meeting can move to. Send one to Reschedule a booked meeting."}},"required":["stepExecutionId","date","timezone","duration","earliestBookableDate","current","slots"],"description":"The free times on that day."}},"required":["success","data"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Refused: `MEETING_RESCHEDULE_BOOKING_TOO_OLD`, `MEETING_RESCHEDULE_NOT_SUPPORTED`, `MEETING_RESCHEDULE_NO_HOURS`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/{id}/steps/{stepId}/meeting/reschedule":{"post":{"tags":["Steps"],"summary":"Reschedule a booked meeting","description":"Moves a Time Booking step's booked meeting to one of the free times List free times offers, before it starts. The same calendar event on the host's calendar moves and the guests get the calendar's update; if the calendar can't be reached nothing changes (`409 CALENDAR_RECONNECT_NEEDED`, `503 CALENDAR_UNAVAILABLE`), and an event deleted from the calendar is never recreated (`409 MEETING_NOT_ON_CALENDAR`). Then `meet.startTime` and `meet.endTime` give the new time, `meet.status` reads `Rescheduled`, the reminder is replaced, the people who got Meeting confirmed get Meeting rescheduled, and a separate Zoom, Teams or Moxo Meet meeting moves where Moxo can (`data.onlineMeeting`). A time that is no longer free returns `409 MEETING_TIME_NOT_FREE`; the time it already has, `409 MEETING_SAME_TIME`. While someone else moves or cancels it, `409 MEETING_CHANGE_IN_PROGRESS`; if the step changed during the move, the event is moved back and the call returns `409 MEETING_CHANGE_STEP_CHANGED`. A flow's managers can reschedule; with the step's `bookerCanReschedule`, so can the host and an internal user who booked.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `flows:write`","security":[{"bearerAuth":["flows:write"]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","description":"The step to act on. Takes either id from `GET /v1/flows/{id}`: `steps[].stepId`, which names the step on the flow and exists before it starts, or `steps[].id`, which names one run of it. A bare step id is accepted only while exactly one run has it; once a step has more than one run, it returns `409 AMBIGUOUS_STEP` and moves nothing.","example":"step-2"},"required":true,"description":"The step to act on. Takes either id from `GET /v1/flows/{id}`: `steps[].stepId`, which names the step on the flow and exists before it starts, or `steps[].id`, which names one run of it. A bare step id is accepted only while exactly one run has it; once a step has more than one run, it returns `409 AMBIGUOUS_STEP` and moves nothing.","name":"stepId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"start":{"type":"string","format":"date-time","description":"The new start, ISO 8601 with a time-zone offset, exactly as List free times returned it."},"end":{"type":"string","format":"date-time","description":"The new end, ISO 8601 with a time-zone offset, exactly as List free times returned it."},"timezone":{"type":"string","minLength":1,"maxLength":64,"description":"The IANA time zone those free times were read in, such as `Asia/Kuala_Lumpur`."}},"required":["start","end","timezone"],"additionalProperties":false}}}},"responses":{"200":{"description":"The meeting moved.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true`: the calendar event moved and the meeting reads Rescheduled."},"data":{"type":"object","properties":{"stepExecutionId":{"type":"string","description":"The run of the Time Booking step whose meeting moved."},"from":{"type":"object","properties":{"start":{"type":"string","description":"The start, ISO 8601 in UTC."},"end":{"type":"string","description":"The end, ISO 8601 in UTC."}},"required":["start","end"],"description":"The time it moved from."},"to":{"type":"object","properties":{"start":{"type":"string","description":"The start, ISO 8601 in UTC."},"end":{"type":"string","description":"The end, ISO 8601 in UTC."}},"required":["start","end"],"description":"The new time."},"onlineMeeting":{"type":"string","enum":["moved","not_needed","old_time"],"description":"What happened to the online meeting. `moved`: it shows the new time. `not_needed`: there was nothing to move (in person, a phone call, a shared link, or Google Meet on an Outlook calendar). `old_time`: Moxo couldn't move it; its link still works, and inside its own app it shows the old time."}},"required":["stepExecutionId","from","to","onlineMeeting"],"description":"What the move did."}},"required":["success","data"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Refused: `CALENDAR_RECONNECT_NEEDED`, `MEETING_CHANGE_IN_PROGRESS`, `MEETING_CHANGE_STEP_CHANGED`, `MEETING_NOT_ON_CALENDAR`, `MEETING_SAME_TIME`, `MEETING_TIME_NOT_FREE`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Refused: `CALENDAR_UNAVAILABLE`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/{flowId}/steps/{stepId}/attachments":{"post":{"tags":["Steps"],"summary":"Upload an attachment to a step (manager)","description":"**Acting as a flow manager.** Gives the step's assignee something to consult, a document or a web link, shown to them as **Reference materials** on the step.\n\nUse this endpoint when each run of a flow needs its own documents. It works on a step that has not started, so the usual pattern is: start the flow, then attach this run's document to the step that will need it. By the time the assignee gets there, it is waiting for them.\n\n**This is not `POST .../steps/{stepId}/files`**, which uploads the assignee's own submission, visible only to whoever uploaded it. A file you put there is one the assignee never sees.\n\n**To attach a file, send it directly.** Use `multipart/form-data` with the file in a part named `file`. That is the whole call: the response is the finished attachment, with `fileName` and `fileSize`, and there is nothing to upload afterwards. A file sent this way is checked for safety as part of the call, so it can be at most 100 MB. For a larger file, use the JSON form below, which allows up to 2 GB because the bytes go straight to storage. An empty file (0 bytes) is refused with `400 EMPTY_FILE`.\n\n```\ncurl -X POST \"$MOXO/v1/flows/$FLOW/steps/$STEP/attachments\" \\\n  -H \"Authorization: Bearer $TOKEN\" \\\n  -F \"file=@engagement-letter.pdf\"\n```\n\n**The two-step upload also works.** A JSON body of `{kind:\"file\", fileName, fileSize, mimeType}` returns upload details instead: `PUT` the bytes to `uploadUrl` with every header in `requiredHeaders` exactly as given, then `POST` to `completionUrl` if one is returned. Prefer the form upload above: with the two-step upload, a file whose bytes never arrive stays invisible to everyone, with no error.\n\nEach file attachment is separate. Two documents can share a name, so a repeated call adds a second attachment instead of replacing the first. If a call times out and you aren't sure whether it went through, list the step's attachments and delete the extra one by its id. Repeating a **link** that is already on the step changes nothing and returns `200` instead of `201`.\n\nA step can hold 20 attachments. Refusals: `400 STEP_TYPE_NO_ATTACHMENTS` for a step type that shows its assignee no reference materials (automations, controls and document review steps, whose document has its own place); `409 STEP_ALREADY_FINISHED` for a step nobody will act on again. An approval's, a decision's or an acknowledgement's files are what the person decides on or acknowledges: after the first answer they are refused as editing the step is (`409 STEP_ALREADY_ANSWERED` or `400 ACK_ALREADY_ACKNOWLEDGED`, with `error.details.lockReason` and `error.details.stepId`).\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `flows:write`","security":[{"bearerAuth":["flows:write"]}],"parameters":[{"schema":{"type":"string","example":"flow_123"},"required":true,"name":"flowId","in":"path"},{"schema":{"type":"string","description":"Either the step's template id (`step-2`) or its execution id; both name the same step.\n\nA step inside a loop is the exception, and neither id works there. Attachments belong to the step, and every copy of a looped step is the same step, so adding or removing one would change what every copy shows. Both id forms return `409 STEP_REF_AMBIGUOUS`.","example":"step-2"},"required":true,"description":"Either the step's template id (`step-2`) or its execution id; both name the same step.\n\nA step inside a loop is the exception, and neither id works there. Attachments belong to the step, and every copy of a looped step is the same step, so adding or removing one would change what every copy shows. Both id forms return `409 STEP_REF_AMBIGUOUS`.","name":"stepId","in":"path"}],"requestBody":{"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","format":"binary","description":"The file to attach, in the one-call form. At most 100 MB, because the file is checked for safety as part of the call. A JSON body can declare a file up to 2 GB, because those bytes go straight to storage."}},"required":["file"]}},"application/json":{"schema":{"$ref":"#/components/schemas/AddStepAttachmentRequest"}}}},"responses":{"200":{"description":"The link was already on the step, so nothing was added: `attachmentId` names the existing entry. A link is the same entry when its URL is.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."},"data":{"allOf":[{"$ref":"#/components/schemas/AddStepAttachmentResponse"},{"description":"The entry already on the step."}]}},"required":["success","data"]}}}},"201":{"description":"The attachment was added.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"anyOf":[{"$ref":"#/components/schemas/MultipartStepAttachmentResponse"},{"$ref":"#/components/schemas/AddStepAttachmentResponse"}]}},"required":["success","data"]}}}},"400":{"description":"Refused: `ACK_ALREADY_ACKNOWLEDGED`, `EMPTY_FILE`, `STEP_TYPE_NO_ATTACHMENTS`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Refused: `STEP_ALREADY_ANSWERED`, `STEP_ALREADY_FINISHED`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"get":{"tags":["Steps"],"summary":"List attachments for a step (manager)","description":"**Acting as a flow manager.** Lists everything this step shows its assignee as reference material, whether it came from the template or was added to this flow later.\n\nEntries with `removable: false` can't be changed on this flow. Either they came from the template the flow started from, or they are a `dynamic` reference to whatever an earlier step produced, which is a different file on every run and has no fixed file id.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `flows:read`","security":[{"bearerAuth":["flows:read"]}],"parameters":[{"schema":{"type":"string","example":"flow_123"},"required":true,"name":"flowId","in":"path"},{"schema":{"type":"string","description":"Either the step's template id (`step-2`) or its execution id; both name the same step.\n\nA step inside a loop is the exception, and neither id works there. Attachments belong to the step, and every copy of a looped step is the same step, so adding or removing one would change what every copy shows. Both id forms return `409 STEP_REF_AMBIGUOUS`.","example":"step-2"},"required":true,"description":"Either the step's template id (`step-2`) or its execution id; both name the same step.\n\nA step inside a loop is the exception, and neither id works there. Attachments belong to the step, and every copy of a looped step is the same step, so adding or removing one would change what every copy shows. Both id forms return `409 STEP_REF_AMBIGUOUS`.","name":"stepId","in":"path"}],"responses":{"200":{"description":"The step's attachments.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"array","items":{"$ref":"#/components/schemas/StepAttachment"}}},"required":["success","data"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/{flowId}/steps/{stepId}/attachments/{attachmentId}":{"delete":{"tags":["Steps"],"summary":"Delete an attachment (manager)","description":"**Acting as a flow manager.** Stops showing this reference material to the step's assignee. A file uploaded to this flow is deleted with it.\n\nMaterial from the template can't be removed here (`409 ATTACHMENT_NOT_REMOVABLE`). Change the template so new flows leave it out; a running flow keeps what it started with.\n\nIf two entries point at the same address, they share an id, and removing one would be a guess. That returns `409 AMBIGUOUS_ATTACHMENT` instead. Give them different addresses in the template to tell them apart.\n\nAn approval's, a decision's or an acknowledgement's files are refused after the first answer, as editing the step is (`409 STEP_ALREADY_ANSWERED` or `400 ACK_ALREADY_ACKNOWLEDGED`, with `error.details.lockReason` and `error.details.stepId`).\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `flows:write`","security":[{"bearerAuth":["flows:write"]}],"parameters":[{"schema":{"type":"string","example":"flow_123"},"required":true,"name":"flowId","in":"path"},{"schema":{"type":"string","description":"Either the step's template id (`step-2`) or its execution id; both name the same step.\n\nA step inside a loop is the exception, and neither id works there. Attachments belong to the step, and every copy of a looped step is the same step, so adding or removing one would change what every copy shows. Both id forms return `409 STEP_REF_AMBIGUOUS`.","example":"step-2"},"required":true,"description":"Either the step's template id (`step-2`) or its execution id; both name the same step.\n\nA step inside a loop is the exception, and neither id works there. Attachments belong to the step, and every copy of a looped step is the same step, so adding or removing one would change what every copy shows. Both id forms return `409 STEP_REF_AMBIGUOUS`.","name":"stepId","in":"path"},{"schema":{"type":"string","description":"The `id` from the step's list of attachments. For a document, this is its file id."},"required":true,"description":"The `id` from the step's list of attachments. For a document, this is its file id.","name":"attachmentId","in":"path"}],"responses":{"200":{"description":"The attachment was removed.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]}},"required":["success"]}}}},"400":{"description":"Refused: `ACK_ALREADY_ACKNOWLEDGED`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Refused: `AMBIGUOUS_ATTACHMENT`, `ATTACHMENT_NOT_REMOVABLE`, `STEP_ALREADY_ANSWERED`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/{flowId}/steps/{stepId}/document":{"post":{"tags":["Steps"],"summary":"Replace the document on a step (manager)","description":"**Acting as a flow manager.** Replaces the PDF that a **PDF Form**, **E-Sign** or **Document Review** step is built around, on a running flow.\n\nUse it to give each run its own document. The usual pattern: publish a template with a blank form, start a flow, then send that person's copy of the form, already filled in with their details. When the assignee opens the step, their own document is waiting.\n\n**Send the file directly.** This takes `multipart/form-data` with the PDF in a field named `file`, and returns the finished result. There is no upload URL to call afterwards and nothing to poll.\n\n**The same call adds a document to a step that has none yet**, such as a step waiting for someone to prepare it.\n\n**What happens to the fields.** On an **E-Sign** step the signature fields are kept exactly where they were, because they are positions on a page and nothing about them can be recovered from a different PDF. Send a document with the same layout as the one it replaces. On a **PDF Form** step the fields are matched up by their name inside the PDF: settings you configured (the label, whether it is required, who fills it, what it prefills from) carry across, and the response tells you which fields the new document added or dropped. A **Document Review** step has no fields. The new PDF replaces the one under review.\n\n**When.** In the window Moxo's step editor changes the step in: a PDF Form or E-Sign step until the person doing it submits it, a **Document Review** step until it starts (before anyone can have commented on or reviewed the file). A later step returns `STEP_NOT_EDITABLE` (409). The document a replacement takes the place of stays a file of the flow.\n\n**One writer.** The new document is put on the step by Moxo's step editor, the same one Edit a step and the app use, so the checks, the signer emails and the record (one \"document replaced\" entry) are the same. If the document can't be put in place (what the person doing the step is shown could not be updated, or the signing document could not be rebuilt), the step keeps its previous document and signing files and the call returns `500 DOCUMENT_REPLACE_FAILED` or `500 ESIGN_REINIT_FAILED`. Try again.\n\n**Refusals.** `ESIGN_ALREADY_SIGNED` (409) once anyone has signed. From that moment the document is a signed record and cannot be swapped. `ESIGN_PREPARER_PLACED` (409) while a preparer's placed signing fields exist on an e-sign step: they sit on the document they were placed on, so it stays. `ESIGN_SOURCE_DOCUMENT_LOCKED` (409) when the template turned on Prevent PDF replacement for this e-sign step. Later signature steps placed their fields on that PDF, so it stays as it is for the whole flow. `STEP_NOT_EDITABLE` (409) for a step past its window. `STEP_REF_AMBIGUOUS` (409) when the step runs once per item. `STEP_TYPE_NO_DOCUMENT` (400) for a step that is not built around a document, naming what to do instead. `DOCUMENT_UNREADABLE` (400) when the PDF cannot be opened. `UNSUPPORTED_FILE_TYPE` (415) for anything that is not a PDF. `FILE_TOO_LARGE` (413) above 20 MB. `FILE_INFECTED` (422) if the file fails its safety check, in which case nothing was stored and nothing on the step changed. `SCAN_UNAVAILABLE` and `SCAN_BUSY` (503) when the safety check can't run. `SIGNING_BUSY` (503) when someone is signing at the same moment. `DOCUMENT_REPLACED` (409) when someone else saved a different file while yours was saving. The step keeps their file. Look at the step and send yours again if it is still the one you want.\n\n**Everyone signing gets told.** Replacing the document on an E-Sign step that has already been sent out replaces the links the signers are holding, since those point at the old document, and emails them a fresh one. The email goes out through Moxo's notification queue, which retries delivery.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `flows:write`","security":[{"bearerAuth":["flows:write"]}],"parameters":[{"schema":{"type":"string","example":"flow_123"},"required":true,"name":"flowId","in":"path"},{"schema":{"type":"string","description":"Either the step's template id (`step-2`) or its execution id; both name the same step.\n\nA step inside a loop is the exception, and neither id works there. The document belongs to the step, and every copy of a looped step is the same step, so replacing it would change what every copy shows. Both id forms return `409 STEP_REF_AMBIGUOUS`.","example":"step-2"},"required":true,"description":"Either the step's template id (`step-2`) or its execution id; both name the same step.\n\nA step inside a loop is the exception, and neither id works there. The document belongs to the step, and every copy of a looped step is the same step, so replacing it would change what every copy shows. Both id forms return `409 STEP_REF_AMBIGUOUS`.","name":"stepId","in":"path"}],"requestBody":{"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","format":"binary","description":"The PDF to put on the step. Maximum 20 MB."}},"required":["file"]}}}},"responses":{"200":{"description":"The document was replaced.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/ReplaceStepDocumentResponse"}},"required":["success","data"]}}}},"400":{"description":"The file or the step cannot take this document. `NO_FILE` when the form field is missing. `DOCUMENT_UNREADABLE` when the PDF cannot be opened. `STEP_TYPE_NO_DOCUMENT` when this step is not built around a document.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"The step can't be changed. `STEP_NOT_EDITABLE` when it is past the window its document changes in. `ESIGN_ALREADY_SIGNED` when someone has signed. `ESIGN_PREPARER_PLACED` when a preparer placed the signing fields on this document. `ESIGN_SOURCE_DOCUMENT_LOCKED` when the template prevents replacing this PDF. `STEP_REF_AMBIGUOUS` when several copies share this step. `DOCUMENT_REPLACED` when someone else saved a different file first.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"413":{"description":"The PDF is larger than 20 MB (`FILE_TOO_LARGE`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"The file is not a PDF (`UNSUPPORTED_FILE_TYPE`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"The file failed its safety check (`FILE_INFECTED`). Nothing was stored and the step is unchanged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Refused: `DOCUMENT_REPLACE_FAILED`, `ESIGN_REINIT_FAILED`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Try again. `SCAN_UNAVAILABLE` or `SCAN_BUSY` when the safety check cannot run. `SIGNING_BUSY` when someone is signing this document.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/steps":{"get":{"tags":["Steps"],"summary":"List steps across flows","description":"Returns step runs across every flow you can see, newest first, narrowed by flow, name, status, due date, start time, account, or whether they are overdue or were reopened. Use it for questions such as \"what is overdue?\" or \"which approval steps are open?\". For the steps waiting on you, use `GET /v1/users/me/steps`.\n\nA personal access token sees the steps of the flows on its person's Flows list, as each flow's page shows them, and `name` matches the names they see. An organization API key sees every step.\n\nEach call reads up to 1,000 steps to fill its page, so a page can be empty while `hasMore` is `true`: keep sending `nextCursor` as `cursor`, with the same filters, until it is `null`.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `flows:read`","security":[{"bearerAuth":["flows:read"]}],"parameters":[{"schema":{"type":"string","format":"uuid","description":"Only the steps of this flow."},"required":false,"description":"Only the steps of this flow.","name":"flowId","in":"query"},{"schema":{"type":"string","maxLength":500,"description":"Only steps whose name, as you see it, contains this text. Not case-sensitive."},"required":false,"description":"Only steps whose name, as you see it, contains this text. Not case-sensitive.","name":"name","in":"query"},{"schema":{"type":"string","enum":["PENDING","AWAITING_HOST_SETUP","AWAITING_CONNECTION","AWAITING_BUNDLE","WAITING_FOR_ASSIGNEE","PREPARING","IN_PROGRESS","REVIEWING","PAUSED","COMPLETED","SKIPPED","CANCELLED","FAILED","SUPERSEDED"],"description":"Only steps in this status."},"required":false,"description":"Only steps in this status.","name":"status","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":60,"description":"Only steps with this step status: its `key` from the template's `stepStatuses`, the same across every template that uses the key. Matches nothing when the organization's plan does not have Custom step statuses."},"required":false,"description":"Only steps with this step status: its `key` from the template's `stepStatuses`, the same across every template that uses the key. Matches nothing when the organization's plan does not have Custom step statuses.","name":"customStatus","in":"query"},{"schema":{"type":"boolean","description":"`true` for open steps past their due date."},"required":false,"description":"`true` for open steps past their due date.","name":"isOverdue","in":"query"},{"schema":{"type":"boolean","description":"`true` for steps reopened at least once."},"required":false,"description":"`true` for steps reopened at least once.","name":"hasReopens","in":"query"},{"schema":{"type":"string","format":"date-time","description":"Only steps due on or before this time (ISO 8601)."},"required":false,"description":"Only steps due on or before this time (ISO 8601).","name":"dueBefore","in":"query"},{"schema":{"type":"string","format":"date-time","description":"Only steps that started on or after this time (ISO 8601)."},"required":false,"description":"Only steps that started on or after this time (ISO 8601).","name":"startedAfter","in":"query"},{"schema":{"type":"string","format":"uuid","description":"Only steps of flows for this account."},"required":false,"description":"Only steps of flows for this account.","name":"accountId","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"description":"Steps per page, 1 to 100. Defaults to 25."},"required":false,"description":"Steps per page, 1 to 100. Defaults to 25.","name":"limit","in":"query"},{"schema":{"type":["integer","null"],"minimum":0,"maximum":10000,"description":"Matching steps to skip, up to 10,000. Use `cursor` for the next page instead: each call reads at most 1,000 steps past the offset."},"required":false,"description":"Matching steps to skip, up to 10,000. Use `cursor` for the next page instead: each call reads at most 1,000 steps past the offset.","name":"offset","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":2000,"description":"The previous page's `nextCursor`. Omit for the first page."},"required":false,"description":"The previous page's `nextCursor`. Omit for the first page.","name":"cursor","in":"query"}],"responses":{"200":{"description":"A page of steps.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a 200 response."},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The step run's id: `steps[].id` on the flow. Send it as `{stepId}` to the step endpoints."},"name":{"type":["string","null"],"description":"The step's name, as you see it."},"stepName":{"type":["string","null"],"deprecated":true,"description":"Deprecated: the step's name, the same as `name`. Read `name`; this field is still sent so integrations built on it keep working."},"flowId":{"type":"string","description":"The flow it belongs to."},"flowName":{"type":["string","null"],"description":"The flow's name."},"status":{"type":"string","enum":["PENDING","AWAITING_HOST_SETUP","AWAITING_CONNECTION","AWAITING_BUNDLE","WAITING_FOR_ASSIGNEE","PREPARING","IN_PROGRESS","REVIEWING","PAUSED","COMPLETED","SKIPPED","CANCELLED","FAILED","SUPERSEDED"],"description":"The run's status."},"startedAt":{"type":["string","null"],"description":"When it started (ISO 8601). `null` when it has not."},"completedAt":{"type":["string","null"],"description":"When it finished (ISO 8601). `null` when it has not."},"firstViewedAt":{"type":["string","null"],"description":"When it was first opened by an assignee (ISO 8601). `null` when it has not."},"reopenCount":{"type":["integer","null"],"description":"How many times it was reopened."},"reopenReason":{"type":["string","null"],"description":"Why the step was last reopened, for a flow manager or an organization API key. `null` for anyone else (read the step for it: `GET /v1/flows/{id}/steps/{stepId}`), when it was never reopened, or none was given."},"reopenedAt":{"type":["string","null"],"format":"date-time","description":"When the step was last reopened. `null` when it was never reopened."},"reopenedBy":{"anyOf":[{"$ref":"#/components/schemas/User"},{"type":"null"}],"description":"The person who last reopened the step. `null` when it was never reopened, or when an AI agent or the system reopened it (`reopenedByKind`)."},"reopenedByKind":{"type":["string","null"],"enum":["person","agent","system",null],"description":"Who last reopened the step: `person` (named in `reopenedBy`), `agent` (an AI agent sent it back, named in `reopenedByAgent`), or `system` (an API key, a loop back, or Moxo itself). Read it with `reopenReason` and `reopenedAt` to tell a step sent back for changes from one still waiting on its first round. `null` when it was never reopened.","example":"agent"},"reopenedByAgent":{"type":["object","null"],"properties":{"id":{"type":"string","description":"The agent's id."},"name":{"type":"string","description":"The agent's name."}},"required":["id","name"],"additionalProperties":false,"description":"The AI agent that last sent the step back, when `reopenedByKind` is `agent`. `null` otherwise."},"dueAt":{"type":["string","null"],"description":"When it is due (ISO 8601). `null` when it has no due date."},"customStatus":{"anyOf":[{"$ref":"#/components/schemas/StepStatus"},{"type":"null"}],"description":"The step status someone put on it from the template's list, beside `status`. `null` when none is set, once the step is finished, or when the organization's plan does not have Custom step statuses."},"assignees":{"type":"array","items":{"type":"string"},"description":"The names of the people it is assigned to."}},"required":["id","name","flowId","flowName","status","startedAt","completedAt","firstViewedAt","reopenCount","reopenReason","reopenedAt","reopenedBy","reopenedByKind","reopenedByAgent","dueAt","customStatus","assignees"],"additionalProperties":false},"description":"The steps on this page, newest first."},"pagination":{"type":"object","properties":{"nextCursor":{"type":["string","null"],"description":"Send it as `cursor` for the next page. `null` on the last page."},"limit":{"type":"integer","description":"The page size this call used."},"hasMore":{"type":"boolean","description":"Whether there is another page."},"total":{"type":"integer","description":"Matching steps among those this call read. With `hasMore`, there may be more."}},"required":["nextCursor","limit","hasMore","total"],"description":"Where the next page starts, and how many steps matched."}},"required":["success","data","pagination"]}}}},"400":{"description":"A query parameter is not valid (`VALIDATION_FAILED`), or `cursor` is not one this list issued (`INVALID_CURSOR`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/users/me/steps":{"get":{"x-moxo-person-only":"PERSON_TOKEN_REQUIRED","tags":["Steps"],"summary":"List the steps waiting on you","description":"Returns the steps waiting on you now: the same list as **Your actions** in the app, in its order (overdue first, then soonest due, then most recent activity). It includes steps you prepare or review and steps you cover for someone who is away, and each says why it is yours in `seat`. Steps a desk could give you are not in it until you have them.\n\nNeeds a personal access token: an organization API key is not a person, so it gets `403 PERSON_TOKEN_REQUIRED`. Page with `cursor`: send the previous page's `nextCursor` as it is.\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"integer","minimum":1,"maximum":200,"description":"Steps per page, 1 to 200. Defaults to 50."},"required":false,"description":"Steps per page, 1 to 200. Defaults to 50.","name":"limit","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":2000,"description":"The previous page's `nextCursor`. Omit for the first page."},"required":false,"description":"The previous page's `nextCursor`. Omit for the first page.","name":"cursor","in":"query"}],"responses":{"200":{"description":"A page of the steps waiting on you.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a 200 response."},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The step run. Send it as `{stepId}` to the step endpoints."},"stepId":{"type":"string","description":"The step on the flow."},"name":{"type":["string","null"],"description":"The step's name."},"type":{"type":["string","null"],"description":"The step type."},"executionId":{"type":"string","deprecated":true,"description":"Deprecated: this run of the step, the same as `id`. Read `id`; this field is still sent so integrations built on it keep working."},"stepName":{"type":["string","null"],"deprecated":true,"description":"Deprecated: the step's name, the same as `name`. Read `name`; this field is still sent so integrations built on it keep working."},"stepType":{"type":["string","null"],"deprecated":true,"description":"Deprecated: the step's type, the same as `type`. Read `type`; this field is still sent so integrations built on it keep working."},"status":{"type":["string","null"],"enum":["PENDING","AWAITING_HOST_SETUP","AWAITING_CONNECTION","AWAITING_BUNDLE","WAITING_FOR_ASSIGNEE","PREPARING","IN_PROGRESS","REVIEWING","PAUSED","COMPLETED","SKIPPED","CANCELLED","FAILED","SUPERSEDED",null],"description":"The run's status."},"seat":{"type":"string","enum":["executor","preparer","reviewer"],"description":"Why it is waiting on you: you do the step (`executor`), prepare it (`preparer`) or review it (`reviewer`)."},"dueAt":{"type":["string","null"],"description":"When it is due (ISO 8601). `null` when it has no due date."},"overdue":{"type":"boolean","description":"Whether it is past its due date."},"flow":{"type":"object","properties":{"id":{"type":"string","description":"The flow's id."},"name":{"type":"string","description":"The flow's name."}},"required":["id","name"],"description":"The flow the step is in."},"template":{"type":["object","null"],"properties":{"id":{"type":"string","description":"The template's id."},"name":{"type":"string","description":"The template's name."}},"required":["id","name"],"description":"The template the flow was started from. `null` for a flow without one."}},"required":["id","stepId","name","type","status","seat","dueAt","overdue","flow","template"],"additionalProperties":false},"description":"The steps on this page, overdue first, then soonest due."},"pagination":{"type":"object","properties":{"nextCursor":{"type":["string","null"],"description":"Send it as `cursor` for the next page. `null` on the last page."},"limit":{"type":"integer","description":"The page size this call used."},"hasMore":{"type":"boolean","description":"Whether there is another page."}},"required":["nextCursor","limit","hasMore"],"description":"Where the next page starts."}},"required":["success","data","pagination"]}}}},"400":{"description":"A query parameter is not valid (`VALIDATION_FAILED`), or `cursor` is not one this list issued (`INVALID_CURSOR`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/{id}/restore":{"post":{"tags":["Flows"],"summary":"Reopen a canceled flow","description":"**Acting as a flow manager.** Undoes a cancel: the flow is running again and each step the cancel stopped goes back to where it was. Steps finished before the cancel stay finished. The body is optional. Returns the flow.\n\nOnly a flow canceled by a person can be reopened: a flow that is not canceled returns `400 INVALID_STATE`, and one canceled before reopening existed, or ended by an End flow step, returns `409 NO_RESTORE_SNAPSHOT` (start a new flow instead). An archived flow returns `409 FLOW_ARCHIVED` (unarchive it first), and a paused organization `402 ORG_FROZEN`. Returns 403 if you don't manage the flow.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `flows:write`","security":[{"bearerAuth":["flows:write"]}],"parameters":[{"schema":{"type":"string","description":"The flow's id."},"required":true,"description":"The flow's id.","name":"id","in":"path"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":["object","null"],"properties":{"reason":{"type":"string","maxLength":500,"description":"Why the flow is reopened, up to 500 characters. It is recorded in the flow's activity."}},"additionalProperties":false}}}},"responses":{"200":{"description":"The flow after the change, so you don't need to read it again.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."},"data":{"allOf":[{"$ref":"#/components/schemas/FlowDetail"},{"description":"The flow, as `GET /v1/flows/{id}` returns it."}]}},"required":["success","data"]}}}},"400":{"description":"Refused: `INVALID_STATE`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"Refused: `ORG_FROZEN`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Refused: `FLOW_ARCHIVED`, `NO_RESTORE_SNAPSHOT`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/{id}/continue":{"post":{"tags":["Flows"],"summary":"Continue a completed flow","description":"**Acting as a flow manager.** Opens a completed flow again so more work can be added to it: it is running again, and every finished step stays finished. Add the next steps with `POST /v1/flows/{id}/steps`. The body is optional. Returns the flow.\n\nA flow that is not completed returns `400 INVALID_STATE`, a test run `400 IS_TEST_RUN` (start a new one), a one-off action (`kind: \"action\"`) `409 ACTION_ENDED` (send it to someone else instead), an archived flow `409 FLOW_ARCHIVED` (unarchive it first) and a paused organization `402 ORG_FROZEN`. Returns 403 if you don't manage the flow.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `flows:write`","security":[{"bearerAuth":["flows:write"]}],"parameters":[{"schema":{"type":"string","description":"The flow's id."},"required":true,"description":"The flow's id.","name":"id","in":"path"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":["object","null"],"properties":{"reason":{"type":"string","maxLength":500,"description":"Why the flow continues, up to 500 characters. It is recorded in the flow's activity."}},"additionalProperties":false}}}},"responses":{"200":{"description":"The flow after the change, so you don't need to read it again.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."},"data":{"allOf":[{"$ref":"#/components/schemas/FlowDetail"},{"description":"The flow, as `GET /v1/flows/{id}` returns it."}]}},"required":["success","data"]}}}},"400":{"description":"Refused: `INVALID_STATE`, `IS_TEST_RUN`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"Refused: `ORG_FROZEN`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Refused: `ACTION_ENDED`, `FLOW_ARCHIVED`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/{id}/mark-goal-met":{"post":{"tags":["Flows"],"summary":"Mark an adaptive flow's goal met","description":"**Acting as a flow manager.** Completes an adaptive flow: an adaptive flow never completes on its own when its steps run out, so this is how it ends. Every step still open is closed as no longer needed, and the flow's managers get the usual completion summary. The body is optional. Returns the flow. Calling it on a flow already completed changes nothing.\n\nA flow started from a template with fixed steps returns `400 INVALID_STATE` (it completes when its steps are done), and so does a canceled flow. A paused flow returns `409 FLOW_PAUSED`: resume it first. While any sub-flow beneath the flow, at any depth, is still running or paused, it returns `409 SUB_FLOWS_OPEN` and nothing changes: finish or cancel them first. `error.details.subFlows` lists each one with its `templateName`, and its `id` and `name` when you can open it and every sub-flow above it (else `null`); a sub-flow you can't open stands for everything beneath it. Closing a step that reviews your own work returns `403 OWN_REVIEW`. Returns 403 if you don't manage the flow.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `flows:write`","security":[{"bearerAuth":["flows:write"]}],"parameters":[{"schema":{"type":"string","description":"The flow's id."},"required":true,"description":"The flow's id.","name":"id","in":"path"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":["object","null"],"properties":{"reason":{"type":"string","maxLength":500,"description":"A note on how the goal was met, up to 500 characters. It is kept as the flow's completion reason."}},"additionalProperties":false}}}},"responses":{"200":{"description":"The flow after the change, so you don't need to read it again.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."},"data":{"allOf":[{"$ref":"#/components/schemas/FlowDetail"},{"description":"The flow, as `GET /v1/flows/{id}` returns it."}]}},"required":["success","data"]}}}},"400":{"description":"Refused: `INVALID_STATE`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Refused: `FLOW_PAUSED`, `SUB_FLOWS_OPEN`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/adaptive":{"post":{"x-moxo-person-only":"PERSON_TOKEN_REQUIRED","tags":["Flows"],"summary":"Start an adaptive flow","description":"Starts an empty adaptive flow toward a `goal`, with no template: you are its manager, and you add its steps as it runs (`POST /v1/flows/{id}/steps`). It stays open until you mark its goal met (`POST /v1/flows/{id}/mark-goal-met`). Returns the new flow.\n\nNeeds a teammate's personal access token, and the organization's plan to have adaptive flows (`403 FEATURE_DISABLED` otherwise). A paused organization returns `402 ORG_FROZEN`, and a plan out of flows `402 QUOTA_EXCEEDED`.\n\n**Idempotent.** Send an `Idempotency-Key` header to make retries safe: a retry within 10 minutes returns the same flow and starts no second flow. See Idempotency in the Introduction.\n\n**Products.** An organization without the Flow product can't start new flows: the response is `403 FEATURE_DISABLED` with `error.feature: \"haiFlow\"`. Flows already running carry on.\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":256,"pattern":"^[A-Za-z0-9_\\-:.]+$","description":"An optional key that makes this request safe to retry. Send a new UUID for each request. A key is up to 256 letters, digits, `-`, `_`, `:` or `.`; any other key is refused with `400 INVALID_IDEMPOTENCY_KEY` and nothing runs. A retry with the same key within 10 minutes returns the first response and changes nothing again. After 10 minutes, the same key runs the request again, so use a new key for a late retry. See Idempotency in the Introduction.","example":"6f2c4a5e-3b8d-4c7f-9a1e-2d6b8e0f4c5a"},"required":false,"description":"An optional key that makes this request safe to retry. Send a new UUID for each request. A key is up to 256 letters, digits, `-`, `_`, `:` or `.`; any other key is refused with `400 INVALID_IDEMPOTENCY_KEY` and nothing runs. A retry with the same key within 10 minutes returns the first response and changes nothing again. After 10 minutes, the same key runs the request again, so use a new key for a late retry. See Idempotency in the Introduction.","name":"Idempotency-Key","in":"header"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200,"description":"The flow's name, up to 200 characters. Omitted: \"Dynamic flow\"."},"goal":{"type":"string","minLength":1,"maxLength":2000,"description":"What the flow is for, up to 2,000 characters. Its managers add steps toward it as it runs."}},"required":["goal"],"additionalProperties":false}}}},"responses":{"201":{"description":"The new flow, or the first one when this is a retry with the same `Idempotency-Key`.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."},"data":{"allOf":[{"$ref":"#/components/schemas/FlowDetail"},{"description":"The flow, as `GET /v1/flows/{id}` returns it."}]}},"required":["success","data"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"Refused: `ORG_FROZEN`, `QUOTA_EXCEEDED`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"410":{"description":"The first result for this `Idempotency-Key` can no longer be returned, because what it created was deleted. Use a new key for the next attempt.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"425":{"description":"A request with this `Idempotency-Key` is still running. Retry after `Retry-After` seconds. If the first request failed with a `5xx`, the key stays held for 10 minutes; to retry sooner, use a new key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"The first result for this `Idempotency-Key` couldn't be checked. Retry with the same key after a short wait. If it keeps happening, contact support with the `requestId`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/{id}/roles":{"post":{"tags":["Flows"],"summary":"Add a role to a flow","description":"**Acting as a flow manager.** Adds a role to this running flow only (the template keeps its roles). Put someone on it now with `userId` or `contactId`, or later with `POST /v1/flows/{id}/roles/{roleId}/assign`. A name another role of the flow has returns `409 ROLE_ALREADY_EXISTS`; a flow that is not running returns `400 INVALID_STATE`. Returns the new role and its id.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `flows:write`","security":[{"bearerAuth":["flows:write"]}],"parameters":[{"schema":{"type":"string","description":"The flow's id."},"required":true,"description":"The flow's id.","name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100,"description":"The role's name, up to 100 characters. A name another role of this flow has is refused."},"description":{"type":"string","maxLength":500,"description":"What the role does, up to 500 characters."},"userId":{"type":"string","description":"A teammate to put on the role now (`usr_…`)."},"contactId":{"type":"string","description":"Or an external person to put on the role now (`usr_…`). Send at most one of `userId` and `contactId`."}},"required":["name"]}}}},"responses":{"201":{"description":"The role added.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."},"data":{"type":"object","properties":{"role":{"type":"object","properties":{"roleId":{"type":"string","description":"The new role's id."},"name":{"type":"string","description":"Its name."},"description":{"type":"string","description":"What it does, when sent."}},"required":["roleId","name"],"additionalProperties":false,"description":"The role added."}},"required":["role"],"additionalProperties":false,"description":"What was added."}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Refused: `INVALID_STATE`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Refused: `ROLE_ALREADY_EXISTS`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/{id}/roles/{roleId}/accounts":{"post":{"tags":["Flows"],"summary":"Put an account on a role","description":"**Acting as a flow manager.** Puts an account on one of this flow's roles. For an account whose people follow it, its people join the role. The account must be one the role takes, as at the start of a flow. Returns 403 if you don't manage the flow.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `flows:write`","security":[{"bearerAuth":["flows:write"]}],"parameters":[{"schema":{"type":"string","description":"The flow's id."},"required":true,"description":"The flow's id.","name":"id","in":"path"},{"schema":{"type":"string","description":"The role's id, from `roles[].id` on `GET /v1/flows/{id}`."},"required":true,"description":"The role's id, from `roles[].id` on `GET /v1/flows/{id}`.","name":"roleId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"accountId":{"type":"string","minLength":1,"description":"The account to put on the role."}},"required":["accountId"]}}}},"responses":{"200":{"description":"The change was made.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."}},"required":["success"],"additionalProperties":false}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/{id}/roles/{roleId}/accounts/{accountId}":{"delete":{"tags":["Flows"],"summary":"Take an account off a role","description":"**Acting as a flow manager.** Takes an account off one of this flow's roles. For an account whose people follow it, the people it brought leave the role too, unless another account on the role brought them; their open steps wait for a manager to reassign them, and their finished work keeps their name. Someone who can't leave yet (a signer on a document already sent) refuses the whole change. A canceled flow returns `403 FLOW_CANCELLED`.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `flows:write`","security":[{"bearerAuth":["flows:write"]}],"parameters":[{"schema":{"type":"string","description":"The flow's id."},"required":true,"description":"The flow's id.","name":"id","in":"path"},{"schema":{"type":"string","description":"The role's id, from `roles[].id` on `GET /v1/flows/{id}`."},"required":true,"description":"The role's id, from `roles[].id` on `GET /v1/flows/{id}`.","name":"roleId","in":"path"},{"schema":{"type":"string","description":"The account's id."},"required":true,"description":"The account's id.","name":"accountId","in":"path"}],"responses":{"200":{"description":"The change was made.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."}},"required":["success"],"additionalProperties":false}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/{id}/roles/{roleId}/visibility":{"patch":{"tags":["Flows"],"summary":"Change what a role sees in a flow","description":"**Acting as a flow manager.** Changes what people in one role see on this running flow only (the template keeps its setting). Send any of the three switches; the others stay. Showing more to a role that includes people outside your organization shows them more of the flow. A role that always sees everything returns `400 ROLE_VISIBILITY_LOCKED`; automations without every action `400 AUTOMATIONS_REQUIRE_SEE_ALL`; progress only for a managing role `400 PROGRESS_ONLY_REQUIRES_VIEWER`, or without every action `400 PROGRESS_ONLY_REQUIRES_SEE_ALL`; `holderUserId` who no longer holds the role `409 ROLE_NOT_HELD`. A flow that is not running returns `400 INVALID_STATE`.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `flows:write`","security":[{"bearerAuth":["flows:write"]}],"parameters":[{"schema":{"type":"string","description":"The flow's id."},"required":true,"description":"The flow's id.","name":"id","in":"path"},{"schema":{"type":"string","description":"The role's id, from `roles[].id` on `GET /v1/flows/{id}`."},"required":true,"description":"The role's id, from `roles[].id` on `GET /v1/flows/{id}`.","name":"roleId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"allowViewAllActions":{"type":"boolean","description":"Whether people in this role see every action of the flow, not only their own."},"allowViewAutomations":{"type":"boolean","description":"With every action shown: whether they also see the automated ones."},"showProgressOnly":{"type":"boolean","description":"Whether they see only how far the flow has got, not its actions."},"holderUserId":{"type":"string","minLength":1,"maxLength":200,"description":"Change it only while this person still holds the role (`usr_…`). Omit it to change the role whoever holds it."}}}}}},"responses":{"200":{"description":"The change was made.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."}},"required":["success"],"additionalProperties":false}}}},"400":{"description":"Refused: `AUTOMATIONS_REQUIRE_SEE_ALL`, `INVALID_STATE`, `PROGRESS_ONLY_REQUIRES_SEE_ALL`, `PROGRESS_ONLY_REQUIRES_VIEWER`, `ROLE_VISIBILITY_LOCKED`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Refused: `ROLE_NOT_HELD`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/{id}/roles/{roleId}/extra-permissions":{"patch":{"tags":["Flows"],"summary":"Change a role's powers in a flow","description":"**Acting as a flow manager.** Sets the extra powers people in one Assignee role have on this running flow only: send every power they should have. A power the organization's plan doesn't include returns `403 FEATURE_DISABLED`; a role that manages or only views the flow `400 ROLE_NOT_ASSIGNEE`; a flow that is not running `400 INVALID_STATE`.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `flows:write`","security":[{"bearerAuth":["flows:write"]}],"parameters":[{"schema":{"type":"string","description":"The flow's id."},"required":true,"description":"The flow's id.","name":"id","in":"path"},{"schema":{"type":"string","description":"The role's id, from `roles[].id` on `GET /v1/flows/{id}`."},"required":true,"description":"The role's id, from `roles[].id` on `GET /v1/flows/{id}`.","name":"roleId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"extraPermissions":{"type":"array","items":{"type":"string","enum":["remind","reopen","step_status"]},"maxItems":3,"description":"Every power people in this role have on this flow: `remind` (send reminders), `reopen` (reopen completed actions), `step_status` (put a step status on an action). One left out is taken away. Only an Assignee role takes them."}},"required":["extraPermissions"],"additionalProperties":false}}}},"responses":{"200":{"description":"The change was made.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."}},"required":["success"],"additionalProperties":false}}}},"400":{"description":"Refused: `INVALID_STATE`, `ROLE_NOT_ASSIGNEE`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/{id}/participants/{userId}/view":{"patch":{"tags":["Flows"],"summary":"Change how one person sees a flow","description":"**Acting as a flow manager.** Sets how one person on this running flow sees it. Only this flow and this person change. A flow that is not running returns `400 INVALID_STATE`.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `flows:write`","security":[{"bearerAuth":["flows:write"]}],"parameters":[{"schema":{"type":"string","description":"The flow's id."},"required":true,"description":"The flow's id.","name":"id","in":"path"},{"schema":{"type":"string","description":"The person's id (`usr_…`)."},"required":true,"description":"The person's id (`usr_…`).","name":"userId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"viewMode":{"type":"string","enum":["SPOTLIGHT","GALLERY"],"description":"How this person sees the flow: `SPOTLIGHT` (their own actions first) or `GALLERY` (every action they may see)."}},"required":["viewMode"],"additionalProperties":false}}}},"responses":{"200":{"description":"The change was made.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."}},"required":["success"],"additionalProperties":false}}}},"400":{"description":"Refused: `INVALID_STATE`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/{id}/tags/{groupId}":{"put":{"x-moxo-person-only":"PERSON_TOKEN_REQUIRED","tags":["Flows"],"summary":"Set a flow's tags in one group","description":"**Acting as a flow manager.** Sets the flow's tags in one tag group, whatever its state, so a flow can be filed again after it ends. Other groups stay as they are. Send `tagIds` for a group of tags, or `value` for a text group. Needs the organization's plan to have tags (`403 FEATURE_DISABLED` otherwise), and a teammate's personal access token: tags are filed by a person (`403 PERSON_TOKEN_REQUIRED` for an organization API key).\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"The flow's id."},"required":true,"description":"The flow's id.","name":"id","in":"path"},{"schema":{"type":"string","description":"The tag group's id."},"required":true,"description":"The tag group's id.","name":"groupId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"tagIds":{"type":"array","items":{"type":"string"},"maxItems":50,"description":"Every tag of this group the flow has, by id (at most 50). An empty list takes them all off."}},"required":["tagIds"],"additionalProperties":false},{"type":"object","properties":{"value":{"type":"string","maxLength":200,"description":"For a text tag group: the flow's value, up to 200 characters. An empty value clears it."}},"required":["value"],"additionalProperties":false}]}}}},"responses":{"200":{"description":"The change was made.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."}},"required":["success"],"additionalProperties":false}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/{id}/access-requests":{"get":{"tags":["Flows"],"summary":"List requests to join a flow","description":"**Acting as a flow manager.** Lists the open requests to join the flow, oldest first. People in your organization ask to join from the flow's link when its template lets them. A request from someone who left the organization is not listed. Returns 403 if you don't manage the flow.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `flows:read`","security":[{"bearerAuth":["flows:read"]}],"parameters":[{"schema":{"type":"string","description":"The flow's id."},"required":true,"description":"The flow's id.","name":"id","in":"path"}],"responses":{"200":{"description":"The open requests.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."},"data":{"type":"object","properties":{"requests":{"type":"array","items":{"$ref":"#/components/schemas/FlowAccessRequest"},"description":"The open requests, oldest first. Empty when there are none."}},"required":["requests"],"additionalProperties":false,"description":"The flow's open requests to join."}},"required":["success","data"],"additionalProperties":false}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/{id}/access-requests/{requestId}/approve":{"post":{"tags":["Flows"],"summary":"Approve a request to join a flow","description":"**Acting as a flow manager.** Adds the person who asked to the flow as a viewer and tells them, the same as `POST /v1/flows/{id}/members` with `access: \"viewer\"`. Takes no body.\n\nA request someone already approved or declined returns `409 ACCESS_REQUEST_ALREADY_DECIDED`. When the person can't be a viewer of this flow, the call returns the same refusal as adding them, and the request stays open. Returns 403 if you don't manage the flow, and 404 if the request doesn't exist on this flow.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `flows:write`","security":[{"bearerAuth":["flows:write"]}],"parameters":[{"schema":{"type":"string","description":"The flow's id."},"required":true,"description":"The flow's id.","name":"id","in":"path"},{"schema":{"type":"string","description":"The request's id, from `requests[].id` on `GET /v1/flows/{id}/access-requests`."},"required":true,"description":"The request's id, from `requests[].id` on `GET /v1/flows/{id}/access-requests`.","name":"requestId","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":256,"pattern":"^[A-Za-z0-9_\\-:.]+$","description":"An optional key that makes this request safe to retry. Send a new UUID for each request. A key is up to 256 letters, digits, `-`, `_`, `:` or `.`; any other key is refused with `400 INVALID_IDEMPOTENCY_KEY` and nothing runs. A retry with the same key within 10 minutes returns the first response and changes nothing again. After 10 minutes, the same key runs the request again, so use a new key for a late retry. See Idempotency in the Introduction.","example":"6f2c4a5e-3b8d-4c7f-9a1e-2d6b8e0f4c5a"},"required":false,"description":"An optional key that makes this request safe to retry. Send a new UUID for each request. A key is up to 256 letters, digits, `-`, `_`, `:` or `.`; any other key is refused with `400 INVALID_IDEMPOTENCY_KEY` and nothing runs. A retry with the same key within 10 minutes returns the first response and changes nothing again. After 10 minutes, the same key runs the request again, so use a new key for a late retry. See Idempotency in the Introduction.","name":"Idempotency-Key","in":"header"}],"responses":{"200":{"description":"The request was answered.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."},"data":{"type":"object","properties":{"status":{"type":"string","enum":["approved"],"description":"Always `approved`."}},"required":["status"],"additionalProperties":false,"description":"The request after your answer."}},"required":["success","data"],"additionalProperties":false}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Refused: `ACCESS_REQUEST_ALREADY_DECIDED`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"410":{"description":"The first result for this `Idempotency-Key` can no longer be returned, because what it created was deleted. Use a new key for the next attempt.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"425":{"description":"A request with this `Idempotency-Key` is still running. Retry after `Retry-After` seconds. If the first request failed with a `5xx`, the key stays held for 10 minutes; to retry sooner, use a new key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"The first result for this `Idempotency-Key` couldn't be checked. Retry with the same key after a short wait. If it keeps happening, contact support with the `requestId`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/{id}/access-requests/{requestId}/deny":{"post":{"tags":["Flows"],"summary":"Decline a request to join a flow","description":"**Acting as a flow manager.** Declines the request. Nobody is told. The person can ask again after 24 hours. Takes no body.\n\nA request someone already approved or declined returns `409 ACCESS_REQUEST_ALREADY_DECIDED`. Returns 403 if you don't manage the flow, and 404 if the request doesn't exist on this flow.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `flows:write`","security":[{"bearerAuth":["flows:write"]}],"parameters":[{"schema":{"type":"string","description":"The flow's id."},"required":true,"description":"The flow's id.","name":"id","in":"path"},{"schema":{"type":"string","description":"The request's id, from `requests[].id` on `GET /v1/flows/{id}/access-requests`."},"required":true,"description":"The request's id, from `requests[].id` on `GET /v1/flows/{id}/access-requests`.","name":"requestId","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":256,"pattern":"^[A-Za-z0-9_\\-:.]+$","description":"An optional key that makes this request safe to retry. Send a new UUID for each request. A key is up to 256 letters, digits, `-`, `_`, `:` or `.`; any other key is refused with `400 INVALID_IDEMPOTENCY_KEY` and nothing runs. A retry with the same key within 10 minutes returns the first response and changes nothing again. After 10 minutes, the same key runs the request again, so use a new key for a late retry. See Idempotency in the Introduction.","example":"6f2c4a5e-3b8d-4c7f-9a1e-2d6b8e0f4c5a"},"required":false,"description":"An optional key that makes this request safe to retry. Send a new UUID for each request. A key is up to 256 letters, digits, `-`, `_`, `:` or `.`; any other key is refused with `400 INVALID_IDEMPOTENCY_KEY` and nothing runs. A retry with the same key within 10 minutes returns the first response and changes nothing again. After 10 minutes, the same key runs the request again, so use a new key for a late retry. See Idempotency in the Introduction.","name":"Idempotency-Key","in":"header"}],"responses":{"200":{"description":"The request was answered.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."},"data":{"type":"object","properties":{"status":{"type":"string","enum":["denied"],"description":"Always `denied`."}},"required":["status"],"additionalProperties":false,"description":"The request after your answer."}},"required":["success","data"],"additionalProperties":false}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Refused: `ACCESS_REQUEST_ALREADY_DECIDED`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"410":{"description":"The first result for this `Idempotency-Key` can no longer be returned, because what it created was deleted. Use a new key for the next attempt.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"425":{"description":"A request with this `Idempotency-Key` is still running. Retry after `Retry-After` seconds. If the first request failed with a `5xx`, the key stays held for 10 minutes; to retry sooner, use a new key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"The first result for this `Idempotency-Key` couldn't be checked. Retry with the same key after a short wait. If it keeps happening, contact support with the `requestId`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/{id}/messages/{messageId}":{"patch":{"x-moxo-person-only":"ASSIGNEE_REQUIRED","tags":["Flows"],"summary":"Edit a flow chat message","description":"Changes the text of a message you wrote. Someone else's message returns `403 MESSAGE_EDIT_FORBIDDEN`, and a deleted one `410 MESSAGE_DELETED`. You act as the person the token belongs to, with the reach they have in the app: participate access to the flow, and only messages they can see (a message on a step they can't see is `404`). The flow must not be canceled (`403 FLOW_CANCELLED`). When the template turns comments off, it returns `403 COMMENTS_DISABLED`. Needs a personal access token: an organization API key has no person to act as (`403 ASSIGNEE_REQUIRED`).\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"The flow's id."},"required":true,"description":"The flow's id.","name":"id","in":"path"},{"schema":{"type":"string","description":"The message's id, from `GET /v1/flows/{id}/messages`."},"required":true,"description":"The message's id, from `GET /v1/flows/{id}/messages`.","name":"messageId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"body":{"type":"string","minLength":1,"maxLength":10000,"description":"The message's new text."}},"required":["body"]}}}},"responses":{"200":{"description":"The message after the change, as `GET /v1/flows/{id}/messages` returns it.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."},"data":{"$ref":"#/components/schemas/FlowChatMessage"}},"required":["success","data"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"410":{"description":"Refused: `MESSAGE_DELETED`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"x-moxo-person-only":"ASSIGNEE_REQUIRED","tags":["Flows"],"summary":"Delete a flow chat message","description":"Deletes a message you wrote, as the app does: the thread shows that a message was deleted. Someone else's message returns `403 MESSAGE_DELETE_FORBIDDEN`. You act as the person the token belongs to, with the reach they have in the app: participate access to the flow, and only messages they can see (a message on a step they can't see is `404`). The flow must not be canceled (`403 FLOW_CANCELLED`). When the template turns comments off, it returns `403 COMMENTS_DISABLED`. Needs a personal access token: an organization API key has no person to act as (`403 ASSIGNEE_REQUIRED`).\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"The flow's id."},"required":true,"description":"The flow's id.","name":"id","in":"path"},{"schema":{"type":"string","description":"The message's id, from `GET /v1/flows/{id}/messages`."},"required":true,"description":"The message's id, from `GET /v1/flows/{id}/messages`.","name":"messageId","in":"path"}],"responses":{"204":{"description":"The message is deleted."},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/{id}/messages/{messageId}/resolve":{"patch":{"x-moxo-person-only":"ASSIGNEE_REQUIRED","tags":["Flows"],"summary":"Resolve a flow chat thread","description":"Marks a thread resolved, or opens it again. Works when comments are off too, so open threads can be closed out. You act as the person the token belongs to, with the reach they have in the app: participate access to the flow, and only messages they can see (a message on a step they can't see is `404`). The flow must not be canceled (`403 FLOW_CANCELLED`). Needs a personal access token: an organization API key has no person to act as (`403 ASSIGNEE_REQUIRED`).\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"The flow's id."},"required":true,"description":"The flow's id.","name":"id","in":"path"},{"schema":{"type":"string","description":"The message's id, from `GET /v1/flows/{id}/messages`."},"required":true,"description":"The message's id, from `GET /v1/flows/{id}/messages`.","name":"messageId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"resolved":{"type":"boolean","description":"`true` marks the thread resolved; `false` opens it again."}},"required":["resolved"]}}}},"responses":{"200":{"description":"The message after the change, as `GET /v1/flows/{id}/messages` returns it.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."},"data":{"$ref":"#/components/schemas/FlowChatMessage"}},"required":["success","data"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/{id}/messages/{messageId}/pin":{"post":{"x-moxo-person-only":"ASSIGNEE_REQUIRED","tags":["Flows"],"summary":"Pin a flow chat message","description":"Pins a message, for everyone who can see it. You act as the person the token belongs to, with the reach they have in the app: participate access to the flow, and only messages they can see (a message on a step they can't see is `404`). The flow must not be canceled (`403 FLOW_CANCELLED`). When the template turns comments off, it returns `403 COMMENTS_DISABLED`. Needs a personal access token: an organization API key has no person to act as (`403 ASSIGNEE_REQUIRED`).\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"The flow's id."},"required":true,"description":"The flow's id.","name":"id","in":"path"},{"schema":{"type":"string","description":"The message's id, from `GET /v1/flows/{id}/messages`."},"required":true,"description":"The message's id, from `GET /v1/flows/{id}/messages`.","name":"messageId","in":"path"}],"responses":{"200":{"description":"The message's pin.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."},"data":{"type":"object","properties":{"id":{"type":"string","description":"The message's id."},"isPinned":{"type":"boolean","description":"Whether the message is pinned now."},"pinnedAt":{"type":["string","null"],"description":"When it was pinned (ISO 8601), or `null`."}},"required":["id","isPinned","pinnedAt"],"additionalProperties":false,"description":"The message's pin."}},"required":["success","data"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"x-moxo-person-only":"ASSIGNEE_REQUIRED","tags":["Flows"],"summary":"Unpin a flow chat message","description":"Takes a message's pin away. You act as the person the token belongs to, with the reach they have in the app: participate access to the flow, and only messages they can see (a message on a step they can't see is `404`). The flow must not be canceled (`403 FLOW_CANCELLED`). Needs a personal access token: an organization API key has no person to act as (`403 ASSIGNEE_REQUIRED`).\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"The flow's id."},"required":true,"description":"The flow's id.","name":"id","in":"path"},{"schema":{"type":"string","description":"The message's id, from `GET /v1/flows/{id}/messages`."},"required":true,"description":"The message's id, from `GET /v1/flows/{id}/messages`.","name":"messageId","in":"path"}],"responses":{"200":{"description":"The message's pin.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."},"data":{"type":"object","properties":{"id":{"type":"string","description":"The message's id."},"isPinned":{"type":"boolean","description":"Whether the message is pinned now."},"pinnedAt":{"type":["string","null"],"description":"When it was pinned (ISO 8601), or `null`."}},"required":["id","isPinned","pinnedAt"],"additionalProperties":false,"description":"The message's pin."}},"required":["success","data"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/{id}/messages/{messageId}/reactions":{"post":{"x-moxo-person-only":"ASSIGNEE_REQUIRED","tags":["Flows"],"summary":"React to a flow chat message","description":"Adds your reaction with one emoji, or takes it away when you already reacted with it. Anything but a single emoji returns `400`. You act as the person the token belongs to, with the reach they have in the app: participate access to the flow, and only messages they can see (a message on a step they can't see is `404`). The flow must not be canceled (`403 FLOW_CANCELLED`). Needs a personal access token: an organization API key has no person to act as (`403 ASSIGNEE_REQUIRED`).\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"The flow's id."},"required":true,"description":"The flow's id.","name":"id","in":"path"},{"schema":{"type":"string","description":"The message's id, from `GET /v1/flows/{id}/messages`."},"required":true,"description":"The message's id, from `GET /v1/flows/{id}/messages`.","name":"messageId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"emoji":{"type":"string","minLength":1,"maxLength":64,"description":"One emoji. Sending one you already reacted with takes it away."}},"required":["emoji"]}}}},"responses":{"200":{"description":"Your reaction now, and how many people react with that emoji.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."},"data":{"type":"object","properties":{"emoji":{"type":"string","description":"The emoji."},"reacted":{"type":"boolean","description":"`true` when you now react with it, `false` when this call took your reaction away."},"count":{"type":"integer","description":"How many people react with it now."}},"required":["emoji","reacted","count"],"additionalProperties":false,"description":"Your reaction now, and how many people react with that emoji."}},"required":["success","data"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/{id}/messages/upload-init":{"post":{"x-moxo-person-only":"ASSIGNEE_REQUIRED","tags":["Flows"],"summary":"Get an upload link for a chat file","description":"Returns a signed upload link for one file to send with a message. `PUT` the bytes to `uploadUrl` with every header in `requiredHeaders`; when `completionUrl` is present, `POST` to it after the `PUT`. Then send the `fileId` in `attachmentFileIds` on `POST /v1/flows/{id}/messages`. The file is scanned for viruses after the upload, and counts toward your organization's storage (`402` when it is full). You act as the person the token belongs to, with the reach they have in the app: participate access to the flow, and only messages they can see (a message on a step they can't see is `404`). The flow must not be canceled (`403 FLOW_CANCELLED`). When the template turns comments off, it returns `403 COMMENTS_DISABLED`. Needs a personal access token: an organization API key has no person to act as (`403 ASSIGNEE_REQUIRED`).\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"The flow's id."},"required":true,"description":"The flow's id.","name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"fileName":{"type":"string","minLength":1,"maxLength":500,"description":"The file's name, with its extension."},"fileSize":{"type":"integer","exclusiveMinimum":0,"maximum":2147483648,"description":"The file's size in bytes."},"mimeType":{"type":"string","minLength":1,"maxLength":255,"description":"The file's type, such as `application/pdf`."}},"required":["fileName","fileSize","mimeType"]}}}},"responses":{"201":{"description":"The upload link. Send its `fileId` in `attachmentFileIds` on `POST /v1/flows/{id}/messages` after the upload.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."},"data":{"allOf":[{"$ref":"#/components/schemas/UploadEnvelope"},{"description":"The upload link. Send its `fileId` in `attachmentFileIds` on `POST /v1/flows/{id}/messages` after the upload."}]}},"required":["success","data"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"The organization's plan or quota does not allow this now.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/{id}/messages/from-project":{"post":{"x-moxo-person-only":"ASSIGNEE_REQUIRED","tags":["Flows"],"summary":"Copy project files for a chat message","description":"Copies files of the flow's project, ready to send with a message: send each copy's `fileId` in `attachmentFileIds` on `POST /v1/flows/{id}/messages`. Only a team member on the project can copy its files, and only the current version of each. More than 10 files returns `400 TOO_MANY_ATTACHMENTS`. You act as the person the token belongs to, with the reach they have in the app: participate access to the flow, and only messages they can see (a message on a step they can't see is `404`). The flow must not be canceled (`403 FLOW_CANCELLED`). When the template turns comments off, it returns `403 COMMENTS_DISABLED`. Needs a personal access token: an organization API key has no person to act as (`403 ASSIGNEE_REQUIRED`).\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"The flow's id."},"required":true,"description":"The flow's id.","name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"projectFileIds":{"type":"array","items":{"type":"string","minLength":1,"maxLength":64},"minItems":1,"maxItems":10,"description":"Up to 10 files of the flow's project, by id. Each is copied and ready to send with a message."}},"required":["projectFileIds"],"additionalProperties":false}}}},"responses":{"201":{"description":"The copies, ready to send.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."},"data":{"type":"object","properties":{"files":{"type":"array","items":{"type":"object","properties":{"fileId":{"type":"string","description":"The copy's id: send it in `attachmentFileIds`."},"fileName":{"type":"string","description":"The file's name."},"fileSize":{"type":"number","description":"The file's size in bytes."},"mimeType":{"type":"string","description":"The file's type."},"scanStatus":{"type":"string","description":"The virus scan: `clean`, or still `pending`."}},"required":["fileId","fileName","fileSize","mimeType","scanStatus"],"additionalProperties":false},"description":"One copy for each file you named."}},"required":["files"],"additionalProperties":false,"description":"The copies, ready to send."}},"required":["success","data"]}}}},"400":{"description":"Refused: `TOO_MANY_ATTACHMENTS`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/{id}/notes":{"get":{"tags":["Flows"],"summary":"List a flow's notes","description":"Returns the flow's notes, newest first: the ones written in Notes and the ones people left when they submitted or sent back a step. You see the notes the person the token belongs to sees in the app: a note on a step they can't see is left out, and the template decides who reads Notes at all (`403 FORBIDDEN`). An organization API key reads them as a flow manager does. Notes must be on for your organization and for the flow's template (`404 NOTES_DISABLED`).\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `flows:read`","security":[{"bearerAuth":["flows:read"]}],"parameters":[{"schema":{"type":"string","description":"The flow's id."},"required":true,"description":"The flow's id.","name":"id","in":"path"},{"schema":{"type":"string","description":"The previous page's `nextCursor`. Leave it out for the first page."},"required":false,"description":"The previous page's `nextCursor`. Leave it out for the first page.","name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"description":"How many notes to return, up to 100. Defaults to 50."},"required":false,"description":"How many notes to return, up to 100. Defaults to 50.","name":"limit","in":"query"},{"schema":{"type":"string","description":"Only the notes on this step."},"required":false,"description":"Only the notes on this step.","name":"stepId","in":"query"}],"responses":{"200":{"description":"A page of notes.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."},"data":{"type":"object","properties":{"audience":{"type":"string","enum":["managers","everyone","roles"],"description":"Who reads this flow's notes: its managers, everyone on it, or chosen roles."},"canWrite":{"type":"boolean","description":"Whether you may write a note on this flow."},"notes":{"type":"array","items":{"$ref":"#/components/schemas/FlowNote"},"description":"The notes, newest first."},"nextCursor":{"type":["string","null"],"description":"Send it as `cursor` for the next page; `null` on the last."},"viewerActorId":{"type":["string","null"],"description":"Your own id as `notes[].actor.id` shows it, or `null`."}},"required":["audience","canWrite","notes","nextCursor","viewerActorId"],"additionalProperties":false,"description":"A page of notes."}},"required":["success","data"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"x-moxo-person-only":"ASSIGNEE_REQUIRED","tags":["Flows"],"summary":"Write a flow note","description":"Adds a note to the flow, or to one of its steps, as the person the token belongs to. Everyone who reads the flow's notes sees it. The template decides who may write one (`403 FORBIDDEN`), and a canceled flow takes none (`403 FLOW_CANCELLED`). Notes must be on for your organization and for the flow's template (`404 NOTES_DISABLED`). Needs a personal access token: an organization API key has no person to act as (`403 ASSIGNEE_REQUIRED`). Send an `Idempotency-Key` header to make retries safe.\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"The flow's id."},"required":true,"description":"The flow's id.","name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"body":{"type":"string","minLength":1,"maxLength":20000,"description":"The note."},"bodyFormat":{"type":"string","enum":["text","html"],"description":"`text` (the default) or `html`. HTML is cleaned to the formatting the app's notes allow."},"stepExecutionId":{"type":"string","format":"uuid","description":"Put the note on this step run (`steps[].executionId` from `GET /v1/flows/{id}`)."},"stepId":{"type":"string","minLength":1,"maxLength":200,"description":"Put the note on this step of the flow, started or not. Send this or `stepExecutionId`, not both."}},"required":["body"],"additionalProperties":false}}}},"responses":{"201":{"description":"The note.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."},"data":{"type":"object","properties":{"note":{"allOf":[{"$ref":"#/components/schemas/FlowNote"},{"description":"The note you wrote."}]}},"required":["note"],"additionalProperties":false,"description":"The note."}},"required":["success","data"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/{id}/steps/{stepExecId}/doc-collab":{"get":{"x-moxo-person-only":"PERSON_TOKEN_REQUIRED","tags":["Flows"],"summary":"Get a step's document collaboration","description":"Returns the document collaboration on a step as the app shows it to the person the token belongs to: whose turn it is, the versions and their documents, their side's draft, the held copies, the sections, and what they may do now (`permissions`). Another side's draft is never in it. A step that is not a document collaboration, or one they can't see, returns `404`. Needs a personal access token: the page is a person's own (`403 PERSON_TOKEN_REQUIRED` for an organization API key).\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"The flow's id."},"required":true,"description":"The flow's id.","name":"id","in":"path"},{"schema":{"type":"string","description":"The document collaboration step's run: `steps[].id` from `GET /v1/flows/{id}`. It doesn't take a template step id."},"required":true,"description":"The document collaboration step's run: `steps[].id` from `GET /v1/flows/{id}`. It doesn't take a template step id.","name":"stepExecId","in":"path"}],"responses":{"200":{"description":"The collaboration as the app shows it to you.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."},"data":{"$ref":"#/components/schemas/DocCollabPage"}},"required":["success","data"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/{id}/steps/{stepExecId}/doc-collab/upload-init":{"post":{"x-moxo-person-only":"ASSIGNEE_REQUIRED","tags":["Flows"],"summary":"Get an upload link for a collaboration document","description":"Gets a link to upload a file into this step: the first half of putting a new document in your side's draft, preparing version 1, or a manager's upload for a side. Only a person on a side, a flow manager, or the person preparing version 1 may upload (`403 READ_ONLY`). A file type the collaboration doesn't take returns `422 DOC_COLLAB_FILE_TYPE_NOT_ACCEPTED`. You act as the person the token belongs to, with what they may do in the app: a side's acts need a seat on that side (`403 NOT_ON_A_SIDE`) and, where it matters, their turn (`409 NOT_YOUR_TURN`); a read-only viewer acts on nothing (`403 READ_ONLY`); a step you can't see is `404`. A paused flow returns `409 FLOW_PAUSED`. Needs a personal access token: an organization API key has no person, side or turn to act as (`403 ASSIGNEE_REQUIRED`).\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"The flow's id."},"required":true,"description":"The flow's id.","name":"id","in":"path"},{"schema":{"type":"string","description":"The document collaboration step's run: `steps[].id` from `GET /v1/flows/{id}`. It doesn't take a template step id."},"required":true,"description":"The document collaboration step's run: `steps[].id` from `GET /v1/flows/{id}`. It doesn't take a template step id.","name":"stepExecId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"fileName":{"type":"string","minLength":1,"maxLength":500,"description":"The file's name, with its extension."},"fileSize":{"type":"integer","exclusiveMinimum":0,"maximum":2147483648,"description":"The file's size in bytes."},"mimeType":{"type":"string","minLength":1,"maxLength":255,"description":"The file's type, such as `application/vnd.openxmlformats-officedocument.wordprocessingml.document`."}},"required":["fileName","fileSize","mimeType"],"additionalProperties":false}}}},"responses":{"201":{"description":"The upload link. Name its `fileId` in `POST …/doc-collab/draft-documents`, `PUT …/doc-collab/prepare-documents` or `POST …/doc-collab/manager-upload` after the upload.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."},"data":{"allOf":[{"$ref":"#/components/schemas/UploadEnvelope"},{"description":"The upload link. Name its `fileId` in `POST …/doc-collab/draft-documents`, `PUT …/doc-collab/prepare-documents` or `POST …/doc-collab/manager-upload` after the upload."}]}},"required":["success","data"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Refused: `FLOW_PAUSED`, `NOT_YOUR_TURN`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Refused: `DOC_COLLAB_FILE_TYPE_NOT_ACCEPTED`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/{id}/steps/{stepExecId}/doc-collab/draft-documents":{"post":{"x-moxo-person-only":"ASSIGNEE_REQUIRED","tags":["Flows"],"summary":"Put a document in your side's draft","description":"Puts a file you uploaded (`POST …/doc-collab/upload-init`) into your side's draft as one of the package's documents, starting the draft when there is none. Only your own upload into this step can be used (`404 FILE_REJECTED`), and not a file that failed the virus check (`422 FILE_REJECTED`); `error.fileCode` says why. You act as the person the token belongs to, with what they may do in the app: a side's acts need a seat on that side (`403 NOT_ON_A_SIDE`) and, where it matters, their turn (`409 NOT_YOUR_TURN`); a read-only viewer acts on nothing (`403 READ_ONLY`); a step you can't see is `404`. A paused flow returns `409 FLOW_PAUSED`. Needs a personal access token: an organization API key has no person, side or turn to act as (`403 ASSIGNEE_REQUIRED`). Send an `Idempotency-Key` header to make retries safe: a retry answers the page as it stands.\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"The flow's id."},"required":true,"description":"The flow's id.","name":"id","in":"path"},{"schema":{"type":"string","description":"The document collaboration step's run: `steps[].id` from `GET /v1/flows/{id}`. It doesn't take a template step id."},"required":true,"description":"The document collaboration step's run: `steps[].id` from `GET /v1/flows/{id}`. It doesn't take a template step id.","name":"stepExecId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"documentKey":{"type":"string","minLength":1,"maxLength":40,"description":"The document it is: its `key`, from the page's `documents[]`."},"fileId":{"type":"string","format":"uuid","description":"The file you uploaded, from `POST …/doc-collab/upload-init`."},"checkoutToken":{"type":["string","null"],"minLength":1,"maxLength":100,"description":"Leave it out. The app sends it for a file that comes back from Edit in Word."},"dropSuggestionCount":{"type":"integer","minimum":0,"maximum":100000,"description":"Replacing a PDF that has suggested edits on your side's draft drops them: say how many you agree to drop. Otherwise it returns `409 SUGGESTIONS_OPEN` with the count."}},"required":["documentKey","fileId"],"additionalProperties":false}}}},"responses":{"200":{"description":"The page after the act, as the app shows it to you, and what the act produced.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."},"data":{"$ref":"#/components/schemas/DocCollabActAnswer"}},"required":["success","data"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Refused: `FLOW_PAUSED`, `NOT_YOUR_TURN`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Refused: `FILE_REJECTED`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/{id}/steps/{stepExecId}/doc-collab/documents/{key}/open-draft":{"post":{"x-moxo-person-only":"ASSIGNEE_REQUIRED","tags":["Flows"],"summary":"Start your side's draft of a document written in Moxo","description":"Starts your side's draft of a document written in Moxo, from the current version, so your side can change it before sending. Answers the page with the draft's parts. You act as the person the token belongs to, with what they may do in the app: a side's acts need a seat on that side (`403 NOT_ON_A_SIDE`) and, where it matters, their turn (`409 NOT_YOUR_TURN`); a read-only viewer acts on nothing (`403 READ_ONLY`); a step you can't see is `404`. A paused flow returns `409 FLOW_PAUSED`. Needs a personal access token: an organization API key has no person, side or turn to act as (`403 ASSIGNEE_REQUIRED`). Send an `Idempotency-Key` header to make retries safe: a retry answers the page as it stands.\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"The flow's id."},"required":true,"description":"The flow's id.","name":"id","in":"path"},{"schema":{"type":"string","description":"The document collaboration step's run: `steps[].id` from `GET /v1/flows/{id}`. It doesn't take a template step id."},"required":true,"description":"The document collaboration step's run: `steps[].id` from `GET /v1/flows/{id}`. It doesn't take a template step id.","name":"stepExecId","in":"path"},{"schema":{"type":"string","description":"The document's `key`, from the page's `documents[]`."},"required":true,"description":"The document's `key`, from the page's `documents[]`.","name":"key","in":"path"}],"responses":{"200":{"description":"The page after the act, as the app shows it to you, and what the act produced.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."},"data":{"$ref":"#/components/schemas/DocCollabActAnswer"}},"required":["success","data"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Refused: `FLOW_PAUSED`, `NOT_YOUR_TURN`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/{id}/steps/{stepExecId}/doc-collab/suggestions":{"post":{"x-moxo-person-only":"ASSIGNEE_REQUIRED","tags":["Flows"],"summary":"Suggest an edit on a PDF","description":"Adds a suggested edit to a passage of a PDF in the current version (strike it through, replace it, or insert text after it), in your side's draft: the other side reads it when your side sends. The passage names its page and boxes; the words are read from the PDF. You act as the person the token belongs to, with what they may do in the app: a side's acts need a seat on that side (`403 NOT_ON_A_SIDE`) and, where it matters, their turn (`409 NOT_YOUR_TURN`); a read-only viewer acts on nothing (`403 READ_ONLY`); a step you can't see is `404`. A paused flow returns `409 FLOW_PAUSED`. Needs a personal access token: an organization API key has no person, side or turn to act as (`403 ASSIGNEE_REQUIRED`). Send an `Idempotency-Key` header to make retries safe: a retry answers the page as it stands.\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"The flow's id."},"required":true,"description":"The flow's id.","name":"id","in":"path"},{"schema":{"type":"string","description":"The document collaboration step's run: `steps[].id` from `GET /v1/flows/{id}`. It doesn't take a template step id."},"required":true,"description":"The document collaboration step's run: `steps[].id` from `GET /v1/flows/{id}`. It doesn't take a template step id.","name":"stepExecId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"documentKey":{"type":"string","minLength":1,"maxLength":40,"description":"The PDF it is on: its `key`, from the page's `documents[]`."},"op":{"type":"string","enum":["strike","replace","insert"],"description":"`strike`: strike the passage through. `replace`: replace it with `text`. `insert`: insert `text` after it."},"text":{"type":"string","maxLength":4000,"description":"The new text: needed to replace or insert, refused to strike through. Kept as written, spaces included."},"note":{"type":"string","maxLength":4000,"description":"A word on why, shown with the suggestion."},"textAnchor":{"anyOf":[{"type":"object","properties":{"quote":{"type":"string","minLength":1,"maxLength":1000,"description":"The passage's words."},"prefix":{"type":"string","maxLength":200,"description":"The words just before it."},"suffix":{"type":"string","maxLength":200,"description":"The words just after it."},"from":{"type":"string","minLength":1,"maxLength":1024,"description":"Where the passage starts in a document written in Moxo, as the editor marks it."},"to":{"type":"string","minLength":1,"maxLength":1024,"description":"Where it ends."},"ooxml":{"type":"object","properties":{"paragraph":{"type":"string","minLength":1,"maxLength":200,"description":"The Word paragraph it is in."},"start":{"type":"integer","minimum":0,"maximum":10000000,"description":"Where the passage starts in the paragraph's shown text."},"end":{"type":"integer","minimum":1,"maximum":10000000,"description":"Where it ends."}},"required":["paragraph","start","end"],"additionalProperties":false,"description":"On a Word document: the paragraph and where the passage is in it."},"pdf":{"type":"object","properties":{"page":{"type":"integer","minimum":1,"maximum":100000,"description":"The page it is on, from 1."},"quads":{"type":"array","items":{"type":"object","properties":{"x":{"type":"number","minimum":0,"maximum":100,"description":"Its left edge, in percent of the page's width."},"y":{"type":"number","minimum":0,"maximum":100,"description":"Its top edge, in percent of the page's height."},"w":{"type":"number","minimum":0,"maximum":100,"description":"Its width, in percent of the page's width."},"h":{"type":"number","minimum":0,"maximum":100,"description":"Its height, in percent of the page's height."}},"required":["x","y","w","h"],"additionalProperties":false},"minItems":1,"maxItems":500,"description":"The boxes around its words."}},"required":["page","quads"],"additionalProperties":false,"description":"On a PDF: the page and the boxes around the passage."}},"required":["quote","prefix","suffix"],"additionalProperties":false},{"type":"object","properties":{"pdf":{"type":"object","properties":{"page":{"type":"integer","minimum":1,"maximum":100000,"description":"The page it is on, from 1."},"quads":{"type":"array","items":{"type":"object","properties":{"x":{"type":"number","minimum":0,"maximum":100,"description":"Its left edge, in percent of the page's width."},"y":{"type":"number","minimum":0,"maximum":100,"description":"Its top edge, in percent of the page's height."},"w":{"type":"number","minimum":0,"maximum":100,"description":"Its width, in percent of the page's width."},"h":{"type":"number","minimum":0,"maximum":100,"description":"Its height, in percent of the page's height."}},"required":["x","y","w","h"],"additionalProperties":false},"minItems":1,"maxItems":500,"description":"The boxes around its words."}},"required":["page","quads"],"additionalProperties":false,"description":"The page and the boxes around the passage."}},"required":["pdf"],"additionalProperties":false}],"description":"The passage: its page and the boxes around its words (`pdf`). The words are read from the PDF under the boxes."}},"required":["documentKey","op","textAnchor"],"additionalProperties":false}}}},"responses":{"201":{"description":"The page after the act, as the app shows it to you, and what the act produced.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."},"data":{"$ref":"#/components/schemas/DocCollabActAnswer"}},"required":["success","data"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Refused: `FLOW_PAUSED`, `NOT_YOUR_TURN`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/{id}/steps/{stepExecId}/doc-collab/suggestions/{suggestionId}/remove":{"post":{"x-moxo-person-only":"ASSIGNEE_REQUIRED","tags":["Flows"],"summary":"Remove a suggested edit","description":"Takes a suggested edit out of your side's draft. You act as the person the token belongs to, with what they may do in the app: a side's acts need a seat on that side (`403 NOT_ON_A_SIDE`) and, where it matters, their turn (`409 NOT_YOUR_TURN`); a read-only viewer acts on nothing (`403 READ_ONLY`); a step you can't see is `404`. A paused flow returns `409 FLOW_PAUSED`. Needs a personal access token: an organization API key has no person, side or turn to act as (`403 ASSIGNEE_REQUIRED`). Send an `Idempotency-Key` header to make retries safe: a retry answers the page as it stands.\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"The flow's id."},"required":true,"description":"The flow's id.","name":"id","in":"path"},{"schema":{"type":"string","description":"The document collaboration step's run: `steps[].id` from `GET /v1/flows/{id}`. It doesn't take a template step id."},"required":true,"description":"The document collaboration step's run: `steps[].id` from `GET /v1/flows/{id}`. It doesn't take a template step id.","name":"stepExecId","in":"path"},{"schema":{"type":"string","description":"The suggestion's id, from the page."},"required":true,"description":"The suggestion's id, from the page.","name":"suggestionId","in":"path"}],"responses":{"200":{"description":"The page after the act, as the app shows it to you, and what the act produced.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."},"data":{"$ref":"#/components/schemas/DocCollabActAnswer"}},"required":["success","data"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Refused: `FLOW_PAUSED`, `NOT_YOUR_TURN`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/{id}/steps/{stepExecId}/doc-collab/discard-draft":{"post":{"x-moxo-person-only":"ASSIGNEE_REQUIRED","tags":["Flows"],"summary":"Discard your side's draft","description":"Drops your side's draft and everything in it. It can't be put back. You act as the person the token belongs to, with what they may do in the app: a side's acts need a seat on that side (`403 NOT_ON_A_SIDE`) and, where it matters, their turn (`409 NOT_YOUR_TURN`); a read-only viewer acts on nothing (`403 READ_ONLY`); a step you can't see is `404`. A paused flow returns `409 FLOW_PAUSED`. Needs a personal access token: an organization API key has no person, side or turn to act as (`403 ASSIGNEE_REQUIRED`). Send an `Idempotency-Key` header to make retries safe: a retry answers the page as it stands.\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"The flow's id."},"required":true,"description":"The flow's id.","name":"id","in":"path"},{"schema":{"type":"string","description":"The document collaboration step's run: `steps[].id` from `GET /v1/flows/{id}`. It doesn't take a template step id."},"required":true,"description":"The document collaboration step's run: `steps[].id` from `GET /v1/flows/{id}`. It doesn't take a template step id.","name":"stepExecId","in":"path"}],"responses":{"200":{"description":"The page after the act, as the app shows it to you, and what the act produced.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."},"data":{"$ref":"#/components/schemas/DocCollabActAnswer"}},"required":["success","data"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Refused: `FLOW_PAUSED`, `NOT_YOUR_TURN`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/{id}/steps/{stepExecId}/doc-collab/go-ahead":{"post":{"x-moxo-person-only":"ASSIGNEE_REQUIRED","tags":["Flows"],"summary":"Give the go-ahead on your side's draft","description":"Says the draft you read is ready to send, for a side whose rule needs more than one person's go-ahead. Name the draft as the page showed it (`myDraft.id` and `myDraft.rev`): a draft that changed since returns `409 DRAFT_CHANGED` with its revision now. You act as the person the token belongs to, with what they may do in the app: a side's acts need a seat on that side (`403 NOT_ON_A_SIDE`) and, where it matters, their turn (`409 NOT_YOUR_TURN`); a read-only viewer acts on nothing (`403 READ_ONLY`); a step you can't see is `404`. A paused flow returns `409 FLOW_PAUSED`. Needs a personal access token: an organization API key has no person, side or turn to act as (`403 ASSIGNEE_REQUIRED`). Send an `Idempotency-Key` header to make retries safe: a retry answers the page as it stands.\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"The flow's id."},"required":true,"description":"The flow's id.","name":"id","in":"path"},{"schema":{"type":"string","description":"The document collaboration step's run: `steps[].id` from `GET /v1/flows/{id}`. It doesn't take a template step id."},"required":true,"description":"The document collaboration step's run: `steps[].id` from `GET /v1/flows/{id}`. It doesn't take a template step id.","name":"stepExecId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"draftId":{"type":"string","format":"uuid","description":"The draft you read: `myDraft.id` from the page."},"draftRev":{"type":"integer","minimum":0,"description":"Its revision as you read it: `myDraft.rev`."}},"required":["draftId","draftRev"],"additionalProperties":false}}}},"responses":{"200":{"description":"The page after the act, as the app shows it to you, and what the act produced.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."},"data":{"$ref":"#/components/schemas/DocCollabActAnswer"}},"required":["success","data"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Refused: `DRAFT_CHANGED`, `FLOW_PAUSED`, `NOT_YOUR_TURN`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/{id}/steps/{stepExecId}/doc-collab/send":{"post":{"x-moxo-person-only":"ASSIGNEE_REQUIRED","tags":["Flows"],"summary":"Send your side's draft as a new version","description":"Sends your side's draft as the next version, with a note to the other side, and passes the turn. Name what the page showed: the version number (`versionNumber`), the draft (`myDraft.id`, `myDraft.rev`) and each part's revision of a document written in Moxo. A version that moved returns `409 ALREADY_SENT`, and a draft that changed `409 DRAFT_CHANGED`; your side keeps its draft. You act as the person the token belongs to, with what they may do in the app: a side's acts need a seat on that side (`403 NOT_ON_A_SIDE`) and, where it matters, their turn (`409 NOT_YOUR_TURN`); a read-only viewer acts on nothing (`403 READ_ONLY`); a step you can't see is `404`. A paused flow returns `409 FLOW_PAUSED`. Needs a personal access token: an organization API key has no person, side or turn to act as (`403 ASSIGNEE_REQUIRED`). Send an `Idempotency-Key` header to make retries safe: a retry answers the page as it stands.\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"The flow's id."},"required":true,"description":"The flow's id.","name":"id","in":"path"},{"schema":{"type":"string","description":"The document collaboration step's run: `steps[].id` from `GET /v1/flows/{id}`. It doesn't take a template step id."},"required":true,"description":"The document collaboration step's run: `steps[].id` from `GET /v1/flows/{id}`. It doesn't take a template step id.","name":"stepExecId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"note":{"type":"string","maxLength":4000,"default":"","description":"A note to the other side, sent with the version."},"expectedVersionNumber":{"type":"integer","minimum":0,"description":"The current version's number as the page showed it: `versionNumber`."},"draftId":{"type":"string","format":"uuid","description":"Your side's draft: `myDraft.id` from the page."},"draftRev":{"type":"integer","minimum":0,"description":"Its revision as you read it: `myDraft.rev`."},"expectedDraftRev":{"type":"integer","minimum":0,"description":"Leave it out. The app sends it when its own saves moved the draft on."},"expectedPartRevs":{"type":"object","additionalProperties":{"type":"integer","minimum":0},"description":"Each part of a document written in Moxo as the page showed it: `documents[].parts[].rev` by `partId`, for every part you can read. `{}` when there is none."}},"required":["expectedVersionNumber","draftId","draftRev","expectedPartRevs"],"additionalProperties":false}}}},"responses":{"200":{"description":"The page after the act, as the app shows it to you, and what the act produced.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."},"data":{"$ref":"#/components/schemas/DocCollabActAnswer"}},"required":["success","data"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Refused: `ALREADY_SENT`, `DRAFT_CHANGED`, `FLOW_PAUSED`, `NOT_YOUR_TURN`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/{id}/steps/{stepExecId}/doc-collab/approve":{"post":{"x-moxo-person-only":"ASSIGNEE_REQUIRED","tags":["Flows"],"summary":"Approve the current version","description":"Approves the current version for your side. When every side has approved it, the documents are agreed and the step completes. Name the version the page showed (`versionNumber`): one that moved returns `409 ALREADY_SENT`. With suggested edits open on it, say how many you approve without (`withoutSuggestionCount`), or it returns `409 SUGGESTIONS_OPEN` with the count. You act as the person the token belongs to, with what they may do in the app: a side's acts need a seat on that side (`403 NOT_ON_A_SIDE`) and, where it matters, their turn (`409 NOT_YOUR_TURN`); a read-only viewer acts on nothing (`403 READ_ONLY`); a step you can't see is `404`. A paused flow returns `409 FLOW_PAUSED`. Needs a personal access token: an organization API key has no person, side or turn to act as (`403 ASSIGNEE_REQUIRED`). Send an `Idempotency-Key` header to make retries safe: a retry answers the page as it stands.\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"The flow's id."},"required":true,"description":"The flow's id.","name":"id","in":"path"},{"schema":{"type":"string","description":"The document collaboration step's run: `steps[].id` from `GET /v1/flows/{id}`. It doesn't take a template step id."},"required":true,"description":"The document collaboration step's run: `steps[].id` from `GET /v1/flows/{id}`. It doesn't take a template step id.","name":"stepExecId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"expectedVersionNumber":{"type":"integer","minimum":0,"description":"The version you approve, as the page showed it: `versionNumber`."},"withoutSuggestionCount":{"type":"integer","minimum":0,"maximum":100000,"description":"With suggested edits open on the version: how many you approve it without. Otherwise it returns `409 SUGGESTIONS_OPEN` with the count."}},"required":["expectedVersionNumber"],"additionalProperties":false}}}},"responses":{"200":{"description":"The page after the act, as the app shows it to you, and what the act produced.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."},"data":{"$ref":"#/components/schemas/DocCollabActAnswer"}},"required":["success","data"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Refused: `ALREADY_SENT`, `FLOW_PAUSED`, `NOT_YOUR_TURN`, `SUGGESTIONS_OPEN`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/{id}/steps/{stepExecId}/doc-collab/approve-content":{"post":{"x-moxo-person-only":"ASSIGNEE_REQUIRED","tags":["Flows"],"summary":"Approve the text written together","description":"Approves the documents written together, as the page showed them: the package's revision (`contentRevision`) and each part's. Text someone saved since returns `409 CONTENT_MOVED`. When enough people have approved, the step completes. You act as the person the token belongs to, with what they may do in the app: a side's acts need a seat on that side (`403 NOT_ON_A_SIDE`) and, where it matters, their turn (`409 NOT_YOUR_TURN`); a read-only viewer acts on nothing (`403 READ_ONLY`); a step you can't see is `404`. A paused flow returns `409 FLOW_PAUSED`. Needs a personal access token: an organization API key has no person, side or turn to act as (`403 ASSIGNEE_REQUIRED`). Send an `Idempotency-Key` header to make retries safe: a retry answers the page as it stands.\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"The flow's id."},"required":true,"description":"The flow's id.","name":"id","in":"path"},{"schema":{"type":"string","description":"The document collaboration step's run: `steps[].id` from `GET /v1/flows/{id}`. It doesn't take a template step id."},"required":true,"description":"The document collaboration step's run: `steps[].id` from `GET /v1/flows/{id}`. It doesn't take a template step id.","name":"stepExecId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"expectedContentRevision":{"type":"integer","minimum":0,"description":"The package's revision as the page showed it: `contentRevision`."},"expectedPartRevs":{"type":"object","additionalProperties":{"type":"integer","minimum":0},"description":"Each part of a document written in Moxo as the page showed it: `documents[].parts[].rev` by `partId`, for every part you can read. `{}` when there is none."}},"required":["expectedContentRevision","expectedPartRevs"],"additionalProperties":false}}}},"responses":{"200":{"description":"The page after the act, as the app shows it to you, and what the act produced.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."},"data":{"$ref":"#/components/schemas/DocCollabActAnswer"}},"required":["success","data"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Refused: `CONTENT_MOVED`, `FLOW_PAUSED`, `NOT_YOUR_TURN`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/{id}/steps/{stepExecId}/doc-collab/sections/{sectionId}/done":{"post":{"x-moxo-person-only":"ASSIGNEE_REQUIRED","tags":["Flows"],"summary":"Mark a section done","description":"Marks a section done: one your role owns, any section as an editor, or, as a flow manager, a section nobody is on. Anyone else returns `403 NOT_YOUR_SECTION`. You act as the person the token belongs to, with what they may do in the app: a side's acts need a seat on that side (`403 NOT_ON_A_SIDE`) and, where it matters, their turn (`409 NOT_YOUR_TURN`); a read-only viewer acts on nothing (`403 READ_ONLY`); a step you can't see is `404`. A paused flow returns `409 FLOW_PAUSED`. Needs a personal access token: an organization API key has no person, side or turn to act as (`403 ASSIGNEE_REQUIRED`). Send an `Idempotency-Key` header to make retries safe: a retry answers the page as it stands.\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"The flow's id."},"required":true,"description":"The flow's id.","name":"id","in":"path"},{"schema":{"type":"string","description":"The document collaboration step's run: `steps[].id` from `GET /v1/flows/{id}`. It doesn't take a template step id."},"required":true,"description":"The document collaboration step's run: `steps[].id` from `GET /v1/flows/{id}`. It doesn't take a template step id.","name":"stepExecId","in":"path"},{"schema":{"type":"string","description":"The section's `sectionId`, from the page's `sections[]`."},"required":true,"description":"The section's `sectionId`, from the page's `sections[]`.","name":"sectionId","in":"path"}],"responses":{"200":{"description":"The page after the act, as the app shows it to you, and what the act produced.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."},"data":{"$ref":"#/components/schemas/DocCollabActAnswer"}},"required":["success","data"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Refused: `FLOW_PAUSED`, `NOT_YOUR_TURN`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/{id}/steps/{stepExecId}/doc-collab/sections/{sectionId}/reopen":{"post":{"x-moxo-person-only":"ASSIGNEE_REQUIRED","tags":["Flows"],"summary":"Reopen a section","description":"Opens a section marked done for writing again. Someone who may not returns `403 NOT_YOUR_SECTION`. You act as the person the token belongs to, with what they may do in the app: a side's acts need a seat on that side (`403 NOT_ON_A_SIDE`) and, where it matters, their turn (`409 NOT_YOUR_TURN`); a read-only viewer acts on nothing (`403 READ_ONLY`); a step you can't see is `404`. A paused flow returns `409 FLOW_PAUSED`. Needs a personal access token: an organization API key has no person, side or turn to act as (`403 ASSIGNEE_REQUIRED`). Send an `Idempotency-Key` header to make retries safe: a retry answers the page as it stands.\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"The flow's id."},"required":true,"description":"The flow's id.","name":"id","in":"path"},{"schema":{"type":"string","description":"The document collaboration step's run: `steps[].id` from `GET /v1/flows/{id}`. It doesn't take a template step id."},"required":true,"description":"The document collaboration step's run: `steps[].id` from `GET /v1/flows/{id}`. It doesn't take a template step id.","name":"stepExecId","in":"path"},{"schema":{"type":"string","description":"The section's `sectionId`, from the page's `sections[]`."},"required":true,"description":"The section's `sectionId`, from the page's `sections[]`.","name":"sectionId","in":"path"}],"responses":{"200":{"description":"The page after the act, as the app shows it to you, and what the act produced.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."},"data":{"$ref":"#/components/schemas/DocCollabActAnswer"}},"required":["success","data"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Refused: `FLOW_PAUSED`, `NOT_YOUR_TURN`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/{id}/steps/{stepExecId}/doc-collab/sections/{sectionId}":{"patch":{"x-moxo-person-only":"ASSIGNEE_REQUIRED","tags":["Flows"],"summary":"Rename a section","description":"Changes a section's heading. Only an editor may (`403 NOT_AN_EDITOR`). You act as the person the token belongs to, with what they may do in the app: a side's acts need a seat on that side (`403 NOT_ON_A_SIDE`) and, where it matters, their turn (`409 NOT_YOUR_TURN`); a read-only viewer acts on nothing (`403 READ_ONLY`); a step you can't see is `404`. A paused flow returns `409 FLOW_PAUSED`. Needs a personal access token: an organization API key has no person, side or turn to act as (`403 ASSIGNEE_REQUIRED`). Send an `Idempotency-Key` header to make retries safe: a retry answers the page as it stands.\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"The flow's id."},"required":true,"description":"The flow's id.","name":"id","in":"path"},{"schema":{"type":"string","description":"The document collaboration step's run: `steps[].id` from `GET /v1/flows/{id}`. It doesn't take a template step id."},"required":true,"description":"The document collaboration step's run: `steps[].id` from `GET /v1/flows/{id}`. It doesn't take a template step id.","name":"stepExecId","in":"path"},{"schema":{"type":"string","description":"The section's `sectionId`, from the page's `sections[]`."},"required":true,"description":"The section's `sectionId`, from the page's `sections[]`.","name":"sectionId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":200,"description":"The section's new heading."}},"required":["title"],"additionalProperties":false}}}},"responses":{"200":{"description":"The page after the act, as the app shows it to you, and what the act produced.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."},"data":{"$ref":"#/components/schemas/DocCollabActAnswer"}},"required":["success","data"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Refused: `FLOW_PAUSED`, `NOT_YOUR_TURN`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/{id}/steps/{stepExecId}/doc-collab/ask-for-approval":{"post":{"x-moxo-person-only":"ASSIGNEE_REQUIRED","tags":["Flows"],"summary":"Ask for approval of the text","description":"Ends the writing of the sections and asks everyone to approve the text. Only an editor may, or a flow manager when no editor is on the step (`403 NOT_AN_EDITOR`). You act as the person the token belongs to, with what they may do in the app: a side's acts need a seat on that side (`403 NOT_ON_A_SIDE`) and, where it matters, their turn (`409 NOT_YOUR_TURN`); a read-only viewer acts on nothing (`403 READ_ONLY`); a step you can't see is `404`. A paused flow returns `409 FLOW_PAUSED`. Needs a personal access token: an organization API key has no person, side or turn to act as (`403 ASSIGNEE_REQUIRED`). Send an `Idempotency-Key` header to make retries safe: a retry answers the page as it stands.\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"The flow's id."},"required":true,"description":"The flow's id.","name":"id","in":"path"},{"schema":{"type":"string","description":"The document collaboration step's run: `steps[].id` from `GET /v1/flows/{id}`. It doesn't take a template step id."},"required":true,"description":"The document collaboration step's run: `steps[].id` from `GET /v1/flows/{id}`. It doesn't take a template step id.","name":"stepExecId","in":"path"}],"responses":{"200":{"description":"The page after the act, as the app shows it to you, and what the act produced.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."},"data":{"$ref":"#/components/schemas/DocCollabActAnswer"}},"required":["success","data"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Refused: `FLOW_PAUSED`, `NOT_YOUR_TURN`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/{id}/steps/{stepExecId}/doc-collab/held/{heldItemId}/resolve":{"post":{"x-moxo-person-only":"ASSIGNEE_REQUIRED","tags":["Flows"],"summary":"Settle a held upload","description":"Settles a late upload or an emailed reply that was held: `applied` once you have used it, or `dismissed`. Only its side, or a manager, may. You act as the person the token belongs to, with what they may do in the app: a side's acts need a seat on that side (`403 NOT_ON_A_SIDE`) and, where it matters, their turn (`409 NOT_YOUR_TURN`); a read-only viewer acts on nothing (`403 READ_ONLY`); a step you can't see is `404`. A paused flow returns `409 FLOW_PAUSED`. Needs a personal access token: an organization API key has no person, side or turn to act as (`403 ASSIGNEE_REQUIRED`). Send an `Idempotency-Key` header to make retries safe: a retry answers the page as it stands.\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"The flow's id."},"required":true,"description":"The flow's id.","name":"id","in":"path"},{"schema":{"type":"string","description":"The document collaboration step's run: `steps[].id` from `GET /v1/flows/{id}`. It doesn't take a template step id."},"required":true,"description":"The document collaboration step's run: `steps[].id` from `GET /v1/flows/{id}`. It doesn't take a template step id.","name":"stepExecId","in":"path"},{"schema":{"type":"string","description":"The held copy's `id`, from the page's `heldItems[]`."},"required":true,"description":"The held copy's `id`, from the page's `heldItems[]`.","name":"heldItemId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"resolution":{"type":"string","enum":["applied","dismissed"],"description":"`applied`: you have used it. `dismissed`: it is not needed."}},"required":["resolution"],"additionalProperties":false}}}},"responses":{"200":{"description":"The page after the act, as the app shows it to you, and what the act produced.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."},"data":{"$ref":"#/components/schemas/DocCollabActAnswer"}},"required":["success","data"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Refused: `FLOW_PAUSED`, `NOT_YOUR_TURN`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/{id}/steps/{stepExecId}/doc-collab/held/{heldItemId}/combine":{"post":{"x-moxo-person-only":"ASSIGNEE_REQUIRED","tags":["Flows"],"summary":"Combine a held copy into the draft","description":"Combines a held copy into your side's draft, with a choice for each passage both changed. Name the draft's revision the page showed: a draft that moved returns `409 DRAFT_CHANGED`, and passages that changed since `409 CONFLICTS_CHANGED` with the list now. A copy that can't be combined returns `422 NOT_COMBINABLE`. You act as the person the token belongs to, with what they may do in the app: a side's acts need a seat on that side (`403 NOT_ON_A_SIDE`) and, where it matters, their turn (`409 NOT_YOUR_TURN`); a read-only viewer acts on nothing (`403 READ_ONLY`); a step you can't see is `404`. A paused flow returns `409 FLOW_PAUSED`. Needs a personal access token: an organization API key has no person, side or turn to act as (`403 ASSIGNEE_REQUIRED`). Send an `Idempotency-Key` header to make retries safe: a retry answers the page as it stands.\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"The flow's id."},"required":true,"description":"The flow's id.","name":"id","in":"path"},{"schema":{"type":"string","description":"The document collaboration step's run: `steps[].id` from `GET /v1/flows/{id}`. It doesn't take a template step id."},"required":true,"description":"The document collaboration step's run: `steps[].id` from `GET /v1/flows/{id}`. It doesn't take a template step id.","name":"stepExecId","in":"path"},{"schema":{"type":"string","description":"The held copy's `id`, from the page's `heldItems[]`."},"required":true,"description":"The held copy's `id`, from the page's `heldItems[]`.","name":"heldItemId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"choices":{"type":"array","items":{"type":"object","properties":{"conflictId":{"type":"string","minLength":1,"maxLength":64,"description":"The passage: its `id`, from `GET …/doc-collab/held/{heldItemId}/combine`."},"keep":{"type":"string","enum":["ours","theirs","both"],"description":"`ours`: the draft's words. `theirs`: the held copy's. `both`: both, one after the other."}},"required":["conflictId","keep"],"additionalProperties":false},"maxItems":200,"description":"A choice for each passage both changed; `[]` when there is none."},"expectedDraftRev":{"type":"integer","minimum":0,"description":"Your side's draft's revision as the page showed it: `myDraft.rev`."}},"required":["choices","expectedDraftRev"],"additionalProperties":false}}}},"responses":{"200":{"description":"The page after the act, as the app shows it to you, and what the act produced.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."},"data":{"$ref":"#/components/schemas/DocCollabActAnswer"}},"required":["success","data"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Refused: `CONFLICTS_CHANGED`, `DRAFT_CHANGED`, `FLOW_PAUSED`, `NOT_YOUR_TURN`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Refused: `NOT_COMBINABLE`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/{id}/steps/{stepExecId}/doc-collab/held/{heldItemId}/use-instead":{"post":{"x-moxo-person-only":"ASSIGNEE_REQUIRED","tags":["Flows"],"summary":"Use a held copy instead of the draft","description":"Makes a held copy your side's draft; the draft it replaces is kept aside as a held copy. Name the draft's revision the page showed (`409 DRAFT_CHANGED` when it moved). You act as the person the token belongs to, with what they may do in the app: a side's acts need a seat on that side (`403 NOT_ON_A_SIDE`) and, where it matters, their turn (`409 NOT_YOUR_TURN`); a read-only viewer acts on nothing (`403 READ_ONLY`); a step you can't see is `404`. A paused flow returns `409 FLOW_PAUSED`. Needs a personal access token: an organization API key has no person, side or turn to act as (`403 ASSIGNEE_REQUIRED`). Send an `Idempotency-Key` header to make retries safe: a retry answers the page as it stands.\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"The flow's id."},"required":true,"description":"The flow's id.","name":"id","in":"path"},{"schema":{"type":"string","description":"The document collaboration step's run: `steps[].id` from `GET /v1/flows/{id}`. It doesn't take a template step id."},"required":true,"description":"The document collaboration step's run: `steps[].id` from `GET /v1/flows/{id}`. It doesn't take a template step id.","name":"stepExecId","in":"path"},{"schema":{"type":"string","description":"The held copy's `id`, from the page's `heldItems[]`."},"required":true,"description":"The held copy's `id`, from the page's `heldItems[]`.","name":"heldItemId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"expectedDraftRev":{"type":"integer","minimum":0,"description":"Your side's draft's revision as the page showed it: `myDraft.rev`."}},"required":["expectedDraftRev"],"additionalProperties":false}}}},"responses":{"200":{"description":"The page after the act, as the app shows it to you, and what the act produced.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."},"data":{"$ref":"#/components/schemas/DocCollabActAnswer"}},"required":["success","data"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Refused: `DRAFT_CHANGED`, `FLOW_PAUSED`, `NOT_YOUR_TURN`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/{id}/steps/{stepExecId}/doc-collab/prepare-documents":{"put":{"x-moxo-person-only":"ASSIGNEE_REQUIRED","tags":["Flows"],"summary":"Save the documents for version 1","description":"Saves the documents the person preparing version 1 has so far (the whole list each time, each a file uploaded into this step) and the values typed for a Word template's placeholders. Only the person preparing it may. You act as the person the token belongs to, with what they may do in the app: a side's acts need a seat on that side (`403 NOT_ON_A_SIDE`) and, where it matters, their turn (`409 NOT_YOUR_TURN`); a read-only viewer acts on nothing (`403 READ_ONLY`); a step you can't see is `404`. A paused flow returns `409 FLOW_PAUSED`. Needs a personal access token: an organization API key has no person, side or turn to act as (`403 ASSIGNEE_REQUIRED`). Send an `Idempotency-Key` header to make retries safe: a retry answers the page as it stands.\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"The flow's id."},"required":true,"description":"The flow's id.","name":"id","in":"path"},{"schema":{"type":"string","description":"The document collaboration step's run: `steps[].id` from `GET /v1/flows/{id}`. It doesn't take a template step id."},"required":true,"description":"The document collaboration step's run: `steps[].id` from `GET /v1/flows/{id}`. It doesn't take a template step id.","name":"stepExecId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"documents":{"type":"array","items":{"type":"object","properties":{"documentKey":{"type":"string","minLength":1,"maxLength":40,"description":"The document it is: its `key`, from the page's `documents[]`."},"fileId":{"type":"string","format":"uuid","description":"The file you uploaded, from `POST …/doc-collab/upload-init`."}},"required":["documentKey","fileId"],"additionalProperties":false},"maxItems":10,"description":"The whole list of documents so far, one file each."},"slotValues":{"type":"object","additionalProperties":{"type":"object","additionalProperties":{"type":"string","maxLength":4000}},"description":"The values typed for Word templates' placeholders, by document key, then placeholder name: the whole set. Leave it out to keep the saved values."}},"required":["documents"],"additionalProperties":false}}}},"responses":{"200":{"description":"The page after the act, as the app shows it to you, and what the act produced.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."},"data":{"$ref":"#/components/schemas/DocCollabActAnswer"}},"required":["success","data"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Refused: `FLOW_PAUSED`, `NOT_YOUR_TURN`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/{id}/steps/{stepExecId}/doc-collab/manager-upload":{"post":{"x-moxo-person-only":"ASSIGNEE_REQUIRED","tags":["Flows"],"summary":"Upload a version for a side","description":"A flow manager sends a version for a side (the documents a side sent by email, say), with a note, as if that side had sent it. Name the version the page showed (`409 ALREADY_SENT` when it moved). Only a flow manager may. You act as the person the token belongs to, with what they may do in the app: a side's acts need a seat on that side (`403 NOT_ON_A_SIDE`) and, where it matters, their turn (`409 NOT_YOUR_TURN`); a read-only viewer acts on nothing (`403 READ_ONLY`); a step you can't see is `404`. A paused flow returns `409 FLOW_PAUSED`. Needs a personal access token: an organization API key has no person, side or turn to act as (`403 ASSIGNEE_REQUIRED`). Send an `Idempotency-Key` header to make retries safe: a retry answers the page as it stands.\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"The flow's id."},"required":true,"description":"The flow's id.","name":"id","in":"path"},{"schema":{"type":"string","description":"The document collaboration step's run: `steps[].id` from `GET /v1/flows/{id}`. It doesn't take a template step id."},"required":true,"description":"The document collaboration step's run: `steps[].id` from `GET /v1/flows/{id}`. It doesn't take a template step id.","name":"stepExecId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"sideId":{"type":"string","minLength":1,"maxLength":40,"description":"The side it is from: its `id`, from the page's `sides[]`."},"documents":{"type":"array","items":{"type":"object","properties":{"documentKey":{"type":"string","minLength":1,"maxLength":40,"description":"The document it is: its `key`, from the page's `documents[]`."},"fileId":{"type":"string","format":"uuid","description":"The file you uploaded, from `POST …/doc-collab/upload-init`."}},"required":["documentKey","fileId"],"additionalProperties":false},"minItems":1,"maxItems":10,"description":"The documents of the version, one file each."},"note":{"type":"string","maxLength":4000,"default":"","description":"A note sent with the version."},"expectedVersionNumber":{"type":"integer","minimum":0,"description":"The current version's number as the page showed it: `versionNumber`."}},"required":["sideId","documents","expectedVersionNumber"],"additionalProperties":false}}}},"responses":{"200":{"description":"The page after the act, as the app shows it to you, and what the act produced.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."},"data":{"$ref":"#/components/schemas/DocCollabActAnswer"}},"required":["success","data"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Refused: `ALREADY_SENT`, `FLOW_PAUSED`, `NOT_YOUR_TURN`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/{id}/steps/{stepExecId}/doc-collab/remind":{"post":{"x-moxo-person-only":"ASSIGNEE_REQUIRED","tags":["Flows"],"summary":"Remind the people who must act","description":"A flow manager reminds everyone who must act now, or, for documents written in sections, one section's owners (`sectionId`). Nobody to remind returns `400 NOTHING_TO_REMIND`. Only a flow manager may. You act as the person the token belongs to, with what they may do in the app: a side's acts need a seat on that side (`403 NOT_ON_A_SIDE`) and, where it matters, their turn (`409 NOT_YOUR_TURN`); a read-only viewer acts on nothing (`403 READ_ONLY`); a step you can't see is `404`. A paused flow returns `409 FLOW_PAUSED`. Needs a personal access token: an organization API key has no person, side or turn to act as (`403 ASSIGNEE_REQUIRED`). Send an `Idempotency-Key` header to make retries safe: a retry answers the page as it stands.\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"The flow's id."},"required":true,"description":"The flow's id.","name":"id","in":"path"},{"schema":{"type":"string","description":"The document collaboration step's run: `steps[].id` from `GET /v1/flows/{id}`. It doesn't take a template step id."},"required":true,"description":"The document collaboration step's run: `steps[].id` from `GET /v1/flows/{id}`. It doesn't take a template step id.","name":"stepExecId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"sectionId":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,39}$","description":"For documents written in sections: remind only this section's owners. Leave it out to remind everyone who must act now."}},"additionalProperties":false}}}},"responses":{"200":{"description":"The page after the act, as the app shows it to you, and what the act produced.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."},"data":{"$ref":"#/components/schemas/DocCollabActAnswer"}},"required":["success","data"]}}}},"400":{"description":"Refused: `NOTHING_TO_REMIND`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Refused: `FLOW_PAUSED`, `NOT_YOUR_TURN`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/{id}/steps/{stepExecId}/doc-collab/parts/{partId}/comments":{"get":{"x-moxo-person-only":"PERSON_TOKEN_REQUIRED","tags":["Flows"],"summary":"List the comments on a part","description":"Returns the comments on one part of a document written in Moxo, as the app shows them to the person the token belongs to: a part they can't read is `404`, and a comment kept to another side is left out. Needs a personal access token (`403 PERSON_TOKEN_REQUIRED` for an organization API key).\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"The flow's id."},"required":true,"description":"The flow's id.","name":"id","in":"path"},{"schema":{"type":"string","description":"The document collaboration step's run: `steps[].id` from `GET /v1/flows/{id}`. It doesn't take a template step id."},"required":true,"description":"The document collaboration step's run: `steps[].id` from `GET /v1/flows/{id}`. It doesn't take a template step id.","name":"stepExecId","in":"path"},{"schema":{"type":"string","description":"The part's `partId`, from the page's `documents[].parts[]`."},"required":true,"description":"The part's `partId`, from the page's `documents[].parts[]`.","name":"partId","in":"path"}],"responses":{"200":{"description":"The part's comments you may read.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."},"data":{"type":"object","properties":{"partId":{"type":"string","description":"The part."},"comments":{"type":"array","items":{"$ref":"#/components/schemas/DocCollabPartComment"},"description":"Its comments, oldest first."}},"required":["partId","comments"],"additionalProperties":false,"description":"The part's comments you may read."}},"required":["success","data"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"x-moxo-person-only":"ASSIGNEE_REQUIRED","tags":["Flows"],"summary":"Comment on a part","description":"Adds a comment to a part of a document written in Moxo, on a passage (`textAnchor`) or the whole part, or a reply (`parentId`). It is shared with everyone who reads the part, or kept to your side (`audience: \"side\"`). People it names (`mentionedUserIds`, public ids) who can't read the part are dropped. You act as the person the token belongs to, with what they may do in the app: a side's acts need a seat on that side (`403 NOT_ON_A_SIDE`) and, where it matters, their turn (`409 NOT_YOUR_TURN`); a read-only viewer acts on nothing (`403 READ_ONLY`); a step you can't see is `404`. A paused flow returns `409 FLOW_PAUSED`. Needs a personal access token: an organization API key has no person, side or turn to act as (`403 ASSIGNEE_REQUIRED`).\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"The flow's id."},"required":true,"description":"The flow's id.","name":"id","in":"path"},{"schema":{"type":"string","description":"The document collaboration step's run: `steps[].id` from `GET /v1/flows/{id}`. It doesn't take a template step id."},"required":true,"description":"The document collaboration step's run: `steps[].id` from `GET /v1/flows/{id}`. It doesn't take a template step id.","name":"stepExecId","in":"path"},{"schema":{"type":"string","description":"The part's `partId`, from the page's `documents[].parts[]`."},"required":true,"description":"The part's `partId`, from the page's `documents[].parts[]`.","name":"partId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"type":"string","enum":["text","document"],"default":"document","description":"`text`: on a passage (`textAnchor`). `document`: on the whole part (the default)."},"body":{"type":"string","minLength":1,"maxLength":4000,"description":"What the comment says."},"parentId":{"type":["string","null"],"minLength":1,"description":"To reply: the comment you reply to. A reply takes no `textAnchor`."},"textAnchor":{"type":"object","properties":{"quote":{"type":"string","minLength":1,"maxLength":1000,"description":"The passage's words."},"prefix":{"type":"string","maxLength":200,"description":"The words just before it."},"suffix":{"type":"string","maxLength":200,"description":"The words just after it."},"from":{"type":"string","minLength":1,"maxLength":1024,"description":"Where the passage starts in a document written in Moxo, as the editor marks it."},"to":{"type":"string","minLength":1,"maxLength":1024,"description":"Where it ends."},"ooxml":{"type":"object","properties":{"paragraph":{"type":"string","minLength":1,"maxLength":200,"description":"The Word paragraph it is in."},"start":{"type":"integer","minimum":0,"maximum":10000000,"description":"Where the passage starts in the paragraph's shown text."},"end":{"type":"integer","minimum":1,"maximum":10000000,"description":"Where it ends."}},"required":["paragraph","start","end"],"additionalProperties":false,"description":"On a Word document: the paragraph and where the passage is in it."},"pdf":{"type":"object","properties":{"page":{"type":"integer","minimum":1,"maximum":100000,"description":"The page it is on, from 1."},"quads":{"type":"array","items":{"type":"object","properties":{"x":{"type":"number","minimum":0,"maximum":100,"description":"Its left edge, in percent of the page's width."},"y":{"type":"number","minimum":0,"maximum":100,"description":"Its top edge, in percent of the page's height."},"w":{"type":"number","minimum":0,"maximum":100,"description":"Its width, in percent of the page's width."},"h":{"type":"number","minimum":0,"maximum":100,"description":"Its height, in percent of the page's height."}},"required":["x","y","w","h"],"additionalProperties":false},"minItems":1,"maxItems":500,"description":"The boxes around its words."}},"required":["page","quads"],"additionalProperties":false,"description":"On a PDF: the page and the boxes around the passage."}},"required":["quote","prefix","suffix"],"additionalProperties":false,"description":"For a comment on a passage: its words (`quote`) and the words around them (`prefix`, `suffix`)."},"audience":{"type":"string","enum":["shared","side"],"description":"`shared`: everyone who reads the part. `side`: only your side. A reply takes its thread's, and a comment on your side's draft is your side's."},"mentionedUserIds":{"type":"array","items":{"type":"string","minLength":1},"maxItems":20,"description":"People the comment names, by public id (`usr_…`). Anyone who can't read the part is dropped."}},"required":["body"],"additionalProperties":false}}}},"responses":{"201":{"description":"The comment.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."},"data":{"type":"object","properties":{"comment":{"$ref":"#/components/schemas/DocCollabPartComment"}},"required":["comment"],"additionalProperties":false,"description":"The comment."}},"required":["success","data"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Refused: `FLOW_PAUSED`, `NOT_YOUR_TURN`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/{id}/steps/{stepExecId}/doc-collab/parts/{partId}/comments/{commentId}/resolve":{"post":{"x-moxo-person-only":"ASSIGNEE_REQUIRED","tags":["Flows"],"summary":"Resolve a comment thread","description":"Resolves a comment thread (`resolved: true`), or opens it again (`false`). You act as the person the token belongs to, with what they may do in the app: a side's acts need a seat on that side (`403 NOT_ON_A_SIDE`) and, where it matters, their turn (`409 NOT_YOUR_TURN`); a read-only viewer acts on nothing (`403 READ_ONLY`); a step you can't see is `404`. A paused flow returns `409 FLOW_PAUSED`. Needs a personal access token: an organization API key has no person, side or turn to act as (`403 ASSIGNEE_REQUIRED`).\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"The flow's id."},"required":true,"description":"The flow's id.","name":"id","in":"path"},{"schema":{"type":"string","description":"The document collaboration step's run: `steps[].id` from `GET /v1/flows/{id}`. It doesn't take a template step id."},"required":true,"description":"The document collaboration step's run: `steps[].id` from `GET /v1/flows/{id}`. It doesn't take a template step id.","name":"stepExecId","in":"path"},{"schema":{"type":"string","description":"The part's `partId`, from the page's `documents[].parts[]`."},"required":true,"description":"The part's `partId`, from the page's `documents[].parts[]`.","name":"partId","in":"path"},{"schema":{"type":"string","description":"The comment's `id`, from `GET …/parts/{partId}/comments`."},"required":true,"description":"The comment's `id`, from `GET …/parts/{partId}/comments`.","name":"commentId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"resolved":{"type":"boolean","description":"`true` to resolve the thread, `false` to open it again."}},"required":["resolved"],"additionalProperties":false}}}},"responses":{"200":{"description":"The comment.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."},"data":{"type":"object","properties":{"comment":{"$ref":"#/components/schemas/DocCollabPartComment"}},"required":["comment"],"additionalProperties":false,"description":"The comment."}},"required":["success","data"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Refused: `FLOW_PAUSED`, `NOT_YOUR_TURN`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/{id}/steps/{stepExecId}/doc-collab/parts/{partId}/comments/{commentId}":{"delete":{"x-moxo-person-only":"ASSIGNEE_REQUIRED","tags":["Flows"],"summary":"Delete a comment","description":"Deletes a comment you wrote; the first comment of a thread takes its replies with it. Someone else's returns `403 NOT_AUTHOR`. You act as the person the token belongs to, with what they may do in the app: a side's acts need a seat on that side (`403 NOT_ON_A_SIDE`) and, where it matters, their turn (`409 NOT_YOUR_TURN`); a read-only viewer acts on nothing (`403 READ_ONLY`); a step you can't see is `404`. A paused flow returns `409 FLOW_PAUSED`. Needs a personal access token: an organization API key has no person, side or turn to act as (`403 ASSIGNEE_REQUIRED`).\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"The flow's id."},"required":true,"description":"The flow's id.","name":"id","in":"path"},{"schema":{"type":"string","description":"The document collaboration step's run: `steps[].id` from `GET /v1/flows/{id}`. It doesn't take a template step id."},"required":true,"description":"The document collaboration step's run: `steps[].id` from `GET /v1/flows/{id}`. It doesn't take a template step id.","name":"stepExecId","in":"path"},{"schema":{"type":"string","description":"The part's `partId`, from the page's `documents[].parts[]`."},"required":true,"description":"The part's `partId`, from the page's `documents[].parts[]`.","name":"partId","in":"path"},{"schema":{"type":"string","description":"The comment's `id`, from `GET …/parts/{partId}/comments`."},"required":true,"description":"The comment's `id`, from `GET …/parts/{partId}/comments`.","name":"commentId","in":"path"}],"responses":{"200":{"description":"The comment deleted.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."},"data":{"type":"object","properties":{"commentId":{"type":"string","description":"The comment deleted."}},"required":["commentId"],"additionalProperties":false,"description":"The comment deleted."}},"required":["success","data"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Refused: `FLOW_PAUSED`, `NOT_YOUR_TURN`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/{id}/steps/{stepExecId}/prepared-document":{"get":{"x-moxo-person-only":"PERSON_TOKEN_REQUIRED","tags":["Flows"],"summary":"Get a Prepare document action's document","description":"Returns the document a person is preparing on a running Prepare document action: the latest version, the earlier ones (newest first), whether someone has it open in Moxo's editor, what the signature check found, and the placeholders still to fill. Anyone who may see the step reads it: its assignees, the flow's managers and viewers. A step that is not a Prepare document action prepared by a person, or one you can't see, returns `404 NOT_FOUND`. Needs a personal access token: the document is read as a person sees it (`403 PERSON_TOKEN_REQUIRED` for an organization API key).\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"The flow's id."},"required":true,"description":"The flow's id.","name":"id","in":"path"},{"schema":{"type":"string","description":"The Prepare document step's run: `steps[].id` from `GET /v1/flows/{id}`. It doesn't take a template step id."},"required":true,"description":"The Prepare document step's run: `steps[].id` from `GET /v1/flows/{id}`. It doesn't take a template step id.","name":"stepExecId","in":"path"}],"responses":{"200":{"description":"The document and its versions, or `notStarted` before the action is the assignee's.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."},"data":{"$ref":"#/components/schemas/PreparedDocumentState"}},"required":["success","data"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/{id}/steps/{stepExecId}/prepared-document/versions/{versionId}/download":{"get":{"x-moxo-person-only":"PERSON_TOKEN_REQUIRED","tags":["Flows"],"summary":"Download a version of a document being prepared","description":"Returns a version's Word file (.docx) as an attachment. Downloading the latest version marks it as your copy: an upload of an older copy then asks first (`OLDER_COPY`). Anyone who may see the step reads it: its assignees, the flow's managers and viewers. A step that is not a Prepare document action prepared by a person, or one you can't see, returns `404 NOT_FOUND`. Needs a personal access token: the document is read as a person sees it (`403 PERSON_TOKEN_REQUIRED` for an organization API key).\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"The flow's id."},"required":true,"description":"The flow's id.","name":"id","in":"path"},{"schema":{"type":"string","description":"The Prepare document step's run: `steps[].id` from `GET /v1/flows/{id}`. It doesn't take a template step id."},"required":true,"description":"The Prepare document step's run: `steps[].id` from `GET /v1/flows/{id}`. It doesn't take a template step id.","name":"stepExecId","in":"path"},{"schema":{"type":"string","description":"The version's `id`, from `latest` or `earlier` in `GET …/prepared-document`."},"required":true,"description":"The version's `id`, from `latest` or `earlier` in `GET …/prepared-document`.","name":"versionId","in":"path"}],"responses":{"200":{"description":"The Word file.","content":{"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{"schema":{"type":"string","format":"binary"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/{id}/steps/{stepExecId}/prepared-document/versions":{"post":{"x-moxo-person-only":"ASSIGNEE_REQUIRED","tags":["Flows"],"summary":"Upload an edited copy of a document being prepared","description":"Uploads an edited Word copy as the document's latest version, as Upload your edited copy does on the action's card. Send `multipart/form-data` with the file in a field named `file`, or, after uploading it through `POST /v1/flows/{id}/steps/{stepExecId}/prepared-document/upload-init`, JSON naming its `fileId` (`404 FILE_NOT_FOUND` for an upload that isn't yours or isn't in this step, `425 SCAN_PENDING` while its virus check runs). A copy downloaded before newer changes answers `ok: false` with `OLDER_COPY` and keeps nothing; send it again with `confirmOlderCopy=true` to replace those changes. A file that is not a Word document answers `ok: false` with `NOT_WORD`. The same document as the latest version adds no version. Only the assignee whose turn it is changes the document (`403 NOT_YOUR_TURN`); while someone has it open in Moxo's editor it can't be changed (`409 LOCKED`). A step that is not a Prepare document action prepared by a person, or one you can't see, returns `404 NOT_FOUND`. Needs a personal access token: an organization API key has no person to act as (`403 ASSIGNEE_REQUIRED`). `FILE_TOO_LARGE` (413) above 25 MB. `FILE_INFECTED` (422) when the file fails its virus check. `SCAN_UNAVAILABLE` (503) when the check can't run.\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"The flow's id."},"required":true,"description":"The flow's id.","name":"id","in":"path"},{"schema":{"type":"string","description":"The Prepare document step's run: `steps[].id` from `GET /v1/flows/{id}`. It doesn't take a template step id."},"required":true,"description":"The Prepare document step's run: `steps[].id` from `GET /v1/flows/{id}`. It doesn't take a template step id.","name":"stepExecId","in":"path"}],"requestBody":{"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","format":"binary","description":"The edited Word document (.docx). Maximum 25 MB."},"confirmOlderCopy":{"type":"string","enum":["true","false"],"description":"`true` to keep a copy downloaded before newer changes, replacing them."}},"required":["file"]}},"application/json":{"schema":{"type":"object","properties":{"confirmOlderCopy":{"anyOf":[{"type":"string","enum":["true","false"]},{"type":"boolean"}],"description":"`true` to keep a copy downloaded before newer changes, replacing them."},"fileId":{"type":"string","format":"uuid","description":"With a JSON body: the file you uploaded, from `POST …/prepared-document/upload-init`. A multipart upload sends the file itself instead."}},"additionalProperties":false}}}},"responses":{"200":{"description":"What happened to the upload.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."},"data":{"$ref":"#/components/schemas/PreparedDocumentUploadResult"}},"required":["success","data"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Refused: `LOCKED`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"413":{"description":"The file is larger than 25 MB (`FILE_TOO_LARGE`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Refused: `FILE_INFECTED`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"425":{"description":"Refused: `SCAN_PENDING`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Temporarily unavailable. Retry after `Retry-After` seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/{id}/steps/{stepExecId}/prepared-document/versions/{versionId}/restore":{"post":{"x-moxo-person-only":"ASSIGNEE_REQUIRED","tags":["Flows"],"summary":"Restore an earlier version of a document being prepared","description":"Makes an earlier version the latest again, as a new `restored` version (nothing is deleted). Restoring the version that already is the latest changes nothing. Only the assignee whose turn it is changes the document (`403 NOT_YOUR_TURN`); while someone has it open in Moxo's editor it can't be changed (`409 LOCKED`). A step that is not a Prepare document action prepared by a person, or one you can't see, returns `404 NOT_FOUND`. Needs a personal access token: an organization API key has no person to act as (`403 ASSIGNEE_REQUIRED`).\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"The flow's id."},"required":true,"description":"The flow's id.","name":"id","in":"path"},{"schema":{"type":"string","description":"The Prepare document step's run: `steps[].id` from `GET /v1/flows/{id}`. It doesn't take a template step id."},"required":true,"description":"The Prepare document step's run: `steps[].id` from `GET /v1/flows/{id}`. It doesn't take a template step id.","name":"stepExecId","in":"path"},{"schema":{"type":"string","description":"The version's `id`, from `latest` or `earlier` in `GET …/prepared-document`."},"required":true,"description":"The version's `id`, from `latest` or `earlier` in `GET …/prepared-document`.","name":"versionId","in":"path"}],"responses":{"200":{"description":"The document after the restore.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."},"data":{"$ref":"#/components/schemas/PreparedDocument"}},"required":["success","data"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Refused: `LOCKED`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/{id}/steps/{stepExecId}/prepared-document/suggestions/{suggestionId}/accept":{"post":{"x-moxo-person-only":"ASSIGNEE_REQUIRED","tags":["Flows"],"summary":"Accept an AI suggestion on a document being prepared","description":"Makes the suggested change as a new latest version, as Accept does on the action's card. The change is your own edit: the Word file never says AI. Send an empty body. Answers `ok: false` with `EDITING` while the document is open in Moxo's editor, `STALE` when the text it applies to is gone, and `DECIDED` when it was already accepted or dismissed. `409 NOT_A_CHANGE` for a comment (dismiss it instead). `409 CANT_APPLY` when Moxo can't make the change there, such as inside the signature block. `409 SUBMITTING` while the document is being submitted. Only the assignee whose turn it is changes the document (`403 NOT_YOUR_TURN`); while someone has it open in Moxo's editor it can't be changed (`409 LOCKED`). A step that is not a Prepare document action prepared by a person, or one you can't see, returns `404 NOT_FOUND`. Needs a personal access token: an organization API key has no person to act as (`403 ASSIGNEE_REQUIRED`).\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"The flow's id."},"required":true,"description":"The flow's id.","name":"id","in":"path"},{"schema":{"type":"string","description":"The Prepare document step's run: `steps[].id` from `GET /v1/flows/{id}`. It doesn't take a template step id."},"required":true,"description":"The Prepare document step's run: `steps[].id` from `GET /v1/flows/{id}`. It doesn't take a template step id.","name":"stepExecId","in":"path"},{"schema":{"type":"string","description":"The suggestion's `id`, from `suggestions` in `GET …/prepared-document`."},"required":true,"description":"The suggestion's `id`, from `suggestions` in `GET …/prepared-document`.","name":"suggestionId","in":"path"}],"responses":{"200":{"description":"What happened to the suggestion.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."},"data":{"$ref":"#/components/schemas/PreparedDocumentAcceptSuggestionResult"}},"required":["success","data"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Refused: `CANT_APPLY`, `LOCKED`, `NOT_A_CHANGE`, `SUBMITTING`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/{id}/steps/{stepExecId}/prepared-document/suggestions/{suggestionId}/dismiss":{"post":{"x-moxo-person-only":"ASSIGNEE_REQUIRED","tags":["Flows"],"summary":"Dismiss an AI suggestion on a document being prepared","description":"Sets the suggestion aside without changing the document, as Dismiss does on the action's card. Send an empty body. Answers `ok: false` with `DECIDED` when it was already accepted or dismissed. Only the assignee whose turn it is decides it (`403 NOT_YOUR_TURN`). A step that is not a Prepare document action prepared by a person, a suggestion that isn't on it, or one you can't see, returns `404 NOT_FOUND`. Needs a personal access token: an organization API key has no person to act as (`403 ASSIGNEE_REQUIRED`).\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"The flow's id."},"required":true,"description":"The flow's id.","name":"id","in":"path"},{"schema":{"type":"string","description":"The Prepare document step's run: `steps[].id` from `GET /v1/flows/{id}`. It doesn't take a template step id."},"required":true,"description":"The Prepare document step's run: `steps[].id` from `GET /v1/flows/{id}`. It doesn't take a template step id.","name":"stepExecId","in":"path"},{"schema":{"type":"string","description":"The suggestion's `id`, from `suggestions` in `GET …/prepared-document`."},"required":true,"description":"The suggestion's `id`, from `suggestions` in `GET …/prepared-document`.","name":"suggestionId","in":"path"}],"responses":{"200":{"description":"What happened to the suggestion.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."},"data":{"$ref":"#/components/schemas/PreparedDocumentDismissSuggestionResult"}},"required":["success","data"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flows/{id}/steps/{stepExecId}/prepared-document/upload-init":{"post":{"x-moxo-person-only":"ASSIGNEE_REQUIRED","tags":["Flows"],"summary":"Get a link to upload an edited copy of a document being prepared","description":"Gets a link to upload an edited Word copy into this step: the first half of uploading it without sending the file in the call. `PUT` the file to the link, then send its `fileId` to `POST /v1/flows/{id}/steps/{stepExecId}/prepared-document/versions`. Only a Word document (.docx) is taken (`415 UNSUPPORTED_FILE_TYPE`). Only the assignee whose turn it is changes the document (`403 NOT_YOUR_TURN`); while someone has it open in Moxo's editor it can't be changed (`409 LOCKED`). A step that is not a Prepare document action prepared by a person, or one you can't see, returns `404 NOT_FOUND`. Needs a personal access token: an organization API key has no person to act as (`403 ASSIGNEE_REQUIRED`).\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"The flow's id."},"required":true,"description":"The flow's id.","name":"id","in":"path"},{"schema":{"type":"string","description":"The Prepare document step's run: `steps[].id` from `GET /v1/flows/{id}`. It doesn't take a template step id."},"required":true,"description":"The Prepare document step's run: `steps[].id` from `GET /v1/flows/{id}`. It doesn't take a template step id.","name":"stepExecId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"fileName":{"type":"string","minLength":1,"maxLength":500,"description":"The file's name, ending in `.docx`."},"fileSize":{"type":"integer","exclusiveMinimum":0,"maximum":26214400,"description":"The file's size in bytes (at most 25 MB)."},"mimeType":{"type":"string","minLength":1,"maxLength":255,"description":"The file's type: `application/vnd.openxmlformats-officedocument.wordprocessingml.document`."}},"required":["fileName","fileSize","mimeType"],"additionalProperties":false}}}},"responses":{"201":{"description":"The upload link. Name its `fileId` in `POST …/prepared-document/versions` after the upload.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."},"data":{"allOf":[{"$ref":"#/components/schemas/UploadEnvelope"},{"description":"The upload link: `PUT` the file to `uploadUrl` with `requiredHeaders`, then call `completionUrl` when it is given."}]}},"required":["success","data"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Refused: `LOCKED`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Refused: `UNSUPPORTED_FILE_TYPE`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/templates":{"get":{"tags":["Templates"],"summary":"List templates","description":"Returns the templates the caller can see. With a personal access token, the person needs permission to view templates or to start flows, as for the template list in the app; without either, the response is `403`. An organization API key needs the `templates:read` scope.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `templates:read`","security":[{"bearerAuth":["templates:read"]}],"parameters":[{"schema":{"type":"string","enum":["DRAFT","ACTIVE","ARCHIVED"]},"required":false,"name":"status","in":"query"},{"schema":{"type":"string"},"required":false,"name":"search","in":"query"},{"schema":{"type":"string","enum":["process","action"],"description":"Which kind of template to list. Defaults to `process`. Send `action` for saved requests. An `action` template is one saved request with its wording and the people it asks for, named by their place (for example Client). You choose who fills each place every time you send it. Send those with `POST /v1/actions`; `POST /v1/templates/{id}/start` accepts process templates only and returns `400 WRONG_TEMPLATE_KIND` for an action template. Every row has `kind`, so a list you filter yourself is never ambiguous.","example":"action"},"required":false,"description":"Which kind of template to list. Defaults to `process`. Send `action` for saved requests. An `action` template is one saved request with its wording and the people it asks for, named by their place (for example Client). You choose who fills each place every time you send it. Send those with `POST /v1/actions`; `POST /v1/templates/{id}/start` accepts process templates only and returns `400 WRONG_TEMPLATE_KIND` for an action template. Every row has `kind`, so a list you filter yourself is never ambiguous.","name":"kind","in":"query"},{"schema":{"type":"string","description":"Only templates that use this, as `<kind>:<id>`: `connection:<id>` (an app account, AI provider, Secret or MCP server from `GET /v1/connections`), `agent:<id>`, `data_table:<id>`, `template:<id>` (a template this one starts or includes; each says how in `startedByKind`: `sub_flow`, `start_flow`, `scheduled` or `building_block`), or `host:<name>` (an address that a REST API step, an outgoing webhook or a monitor that fires a webhook calls). Each row then adds `runningFlows`, the unfinished flows from that template whose steps use it; `uses`, those steps; and `canEdit`, whether you can change the template. A template whose current version no longer uses it is still listed, with an empty `uses`, while flows run an earlier version that does. Templates you can't open are left out, and flows you can't open are not counted. An organization API key sees what an admin sees. An id that names nothing you can see returns `404 NOT_FOUND`, naming the parameter; a malformed value returns `400`. With `updatedSince`, it narrows the list of changes to the templates that use it, on the same cursor.","example":"host:gateway.internal.example"},"required":false,"description":"Only templates that use this, as `<kind>:<id>`: `connection:<id>` (an app account, AI provider, Secret or MCP server from `GET /v1/connections`), `agent:<id>`, `data_table:<id>`, `template:<id>` (a template this one starts or includes; each says how in `startedByKind`: `sub_flow`, `start_flow`, `scheduled` or `building_block`), or `host:<name>` (an address that a REST API step, an outgoing webhook or a monitor that fires a webhook calls). Each row then adds `runningFlows`, the unfinished flows from that template whose steps use it; `uses`, those steps; and `canEdit`, whether you can change the template. A template whose current version no longer uses it is still listed, with an empty `uses`, while flows run an earlier version that does. Templates you can't open are left out, and flows you can't open are not counted. An organization API key sees what an admin sees. An id that names nothing you can see returns `404 NOT_FOUND`, naming the parameter; a malformed value returns `400`. With `updatedSince`, it narrows the list of changes to the templates that use it, on the same cursor.","name":"uses","in":"query"},{"schema":{"type":"string","format":"date-time","description":"Only templates published at or after this time; saving a draft is not a change. Rows come oldest publish first, each with its `lastChangedAt`. Page with `cursor`: send `pagination.nextCursor` back as it is, with the same filters, and keep the last one for your next run. Delivery is at least once: a template can repeat within 5 minutes of your previous run’s end. Rarely, a change is missed: one saved by a background process in Moxo that ran longer than 5 minutes, or by any save that ran longer than 15 minutes."},"required":false,"description":"Only templates published at or after this time; saving a draft is not a change. Rows come oldest publish first, each with its `lastChangedAt`. Page with `cursor`: send `pagination.nextCursor` back as it is, with the same filters, and keep the last one for your next run. Delivery is at least once: a template can repeat within 5 minutes of your previous run’s end. Rarely, a change is missed: one saved by a background process in Moxo that ran longer than 5 minutes, or by any save that ran longer than 15 minutes.","name":"updatedSince","in":"query"},{"schema":{"type":"string","description":"The `pagination.nextCursor` of the previous page, with the same filters: of an `updatedSince` list, or of a list paged with `limit`."},"required":false,"description":"The `pagination.nextCursor` of the previous page, with the same filters: of an `updatedSince` list, or of a list paged with `limit`.","name":"cursor","in":"query"},{"schema":{"type":"number","minimum":1,"maximum":100,"description":"Templates per page, 1 to 100; defaults to 50 on a paged list. Without `updatedSince`, sending `limit` or a `cursor` pages the list newest created first, and every template is reachable however many there are. Without either, the list is not paged and stops at 500 templates."},"required":false,"description":"Templates per page, 1 to 100; defaults to 50 on a paged list. Without `updatedSince`, sending `limit` or a `cursor` pages the list newest created first, and every template is reachable however many there are. Without either, the list is not paged and stops at 500 templates.","name":"limit","in":"query"}],"responses":{"200":{"description":"List of templates. With `updatedSince`, `limit` or `cursor`, the response adds `pagination: { limit, hasMore, nextCursor }`.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"array","items":{"$ref":"#/components/schemas/TemplateSummary"}},"pagination":{"type":"object","properties":{"limit":{"type":"number"},"hasMore":{"type":"boolean"},"nextCursor":{"type":["string","null"],"description":"Send it back as `cursor` for the next page. `null` on the last page of a list paged with `limit`. An `updatedSince` list always has one: keep it for your next run."}},"required":["limit","hasMore","nextCursor"]}},"required":["success","data"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"tags":["Build templates"],"summary":"Create a template from changes","description":"Creates a draft template owned by you, applies the list of changes with the same checks as the template builder, then runs every publish check. All or nothing: if any change is refused, nothing is created and the response is `422` with every issue. A malformed change, such as an unknown change type or a missing or unknown field, returns `400 VALIDATION_FAILED` naming the field. The result says what changed, the id given to each `handle`, any fix made for you, each issue with where it is and how to fix it, what only a person can do, links to open the template, and an outline. Send `fromExample` to start from a gallery example. Send an `Idempotency-Key` to make a retry safe.\n\n**Who can call it.** A personal access token (`mxo_pat_...`) or a signed-in session builds as its person, with that person's permissions, and every change and publish is recorded as theirs. A template has owners, so building, changing and publishing one is a person's act: an organization API key gets `403 PERSON_TOKEN_REQUIRED` on every call that changes a template, and so does a partner delegation key. A key may still read templates and their files, check a change list, and read a document's fields. Building from code works on flow templates: a call on an action template answers `400 WRONG_TEMPLATE_KIND`.\n\n**Products.** A new template needs the product it belongs to: a process template needs the Flow product and an action template needs the Actions product. Without it, the response is `403 FEATURE_DISABLED` with `error.feature` `\"haiFlow\"` or `\"haiActions\"`.\n\n**Tokens:** personal access token","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":256,"pattern":"^[A-Za-z0-9_\\-:.]+$","description":"An optional key that makes this request safe to retry. Send a new UUID for each request. A key is up to 256 letters, digits, `-`, `_`, `:` or `.`; any other key is refused with `400 INVALID_IDEMPOTENCY_KEY` and nothing runs. A retry with the same key within 10 minutes returns the first response and changes nothing again. After 10 minutes, the same key runs the request again, so use a new key for a late retry. See Idempotency in the Introduction.","example":"6f2c4a5e-3b8d-4c7f-9a1e-2d6b8e0f4c5a"},"required":false,"description":"An optional key that makes this request safe to retry. Send a new UUID for each request. A key is up to 256 letters, digits, `-`, `_`, `:` or `.`; any other key is refused with `400 INVALID_IDEMPOTENCY_KEY` and nothing runs. A retry with the same key within 10 minutes returns the first response and changes nothing again. After 10 minutes, the same key runs the request again, so use a new key for a late retry. See Idempotency in the Introduction.","name":"Idempotency-Key","in":"header"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"changeSchemaVersion":{"type":"number","enum":[1],"description":"The change format version. Only `1` is supported, and it is the default."},"name":{"type":"string","minLength":1,"maxLength":200,"description":"The template's name. Needed unless you send `file`, whose `name` it takes."},"file":{"type":"string","minLength":1,"maxLength":1572864,"description":"A template file (the text `GET /v1/templates/{id}/file` returns) to make the template from, in one call. Send it without `name`, `changes` and `fromExample`. Nothing is made when the file or one of its changes is refused."},"description":{"type":"string","maxLength":2000},"changes":{"type":"array","items":{"$ref":"#/components/schemas/Change"},"maxItems":200,"default":[],"description":"The changes, applied in order and saved all together, or not at all. Text in a change can read an earlier value with `${{ }}`, such as `${{ steps.intake.fields.email }}` or `${{ fields.contract_name }}`: a step, role or field by its id, a handle from this list, or its template file key. A reference written the older way (`{Intake / Email}`) is refused."},"fromExample":{"type":"string","minLength":1,"maxLength":200,"description":"An example id (the MCP tool `get_build_context` view `examples` returns them) to start the draft from. Changes in the same call may refer to new things by handle; read the outline of the new draft to change what the example brought."},"detail":{"type":"string","enum":["full","concise"],"description":"`full` (the default): `outline` is the whole template. `concise`: `outline` lists only the steps this call added or changed, with where they sit; read the whole outline with `GET /v1/templates/{id}/outline`."}},"additionalProperties":false}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/TemplateAuthoringResult"}},"required":["success","data"]}}}},"400":{"description":"Refused: `VALIDATION_FAILED`, `WRONG_TEMPLATE_KIND`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"A change was refused and nothing was saved. `data` is the result, with every issue.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string","enum":["CHANGES_REFUSED"]},"message":{"type":"string"}},"required":["code","message"]},"data":{"$ref":"#/components/schemas/TemplateAuthoringResult"}},"required":["success","error","data"]}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-moxo-person-only":"PERSON_TOKEN_REQUIRED","security":[{"bearerAuth":[]}]}},"/v1/templates/{id}":{"get":{"tags":["Templates"],"summary":"Get a template","description":"Returns the full template: its steps, roles, milestones and flow fields.\n\n**Steps inside other steps.** `steps[]` is the top level. A step that contains others keeps them in its own `config`, each a full step, at any depth: `SINGLE_CHOICE_BRANCH`, `MULTI_CHOICE_BRANCH` and `PARALLEL_BRANCH` in `config.paths[].steps`; `DECISION` in `config.outcomes[].steps`; `APPROVAL` in `config.approveBranch.steps` and `config.rejectBranch.steps`; `FOR_EACH` and `REPEAT_WHILE` in `config.steps`. To visit every step in the order the builder shows them:\n\n```js\nfunction* walk(steps) {\n  for (const s of steps) {\n    yield s;\n    const c = s.config ?? {};\n    for (const lane of [...(c.paths ?? []), ...(c.outcomes ?? [])]) yield* walk(lane.steps ?? []);\n    for (const b of [c.approveBranch, c.rejectBranch]) if (b) yield* walk(b.steps ?? []);\n    if (s.type === 'FOR_EACH' || s.type === 'REPEAT_WHILE') yield* walk(c.steps ?? []);\n  }\n}\n```\n\nWhat each step's `config` keys mean is in its `StepConfig_<TYPE>` component, or `get_build_context` view `action_types` on the MCP server.\n\n**Where the settings are.** Each step's settings are in `steps[].config`, at every depth. A step with nothing beyond its name, assignees and completion has an empty `config`. `definition` is deprecated: it repeats `customFields[]`, which you should read instead. To change a template, send a list of changes to `POST /v1/templates/{id}/changes`. Some settings are sent in a different form from the one `config` returns: see [Build templates from code](/docs/guides/build-templates-from-code).\n\n**Secrets.** A Secret's value is never returned. A step names the Secret it signs in with by id, and `GET /v1/connections` lists connections and Secrets by name and id. A credential typed into a step instead of a Secret is removed from every response. That includes a key in an address: the sign-in part of a URL, a query parameter named like a credential (such as `api_key`, `token`, `code` or `sig`), or a query value shaped like a known key. An address that is itself the secret, such as a Slack, Teams, Discord or Zapier webhook or an address with a key in its path, reads `null`. The step names the setting in `typedInCredentials`. For a short, readable summary of a template, use `GET /v1/templates/{id}/outline`.\n\n**What a template uses.** Send `expand=dependencies` to add `dependencies[]` instead of walking the steps yourself. This is not `dependsOnStepIds`, which lets a step start sooner.\n\n**Which copy.** The read answers the published copy, what a start uses (`copy: \"published\"`). Someone who may change the template sends `copy=working` for the working copy, the one `POST /v1/templates/{id}/changes` changes, with its `draftRevision` to send as `baseVersion`: any part of it sent back unchanged changes nothing. Only a working read carries `draftRevision`, so a change is always made on the working copy. Anyone else asking for it answers `403 WORKING_COPY_NOT_ALLOWED`. A template never published has only its working copy, which the read answers.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `templates:read`","security":[{"bearerAuth":["templates:read"]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","description":"`dependencies` adds `dependencies[]`: every connection (an app account, AI provider, Secret or MCP server), AI agent, data table, sub-template and outside address the template uses, each with the steps that use it in `actions[]`. An AI agent lists the connections its tools use in `uses[]`. Connections and Secrets come by name and id, never a credential, and with a name only when you can see it in the app. An address built from an answer in the flow has `host: null` and `dynamic: true`. Any other value returns `400`.","example":"dependencies"},"required":false,"description":"`dependencies` adds `dependencies[]`: every connection (an app account, AI provider, Secret or MCP server), AI agent, data table, sub-template and outside address the template uses, each with the steps that use it in `actions[]`. An AI agent lists the connections its tools use in `uses[]`. Connections and Secrets come by name and id, never a credential, and with a name only when you can see it in the app. An address built from an answer in the flow has `host: null` and `dynamic: true`. Any other value returns `400`.","name":"expand","in":"query"},{"schema":{"type":"string","enum":["published","working"],"description":"`published` (the default): the published copy, what a start uses. `working`: the working copy, the one the change list changes, with its unpublished changes and its `draftRevision`. For someone who may change the template; anyone else answers `403 WORKING_COPY_NOT_ALLOWED`.","example":"working"},"required":false,"description":"`published` (the default): the published copy, what a start uses. `working`: the working copy, the one the change list changes, with its unpublished changes and its `draftRevision`. For someone who may change the template; anyone else answers `403 WORKING_COPY_NOT_ALLOWED`.","name":"copy","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/TemplateDetail"}},"required":["success","data"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"tags":["Templates"],"summary":"Update template info","description":"Updates a template's name and description. To change its steps, roles or milestones, use Build templates: `POST /v1/templates/{id}/changes`. Sending the name and description it already has changes nothing: the answer says `changed: false`. While someone else is editing the template in Moxo, the call answers `409 TEMPLATE_BEING_EDITED` and changes nothing: `error.editingBy` names them, and editing frees up after 5 minutes without activity. The editor's own token is never refused for this.\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":500,"example":"Acme onboarding"},"description":{"type":"string","example":"Standard client onboarding for enterprise customers."}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."},"data":{"allOf":[{"$ref":"#/components/schemas/TemplateDetail"},{"description":"The template, as it is now."}]},"changed":{"type":"boolean","description":"`true` when this call changed what you asked it to. `false` when that was already so, and the call changed nothing of it."},"message":{"type":"string","description":"Only with `changed: false`: what was already so.","example":"Nothing changed: this person already holds this role."}},"required":["success","data","changed"],"additionalProperties":false}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Refused: `TEMPLATE_BEING_EDITED`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-moxo-person-only":"PERSON_TOKEN_REQUIRED"},"delete":{"x-moxo-person-only":"ORG_KEY_NOT_SUPPORTED","tags":["Templates"],"summary":"Delete a template","description":"Deletes the template. It disappears from every list and read (`GET /v1/templates/{id}` returns 404), it can't be restored through the API, and no new flow can start from it. This is not archiving: an archived template can be brought back, a deleted one can't.\n\nFlows already running from it keep running to the end. Its schedules, its incoming webhook, its start link and its place in portal catalogs are removed; its version history is kept.\n\n**Two calls when work depends on it.** If the template still has running flows, active schedules or data table triggers, the first call deletes nothing and returns `requiresConfirmation: true` with the counts. Repeat it with `?force=true` to delete. Without such work, the first call deletes and returns `{ \"deleted\": true }`.\n\nOnly an organization admin or one of the template's owners can delete it (403 otherwise). Needs a personal access token: an organization API key gets 403 `ORG_KEY_NOT_SUPPORTED`, because the audit trail records the person who deleted it.\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","enum":["1","true"],"description":"Deletes the template even when flows are running, or when schedules or data table triggers would stop.","example":"true"},"required":false,"description":"Deletes the template even when flows are running, or when schedules or data table triggers would stop.","name":"force","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/DeleteTemplateResult"}},"required":["success","data"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/connections":{"get":{"tags":["Connections"],"summary":"List connections","description":"Returns the organization's connected app accounts, AI providers, Secrets and MCP servers, by name and id, never a credential. Use an `id` with `GET /v1/templates?uses=connection:<id>`.\n\nAn organization API key lists every connection, as an admin sees them. A personal access token lists what its person sees in **Connected Apps**: the organization's connections plus their own personal accounts. Secrets and AI providers are listed for an organization API key, or for a person with the **Manage credentials** permission.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `templates:read`","security":[{"bearerAuth":["templates:read"]}],"parameters":[{"schema":{"type":"string","enum":["app","ai","secret","mcp"],"description":"Only connections of this type."},"required":false,"description":"Only connections of this type.","name":"type","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"array","items":{"$ref":"#/components/schemas/ConnectionSummary"}}},"required":["success","data"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/templates/{id}/archive":{"post":{"tags":["Templates"],"summary":"Archive a template","description":"Archives the template: it leaves the template lists (`GET /v1/templates?status=ARCHIVED` lists it), no new flow can start from it, and it leaves every portal catalog. Flows already running keep running. A template already archived returns `409 CONFLICT`. Bring it back with `POST /v1/templates/{id}/unarchive`. No body. Returns the template.\n\nOnly an organization admin or one of the template's owners can archive it (403 otherwise). Needs a personal access token.\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success response."},"data":{"allOf":[{"$ref":"#/components/schemas/TemplateDetail"},{"description":"The template, as it is now."}]}},"required":["success","data"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Refused: `CONFLICT`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-moxo-person-only":"PERSON_TOKEN_REQUIRED"}},"/v1/templates/{id}/unarchive":{"post":{"tags":["Templates"],"summary":"Unarchive a template","description":"Brings an archived template back to the template lists, as a draft (`status: \"DRAFT\"`): publish it (`POST /v1/templates/{id}/publish`) before flows can start from it again. Add it to a portal catalog again in the app. No body. Returns the template.\n\nOnly an organization admin or one of the template's owners can unarchive it (403 otherwise). Needs a personal access token.\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success response."},"data":{"allOf":[{"$ref":"#/components/schemas/TemplateDetail"},{"description":"The template, as it is now."}]}},"required":["success","data"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-moxo-person-only":"PERSON_TOKEN_REQUIRED"}},"/v1/template-folders":{"get":{"tags":["Templates"],"summary":"List template folders","description":"Returns the folders of your organization's template library, by name. Folders can hold folders, up to 5 levels deep: `parentFolderId` names the folder each one is in (null at the top level). `templateCount` counts the flow templates you can see directly in a folder; `totalTemplateCount` counts those anywhere under it. Put a template in one with `PUT /v1/templates/{id}/folder`; every template read names its `folder`. Make a folder with `POST /v1/template-folders`, and rename, move or remove one with `PATCH` or `DELETE /v1/template-folders/{id}`.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `templates:read`","security":[{"bearerAuth":["templates:read"]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a 200 response."},"data":{"type":"array","items":{"$ref":"#/components/schemas/TemplateFolder"},"description":"The folders, by name."}},"required":["success","data"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"x-moxo-person-only":"PERSON_TOKEN_REQUIRED","tags":["Templates"],"summary":"Make a template folder","description":"Makes a folder in your organization's template library, as **New folder** does in Moxo: at the top level, or inside `parentFolderId`. Folders go 5 levels deep: a folder at level 5 can't hold a folder (`409 FOLDER_TOO_DEEP`), and a parent your organization doesn't have answers `404 FOLDER_NOT_FOUND`. Put templates in it with `PUT /v1/templates/{id}/folder`. Two folders may have the same name; to put a template in one of them, send its `folderId`.\n\nRuns as the person who owns the token, with their permissions in Moxo, and is recorded as theirs. An organization API key gets `403 PERSON_TOKEN_REQUIRED`. The person needs permission to create templates (`403` otherwise).\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateFolderCreateBody"}}}},"responses":{"201":{"description":"The folder, with no templates in it yet.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success response."},"data":{"allOf":[{"$ref":"#/components/schemas/TemplateFolder"},{"description":"The folder."}]}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Refused: `FOLDER_TOO_DEEP`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/template-folders/{id}":{"patch":{"x-moxo-person-only":"PERSON_TOKEN_REQUIRED","tags":["Templates"],"summary":"Rename a template folder","description":"Renames a folder in your organization's template library, moves it with everything in it (`parentFolderId`), or both in one change. Leave `parentFolderId` out to keep the folder where it is; send null to move it to the top level. A move into the folder itself or one of its own folders answers `409 FOLDER_CYCLE`; one that would put a folder past level 5 answers `409 FOLDER_TOO_DEEP`; a target your organization doesn't have answers `404 FOLDER_NOT_FOUND`. Nothing changes when a part is refused. A folder your organization doesn't have answers `404`.\n\nRuns as the person who owns the token, with their permissions in Moxo, and is recorded as theirs. An organization API key gets `403 PERSON_TOKEN_REQUIRED`. The person needs permission to edit templates (`403` otherwise).\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"The folder's id, as `GET /v1/template-folders` lists it."},"required":true,"description":"The folder's id, as `GET /v1/template-folders` lists it.","name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateFolderChangeBody"}}}},"responses":{"200":{"description":"The folder, as `GET /v1/template-folders` lists it.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success response."},"data":{"allOf":[{"$ref":"#/components/schemas/TemplateFolder"},{"description":"The folder."}]}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Refused: `FOLDER_CYCLE`, `FOLDER_TOO_DEEP`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"x-moxo-person-only":"PERSON_TOKEN_REQUIRED","tags":["Templates"],"summary":"Remove a template folder","description":"Removes a folder from your organization's template library. Nothing in it is deleted: its templates and its folders move up to the folder it was in (the top level, for a top-level folder). A folder your organization doesn't have answers `404`.\n\nRuns as the person who owns the token, with their permissions in Moxo, and is recorded as theirs. An organization API key gets `403 PERSON_TOKEN_REQUIRED`. The person needs permission to edit templates (`403` otherwise).\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"The folder's id, as `GET /v1/template-folders` lists it."},"required":true,"description":"The folder's id, as `GET /v1/template-folders` lists it.","name":"id","in":"path"}],"responses":{"200":{"description":"The folder is gone.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success response."},"data":{"type":"object","properties":{"id":{"type":"string","description":"The folder that was removed."},"deleted":{"type":"boolean","enum":[true],"description":"Always `true`: the folder is gone."}},"required":["id","deleted"],"additionalProperties":false,"description":"What was removed."}},"required":["success","data"],"additionalProperties":false}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/templates/{id}/publish":{"post":{"tags":["Templates"],"summary":"Publish a template","description":"Publishes the draft. When the draft has changes the live version lacks, they become a new version and new flows start from it; flows already running keep the version they started on. Only published templates can have flows started from them. While someone else is editing the template in Moxo, the call answers `409 TEMPLATE_BEING_EDITED` and changes nothing: `error.editingBy` names them, and editing frees up after 5 minutes without activity. The editor's own token is never refused for this.\n\nSend `changeNote` to say what this version changes: it is stored on the version and shown wherever the version is read. It is optional.\n\nReturns the template, as `GET /v1/templates/{id}` returns it, with `published`: `true` when a new version was made. When the draft has nothing new, nothing is written and no version is made: `published` is `false` and `message` says so. A real publish moves the draft revision on by one, so read `draftRevision` again (from the outline or a check) before your next change. `warnings` lists what publishes but may not do what you expect, such as an escalation while escalation is off for your organization.\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublishTemplateRequest"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"allOf":[{"$ref":"#/components/schemas/TemplateDetail"},{"description":"The template, as it is now live."}]},"published":{"type":"boolean","description":"`true` when this call made a new version; `false` when the draft had nothing new, so nothing was written."},"message":{"type":"string","description":"Only when `published` is `false`: says that nothing new was published.","example":"Nothing new to publish: the draft is the same as the live version, so no version was made."},"warnings":{"type":"array","items":{"$ref":"#/components/schemas/PublishWarning"},"description":"What publishes but may not do what you expect. Left out when there is none."}},"required":["success","data","published"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Refused: `TEMPLATE_BEING_EDITED`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-moxo-person-only":"PERSON_TOKEN_REQUIRED"}},"/v1/templates/{id}/duplicate":{"post":{"tags":["Templates"],"summary":"Duplicate a template","description":"Copies a template into a new draft, owned by the calling person. The copy takes the template's current content, including unpublished changes, with new ids for its steps, roles, milestones, paths and outcomes; its fields keep theirs, so a reference to a field reads the same in the copy. Send `name` to name the copy; without it, the copy is called \"<original name> (Copy)\". The body is optional and takes no other key (400 otherwise).\n\nReturns **201** with the new template in the same shape as `GET /v1/templates/{id}`. A personal access token needs its person to be able to see the template (404 otherwise). An organization API key gets 403 `PERSON_TOKEN_REQUIRED`: a copy has an owner, and a key has no person behind it.\n\nEach call makes a new copy, so send an `Idempotency-Key`: a retry within 10 minutes returns the first copy instead of making another.\n\n**Products.** A new template needs the product it belongs to: a process template needs the Flow product and an action template needs the Actions product. Without it, the response is `403 FEATURE_DISABLED` with `error.feature` `\"haiFlow\"` or `\"haiActions\"`.\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":256,"pattern":"^[A-Za-z0-9_\\-:.]+$","description":"An optional key that makes this request safe to retry. Send a new UUID for each request. A key is up to 256 letters, digits, `-`, `_`, `:` or `.`; any other key is refused with `400 INVALID_IDEMPOTENCY_KEY` and nothing runs. A retry with the same key within 10 minutes returns the first response and changes nothing again. After 10 minutes, the same key runs the request again, so use a new key for a late retry. See Idempotency in the Introduction.","example":"6f2c4a5e-3b8d-4c7f-9a1e-2d6b8e0f4c5a"},"required":false,"description":"An optional key that makes this request safe to retry. Send a new UUID for each request. A key is up to 256 letters, digits, `-`, `_`, `:` or `.`; any other key is refused with `400 INVALID_IDEMPOTENCY_KEY` and nothing runs. A retry with the same key within 10 minutes returns the first response and changes nothing again. After 10 minutes, the same key runs the request again, so use a new key for a late retry. See Idempotency in the Introduction.","name":"Idempotency-Key","in":"header"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DuplicateTemplateRequest"}}}},"responses":{"201":{"description":"Template duplicated. `data` is the new draft.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/TemplateDetail"}},"required":["success","data"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-moxo-person-only":"PERSON_TOKEN_REQUIRED"}},"/v1/templates/{id}/versions":{"get":{"tags":["Templates"],"summary":"List template versions","description":"Returns the template's published versions, newest first. The live version has `isCurrent: true` and is always listed; any other version is kept once a flow starts on it. Read one version's content with `GET /v1/templates/{id}/versions/{versionId}`.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `templates:read`","security":[{"bearerAuth":["templates:read"]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Version history","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"array","items":{"$ref":"#/components/schemas/TemplateVersion"}}},"required":["success","data"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/templates/{id}/versions/{versionId}":{"get":{"tags":["Templates"],"summary":"Get one template version","description":"Returns one published version with its steps, roles and fields, for example to compare before a restore.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `templates:read`","security":[{"bearerAuth":["templates:read"]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":true,"name":"versionId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/TemplateVersionDetail"}},"required":["success","data"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/templates/{id}/kept-drafts":{"get":{"tags":["Templates"],"summary":"List kept drafts","description":"Returns the drafts restores replaced on this template, newest first (at most 20), so a restore can be undone: restore one by its `id`. A kept draft is a draft, so only a person who can edit the template sees any; anyone else gets an empty list.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `templates:read`","security":[{"bearerAuth":["templates:read"]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success response."},"data":{"type":"array","items":{"$ref":"#/components/schemas/TemplateKeptDraft"},"description":"The kept drafts, newest first."}},"required":["success","data"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/templates/{id}/versions/{versionId}/compare":{"get":{"tags":["Templates"],"summary":"Compare a template version","description":"Returns what restoring this version would change, one line per change: steps and roles only in one side, each changed step's settings, form fields, options and document fields, from the draft to the version. A person who can edit the template compares with their draft; an API key, or a person who can only view the template, compares with what is live. Send `against=live` to compare with what is live instead of your draft. `same` is true when a restore would change nothing.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `templates:read`","security":[{"bearerAuth":["templates:read"]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":true,"name":"versionId","in":"path"},{"schema":{"type":"string","enum":["draft","live"],"description":"`draft` (the default) compares the version with your draft; `live` compares it with the version that is live, for example to see how it differs from what running flows start on. Only a person who can edit the template reads the draft: anyone else always gets `live`."},"required":false,"description":"`draft` (the default) compares the version with your draft; `live` compares it with the version that is live, for example to see how it differs from what running flows start on. Only a person who can edit the template reads the draft: anyone else always gets `live`.","name":"against","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success response."},"data":{"allOf":[{"$ref":"#/components/schemas/TemplateVersionChanges"},{"description":"What restoring the version would change."}]}},"required":["success","data"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/templates/{id}/versions/{versionId}/restore":{"post":{"x-moxo-person-only":"ORG_KEY_NOT_SUPPORTED","tags":["Templates"],"summary":"Restore a previous version","description":"Replaces the current draft with a previously published version. The version is not live until the template is published again. Needs a personal access token: the restore is recorded as the person's, and an organization API key gets 403 `ORG_KEY_NOT_SUPPORTED`. Send `baseDefinitionVersion` (the draft revision you read) to have the restore refused with 409 `TEMPLATE_VERSION_CONFLICT` if someone changed the draft since: nothing is changed, and `currentVersion` is the draft revision to read again. Without it, the restore replaces the draft as it is now. Restoring the version the draft already is changes nothing: the answer says `changed: false`. A version listed with `restorable: false` returns 404. While someone else is editing the template in Moxo, the call answers `409 TEMPLATE_BEING_EDITED` and changes nothing: `error.editingBy` names them, and editing frees up after 5 minutes without activity. The editor's own token is never refused for this.\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":true,"name":"versionId","in":"path"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"baseDefinitionVersion":{"type":"integer","minimum":0,"description":"The draft revision you read. A restore onto a draft that changed since returns `409 TEMPLATE_VERSION_CONFLICT`."}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."},"data":{"allOf":[{"$ref":"#/components/schemas/TemplateDetail"},{"description":"The template, with its draft as it is now."}]},"changed":{"type":"boolean","description":"`true` when this call changed what you asked it to. `false` when that was already so, and the call changed nothing of it."},"message":{"type":"string","description":"Only with `changed: false`: what was already so.","example":"Nothing changed: this person already holds this role."}},"required":["success","data","changed"],"additionalProperties":false}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Refused: `TEMPLATE_BEING_EDITED`, `TEMPLATE_VERSION_CONFLICT`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/templates/{id}/export":{"get":{"tags":["Templates"],"summary":"Export a template","description":"Downloads the template as an encrypted `.moxo` file, or as a `.moxo-bundle` with `?bundle=true`, which also includes the AI agents its steps use. The file moves a template into another Moxo organization, for example from a test organization to production: import it there with `POST /v1/templates/import-init` and `POST /v1/templates/import`. It is encrypted so that it can't be read or edited outside Moxo; to read a template's structure, use `GET /v1/templates/{id}`. Credentials and Secrets never leave the organization: connections are reconnected after import.\n\nTemplate export must be turned on for the organization (403 otherwise). A personal access token needs edit permission on the template; `bundle=true` also needs permission to manage AI agents.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `templates:read`","security":[{"bearerAuth":["templates:read"]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","enum":["true"],"description":"Includes the AI agents the template uses, as a `.moxo-bundle`."},"required":false,"description":"Includes the AI agents the template uses, as a `.moxo-bundle`.","name":"bundle","in":"query"}],"responses":{"200":{"description":"The encrypted file, as an attachment (`Content-Disposition: attachment; filename=\"<name>.moxo\"`).","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/templates/import-init":{"post":{"tags":["Templates"],"summary":"Start a template import","description":"The first of two calls that bring an exported template file (`.moxo`, or `.moxo-bundle` with its AI agents) into this organization, for example from a test organization into production.\n\n1. Call this with the file's name, size and type. 2. `PUT` the file's bytes to `uploadUrl` with exactly the `requiredHeaders` (and `POST` to `completionUrl` when one is returned). 3. Call `POST /v1/templates/import` with the `fileId`.\n\nWith a personal access token, the new draft is owned by its person, who needs permission to create templates (403 otherwise). An organization API key gets 403 `PERSON_TOKEN_REQUIRED`: the draft has an owner, and a key has no person behind it. Template import must be turned on for the organization (403 otherwise).\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateImportUploadRequest"}}}},"responses":{"201":{"description":"Upload the file to `uploadUrl`, then call `POST /v1/templates/import`.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/UploadEnvelope"}},"required":["success","data"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-moxo-person-only":"PERSON_TOKEN_REQUIRED"}},"/v1/templates/import":{"post":{"tags":["Templates"],"summary":"Import a template file","description":"Creates a new draft template from the uploaded file, owned by the calling person. Nothing is published or started. The file can be used once.\n\nCredentials never move between organizations, so `configWarnings` lists what to set up before publishing: connected apps and Secrets to reconnect, AI agents to choose, and email and app starts to set up. A webhook start gets a new URL and secret here. A `.moxo-bundle` also creates its AI agents as drafts (`agentIds`), which needs permission to manage AI agents and agent import turned on for the organization.\n\nA file that is not a Moxo template export, or is an agent file, returns 400. A file whose `stepStatuses` gives two statuses the same `id` returns `400 DUPLICATE_STEP_STATUS_ID`. The file can be imported once, so send an `Idempotency-Key`: a retry within 10 minutes returns the first result again instead of an error.\n\nWith a personal access token, the new draft is owned by its person, who needs permission to create templates (403 otherwise). An organization API key gets 403 `PERSON_TOKEN_REQUIRED`: the draft has an owner, and a key has no person behind it. Template import must be turned on for the organization (403 otherwise).\n\n**Products.** A new template needs the product it belongs to: a process template needs the Flow product and an action template needs the Actions product. Without it, the response is `403 FEATURE_DISABLED` with `error.feature` `\"haiFlow\"` or `\"haiActions\"`.\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":256,"pattern":"^[A-Za-z0-9_\\-:.]+$","description":"An optional key that makes this request safe to retry. Send a new UUID for each request. A key is up to 256 letters, digits, `-`, `_`, `:` or `.`; any other key is refused with `400 INVALID_IDEMPOTENCY_KEY` and nothing runs. A retry with the same key within 10 minutes returns the first response and changes nothing again. After 10 minutes, the same key runs the request again, so use a new key for a late retry. See Idempotency in the Introduction.","example":"6f2c4a5e-3b8d-4c7f-9a1e-2d6b8e0f4c5a"},"required":false,"description":"An optional key that makes this request safe to retry. Send a new UUID for each request. A key is up to 256 letters, digits, `-`, `_`, `:` or `.`; any other key is refused with `400 INVALID_IDEMPOTENCY_KEY` and nothing runs. A retry with the same key within 10 minutes returns the first response and changes nothing again. After 10 minutes, the same key runs the request again, so use a new key for a late retry. See Idempotency in the Introduction.","name":"Idempotency-Key","in":"header"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateImportRequest"}}}},"responses":{"201":{"description":"The new draft.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/TemplateImportResult"}},"required":["success","data"]}}}},"400":{"description":"Refused: `DUPLICATE_STEP_STATUS_ID`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-moxo-person-only":"PERSON_TOKEN_REQUIRED"}},"/v1/templates/{id}/webhook-config":{"get":{"tags":["Webhooks"],"summary":"Get a template's webhook settings","description":"Returns the template's incoming webhook settings: the URL, how callers authenticate, the secret's fingerprint, whether it is on, and an optional condition filter. It only reads: it creates nothing and changes nothing. A template whose webhook was never set up answers with `secretPresent: false` and `enabled: false`; the first change makes it (`PATCH …/webhook-config`, `regenerate`, `reveal`, saving a mapping or listening for a test event). A personal access token needs edit access to the template (403 otherwise). An organization API key reads a `none` webhook's URL without its token, because the token is the secret. The webhook is on when the template's Webhook start mode is on: call `PATCH /v1/templates/{id}/webhook-config` with `{ \"enabled\": true }` (or `PATCH /v1/templates/{id}/trigger-activation`); nothing is needed in the template builder. `secret` is always `null` here: the secret itself is returned only by `regenerate`, `reveal` or a change of `authMethod`.\n\nTo start flows from a webhook: (1) `PATCH …/webhook-config` with `{ \"enabled\": true }`; (2) `POST …/webhook-config/regenerate` and store the `secret`; (3) optionally, `PUT …/webhook-config/mapping` so the sender can post its own JSON; (4) the sender sends a `POST` to `webhookUrl`.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `templates:read`","security":[{"bearerAuth":["templates:read"]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/WebhookConfig"}},"required":["success","data"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"tags":["Webhooks"],"summary":"Update a template's webhook settings","description":"Three separate updates: send any of them, alone or together.\n\n`enabled` turns the webhook on or off by turning the template's Webhook start mode on or pausing it, the same switch as the **Start Modes** panel in the template builder. The change survives later saves of the template and is recorded in the audit trail. Turning it off is a pause: the URL, secret, authentication method and conditions are kept, and turning it on again restores them. Turning it on for a template that never had a webhook creates the webhook and turns it on in one call.\n\n`authMethod` changes how callers authenticate: `hmac`, `api_key` or `none`. Sending the method already in use changes nothing, and the secret keeps working; to make a new secret for the same method, use `POST /v1/templates/{id}/webhook-config/regenerate`. A different method creates a new secret, and the response includes it once. Store it. The secret it replaces stops working at once. For `none` the secret is the token in the URL, so `webhookUrl` changes too: going back to `none` after `hmac` or `api_key` never brings back an earlier URL.\n\n`filter` is an AND/OR tree of conditions, checked against the sender's original payload before mapping. Send `null` or an empty object to accept every authenticated delivery.\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"authMethod":{"type":"string","enum":["hmac","api_key","none"]},"enabled":{"type":"boolean","description":"`true` turns on the Webhook start mode, so the endpoint accepts requests. `false` pauses it: the endpoint returns `404` until it is turned on again, and its credentials are kept."},"filter":{"anyOf":[{"$ref":"#/components/schemas/WebhookTriggerFilter"},{"type":"null"}]}},"example":{"enabled":true}},"examples":{"turnOn":{"summary":"Turn the webhook start on","value":{"enabled":true}},"pause":{"summary":"Pause it (URL and secret kept)","value":{"enabled":false}},"hmac":{"summary":"Switch callers to HMAC signatures (returns the new secret once)","value":{"authMethod":"hmac"}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/WebhookConfig"}},"required":["success","data"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-moxo-person-only":"PERSON_TOKEN_REQUIRED"}},"/v1/templates/{id}/webhook-config/regenerate":{"post":{"tags":["Webhooks"],"summary":"Regenerate webhook secret","description":"Replaces the webhook's secret, and the response includes the new `secret` once, with `rotated: true`. Store it. Whether the webhook is on doesn't change; a template whose webhook was never set up gets one, turned on only if its Webhook start mode is on.\n\nBy default the old secret stops working at once, as it should after a leak: `previousKeyExpiresAt` is `null`. You can keep the old API key or HMAC signing secret working for up to 24 hours while the sender switches, with `previousKeyGraceSeconds`; `previousKeyExpiresAt` then says exactly when it stops, and `GET …/webhook-config` shows the same until then. During that time both keys start flows, or a signature made with either secret verifies. A URL token (`none`) always stops at once, so a grace for one is refused with 400 `PREVIOUS_KEY_GRACE_NOT_FOR_URL_TOKEN`. Changing `authMethod` stops the old secret at once too. `secretLast4` is the new secret's own last 4 characters.\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"previousKeyGraceSeconds":{"type":"integer","minimum":0,"maximum":86400,"description":"How many seconds the replaced API key or HMAC signing secret keeps working, up to 86400 (24 hours), so the sender can switch without missing a delivery: both are accepted until `previousKeyExpiresAt`. Leave it out (or send `0`) to stop the old one at once, as you would after a leak. A `none` webhook refuses it with 400 `PREVIOUS_KEY_GRACE_NOT_FOR_URL_TOKEN`: its key is the URL, which always changes at once.","example":3600}},"additionalProperties":false,"example":{"previousKeyGraceSeconds":3600}},"examples":{"atOnce":{"summary":"Replace it; the old secret stops at once (default)","value":{}},"grace":{"summary":"Keep the old API key working for an hour","value":{"previousKeyGraceSeconds":3600}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"allOf":[{"$ref":"#/components/schemas/WebhookConfig"},{"type":"object","properties":{"rotated":{"type":"boolean","enum":[true]}},"required":["rotated"],"additionalProperties":false}]}},"required":["success","data"]}}}},"400":{"description":"Refused: `PREVIOUS_KEY_GRACE_NOT_FOR_URL_TOKEN`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-moxo-person-only":"PERSON_TOKEN_REQUIRED"}},"/v1/templates/{id}/webhook-config/reveal":{"post":{"tags":["Webhooks"],"summary":"Reveal the webhook secret","description":"Returns the secret, for a screen that needs to show it again. Every call is recorded in the audit trail, with who saw the secret and when. An API key secret can't be shown again: Moxo keeps only a hash of it, so the call returns `409 SECRET_HASHED_ONLY`. Replace it with `/regenerate`, which shows the new one once. A template whose webhook was never set up gets one here (an `hmac` webhook, turned on only if its Webhook start mode is on), and this shows its first secret.\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"secret":{"type":"string","description":"The secret.","example":"a1b2c3d4-…"},"authMethod":{"type":"string","enum":["hmac","api_key","none"]}},"required":["secret","authMethod"]}},"required":["success","data"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"`SECRET_HASHED_ONLY`: Moxo keeps only a hash of this API key secret, so it can't be shown. Replace it with `/regenerate`. `SECRET_NEEDS_REGENERATE`: this secret can no longer be used (`secretNeedsRegenerate`). Replace it with `/regenerate`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-moxo-person-only":"PERSON_TOKEN_REQUIRED"}},"/v1/templates/{id}/webhook-config/test-listen":{"post":{"x-moxo-person-only":"PERSON_TOKEN_REQUIRED","tags":["Webhooks"],"summary":"Listen for a test event","description":"Starts listening for a test event, as **Listen for a test event** does in the template's webhook settings, and returns a new `testUrl`, valid for ten minutes (`listenUntil`). Send the sender's request to it, with the same authentication as the real URL: it starts a test run of the template as it is being edited (draft steps, and the mapping and conditions waiting for publish), with every role given to you, so nobody the payload names is contacted. It answers `201` with the test run, or `200` with status `skipped` when the payload does not meet the conditions. After the window, or once you stop, the test URL answers `409 NOT_LISTENING`; an unknown or replaced test URL answers `404`. Each call makes a new test URL, and the previous one stops working. A template whose webhook was never set up gets one here.\n\nNeeds a personal access token whose person can edit the template (403 otherwise): the test run is theirs. An organization API key gets 403 `PERSON_TOKEN_REQUIRED`.\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{},"additionalProperties":false}}}},"responses":{"200":{"description":"The new test URL, and until when it listens.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a 200 response."},"data":{"type":"object","properties":{"testUrl":{"type":"string","description":"Where to send the test event. A new one on every call; the previous one stops working.","example":"https://api.moxo.com/v1/webhooks/incoming/tpl_onboarding_v3/test/7f0c…"},"listenUntil":{"type":"string","format":"date-time","description":"When it stops listening: ten minutes from now."}},"required":["testUrl","listenUntil"],"additionalProperties":false,"description":"The new test URL, and until when it listens."}},"required":["success","data"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Refused: `NOT_LISTENING`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"get":{"x-moxo-person-only":"PERSON_TOKEN_REQUIRED","tags":["Webhooks"],"summary":"Check the test event","description":"Says whether the test URL is listening, until when, and the newest test run a test event started (`lastTestFlowId`), so a script can wait for its test event and then read the run with `GET /v1/flows/{id}`. It only reads.\n\nNeeds a personal access token whose person can edit the template (403 otherwise): the test run is theirs. An organization API key gets 403 `PERSON_TOKEN_REQUIRED`.\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Whether it is listening, and the newest test run.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a 200 response."},"data":{"type":"object","properties":{"listening":{"type":"boolean","description":"`true` while the test URL accepts a test event."},"listenUntil":{"type":["string","null"],"format":"date-time","description":"When listening stops, or `null` when it is not listening."},"lastTestFlowId":{"type":["string","null"],"description":"The newest test run a test event started, when you can open it; otherwise `null`."},"testUrl":{"type":["string","null"],"description":"The test URL from the last listen, or `null` before the first. It accepts a test event only while `listening`."}},"required":["listening","listenUntil","lastTestFlowId","testUrl"],"additionalProperties":false,"description":"Whether it is listening, and the newest test run."}},"required":["success","data"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"x-moxo-person-only":"PERSON_TOKEN_REQUIRED","tags":["Webhooks"],"summary":"Stop listening for a test event","description":"Stops listening: the test URL answers `409 NOT_LISTENING` until you listen again. Test runs already started keep running.\n\nNeeds a personal access token whose person can edit the template (403 otherwise): the test run is theirs. An organization API key gets 403 `PERSON_TOKEN_REQUIRED`.\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"It stopped listening.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a 200 response."},"data":{"type":"object","properties":{"listening":{"type":"boolean","enum":[false],"description":"Always `false`: the test URL no longer accepts a test event."}},"required":["listening"],"additionalProperties":false,"description":"It stopped listening."}},"required":["success","data"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Refused: `NOT_LISTENING`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/templates/{id}/webhook-config/mapping":{"get":{"tags":["Webhooks"],"summary":"Get the incoming webhook field mapping","description":"Returns how the template's incoming webhook turns a sender's JSON into a flow start, or `payloadMapping: null` when there is none (senders then post Moxo's own `{ name, fieldValues, roleAssignments }` shape). This is the mapping being edited: a saved change waits for the template's next publish (`hasPendingSetup: true`). Fields are keyed by field id, and roles by `roleId`. A personal access token needs edit permission on the template (403 otherwise).\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `templates:read`","security":[{"bearerAuth":["templates:read"]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"payloadMapping":{"anyOf":[{"$ref":"#/components/schemas/WebhookPayloadMapping"},{"type":"null"}]},"hasPendingSetup":{"type":"boolean","description":"`true` when a change to the mapping or conditions waits for the template's next publish. Until then, deliveries use the published one."}},"required":["payloadMapping","hasPendingSetup"]}},"required":["success","data"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"put":{"tags":["Webhooks"],"summary":"Save the incoming webhook field mapping","description":"Saves the mapping that turns a sender's own JSON into a flow start, or removes it with `payloadMapping: null`. Name fields by `key`, label or id, and roles by name or `roleId`. Moxo stores them by id, so a later rename doesn't break the mapping, and the response shows what was saved. Live deliveries use the mapping once the template is next published; the template's test URL uses it at once. A template whose webhook was never set up gets one here, turned on only if its Webhook start mode is on. Mapping a person's profile fields needs permission to edit people (403 otherwise). A mapping that names a role or a start field the template doesn't have, or fixes a role to a value that is no email, phone or person, returns `400 VALIDATION_FAILED` naming each one, and nothing is saved: the same check the mapping test runs, and publish refuses a waiting mapping that fails it. A personal access token needs edit permission on the template (403 otherwise).\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"payloadMapping":{"anyOf":[{"$ref":"#/components/schemas/WebhookPayloadMapping"},{"type":"null"}],"description":"The mapping to save, or `null` to remove it; senders then send Moxo's own shape."}},"required":["payloadMapping"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"payloadMapping":{"anyOf":[{"$ref":"#/components/schemas/WebhookPayloadMapping"},{"type":"null"}]},"hasPendingSetup":{"type":"boolean","description":"`true` when a change to the mapping or conditions waits for the template's next publish. Until then, deliveries use the published one."}},"required":["payloadMapping","hasPendingSetup"]}},"required":["success","data"]}}}},"400":{"description":"Refused: `VALIDATION_FAILED`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-moxo-person-only":"PERSON_TOKEN_REQUIRED"}},"/v1/templates/{id}/webhook-config/mapping/test":{"post":{"tags":["Webhooks"],"summary":"Test a mapping against a sample payload","description":"Runs `mapping` over `samplePayload` and returns the flow start it would produce, checked the way a real delivery is: start fields against the template, role names against its roles, people by email or phone. Nothing is saved, no flow starts and no one is invited. A problem returns 400 with what to fix.\n\nA `{{payload.…}}` token the sample has no value for would be empty text. The answer still succeeds, and `warnings` names each such token and where it is in the mapping (`UNRESOLVED_TOKEN`), so a typo in a path is not mistaken for an empty value. A value the sample does have, even an empty one, is not a warning. A personal access token needs edit permission on the template (403 otherwise).\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `templates:read`","security":[{"bearerAuth":["templates:read"]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"samplePayload":{"type":"object","additionalProperties":{},"description":"A payload the sender would post.","example":{"company":{"name":"Acme"},"contact":{"email":"ops@acme.example"}}},"mapping":{"$ref":"#/components/schemas/WebhookPayloadMapping"}},"required":["samplePayload","mapping"]}}}},"responses":{"200":{"description":"The flow start the mapping produces from the sample.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"name":{"type":"string","description":"Overrides the new flow's name.","example":"Loan request: Acme"},"description":{"type":"string","description":"Overrides the new flow's description."},"dueAt":{"type":"string","description":"ISO 8601 due date for the new flow.","example":"2026-12-31T17:00:00Z"},"roleAssignments":{"type":"object","additionalProperties":{"anyOf":[{"type":"string","format":"email","description":"A plain email address.","example":"person@example.com"},{"type":"string","description":"A phone number with a country code.","example":"+14088630100"},{"type":"object","properties":{"email":{"type":"string","format":"email","example":"person@example.com"},"uniqueId":{"type":"string","description":"Not accepted with email: name each assignee one way."},"name":{"type":"string","description":"Display name for this assignee.","example":"Full Name"},"phone":{"type":"string","minLength":1,"example":"4088630100","description":"A phone number to save for the person, when they are an external user found by email."},"countryCode":{"type":"string","description":"Required when phone does not already include a country code.","example":"+1"},"customFields":{"type":"object","additionalProperties":{"type":"string"},"description":"Custom user fields for this person. Leave it blank to keep the current value. A name that is not a custom user field is skipped and the flow still starts. Not the flow's own fields."}},"required":["email"],"description":"Email with an optional display name and phone number. The email identifies the assignee; the phone number is saved for an external user."},{"type":"object","properties":{"uniqueId":{"type":"string","minLength":1,"maxLength":128,"description":"Org-scoped partner identity for a person who already exists in the organization. Does not create a new contact — create them with `POST /v1/users` first when needed.","example":"cust_984431"},"email":{"type":"string","description":"Not accepted with uniqueId: name each assignee one way."},"phone":{"type":"string","description":"Not accepted with uniqueId: name each assignee one way."},"name":{"type":"string","description":"Display name for this assignee (informational; the membership name wins when set).","example":"Full Name"},"customFields":{"type":"object","additionalProperties":{"type":"string"},"description":"Custom user fields for this person. A blank leaves the stored value. A name that is not a custom user field is skipped and the flow still starts."}},"required":["uniqueId"],"description":"Existing org member identified by uniqueId (find-only; no auto-create)."},{"type":"object","properties":{"phone":{"type":"string","minLength":1,"example":"4088630100"},"uniqueId":{"type":"string","description":"Not accepted with phone: name each assignee one way."},"countryCode":{"type":"string","description":"Required if not already embedded in `phone`.","example":"+1"},"name":{"type":"string","description":"Display name for this assignee.","example":"Full Name"},"customFields":{"type":"object","additionalProperties":{"type":"string"},"description":"Custom user fields for this person. Leave it blank to keep the current value. A name that is not a custom user field is skipped and the flow still starts."}},"required":["phone"],"description":"Phone + country code with an optional display name."},{"type":"array","items":{"anyOf":[{"type":"string","format":"email","description":"A plain email address.","example":"person@example.com"},{"type":"string","description":"A phone number with a country code.","example":"+14088630100"},{"type":"object","properties":{"email":{"type":"string","format":"email","example":"person@example.com"},"uniqueId":{"type":"string","description":"Not accepted with email: name each assignee one way."},"name":{"type":"string","description":"Display name for this assignee.","example":"Full Name"},"phone":{"type":"string","minLength":1,"example":"4088630100","description":"A phone number to save for the person, when they are an external user found by email."},"countryCode":{"type":"string","description":"Required when phone does not already include a country code.","example":"+1"},"customFields":{"type":"object","additionalProperties":{"type":"string"},"description":"Custom user fields for this person. Leave it blank to keep the current value. A name that is not a custom user field is skipped and the flow still starts. Not the flow's own fields."}},"required":["email"],"description":"Email with an optional display name and phone number. The email identifies the assignee; the phone number is saved for an external user."},{"type":"object","properties":{"uniqueId":{"type":"string","minLength":1,"maxLength":128,"description":"Org-scoped partner identity for a person who already exists in the organization. Does not create a new contact — create them with `POST /v1/users` first when needed.","example":"cust_984431"},"email":{"type":"string","description":"Not accepted with uniqueId: name each assignee one way."},"phone":{"type":"string","description":"Not accepted with uniqueId: name each assignee one way."},"name":{"type":"string","description":"Display name for this assignee (informational; the membership name wins when set).","example":"Full Name"},"customFields":{"type":"object","additionalProperties":{"type":"string"},"description":"Custom user fields for this person. A blank leaves the stored value. A name that is not a custom user field is skipped and the flow still starts."}},"required":["uniqueId"],"description":"Existing org member identified by uniqueId (find-only; no auto-create)."},{"type":"object","properties":{"phone":{"type":"string","minLength":1,"example":"4088630100"},"uniqueId":{"type":"string","description":"Not accepted with phone: name each assignee one way."},"countryCode":{"type":"string","description":"Required if not already embedded in `phone`.","example":"+1"},"name":{"type":"string","description":"Display name for this assignee.","example":"Full Name"},"customFields":{"type":"object","additionalProperties":{"type":"string"},"description":"Custom user fields for this person. Leave it blank to keep the current value. A name that is not a custom user field is skipped and the flow still starts."}},"required":["phone"],"description":"Phone + country code with an optional display name."}],"description":"A single role assignee: email, phone (with country code), uniqueId for an existing member, or a structured object carrying a display name alongside the identity."}}],"description":"One assignee, or an array of assignees for a multi-assignee role."},"description":"Maps each role, by its `key`, its id or its name exactly as the template labels it, to the person or people to assign. Someone already in your organization is used. An email no one here has adds that person as an external user (or reactivates them), and the answer lists them under `addedUsers`; on a role internal users fill (a flow manager or meeting host role) it is refused with `400 ROLE_NEEDS_INTERNAL_USER` and no flow starts.","example":{"Preparer":{"email":"carol@example.com","name":"Carol"},"Reviewer":"dev@example.com"}},"customFields":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","minLength":1,"description":"The start field's `key` (not its `fieldId`).","example":"applicant_name"},"value":{"description":"A value of the field's type: text, a number, a list, or a table's rows. Name, Address, Phone and Currency fields take an object as a JSON string."}},"required":["key"],"additionalProperties":false},"description":"The new flow's start values, each field by its `key` (not its `fieldId`), as every start names them. Name, Address, Phone and Currency fields take an object as a JSON string; see the example.","example":[{"key":"applicant_name","value":"{\"firstName\":\"John\",\"lastName\":\"Doe\"}"},{"key":"applicant_address","value":"{\"street\":\"123 Main St\",\"street2\":\"\",\"city\":\"Denver\",\"state\":\"CO\",\"zip\":\"80202\",\"country\":\"US\"}"}]},"fieldValues":{"type":"object","additionalProperties":{},"deprecated":true,"description":"Deprecated: read `customFields`. The same start values as a map of field key to value, kept for callers built on it."}},"additionalProperties":false,"description":"The body an incoming webhook accepts. Every field is optional, but send at least the roles and fields the flow needs."},"warnings":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string","enum":["UNRESOLVED_TOKEN"],"description":"Always `UNRESOLVED_TOKEN`: a token found nothing in the sample."},"token":{"type":"string","description":"The token, as written in the mapping.","example":"{{payload.contact.phone}}"},"at":{"type":"string","description":"Where in the mapping: `flowName`, `description`, `dueAt`, `fieldValues.<field id>` (a field named by key or label is shown by its id) or `roleAssignments.<role>` as you named it, with a part after a dot for a field or role with parts.","example":"roleAssignments.Client.phone"},"message":{"type":"string","description":"What to check, in a sentence."}},"required":["code","token","at","message"],"additionalProperties":false},"description":"Each token the sample has no value for. Left out when there is none."}},"required":["success","data"]}}}},"400":{"description":"The mapping produces a start the template would refuse (a field value, an unknown role, a person who can't be found), or the sample is not the mapping's `source`. The message says what to fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/templates/{id}/trigger-activation":{"patch":{"tags":["Templates"],"summary":"Turn start modes on or off","description":"Sets which ways of starting a flow are on for the template, and which are paused: the same switch as the **Start Modes** panel in the template builder. It applies to the live template at once, without publishing, survives later saves and is recorded in the audit trail.\n\n`supportedStartModes` is the full list of modes that are on; `MANUAL` is always on. `disabledStartModes` lists modes that are set up but paused: `START_LINK`, `WEBHOOK` or `EMAIL`. A mode can be in only one list (400 otherwise). Turning `WEBHOOK` on creates its webhook if needed (read its URL with `GET …/webhook-config`); turning `START_LINK` on gives the template a start link. `APP` starts are turned on and off for each trigger, not here.\n\nTo change one mode without restating the others, send `{ \"mode\": \"WEBHOOK\", \"enabled\": false }` (pause it), `{ \"mode\": \"WEBHOOK\", \"enabled\": true }` (turn it on) or `{ \"mode\": \"WEBHOOK\", \"removed\": true }` (take it out of both lists). It is applied to the lists as they are when it is written, so it never puts back a mode someone else removed. The two lists are the full replacement: send them only from a copy you just read.\n\nReturns the template in the same shape as `GET /v1/templates/{id}`. A personal access token needs edit permission on the template (403 otherwise). Turning on a public start link is refused when the organization doesn't allow sharing outside it. On a template installed from an Archway bundle, a change answers `409 ARCHWAY_REQUIRES_DETACH_ACK` until it is sent again with the header `x-archway-detach-ack: 1`, which detaches the template.\n\n`EMAIL` in `supportedStartModes` is the template's Start by email setting. The email start has one pause, the same as `PATCH /v1/templates/{id}/email-start`: `EMAIL` in `disabledStartModes`, or `{ \"mode\": \"EMAIL\", \"enabled\": false }`, pauses it and keeps Start by email on, and a read never lists `EMAIL` as paused here (read `paused` from `GET …/email-start`). `{ \"mode\": \"EMAIL\", \"enabled\": true }` resumes it. Putting `EMAIL` in `supportedStartModes` does not lift a pause.\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"supportedStartModes":{"type":"array","items":{"type":"string","enum":["MANUAL","START_LINK","WEBHOOK","EMAIL","APP"]},"description":"Every mode that is on. `MANUAL` is always on."},"disabledStartModes":{"type":"array","items":{"type":"string","enum":["START_LINK","WEBHOOK","EMAIL"]},"description":"Defaults to `[]`."}},"required":["supportedStartModes"],"additionalProperties":false},{"type":"object","properties":{"mode":{"type":"string","enum":["MANUAL","START_LINK","WEBHOOK","EMAIL","APP"],"description":"The one mode to change; the others stay as they are."},"enabled":{"type":"boolean","description":"`true` turns the mode on; `false` pauses it (`APP` goes off)."}},"required":["mode","enabled"],"additionalProperties":false},{"type":"object","properties":{"mode":{"type":"string","enum":["MANUAL","START_LINK","WEBHOOK","EMAIL","APP"],"description":"The one mode to take out; the others stay as they are."},"removed":{"type":"boolean","enum":[true],"description":"Takes the mode out of both lists."}},"required":["mode","removed"],"additionalProperties":false}],"example":{"mode":"WEBHOOK","enabled":true}},"examples":{"webhookOnOneMode":{"summary":"Turn the webhook start on, leaving the others as they are","value":{"mode":"WEBHOOK","enabled":true}},"webhookOn":{"summary":"Set both lists: the webhook start on","value":{"supportedStartModes":["MANUAL","WEBHOOK"],"disabledStartModes":[]}},"webhookPaused":{"summary":"Set both lists: the webhook start paused","value":{"supportedStartModes":["MANUAL"],"disabledStartModes":["WEBHOOK"]}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/TemplateDetail"}},"required":["success","data"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Refused: `ARCHWAY_REQUIRES_DETACH_ACK`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-moxo-person-only":"PERSON_TOKEN_REQUIRED"}},"/v1/templates/{id}/email-start":{"get":{"tags":["Templates"],"summary":"Read whether a template starts by email","description":"Whether the template's Start by email setting is on (`startByEmail`) and whether the email start is paused (`paused`). Mail to its address starts a flow when it is on and not paused. It reads only: it creates nothing. A personal access token needs to be able to open the template (403 otherwise). The address, conditions and mapping are on `GET /v1/email-triggers?templateId=…`.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `templates:read`","security":[{"bearerAuth":["templates:read"]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success response."},"data":{"allOf":[{"$ref":"#/components/schemas/EmailStart"},{"description":"The template's email start."}]}},"required":["success","data"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"tags":["Templates"],"summary":"Pause or resume the email start","description":"The same switch as **Email** under **Ways to start** in the app, and the one pause for the email start: `enabled` on `PATCH /v1/email-triggers/{id}` and `EMAIL` in `disabledStartModes` on `PATCH /v1/templates/{id}/trigger-activation` set the same pause, and any of them lifts it. `{ \"paused\": true }` stops the address starting flows and keeps its conditions and mapping; Start by email stays on. `{ \"paused\": false }` resumes it and turns Start by email on if it is off, in one change. It applies to the live template at once and is recorded in the audit trail.\n\nA personal access token needs edit permission on the template (403 otherwise); the Configure integrations permission is not needed. Resuming needs Start by email on the organization's plan (`403 FEATURE_DISABLED` otherwise); pausing never does. Resuming on a template installed from an Archway bundle answers `409 ARCHWAY_REQUIRES_DETACH_ACK` until it is sent again with the header `x-archway-detach-ack: 1`, which detaches the template.\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailStartBody"},"examples":{"pause":{"summary":"Pause the email start","value":{"paused":true}},"resume":{"summary":"Resume it (and turn Start by email on)","value":{"paused":false}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success response."},"data":{"allOf":[{"$ref":"#/components/schemas/EmailStartChange"},{"description":"The email start after the change, and the template's start modes as it left them."}]}},"required":["success","data"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Refused: `ARCHWAY_REQUIRES_DETACH_ACK`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-moxo-person-only":"PERSON_TOKEN_REQUIRED"}},"/v1/webhooks/incoming/{templateId}/{pathToken}":{"post":{"tags":["Webhooks"],"summary":"Start a flow with an incoming webhook (token)","description":"Starts a flow from the latest published version of the template, using its secret webhook URL. A template that was never published returns 409 `TEMPLATE_NOT_PUBLISHED`, and an archived one 409 `TEMPLATE_ARCHIVED`. A payload that doesn't match the trigger's conditions is accepted with `200` and status `skipped`, and no flow starts. Send a unique `Idempotency-Key` for each event, and send the same one when you retry. Without an `Idempotency-Key`, a delivery whose body is exactly the same as one received in the last 30 seconds is treated as a retry: it answers `200` with the first flow and `idempotent: true`, and starts nothing. To start two flows from the same body within 30 seconds, send a different key with each. A delivery the template can't start a flow from (a start field that isn't on the template, a required one left out, a value of the wrong kind, a role nobody can fill) answers `400 VALIDATION_ERROR`; `error.message` names the field, and `error.roleId` the role. A role given an email no one in the organization has adds that person as an external user, listed in `addedUsers`, when the template's publisher (or, for a version with no recorded publisher, one of its owners) may add external users; when they lack that permission it answers `403 FORBIDDEN` (the endpoint's delivery log says who needs it). A new email on a role internal users fill answers `400 ROLE_NEEDS_INTERNAL_USER`. Nothing starts.\n\n**Tokens:** none. The token in the webhook URL is the credential.","security":[],"parameters":[{"schema":{"type":"string","description":"The template id, from the webhook URL in the template's settings."},"required":true,"description":"The template id, from the webhook URL in the template's settings.","name":"templateId","in":"path"},{"schema":{"type":"string","description":"The token in the webhook URL, from the template's settings."},"required":true,"description":"The token in the webhook URL, from the template's settings.","name":"pathToken","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":256,"pattern":"^[A-Za-z0-9_\\-:.]+$","description":"A unique key for this event, up to 256 letters, digits, `-`, `_`, `:` or `.`. Send the same value when you retry. Any other key is refused with `400 INVALID_IDEMPOTENCY_KEY` and starts nothing.","example":"evt_123"},"required":false,"description":"A unique key for this event, up to 256 letters, digits, `-`, `_`, `:` or `.`. Send the same value when you retry. Any other key is refused with `400 INVALID_IDEMPOTENCY_KEY` and starts nothing.","name":"Idempotency-Key","in":"header"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Overrides the new flow's name.","example":"Loan request: Acme"},"description":{"type":"string","description":"Overrides the new flow's description."},"dueAt":{"type":"string","description":"ISO 8601 due date for the new flow.","example":"2026-12-31T17:00:00Z"},"roleAssignments":{"type":"object","additionalProperties":{"anyOf":[{"type":"string","format":"email","description":"A plain email address.","example":"person@example.com"},{"type":"string","description":"A phone number with a country code.","example":"+14088630100"},{"type":"object","properties":{"email":{"type":"string","format":"email","example":"person@example.com"},"uniqueId":{"type":"string","description":"Not accepted with email: name each assignee one way."},"name":{"type":"string","description":"Display name for this assignee.","example":"Full Name"},"phone":{"type":"string","minLength":1,"example":"4088630100","description":"A phone number to save for the person, when they are an external user found by email."},"countryCode":{"type":"string","description":"Required when phone does not already include a country code.","example":"+1"},"customFields":{"type":"object","additionalProperties":{"type":"string"},"description":"Custom user fields for this person. Leave it blank to keep the current value. A name that is not a custom user field is skipped and the flow still starts. Not the flow's own fields."}},"required":["email"],"description":"Email with an optional display name and phone number. The email identifies the assignee; the phone number is saved for an external user."},{"type":"object","properties":{"uniqueId":{"type":"string","minLength":1,"maxLength":128,"description":"Org-scoped partner identity for a person who already exists in the organization. Does not create a new contact — create them with `POST /v1/users` first when needed.","example":"cust_984431"},"email":{"type":"string","description":"Not accepted with uniqueId: name each assignee one way."},"phone":{"type":"string","description":"Not accepted with uniqueId: name each assignee one way."},"name":{"type":"string","description":"Display name for this assignee (informational; the membership name wins when set).","example":"Full Name"},"customFields":{"type":"object","additionalProperties":{"type":"string"},"description":"Custom user fields for this person. A blank leaves the stored value. A name that is not a custom user field is skipped and the flow still starts."}},"required":["uniqueId"],"description":"Existing org member identified by uniqueId (find-only; no auto-create)."},{"type":"object","properties":{"phone":{"type":"string","minLength":1,"example":"4088630100"},"uniqueId":{"type":"string","description":"Not accepted with phone: name each assignee one way."},"countryCode":{"type":"string","description":"Required if not already embedded in `phone`.","example":"+1"},"name":{"type":"string","description":"Display name for this assignee.","example":"Full Name"},"customFields":{"type":"object","additionalProperties":{"type":"string"},"description":"Custom user fields for this person. Leave it blank to keep the current value. A name that is not a custom user field is skipped and the flow still starts."}},"required":["phone"],"description":"Phone + country code with an optional display name."},{"type":"array","items":{"anyOf":[{"type":"string","format":"email","description":"A plain email address.","example":"person@example.com"},{"type":"string","description":"A phone number with a country code.","example":"+14088630100"},{"type":"object","properties":{"email":{"type":"string","format":"email","example":"person@example.com"},"uniqueId":{"type":"string","description":"Not accepted with email: name each assignee one way."},"name":{"type":"string","description":"Display name for this assignee.","example":"Full Name"},"phone":{"type":"string","minLength":1,"example":"4088630100","description":"A phone number to save for the person, when they are an external user found by email."},"countryCode":{"type":"string","description":"Required when phone does not already include a country code.","example":"+1"},"customFields":{"type":"object","additionalProperties":{"type":"string"},"description":"Custom user fields for this person. Leave it blank to keep the current value. A name that is not a custom user field is skipped and the flow still starts. Not the flow's own fields."}},"required":["email"],"description":"Email with an optional display name and phone number. The email identifies the assignee; the phone number is saved for an external user."},{"type":"object","properties":{"uniqueId":{"type":"string","minLength":1,"maxLength":128,"description":"Org-scoped partner identity for a person who already exists in the organization. Does not create a new contact — create them with `POST /v1/users` first when needed.","example":"cust_984431"},"email":{"type":"string","description":"Not accepted with uniqueId: name each assignee one way."},"phone":{"type":"string","description":"Not accepted with uniqueId: name each assignee one way."},"name":{"type":"string","description":"Display name for this assignee (informational; the membership name wins when set).","example":"Full Name"},"customFields":{"type":"object","additionalProperties":{"type":"string"},"description":"Custom user fields for this person. A blank leaves the stored value. A name that is not a custom user field is skipped and the flow still starts."}},"required":["uniqueId"],"description":"Existing org member identified by uniqueId (find-only; no auto-create)."},{"type":"object","properties":{"phone":{"type":"string","minLength":1,"example":"4088630100"},"uniqueId":{"type":"string","description":"Not accepted with phone: name each assignee one way."},"countryCode":{"type":"string","description":"Required if not already embedded in `phone`.","example":"+1"},"name":{"type":"string","description":"Display name for this assignee.","example":"Full Name"},"customFields":{"type":"object","additionalProperties":{"type":"string"},"description":"Custom user fields for this person. Leave it blank to keep the current value. A name that is not a custom user field is skipped and the flow still starts."}},"required":["phone"],"description":"Phone + country code with an optional display name."}],"description":"A single role assignee: email, phone (with country code), uniqueId for an existing member, or a structured object carrying a display name alongside the identity."}}],"description":"One assignee, or an array of assignees for a multi-assignee role."},"description":"Maps each role, by its `key`, its id or its name exactly as the template labels it, to the person or people to assign. Someone already in your organization is used. An email no one here has adds that person as an external user (or reactivates them), and the answer lists them under `addedUsers`; on a role internal users fill (a flow manager or meeting host role) it is refused with `400 ROLE_NEEDS_INTERNAL_USER` and no flow starts.","example":{"Preparer":{"email":"carol@example.com","name":"Carol"},"Reviewer":"dev@example.com"}},"customFields":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","minLength":1,"description":"The start field's `key` (not its `fieldId`).","example":"applicant_name"},"value":{"description":"A value of the field's type: text, a number, a list, or a table's rows. Name, Address, Phone and Currency fields take an object as a JSON string."}},"required":["key"],"additionalProperties":false},"description":"The new flow's start values, each field by its `key` (not its `fieldId`), as every start names them. Name, Address, Phone and Currency fields take an object as a JSON string; see the example.","example":[{"key":"applicant_name","value":"{\"firstName\":\"John\",\"lastName\":\"Doe\"}"},{"key":"applicant_address","value":"{\"street\":\"123 Main St\",\"street2\":\"\",\"city\":\"Denver\",\"state\":\"CO\",\"zip\":\"80202\",\"country\":\"US\"}"}]}},"additionalProperties":false,"description":"The body an incoming webhook accepts. Every field is optional, but send at least the roles and fields the flow needs."}}}},"responses":{"200":{"description":"The delivery was accepted: either the conditions didn't match, or it repeated an earlier delivery and returns that flow.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"anyOf":[{"type":"object","properties":{"flowId":{"type":"string"},"idempotent":{"type":"boolean","enum":[true]},"message":{"type":"string"}},"required":["flowId","idempotent","message"]},{"type":"object","properties":{"status":{"type":"string","enum":["skipped"]},"message":{"type":"string"}},"required":["status","message"]}]}},"required":["success","data"]}}}},"201":{"description":"The flow started.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"flowId":{"type":"string"},"status":{"type":"string","enum":["started"]},"addedUsers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The person's user id (`usr_…`)."},"email":{"type":"string","description":"The email the delivery named them by."},"roleId":{"type":"string","description":"The role they hold on the new flow."},"reactivated":{"type":"boolean","description":"`true` when they were a deactivated external user, now active again."}},"required":["id","email","roleId","reactivated"],"additionalProperties":false},"description":"The people this delivery added to your organization as external users, or reactivated, because no one here had their email. Absent when it added no one."}},"required":["flowId","status"]}},"required":["success","data"]}}}},"400":{"description":"Refused: `ROLE_NEEDS_INTERNAL_USER`, `VALIDATION_ERROR`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"`IDEMPOTENCY_IN_PROGRESS`: a request with this `Idempotency-Key` is still running; retry after `Retry-After`. `TEMPLATE_NOT_PUBLISHED`: the template was never published, so it starts nothing (\"This template isn't published yet. Publish it, or use its test URL.\"). `TEMPLATE_ARCHIVED`: the template is archived, so it starts nothing until it is restored. Nothing is recorded for either delivery, so if your system sends it again once the template is published or restored, it starts a flow. `START_PEOPLE_CHANGED`: someone with an email the delivery was adding joined your organization while the flow was starting; nothing was started or added, and sending it again (the same `Idempotency-Key` is fine) starts it with that person. `SIGNATURE_ALREADY_USED`: a delivery with this exact `X-Moxo-Signature` was already received and started no flow (the conditions skipped it, or it is still starting one), so this one starts nothing. Sign each new delivery with the current time. `WEBHOOK_ADDRESS_CHANGED`: the organization is served at another address now, so this one starts nothing; send the delivery to `error.webhookBaseUrl` followed by the same path, and change the address in the sending system.","headers":{"Retry-After":{"description":"Seconds to wait before retrying","schema":{"type":"string","example":"1"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string","enum":["IDEMPOTENCY_IN_PROGRESS","TEMPLATE_NOT_PUBLISHED","TEMPLATE_ARCHIVED","START_PEOPLE_CHANGED","SIGNATURE_ALREADY_USED","WEBHOOK_ADDRESS_CHANGED"]},"message":{"type":"string"},"webhookBaseUrl":{"type":"string","description":"With `WEBHOOK_ADDRESS_CHANGED`: the address to send this webhook to, followed by the same path."}},"required":["code","message"]}},"required":["success","error"]}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/webhooks/incoming/{templateId}":{"post":{"tags":["Webhooks"],"summary":"Start a flow with an incoming webhook (signed or key)","description":"Starts a flow from the latest published version of the template. A template that was never published returns 409 `TEMPLATE_NOT_PUBLISHED`, and an archived one 409 `TEMPLATE_ARCHIVED`. An HMAC endpoint needs `X-Moxo-Signature: t=<unix-seconds>,v1=<hex-hmac>`, where the HMAC-SHA256 input is `<timestamp>.<raw-request-body>`, signed within 5 minutes of now; each signature starts at most one flow: the same signed request sent again, whatever its `Idempotency-Key`, answers `200` with the flow it started and `idempotent: true`, or 409 `SIGNATURE_ALREADY_USED` when the conditions skipped it. A request refused before a flow started can be sent again as it was. `X-Moxo-Signature` is recommended. The body-only `X-Webhook-Signature: <hex-hmac>` (the HMAC-SHA256 of the JSON body, no timestamp) is also accepted, and is not refused when sent again: only `Idempotency-Key`, or the same body within 30 seconds, answers with an earlier flow. When both are sent, `X-Moxo-Signature` is checked. An API key endpoint needs `X-API-Key`. A payload that doesn't match the trigger's conditions is accepted with `200` and status `skipped`, and no flow starts. Send a unique `Idempotency-Key` for each event, and send the same one when you retry. Without an `Idempotency-Key`, a delivery whose body is exactly the same as one received in the last 30 seconds is treated as a retry: it answers `200` with the first flow and `idempotent: true`, and starts nothing. To start two flows from the same body within 30 seconds, send a different key with each. A delivery the template can't start a flow from (a start field that isn't on the template, a required one left out, a value of the wrong kind, a role nobody can fill) answers `400 VALIDATION_ERROR`; `error.message` names the field, and `error.roleId` the role. A role given an email no one in the organization has adds that person as an external user, listed in `addedUsers`, when the template's publisher (or, for a version with no recorded publisher, one of its owners) may add external users; when they lack that permission it answers `403 FORBIDDEN` (the endpoint's delivery log says who needs it). A new email on a role internal users fill answers `400 ROLE_NEEDS_INTERNAL_USER`. Nothing starts. [Webhooks](/docs/guides/webhooks) shows how to sign a request.\n\n**Tokens:** none. The signature (`X-Moxo-Signature`, or the body-only `X-Webhook-Signature`) or the `X-API-Key` header, whichever the template's webhook settings use, is the credential.","security":[],"parameters":[{"schema":{"type":"string","description":"The template id, from the webhook URL in the template's settings."},"required":true,"description":"The template id, from the webhook URL in the template's settings.","name":"templateId","in":"path"},{"schema":{"type":"string","description":"For HMAC endpoints, recommended: `t=<unix-seconds>,v1=<hex-hmac>`. An HMAC endpoint needs this or `X-Webhook-Signature`."},"required":false,"description":"For HMAC endpoints, recommended: `t=<unix-seconds>,v1=<hex-hmac>`. An HMAC endpoint needs this or `X-Webhook-Signature`.","name":"X-Moxo-Signature","in":"header"},{"schema":{"type":"string","description":"For HMAC endpoints: the hex HMAC-SHA256 of the JSON body, with no timestamp. Read only when `X-Moxo-Signature` is absent."},"required":false,"description":"For HMAC endpoints: the hex HMAC-SHA256 of the JSON body, with no timestamp. Read only when `X-Moxo-Signature` is absent.","name":"X-Webhook-Signature","in":"header"},{"schema":{"type":"string","description":"Required for API-key endpoints."},"required":false,"description":"Required for API-key endpoints.","name":"X-API-Key","in":"header"},{"schema":{"type":"string","minLength":1,"maxLength":256,"pattern":"^[A-Za-z0-9_\\-:.]+$","description":"A unique key for this event, up to 256 letters, digits, `-`, `_`, `:` or `.`. Send the same value when you retry. Any other key is refused with `400 INVALID_IDEMPOTENCY_KEY` and starts nothing.","example":"evt_123"},"required":false,"description":"A unique key for this event, up to 256 letters, digits, `-`, `_`, `:` or `.`. Send the same value when you retry. Any other key is refused with `400 INVALID_IDEMPOTENCY_KEY` and starts nothing.","name":"Idempotency-Key","in":"header"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Overrides the new flow's name.","example":"Loan request: Acme"},"description":{"type":"string","description":"Overrides the new flow's description."},"dueAt":{"type":"string","description":"ISO 8601 due date for the new flow.","example":"2026-12-31T17:00:00Z"},"roleAssignments":{"type":"object","additionalProperties":{"anyOf":[{"type":"string","format":"email","description":"A plain email address.","example":"person@example.com"},{"type":"string","description":"A phone number with a country code.","example":"+14088630100"},{"type":"object","properties":{"email":{"type":"string","format":"email","example":"person@example.com"},"uniqueId":{"type":"string","description":"Not accepted with email: name each assignee one way."},"name":{"type":"string","description":"Display name for this assignee.","example":"Full Name"},"phone":{"type":"string","minLength":1,"example":"4088630100","description":"A phone number to save for the person, when they are an external user found by email."},"countryCode":{"type":"string","description":"Required when phone does not already include a country code.","example":"+1"},"customFields":{"type":"object","additionalProperties":{"type":"string"},"description":"Custom user fields for this person. Leave it blank to keep the current value. A name that is not a custom user field is skipped and the flow still starts. Not the flow's own fields."}},"required":["email"],"description":"Email with an optional display name and phone number. The email identifies the assignee; the phone number is saved for an external user."},{"type":"object","properties":{"uniqueId":{"type":"string","minLength":1,"maxLength":128,"description":"Org-scoped partner identity for a person who already exists in the organization. Does not create a new contact — create them with `POST /v1/users` first when needed.","example":"cust_984431"},"email":{"type":"string","description":"Not accepted with uniqueId: name each assignee one way."},"phone":{"type":"string","description":"Not accepted with uniqueId: name each assignee one way."},"name":{"type":"string","description":"Display name for this assignee (informational; the membership name wins when set).","example":"Full Name"},"customFields":{"type":"object","additionalProperties":{"type":"string"},"description":"Custom user fields for this person. A blank leaves the stored value. A name that is not a custom user field is skipped and the flow still starts."}},"required":["uniqueId"],"description":"Existing org member identified by uniqueId (find-only; no auto-create)."},{"type":"object","properties":{"phone":{"type":"string","minLength":1,"example":"4088630100"},"uniqueId":{"type":"string","description":"Not accepted with phone: name each assignee one way."},"countryCode":{"type":"string","description":"Required if not already embedded in `phone`.","example":"+1"},"name":{"type":"string","description":"Display name for this assignee.","example":"Full Name"},"customFields":{"type":"object","additionalProperties":{"type":"string"},"description":"Custom user fields for this person. Leave it blank to keep the current value. A name that is not a custom user field is skipped and the flow still starts."}},"required":["phone"],"description":"Phone + country code with an optional display name."},{"type":"array","items":{"anyOf":[{"type":"string","format":"email","description":"A plain email address.","example":"person@example.com"},{"type":"string","description":"A phone number with a country code.","example":"+14088630100"},{"type":"object","properties":{"email":{"type":"string","format":"email","example":"person@example.com"},"uniqueId":{"type":"string","description":"Not accepted with email: name each assignee one way."},"name":{"type":"string","description":"Display name for this assignee.","example":"Full Name"},"phone":{"type":"string","minLength":1,"example":"4088630100","description":"A phone number to save for the person, when they are an external user found by email."},"countryCode":{"type":"string","description":"Required when phone does not already include a country code.","example":"+1"},"customFields":{"type":"object","additionalProperties":{"type":"string"},"description":"Custom user fields for this person. Leave it blank to keep the current value. A name that is not a custom user field is skipped and the flow still starts. Not the flow's own fields."}},"required":["email"],"description":"Email with an optional display name and phone number. The email identifies the assignee; the phone number is saved for an external user."},{"type":"object","properties":{"uniqueId":{"type":"string","minLength":1,"maxLength":128,"description":"Org-scoped partner identity for a person who already exists in the organization. Does not create a new contact — create them with `POST /v1/users` first when needed.","example":"cust_984431"},"email":{"type":"string","description":"Not accepted with uniqueId: name each assignee one way."},"phone":{"type":"string","description":"Not accepted with uniqueId: name each assignee one way."},"name":{"type":"string","description":"Display name for this assignee (informational; the membership name wins when set).","example":"Full Name"},"customFields":{"type":"object","additionalProperties":{"type":"string"},"description":"Custom user fields for this person. A blank leaves the stored value. A name that is not a custom user field is skipped and the flow still starts."}},"required":["uniqueId"],"description":"Existing org member identified by uniqueId (find-only; no auto-create)."},{"type":"object","properties":{"phone":{"type":"string","minLength":1,"example":"4088630100"},"uniqueId":{"type":"string","description":"Not accepted with phone: name each assignee one way."},"countryCode":{"type":"string","description":"Required if not already embedded in `phone`.","example":"+1"},"name":{"type":"string","description":"Display name for this assignee.","example":"Full Name"},"customFields":{"type":"object","additionalProperties":{"type":"string"},"description":"Custom user fields for this person. Leave it blank to keep the current value. A name that is not a custom user field is skipped and the flow still starts."}},"required":["phone"],"description":"Phone + country code with an optional display name."}],"description":"A single role assignee: email, phone (with country code), uniqueId for an existing member, or a structured object carrying a display name alongside the identity."}}],"description":"One assignee, or an array of assignees for a multi-assignee role."},"description":"Maps each role, by its `key`, its id or its name exactly as the template labels it, to the person or people to assign. Someone already in your organization is used. An email no one here has adds that person as an external user (or reactivates them), and the answer lists them under `addedUsers`; on a role internal users fill (a flow manager or meeting host role) it is refused with `400 ROLE_NEEDS_INTERNAL_USER` and no flow starts.","example":{"Preparer":{"email":"carol@example.com","name":"Carol"},"Reviewer":"dev@example.com"}},"customFields":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","minLength":1,"description":"The start field's `key` (not its `fieldId`).","example":"applicant_name"},"value":{"description":"A value of the field's type: text, a number, a list, or a table's rows. Name, Address, Phone and Currency fields take an object as a JSON string."}},"required":["key"],"additionalProperties":false},"description":"The new flow's start values, each field by its `key` (not its `fieldId`), as every start names them. Name, Address, Phone and Currency fields take an object as a JSON string; see the example.","example":[{"key":"applicant_name","value":"{\"firstName\":\"John\",\"lastName\":\"Doe\"}"},{"key":"applicant_address","value":"{\"street\":\"123 Main St\",\"street2\":\"\",\"city\":\"Denver\",\"state\":\"CO\",\"zip\":\"80202\",\"country\":\"US\"}"}]}},"additionalProperties":false,"description":"The body an incoming webhook accepts. Every field is optional, but send at least the roles and fields the flow needs."}}}},"responses":{"200":{"description":"The delivery was accepted: either the conditions didn't match, or it repeated an earlier delivery and returns that flow.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"anyOf":[{"type":"object","properties":{"flowId":{"type":"string"},"idempotent":{"type":"boolean","enum":[true]},"message":{"type":"string"}},"required":["flowId","idempotent","message"]},{"type":"object","properties":{"status":{"type":"string","enum":["skipped"]},"message":{"type":"string"}},"required":["status","message"]}]}},"required":["success","data"]}}}},"201":{"description":"The flow started.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"flowId":{"type":"string"},"status":{"type":"string","enum":["started"]},"addedUsers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The person's user id (`usr_…`)."},"email":{"type":"string","description":"The email the delivery named them by."},"roleId":{"type":"string","description":"The role they hold on the new flow."},"reactivated":{"type":"boolean","description":"`true` when they were a deactivated external user, now active again."}},"required":["id","email","roleId","reactivated"],"additionalProperties":false},"description":"The people this delivery added to your organization as external users, or reactivated, because no one here had their email. Absent when it added no one."}},"required":["flowId","status"]}},"required":["success","data"]}}}},"400":{"description":"Refused: `ROLE_NEEDS_INTERNAL_USER`, `VALIDATION_ERROR`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"`IDEMPOTENCY_IN_PROGRESS`: a request with this `Idempotency-Key` is still running; retry after `Retry-After`. `TEMPLATE_NOT_PUBLISHED`: the template was never published, so it starts nothing (\"This template isn't published yet. Publish it, or use its test URL.\"). `TEMPLATE_ARCHIVED`: the template is archived, so it starts nothing until it is restored. Nothing is recorded for either delivery, so if your system sends it again once the template is published or restored, it starts a flow. `START_PEOPLE_CHANGED`: someone with an email the delivery was adding joined your organization while the flow was starting; nothing was started or added, and sending it again (the same `Idempotency-Key` is fine) starts it with that person. `SIGNATURE_ALREADY_USED`: a delivery with this exact `X-Moxo-Signature` was already received and started no flow (the conditions skipped it, or it is still starting one), so this one starts nothing. Sign each new delivery with the current time. `WEBHOOK_ADDRESS_CHANGED`: the organization is served at another address now, so this one starts nothing; send the delivery to `error.webhookBaseUrl` followed by the same path, and change the address in the sending system.","headers":{"Retry-After":{"description":"Seconds to wait before retrying","schema":{"type":"string","example":"1"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string","enum":["IDEMPOTENCY_IN_PROGRESS","TEMPLATE_NOT_PUBLISHED","TEMPLATE_ARCHIVED","START_PEOPLE_CHANGED","SIGNATURE_ALREADY_USED","WEBHOOK_ADDRESS_CHANGED"]},"message":{"type":"string"},"webhookBaseUrl":{"type":"string","description":"With `WEBHOOK_ADDRESS_CHANGED`: the address to send this webhook to, followed by the same path."}},"required":["code","message"]}},"required":["success","error"]}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/webhooks/incoming/{templateId}/test/{testToken}":{"post":{"tags":["Webhooks"],"summary":"Send a test event to an incoming webhook","description":"The template's separate test URL. It accepts deliveries only while someone listens for a test event, for ten minutes at a time: **Listen for a test event** in Moxo, or `POST /v1/templates/{id}/webhook-config/test-listen` with a personal access token, which returns this URL. A delivery then starts a labeled test run of the template's draft, with the trigger's unpublished mapping and conditions, so you can try a sender before the template is published. The endpoint's own authentication applies: with token authentication, the test token is the credential; an HMAC or API key endpoint also needs a signature (`X-Moxo-Signature`, or the body-only `X-Webhook-Signature`) or `X-API-Key`, exactly as on the real URL. Test deliveries ignore idempotency keys. A test run gives every role to the person listening and adds no one: an email the payload names is never added or written to. A start field that is not on the template, a required one left out, or a value of the wrong kind answers `400 VALIDATION_ERROR`, naming the field. A test URL whose listening window ended answers `409 NOT_LISTENING`; an unknown test URL, or one replaced by a newer listen, answers `404`.\n\n**Tokens:** none. The test token in the URL is the credential, with the endpoint's own signature or `X-API-Key` when it uses one.","security":[],"parameters":[{"schema":{"type":"string","description":"The template id."},"required":true,"description":"The template id.","name":"templateId","in":"path"},{"schema":{"type":"string","description":"The token in the test URL that **Listen for a test event** shows, or that `POST /v1/templates/{id}/webhook-config/test-listen` returns."},"required":true,"description":"The token in the test URL that **Listen for a test event** shows, or that `POST /v1/templates/{id}/webhook-config/test-listen` returns.","name":"testToken","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Overrides the new flow's name.","example":"Loan request: Acme"},"description":{"type":"string","description":"Overrides the new flow's description."},"dueAt":{"type":"string","description":"ISO 8601 due date for the new flow.","example":"2026-12-31T17:00:00Z"},"roleAssignments":{"type":"object","additionalProperties":{"anyOf":[{"type":"string","format":"email","description":"A plain email address.","example":"person@example.com"},{"type":"string","description":"A phone number with a country code.","example":"+14088630100"},{"type":"object","properties":{"email":{"type":"string","format":"email","example":"person@example.com"},"uniqueId":{"type":"string","description":"Not accepted with email: name each assignee one way."},"name":{"type":"string","description":"Display name for this assignee.","example":"Full Name"},"phone":{"type":"string","minLength":1,"example":"4088630100","description":"A phone number to save for the person, when they are an external user found by email."},"countryCode":{"type":"string","description":"Required when phone does not already include a country code.","example":"+1"},"customFields":{"type":"object","additionalProperties":{"type":"string"},"description":"Custom user fields for this person. Leave it blank to keep the current value. A name that is not a custom user field is skipped and the flow still starts. Not the flow's own fields."}},"required":["email"],"description":"Email with an optional display name and phone number. The email identifies the assignee; the phone number is saved for an external user."},{"type":"object","properties":{"uniqueId":{"type":"string","minLength":1,"maxLength":128,"description":"Org-scoped partner identity for a person who already exists in the organization. Does not create a new contact — create them with `POST /v1/users` first when needed.","example":"cust_984431"},"email":{"type":"string","description":"Not accepted with uniqueId: name each assignee one way."},"phone":{"type":"string","description":"Not accepted with uniqueId: name each assignee one way."},"name":{"type":"string","description":"Display name for this assignee (informational; the membership name wins when set).","example":"Full Name"},"customFields":{"type":"object","additionalProperties":{"type":"string"},"description":"Custom user fields for this person. A blank leaves the stored value. A name that is not a custom user field is skipped and the flow still starts."}},"required":["uniqueId"],"description":"Existing org member identified by uniqueId (find-only; no auto-create)."},{"type":"object","properties":{"phone":{"type":"string","minLength":1,"example":"4088630100"},"uniqueId":{"type":"string","description":"Not accepted with phone: name each assignee one way."},"countryCode":{"type":"string","description":"Required if not already embedded in `phone`.","example":"+1"},"name":{"type":"string","description":"Display name for this assignee.","example":"Full Name"},"customFields":{"type":"object","additionalProperties":{"type":"string"},"description":"Custom user fields for this person. Leave it blank to keep the current value. A name that is not a custom user field is skipped and the flow still starts."}},"required":["phone"],"description":"Phone + country code with an optional display name."},{"type":"array","items":{"anyOf":[{"type":"string","format":"email","description":"A plain email address.","example":"person@example.com"},{"type":"string","description":"A phone number with a country code.","example":"+14088630100"},{"type":"object","properties":{"email":{"type":"string","format":"email","example":"person@example.com"},"uniqueId":{"type":"string","description":"Not accepted with email: name each assignee one way."},"name":{"type":"string","description":"Display name for this assignee.","example":"Full Name"},"phone":{"type":"string","minLength":1,"example":"4088630100","description":"A phone number to save for the person, when they are an external user found by email."},"countryCode":{"type":"string","description":"Required when phone does not already include a country code.","example":"+1"},"customFields":{"type":"object","additionalProperties":{"type":"string"},"description":"Custom user fields for this person. Leave it blank to keep the current value. A name that is not a custom user field is skipped and the flow still starts. Not the flow's own fields."}},"required":["email"],"description":"Email with an optional display name and phone number. The email identifies the assignee; the phone number is saved for an external user."},{"type":"object","properties":{"uniqueId":{"type":"string","minLength":1,"maxLength":128,"description":"Org-scoped partner identity for a person who already exists in the organization. Does not create a new contact — create them with `POST /v1/users` first when needed.","example":"cust_984431"},"email":{"type":"string","description":"Not accepted with uniqueId: name each assignee one way."},"phone":{"type":"string","description":"Not accepted with uniqueId: name each assignee one way."},"name":{"type":"string","description":"Display name for this assignee (informational; the membership name wins when set).","example":"Full Name"},"customFields":{"type":"object","additionalProperties":{"type":"string"},"description":"Custom user fields for this person. A blank leaves the stored value. A name that is not a custom user field is skipped and the flow still starts."}},"required":["uniqueId"],"description":"Existing org member identified by uniqueId (find-only; no auto-create)."},{"type":"object","properties":{"phone":{"type":"string","minLength":1,"example":"4088630100"},"uniqueId":{"type":"string","description":"Not accepted with phone: name each assignee one way."},"countryCode":{"type":"string","description":"Required if not already embedded in `phone`.","example":"+1"},"name":{"type":"string","description":"Display name for this assignee.","example":"Full Name"},"customFields":{"type":"object","additionalProperties":{"type":"string"},"description":"Custom user fields for this person. Leave it blank to keep the current value. A name that is not a custom user field is skipped and the flow still starts."}},"required":["phone"],"description":"Phone + country code with an optional display name."}],"description":"A single role assignee: email, phone (with country code), uniqueId for an existing member, or a structured object carrying a display name alongside the identity."}}],"description":"One assignee, or an array of assignees for a multi-assignee role."},"description":"Maps each role, by its `key`, its id or its name exactly as the template labels it, to the person or people to assign. Someone already in your organization is used. An email no one here has adds that person as an external user (or reactivates them), and the answer lists them under `addedUsers`; on a role internal users fill (a flow manager or meeting host role) it is refused with `400 ROLE_NEEDS_INTERNAL_USER` and no flow starts.","example":{"Preparer":{"email":"carol@example.com","name":"Carol"},"Reviewer":"dev@example.com"}},"customFields":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","minLength":1,"description":"The start field's `key` (not its `fieldId`).","example":"applicant_name"},"value":{"description":"A value of the field's type: text, a number, a list, or a table's rows. Name, Address, Phone and Currency fields take an object as a JSON string."}},"required":["key"],"additionalProperties":false},"description":"The new flow's start values, each field by its `key` (not its `fieldId`), as every start names them. Name, Address, Phone and Currency fields take an object as a JSON string; see the example.","example":[{"key":"applicant_name","value":"{\"firstName\":\"John\",\"lastName\":\"Doe\"}"},{"key":"applicant_address","value":"{\"street\":\"123 Main St\",\"street2\":\"\",\"city\":\"Denver\",\"state\":\"CO\",\"zip\":\"80202\",\"country\":\"US\"}"}]}},"additionalProperties":false,"description":"The body an incoming webhook accepts. Every field is optional, but send at least the roles and fields the flow needs."}}}},"responses":{"200":{"description":"The delivery was accepted, but the conditions didn't match, so no test run started.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"anyOf":[{"type":"object","properties":{"flowId":{"type":"string"},"idempotent":{"type":"boolean","enum":[true]},"message":{"type":"string"}},"required":["flowId","idempotent","message"]},{"type":"object","properties":{"status":{"type":"string","enum":["skipped"]},"message":{"type":"string"}},"required":["status","message"]}]}},"required":["success","data"]}}}},"201":{"description":"The test run started.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"flowId":{"type":"string"},"status":{"type":"string","enum":["started"]},"addedUsers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The person's user id (`usr_…`)."},"email":{"type":"string","description":"The email the delivery named them by."},"roleId":{"type":"string","description":"The role they hold on the new flow."},"reactivated":{"type":"boolean","description":"`true` when they were a deactivated external user, now active again."}},"required":["id","email","roleId","reactivated"],"additionalProperties":false},"description":"The people this delivery added to your organization as external users, or reactivated, because no one here had their email. Absent when it added no one."}},"required":["flowId","status"]}},"required":["success","data"]}}}},"400":{"description":"Refused: `VALIDATION_ERROR`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"`NOT_LISTENING`: nobody is listening for a test event (\"Not listening. Choose Listen for a test event first.\"). `WEBHOOK_ADDRESS_CHANGED`: the organization is served at another address now; send the delivery to `error.webhookBaseUrl` followed by the same path.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string","enum":["NOT_LISTENING","WEBHOOK_ADDRESS_CHANGED"]},"message":{"type":"string"},"webhookBaseUrl":{"type":"string","description":"With `WEBHOOK_ADDRESS_CHANGED`: the address to send this webhook to, followed by the same path."}},"required":["code","message"]}},"required":["success","error"]}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/webhooks/wait/{token}":{"post":{"tags":["Webhooks"],"summary":"Complete a Wait step","description":"Resumes a flow that is waiting at a Wait step. Call the Wait's unique callback URL, optionally with data that becomes the step's result. A token that is not a well-formed callback token (it was cut short or changed) returns `400 INVALID_TOKEN`.\n\n**Tokens:** none. The token in the callback URL is the credential.","security":[],"parameters":[{"schema":{"type":"string","description":"The Wait step's callback token."},"required":true,"description":"The Wait step's callback token.","name":"token","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":{}}}}},"responses":{"200":{"description":"The Wait step is complete.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."},"data":{"type":"object","properties":{"message":{"type":"string","description":"What happened, in plain words."},"flowId":{"type":"string","description":"The flow the step is on."},"stepExecutionId":{"type":"string","description":"The step run the call completed."}},"required":["message","flowId","stepExecutionId"],"additionalProperties":false,"description":"The step the call completed."}},"required":["success","data"],"additionalProperties":false}}}},"202":{"description":"Accepted, not applied: the flow is paused (`accepted_pending_resume`, applied when it resumes) or the callback could not be recorded (`not_recorded`, send it again).","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."},"data":{"type":"object","properties":{"message":{"type":"string","description":"What happened, in plain words."},"flowId":{"type":"string","description":"The flow the step is on."},"stepExecutionId":{"type":"string","description":"The step run the call was for."},"status":{"type":"string","enum":["accepted_pending_resume","not_recorded"],"description":"`accepted_pending_resume`: recorded, and applied when the flow resumes. `not_recorded`: nothing was recorded or applied; send the call again."}},"required":["message","flowId","stepExecutionId","status"],"additionalProperties":false,"description":"What happened to the call."}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"Refused: `INVALID_TOKEN`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/webhooks/grok-bot/{token}/files":{"post":{"tags":["Webhooks"],"summary":"Upload a file for a Grok Bot step","description":"Uploads a file for a Grok Bot step that is waiting. Then complete the step with `{ fileId }` for a declared file output; don't send the document as a string. The organization's file upload limit applies, not the 1 MB limit on the Complete body. A token that is not a well-formed callback token (it was cut short or changed) returns `400 INVALID_TOKEN`.\n\n**Tokens:** none. The Complete token in the URL is the credential.","security":[],"parameters":[{"schema":{"type":"string","description":"Grok Bot Complete token"},"required":true,"description":"Grok Bot Complete token","name":"token","in":"path"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","format":"binary","description":"The file."}}}}}},"responses":{"201":{"description":"The file is stored on this step.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"fileId":{"type":"string"},"name":{"type":"string"},"contentType":{"type":"string"}},"required":["fileId","name","contentType"]}},"required":["success","data"]}}}},"400":{"description":"The upload is not valid. The step stays open."},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/webhooks/grok-bot/{token}":{"post":{"tags":["Webhooks"],"summary":"Complete a Grok Bot step","description":"Completes an `AI_AGENT` step that Grok Bot accepted. A declared file field must be `{ fileId }` for a file uploaded with this token; a string is refused and the step stays open. A token that is not a well-formed callback token (it was cut short or changed) returns `400 INVALID_TOKEN`.\n\n**Tokens:** none. The Complete token in the URL is the credential.","security":[],"parameters":[{"schema":{"type":"string","description":"Grok Bot Complete token"},"required":true,"description":"Grok Bot Complete token","name":"token","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":{}}}}},"responses":{"200":{"description":"The step is complete, or its answer is recorded and waits for its review.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."},"data":{"type":"object","properties":{"message":{"type":"string","description":"What happened, in plain words."},"flowId":{"type":"string","description":"The flow the step is on."},"stepExecutionId":{"type":"string","description":"The step run the call completed."}},"required":["message","flowId","stepExecutionId"],"additionalProperties":false,"description":"The step the call completed."}},"required":["success","data"],"additionalProperties":false}}}},"202":{"description":"Accepted, not applied yet: recorded and applied later (`accepted_pending_resume`: the flow is paused and it applies when the flow resumes, or the Complete came back before Moxo finished recording that Grok Bot accepted the work and it applies in a moment), or the callback could not be recorded (`not_recorded`, send it again).","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."},"data":{"type":"object","properties":{"message":{"type":"string","description":"What happened, in plain words."},"flowId":{"type":"string","description":"The flow the step is on."},"stepExecutionId":{"type":"string","description":"The step run the call was for."},"status":{"type":"string","enum":["accepted_pending_resume","not_recorded"],"description":"`accepted_pending_resume`: recorded, and applied when the flow resumes. `not_recorded`: nothing was recorded or applied; send the call again."}},"required":["message","flowId","stepExecutionId","status"],"additionalProperties":false,"description":"What happened to the call."}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"The body is not valid. The step stays open."},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/templates/{id}/webhook-config/test":{"post":{"tags":["Webhooks"],"summary":"Send a test to an incoming webhook","description":"Sends one sample delivery through the template's incoming webhook, as **Send test** in the template builder does: the same conditions, mapping and checks a real delivery meets, against the draft. It starts a test flow that contacts nobody, isn't billed and isn't listed with real work, with every role given to you. Send your own `payload`, or leave it out and Moxo makes one with a sample value for each required start field. The delivery is listed in the webhook's delivery log, marked as a test.\n\nA payload the conditions skip answers `200` with status `skipped`. One the mapping can't use answers `400`, and a draft not ready for a test run answers its refusal. A template whose webhook was never set up answers `404`.\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":["object","null"],"properties":{"payload":{"type":"object","additionalProperties":{},"description":"The delivery to try, as the sender would post it. Leave it out for a sample one."}},"additionalProperties":false}}}},"responses":{"200":{"description":"The conditions didn't match, so no flow started.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."},"data":{"type":"object","properties":{"status":{"type":"string","enum":["skipped"],"description":"Always `skipped`: the conditions didn't match."},"message":{"type":"string","description":"What happened, in plain words."}},"required":["status","message"],"additionalProperties":false,"description":"Why no flow started."}},"required":["success","data"]}}}},"201":{"description":"The test flow started.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."},"data":{"type":"object","properties":{"flowId":{"type":"string","description":"The test flow the delivery started. It contacts nobody and isn't listed with real work."},"status":{"type":"string","enum":["started"],"description":"Always `started`."}},"required":["flowId","status"],"additionalProperties":false,"description":"The test flow."}},"required":["success","data"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-moxo-person-only":"PERSON_TOKEN_REQUIRED"}},"/v1/templates/{id}/outgoing-webhooks/{endpointId}/test":{"post":{"tags":["Webhooks"],"summary":"Send a test to an outgoing webhook","description":"Sends one test `flow.started` delivery to one of the template's saved outgoing webhook endpoints, as **Send test** in the template's notification settings does: to its saved address, signed with its signing secret (`X-Moxo-Signature`), with `\"test\": true` and the header `X-Moxo-Test: true`. You name the endpoint by its `id`, never an address: save the endpoint first (`update_settings` with `notifications.channelIntegrations.webhooks`). Nothing is stored. An endpoint that isn't saved answers `404`; an address your organization's outbound rules don't allow answers `422`; a signing secret that must be replaced answers `409 SECRET_NEEDS_REGENERATE` (replace it in the app). A signing secret is never returned here: an admin reveals or replaces it in the app, on the webhook's settings, and every reveal is recorded.\n\nA personal access token needs edit access to the template.\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":true,"name":"endpointId","in":"path"}],"responses":{"200":{"description":"What the receiver answered.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."},"data":{"allOf":[{"$ref":"#/components/schemas/WebhookTestResult"},{"description":"What the receiver answered, and what was sent."}]}},"required":["success","data"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Refused: `SECRET_NEEDS_REGENERATE`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"The request is well formed but can't be applied. `error.code` says why.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-moxo-person-only":"PERSON_TOKEN_REQUIRED"}},"/v1/organization/action-webhooks":{"get":{"tags":["Webhooks"],"summary":"List action webhooks","description":"The addresses your organization's actions are announced to (Settings › Defaults › Actions): each one's events and whether it is on. A signing secret is never returned here: an admin reveals or replaces it in the app, on the webhook's settings, and every reveal is recorded.\n\nA personal access token needs an organization admin, as the Defaults page does.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `actions:read`","security":[{"bearerAuth":["actions:read"]}],"responses":{"200":{"description":"The endpoints.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."},"data":{"type":"object","properties":{"endpoints":{"type":"array","items":{"$ref":"#/components/schemas/ActionWebhookEndpoint"},"description":"Every endpoint the organization keeps, in the order the Defaults page lists them."}},"required":["endpoints"],"additionalProperties":false,"description":"The organization's action endpoints."}},"required":["success","data"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"put":{"tags":["Webhooks"],"summary":"Set action webhooks","description":"Saves the whole list of action endpoints, as the Defaults page saves it: add an endpoint to create it, change one by its `id`, set `enabled` to turn it on or off, and leave one out to remove it. Up to 10, `https` only. A new endpoint gets its own signing secret. A signing secret is never returned here: an admin reveals or replaces it in the app, on the webhook's settings, and every reveal is recorded. The change reaches actions sent from now on; one already sent keeps the endpoints it was sent with. The change is recorded in the audit log.\n\nA personal access token needs an organization admin, as the Defaults page does.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `actions:write`","security":[{"bearerAuth":["actions:write"]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"endpoints":{"type":"array","items":{"$ref":"#/components/schemas/ActionWebhookEndpoint"},"maxItems":10,"description":"Every endpoint the organization keeps, up to 10. Add one to create it, change one by its `id`, set `enabled` to turn it on or off, and leave one out to remove it."}},"required":["endpoints"],"additionalProperties":false}}}},"responses":{"200":{"description":"The endpoints as saved.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."},"data":{"type":"object","properties":{"endpoints":{"type":"array","items":{"$ref":"#/components/schemas/ActionWebhookEndpoint"},"description":"Every endpoint the organization keeps, in the order the Defaults page lists them."}},"required":["endpoints"],"additionalProperties":false,"description":"The endpoints as saved."}},"required":["success","data"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/organization/action-webhooks/{endpointId}/test":{"post":{"tags":["Webhooks"],"summary":"Send a test to an action webhook","description":"Sends one test `action.sent` delivery to a saved endpoint: to its saved address, signed with its signing secret (`X-Moxo-Signature`), with `\"test\": true` and the header `X-Moxo-Test: true`. Nothing is stored. The answer says what the receiver answered. An endpoint that isn't saved answers `404`; an address your organization's outbound rules don't allow answers `422`; a signing secret that must be replaced before it can sign answers `409 SECRET_NEEDS_REGENERATE` (replace it in the app).\n\nA personal access token needs an organization admin, as the Defaults page does.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `actions:write`","security":[{"bearerAuth":["actions:write"]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"endpointId","in":"path"}],"responses":{"200":{"description":"What the receiver answered.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."},"data":{"allOf":[{"$ref":"#/components/schemas/WebhookTestResult"},{"description":"What the receiver answered, and what was sent."}]}},"required":["success","data"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Refused: `SECRET_NEEDS_REGENERATE`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"The request is well formed but can't be applied. `error.code` says why.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/reports/summary":{"get":{"tags":["Reports"],"deprecated":true,"summary":"Dashboard summary","description":"Returns organization-wide flow counts, step counts and progress indicators. **Deprecated.** Use `POST /v1/reports/query` for new integrations: it answers any reporting question from one catalog instead of a fixed response for each endpoint. This endpoint keeps its URL and response shape. The [changelog](/v1/changelog) lists which figures already come from its source.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `reports:read`","security":[{"bearerAuth":["reports:read"]}],"parameters":[{"schema":{"type":"string","description":"A preset time window, such as `week`, `month`, `quarter` or `last30`. Defaults to `week`."},"required":false,"description":"A preset time window, such as `week`, `month`, `quarter` or `last30`. Defaults to `week`.","name":"range","in":"query"},{"schema":{"type":"string","description":"Only this template."},"required":false,"description":"Only this template.","name":"templateId","in":"query"},{"schema":{"type":"string","description":"Only flows associated with this account."},"required":false,"description":"Only flows associated with this account.","name":"accountId","in":"query"}],"responses":{"200":{"description":"Summary metrics","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/ReportSummary"}},"required":["success","data"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/reports/flows/performance":{"get":{"tags":["Reports"],"deprecated":true,"summary":"Template performance","description":"Returns metrics for each template: completion rate, cycle time and overdue count. Send `templateId` to narrow it to one template and add `drillDown`, a breakdown by step. **Deprecated.** Use `POST /v1/reports/query` for new integrations: it answers any reporting question from one catalog instead of a fixed response for each endpoint. This endpoint keeps its URL and response shape. The [changelog](/v1/changelog) lists which figures already come from its source.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `reports:read`","security":[{"bearerAuth":["reports:read"]}],"parameters":[{"schema":{"type":"string","description":"Only this template. Also adds `drillDown` to the response."},"required":false,"description":"Only this template. Also adds `drillDown` to the response.","name":"templateId","in":"query"},{"schema":{"type":"string","description":"Only flows associated with this account."},"required":false,"description":"Only flows associated with this account.","name":"accountId","in":"query"},{"schema":{"type":"string","description":"A preset time window, such as `month`, `quarter` or `last30`. Ignored when both `from` and `to` are set."},"required":false,"description":"A preset time window, such as `month`, `quarter` or `last30`. Ignored when both `from` and `to` are set.","name":"range","in":"query"},{"schema":{"type":"string","description":"The first day of a custom window (`YYYY-MM-DD`). Requires `to`."},"required":false,"description":"The first day of a custom window (`YYYY-MM-DD`). Requires `to`.","name":"from","in":"query"},{"schema":{"type":"string","description":"The last day of a custom window (`YYYY-MM-DD`), included. Requires `from`."},"required":false,"description":"The last day of a custom window (`YYYY-MM-DD`), included. Requires `from`.","name":"to","in":"query"}],"responses":{"200":{"description":"Performance data","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/TemplatePerformanceResponse"}},"required":["success","data"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/reports/sla":{"get":{"tags":["Reports"],"deprecated":true,"summary":"SLA compliance","description":"Returns on-time and late completion rates across templates. **Deprecated.** Use `POST /v1/reports/query` for new integrations: it answers any reporting question from one catalog instead of a fixed response for each endpoint. This endpoint keeps its URL and response shape. The [changelog](/v1/changelog) lists which figures already come from its source.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `reports:read`","security":[{"bearerAuth":["reports:read"]}],"parameters":[{"schema":{"type":"string","description":"A preset time window, such as `week`, `month`, `quarter` or `last30`. Defaults to `week`."},"required":false,"description":"A preset time window, such as `week`, `month`, `quarter` or `last30`. Defaults to `week`.","name":"range","in":"query"},{"schema":{"type":"string","description":"Only this template."},"required":false,"description":"Only this template.","name":"templateId","in":"query"},{"schema":{"type":"string","description":"Only flows associated with this account."},"required":false,"description":"Only flows associated with this account.","name":"accountId","in":"query"}],"responses":{"200":{"description":"SLA metrics","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/SlaCompliance"}},"required":["success","data"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/reports/bottlenecks":{"get":{"tags":["Reports"],"deprecated":true,"summary":"Step performance","description":"Returns one ranking for each kind of work: steps done by people, AI steps, automations and waits on other systems. Also returns how the total time splits across them. Compare durations only within one kind. **Deprecated.** Use `POST /v1/reports/query` for new integrations: it answers any reporting question from one catalog instead of a fixed response for each endpoint. This endpoint keeps its URL and response shape. The [changelog](/v1/changelog) lists which figures already come from its source.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `reports:read`","security":[{"bearerAuth":["reports:read"]}],"parameters":[{"schema":{"type":"string","description":"A preset time window, such as `month`, `quarter` or `last30`. Ignored when both `from` and `to` are set."},"required":false,"description":"A preset time window, such as `month`, `quarter` or `last30`. Ignored when both `from` and `to` are set.","name":"range","in":"query"},{"schema":{"type":"string","description":"The first day of a custom window (`YYYY-MM-DD`). Requires `to`."},"required":false,"description":"The first day of a custom window (`YYYY-MM-DD`). Requires `to`.","name":"from","in":"query"},{"schema":{"type":"string","description":"The last day of a custom window (`YYYY-MM-DD`), included. Requires `from`."},"required":false,"description":"The last day of a custom window (`YYYY-MM-DD`), included. Requires `from`.","name":"to","in":"query"},{"schema":{"type":"string","description":"Only this template."},"required":false,"description":"Only this template.","name":"templateId","in":"query"},{"schema":{"type":"string","description":"Only flows associated with this account."},"required":false,"description":"Only flows associated with this account.","name":"accountId","in":"query"}],"responses":{"200":{"description":"Step performance by kind of work","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/StepPerformanceReport"}},"required":["success","data"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/reports/query":{"post":{"tags":["Reports"],"summary":"Query the reporting catalog","description":"Answers a batch of 1 to 24 report specs from the catalog that `GET /v1/reports/catalog` describes. Each spec names an entity, one or more metrics, and optional grouping dimensions and filters. A spec that fails on its own, such as one with a bad metric key or a template the caller can't read, reports its own `error` and `errorKind` in its result instead of failing the batch. Only when every spec in the batch fails is the request refused (`400` or `403`).\n\nA spec with `correlationSpec` correlates several data tables on shared axes instead of measuring one entity. Its `mode` decides which keys become rows. `\"left\"`, the default and what an omitted `mode` means, uses the anchor table's keys, so a key the anchor doesn't have is not a row. `\"full\"` uses the union of every table's keys, so a key in one table and missing from another is returned, with the missing side's measures `null`. Use `\"full\"` to find what didn't reconcile: with `\"left\"`, those rows are not in the result. `\"inner\"` is rejected. Both modes return `matchQuality`, which says what happened to every key.\n\nAn axis of type `\"temporal-proximity\"` (with `toleranceSeconds` and `joinTimezone`) matches each row to the nearest row within that many seconds either way, on the other axes' exact keys, instead of requiring the same time bucket. Every row of `dimensionalData` then has `match` (`exact`, `tolerance`, `unmatched` or `ambiguous`) and `matchDeltaSeconds`: the row's time minus its matched anchor row's, or `null` when there is no single distance. Several rows within one tolerance combine into one key, with their measures combined by that table's own aggregate (sums add, averages are weighted, nothing is multiplied), and `matchQuality.cardinality` reports how many rows combined. Matching runs from the anchor: every other table is matched to the nearest anchor row, so a different `anchorTableId` matches different rows and gives a different total. The first entry in the result's `warnings` says so, ahead of any truncation note. When two rows are equally near, the match is `ambiguous` and neither row is merged.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `reports:read`","security":[{"bearerAuth":["reports:read"]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"specs":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"dataSource":{"type":"string","enum":["summary","health","sla","flows","bottlenecks","members","assignees","pulse"]},"metric":{"type":"string","maxLength":64},"widgetType":{"type":"string","maxLength":64},"range":{"anyOf":[{"type":"string","enum":["today","week","month","quarter","year","last30","last90","7d","30d","90d","180d"]},{"type":"object","properties":{"start":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"ISO date string (YYYY-MM-DD)"},"end":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"ISO date string (YYYY-MM-DD)"}},"required":["start","end"]}]},"templateId":{"type":"string","maxLength":100},"accountId":{"type":"string","maxLength":100},"relationshipId":{"type":"string","maxLength":100},"key":{"type":"string","maxLength":120}},"required":["dataSource"]},{"type":"object","properties":{"entity":{"type":"string","minLength":1,"maxLength":64},"mode":{"type":"string","enum":["standard","cohort","funnel"]},"periods":{"type":"integer","minimum":1,"maximum":24},"metrics":{"type":"array","items":{"type":"string","minLength":1,"maxLength":64},"minItems":1,"maxItems":6},"dimensions":{"type":"array","items":{"type":"string","minLength":1,"maxLength":64},"maxItems":2},"filters":{"type":"object","properties":{"dateRange":{"anyOf":[{"type":"string","enum":["today","week","month","quarter","year","last30","last90","7d","30d","90d","180d"]},{"type":"object","properties":{"start":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"ISO date string (YYYY-MM-DD)"},"end":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"ISO date string (YYYY-MM-DD)"}},"required":["start","end"]}]},"templateId":{"type":"string","maxLength":100},"accountId":{"type":"string","maxLength":100},"relationshipId":{"type":"string","maxLength":100},"status":{"type":"array","items":{"type":"string","enum":["PENDING","AWAITING_HOST_SETUP","AWAITING_CONNECTION","AWAITING_BUNDLE","WAITING_FOR_ASSIGNEE","PREPARING","IN_PROGRESS","REVIEWING","PAUSED","COMPLETED","SKIPPED","CANCELLED","FAILED","SUPERSEDED"]}},"isOverdue":{"type":"boolean"},"stepName":{"type":"string","maxLength":200},"slaBreached":{"type":"boolean"},"dueWithinDays":{"type":"integer","minimum":1,"maximum":365},"stalledForDays":{"type":"integer","minimum":1,"maximum":365},"isStalled":{"type":"boolean"},"trackingReason":{"type":"string","enum":["STEP_FAILED","FLOW_OVERDUE","STEP_OVERDUE","STALLED","PROJECTED"]},"personType":{"type":"string","enum":["internal","external"]},"assignedToMe":{"type":"boolean"},"allTime":{"type":"boolean","enum":[true]},"ownScope":{"type":"boolean","enum":[true]},"customFields":{"type":"array","items":{"type":"object","properties":{"fieldId":{"type":"string"},"value":{"type":"string","minLength":1,"maxLength":500},"match":{"type":"string","enum":["contains","equals"]}},"required":["fieldId","value","match"]},"maxItems":10}}},"when":{"type":"string","enum":["started","completed","resolved","due","activated","cancelled"]},"compare":{"type":"object","properties":{"type":{"type":"string","enum":["previous_period","year_over_year","custom"]},"baselinePeriod":{"type":"object","properties":{"start":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"ISO date string (YYYY-MM-DD)"},"end":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"ISO date string (YYYY-MM-DD)"}},"required":["start","end"]}},"required":["type"]},"list":{"type":"object","properties":{"sortBy":{"type":"string","maxLength":64},"sortOrder":{"type":"string","enum":["asc","desc"]},"limit":{"type":"integer","minimum":1,"maximum":100}}},"key":{"type":"string","maxLength":120}},"required":["entity","metrics"]}]},"minItems":1,"maxItems":24}},"required":["specs"]}}}},"responses":{"200":{"description":"One result for each spec, in the order sent.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/ReportQueryResponse"}},"required":["success","data"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/reports/catalog":{"get":{"tags":["Reports"],"summary":"Get the reporting catalog","description":"Describes everything `POST /v1/reports/query` can answer: every entity the caller can read, with its metrics, dimensions, filters and time anchors, plus the fixed values a spec can set (`mode`, `compare`) and the limits a spec must stay within. Send `templateId` to add that template's flow fields as dimensions.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `reports:read`","security":[{"bearerAuth":["reports:read"]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":100,"description":"Only this template, with its flow fields added as dimensions."},"required":false,"description":"Only this template, with its flow fields added as dimensions.","name":"templateId","in":"query"}],"responses":{"200":{"description":"The reporting catalog.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/ReportCatalog"}},"required":["success","data"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/desks":{"get":{"tags":["Desks"],"summary":"List desks","description":"Returns the desks in your organization: shared queues a team picks work from. Use these ids to look up the `desk.id` on flows and steps.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `team:read`","security":[{"bearerAuth":["team:read"]}],"parameters":[{"schema":{"type":"string","description":"Part of the desk name, not case-sensitive."},"required":false,"description":"Part of the desk name, not case-sensitive.","name":"search","in":"query"}],"responses":{"200":{"description":"The desks.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"array","items":{"$ref":"#/components/schemas/DeskSummary"}}},"required":["success","data"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/desks/{id}":{"get":{"tags":["Desks"],"summary":"Get desk","description":"Returns the desk and its members.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `team:read`","security":[{"bearerAuth":["team:read"]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The desk.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/DeskDetail"}},"required":["success","data"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/conversations":{"get":{"tags":["Conversations"],"summary":"List conversations","description":"Lists group conversations and, by default, the flow chats in the Messages inbox, most recent activity first.\n\nSend `kind=group` for group conversations only, with no flow chats. `kind=flow` returns flow chats only. Leaving `kind` out, or `kind=all`, returns both.\n\nA personal access token sees exactly the chats its person sees in the Messages inbox, with unread counts. An organization API key sees every group conversation in the organization, with no unread count or role. It sees flow chats only when the key also has `chat:read`, the scope for the chat inside flows; without it, `kind=flow` returns 403 and other requests list group conversations only. `filter=unread` and `filter=managed_by_me` are a person's view and return 400 for an organization API key.\n\nPage with `cursor`: send the previous page's `nextCursor` as it is. A cursor this list didn't issue returns 400. A flow's chat history is on `GET /v1/flows/{id}/messages` (scope `chat:read`).\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `conversations:read`","security":[{"bearerAuth":["conversations:read"]}],"parameters":[{"schema":{"type":"string","maxLength":200,"description":"Text to find in the title or the last message, not case-sensitive."},"required":false,"description":"Text to find in the title or the last message, not case-sensitive.","name":"search","in":"query"},{"schema":{"type":"string","enum":["all","group","flow"],"description":"Which conversations to return: `group` for group conversations only, `flow` for flow chats only, or `all` for both. Defaults to `all`.","example":"group"},"required":false,"description":"Which conversations to return: `group` for group conversations only, `flow` for flow chats only, or `all` for both. Defaults to `all`.","name":"kind","in":"query"},{"schema":{"type":"string","enum":["all","unread","managed_by_me"],"description":"Chats with unread messages, or chats you manage. Needs a personal access token."},"required":false,"description":"Chats with unread messages, or chats you manage. Needs a personal access token.","name":"filter","in":"query"},{"schema":{"type":"boolean"},"required":false,"name":"includeArchived","in":"query"},{"schema":{"type":"string","enum":["mine","all"],"description":"A personal access token with View all conversations, on a plan that allows it, sends `all` for every group conversation. The default, `mine`, is the conversations they are in. An organization API key already lists every group conversation; `scope` does not change that."},"required":false,"description":"A personal access token with View all conversations, on a plan that allows it, sends `all` for every group conversation. The default, `mine`, is the conversations they are in. An organization API key already lists every group conversation; `scope` does not change that.","name":"scope","in":"query"},{"schema":{"type":"integer","exclusiveMinimum":0,"maximum":200,"description":"Items per page, up to 200. Defaults to 50."},"required":false,"description":"Items per page, up to 200. Defaults to 50.","name":"limit","in":"query"},{"schema":{"type":"string","description":"The previous page's `nextCursor`. Omit for the first page."},"required":false,"description":"The previous page's `nextCursor`. Omit for the first page.","name":"cursor","in":"query"}],"responses":{"200":{"description":"A page of conversations.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"array","items":{"$ref":"#/components/schemas/ConversationSummary"}},"pagination":{"type":"object","properties":{"nextCursor":{"type":["string","null"]},"limit":{"type":"integer"},"hasMore":{"type":"boolean"}},"required":["nextCursor","limit","hasMore"]}},"required":["success","data","pagination"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"tags":["Conversations"],"summary":"Create a group conversation","description":"Starts a group conversation. Requires Group Chat on the organization's plan. Each participant entry takes the `userId` or `email` of someone already in the organization; an entry that matches nobody returns 400, naming it.\n\nWith a personal access token, the token's person starts the conversation and becomes its manager, under the same rules as the app (a portal user may be limited to people they already work with, and anyone they may not add returns 403, whether or not that person exists).\n\nWith an organization API key, name the person on your team who starts it in `startedBy`: they become its manager. Without `startedBy` the response is `400 CONVERSATION_NEEDS_CREATOR`; with someone outside your team, `400 CREATOR_NOT_INTERNAL`. The conversation is recorded as started through your API key.\n\n**Products.** An organization with no Moxo product has read-only chats: a new conversation or message returns `403 FEATURE_DISABLED` with `error.feature: \"haiChat\"`. Reading still works.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `conversations:write`","security":[{"bearerAuth":["conversations:write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateConversation"}}}},"responses":{"201":{"description":"The new conversation.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/ConversationDetail"}},"required":["success","data"]}}}},"400":{"description":"Refused: `CONVERSATION_NEEDS_CREATOR`, `CREATOR_NOT_INTERNAL`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/conversations/unread-count":{"get":{"x-moxo-person-only":"ORG_KEY_NOT_SUPPORTED","tags":["Conversations"],"summary":"Count unread conversations","description":"Returns how many conversations have unread messages for the person behind the token. Unread is per person, not organization-wide.\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"The unread count.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"count":{"type":"integer"}},"required":["count"]}},"required":["success","data"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/conversations/{id}":{"get":{"tags":["Conversations"],"summary":"Get a group conversation","description":"Returns a group conversation and its participants. A flow id, or a conversation the token's person is not in, returns 404. An organization API key reads any group conversation in its organization, without a role or unread count.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `conversations:read`","security":[{"bearerAuth":["conversations:read"]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The conversation.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/ConversationDetail"}},"required":["success","data"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"x-moxo-person-only":"ORG_KEY_NOT_SUPPORTED","tags":["Conversations"],"summary":"Rename a conversation","description":"Changes the title. Only a manager of the conversation can rename it. The title it already has changes nothing, and posts no \"renamed\" line in the chat: the answer says `changed: false`. An organization API key gets 403 `ORG_KEY_NOT_SUPPORTED`: use the manager's personal access token.\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PatchConversation"}}}},"responses":{"200":{"description":"The conversation, as it is now.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."},"data":{"allOf":[{"$ref":"#/components/schemas/ConversationDetail"},{"description":"The conversation, as it is now."}]},"changed":{"type":"boolean","description":"`true` when this call changed what you asked it to. `false` when that was already so, and the call changed nothing of it."},"message":{"type":"string","description":"Only with `changed: false`: what was already so.","example":"Nothing changed: this person already holds this role."}},"required":["success","data","changed"],"additionalProperties":false}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"x-moxo-person-only":"ORG_KEY_NOT_SUPPORTED","tags":["Conversations"],"summary":"Delete a conversation","description":"Deletes the conversation for everyone. Only a manager of the conversation can delete it. An organization API key gets 403 `ORG_KEY_NOT_SUPPORTED`: use the manager's personal access token.\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]}},"required":["success"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/conversations/{id}/archive":{"post":{"x-moxo-person-only":"ORG_KEY_NOT_SUPPORTED","tags":["Conversations"],"summary":"Archive a conversation","description":"Only a manager of the conversation can do this. A conversation already archived stays as it was, with its archive time: the answer says `changed: false`. An organization API key gets 403 `ORG_KEY_NOT_SUPPORTED`: use the manager's personal access token.\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."},"changed":{"type":"boolean","description":"`true` when this call changed what you asked it to. `false` when that was already so, and the call changed nothing of it."},"message":{"type":"string","description":"Only with `changed: false`: what was already so.","example":"Nothing changed: this person already holds this role."}},"required":["success","changed"],"additionalProperties":false}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/conversations/{id}/unarchive":{"post":{"x-moxo-person-only":"ORG_KEY_NOT_SUPPORTED","tags":["Conversations"],"summary":"Unarchive a conversation","description":"Only a manager of the conversation can do this. A conversation that isn't archived stays as it was: the answer says `changed: false`. An organization API key gets 403 `ORG_KEY_NOT_SUPPORTED`: use the manager's personal access token.\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."},"changed":{"type":"boolean","description":"`true` when this call changed what you asked it to. `false` when that was already so, and the call changed nothing of it."},"message":{"type":"string","description":"Only with `changed: false`: what was already so.","example":"Nothing changed: this person already holds this role."}},"required":["success","changed"],"additionalProperties":false}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/conversations/{id}/join":{"post":{"x-moxo-person-only":"ORG_KEY_NOT_SUPPORTED","tags":["Conversations"],"summary":"Join a conversation","description":"Takes a seat in a group conversation you can read but are not in. Needs the View all conversations permission, on a plan that allows it. Already being in it changes nothing. An organization API key gets 403.\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"You are in the conversation.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always true on a success."},"data":{"allOf":[{"$ref":"#/components/schemas/ConversationDetail"},{"description":"The conversation, with you in it."}]}},"required":["success","data"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/conversations/{id}/participants":{"get":{"tags":["Conversations"],"summary":"List participants","description":"Lists the participants of a group conversation.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `conversations:read`","security":[{"bearerAuth":["conversations:read"]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Participants","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"array","items":{"$ref":"#/components/schemas/ConversationParticipant"}}},"required":["success","data"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"tags":["Conversations"],"summary":"Add participants","description":"Adds people to the conversation. Each entry takes the `userId` or `email` of someone already in the organization; an entry that matches nobody returns 400, naming it.\n\nWith a personal access token, its person must manage the conversation, under the same rules as the app. With an organization API key, your organization adds them: the conversation shows your organization as having added them, and the change is recorded against your API key, never a person. An archived conversation returns 409. Naming only people already in the conversation adds nobody: the answer says `changed: false`.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `conversations:write`","security":[{"bearerAuth":["conversations:write"]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddConversationParticipants"}}}},"responses":{"201":{"description":"Added","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."},"changed":{"type":"boolean","description":"`true` when this call changed what you asked it to. `false` when that was already so, and the call changed nothing of it."},"message":{"type":"string","description":"Only with `changed: false`: what was already so.","example":"Nothing changed: this person already holds this role."}},"required":["success","changed"],"additionalProperties":false}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict: the request can't be applied to the resource as it is now. `error.code` says why.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/conversations/{id}/participants/{userId}":{"delete":{"x-moxo-person-only":"ORG_KEY_NOT_SUPPORTED","tags":["Conversations"],"summary":"Remove a participant","description":"Removes one person from the conversation. Only a manager can do this. Someone not in the conversation is not removed: the answer says `changed: false`. An organization API key gets 403 `ORG_KEY_NOT_SUPPORTED`: use the manager's personal access token.\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","description":"The participant's user id."},"required":true,"description":"The participant's user id.","name":"userId","in":"path"}],"responses":{"200":{"description":"Removed","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."},"changed":{"type":"boolean","description":"`true` when this call changed what you asked it to. `false` when that was already so, and the call changed nothing of it."},"message":{"type":"string","description":"Only with `changed: false`: what was already so.","example":"Nothing changed: this person already holds this role."}},"required":["success","changed"],"additionalProperties":false}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"x-moxo-person-only":"ORG_KEY_NOT_SUPPORTED","tags":["Conversations"],"summary":"Change a participant's role","description":"Makes a participant a `manager` or a `member`. Only a manager can do this. The role they already have changes nothing: the answer says `changed: false`. An organization API key gets 403 `ORG_KEY_NOT_SUPPORTED`: use the manager's personal access token.\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","description":"The participant's user id."},"required":true,"description":"The participant's user id.","name":"userId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"role":{"type":"string","enum":["manager","member"]}},"required":["role"],"additionalProperties":false}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."},"changed":{"type":"boolean","description":"`true` when this call changed what you asked it to. `false` when that was already so, and the call changed nothing of it."},"message":{"type":"string","description":"Only with `changed: false`: what was already so.","example":"Nothing changed: this person already holds this role."}},"required":["success","changed"],"additionalProperties":false}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/conversations/{id}/leave":{"post":{"x-moxo-person-only":"ORG_KEY_NOT_SUPPORTED","tags":["Conversations"],"summary":"Leave a conversation","description":"Takes you out of a group conversation. For people on the team: someone outside the organization gets 403 `EXTERNAL_CANNOT_LEAVE`, and a direct chat answers 400 `DIRECT_CHAT`. Someone from your team has to stay: when you are the last one who can still be reached, the answer is 409 `LAST_TEAMMATE`. The owner names who owns the conversation next in `nextOwnerUserId` (400 `NEXT_OWNER_REQUIRED` without it, 400 `INVALID_OWNER` when that person is not a teammate in it); anyone else leaves it out (400 `NOT_THE_OWNER`). Not being in the conversation changes nothing: the answer says `changed: false`. An organization API key gets 403 `ORG_KEY_NOT_SUPPORTED`.\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":["object","null"],"properties":{"nextOwnerUserId":{"type":"string","minLength":1,"description":"Only when you are the owner, and then required: the teammate (`usr_…` id) who owns the conversation next. They must be in it and be on your team."}},"additionalProperties":false}}}},"responses":{"200":{"description":"Left","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."},"changed":{"type":"boolean","description":"`true` when this call changed what you asked it to. `false` when that was already so, and the call changed nothing of it."},"message":{"type":"string","description":"Only with `changed: false`: what was already so.","example":"Nothing changed: this person already holds this role."}},"required":["success","changed"],"additionalProperties":false}}}},"400":{"description":"Refused: `DIRECT_CHAT`, `INVALID_OWNER`, `NEXT_OWNER_REQUIRED`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Refused: `LAST_TEAMMATE`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/conversations/{id}/owner":{"put":{"x-moxo-person-only":"ORG_KEY_NOT_SUPPORTED","tags":["Conversations"],"summary":"Make someone the owner","description":"Hands the conversation to a teammate in it, who becomes its owner and a manager. Only the owner can do this (403 `NOT_THE_OWNER`); they stay a manager. Someone outside the organization, or a teammate who is not in it or can no longer be reached, is refused with 400 `INVALID_OWNER`. Naming the owner changes nothing: the answer says `changed: false`. An organization API key gets 403 `ORG_KEY_NOT_SUPPORTED`.\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"userId":{"type":"string","minLength":1,"description":"The teammate (`usr_…` id) who owns the conversation from now on. They must be in it and be on your team."}},"required":["userId"],"additionalProperties":false}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."},"changed":{"type":"boolean","description":"`true` when this call changed what you asked it to. `false` when that was already so, and the call changed nothing of it."},"message":{"type":"string","description":"Only with `changed: false`: what was already so.","example":"Nothing changed: this person already holds this role."}},"required":["success","changed"],"additionalProperties":false}}}},"400":{"description":"Refused: `INVALID_OWNER`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/conversations/{id}/feeds":{"get":{"tags":["Conversations"],"summary":"Get conversation feeds","description":"Returns the messages, files and actions of a **group** conversation in one list, newest first. File and action rows carry basic fields only: download files with Download file and read an action with Get action. Page with `cursor` (the previous page's `nextCursor`); rows that share a timestamp are never skipped. A cursor this feed didn't issue, or an unknown `types` value, returns 400. A flow's chat history is on `GET /v1/flows/{id}/messages` (`chat:read`).\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `conversations:read`","security":[{"bearerAuth":["conversations:read"]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"anyOf":[{"type":"string","enum":["message","file","action"]},{"type":"array","items":{"type":"string","enum":["message","file","action"]}}],"description":"Which rows to return, comma-separated or repeated: `message`, `file`, `action`. Defaults to all three. Any other value returns 400."},"required":false,"description":"Which rows to return, comma-separated or repeated: `message`, `file`, `action`. Defaults to all three. Any other value returns 400.","name":"types","in":"query"},{"schema":{"type":"string","description":"The previous page's `nextCursor`. Omit for the first page."},"required":false,"description":"The previous page's `nextCursor`. Omit for the first page.","name":"cursor","in":"query"},{"schema":{"type":"integer","exclusiveMinimum":0,"maximum":200,"description":"Items per page, up to 200. Defaults to 50."},"required":false,"description":"Items per page, up to 200. Defaults to 50.","name":"limit","in":"query"}],"responses":{"200":{"description":"A page of the feed.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"array","items":{"$ref":"#/components/schemas/ConversationFeedItem"}},"pagination":{"type":"object","properties":{"nextCursor":{"type":["string","null"]}},"required":["nextCursor"]}},"required":["success","data","pagination"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/conversations/{id}/messages":{"post":{"tags":["Conversations"],"summary":"Send a message","description":"Posts a message in a group conversation.\n\nWith a personal access token, the message is from the token's person, sent exactly as the app sends it (they must be in the conversation, and posting clears their own unsent drafts there). A mention id that matches nobody returns 400, naming it.\n\nWith an organization API key, the message is posted by your organization and labeled with its name, like a Send to conversation step. It can't reply in a thread or mention people (`parentMessageId` and `mentionedUserIds` return 400).\n\nAn archived conversation returns `409 CONVERSATION_UNAVAILABLE`, with either token.\n\nIn a conversation with an external user on WhatsApp, while the organization sends WhatsApp without links, a person's message with a web address returns `422 LINK_NOT_ALLOWED` and posts nothing.\n\nSend an `Idempotency-Key` to retry safely: a retry with the same key returns 201 with the original message and posts nothing.\n\n**Products.** An organization with no Moxo product has read-only chats: a new conversation or message returns `403 FEATURE_DISABLED` with `error.feature: \"haiChat\"`. Reading still works.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `conversations:write`","security":[{"bearerAuth":["conversations:write"]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":256,"pattern":"^[A-Za-z0-9_\\-:.]+$","description":"An optional key of up to 256 letters, digits, `-`, `_`, `:` or `.`; any other key is refused with `400 INVALID_IDEMPOTENCY_KEY` and nothing is posted. A retry with the same key within 10 minutes returns the original message instead of posting it twice."},"required":false,"description":"An optional key of up to 256 letters, digits, `-`, `_`, `:` or `.`; any other key is refused with `400 INVALID_IDEMPOTENCY_KEY` and nothing is posted. A retry with the same key within 10 minutes returns the original message instead of posting it twice.","name":"Idempotency-Key","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendConversationMessage"}}}},"responses":{"201":{"description":"The message: the new one, or the original one when this is a retry with the same `Idempotency-Key`.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/ConversationMessage"}},"required":["success","data"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Refused: `CONVERSATION_UNAVAILABLE`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"410":{"description":"The first result for this `Idempotency-Key` can no longer be returned, because what it created was deleted. Use a new key for the next attempt.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Refused: `LINK_NOT_ALLOWED`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"425":{"description":"A request with this `Idempotency-Key` is still running. Retry after `Retry-After` seconds. If the first request failed with a `5xx`, the key stays held for 10 minutes; to retry sooner, use a new key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"The first result for this `Idempotency-Key` couldn't be checked. Retry with the same key after a short wait. If it keeps happening, contact support with the `requestId`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"get":{"tags":["Conversations"],"summary":"List messages","description":"Lists the messages of a group conversation. The first page is the latest messages, and each `nextCursor` pages further back; within a page, messages run oldest to newest, the order the thread reads in. Rows that share a timestamp are never skipped. Same order and cursor as the SDK and the MCP tool `get_conversation` with `view: \"messages\"`. For messages, files and actions in one list, use Get conversation feeds.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `conversations:read`","security":[{"bearerAuth":["conversations:read"]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","description":"The previous page's `nextCursor`. Omit for the latest page."},"required":false,"description":"The previous page's `nextCursor`. Omit for the latest page.","name":"cursor","in":"query"},{"schema":{"type":"integer","exclusiveMinimum":0,"maximum":200,"description":"Items per page, up to 200. Defaults to 50."},"required":false,"description":"Items per page, up to 200. Defaults to 50.","name":"limit","in":"query"}],"responses":{"200":{"description":"A page of messages.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"array","items":{"$ref":"#/components/schemas/ConversationMessage"}},"pagination":{"type":"object","properties":{"nextCursor":{"type":["string","null"]}},"required":["nextCursor"]}},"required":["success","data","pagination"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/conversations/{id}/messages/{messageId}":{"delete":{"x-moxo-person-only":"ORG_KEY_NOT_SUPPORTED","tags":["Conversations"],"summary":"Delete a message","description":"Deletes a message; it stays in the thread as \"This message was deleted\". Its author or a manager of the conversation can do this. An organization API key gets 403 `ORG_KEY_NOT_SUPPORTED`: use their personal access token.\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":true,"name":"messageId","in":"path"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]}},"required":["success"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/conversations/{id}/read":{"post":{"x-moxo-person-only":"ORG_KEY_NOT_SUPPORTED","tags":["Conversations"],"summary":"Mark a conversation read","description":"Marks the conversation read for the token's person, up to `messageId` or, with no body, up to the latest message. A `messageId` that isn't a message in this conversation that the person can see returns 404.\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"messageId":{"type":["string","null"]}},"additionalProperties":false}}}},"responses":{"200":{"description":"The conversation is marked.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]}},"required":["success"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/conversations/{id}/unread":{"post":{"x-moxo-person-only":"ORG_KEY_NOT_SUPPORTED","tags":["Conversations"],"summary":"Mark a conversation unread","description":"Marks the conversation unread for the token's person, from `messageId` onward or, with no body, all of it. A `messageId` that isn't a message in this conversation that the person can see returns 404.\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"messageId":{"type":["string","null"]}},"additionalProperties":false}}}},"responses":{"200":{"description":"The conversation is marked.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]}},"required":["success"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/conversations/{id}/files":{"get":{"tags":["Conversations"],"summary":"List files","description":"Lists the files and folders shared in the conversation. Files in unsent drafts are not listed.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `conversations:read`","security":[{"bearerAuth":["conversations:read"]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The files and folders.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"files":{"type":"array","items":{"$ref":"#/components/schemas/ConversationFile"}},"folders":{"type":"array","items":{"$ref":"#/components/schemas/ConversationFolder"}}},"required":["files","folders"]}},"required":["success","data"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"tags":["Conversations"],"summary":"Upload a file","description":"Uploads one file in a single call. Send `multipart/form-data` with the file in a part named `file`, and optionally a text field `folderId` to put the file in a folder. The response describes the finished file. A file can be at most 100 MB, and a file that fails its virus check is refused. Your organization's upload rules apply too: a file over their size limit returns `413 FILE_TOO_LARGE`, and a kind of file they don't allow returns `415 UPLOAD_TYPE_NOT_ALLOWED`, with the kinds they allow in the message. A body that isn't `multipart/form-data` returns `415 UNSUPPORTED_MEDIA_TYPE`. With an organization API key, your organization shares the file and nobody is named as its uploader.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `conversations:write`","security":[{"bearerAuth":["conversations:write"]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","format":"binary","description":"The file to upload."},"folderId":{"type":"string","description":"A folder id from List files or Make a folder."}},"required":["file"]}}}},"responses":{"201":{"description":"The uploaded file.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/ConversationFile"}},"required":["success","data"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"413":{"description":"Refused: `FILE_TOO_LARGE`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Refused: `UNSUPPORTED_MEDIA_TYPE`, `UPLOAD_TYPE_NOT_ALLOWED`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/conversations/{id}/files/upload-init":{"post":{"tags":["Conversations"],"summary":"Get an upload link for a file","description":"Returns a signed upload link for one file, for a file too large to send in one call. `PUT` the bytes to `uploadUrl` with every header in `requiredHeaders`, then `POST` to `completionUrl` (no body): that finishes the file and starts its virus check. A file can be at most 2 GB, and counts toward your organization's storage (`402` when it is full).\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `conversations:write`","security":[{"bearerAuth":["conversations:write"]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConversationUploadInit"}}}},"responses":{"201":{"description":"The upload link.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success response."},"data":{"allOf":[{"$ref":"#/components/schemas/UploadEnvelope"},{"description":"The upload link. `PUT` the bytes to `uploadUrl` with every header in `requiredHeaders`, then `POST` to `completionUrl` with an empty body."}]}},"required":["success","data"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"The organization's plan or quota does not allow this now.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/conversations/{id}/files/{fileId}/complete":{"post":{"tags":["Conversations"],"summary":"Finish an upload","description":"Finishes a file uploaded to the link from Get an upload link, and starts its virus check: the `completionUrl` that call returned. A file whose bytes have not landed yet returns `409 UPLOAD_NOT_LANDED`; finish the `PUT`, then call again.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `conversations:write`","security":[{"bearerAuth":["conversations:write"]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":true,"name":"fileId","in":"path"}],"responses":{"202":{"description":"The file is being checked; it is listed once its virus check passes.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success response."},"data":{"type":"object","properties":{"fileId":{"type":"string","description":"The file's id."},"scanStatus":{"type":"string","description":"`pending` until the virus check finishes; a file already checked answers its result (`clean`)."}},"required":["fileId","scanStatus"],"description":"The file and where its virus check stands."}},"required":["success","data"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Refused: `UPLOAD_NOT_LANDED`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/conversations/{id}/files/{fileId}/download-url":{"get":{"tags":["Conversations"],"summary":"Download a file","description":"Returns short-lived links to download and preview the file. A file that didn't pass its virus check isn't available.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `conversations:read`","security":[{"bearerAuth":["conversations:read"]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":true,"name":"fileId","in":"path"}],"responses":{"200":{"description":"The download and preview links.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"url":{"type":"string"},"inlineUrl":{"type":["string","null"]},"fileName":{"type":"string"}},"required":["url","inlineUrl","fileName"]}},"required":["success","data"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/conversations/{id}/files/{fileId}":{"delete":{"x-moxo-person-only":"ORG_KEY_NOT_SUPPORTED","tags":["Conversations"],"summary":"Delete a file","description":"Removes the file from the conversation, under the same rules as the app. An organization API key gets 403 `ORG_KEY_NOT_SUPPORTED`: use a personal access token.\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":true,"name":"fileId","in":"path"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"id":{"type":"string"},"deleted":{"type":"boolean","enum":[true]}},"required":["id","deleted"]}},"required":["success","data"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/conversations/{id}/folders":{"post":{"x-moxo-person-only":"ORG_KEY_NOT_SUPPORTED","tags":["Conversations"],"summary":"Make a folder","description":"Makes a folder in the conversation's files, as **New folder** does in Moxo. Everyone in the conversation sees it. Put files in it with `folderId` when you upload them. A name already used beside it returns `409 DUPLICATE_FOLDER`.\n\nAnyone in the conversation can do this, as in Moxo; someone who isn't in it gets `404`, and an archived conversation can't be changed (`409 CONVERSATION_UNAVAILABLE`). Your plan must include group conversations (`403 FEATURE_DISABLED`). It is recorded as the token's person, so an organization API key gets `403 ORG_KEY_NOT_SUPPORTED`: use a personal access token.\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"The conversation."},"required":true,"description":"The conversation.","name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateConversationFolder"}}}},"responses":{"201":{"description":"The folder, as List files returns it.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success response."},"data":{"allOf":[{"$ref":"#/components/schemas/ConversationFolder"},{"description":"The folder."}]}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Refused: `CONVERSATION_UNAVAILABLE`, `DUPLICATE_FOLDER`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/conversations/{id}/folders/{folderId}":{"patch":{"x-moxo-person-only":"ORG_KEY_NOT_SUPPORTED","tags":["Conversations"],"summary":"Rename a folder","description":"Renames a folder in the conversation's files. A name already used beside it returns `409 DUPLICATE_FOLDER`, and a folder that isn't in this conversation returns `404`.\n\nAnyone in the conversation can do this, as in Moxo; someone who isn't in it gets `404`, and an archived conversation can't be changed (`409 CONVERSATION_UNAVAILABLE`). Your plan must include group conversations (`403 FEATURE_DISABLED`). It is recorded as the token's person, so an organization API key gets `403 ORG_KEY_NOT_SUPPORTED`: use a personal access token.\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"The conversation."},"required":true,"description":"The conversation.","name":"id","in":"path"},{"schema":{"type":"string","description":"The folder, as List files returns it."},"required":true,"description":"The folder, as List files returns it.","name":"folderId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RenameConversationFolder"}}}},"responses":{"200":{"description":"The folder, as List files returns it.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success response."},"data":{"allOf":[{"$ref":"#/components/schemas/ConversationFolder"},{"description":"The folder."}]}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Refused: `CONVERSATION_UNAVAILABLE`, `DUPLICATE_FOLDER`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"x-moxo-person-only":"ORG_KEY_NOT_SUPPORTED","tags":["Conversations"],"summary":"Remove a folder","description":"Removes a folder and every folder inside it from the conversation's files. The files in them are not deleted: they stay in the conversation, in no folder. A folder that isn't in this conversation returns `404`.\n\nAnyone in the conversation can do this, as in Moxo; someone who isn't in it gets `404`, and an archived conversation can't be changed (`409 CONVERSATION_UNAVAILABLE`). Your plan must include group conversations (`403 FEATURE_DISABLED`). It is recorded as the token's person, so an organization API key gets `403 ORG_KEY_NOT_SUPPORTED`: use a personal access token.\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"The conversation."},"required":true,"description":"The conversation.","name":"id","in":"path"},{"schema":{"type":"string","description":"The folder, as List files returns it."},"required":true,"description":"The folder, as List files returns it.","name":"folderId","in":"path"}],"responses":{"200":{"description":"The folder is gone.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success response."},"data":{"type":"object","properties":{"id":{"type":"string","description":"The folder that was removed."},"deleted":{"type":"boolean","enum":[true],"description":"Always `true`: the folder and the folders inside it are gone."}},"required":["id","deleted"],"additionalProperties":false,"description":"What was removed."}},"required":["success","data"],"additionalProperties":false}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Refused: `CONVERSATION_UNAVAILABLE`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/conversations/{id}/actions":{"get":{"tags":["Conversations"],"summary":"List actions","description":"Lists the actions sent in this conversation, newest first, paged with `cursor`. A flow id returns 404.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `conversations:read`","security":[{"bearerAuth":["conversations:read"]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","description":"The previous page's `nextCursor`. Omit for the first page."},"required":false,"description":"The previous page's `nextCursor`. Omit for the first page.","name":"cursor","in":"query"},{"schema":{"type":"integer","exclusiveMinimum":0,"maximum":200,"description":"Items per page, up to 200. Defaults to 50."},"required":false,"description":"Items per page, up to 200. Defaults to 50.","name":"limit","in":"query"}],"responses":{"200":{"description":"The actions.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"array","items":{"$ref":"#/components/schemas/ConversationActionSummary"}},"pagination":{"type":"object","properties":{"nextCursor":{"type":["string","null"]}},"required":["nextCursor"]}},"required":["success","data","pagination"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/conversations/{id}/actions/{actionId}":{"get":{"tags":["Conversations"],"summary":"Get action","description":"Returns one action in this conversation, however long ago it was sent. A flow id returns 404.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `conversations:read`","security":[{"bearerAuth":["conversations:read"]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":true,"name":"actionId","in":"path"}],"responses":{"200":{"description":"The action.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/ConversationActionDetail"}},"required":["success","data"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/step-types":{"get":{"tags":["Build templates"],"summary":"List step types","description":"Returns every step type, with whether your organization's plan includes it and, when it needs one, the app a person must connect first. Read one type's settings with `GET /v1/step-types/{type}`.\n\nA personal access token reads as its person, who needs permission to view templates. An organization API key reads with administrator permissions. A partner delegation key gets `403 PERSON_TOKEN_REQUIRED`.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `templates:read`","security":[{"bearerAuth":["templates:read"]}],"responses":{"200":{"description":"Every step type.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a 200 response."},"data":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","description":"The step type, as a step's `type` names it.","example":"REST_API"},"name":{"type":"string","description":"Its name in the template builder."},"category":{"type":"string","description":"The group the template builder lists it under."},"description":{"type":"string","description":"What a step of this type does."},"available":{"type":"boolean","description":"Whether your organization's plan includes it and it is switched on."},"unavailableReason":{"type":"string","description":"Why it is not available. Only when `available` is `false`."},"needsConnectedApp":{"type":"string","description":"The app a person must connect before a step of this type can run."}},"required":["type","name","category","description","available"]},"description":"Every step type."}},"required":["success","data"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/step-types/{type}":{"get":{"tags":["Build templates"],"summary":"Get a step type","description":"Returns what a step type does, its settings (the step's `config`) with your organization's plan applied, an example as changes you can send as they are, and its common mistakes. The settings include the ones step types share (name, description, assignees, due dates, monitors and the like), which this reference documents once as `StepSettings`; the type's own are its `StepSettings_<TYPE>` schema. For `EXTERNAL_APP`, send `app` to list one app's actions and their inputs. A type that does not exist returns `404 NOT_FOUND`. Follow the settings over any guide.\n\nA personal access token reads as its person, who needs permission to view templates. An organization API key reads with administrator permissions. A partner delegation key gets `403 PERSON_TOKEN_REQUIRED`.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `templates:read`","security":[{"bearerAuth":["templates:read"]}],"parameters":[{"schema":{"type":"string","description":"The step type, as `GET /v1/step-types` lists it.","example":"REST_API"},"required":true,"description":"The step type, as `GET /v1/step-types` lists it.","name":"type","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":64,"description":"For `EXTERNAL_APP`: one app's id, such as `hubspot`, to list that app's actions and their inputs."},"required":false,"description":"For `EXTERNAL_APP`: one app's id, such as `hubspot`, to list that app's actions and their inputs.","name":"app","in":"query"},{"schema":{"type":"string","enum":["concise","full"],"description":"`full` (the default): the settings as JSON Schema, the example step on its own and as one `add_step` change, and the rules every step follows. `concise`: each setting as one line with its type and description, and the example as changes; it leaves out `example`, `exampleChange` and `rules`, and adds `more`. Both list the settings step types share as well as the type's own."},"required":false,"description":"`full` (the default): the settings as JSON Schema, the example step on its own and as one `add_step` change, and the rules every step follows. `concise`: each setting as one line with its type and description, and the example as changes; it leaves out `example`, `exampleChange` and `rules`, and adds `more`. Both list the settings step types share as well as the type's own.","name":"detail","in":"query"}],"responses":{"200":{"description":"The step type.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a 200 response."},"data":{"type":"object","properties":{"type":{"type":"string","description":"The step type, as a step's `type` names it.","example":"REST_API"},"name":{"type":"string","description":"Its name in the template builder."},"category":{"type":"string","description":"The group the template builder lists it under."},"description":{"type":"string","description":"What a step of this type does."},"available":{"type":"boolean","description":"Whether your organization's plan includes it and it is switched on."},"unavailableReason":{"type":"string","description":"Why it is not available. Only when `available` is `false`."},"needsConnectedApp":{"type":"string","description":"The app a person must connect before a step of this type can run."},"settings":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"object","additionalProperties":{}}],"description":"The step's `config`: one line per setting, with its type and description, with `detail=concise`; JSON Schema with `detail=full`. It holds the settings step types share, which this reference documents once as `StepSettings`, and the type's own, documented as `StepSettings_<TYPE>` (such as `StepSettings_TODO`). Empty when the type is not available."},"example":{"type":["object","null"],"additionalProperties":{},"description":"With `detail=full`: a minimal step of this type that passes the settings schema."},"exampleChange":{"oneOf":[{"$ref":"#/components/schemas/Change_add_step"},{"$ref":"#/components/schemas/Change_update_step"},{"$ref":"#/components/schemas/Change_remove_step"},{"$ref":"#/components/schemas/Change_move_step"},{"$ref":"#/components/schemas/Change_reorder_steps"},{"$ref":"#/components/schemas/Change_update_form_fields"},{"$ref":"#/components/schemas/Change_update_paths"},{"$ref":"#/components/schemas/Change_add_role"},{"$ref":"#/components/schemas/Change_update_role"},{"$ref":"#/components/schemas/Change_remove_role"},{"$ref":"#/components/schemas/Change_add_milestone"},{"$ref":"#/components/schemas/Change_update_milestone"},{"$ref":"#/components/schemas/Change_remove_milestone"},{"$ref":"#/components/schemas/Change_add_field"},{"$ref":"#/components/schemas/Change_update_field"},{"$ref":"#/components/schemas/Change_remove_field"},{"$ref":"#/components/schemas/Change_update_template_info"},{"$ref":"#/components/schemas/Change_update_permissions"},{"$ref":"#/components/schemas/Change_update_flow_start"},{"$ref":"#/components/schemas/Change_update_due_dates"},{"$ref":"#/components/schemas/Change_update_step_statuses"},{"$ref":"#/components/schemas/Change_update_flow_monitors"},{"$ref":"#/components/schemas/Change_update_settings"},{"$ref":"#/components/schemas/Change_add_artifact"},{"$ref":"#/components/schemas/Change_update_artifact"},{"$ref":"#/components/schemas/Change_remove_artifact"},{"$ref":"#/components/schemas/Change_update_template_tags"},{"$ref":"#/components/schemas/Change_update_block_interface"},{"$ref":"#/components/schemas/Change_update_connection_policy"},{"$ref":"#/components/schemas/Change_update_custom_agents"},{"type":"null"}],"description":"With `detail=full`: the example as one `add_step` change."},"exampleChanges":{"type":["array","null"],"items":{"$ref":"#/components/schemas/Change"},"description":"The whole example as changes that apply as they are with `POST /v1/templates`: the roles, kickoff fields and earlier steps it needs, then the step. Replace any `<placeholder>` id first."},"outputs":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","description":"The key a reference reads it by: `${{ steps.<step>.fields.<key> }}`."},"name":{"type":"string","description":"Its name in the template builder."},"type":{"type":"string","description":"What kind of value it is, such as `TEXT`."}},"required":["key","name","type"]},"description":"The outputs a step of this type gives, as the example step's settings make them. A type whose outputs come from its own settings (a form's questions, an AI step's outputs) lists those of the example."},"outputsAreComplete":{"type":"boolean","description":"When `true`, `outputs` are everything a run writes, and publish refuses a reference to any other output of the step."},"commonMistakes":{"type":"array","items":{"type":"object","properties":{"mistake":{"type":"string","description":"What gets it wrong."},"whyWrong":{"type":"string","description":"Why, and what to do instead."}},"required":["mistake","whyWrong"]},"description":"Mistakes builders make with this type."},"guide":{"type":"string","description":"The product guide that covers this type in depth."},"rules":{"type":"array","items":{"type":"string"},"description":"With `detail=full`: rules every step follows, whatever its type."},"catalog":{"type":"object","additionalProperties":{},"description":"For `EXTERNAL_APP`: the apps with their connected accounts and actions, or with `app` that app's actions with their inputs and outputs."},"more":{"type":"string","description":"With `detail=concise`: what `detail=full` adds."}},"required":["type","name","category","description","available","settings","exampleChanges","outputs","outputsAreComplete","commonMistakes"],"description":"The step type."}},"required":["success","data"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/templates/examples":{"get":{"tags":["Build templates"],"summary":"Find example templates","description":"Describe the process you want to build and get the closest examples from Moxo's template gallery, each as a readable outline of its roles, steps, branches and deadlines. Send an example's `exampleId` as `fromExample` to `POST /v1/templates` to start a draft from it.\n\nA personal access token reads as its person, who needs permission to view templates. An organization API key reads with administrator permissions. A partner delegation key gets `403 PERSON_TOKEN_REQUIRED`.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `templates:read`","security":[{"bearerAuth":["templates:read"]}],"parameters":[{"schema":{"type":"string","minLength":2,"maxLength":500,"description":"The process you want to build, in a sentence. At least 2 characters.","example":"counterparty approval"},"required":true,"description":"The process you want to build, in a sentence. At least 2 characters.","name":"query","in":"query"}],"responses":{"200":{"description":"The closest examples.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a 200 response."},"data":{"type":"object","properties":{"query":{"type":"string","description":"The description, as sent."},"examples":{"type":"array","items":{"type":"object","properties":{"exampleId":{"type":"string","description":"Send it as `fromExample` to `POST /v1/templates` to start a draft from this example."},"name":{"type":"string","description":"The example's name."},"category":{"type":"string","description":"The gallery category it is in."},"description":{"type":"string","description":"What the process does."},"outline":{"type":"string","description":"The example as a readable outline: roles, steps, branches and deadlines."}},"required":["exampleId","name","category","description","outline"]},"description":"The closest examples from Moxo's template gallery, closest first."}},"required":["query","examples"],"description":"The closest examples."}},"required":["success","data"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/build-guides/search":{"get":{"tags":["Build templates"],"summary":"Search the guides","description":"Ask whether Moxo can do something, or how it handles it, before you design. Returns excerpts from Moxo's product guides and product knowledge, each with its title and source, about what your organization's plan includes. Nothing is generated: when nothing matches, `found` is `false`.\n\nA personal access token reads as its person, who needs permission to view templates. An organization API key reads with administrator permissions. A partner delegation key gets `403 PERSON_TOKEN_REQUIRED`.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `templates:read`","security":[{"bearerAuth":["templates:read"]}],"parameters":[{"schema":{"type":"string","minLength":2,"maxLength":500,"description":"What you want to know, such as \"can a step wait for a signature?\". At least 2 characters.","example":"approvals with escalation when a step is late"},"required":true,"description":"What you want to know, such as \"can a step wait for a signature?\". At least 2 characters.","name":"question","in":"query"}],"responses":{"200":{"description":"The matching excerpts.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a 200 response."},"data":{"type":"object","properties":{"question":{"type":"string","description":"The question, as asked."},"found":{"type":"boolean","description":"Whether anything matched. Nothing is generated: `false` means the guides do not cover it."},"answers":{"type":"array","items":{"type":"object","properties":{"title":{"type":"string","description":"The title of the page or area the excerpt is from."},"source":{"type":"string","enum":["wiki","developer","site","product"],"description":"Where it is from: the product guide (`wiki`), the API docs (`developer`), moxo.com (`site`) or product knowledge (`product`)."},"ref":{"type":"string","description":"The page or area to read next."},"excerpt":{"type":"string","description":"The matching text, as written."}},"required":["title","source","ref","excerpt"]},"description":"The best matches, best first, only about what your organization's plan includes."},"note":{"type":"string","description":"How to read the answers."}},"required":["question","found","answers","note"],"description":"The matching excerpts."}},"required":["success","data"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/build-guides":{"get":{"tags":["Build templates"],"summary":"List build guides","description":"Returns the build guides your organization can read: one per step type its plan includes (`step:<type>`), and guides on concepts, settings and publishing (`concept:<name>`, `settings:<area>`, `publish:<topic>`). Read one with `GET /v1/build-guides/{topic}`.\n\nA personal access token reads as its person, who needs permission to view templates. An organization API key reads with administrator permissions. A partner delegation key gets `403 PERSON_TOKEN_REQUIRED`.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `templates:read`","security":[{"bearerAuth":["templates:read"]}],"responses":{"200":{"description":"The topics.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a 200 response."},"data":{"type":"array","items":{"type":"object","properties":{"topic":{"type":"string","description":"The topic, as `GET /v1/build-guides/{topic}` takes it.","example":"step:rest_api"},"summary":{"type":"string","description":"What the guide covers."}},"required":["topic","summary"]},"description":"The topics."}},"required":["success","data"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/build-guides/{topic}":{"get":{"tags":["Build templates"],"summary":"Get a build guide","description":"Returns one build guide: a summary, examples checked against the settings schema, how it behaves when a flow runs, and common mistakes. A topic your organization cannot read, or that does not exist, returns `404 NOT_FOUND`. Follow a step type's settings (`GET /v1/step-types/{type}`) over any guide.\n\nA personal access token reads as its person, who needs permission to view templates. An organization API key reads with administrator permissions. A partner delegation key gets `403 PERSON_TOKEN_REQUIRED`.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `templates:read`","security":[{"bearerAuth":["templates:read"]}],"parameters":[{"schema":{"type":"string","description":"The topic, as `GET /v1/build-guides` lists it.","example":"step:rest_api"},"required":true,"description":"The topic, as `GET /v1/build-guides` lists it.","name":"topic","in":"path"}],"responses":{"200":{"description":"The guide.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a 200 response."},"data":{"type":"object","properties":{"topic":{"type":"string","description":"The topic."},"summary":{"type":"string","description":"What it is and when to use it."},"examples":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"What the example shows."},"snippet":{"description":"A step, ready to use in a change, checked against the step type's settings."},"notes":{"type":"string","description":"What to know about the example."}},"required":["name"]},"description":"Worked examples."},"edgeCases":{"type":"array","items":{"type":"object","properties":{"question":{"type":"string","description":"A question about how it behaves when a flow runs."},"answer":{"type":"string","description":"The answer."}},"required":["question","answer"]},"description":"How it behaves when a flow runs."},"commonMistakes":{"type":"array","items":{"type":"object","properties":{"mistake":{"type":"string","description":"What gets it wrong."},"whyWrong":{"type":"string","description":"Why, and what to do instead."}},"required":["mistake","whyWrong"]},"description":"Mistakes builders make."},"relatedTopics":{"type":"array","items":{"type":"string"},"description":"Other topics worth reading."}},"required":["topic","summary","examples","edgeCases","commonMistakes","relatedTopics"],"description":"The guide."}},"required":["success","data"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/templates/{id}/changes":{"post":{"tags":["Build templates"],"summary":"Change a template","description":"Applies a list of changes to the template's draft, as you. Live settings are the exception: permissions, start modes, notifications and reminders, the chat assistant and the cover image take effect immediately, including for running flows, and discarding the draft doesn't undo them. You need permission to change this template. Send the `draft.draftRevision` you last saw as `baseVersion`. If the template changed since then, the response is `409 VERSION_CONFLICT` with the current `draftRevision`, and nothing is saved. All or nothing: if any change is refused, nothing is saved and the response is `422` with every issue. A malformed change, such as an unknown change type or a missing or unknown field, returns `400 VALIDATION_FAILED` naming the field. Send `dryRun: true` to run the same checks without saving. An action's connected account must be one your organization has and of the app the action runs (a Stripe payment takes a Stripe account; a REST API or Webhook action takes a saved Secret or a signing account such as a Sumsub account): a change that sets another is refused (`422 STEP_CONNECTION_WRONG_APP` in `data.issues`); every action that runs one app (an app action, Collect payment, DocuSign, Adobe Acrobat Sign, Jotform, identity verification, a scheduler booking, a connected-app wait) names its account the same way, by id or by name, and an app not connected yet saves the action waiting for it, with `needsAPerson` naming the app and the link where a person connects it; an account since removed from your organization is `422 STEP_CONNECTION_FOREIGN`. A template that already holds a wrong account still takes other changes; publish refuses it. Nothing you send is quietly repaired: removing a step another step still reads is `422 STEP_STILL_READ` naming each reader (give `replacedBy`, or change or remove the readers in the same list), a `replacedBy` with no field for what a reader reads is `422 FIELD_NOT_ON_REPLACEMENT`, a setting a step or the template does not have is `422 UNKNOWN_SETTING`, a password or user name a person types into a step in Moxo (a web app's Basic auth) is `422 CREDENTIAL_NOT_ACCEPTED`, a stored file's address typed in where a step takes a file (send the `fileId` of a file uploaded to the step) is `422 STORAGE_KEY_NOT_ACCEPTED`, a branch's `paths`, a decision's `outcomes` or a loop's `steps` sent to `update_step` changed is `422 NESTED_STEPS_NOT_A_SETTING` (use `update_paths`, and `add_step` and its siblings for the steps inside), a question with a blank label is `422 FIELD_LABEL_REQUIRED`, an action named with only spaces is `422 STEP_NAME_REQUIRED`, an app action whose app or action the app catalog does not have is `422 EXTERNAL_APP_UNKNOWN_ACTION`, an app action input under a key its action does not take is `422 EXTERNAL_APP_UNDECLARED_INPUT` (a key the template already holds, sent back with its value unchanged, is not refused; it is removed when the template is saved), two questions sent with one `fieldId` is `422 FORM_FIELD_ID_DUPLICATE`, and an action whose type your organization's plan doesn't include is `422 FEATURE_NOT_ON_PLAN` (an action the template already has keeps its type). Nothing is added that you did not write either: a draft that is not complete yet (a Parallel path with no steps, an action nobody does, no name for new flows) is saved as you sent it, with `status: has_issues` and each gap in `issues`, and `fixedForYou` says anything the save stored differently. While someone else is editing the template in Moxo, the call answers `409 TEMPLATE_BEING_EDITED` and changes nothing: `error.editingBy` names them, and editing frees up after 5 minutes without activity. The editor's own token is never refused for this.\n\n**Who can call it.** A personal access token (`mxo_pat_...`) or a signed-in session builds as its person, with that person's permissions, and every change and publish is recorded as theirs. A template has owners, so building, changing and publishing one is a person's act: an organization API key gets `403 PERSON_TOKEN_REQUIRED` on every call that changes a template, and so does a partner delegation key. A key may still read templates and their files, check a change list, and read a document's fields. Building from code works on flow templates: a call on an action template answers `400 WRONG_TEMPLATE_KIND`.\n\n**Tokens:** personal access token","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"changeSchemaVersion":{"type":"number","enum":[1],"description":"The change format version. Only `1` is supported, and it is the default."},"baseVersion":{"type":"integer","minimum":0,"description":"The `draft.draftRevision` you last saw. If it is out of date, the request returns `409 VERSION_CONFLICT` with the current `draftRevision`."},"changes":{"type":"array","items":{"$ref":"#/components/schemas/Change"},"minItems":1,"maxItems":200,"description":"The changes, applied in order and saved all together, or not at all. Text in a change can read an earlier value with `${{ }}`, such as `${{ steps.intake.fields.email }}` or `${{ fields.contract_name }}`: a step, role or field by its id, a handle from this list, or its template file key. A reference written the older way (`{Intake / Email}`) is refused."},"dryRun":{"type":"boolean","description":"Checks the changes and returns the full response without saving. The same checks run, `saved` is `false` and the draft revision is unchanged. The `ids` are a preview."},"detail":{"type":"string","enum":["full","concise"],"description":"`full` (the default): `outline` is the whole template. `concise`: `outline` lists only the steps this call added or changed, with where they sit; read the whole outline with `GET /v1/templates/{id}/outline`."}},"required":["baseVersion","changes"],"additionalProperties":false}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/TemplateAuthoringResult"}},"required":["success","data"]}}}},"400":{"description":"Refused: `VALIDATION_FAILED`, `WRONG_TEMPLATE_KIND`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"The template changed since `baseVersion`.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[false],"description":"Always `false` on an error."},"error":{"type":"object","properties":{"code":{"type":"string","enum":["VERSION_CONFLICT"],"description":"The draft changed since `baseVersion`."},"message":{"type":"string","description":"What happened and what to do, in a sentence."}},"required":["code","message"],"description":"The error."},"draftRevision":{"type":"integer","description":"The draft revision now. Push again to see the new plan."}},"required":["success","error","draftRevision"]}}}},"422":{"description":"A change was refused and nothing was saved. `data` is the result, with every issue.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string","enum":["CHANGES_REFUSED"]},"message":{"type":"string"}},"required":["code","message"]},"data":{"$ref":"#/components/schemas/TemplateAuthoringResult"}},"required":["success","error","data"]}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-moxo-person-only":"PERSON_TOKEN_REQUIRED","security":[{"bearerAuth":[]}]}},"/v1/templates/{id}/check":{"post":{"description":"Runs every publish check on the draft, and checks each step's settings against its schema, without saving. `status` is `ready` when nothing blocks publishing; otherwise `has_issues`. `check` gives the same findings as levels, for CI: `result` is `OK` or `FAIL` (`FAIL` only when there is an error, including one the published version already had), and each finding has a code, a message and a JSON pointer to where it is. An id you picked from a connected app (a Jotform form, a DocuSign template, an Acrobat Sign library document, a scheduling page) is checked against that app: one not in the account is `422 PICKED_ID_NOT_FOUND`; when the app can't be reached it is the warning `PICKED_ID_UNCHECKED`.\n\n**Who can call it.** A personal access token (`mxo_pat_...`) or a signed-in session builds as its person, with that person's permissions, and every change and publish is recorded as theirs. A template has owners, so building, changing and publishing one is a person's act: an organization API key gets `403 PERSON_TOKEN_REQUIRED` on every call that changes a template, and so does a partner delegation key. A key may still read templates and their files, check a change list, and read a document's fields. Building from code works on flow templates: a call on an action template answers `400 WRONG_TEMPLATE_KIND`.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `templates:read`","security":[{"bearerAuth":["templates:read"]}],"tags":["Build templates"],"summary":"Check a template","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/TemplateAuthoringCheckResult"}},"required":["success","data"]}}}},"400":{"description":"Refused: `WRONG_TEMPLATE_KIND`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Refused: `PICKED_ID_NOT_FOUND`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/templates/{id}/outline":{"get":{"description":"Returns a readable outline of the whole template: how it starts, roles, milestones, deadlines, every step (including those inside paths, outcomes, loops and approval branches), integrations (Secrets by name) and outgoing webhooks, with the ids your next change needs (`stepId`, `pathId`, `parentStepId`, `roleId`). It reads the working copy, with its unpublished changes, because it is what a change is made from; `GET /v1/templates/{id}` reads the published copy.\n\n**Who can call it.** A personal access token (`mxo_pat_...`) or a signed-in session builds as its person, with that person's permissions, and every change and publish is recorded as theirs. A template has owners, so building, changing and publishing one is a person's act: an organization API key gets `403 PERSON_TOKEN_REQUIRED` on every call that changes a template, and so does a partner delegation key. A key may still read templates and their files, check a change list, and read a document's fields. Building from code works on flow templates: a call on an action template answers `400 WRONG_TEMPLATE_KIND`.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `templates:read`","security":[{"bearerAuth":["templates:read"]}],"tags":["Build templates"],"summary":"Get a template's outline","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"templateId":{"type":"string"},"name":{"type":"string"},"version":{"type":"integer","description":"The published version number."},"draftRevision":{"type":"integer","description":"How many times the draft has been saved. Send it as `baseVersion` with your next change. Left out for someone who may only start the template: they read the published version."},"status":{"type":"string"},"links":{"type":"object","properties":{"view":{"type":"string"},"edit":{"type":"string","description":"Where to edit it. Left out for someone who may only start the template."}},"required":["view"]},"outline":{"type":"string"}},"required":["templateId","name","version","status","links","outline"]}},"required":["success","data"]}}}},"400":{"description":"Refused: `WRONG_TEMPLATE_KIND`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/templates/{id}/file":{"get":{"description":"Guide: [Templates as files](/docs/guides/templates-as-files).\n\nThe template's draft as a readable `.yaml` file, to keep in a repository and review like code. Send `Accept: application/yaml` for the file itself. You need permission to change this template. The first pull gives each item a key made from its name; the keys stay when the item is renamed. `422 FILE_NOT_AVAILABLE` when part of the template can't be written as a file yet.\n\n**The file.** `apiVersion: moxo/v1`, `kind: Template`, then the template: roles, flow fields, milestones and steps with their settings. Each step, role, milestone, path, outcome, field, table column, deliverable and reviewer, preparer or advisor has a `key` you can read and write. A setting that names an item writes `@` and its key (`assignees: [{ roleId: \"@customer\" }]`); text reads an earlier value with `${{ }}` (`${{ steps.intake.fields.email }}`, `${{ fields.contract_name }}`, `${{ roles.customer.email }}`). No item ids. People are named by email, and someone you can't see in Moxo's people lists by their user id (`usr_…`); connections, agents, data tables and other templates by name (`@agent:Contract reviewer`; one whose name another shares with its id beside it, `@agent:Contract reviewer [id:<id>]`). A pushed file can be at most 1.5 MB. Secrets, live settings (who can start it, start modes, notifications, chat) and builder layout are not in the file. The file's first line names its JSON Schema (`https://developers.moxo.com/docs/schemas/template-file.v1.json`), so an editor checks it as you type. Same organization only: to copy a template to another organization, use its export.\n\n**Who can call it.** A personal access token (`mxo_pat_...`) or a signed-in session builds as its person, with that person's permissions, and every change and publish is recorded as theirs. A template has owners, so building, changing and publishing one is a person's act: an organization API key gets `403 PERSON_TOKEN_REQUIRED` on every call that changes a template, and so does a partner delegation key. A key may still read templates and their files, check a change list, and read a document's fields. Building from code works on flow templates: a call on an action template answers `400 WRONG_TEMPLATE_KIND`.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `templates:read`","security":[{"bearerAuth":["templates:read"]}],"tags":["Build templates"],"summary":"Get a template as a file","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The file","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on success."},"data":{"$ref":"#/components/schemas/TemplateFile"}},"required":["success","data"]}},"application/yaml":{"schema":{"type":"string"}}}},"400":{"description":"Refused: `WRONG_TEMPLATE_KIND`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"This template can't be written as a file. Nothing was read.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[false],"description":"Always `false` on an error."},"error":{"type":"object","properties":{"code":{"type":"string","enum":["FILE_NOT_AVAILABLE"],"description":"Why the file can't be made."},"message":{"type":"string","description":"What is wrong and what to do, in a sentence."}},"required":["code","message"],"description":"The error."}},"required":["success","error"]}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"put":{"tags":["Build templates"],"summary":"Push a template file","description":"Guide: [Templates as files](/docs/guides/templates-as-files).\n\nCompares the file with the template's draft and makes the difference as a change list, through the same checks as `POST /v1/templates/{id}/changes`. **A dry run unless `apply: true`:** the answer is the plan (`changes`) and what it would do (`result`), and nothing is saved. A key the template does not have is a new item; a key that is gone is a removed item; to rename a key, write the old one on `renamedFrom`. A difference no change can make is refused by name. A push never changes a published field's key and confirms no Send to conversation pin: a person confirms those in the builder. `422 FILE_REFUSED` lists where the file is wrong; `422 CHANGES_REFUSED` lists what the changes would break; `422 FILE_NOT_AVAILABLE` as on a pull; `409 VERSION_CONFLICT` when the template's content changed since the revision the file was pulled at (its `revision:` line, which decides; `baseVersion` only for a file with none, and a `baseVersion` that differs from the line is `400 VALIDATION_ERROR`): `changedSince` lists what changed (an owner hand-off is not a change). Pull it again, make your change in that file, then push it, a dry run included; `409 REVISION_REQUIRED` for a file with no revision. `overwrite: true` pushes the file as it is, undoing changes made since that it does not have. A rename (`renamedFrom`) is a change like any other, and every change is in `changes`. After a push that saves, `draftRevision` is the new revision. While someone else is editing the template in Moxo, the call answers `409 TEMPLATE_BEING_EDITED` and changes nothing: `error.editingBy` names them, and editing frees up after 5 minutes without activity. The editor's own token is never refused for this.\n\n**The file.** `apiVersion: moxo/v1`, `kind: Template`, then the template: roles, flow fields, milestones and steps with their settings. Each step, role, milestone, path, outcome, field, table column, deliverable and reviewer, preparer or advisor has a `key` you can read and write. A setting that names an item writes `@` and its key (`assignees: [{ roleId: \"@customer\" }]`); text reads an earlier value with `${{ }}` (`${{ steps.intake.fields.email }}`, `${{ fields.contract_name }}`, `${{ roles.customer.email }}`). No item ids. People are named by email, and someone you can't see in Moxo's people lists by their user id (`usr_…`); connections, agents, data tables and other templates by name (`@agent:Contract reviewer`; one whose name another shares with its id beside it, `@agent:Contract reviewer [id:<id>]`). A pushed file can be at most 1.5 MB. Secrets, live settings (who can start it, start modes, notifications, chat) and builder layout are not in the file. The file's first line names its JSON Schema (`https://developers.moxo.com/docs/schemas/template-file.v1.json`), so an editor checks it as you type. Same organization only: to copy a template to another organization, use its export.\n\n**Who can call it.** A personal access token (`mxo_pat_...`) or a signed-in session builds as its person, with that person's permissions, and every change and publish is recorded as theirs. A template has owners, so building, changing and publishing one is a person's act: an organization API key gets `403 PERSON_TOKEN_REQUIRED` on every call that changes a template, and so does a partner delegation key. A key may still read templates and their files, check a change list, and read a document's fields. Building from code works on flow templates: a call on an action template answers `400 WRONG_TEMPLATE_KIND`.\n\n**Tokens:** personal access token","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"file":{"type":"string","minLength":1,"maxLength":1572864,"description":"The template file, as a pull returns it, with your edits. At most 1.5 MB."},"apply":{"type":"boolean","description":"Save the changes. Without it the push is a dry run: the answer is the plan, and nothing is saved."},"baseVersion":{"type":"integer","minimum":0,"description":"The draft revision the file was pulled at, only for a file with no `revision:` line. A file's own `revision:` line decides: a `baseVersion` that differs from it is refused (400 `VALIDATION_ERROR`). A file from an older revision is refused (409 `VERSION_CONFLICT`, with what changed since) when the template's content changed since; pull again and push your change from that file."},"overwrite":{"type":"boolean","description":"The file replaces the template as it is now, whatever changed since it was pulled (changes made since that the file does not have are undone). Without it, a file from an older revision, or with no `revision:` line, is refused (409)."},"confirmRemoveAllSteps":{"type":"boolean","description":"Confirms a file that removes every action from the template. Without it, such a push is refused with the issue `REMOVES_EVERY_STEP`, and `changes` lists the removals."}},"required":["file"],"additionalProperties":false}}}},"responses":{"200":{"description":"The plan, and what it did or would do","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on success."},"data":{"$ref":"#/components/schemas/TemplateFilePushResult"}},"required":["success","data"]}}}},"400":{"description":"Refused: `VALIDATION_ERROR`, `WRONG_TEMPLATE_KIND`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"The template changed since the file was pulled, or the file says no revision.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[false],"description":"Always `false` on an error."},"error":{"type":"object","properties":{"code":{"type":"string","enum":["VERSION_CONFLICT","REVISION_REQUIRED"],"description":"`VERSION_CONFLICT`: the template changed since the file's revision. `REVISION_REQUIRED`: the file has no `revision:` line and no `baseVersion` came with it."},"message":{"type":"string","description":"What happened and what to do, in a sentence."}},"required":["code","message"],"description":"The error."},"draftRevision":{"type":"integer","description":"The draft revision now. Pull the file again to push from it."},"fileRevision":{"type":"integer","description":"The revision the file was pulled at."},"changedSince":{"type":"array","items":{"type":"object","properties":{"revision":{"type":"integer","description":"The draft revision this change made."},"change":{"type":"string","enum":["edited","published","discarded changes"],"description":"What it was."},"at":{"type":"string","description":"When, as an ISO 8601 time."}},"required":["revision","change","at"]},"description":"What changed the template since the file's revision, oldest first. Left out when the revisions since can't all be read."}},"required":["success","error","draftRevision"]}}}},"422":{"description":"The file, or the changes it makes, were refused. Nothing was saved.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[false],"description":"Always `false` on an error."},"error":{"type":"object","properties":{"code":{"type":"string","enum":["FILE_REFUSED","CHANGES_REFUSED","FILE_NOT_AVAILABLE"],"description":"What was refused: the file, the changes it makes, or the template as a file."},"message":{"type":"string","description":"What is wrong and what to do, in a sentence."}},"required":["code","message"],"description":"The error."},"data":{"allOf":[{"$ref":"#/components/schemas/TemplateFilePushResult"},{"description":"The plan, with every issue: `issues` for the file, `result.issues` for the changes."}]}},"required":["success","error"]}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-moxo-person-only":"PERSON_TOKEN_REQUIRED","security":[{"bearerAuth":[]}]}},"/v1/templates/{id}/draft":{"delete":{"tags":["Build templates"],"summary":"Discard unpublished changes","description":"Discards the template's unpublished changes, so the draft is the published version again. The body is optional: a plain `DELETE` discards your own changes. You need permission to change this template. A template that was never published, or has no unpublished changes, returns `409 NOTHING_TO_DISCARD`. When other people also have unpublished changes, it returns `409 OTHER_PEOPLES_CHANGES` unless you send `includeOtherPeoplesChanges: true`. While someone else is editing the template in Moxo, the call answers `409 TEMPLATE_BEING_EDITED` and changes nothing: `error.editingBy` names them, and editing frees up after 5 minutes without activity. The editor's own token is never refused for this.\n\n**Who can call it.** A personal access token (`mxo_pat_...`) or a signed-in session builds as its person, with that person's permissions, and every change and publish is recorded as theirs. A template has owners, so building, changing and publishing one is a person's act: an organization API key gets `403 PERSON_TOKEN_REQUIRED` on every call that changes a template, and so does a partner delegation key. A key may still read templates and their files, check a change list, and read a document's fields. Building from code works on flow templates: a call on an action template answers `400 WRONG_TEMPLATE_KIND`.\n\n**Tokens:** personal access token","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"scope":{"type":"string","enum":["session","all"],"description":"Which unpublished changes to discard, as the builder offers: `all` (the default) returns the draft to the published version. `session` takes back only the changes made under this request's `X-Moxo-Edit-Session` header (send the same header with your changes); none sent, or nothing it changed, discards nothing."},"includeOtherPeoplesChanges":{"type":"boolean","description":"Also discard unpublished changes other people made that this discard would take. Without it, the request returns `409 OTHER_PEOPLES_CHANGES` when there are any."}},"additionalProperties":false}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/TemplateAuthoringResult"}},"required":["success","data"]}}}},"400":{"description":"Refused: `WRONG_TEMPLATE_KIND`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Refused: `NOTHING_TO_DISCARD`, `OTHER_PEOPLES_CHANGES`, `TEMPLATE_BEING_EDITED`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-moxo-person-only":"PERSON_TOKEN_REQUIRED","security":[{"bearerAuth":[]}]}},"/v1/templates/{id}/test-runs":{"post":{"x-moxo-person-only":"PERSON_TOKEN_REQUIRED","tags":["Build templates"],"summary":"Start a test run","description":"Starts a test run of the current draft, published or not: the same run as **Test run** in the template builder. It is a real flow, kept out of live work and reports, and not billed. `GET /v1/flows` never lists it: read it with `GET /v1/flows/{id}`, by the `flowId` this call returns. Every role you don't name in `roleAssignments` is given to you, so you get each step by email. You need permission to run this template, and the organization's hourly limit on test runs applies (`429`). Returns the run's link. Send an `Idempotency-Key` so a retry never starts a second run.\n\nA test run's emails, texts, webhooks, API calls and app actions really go out, so you can see an integration work. Each one says it is a test: an email subject and a text start with `[TEST]`; a webhook delivery, a Webhook step's or Step Monitor's POST carries `\"test\": true` in its body; and every webhook, API call and app action request carries the header `X-Moxo-Test: true`.\n\nSend `simulate: true` to start a Walkthrough instead: the steps run as yours, and every outside call is simulated, so nothing leaves Moxo. Its `link` opens the run in Moxo, where you do each action signed in as yourself; it is never a magic link. It needs Walkthrough on for your organization (`403 FEATURE_DISABLED` otherwise).\n\nA test run walks a person through the steps, so it needs a personal access token: an organization API key gets `403 PERSON_TOKEN_REQUIRED`.\n\nA test run needs the draft complete, as publishing does. A draft that is not (a Parallel path with no steps, a step nobody does) is refused with `422 TEMPLATE_NOT_READY` and `issues`: each gap, where it is and how to fix it. Nothing starts.\n\n**Why its answer is not a flow.** `POST /v1/templates/{id}/start` answers the flow it started, as `GET /v1/flows/{id}` reads it. A test run answers `{ flowId, name, link, message, simulated }` instead: the run is kept out of flow lists and reads you would act on, and what you need from it is the link that opens it, whether it is a Walkthrough, and what to do next. Read the run itself with `GET /v1/flows/{flowId}`.\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":256,"pattern":"^[A-Za-z0-9_\\-:.]+$","description":"An optional key that makes this request safe to retry. Send a new UUID for each request. A key is up to 256 letters, digits, `-`, `_`, `:` or `.`; any other key is refused with `400 INVALID_IDEMPOTENCY_KEY` and nothing runs. A retry with the same key within 10 minutes returns the first response and changes nothing again. After 10 minutes, the same key runs the request again, so use a new key for a late retry. See Idempotency in the Introduction.","example":"6f2c4a5e-3b8d-4c7f-9a1e-2d6b8e0f4c5a"},"required":false,"description":"An optional key that makes this request safe to retry. Send a new UUID for each request. A key is up to 256 letters, digits, `-`, `_`, `:` or `.`; any other key is refused with `400 INVALID_IDEMPOTENCY_KEY` and nothing runs. A retry with the same key within 10 minutes returns the first response and changes nothing again. After 10 minutes, the same key runs the request again, so use a new key for a late retry. See Idempotency in the Introduction.","name":"Idempotency-Key","in":"header"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"roleAssignments":{"type":"array","items":{"type":"object","properties":{"role":{"type":"string","minLength":1,"description":"A role id or name on the template."},"userId":{"type":"string","minLength":1,"description":"A person in this organization."}},"required":["role","userId"],"additionalProperties":false},"maxItems":100,"description":"People for named roles. Every role you do not name is assigned to you."},"customFields":{"type":"array","items":{"$ref":"#/components/schemas/CustomFieldValueInput"},"description":"Start form answers, each field by its `key`, as `POST /v1/templates/{id}/start` takes them."},"simulate":{"type":"boolean","description":"`true` starts a Walkthrough instead of a test run: the steps run, and every email, text, webhook, API call and app action is simulated, so nothing leaves Moxo. Every role is yours, so it takes no `roleAssignments` (`400 VALIDATION_FAILED`). Needs Walkthrough on for your organization (`403 FEATURE_DISABLED` otherwise)."}},"additionalProperties":false}}}},"responses":{"201":{"description":"Started","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"flowId":{"type":"string"},"name":{"type":"string"},"link":{"type":"string","description":"Opens the run in Moxo. For a Walkthrough too: you do each action there as yourself. It is never a magic link, so the answer is safe to replay and to show."},"message":{"type":"string"},"simulated":{"type":"boolean","description":"`true` for a Walkthrough: nothing it does leaves Moxo. `false` for a test run: its emails and calls really go out, marked as a test."}},"required":["flowId","name","link","message","simulated"]}},"required":["success","data"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Refused: `TEMPLATE_NOT_READY`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/templates/{id}/steps/{stepId}/attachments/upload-init":{"post":{"tags":["Build templates"],"summary":"Get an upload link for a step's file","description":"Returns a signed upload link for one file on a template step. `PUT` the bytes to `uploadUrl` with every header in `requiredHeaders`; when `completionUrl` is present, `POST` to it after the `PUT`. Files are scanned for viruses after upload. With `slotKind: \"document\"` (the default when `slotKind` is left out, as MCP `get_upload_link` defaults it), the file is the step's own file: the PDF to sign or review, the PDF a PDF form or a Prepare document step fills (a PDF), the template an Update spreadsheet step fills (`.xlsx` or `.csv`), the page a web app step shows (a self-contained `.html` file), or a collaboration document. A file of another kind is refused with `415 UNSUPPORTED_FILE_TYPE` (a collaboration answers `422 DOC_COLLAB_FILE_TYPE_NOT_ACCEPTED`). Then send the change `{ \"op\": \"update_step\", \"stepId\": \"<stepId>\", \"fields\": { \"document\": { \"ref\": \"<fileId>\" } } }` to the draft (for a collaboration, set the document's `ref` in `fields.collaboration.documents`), and Moxo reads the file as the builder does: the PDF's fields, the workbook, the page's answer fields. A step that reads its file waits for the virus scan, so a change sent too early is refused with the issue `FILE_SCANNING`; send it again a few seconds later. With `slotKind: \"reference\"`, the file is reference material people read: it is added to the step in the template's draft (the draft's `definitionVersion` moves), and new flows get it once the template is published. The step must be in the draft, or the request is refused with `404 STEP_NOT_FOUND`. A step with no file of its own returns `422 NO_DOCUMENT_SLOT` for `slotKind: \"document\"`. You need permission to change the template.\n\n**Who can call it.** A personal access token (`mxo_pat_...`) or a signed-in session builds as its person, with that person's permissions, and every change and publish is recorded as theirs. A template has owners, so building, changing and publishing one is a person's act: an organization API key gets `403 PERSON_TOKEN_REQUIRED` on every call that changes a template, and so does a partner delegation key. A key may still read templates and their files, check a change list, and read a document's fields. Building from code works on flow templates: a call on an action template answers `400 WRONG_TEMPLATE_KIND`.\n\n**Tokens:** personal access token","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":true,"name":"stepId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"fileName":{"type":"string","minLength":1,"maxLength":500},"fileSize":{"type":"integer","exclusiveMinimum":0,"maximum":2147483648,"description":"The file's size in bytes, at most 2 GB."},"mimeType":{"type":"string","minLength":1,"maxLength":255},"slotKind":{"type":"string","enum":["document","reference"],"default":"reference","description":"`reference` (the default): a file people read beside the step. `document`: the step's own file (a step with none answers `422 NO_DOCUMENT_SLOT`). Send it: MCP `get_upload_link` uploads the step's own file by default."}},"required":["fileName","fileSize","mimeType"],"additionalProperties":false}}}},"responses":{"201":{"description":"Upload link created","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/UploadEnvelope"}},"required":["success","data"]}}}},"400":{"description":"Refused: `WRONG_TEMPLATE_KIND`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Refused: `UNSUPPORTED_FILE_TYPE`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"The step has no file of its own: `NO_DOCUMENT_SLOT`.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[false],"description":"Always `false` on a refusal."},"error":{"type":"object","properties":{"code":{"type":"string","enum":["NO_DOCUMENT_SLOT"],"description":"Why the file can't be the step's own file."},"message":{"type":"string","description":"What happened and what to do, in plain words."}},"required":["code","message"],"description":"The refusal."}},"required":["success","error"]}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-moxo-person-only":"PERSON_TOKEN_REQUIRED","security":[{"bearerAuth":[]}]}},"/v1/templates/{id}/steps/{stepId}/attachments/{fileId}":{"delete":{"tags":["Build templates"],"summary":"Remove a file from a step","description":"Removes one file from a template step in the template's draft: the step's attachment, a connector input's file, or an image in its description. The published version keeps the file until the template is published again, and running flows keep theirs. A file the step does not name answers `404`. It doesn't remove the step's document: to change the document, set a new one with a change. You need permission to change the template.\n\n**Who can call it.** A personal access token (`mxo_pat_...`) or a signed-in session builds as its person, with that person's permissions, and every change and publish is recorded as theirs. A template has owners, so building, changing and publishing one is a person's act: an organization API key gets `403 PERSON_TOKEN_REQUIRED` on every call that changes a template, and so does a partner delegation key. A key may still read templates and their files, check a change list, and read a document's fields. Building from code works on flow templates: a call on an action template answers `400 WRONG_TEMPLATE_KIND`.\n\n**Tokens:** personal access token","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":true,"name":"stepId","in":"path"},{"schema":{"type":"string"},"required":true,"name":"fileId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"id":{"type":"string"},"removed":{"type":"boolean","enum":[true],"description":"Always `true`: the file is off the step in the draft. The file itself is kept for the published version and running flows."},"deleted":{"type":"boolean","enum":[true],"description":"Deprecated: the same as `removed`. It goes in the next release; read `removed`.","deprecated":true}},"required":["id","removed","deleted"]}},"required":["success","data"]}}}},"400":{"description":"Refused: `WRONG_TEMPLATE_KIND`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"x-moxo-person-only":"PERSON_TOKEN_REQUIRED","security":[{"bearerAuth":[]}]}},"/v1/templates/{id}/steps/{stepId}/esign-detect-fields":{"post":{"description":"Reads the signature and form fields of an e-signature step's document: the PDF's own fields, plus fields found by AI when you send `augmentWithVision` and the virus scan has passed. It changes nothing. To place them, give each field the `roleId` of the signer who fills it and send them as `fields` with the change `{ \"op\": \"update_step\", \"stepId\": \"<stepId>\", \"fields\": { \"fields\": [ … ] } }`, or place them in the template builder. An action the template doesn't have returns `404 STEP_NOT_FOUND`. You need permission to change the template.\n\n**Who can call it.** A personal access token (`mxo_pat_...`) or a signed-in session builds as its person, with that person's permissions, and every change and publish is recorded as theirs. A template has owners, so building, changing and publishing one is a person's act: an organization API key gets `403 PERSON_TOKEN_REQUIRED` on every call that changes a template, and so does a partner delegation key. A key may still read templates and their files, check a change list, and read a document's fields. Building from code works on flow templates: a call on an action template answers `400 WRONG_TEMPLATE_KIND`.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `templates:read`","security":[{"bearerAuth":["templates:read"]}],"tags":["Build templates"],"summary":"Detect e-signature fields","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":true,"name":"stepId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"documentFileId":{"type":"string","minLength":1,"description":"The uploaded document's file id (`fileId` from the step's `attachments/upload-init`). Leave it out to read the step's saved document. The file must belong to this step of this template; any other is a 404."},"augmentWithVision":{"type":"boolean"}},"additionalProperties":false}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"fields":{"type":"array","items":{"type":"object","additionalProperties":{}},"description":"The fields found, each with its page, position, size and type. Give each the `roleId` of the signer who fills it before you place it."},"pageCount":{"type":"number","description":"How many pages the document has."},"parseFailed":{"type":"boolean","description":"`true` when the PDF could not be read as a form, so only the AI could find fields (or none were found)."},"source":{"type":"string","enum":["acroform","vision","mixed","none","pending-scan"],"description":"Where the fields came from. `acroform`: the PDF's own form fields. `vision`: found by AI. `mixed`: both. `none`: the document was read and has no fields to place. `pending-scan`: the virus scan has not finished, so only the PDF's own fields were read and an empty list is not yet an answer; ask again in a few seconds."}},"required":["fields","pageCount","parseFailed","source"],"additionalProperties":false}},"required":["success","data"]}}}},"400":{"description":"Refused: `WRONG_TEMPLATE_KIND`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/sdk/v1/me":{"get":{"tags":["Headless SDK"],"summary":"Get the session's person","description":"Returns the person behind the SDK session: their user id, display name, persona, portal and organization. Call it once after creating a session to set up your UI, and to check a token end to end while you integrate.\n\n**Tokens:** SDK session token","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"The session's person.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/SdkMe"}},"required":["success","data"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/sdk/v1/dashboard":{"get":{"tags":["Headless SDK"],"summary":"Get the person's dashboard","description":"Returns the signed-in person's flows with what a spotlight and gallery need: `awaitingOn` (`you` means they have a step to act on now), due state, progress, unread chat and summary counts. A portal session sees only its portal. Magic link and orchestrator portal sessions see their own flows across the organization: always what involves the person, never an organization-wide list. The response has no action tokens: the session itself is the credential for every follow-up call.\n\n**Tokens:** SDK session token","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Summary counts and flows.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/SdkDashboard"}},"required":["success","data"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/sdk/v1/flows/{id}":{"get":{"tags":["Headless SDK"],"summary":"Get a flow","description":"Returns one flow, limited to what the caller can see: participants and viewers get exactly the steps visible to them (their own steps plus steps shared with them), and flow managers get every step. Each step lists its current assignees, with person ids and a `you` marker. A flow the caller can't open returns 404, so the response never shows whether it exists.\n\n**Tokens:** SDK session token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"The flow's id."},"required":true,"description":"The flow's id.","name":"id","in":"path"}],"responses":{"200":{"description":"The flow, with the steps the caller can see.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/SdkFlowDetail"}},"required":["success","data"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/sdk/v1/templates":{"get":{"tags":["Headless SDK"],"summary":"List the templates the person can start","description":"Returns the templates this portal session can start, each with its start form. Show `kickoffFields` in your own UI, and fill in and hide the `initiatorFieldKeys` from the signed-in person's details. Portal sessions only (403 `WRONG_PERSONA_SURFACE` otherwise): the templates a person can start are their portal's catalog.\n\n**Tokens:** SDK session token","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"The templates the person can start, with their start forms.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"array","items":{"$ref":"#/components/schemas/SdkTemplate"}}},"required":["success","data"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/sdk/v1/flows/{id}/messages":{"get":{"tags":["Headless SDK"],"summary":"List flow chat messages","description":"Returns the flow's chat as the signed-in person can read it, newest first, with replies in threads. `authorType` says who wrote each message (`internal`, `external`, `agent` for AI, or `system`), so you can show AI messages differently. External participants see messages on the whole flow plus the threads on their own steps; internal notes (`internal_only`) never reach external viewers. Post with `POST /sdk/v1/flows/{id}/messages`.\n\n**Tokens:** SDK session token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"The flow's id."},"required":true,"description":"The flow's id.","name":"id","in":"path"},{"schema":{"type":"integer","minimum":1,"maximum":200,"description":"How many top-level messages to return, up to 200. Defaults to 100. Replies are nested and not counted."},"required":false,"description":"How many top-level messages to return, up to 200. Defaults to 100. Replies are nested and not counted.","name":"limit","in":"query"},{"schema":{"type":"string","description":"The previous page's `pagination.nextCursor`. Leave it out for the first page."},"required":false,"description":"The previous page's `pagination.nextCursor`. Leave it out for the first page.","name":"cursor","in":"query"}],"responses":{"200":{"description":"Chat messages, newest first, one page at a time.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"array","items":{"$ref":"#/components/schemas/FlowChatMessage"}},"pagination":{"type":"object","properties":{"nextCursor":{"type":["string","null"]}},"required":["nextCursor"]}},"required":["success","data","pagination"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"tags":["Headless SDK"],"summary":"Post a chat message","description":"Posts a message to the flow's chat as the signed-in person, with the same permissions as chat in the app. To attach it to a step, send `targetStepExecutionId`; a step the caller can't see is refused, never quietly swapped for another. For an external participant, a message without a step attaches to their active step, and is refused when they have none, so name the step when commenting on a completed one. Messages are text only.\n\n**Refusals:** `403 FEATURE_DISABLED` (chat is not on the organization's plan), `403 FLOW_CANCELLED` (the flow was canceled, so its chat is read-only), `403 PROGRESS_ONLY` (the flow is shared with this person to follow its progress only), `403 COMMENTS_DISABLED` (comments are off for this flow; reading still works), `403 STEP_NOT_VISIBLE` (`targetStepExecutionId` names a step this person can't see), `403 FORBIDDEN` (an external participant sent no `targetStepExecutionId` and has no step open on this flow, so name the step they are writing about; also a step that has no chat, such as an automation), `400 BAD_REQUEST` (`targetStepExecutionId` is not a step of this flow), `403 MENTION_NOT_ALLOWED` (`mentions` names someone who isn't on the flow, and this person isn't a flow manager, sent no `targetStepExecutionId`, or the template's Tag anyone in the organization setting is off), `400 MENTION_UNKNOWN` (`mentions` names someone who is not in this organization), `400 MENTION_EXTERNAL` (`mentions` names someone outside the organization who isn't on the flow), `400 MENTION_INACTIVE` (`mentions` names someone who is deactivated), `400 TOO_MANY_MENTIONS` (`mentions` names more than 10 people who aren't on the flow). A flow the caller can't open is `404`.\n\n**Idempotency:** you can send an `Idempotency-Key` header. A retry with the same key returns `201` with the original message instead of posting a duplicate, or `410 IDEMPOTENCY_RESULT_LOST` when that message was deleted since; a retry while the first request is still running returns `425 IDEMPOTENT_REQUEST_PENDING`.\n\n**Tokens:** SDK session token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"The flow's id."},"required":true,"description":"The flow's id.","name":"id","in":"path"},{"schema":{"type":"string","description":"A unique key that makes retries safe. See **Idempotency** in this endpoint's description.","example":"b47ac10b-58cc-4372-a567-0e02b2c3d479"},"required":false,"description":"A unique key that makes retries safe. See **Idempotency** in this endpoint's description.","name":"Idempotency-Key","in":"header"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"body":{"type":"string","minLength":1,"maxLength":10000,"description":"The message text."},"targetStepExecutionId":{"type":"string","description":"The step to attach the message to. Leave it out for a message on the whole flow."}},"required":["body"],"additionalProperties":false}}}},"responses":{"201":{"description":"The message: the new one, or the original one when this is a retry with the same `Idempotency-Key`.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/FlowChatMessage"}},"required":["success","data"]}}}},"400":{"description":"Refused: `BAD_REQUEST`, `MENTION_EXTERNAL`, `MENTION_INACTIVE`, `MENTION_UNKNOWN`, `TOO_MANY_MENTIONS`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"410":{"description":"The first result for this `Idempotency-Key` can no longer be returned, because what it created was deleted. Use a new key for the next attempt.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"425":{"description":"A request with this `Idempotency-Key` is still running. Retry after `Retry-After` seconds. If the first request failed with a `5xx`, the key stays held for 10 minutes; to retry sooner, use a new key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/sdk/v1/notifications":{"get":{"tags":["Headless SDK"],"summary":"List notifications","description":"Returns the person's in-app notifications, most recent first, for your app's bell icon, a page at a time: pass `pagination.nextCursor` as `cursor` for older ones. The feed is filled for internal users; external participants are reached by email or SMS instead, so their feed may be empty.\n\n**Tokens:** SDK session token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","enum":["true","false"],"description":"Return only unread items."},"required":false,"description":"Return only unread items.","name":"unreadOnly","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"description":"How many notifications to return, up to 100. Defaults to 50."},"required":false,"description":"How many notifications to return, up to 100. Defaults to 50.","name":"limit","in":"query"},{"schema":{"type":"string","description":"The previous page's `pagination.nextCursor`, for older notifications. Leave it out for the newest. A cursor this list did not return is refused with `400 INVALID_CURSOR`."},"required":false,"description":"The previous page's `pagination.nextCursor`, for older notifications. Leave it out for the newest. A cursor this list did not return is refused with `400 INVALID_CURSOR`.","name":"cursor","in":"query"}],"responses":{"200":{"description":"Notifications.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"array","items":{"$ref":"#/components/schemas/SdkNotification"}},"pagination":{"type":"object","properties":{"nextCursor":{"type":["string","null"],"description":"Pass it as `cursor` for the next, older page. `null` on the last page."}},"required":["nextCursor"],"description":"Where the next page starts."}},"required":["success","data","pagination"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/sdk/v1/notifications/unread-count":{"get":{"tags":["Headless SDK"],"summary":"Count unread notifications","description":"Returns the number for your bell icon's badge.\n\n**Tokens:** SDK session token","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Unread count","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"count":{"type":"integer","description":"Notifications not yet read or dismissed.","example":3}},"required":["count"]}},"required":["success","data"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/sdk/v1/notifications/{id}/read":{"post":{"tags":["Headless SDK"],"summary":"Mark a notification read","description":"Marks one notification as read. Marking an already-read or unknown id also succeeds and changes nothing, so a retry never fails.\n\n**Tokens:** SDK session token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"Notification id."},"required":true,"description":"Notification id.","name":"id","in":"path"}],"responses":{"200":{"description":"Acknowledged","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]}},"required":["success"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/sdk/v1/notifications/read-all":{"post":{"tags":["Headless SDK"],"summary":"Mark all notifications read","description":"Marks every unread notification of the signed-in person as read.\n\n**Tokens:** SDK session token","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Acknowledged","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"updated":{"type":"integer","description":"How many notifications were marked as read.","example":4}},"required":["updated"]}},"required":["success","data"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/sdk/events":{"get":{"tags":["Headless SDK"],"summary":"Stream live events (SSE)","description":"Server-sent events for the session's person, each one only when the session itself may read it (a session is never an admin, so one created for an admin does not receive the organization's admin notices or events for flows, steps and chat channels it cannot open). Choose what to receive with `?subscribe=`; without it, the stream only keeps the connection open and delivers nothing. Events are pointers (ids, not content): when one arrives, read the matching `/sdk/v1` endpoint again. The stream ends when the session token expires (the `connected` frame's `exp` says when). Create a new session, reconnect and read again to catch up on anything missed; events are not replayed.\n\n**Frames:** `connected` `{jti, orgId, delivery, subscribe, exp}`, then `sync` `{reason}`, then one frame per event, named by its type (for example `step.completed`, `chatMessage.sent`, `conversation.message_sent`, `notification.created`, `notification.os_surface`). Heartbeat comments keep the connection open.\n\n**Groups:** `flows` (step and flow changes), `chat` (flow chat pointers; for older clients, this group also delivers group conversation `conversation.*` events), `conversations` (group conversation pointers only; use it when you don't want flow chat events) and `notifications` (in-app notifications, plus portal alerts).\n\n**Portal alerts:** when `subscribe` includes `notifications`, a session without an orchestrator portal persona also receives `notification.os_surface` (`audience: portal`), at the same moment as a portal browser alert. It is delivered when the plan has the Web SDK or the Headless SDK. `flows` and `notification.created` need the Headless SDK. `chat` and `conversations` are delivered on either SDK plan, because chat embeds need live pointers. On a Web SDK plan, a request that also asks for `flows` is answered without `flows`. In `@moxo/sdk`, `onNotification` turns the frame into a category plus ids and drops the fixed title and body.\n\n**Plans:** portal alerts need the Web SDK or the Headless SDK; `chat` and `conversations` need either SDK plan; `flows` and `notification.created` need the Headless SDK. Create the session token with `POST /sdk/auth/sessions` and send it as the Bearer token.\n\n**Tokens:** SDK session token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"The groups to deliver, comma-separated: `flows`, `chat`, `conversations`, `notifications`. For example `subscribe=flows,chat,conversations`. Leave it out and the stream delivers nothing.","example":"flows,chat,conversations,notifications"},"required":false,"description":"The groups to deliver, comma-separated: `flows`, `chat`, `conversations`, `notifications`. For example `subscribe=flows,chat,conversations`. Leave it out and the stream delivers nothing.","name":"subscribe","in":"query"}],"responses":{"200":{"description":"An SSE stream (`text/event-stream`).","content":{"text/event-stream":{"schema":{"type":"string","description":"SSE frames as described above."}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/sdk/v1/flows/{flowId}/steps/{stepExecutionId}":{"get":{"tags":["Headless SDK"],"summary":"Get a step's content","description":"Returns one step's name, description and files: the same content the Moxo portal shows that person. The name is the title the portal shows, including a preparer's title and filled-in dynamic data. A file from a form answer hidden from the person is left out. A hidden step returns 404, and a step shared as progress only returns `403 PROGRESS_ONLY`.\n\n**Tokens:** SDK session token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"The flow's id."},"required":true,"description":"The flow's id.","name":"flowId","in":"path"},{"schema":{"type":"string","description":"The step's execution id: the `id` of the step in the flow detail."},"required":true,"description":"The step's execution id: the `id` of the step in the flow detail.","name":"stepExecutionId","in":"path"}],"responses":{"200":{"description":"The step's content.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/SdkStepDetail"}},"required":["success","data"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/sdk/v1/flows/{flowId}/files":{"get":{"tags":["Headless SDK"],"summary":"List a flow's files","description":"Returns every file in the flow that this person can see, including a fixed file from the template that the flow kept. A generated file that failed stays in the list with `generationStatus` `failed` and has no download link. When the person only sees progress, other people's files are left out.\n\n**Tokens:** SDK session token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"The flow's id."},"required":true,"description":"The flow's id.","name":"flowId","in":"path"}],"responses":{"200":{"description":"The files the person can see.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"array","items":{"$ref":"#/components/schemas/SdkStepAttachment"}}},"required":["success","data"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/sdk/v1/flows/{flowId}/files/{fileId}":{"get":{"tags":["Headless SDK"],"summary":"Get a file's download link","description":"Returns a signed download link for one file this person can already see. The link lasts 5 minutes. Send `disposition=inline` to preview the file, or `attachment` to download it; a type the browser can't show is sent as `attachment`. A view-only file returns 403. A file that must be watermarked returns 422, because this link can't carry a mark for each person. A file that failed to generate returns `409 FILE_NOT_READY` and has no link. A file from another flow or organization, or from a step the person can't see, returns 404. A permanently deleted file returns 410. The download is recorded only once the link is created. A `HEAD` request checks the same rules and returns 200, with no link and no download recorded.\n\n**Tokens:** SDK session token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"The flow's id."},"required":true,"description":"The flow's id.","name":"flowId","in":"path"},{"schema":{"type":"string","description":"The file's id, from the flow's file list or a step attachment."},"required":true,"description":"The file's id, from the flow's file list or a step attachment.","name":"fileId","in":"path"},{"schema":{"type":"string","enum":["inline","attachment"],"description":"`inline` previews the file; `attachment` downloads it. Defaults to `attachment`."},"required":false,"description":"`inline` previews the file; `attachment` downloads it. Defaults to `attachment`.","name":"disposition","in":"query"}],"responses":{"200":{"description":"The signed link.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/SdkFileDownload"}},"required":["success","data"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Refused: `FILE_NOT_READY`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"410":{"description":"Gone: what the request names no longer exists.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"The request is well formed but can't be applied. `error.code` says why.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"head":{"tags":["Headless SDK"],"summary":"Check a file download","description":"Checks that this person can get a download link for one file. Returns 200 with no body and no link, and records no download. The same refusals apply as for the download link.\n\n**Tokens:** SDK session token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"The flow's id."},"required":true,"description":"The flow's id.","name":"flowId","in":"path"},{"schema":{"type":"string","description":"The file's id, from the flow's file list or a step attachment."},"required":true,"description":"The file's id, from the flow's file list or a step attachment.","name":"fileId","in":"path"}],"responses":{"200":{"description":"The file can be downloaded. No body and no link."},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/sdk/v1/flows/{flowId}/steps/{stepExecutionId}/form-schema":{"get":{"tags":["Headless SDK"],"summary":"Get a step's form","description":"Returns the fields to show for a step, in order: the same form Moxo shows the participant, with dynamic data already filled in and each default converted to its field type's format. Key the completion by each field's `id`. Rules that read values outside the form come already evaluated (`resolved`); evaluate rules within the form in your UI as the person fills it in. Steps without fields, such as an acknowledgement or a to-do, return an empty `fields` array.\n\n**Tokens:** SDK session token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"The flow's id."},"required":true,"description":"The flow's id.","name":"flowId","in":"path"},{"schema":{"type":"string","description":"The step's execution id: the `id` of the step in the flow detail."},"required":true,"description":"The step's execution id: the `id` of the step in the flow detail.","name":"stepExecutionId","in":"path"}],"responses":{"200":{"description":"The step's form.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/SdkStepFormSchema"}},"required":["success","data"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/sdk/v1/flows/{flowId}/steps/{stepExecutionId}/complete":{"post":{"tags":["Headless SDK"],"summary":"Complete a step","description":"Submits the signed-in person's work on a step and moves the flow on. The caller must be an assignee of the step with their part still open, or be covering for a teammate who is away; a flow manager can't complete someone else's step here. `resultData` is keyed by field id (see the step's form endpoint); a form's file field takes the ids the upload endpoint returned. A file request has no form fields: upload each file with `POST /sdk/v1/flows/{flowId}/steps/{stepExecutionId}/files`, then name them under `files`, as in `{ \"resultData\": { \"files\": [\"<fileId>\"] } }`. With no file uploaded, it answers `400 VALIDATION_FAILED`. On a step for several people, the submission completes one person's part, and `group` says how many more the step needs. A form or file request that closes at its due date and allows changes after submitting answers 200 with the step still in progress: the submission is recorded, and the action stays open until it closes. A file request whose AI rename is still running returns `200` with `postProcessing: true`: the submission is recorded, and the step completes when the rename finishes.\n\n**Refusals:** `403 NOT_STEP_ASSIGNEE` (no open part on the step), `403 COMPLETION_REQUIRES_MEMBER` (a Web App step that only an internal user can confirm), `400 VALIDATION_FAILED` (a field the step doesn't ask for, a choice that isn't one of the field's options, or a value of the wrong kind; the message names the field), `409 ESIGN_SIGNATURE_REQUIRED` (an e-signature step finishes when the document is signed), `409 ALREADY_COMPLETED` (the step, or your part of it, is already done), `409 STEP_AWAITING_REVIEW` (the step is in its review), `503 SERVICE_UNAVAILABLE` (a file rename couldn't be scheduled; retry), `400 INVALID_STATE` (the step or flow isn't active), `409 FLOW_PAUSED`, `409 BATCH_NOT_ACTIVE` (an earlier person in the order hasn't finished), `409 REVIEW_REQUIRED` (the step has an AI reviewer; complete it in Moxo), `409 STALE_ACTION` (the step changed at the same moment; read it again and retry), `422 FILE_INFECTED`, `409 SCAN_UNAVAILABLE`, `425 SCAN_PENDING` (an upload the request names is still being checked; retry shortly), and `400` for errors specific to the step type.\n\n**Retries:** a submission is applied once, so a retry of one that was already applied returns `409 ALREADY_COMPLETED` instead of applying it twice. Treat that code as success: your work is recorded. Read the flow again to see the result.\n\n**Tokens:** SDK session token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"The flow's id."},"required":true,"description":"The flow's id.","name":"flowId","in":"path"},{"schema":{"type":"string","description":"The step's execution id."},"required":true,"description":"The step's execution id.","name":"stepExecutionId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"resultData":{"type":"object","additionalProperties":{},"description":"The step's answers, as `POST /v1/flows/{id}/steps/{stepId}/complete` takes them: a form's keyed by each field's `id` from the step's form schema (a field's `key` or label in its place returns `400 VALIDATION_FAILED` naming the id). For a step without fields, leave it out or send `{}`. An approval sends `{ \"decision\": \"APPROVED\" }`. To reject an approval, use the decline endpoint. A file request sends the ids of the files uploaded to it under `files`: `{ \"files\": [\"<fileId>\"] }`.","example":{"decision":"APPROVED"}},"note":{"type":"string","maxLength":4000,"description":"A note to attach to the submission."},"askedFingerprint":{"type":"string","minLength":1,"maxLength":64,"description":"The step's `askedFingerprint` from your read of it. When what the step asks changed since, nothing is saved and the call returns `409 STEP_CHANGED`: read the step again and answer what it asks now. Left out, the answer is saved without this check.","example":"af1-3b0c9e14a2d75f68"}},"additionalProperties":false}}}},"responses":{"200":{"description":"The submission was accepted.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/SdkStepCompleteResult"}},"required":["success","data"]}}}},"400":{"description":"Refused: `INVALID_STATE`, `VALIDATION_FAILED`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Refused: `ALREADY_COMPLETED`, `BATCH_NOT_ACTIVE`, `ESIGN_SIGNATURE_REQUIRED`, `FLOW_PAUSED`, `REVIEW_REQUIRED`, `SCAN_UNAVAILABLE`, `STALE_ACTION`, `STEP_AWAITING_REVIEW`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Refused: `FILE_INFECTED`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"425":{"description":"Refused: `SCAN_PENDING`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Refused: `SERVICE_UNAVAILABLE`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/sdk/v1/flows/{flowId}/steps/{stepExecutionId}/decline":{"post":{"tags":["Headless SDK"],"summary":"Decline an approval step","description":"Declines an approval step as the signed-in approver: either a final rejection or a request for changes, which reopens the steps the template's author chose. The caller must be an approver on the step with their part still open.\n\n**Refusals,** the same as `POST /v1/flows/{id}/steps/{stepId}/decline` answers: `400 VALIDATION_FAILED` (the template doesn't allow the requested action; `error.details` names the setting), `400 INVALID_STEP_TYPE` (not an approval step), `410 NO_ACTIVE_SLOT` (no part on the step, or your part was already decided another way; `error.decision` names yours), `410 SLOT_FORWARDED`, `410 SLOT_NO_LONGER_ACTIONABLE`, `422 CHANGES_TARGETS_UNAVAILABLE` (none of the steps named can take the changes), `409 BATCH_NOT_ACTIVE`, `409 STALE_ACTION` (the step changed at the same moment), `409 APPROVAL_DECIDED_OTHERWISE` (the approval was decided another way this round; `error.decision` is the one that stands), `400 AMBIGUOUS_SLOT` (you hold more than one open part on the approval; `error.availableSlotIds` lists them), `400 INVALID_STATE` (the approval is not open for a decision), `409 FLOW_PAUSED` (the flow is paused), `400 DECLINE_FAILED` (the decline couldn't be applied; the message says why).\n\n**Retries:** each person's decision is applied once, so a retry of a decline that was already applied returns `410 NO_ACTIVE_SLOT` instead of applying it twice. Read the flow again to see the result.\n\n**Tokens:** SDK session token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"The flow's id."},"required":true,"description":"The flow's id.","name":"flowId","in":"path"},{"schema":{"type":"string","description":"The step's execution id."},"required":true,"description":"The step's execution id.","name":"stepExecutionId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"action":{"type":"string","enum":["request_changes","reject"],"description":"How to decline. `request_changes` reopens the steps the template names for changes; `reject` is final."},"reason":{"type":"string","minLength":1,"maxLength":4000,"description":"Why you are declining. The flow's participants see it."},"askedFingerprint":{"type":"string","minLength":1,"maxLength":64,"description":"The approval's `askedFingerprint` from your read of it. When what it asks changed since, nothing is saved and the call returns `409 STEP_CHANGED`.","example":"af1-3b0c9e14a2d75f68"}},"required":["action","reason"],"additionalProperties":false}}}},"responses":{"200":{"description":"The decline was recorded.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/SdkStepDeclineResult"}},"required":["success","data"]}}}},"400":{"description":"Refused: `AMBIGUOUS_SLOT`, `DECLINE_FAILED`, `INVALID_STATE`, `INVALID_STEP_TYPE`, `VALIDATION_FAILED`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Refused: `APPROVAL_DECIDED_OTHERWISE`, `BATCH_NOT_ACTIVE`, `FLOW_PAUSED`, `STALE_ACTION`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"410":{"description":"Refused: `NO_ACTIVE_SLOT`, `SLOT_FORWARDED`, `SLOT_NO_LONGER_ACTIONABLE`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Refused: `CHANGES_TARGETS_UNAVAILABLE`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/sdk/v1/flows/{flowId}/steps/{stepExecutionId}/files":{"post":{"tags":["Headless SDK"],"summary":"Upload a file to a step","description":"Uploads one file to a step where the signed-in person's part is still open. The file is scanned for viruses before it is accepted, so the response's `scanStatus` is always final (`clean` or `skipped`); an infected file is refused with `422 FILE_INFECTED` and nothing is stored. The upload stays a draft until your completion names its `fileId`; drafts your submission never names are ignored and later removed.\n\n**Refusals:** `403 NOT_STEP_ASSIGNEE` (no open part on the step), `400 INVALID_STATE`, `413` (over the size limit), `422 FILE_INFECTED`, `503 SCAN_UNAVAILABLE` (try again shortly).\n\n**Tokens:** SDK session token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"The flow's id."},"required":true,"description":"The flow's id.","name":"flowId","in":"path"},{"schema":{"type":"string","description":"The step's execution id."},"required":true,"description":"The step's execution id.","name":"stepExecutionId","in":"path"}],"requestBody":{"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","format":"binary","description":"The file (one per request)."}},"required":["file"]}}}},"responses":{"201":{"description":"The file was scanned and stored as a draft.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/SdkStepUpload"}},"required":["success","data"]}}}},"400":{"description":"Refused: `INVALID_STATE`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"413":{"description":"The upload is larger than this call takes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Refused: `FILE_INFECTED`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Refused: `SCAN_UNAVAILABLE`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/sdk/v1/flows":{"post":{"tags":["Headless SDK"],"summary":"Start a flow","description":"Starts a flow from the portal's catalog as the signed-in person. `templateId` comes from `GET /sdk/v1/templates`; `customFields` names each start field by its `key` and is checked the same way as on every other way to start a flow. Portal sessions only (`403 WRONG_PERSONA_SURFACE` otherwise). The response carries only the new flow's id: read the flow with `GET /sdk/v1/flows/{id}`, and follow its progress on the event stream.\n\n**Refusals:** `403 PORTAL_BINDING_MISSING` (the session is not linked to a portal: create it with `portal_id`), `403 TEMPLATE_NOT_IN_PORTAL_CATALOG` (the template is not in this portal's catalog, or there is no template with this id: the answer is the same, so it never says which ids exist), `404 TEMPLATE_NOT_FOUND` (the template is in the catalog but is archived or not published), `400 TEMPLATE_NOT_STARTABLE` (the template is not set up for people to start themselves), `400 KICKOFF_VALIDATION_FAILED` (a start field is missing or not valid, with details for each field), `400 CONNECTION_BUNDLE_REJECTED` (the connection picked can't be used for this flow), `422 BUILDING_BLOCK_EXPANSION_FAILED` (the template uses a building block that isn't available), `400 VALIDATION_ERROR` (a building block in the template no longer works with the person it is bound to), `422 ORG_CHART_NO_APPROVER` (neither a manager nor the template's fallback person can take a role filled from the org chart), `400 ASSIGNEE_NOT_INVITABLE` (a person the template assigns was deactivated or removed), `402 ORG_SUSPENDED` (the organization's account is suspended), `402 QUOTA_EXCEEDED` (the plan's included AI is used up, so no new live work starts).\n\n**Idempotency:** you can send an `Idempotency-Key` header (any unique string). A retry with the same key returns the stored result instead of running the action again. When the stored result can no longer be rebuilt, the retry returns `410 IDEMPOTENCY_RESULT_LOST`: treat the first outcome as unknown. Requests without the header run as usual.\n\n**Tokens:** SDK session token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"A unique key that makes retries safe. See **Idempotency** in this endpoint's description.","example":"b47ac10b-58cc-4372-a567-0e02b2c3d479"},"required":false,"description":"A unique key that makes retries safe. See **Idempotency** in this endpoint's description.","name":"Idempotency-Key","in":"header"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"templateId":{"type":"string","minLength":1,"description":"The template to start, from `GET /sdk/v1/templates`."},"customFields":{"type":"array","items":{"$ref":"#/components/schemas/CustomFieldValueInput"},"description":"Answers to the start form, each field by its `key` from `kickoffFields` on `GET /sdk/v1/templates` (`[{ \"key\": \"…\", \"value\": … }]`), as every start takes them. A field's id or label in `key` returns `400 VALIDATION_ERROR` naming the key."},"connectionBundleId":{"type":"string","description":"The connection bundle to use, when the template offers a choice."}},"required":["templateId"],"additionalProperties":false}}}},"responses":{"201":{"description":"The flow was started.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/SdkFlowStart"}},"required":["success","data"]}}}},"400":{"description":"Refused: `ASSIGNEE_NOT_INVITABLE`, `CONNECTION_BUNDLE_REJECTED`, `KICKOFF_VALIDATION_FAILED`, `TEMPLATE_NOT_STARTABLE`, `VALIDATION_ERROR`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"Refused: `ORG_SUSPENDED`, `QUOTA_EXCEEDED`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"410":{"description":"Refused: `IDEMPOTENCY_RESULT_LOST`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Refused: `BUILDING_BLOCK_EXPANSION_FAILED`, `ORG_CHART_NO_APPROVER`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/sdk/v1/actions":{"get":{"tags":["Headless SDK"],"summary":"List the person's actions","description":"Returns the actions the signed-in person sent or received, newest first. `scope` narrows the list: `waiting_on_them` (you asked, they haven't answered), `waiting_on_me` (someone asked you), `done` or `all`. Always only what involves the person, never an organization-wide list, whatever the person can see in Moxo. For that, use `/v1/actions`.\n\n**Tokens:** SDK session token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","enum":["waiting_on_them","waiting_on_me","done","all"]},"required":false,"name":"scope","in":"query"},{"schema":{"type":"string","maxLength":200,"description":"Text to find in the action names."},"required":false,"description":"Text to find in the action names.","name":"q","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":50,"description":"Actions per page, 1 to 50."},"required":false,"description":"Actions per page, 1 to 50.","name":"limit","in":"query"},{"schema":{"type":["integer","null"],"minimum":0,"description":"How many actions to skip. Defaults to 0."},"required":false,"description":"How many actions to skip. Defaults to 0.","name":"offset","in":"query"}],"responses":{"200":{"description":"A page of actions.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"array","items":{"$ref":"#/components/schemas/Action"}},"pagination":{"type":"object","properties":{"total":{"type":"integer"},"limit":{"type":"integer"},"offset":{"type":"integer"},"hasMore":{"type":"boolean"}},"required":["total","limit","offset","hasMore"]}},"required":["success","data","pagination"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"tags":["Headless SDK"],"summary":"Send an action","description":"Sends one request to one or more people, as the signed-in person. They get an email with a link and need no account, portal or app. Needs the `actions.send` permission: a person your organization doesn't let send actions is refused here too, so your own interface can't get around that setting. The person can send 20 actions an hour from no conversation. Past it, the call returns `429 TOO_MANY_REQUESTS` with `Retry-After` and `error.retryAt`, when sending works again.\n\n**Tokens:** SDK session token","security":[{"bearerAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SdkV1CreateAction"}}}},"responses":{"201":{"description":"The action that was sent.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/Action"}},"required":["success","data"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/sdk/v1/actions/{id}":{"get":{"tags":["Headless SDK"],"summary":"Get an action","description":"Returns one action: who it went to, where each of them stands, and whether each has opened it. Build on each person's `openedAt`: the action's own open time is set by the first person to open it, so on a large acknowledgement it is set the moment one person looks. Returns 404 if the action isn't one of yours.\n\n**Tokens:** SDK session token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"The action's id."},"required":true,"description":"The action's id.","name":"id","in":"path"}],"responses":{"200":{"description":"The action","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/Action"}},"required":["success","data"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/sdk/v1/actions/{id}/remind":{"post":{"tags":["Headless SDK"],"summary":"Send a reminder","description":"Reminds everyone who hasn't answered; nobody who has answered is contacted. Available to whoever sent the action, whether or not they can still send new ones.\n\n**Tokens:** SDK session token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"The action's id."},"required":true,"description":"The action's id.","name":"id","in":"path"}],"responses":{"200":{"description":"How many people were reminded.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"reminded":{"type":"integer","description":"How many people were contacted."}},"required":["reminded"]}},"required":["success","data"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/sdk/v1/actions/{id}/cancel":{"post":{"tags":["Headless SDK"],"summary":"Withdraw an action","description":"Withdraws the action. One nobody has answered is deleted; one that has been answered is canceled instead, because the other person is entitled to its record too. The response says which happened.\n\n**Tokens:** SDK session token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"The action's id."},"required":true,"description":"The action's id.","name":"id","in":"path"}],"responses":{"200":{"description":"Whether the action was deleted or canceled.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"deleted":{"type":"boolean"},"cancelled":{"type":"boolean"}},"required":["deleted","cancelled"]}},"required":["success","data"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/sdk/v1/conversations":{"get":{"tags":["Headless SDK"],"summary":"List conversations (Messages inbox)","description":"Returns the signed-in person’s Messages inbox: group conversations and, by default, the flow chats they take part in.\n\n**To leave out flow chats,** send `kind=group`. `kind=flow` returns only flow chats; leaving `kind` out, or `kind=all`, returns both. Send `scope=all` to include every group conversation when this persona may view all conversations. A room they have not joined comes back with `viewerOnly: true` and no `role`. Without that grant, `scope=all` is the conversations they are in. Flow chats stay the ones they take part in either way. Most recent activity first; page with `cursor` (the previous page's `nextCursor`, the same cursor `/v1/conversations` issues). A cursor this list didn't issue returns 400. A flow's chat history is on `GET /sdk/v1/flows/{id}/messages`.\n\n**Tokens:** SDK session token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","maxLength":200,"description":"Text to find in the title or the last message, ignoring case."},"required":false,"description":"Text to find in the title or the last message, ignoring case.","name":"search","in":"query"},{"schema":{"type":"string","enum":["all","group","flow"],"description":"`all` (the default) returns group conversations and flow chats, `group` only group conversations, and `flow` only flow chats.","example":"group"},"required":false,"description":"`all` (the default) returns group conversations and flow chats, `group` only group conversations, and `flow` only flow chats.","name":"kind","in":"query"},{"schema":{"type":"string","enum":["all","unread","managed_by_me"]},"required":false,"name":"filter","in":"query"},{"schema":{"type":"boolean"},"required":false,"name":"includeArchived","in":"query"},{"schema":{"type":"string","enum":["mine","all"],"description":"Send `all` for every group conversation when this person may view all conversations. The default is the conversations they are in."},"required":false,"description":"Send `all` for every group conversation when this person may view all conversations. The default is the conversations they are in.","name":"scope","in":"query"},{"schema":{"type":"integer","exclusiveMinimum":0,"maximum":200,"description":"Items per page, up to 200. Defaults to 50."},"required":false,"description":"Items per page, up to 200. Defaults to 50.","name":"limit","in":"query"},{"schema":{"type":"string","description":"The previous page's `nextCursor`. Leave it out for the first page."},"required":false,"description":"The previous page's `nextCursor`. Leave it out for the first page.","name":"cursor","in":"query"}],"responses":{"200":{"description":"A page of the inbox.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"array","items":{"$ref":"#/components/schemas/ConversationSummary"}},"pagination":{"type":"object","properties":{"nextCursor":{"type":["string","null"]},"limit":{"type":"integer"},"hasMore":{"type":"boolean"}},"required":["nextCursor","limit","hasMore"]}},"required":["success","data","pagination"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"tags":["Headless SDK"],"summary":"Create a group conversation","description":"Starts a group conversation as the signed-in person, who becomes its manager, under the same rules as the app. Needs Group Chat on the organization's plan. A participant id that matches nobody returns 400, naming it. A portal user limited to people they already work with gets 403 for anyone they can't add, whether or not that person exists.\n\n**Tokens:** SDK session token","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":["string","null"],"maxLength":200},"participants":{"type":"array","items":{"type":"object","properties":{"userId":{"type":"string","description":"The id of an existing user in your organization."},"email":{"type":"string","format":"email","description":"The email of an existing user in your organization."}},"additionalProperties":false},"maxItems":100,"description":"The people to add, each by `userId` or `email`, as `/v1` takes them."},"managers":{"type":"array","items":{"type":"object","properties":{"userId":{"type":"string","description":"The id of an existing user in your organization."},"email":{"type":"string","format":"email","description":"The email of an existing user in your organization."}},"additionalProperties":false},"maxItems":100,"description":"People on your team who manage it from the start. Each one must also be in `participants`."},"showParticipantsToExternal":{"type":"boolean"}},"additionalProperties":false}}}},"responses":{"201":{"description":"The new conversation.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/ConversationDetail"}},"required":["success","data"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/sdk/v1/conversations/unread-count":{"get":{"tags":["Headless SDK"],"summary":"Unread conversation count","description":"Returns the badge number for the signed-in person: unread conversations they take part in.\n\n**Tokens:** SDK session token","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Badge count","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"count":{"type":"integer"}},"required":["count"]}},"required":["success","data"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/sdk/v1/conversations/{id}":{"get":{"tags":["Headless SDK"],"summary":"Get a group conversation","description":"Returns a group conversation the signed-in person can read, with its participants. A person who may view all conversations and has not joined gets `viewerOnly: true` and no `role`. A flow id returns 404: for a flow's chat, use `GET /sdk/v1/flows/{id}/messages`.\n\n**Tokens:** SDK session token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Conversation detail","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/ConversationDetail"}},"required":["success","data"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"tags":["Headless SDK"],"summary":"Rename a conversation","description":"Changes the title. Only a conversation manager can do this.\n\n**Tokens:** SDK session token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PatchConversation"}}}},"responses":{"200":{"description":"Updated conversation","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/ConversationDetail"}},"required":["success","data"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"tags":["Headless SDK"],"summary":"Delete a conversation","description":"Deletes the conversation for everyone. Only a conversation manager can do this.\n\n**Tokens:** SDK session token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]}},"required":["success"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/sdk/v1/conversations/{id}/join":{"post":{"tags":["Headless SDK"],"summary":"Join a conversation","description":"Takes a seat in a group conversation this person can read but is not in. Needs View all conversations, on a plan that allows it. Already being in it changes nothing.\n\n**Tokens:** SDK session token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"You are in the conversation.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always true on a success."},"data":{"allOf":[{"$ref":"#/components/schemas/ConversationDetail"},{"description":"The conversation, with you in it."}]}},"required":["success","data"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/sdk/v1/conversations/{id}/archive":{"post":{"tags":["Headless SDK"],"summary":"Archive a conversation","description":"Only a conversation manager can do this.\n\n**Tokens:** SDK session token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]}},"required":["success"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/sdk/v1/conversations/{id}/unarchive":{"post":{"tags":["Headless SDK"],"summary":"Unarchive a conversation","description":"Only a conversation manager can do this.\n\n**Tokens:** SDK session token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]}},"required":["success"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/sdk/v1/conversations/{id}/participants":{"get":{"tags":["Headless SDK"],"summary":"List participants","description":"Returns the participants of a group conversation the signed-in person is in.\n\n**Tokens:** SDK session token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Participants","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"array","items":{"$ref":"#/components/schemas/ConversationParticipant"}}},"required":["success","data"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"tags":["Headless SDK"],"summary":"Add participants","description":"Adds people to the conversation. Only a conversation manager can do this, under the same rules as the app. An id that matches nobody returns 400, naming it.\n\n**Tokens:** SDK session token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"userIds":{"type":"array","items":{"type":"string"},"minItems":1,"maxItems":50}},"required":["userIds"],"additionalProperties":false}}}},"responses":{"201":{"description":"Added","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]}},"required":["success"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/sdk/v1/conversations/{id}/participants/{userId}":{"delete":{"tags":["Headless SDK"],"summary":"Remove a participant","description":"Removes one person from the conversation. Only a conversation manager can do this.\n\n**Tokens:** SDK session token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":true,"name":"userId","in":"path"}],"responses":{"200":{"description":"Removed","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]}},"required":["success"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"tags":["Headless SDK"],"summary":"Change a participant's role","description":"Makes a participant a `manager` or a `member`. Only a conversation manager can do this.\n\n**Tokens:** SDK session token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":true,"name":"userId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"role":{"type":"string","enum":["manager","member"]}},"required":["role"],"additionalProperties":false}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]}},"required":["success"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/sdk/v1/conversations/{id}/messages":{"get":{"tags":["Headless SDK"],"summary":"List messages in a group conversation","description":"Returns the messages in a group conversation. The first page has the latest messages, and each `nextCursor` goes further back; within a page, messages run oldest to newest. Messages that share a timestamp are never skipped. A cursor this list didn't issue returns 400. For a flow's chat, use `GET /sdk/v1/flows/{id}/messages`.\n\n**Tokens:** SDK session token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","description":"The previous page's `nextCursor`. Leave it out for the latest page."},"required":false,"description":"The previous page's `nextCursor`. Leave it out for the latest page.","name":"cursor","in":"query"},{"schema":{"type":"integer","exclusiveMinimum":0,"maximum":200,"description":"Items per page, up to 200. Defaults to 50."},"required":false,"description":"Items per page, up to 200. Defaults to 50.","name":"limit","in":"query"}],"responses":{"200":{"description":"A page of messages.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"array","items":{"$ref":"#/components/schemas/ConversationMessage"}},"pagination":{"type":"object","properties":{"nextCursor":{"type":["string","null"]}},"required":["nextCursor"]}},"required":["success","data","pagination"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"tags":["Headless SDK"],"summary":"Send a message","description":"Posts a message in a group conversation as the signed-in person, exactly as the app does (posting clears their own unsent draft there). A mention id that matches nobody returns 400, naming it. Send an `Idempotency-Key` to retry safely: a retry with the same key returns 201 with the original message and posts nothing, as on `/v1/conversations/{id}/messages`.\n\n**Tokens:** SDK session token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":256,"pattern":"^[A-Za-z0-9_\\-:.]+$","description":"An optional key of up to 256 letters, digits, `-`, `_`, `:` or `.`; any other key is refused with `400 INVALID_IDEMPOTENCY_KEY` and nothing is posted. A retry with the same key within 10 minutes returns the original message instead of posting it twice."},"required":false,"description":"An optional key of up to 256 letters, digits, `-`, `_`, `:` or `.`; any other key is refused with `400 INVALID_IDEMPOTENCY_KEY` and nothing is posted. A retry with the same key within 10 minutes returns the original message instead of posting it twice.","name":"Idempotency-Key","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SdkSendConversationMessage"}}}},"responses":{"201":{"description":"The message: the new one, or the original one when this is a retry with the same `Idempotency-Key`.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/ConversationMessage"}},"required":["success","data"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"410":{"description":"The first result for this `Idempotency-Key` can no longer be returned, because what it created was deleted. Use a new key for the next attempt.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"425":{"description":"A request with this `Idempotency-Key` is still running. Retry after `Retry-After` seconds. If the first request failed with a `5xx`, the key stays held for 10 minutes; to retry sooner, use a new key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"The first result for this `Idempotency-Key` couldn't be checked. Retry with the same key after a short wait. If it keeps happening, contact support with the `requestId`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/sdk/v1/conversations/{id}/messages/{messageId}":{"delete":{"tags":["Headless SDK"],"summary":"Delete a message","description":"Deletes a message; it stays in the thread as \"This message was deleted\". Its author or a manager can do this.\n\n**Tokens:** SDK session token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":true,"name":"messageId","in":"path"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]}},"required":["success"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/sdk/v1/conversations/{id}/read":{"post":{"tags":["Headless SDK"],"summary":"Mark a conversation as read","description":"Marks the conversation as read for the signed-in person, up to `messageId` or, with no body, up to the latest message. A `messageId` that isn't a message in this conversation that they can see returns 404.\n\n**Tokens:** SDK session token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"messageId":{"type":["string","null"]}},"additionalProperties":false}}}},"responses":{"200":{"description":"Marked","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]}},"required":["success"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/sdk/v1/conversations/{id}/unread":{"post":{"tags":["Headless SDK"],"summary":"Mark a conversation as unread","description":"Marks the conversation as unread for the signed-in person, from `messageId` onward or, with no body, all of it. A `messageId` that isn't a message in this conversation that they can see returns 404.\n\n**Tokens:** SDK session token","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"messageId":{"type":["string","null"]}},"additionalProperties":false}}}},"responses":{"200":{"description":"Marked","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]}},"required":["success"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/agents":{"get":{"tags":["AI agents"],"summary":"List AI agents","description":"Returns the organization's AI agents, most recently changed first, with what each takes in and returns. With **Manage AI agents**, also drafts and what setup is still missing (`needs`, `connectionsToBind`). Use an agent's `id` on a template step.\n\nA personal access token reads it with its person's permissions. An organization API key with `templates:read` reads it too, as an admin does; changing it still needs a personal access token.\n\n**Permission for a personal access token:** Manage AI agents (`agents.manage`). A template editor without it sees published agents only, with their kind, inputs and outputs: what the template builder shows when you pick an agent for a step.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `templates:read`","security":[{"bearerAuth":["templates:read"]}],"parameters":[{"schema":{"type":"string","enum":["prepare","advise","review","automation","chat"]},"required":false,"name":"kind","in":"query"},{"schema":{"type":"string","enum":["DRAFT","ACTIVE","ARCHIVED"]},"required":false,"name":"status","in":"query"},{"schema":{"type":"string","description":"Part of the agent name."},"required":false,"description":"Part of the agent name.","name":"search","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"description":"Agents per page, 1 to 100. Defaults to 50."},"required":false,"description":"Agents per page, 1 to 100. Defaults to 50.","name":"limit","in":"query"}],"responses":{"200":{"description":"Agents. A template editor gets only the fields of published agents.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"array","items":{"anyOf":[{"$ref":"#/components/schemas/BuilderAgent"},{"$ref":"#/components/schemas/BuilderAttachableAgent"}]}}},"required":["success","data"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"tags":["AI agents"],"summary":"Create a draft AI agent","description":"Creates a draft AI agent, the same way Agent Foundry does: the same checks, defaults and record. Send the kind (`agentType`), a name and instructions written under the `## headers` for that kind. It doesn't run until it is published.\n\nThe instructions are stored as you send them, except an `## Always` section: rules the agent always keeps live in `guardrails.alwaysRules`, and the lines of an `## Always` section are moved there (none doubled). No rules are added. The app suggests three rules for an AI Action's `guardrails.alwaysRules` (use only the information given, say what is not known instead of guessing, keep every value consistent); include them yourself if you want them.\n\nA person connects the tools that use a connected app (`connectionsToBind` in the response) in Agent Foundry: open the agent's `url`.\n\n**Run it on Grok Bot.** Send `externalSource: { \"kind\": \"grok_bot\", \"connectionId\": \"<id>\" }` on an automation agent. The connection is the bot: a person connects the Grok Bot routine (its webhook URL and sender key) in **Connected Apps**, and `GET /v1/connections?type=app` lists it with `app: \"Grok Bot\"`. The URL and key never pass through the API. The same checks as Agent Foundry apply: bring-your-own agents on your plan (`403 FEATURE_DISABLED` with `error.feature: \"agentBYOA\"`), a Grok Bot connection of your organization and an automation agent (`400` otherwise). To try it, publish the agent (publishing checks the connection with the routine first), put it on an `AI_AGENT` step and start a flow. When the step runs, Moxo sends the routine the step's input with a `completeUrl` and `today` (the organization's date, YYYY-MM-DD, to pass to the model when the routine works with dates); the routine finishes the step by calling it (`POST /v1/webhooks/grok-bot/{token}`). `externalSource` on the agent reads back its host and connection.\n\nCreating AI agents needs the AI agents feature on your plan; without it, the response is `403 FEATURE_DISABLED` with `error.feature`.\n\nThis runs as the person who owns the token, with exactly their permissions in Moxo, and is recorded as theirs. An organization API key gets `403 PERSON_TOKEN_REQUIRED`.\n\n**Permission:** Manage AI agents (`agents.manage`).\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"x-moxo-person-only":"PERSON_TOKEN_REQUIRED","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200,"description":"The agent's name, 1 to 200 characters, such as `Document Preparer`. Use a short role name, without markdown or ids."},"description":{"type":"string","description":"A one-line summary of what the agent does."},"icon":{"type":"string","enum":["Shield","Brain","Lightbulb","Search","FileCheck","Scale","Eye","Zap","Target","Sparkles","Wand2","Briefcase","ClipboardList","HeartPulse","MessageCircle","FileSearch","FileText","Languages","Mic","Pencil","ShieldCheck"],"description":"The icon shown for the agent. Optional; a default icon is used when it is left out."},"agentType":{"type":"string","enum":["prepare","advise","review","automation","chat"],"description":"The kind of agent. `prepare` fills in form fields before the assignee acts. `advise` makes recommendations while the assignee works, without blocking them. `review` checks a submission and can send it back. `automation` runs on its own as a step, with tools. `chat` answers questions in the portal and in comment threads."},"instructions":{"type":"string","description":"The agent's instructions, organized into sections with `##` headings. Suggested sections: for `prepare`, What to pre-fill, What context to gather and What to include in private notes; for `advise`, What to analyze, How to recommend and What to include in private notes; for `review`, What to check, How to explain and What to include in private notes; for `automation`, What to do; for `chat`, How to help and Tone & persona. Rules the agent always keeps go in `guardrails.alwaysRules`, one rule per entry; an `Always` section sent in the instructions is moved there. Write plain prose or numbered steps: the agent editor shows the text as written, so markdown emphasis such as bold or italics shows as literal characters."},"roleInstructions":{"type":"object","properties":{"prepare":{"type":"string","description":"Instructions for preparing: how the agent fills in and prepares data before the assignee acts."},"advise":{"type":"string","description":"Instructions for advising: how the agent analyzes and recommends while the assignee works."},"review":{"type":"string","description":"Instructions for reviewing: how the agent checks a submission after it is sent."}}},"toolIds":{"type":"array","items":{"type":"string"},"description":"The tools the agent can use, by id: `read_prior_steps`, `read_flow_context`, `search_skills`, `read_skill`, `send_email`, `call_webhook`, `call_rest_api`, `call_mcp_tool`, `call_external_app`, `set_field`, `update_org`, `send_notification`, `schedule_reminder`, `fetch_url`, `run_code`, `web_search`, `extract_document`, `query_table`, `append_output`, `browse`, `computer`, `lookup_knowledge` and `ask_specialist`. A tool that needs a connection is chosen here, and a person connects the account in Moxo. When one job needs several apps, give the same agent each app's tool."},"inputFields":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"The input's name, such as `company_name`, `tax_return` or `loan_amount`. Snake case is recommended."},"type":{"type":"string","enum":["text","number","boolean","date","file"],"description":"The input's type: `text`, `number`, `boolean` or `date` for a single value, or `file` for a document the agent reads."},"required":{"type":"boolean","description":"Whether the template must supply this input before it can be published. Defaults to `false`; use `true` only when the agent can't run without it."},"description":{"type":"string","description":"A one-line hint for the person setting up the step, about what to supply here. Optional."},"documentKind":{"type":"string","enum":["general_ledger","bank_statement","trial_balance","tax_invoice","balance_sheet","fixed_asset_schedule","statement"],"description":"For a `file` input only: what the document is (\"Reads as\" in Agent Foundry), one of `general_ledger`, `bank_statement`, `trial_balance`, `tax_invoice`, `balance_sheet`, `fixed_asset_schedule` or `statement`. With Arithmetic verification on, an agent that reads one file into one XLSX output gets its figures checked the way that kind of document adds up. Leave it out for Not set: the figures are extracted without that check."}},"required":["name","type"]},"description":"The named values the agent receives from earlier steps, roles or the start form. For `automation` and `prepare` agents; ignored for `advise`, `review` and `chat`. A `prepare` agent can use one to pass an identifier, such as an email or a vendor id, to a knowledge lookup. Add one entry for each named value the agent reads, or leave it empty. Optional."},"outputFields":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"The output's name, such as `risk_score`, `summary` or `underwriting_memo`. Later steps refer to it as `${{ steps.<agent step>.fields.<name> }}`."},"type":{"type":"string","enum":["text","number","boolean","choice","object","json","list","file"],"description":"The output's type: `text`, `number` or `boolean` for a single value; `choice` for one of a fixed set of values (list them in `enumValues`; a Decision step can branch on it); `object` for a record with sub-fields (list them in `fields`); `list` for repeating records (list their fields in `itemFields`); `json` for any JSON value; `file` for a file (set `fileFormat`)."},"fileFormat":{"type":"string","enum":["TXT","CSV","JSON","XLSX","DOCX","PDF","PPTX","HTML"],"description":"The file's format. Required when `type` is `file`. `PDF` (a report), `PPTX` (a slide deck), `DOCX` (a Word document) and `XLSX` (a spreadsheet) are designed with your branding. `CSV` and `JSON` hold rows of data. `TXT` is plain text. `HTML` is a web page; see `regions`."},"deliverAsPdf":{"type":"boolean","description":"For a DOCX output only. When `true`, the Word file is kept and a PDF copy is saved too. Later steps see the PDF as `<output name> PDF`, so no other output can use that name."},"enumValues":{"type":"array","items":{"type":"string"},"description":"The values the output can take, such as `[\"Approved\", \"Rejected\", \"Needs review\"]`. Required when `type` is `choice`. The agent returns exactly one of them."},"fields":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"The sub-field's name, such as `line_total`. Snake case is recommended."},"type":{"type":"string","enum":["text","number","boolean","date","choice","object"],"description":"The sub-field's type: `text`, `number`, `boolean` or `date` for a single value, `choice` for one of a fixed set of values (list them in `enumValues`), or `object` for further sub-fields (list them in `fields`)."},"description":{"type":"string"},"enumValues":{"type":"array","items":{"type":"string"},"description":"The values the sub-field can take. Required when `type` is `choice`."},"fields":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"The sub-field's name, such as `line_total`. Snake case is recommended."},"type":{"type":"string","enum":["text","number","boolean","date","choice","object"],"description":"The sub-field's type: `text`, `number`, `boolean` or `date` for a single value, `choice` for one of a fixed set of values (list them in `enumValues`), or `object` for further sub-fields (list them in `fields`)."},"description":{"type":"string"},"enumValues":{"type":"array","items":{"type":"string"},"description":"The values the sub-field can take. Required when `type` is `choice`."},"fields":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"The sub-field's name, such as `line_total`. Snake case is recommended."},"type":{"type":"string","enum":["text","number","boolean","date","choice"],"description":"The sub-field's type: `text`, `number`, `boolean` or `date` for a single value, or `choice` for one of a fixed set of values (list them in `enumValues`)."},"description":{"type":"string"},"enumValues":{"type":"array","items":{"type":"string"},"description":"The values the sub-field can take. Required when `type` is `choice`."}},"required":["name","type"]},"description":"The nested record's sub-fields. Required when `type` is `object`."}},"required":["name","type"]},"description":"The nested record's sub-fields. Required when `type` is `object`."}},"required":["name","type"]},"description":"The record's sub-fields. Required when `type` is `object`. Later steps refer to each one as `${{ steps.<agent step>.fields.<field>.<sub-field> }}`."},"itemFields":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"The sub-field's name, such as `line_total`. Snake case is recommended."},"type":{"type":"string","enum":["text","number","boolean","date","choice","object"],"description":"The sub-field's type: `text`, `number`, `boolean` or `date` for a single value, `choice` for one of a fixed set of values (list them in `enumValues`), or `object` for further sub-fields (list them in `fields`)."},"description":{"type":"string"},"enumValues":{"type":"array","items":{"type":"string"},"description":"The values the sub-field can take. Required when `type` is `choice`."},"fields":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"The sub-field's name, such as `line_total`. Snake case is recommended."},"type":{"type":"string","enum":["text","number","boolean","date","choice","object"],"description":"The sub-field's type: `text`, `number`, `boolean` or `date` for a single value, `choice` for one of a fixed set of values (list them in `enumValues`), or `object` for further sub-fields (list them in `fields`)."},"description":{"type":"string"},"enumValues":{"type":"array","items":{"type":"string"},"description":"The values the sub-field can take. Required when `type` is `choice`."},"fields":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"The sub-field's name, such as `line_total`. Snake case is recommended."},"type":{"type":"string","enum":["text","number","boolean","date","choice"],"description":"The sub-field's type: `text`, `number`, `boolean` or `date` for a single value, or `choice` for one of a fixed set of values (list them in `enumValues`)."},"description":{"type":"string"},"enumValues":{"type":"array","items":{"type":"string"},"description":"The values the sub-field can take. Required when `type` is `choice`."}},"required":["name","type"]},"description":"The nested record's sub-fields. Required when `type` is `object`."}},"required":["name","type"]},"description":"The nested record's sub-fields. Required when `type` is `object`."}},"required":["name","type"]},"description":"The fields of each item, when `type` is `list` and each item is a record. Each can be a single value, a `choice` or a nested `object`. Leave it out when the items have no fixed fields."},"description":{"type":"string","description":"A one-line description of what the output holds. Optional."},"required":{"type":"boolean","description":"Whether every run must fill this output. When `true`, a run that leaves it blank waits for a person. When left out, the output is optional, except a `file` output, which is required unless set to `false`."},"source":{"type":"string","enum":["inputs","judgment"],"description":"Whether a number output is checked against documents (\"Check against documents\" in the app). For a number output only; refused on any other type. `judgment` (the default when omitted): not checked. The value is proved as before, unless the AI marks it as its own assessment, such as a risk score. `inputs`: checked. The value must be read from the step's inputs or worked out from them, a judged mark is ignored, and a value Moxo cannot trace waits for a person."},"regions":{"type":"array","items":{"type":"string","minLength":1},"maxItems":24,"description":"The names of the page's sections, such as `[\"summary\", \"findings\", \"next-steps\"]`, up to 24. Required when `fileFormat` is `HTML`. Each top-level `<section>` of the page carries one as `data-region`, so the page keeps the same structure each time it is generated."},"viewAudience":{"type":"string","enum":["assignees","managers","flow","org_internal"],"description":"Who can open the page when it is first generated, when `fileFormat` is `HTML`: `assignees`, `managers`, `flow` or `org_internal`. Defaults to `assignees`, the narrowest. A person can share a page more widely afterward."},"exportable":{"type":"boolean","description":"Whether the page offers its own download, when `fileFormat` is `HTML`. Defaults to `false`."},"pageImages":{"oneOf":[{"type":"object","properties":{"mode":{"type":"string","enum":["bound"],"description":"`bound`: each picture has a fixed place on the page. List the pictures in `slots`. The page holds `<img data-moxo-image=\"NAME\" alt=\"...\">` for each name, without `src`. The recommended mode."},"slots":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","maxLength":81,"description":"A short name for the picture, up to 81 characters: letters, numbers, dots and hyphens, starting with a letter or number, such as `hero`. The page uses this exact name in `data-moxo-image` (`bound` mode) or `data-moxo-image-pool` (`pool` mode). An empty name is allowed only on a draft entry."},"fileRef":{"type":"string","maxLength":4000,"description":"The earlier upload the picture comes from, as a file reference such as `{File request / Files}`, up to 4,000 characters. Moxo reads the file when it generates the page and inserts the picture. Don't send image data. Empty only on a draft entry."},"required":{"type":"boolean","description":"Whether the picture must appear. With `true`, generating the page fails when the file has no picture or the page doesn't place this slot. With `false`, the picture is left out when the file has none. Use `false` unless the page is wrong without it."}},"required":["name","fileRef","required"]},"maxItems":12}},"required":["mode","slots"]},{"type":"object","properties":{"mode":{"type":"string","enum":["pool"],"description":"`pool`: the pictures are available and the page decides where each one goes. List them in `files`. The page places `<img data-moxo-image-pool=\"NAME\" alt=\"...\">` only where it uses one, without `src`. Pictures the page doesn't use are not shown."},"files":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","maxLength":81,"description":"A short name for the picture, up to 81 characters: letters, numbers, dots and hyphens, starting with a letter or number, such as `hero`. The page uses this exact name in `data-moxo-image` (`bound` mode) or `data-moxo-image-pool` (`pool` mode). An empty name is allowed only on a draft entry."},"fileRef":{"type":"string","maxLength":4000,"description":"The earlier upload the picture comes from, as a file reference such as `{File request / Files}`, up to 4,000 characters. Moxo reads the file when it generates the page and inserts the picture. Don't send image data. Empty only on a draft entry."}},"required":["name","fileRef"]},"maxItems":12}},"required":["mode","files"]}],"description":"Pictures from earlier uploads to place on the page, when `fileFormat` is `HTML`. Optional. With `mode` `bound` (recommended), each picture has a named slot, `{ name, required, fileRef }`, and the page holds `<img data-moxo-image=\"NAME\" alt=\"...\">` without `src`. With `mode` `pool`, the pictures are listed in `files` as `{ name, fileRef }`, and the page places `<img data-moxo-image-pool=\"NAME\" alt=\"...\">` only where it uses one. `fileRef` is a reference to a file from an earlier step, such as `{File request / Files}`. Don't embed image data."},"pageFiles":{"type":"object","properties":{"mode":{"type":"string","enum":["bound"],"description":"`bound`: each file has a fixed place on the page. The page holds `<div data-moxo-file=\"NAME\"></div>` for each name, and Moxo replaces that element with the file. Files have no `pool` mode."},"slots":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","maxLength":81,"description":"A short name for the file, up to 81 characters: letters, numbers, dots and hyphens, starting with a letter or number, such as `theme`. The page uses this exact name in `data-moxo-file`. An empty name is allowed only on a draft entry."},"source":{"type":"string","enum":["flow","agent"],"description":"Where the file comes from. `flow` (the default): `fileRef`, a file from an earlier step, read when the flow runs. `agent`: `agentFileId`, a text file uploaded on this agent, which is not asked for when the flow starts."},"fileRef":{"type":"string","maxLength":4000,"description":"With `source` `flow`, or no `source`: the earlier upload the text comes from, as a file reference such as `{File request / Files}`, up to 4,000 characters. Moxo reads the file when it generates the page and inserts its text. The file must be text (a stylesheet, an SVG drawing, data or a fixed part of the page) and can't run code. Empty only on a draft entry, and empty when `source` is `agent`."},"agentFileId":{"type":"string","maxLength":80,"description":"With `source` `agent`: the id of a text file uploaded on this agent, up to 80 characters. Leave it unset until a file is uploaded on the agent in Moxo. Empty when `source` is `flow`."},"agentFileName":{"type":"string","maxLength":255},"agentFileSize":{"type":"integer","minimum":0,"maximum":524288},"required":{"type":"boolean","description":"Whether the file must appear. With `true`, generating the page fails when the file is missing, isn't text, would run code, or isn't placed on the page. With `false`, the file is left out when the reference has no text; a file that isn't text or would run code still stops the page. Use `false` unless the page is wrong without it."}},"required":["name","fileRef","required"]},"maxItems":12}},"required":["mode","slots"],"description":"Text files to place on the page, when `fileFormat` is `HTML`. Optional. Each slot is `{ name, required, source, fileRef, agentFileId }`. With `source` `flow` (the default), `fileRef` is a reference to a file from an earlier step, such as `{File request / Files}`, read when the flow runs. With `source` `agent`, `agentFileId` names a text file uploaded on this agent. The page holds an empty `<div data-moxo-file=\"NAME\"></div>` for each slot. A file must be text (a stylesheet, an SVG drawing, data or a fixed part of the page) and can't run code. Remote addresses are not accepted, and files have no `pool` mode."}},"required":["name","type"]},"description":"For `automation` agents only: the named results the agent produces, which later steps can use, such as a PDF memo or a match score. Leave it empty when no later step uses a result, for example when the agent only sends an email. Leave out ids: Moxo assigns them and keeps them stable."},"sendBackReply":{"type":"string","enum":["outcome_with_reason","outcome_only"],"description":"For `review` agents only: what the person who submitted hears when the agent sends the submission back. `outcome_with_reason` (the default) says what to fix, with each reason on its field. `outcome_only` says only that it needs another look, with no reasons or marked fields, for sensitive checks such as fraud or KYC screening. Ignored for other agent types."},"escalation":{"type":"object","properties":{"escalate":{"type":"string","maxLength":5000,"description":"\"Also escalate when…\", in your own words, such as \"The vendor is new to us.\" The agent judges it and, when it applies, hands the work to a person and stops. Every agent type. An empty string clears it. Who it goes to is set on each template (`settings.aiEscalations`), not on the agent."}},"additionalProperties":false,"description":"When a person steps in on the agent's work: `{ \"escalate\": \"…\" }`. On top of it, every agent always escalates when it can't make progress or can't finish safely, and a chat assistant also when someone asks for a person. Leave it out to keep the current text."},"requireHumanReview":{"type":"boolean","description":"Human in the loop › Require human review: a person approves the agent's result before any step that uses it completes. For a `review` agent, a person on the step confirms its approvals. Every step that uses the agent follows it, and a step can't turn it off. `automation` and `review` agents only; stored off for other types."},"reviewChat":{"type":"boolean","description":"With `requireHumanReview`: reviewers can chat with the AI to change its draft before they approve (\"Chat to change the draft before approving\"). Needs conversational review on your plan. `automation` agents only."},"reviewSampleSize":{"type":["integer","null"],"minimum":1,"maximum":500,"description":"With `requireHumanReview`: reviewers check a sample of at least this many lines of a list result, each picked with the same chance, instead of every line. `null` clears only this minimum. A template step's own `reviewSample` still applies, and while this is set a step can check more lines, never fewer. `automation` agents only."},"actionApprovals":{"type":["object","null"],"properties":{"all":{"type":"boolean","enum":[true],"description":"Every action the agent can take waits for a person's approval, including actions added later."},"tools":{"type":"array","items":{"type":"string","enum":["send_email","set_field","update_org","call_rest_api","call_webhook","call_mcp_tool","call_external_app","send_notification","schedule_reminder"]},"maxItems":9,"description":"Only these actions wait for a person's approval. Each is one of `send_email`, `set_field`, `update_org`, `call_rest_api`, `call_webhook`, `call_mcp_tool`, `call_external_app`, `send_notification` or `schedule_reminder`."}},"additionalProperties":false,"description":"Human in the loop › Approve actions before they run: `{ \"all\": true }` makes every action wait for a person's approval, actions added later included; `{ \"tools\": [...] }` only those. `null` turns it off. Every step that uses the agent follows it: a step can add actions, never remove these. `automation` agents only: a `review` agent takes no outside action, so a value sent for one is stored and does nothing."},"spotIssues":{"type":"boolean","description":"Prepare agents: Settings › Flag issues. The agent flags what looks wrong in what it filled. A new Prepare agent starts with it off."},"memoryMode":{"type":"string","enum":["off","suggest","auto"],"description":"Memory › Learn from feedback: `off`, `suggest` (each learning waits for a person to keep it; the default) or `auto`."},"guardrails":{"type":["object","null"],"properties":{"maxOutputLength":{"anyOf":[{"type":"null"},{"type":"number","minimum":1,"maximum":100000}],"description":"A soft cap on the length of an answer, in characters."},"alwaysRules":{"type":"array","items":{"type":"string","maxLength":2000},"maxItems":50,"description":"Rules the agent keeps in every answer they apply to, one per item: how it behaves (its tone or language), steps it takes, and what it never does. Checked on every answer. At most 50 entries of up to 2,000 characters each. Sending the list replaces it; `[]` empties it."},"topicsToRefuse":{"type":"array","items":{"type":"string","maxLength":2000},"maxItems":50,"description":"Subjects the agent declines to discuss, one per item, such as `tax advice`. At most 50 entries of up to 2,000 characters each. Sending the list replaces it; `[]` empties it."},"contentRestrictions":{"type":"array","items":{"type":"string"},"description":"Deprecated: use `alwaysRules` and `topicsToRefuse`. The older single list, from before the two. It is still read and still accepted: each entry is kept as a rule or a topic by its meaning until it is moved to one of the two lists. Send `[]` once its entries are moved."},"showSources":{"type":"boolean","description":"Show the sources an answer used."},"showFlagsToAssignee":{"type":"boolean","description":"Show this agent's notes to the person on the step: Prepare's flags, Advise's how the AI got this."},"showReasoningToAssignee":{"type":"boolean","description":"Advise agents only. Whether the person deciding a step reads the reasons under the recommendation. Absent or `true` (the default): they do. `false`: they read the recommendation and what to confirm before acting, without the reasons. Separate from `showFlagsToAssignee`. The flow's managers always read the reasons."},"answersMustCite":{"type":"boolean","description":"Every answer cites a source. Kept for Review, Prepare and Advise agents. Every chat answer is checked against what it read."},"piiHandling":{"type":"string","enum":["off","redact"],"description":"What the agent does with personal details."},"creditLimitPerRun":{"anyOf":[{"type":"null"},{"type":"integer","minimum":1,"maximum":100000}],"description":"The most AI credits one run may use. Empty: no limit."}},"additionalProperties":{},"description":"The agent's limits: rules it keeps, how sure it must be, what it does with personal details."},"color":{"type":"string","description":"The agent's color."},"modelConfig":{"type":"object","properties":{"mode":{"type":"string","enum":["auto","effort"],"description":"auto: Moxo picks the model. effort: you pick how hard the task is."},"complexity":{"type":"string","enum":["simple","standard","complex"],"description":"With mode effort: how hard the task is."},"provider":{"type":"string","description":"The model's provider, when one is picked."},"model":{"type":"string","description":"The model, when one is picked."},"connection":{"type":"string","pattern":"^@connection:.+/s","description":"The organization's own AI connection this agent runs on. Kept or removed, never added; connect a new one in Agent Foundry."}},"additionalProperties":{},"description":"Which model the agent runs on."},"toolConfig":{"type":"object","properties":{"call_rest_api":{"type":"object","properties":{"connection":{"type":"string","pattern":"^@connection:.+/s","description":"The Secret the REST API tool sends. Kept or removed, never added; pick a new one in Agent Foundry."},"defaultMethod":{"type":"string","enum":["GET","POST","PUT","PATCH","DELETE"],"description":"The method a call uses when the agent names none."}},"required":["connection"],"additionalProperties":{},"description":"Call a REST API with a Secret."},"call_webhook":{"type":"object","properties":{"connection":{"type":"string","pattern":"^@connection:.+/s","description":"The Secret the webhook tool sends. Kept or removed, never added."}},"required":["connection"],"additionalProperties":{},"description":"Send a webhook with a Secret."},"call_mcp_servers":{"type":"array","items":{"type":"object","properties":{"connection":{"type":"string","pattern":"^@connection:.+/s","description":"The MCP server connection. Kept or removed, never added."},"selectedToolNames":{"type":"array","items":{"type":"string"},"description":"The server's tools the agent may call."},"readOnlyToolNames":{"type":"array","items":{"type":"string"},"description":"Tools the server gives no hint for that the builder marked as only reading, so an AI recommendation or pre-fill may call them. A hint from the server always wins."},"serverName":{"type":"string","description":"The server's name as Agent Foundry showed it when it was picked."}},"required":["connection"],"additionalProperties":{}},"description":"The agent's MCP servers, in order. A chat agent keeps up to 20, each read only in a group chat of colleagues; every other agent keeps one."},"call_mcp_tool":{"type":"object","properties":{"connection":{"type":"string","pattern":"^@connection:.+/s","description":"The MCP server connection. Kept or removed, never added."},"selectedToolNames":{"type":"array","items":{"type":"string"},"description":"The server's tools the agent may call."},"readOnlyToolNames":{"type":"array","items":{"type":"string"},"description":"Tools the server gives no hint for that the builder marked as only reading. A hint from the server always wins."},"serverName":{"type":"string","description":"The server's name as Agent Foundry showed it when it was picked."}},"required":["connection"],"additionalProperties":{},"description":"Deprecated: the older form of the agent's one MCP server. A pull returns it as a mirror of the first entry of `call_mcp_servers`. Sent alone it is saved as `call_mcp_servers`; sent with it, it must equal the list's first entry.","deprecated":true},"call_external_app":{"type":"array","items":{"type":"object","properties":{"appId":{"type":"string","description":"The connected app, such as hubspot."},"connectionMode":{"type":"string","enum":["fixed","per_bundle"],"description":"`fixed`: one connection for every run. `per_bundle`: each flow uses the connection of the connection bundle it was started with."},"connection":{"type":"string","pattern":"^@connection:.+/s","description":"The app's connection. Kept or removed, never added; connect a new app in Agent Foundry."},"selectedActionIds":{"type":"array","items":{"type":"string"},"description":"The app's actions the agent may call."}},"required":["appId"],"additionalProperties":{}},"description":"Connected apps the agent works in, each with its actions."},"browse":{"type":"object","properties":{},"additionalProperties":{},"description":"Which sites the agent may browse."},"web_search":{"type":"object","properties":{"allowedDomains":{"type":"array","items":{"type":"string"},"description":"The domains a web search draws on, each with its subdomains. Empty or left out: any public site."}},"additionalProperties":{},"description":"Which sites the agent may search."},"fetch_url":{"type":"object","properties":{"allowedDomains":{"type":"array","items":{"type":"string"},"description":"The domains whose pages the agent may open, each with its subdomains. Empty or left out: any public site."}},"additionalProperties":{},"description":"Which sites the agent may open pages on."},"extract_document":{"type":"object","properties":{"method":{"type":"string","enum":["standard","complex_documents","exact_amounts"],"description":"How documents are read: `standard`, or `complex_documents` with Advanced extract. `exact_amounts` is an older value, read and never written."},"advancedExtract":{"type":"boolean","description":"Advanced extract: a stronger reader for scanned or handwritten pages, where your organization has one."},"advancedOcr":{"type":"boolean","description":"An older form of Advanced extract. Read, never written; use `advancedExtract`."},"arithmeticCheck":{"type":"boolean","description":"Check figures against the document: totals and running balances are checked against the lines they add up. On when left out."},"arithmeticVerification":{"type":"boolean","description":"The older name of `arithmeticCheck`. Read, never written."},"pack":{"type":"object","properties":{"requiredTypes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The document type's id."},"label":{"type":"string","description":"The document type's name."},"hints":{"type":"array","items":{"type":"string"},"description":"Words that point to this type."}},"required":["id","label"],"additionalProperties":{}},"description":"The document types the agent requires."}},"required":["requiredTypes"],"additionalProperties":{},"description":"The document types a gallery agent requires. Set when the agent is installed."},"verificationCriteria":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The check's id on the agent."},"kind":{"type":"string","enum":["journal_footing","custom"],"description":"`journal_footing`: each journal's debits equal its credits. `custom`: a check in your own words."},"statement":{"type":"string","description":"The check, in plain words."},"check":{"type":"string","description":"Set by Moxo: the library check this sentence runs as."},"confirmedStatement":{"type":"string","description":"Set by Moxo: the words the library check was confirmed for."}},"required":["id","kind","statement"],"additionalProperties":{}},"description":"Your own checks on the figures, each a plain sentence."},"documentAbout":{"type":"string","description":"A note on how accounts show up in the document and which lines to ignore."},"documentKindsOff":{"type":"array","items":{"type":"string","enum":["general_ledger","bank_statement","trial_balance","tax_invoice","balance_sheet","fixed_asset_schedule","statement"]},"description":"Verification › Document math: the document kinds whose math is not checked. Left out: every kind is checked."},"documentKind":{"type":"string","description":"An older place for what the document is; a save moves it onto the file input."}},"additionalProperties":false,"description":"How the agent reads documents: Advanced extract, Check figures against the document and the checks under it."},"data_table":{"type":"object","properties":{"grants":{"type":"array","items":{"type":"object","properties":{"table":{"type":"string","pattern":"^@table:.+/s","description":"A data table, by name: `@table:<name>` (`[id:<id>]` after it when two share a name)."},"read":{"type":"boolean","description":"The agent may read the table."},"fields":{"type":"array","items":{"type":"string"},"description":"The table's columns the agent may use, by key."}},"required":["table","read"],"additionalProperties":{}},"description":"The data tables the agent may read or write. Kept or removed, never added; grant a new one in Agent Foundry."}},"additionalProperties":{},"description":"Read and write data tables."},"computer":{"type":"object","properties":{"browsingModel":{"type":"string","description":"Which model browses for the agent's Computer."}},"additionalProperties":{},"description":"The agent's Computer."},"permissions":{"type":"object","properties":{"tools":{"type":"object","additionalProperties":{"type":"string","enum":["allow","ask","off"]},"description":"Each tool's level: `allow`, `ask` (a person approves each call) or `off`."},"rules":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The rule's id, as read."},"tool":{"type":"string","description":"The tool the rule checks."},"fact":{"type":"string","description":"What Moxo checks about the call, such as `recipient_count`."},"op":{"type":"string","description":"How the fact is compared, such as `more_than`."},"value":{"anyOf":[{"type":"boolean"},{"type":"number"},{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"What the fact is compared with."},"then":{"type":"string","enum":["ask","off"],"description":"`ask` (a person approves the call) or `off`."}},"required":["tool","fact","op","value","then"]},"description":"Custom rules the agent already has. Kept or removed, never added or changed (`TOOL_RULES_IN_GUARDRAILS`): write a new limit as one of the agent's guardrails."}},"additionalProperties":{},"description":"Which tool calls the agent may make, must ask about, or may not make."}},"additionalProperties":{},"description":"Each tool's settings. Connections, Secrets and data-table grants are kept or removed, never added: a person adds them in Agent Foundry."},"knowledge":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"The knowledge source, by its name in Agent Foundry (`[id:<id>]` after it when two share a name)."},"required":{"type":"boolean","description":"The agent cannot answer without it."}},"required":["name"],"additionalProperties":false},"description":"Knowledge the agent reads. Upload a new file first (POST /v1/agents/{id}/knowledge/upload-init), then name it here."},"skills":{"type":"array","items":{"type":"string","pattern":"^@skill:.+/s","description":"A skill, by name: `@skill:<name>` (`[id:<id>]` after it when two share a name)."},"description":"Skills from the organization's library."},"specialistAgents":{"type":"array","items":{"type":"string","pattern":"^@agent:.+/s","description":"An agent, by name: `@agent:<name>` (`[id:<id>]` after it when two share a name)."},"description":"Other agents this agent may ask."},"supervisorConfig":{"type":"object","properties":{"enabled":{"type":"boolean","description":"A second model double-checks the agent's work before it is used."},"scope":{"type":"string","enum":["unproved","whole_result"],"description":"What the second review rereads: unproved (the values Moxo's checks could not prove, the default) or whole_result (every value of the result)."},"customRules":{"type":"string","description":"What the second review checks, in words (\"What should it check?\")."}},"additionalProperties":false,"description":"Double-check with a second model: its switch and what it checks."},"verificationConfig":{"type":"object","properties":{"checkingModel":{"type":"object","properties":{"kind":{"type":"string","enum":["auto","same_as_agent","tier","model","connection","own_agent"],"description":"What the agent's checks run on: auto (Moxo picks a tested checker for each kind of check), same_as_agent, tier (one of Moxo's tiers), model (a model from the agent model picker), connection (a model on one of your AI keys) or own_agent (not accepted yet)."},"tier":{"type":"string","enum":["simple","standard","complex"],"description":"With kind tier: the Moxo tier the checks run on."},"connectionId":{"type":"string","description":"With kind connection: the id of one of your organization's AI connections."},"model":{"type":"string","description":"With kind model: the model's id from the agent model picker. With kind connection: the model on that connection; absent uses the connection's own model."},"agentId":{"type":"string","description":"With kind own_agent: the id of an agent your organization built. Refused at save for now."}},"required":["kind"],"additionalProperties":false,"description":"The model the agent's checks run on. Absent follows the organization's default, else auto."},"yourChecks":{"type":"array","items":{"type":"string"},"maxItems":40,"description":"What else must be true of the agent's work, one check per item. A check Moxo can run as code runs as code; the checking model judges the rest."}},"additionalProperties":false,"description":"The checking model and your own checks."},"reviewRules":{"type":"object","properties":{"rules":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The rule's id on the agent. Send it back unchanged with the rule."},"text":{"type":"string","description":"The check, in plain words (up to 1,000 characters)."},"from":{"type":"array","items":{"type":"string"},"description":"The lines of What to check the rule was made from. Empty for a rule a person added."},"origin":{"type":"string","enum":["compiled","edited","added"],"description":"`compiled`: Moxo made it from What to check. `edited`: a person reworded it. `added`: a person wrote it."}},"required":["id","text","from","origin"],"additionalProperties":false},"maxItems":80,"description":"The rules the review checks, in order (up to 80)."},"compiledFor":{"type":"string","description":"Set by Moxo: which What to check the rules were made from. Send it back as you read it."}},"required":["rules"],"additionalProperties":false,"description":"A review agent's rules: the checks Moxo makes from its What to check after each save. When the instructions change, Moxo makes them again and keeps the ones a person edited or added. Ignored for other agent types."},"chatConfig":{"type":"object","properties":{"displayName":{"type":"string","minLength":1,"maxLength":50,"description":"The name people see in chat. At most 50 characters."},"persona":{"type":"string","description":"How the agent sounds, in words."},"triggerMode":{"type":"string","enum":["auto_reply","mention_only"],"description":"`auto_reply`: the agent answers every message. `mention_only`: only when named."},"coolOffMinutes":{"type":"integer","minimum":0,"maximum":1440,"description":"Minutes the agent stays quiet on a step after an internal user replies. Default 15."},"scopes":{"type":"object","properties":{"portal":{"type":"boolean","description":"The agent answers in the portal. Default on."},"inFlow":{"type":"boolean","description":"The agent answers in a flow's chat. Default on."},"rooms":{"type":"object","properties":{"enabled":{"type":"boolean","description":"The agent answers in group conversations. Default off."},"withExternalPeople":{"type":"boolean","description":"Also in group conversations with external users. Default off."}},"additionalProperties":false,"description":"Group conversations."}},"additionalProperties":false,"description":"Where the agent talks."}},"additionalProperties":false,"description":"A chat agent's settings: its display name, persona and where it talks. When it hands a chat to a person is `escalation`, as for every agent."},"selfImprove":{"type":"boolean","description":"The agent proposes improvements from its runs. Default false."},"chatDisplayName":{"type":"string","minLength":1,"maxLength":50,"description":"Chat agents: the name shown in chat. Defaults to the agent's name."},"externalSource":{"type":["object","null"],"properties":{"kind":{"type":"string","enum":["grok_bot"],"description":"`grok_bot`: the agent runs on a Grok Bot routine."},"connectionId":{"type":"string","minLength":1,"maxLength":200,"description":"The id of a Grok Bot connection your organization made in **Connected Apps**. `GET /v1/connections?type=app` lists it, with `app: \"Grok Bot\"`."}},"required":["kind","connectionId"],"additionalProperties":false,"description":"Where the agent runs. Without it, or with `null`, the agent runs in Moxo. To run it on a Grok Bot routine, send `{ \"kind\": \"grok_bot\", \"connectionId\": \"<id>\" }`. A person makes the connection in **Connected Apps**, never through the API. Only an automation agent runs on Grok Bot, and only on a plan with bring-your-own agents (otherwise `403 FEATURE_DISABLED` with `error.feature: \"agentBYOA\"`). A connection that isn't a Grok Bot connection of your organization returns `400`."},"requiredConnections":{"type":"array","items":{"type":"string","maxLength":100},"maxItems":20,"description":"Names of the apps the agent works in (for example \"HubSpot\"). Not saved on the agent; a person connects them in Moxo."}},"required":["name","agentType","instructions"],"additionalProperties":false}}}},"responses":{"201":{"description":"The draft agent","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/BuilderAgent"}},"required":["success","data"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/agents/{id}":{"get":{"tags":["AI agents"],"summary":"Get an AI agent","description":"Returns one AI agent. With **Manage AI agents**, also what setup is still missing.\n\nA personal access token reads it with its person's permissions. An organization API key with `templates:read` reads it too, as an admin does; changing it still needs a personal access token.\n\n**Permission for a personal access token:** Manage AI agents (`agents.manage`). A template editor can read only a published agent.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `templates:read`","security":[{"bearerAuth":["templates:read"]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The agent. A template editor gets only the fields of a published agent.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"anyOf":[{"$ref":"#/components/schemas/BuilderAgent"},{"$ref":"#/components/schemas/BuilderAttachableAgent"}]}},"required":["success","data"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"tags":["AI agents"],"summary":"Update an AI agent","description":"Changes only the settings you send, named as in the agent file (`GET /v1/agents/{id}/file`), and saves them the same way a pushed file is saved, through the same checks as a save in Agent Foundry. `null` clears a setting. A published agent keeps running its live version, and the change is saved as unpublished until you publish it.\n\nA connection, Secret or data-table grant is kept or removed, never added or changed: a person does that in Agent Foundry. Knowledge, skills and other agents are named, and must be your organization's: upload new knowledge first (`POST /v1/agents/{id}/knowledge/upload-init`). To rename an input or output, write its old name on `renamedFrom`, so steps that read it keep working. Computer tasks change only from a person's own signed-in Moxo session, never with a token.\n\n`422 CHANGE_REFUSED` lists each problem with where and how to fix it, and nothing is saved. If someone else changed the agent at the same moment, the response is `409 CONFLICT`: read it again and resend.\n\n**Run it on Grok Bot.** Send `externalSource: { \"kind\": \"grok_bot\", \"connectionId\": \"<id>\" }` on an automation agent. The connection is the bot: a person connects the Grok Bot routine (its webhook URL and sender key) in **Connected Apps**, and `GET /v1/connections?type=app` lists it with `app: \"Grok Bot\"`. The URL and key never pass through the API. The same checks as Agent Foundry apply: bring-your-own agents on your plan (`403 FEATURE_DISABLED` with `error.feature: \"agentBYOA\"`), a Grok Bot connection of your organization and an automation agent (`400` otherwise). To try it, publish the agent (publishing checks the connection with the routine first), put it on an `AI_AGENT` step and start a flow. When the step runs, Moxo sends the routine the step's input with a `completeUrl` and `today` (the organization's date, YYYY-MM-DD, to pass to the model when the routine works with dates); the routine finishes the step by calling it (`POST /v1/webhooks/grok-bot/{token}`). `externalSource` on the agent reads back its host and connection.\n\nThis runs as the person who owns the token, with exactly their permissions in Moxo, and is recorded as theirs. An organization API key gets `403 PERSON_TOKEN_REQUIRED`.\n\n**Permission:** Manage AI agents (`agents.manage`).\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"x-moxo-person-only":"PERSON_TOKEN_REQUIRED","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200,"description":"The agent's name, 1 to 200 characters, such as `Document Preparer`. Use a short role name, without markdown or ids."},"description":{"type":["string","null"],"description":"One line on what this agent does."},"icon":{"type":["string","null"],"enum":["Shield","Brain","Lightbulb","Search","FileCheck","Scale","Eye","Zap","Target","Sparkles","Wand2","Briefcase","ClipboardList","HeartPulse","MessageCircle","FileSearch","FileText","Languages","Mic","Pencil","ShieldCheck",null],"description":"The agent's icon."},"color":{"type":["string","null"],"description":"The agent's color."},"agentType":{"type":"string","enum":["prepare","advise","review","automation","chat"],"description":"The agent's kind: `prepare`, `advise`, `review`, `automation` or `chat`."},"instructions":{"type":["string","null"],"description":"The agent's instructions, organized into sections with `##` headings. Suggested sections: for `prepare`, What to pre-fill, What context to gather and What to include in private notes; for `advise`, What to analyze, How to recommend and What to include in private notes; for `review`, What to check, How to explain and What to include in private notes; for `automation`, What to do; for `chat`, How to help and Tone & persona. Rules the agent always keeps go in `guardrails.alwaysRules`, one rule per entry; an `Always` section sent in the instructions is moved there. Write plain prose or numbered steps: the agent editor shows the text as written, so markdown emphasis such as bold or italics shows as literal characters."},"roleInstructions":{"type":["object","null"],"additionalProperties":{"type":"string"},"description":"Instructions for each way a step can use the agent, keyed `prepare`, `advise` and `review`."},"inputFields":{"type":["array","null"],"items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"The input's name, such as `company_name`, `tax_return` or `loan_amount`. Snake case is recommended."},"type":{"type":"string","enum":["text","number","boolean","date","file"],"description":"The input's type: `text`, `number`, `boolean` or `date` for a single value, or `file` for a document the agent reads."},"required":{"type":"boolean","description":"Whether the template must supply this input before it can be published. Defaults to `false`; use `true` only when the agent can't run without it."},"description":{"type":"string","description":"A one-line hint for the person setting up the step, about what to supply here. Optional."},"documentKind":{"type":"string","enum":["general_ledger","bank_statement","trial_balance","tax_invoice","balance_sheet","fixed_asset_schedule","statement"],"description":"For a `file` input only: what the document is (\"Reads as\" in Agent Foundry), one of `general_ledger`, `bank_statement`, `trial_balance`, `tax_invoice`, `balance_sheet`, `fixed_asset_schedule` or `statement`. With Arithmetic verification on, an agent that reads one file into one XLSX output gets its figures checked the way that kind of document adds up. Leave it out for Not set: the figures are extracted without that check."},"renamedFrom":{"type":"string","minLength":1,"description":"The name this had before. Send it once, when you rename it, so what reads it keeps working."}},"required":["name","type"]},"description":"What the agent reads, by name. Steps wire their values in."},"outputFields":{"type":["array","null"],"items":{"allOf":[{"type":"object","properties":{"name":{"type":"string","description":"The output's name, such as `risk_score`, `summary` or `underwriting_memo`. Later steps refer to it as `${{ steps.<agent step>.fields.<name> }}`."},"type":{"type":"string","enum":["text","number","boolean","choice","object","json","list","file"],"description":"The output's type: `text`, `number` or `boolean` for a single value; `choice` for one of a fixed set of values (list them in `enumValues`; a Decision step can branch on it); `object` for a record with sub-fields (list them in `fields`); `list` for repeating records (list their fields in `itemFields`); `json` for any JSON value; `file` for a file (set `fileFormat`)."},"fileFormat":{"type":"string","enum":["TXT","CSV","JSON","XLSX","DOCX","PDF","PPTX","HTML"],"description":"The file's format. Required when `type` is `file`. `PDF` (a report), `PPTX` (a slide deck), `DOCX` (a Word document) and `XLSX` (a spreadsheet) are designed with your branding. `CSV` and `JSON` hold rows of data. `TXT` is plain text. `HTML` is a web page; see `regions`."},"deliverAsPdf":{"type":"boolean","description":"For a DOCX output only. When `true`, the Word file is kept and a PDF copy is saved too. Later steps see the PDF as `<output name> PDF`, so no other output can use that name."},"enumValues":{"type":"array","items":{"type":"string"},"description":"The values the output can take, such as `[\"Approved\", \"Rejected\", \"Needs review\"]`. Required when `type` is `choice`. The agent returns exactly one of them."},"fields":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"The sub-field's name, such as `line_total`. Snake case is recommended."},"type":{"type":"string","enum":["text","number","boolean","date","choice","object"],"description":"The sub-field's type: `text`, `number`, `boolean` or `date` for a single value, `choice` for one of a fixed set of values (list them in `enumValues`), or `object` for further sub-fields (list them in `fields`)."},"description":{"type":"string"},"enumValues":{"type":"array","items":{"type":"string"},"description":"The values the sub-field can take. Required when `type` is `choice`."},"fields":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"The sub-field's name, such as `line_total`. Snake case is recommended."},"type":{"type":"string","enum":["text","number","boolean","date","choice","object"],"description":"The sub-field's type: `text`, `number`, `boolean` or `date` for a single value, `choice` for one of a fixed set of values (list them in `enumValues`), or `object` for further sub-fields (list them in `fields`)."},"description":{"type":"string"},"enumValues":{"type":"array","items":{"type":"string"},"description":"The values the sub-field can take. Required when `type` is `choice`."},"fields":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"The sub-field's name, such as `line_total`. Snake case is recommended."},"type":{"type":"string","enum":["text","number","boolean","date","choice"],"description":"The sub-field's type: `text`, `number`, `boolean` or `date` for a single value, or `choice` for one of a fixed set of values (list them in `enumValues`)."},"description":{"type":"string"},"enumValues":{"type":"array","items":{"type":"string"},"description":"The values the sub-field can take. Required when `type` is `choice`."}},"required":["name","type"]},"description":"The nested record's sub-fields. Required when `type` is `object`."}},"required":["name","type"]},"description":"The nested record's sub-fields. Required when `type` is `object`."}},"required":["name","type"]},"description":"The record's sub-fields. Required when `type` is `object`. Later steps refer to each one as `${{ steps.<agent step>.fields.<field>.<sub-field> }}`."},"itemFields":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"The sub-field's name, such as `line_total`. Snake case is recommended."},"type":{"type":"string","enum":["text","number","boolean","date","choice","object"],"description":"The sub-field's type: `text`, `number`, `boolean` or `date` for a single value, `choice` for one of a fixed set of values (list them in `enumValues`), or `object` for further sub-fields (list them in `fields`)."},"description":{"type":"string"},"enumValues":{"type":"array","items":{"type":"string"},"description":"The values the sub-field can take. Required when `type` is `choice`."},"fields":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"The sub-field's name, such as `line_total`. Snake case is recommended."},"type":{"type":"string","enum":["text","number","boolean","date","choice","object"],"description":"The sub-field's type: `text`, `number`, `boolean` or `date` for a single value, `choice` for one of a fixed set of values (list them in `enumValues`), or `object` for further sub-fields (list them in `fields`)."},"description":{"type":"string"},"enumValues":{"type":"array","items":{"type":"string"},"description":"The values the sub-field can take. Required when `type` is `choice`."},"fields":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"The sub-field's name, such as `line_total`. Snake case is recommended."},"type":{"type":"string","enum":["text","number","boolean","date","choice"],"description":"The sub-field's type: `text`, `number`, `boolean` or `date` for a single value, or `choice` for one of a fixed set of values (list them in `enumValues`)."},"description":{"type":"string"},"enumValues":{"type":"array","items":{"type":"string"},"description":"The values the sub-field can take. Required when `type` is `choice`."}},"required":["name","type"]},"description":"The nested record's sub-fields. Required when `type` is `object`."}},"required":["name","type"]},"description":"The nested record's sub-fields. Required when `type` is `object`."}},"required":["name","type"]},"description":"The fields of each item, when `type` is `list` and each item is a record. Each can be a single value, a `choice` or a nested `object`. Leave it out when the items have no fixed fields."},"description":{"type":"string","description":"A one-line description of what the output holds. Optional."},"required":{"type":"boolean","description":"Whether every run must fill this output. When `true`, a run that leaves it blank waits for a person. When left out, the output is optional, except a `file` output, which is required unless set to `false`."},"source":{"type":"string","enum":["inputs","judgment"],"description":"Whether a number output is checked against documents (\"Check against documents\" in the app). For a number output only; refused on any other type. `judgment` (the default when omitted): not checked. The value is proved as before, unless the AI marks it as its own assessment, such as a risk score. `inputs`: checked. The value must be read from the step's inputs or worked out from them, a judged mark is ignored, and a value Moxo cannot trace waits for a person."},"regions":{"type":"array","items":{"type":"string","minLength":1},"maxItems":24,"description":"The names of the page's sections, such as `[\"summary\", \"findings\", \"next-steps\"]`, up to 24. Required when `fileFormat` is `HTML`. Each top-level `<section>` of the page carries one as `data-region`, so the page keeps the same structure each time it is generated."},"viewAudience":{"type":"string","enum":["assignees","managers","flow","org_internal"],"description":"Who can open the page when it is first generated, when `fileFormat` is `HTML`: `assignees`, `managers`, `flow` or `org_internal`. Defaults to `assignees`, the narrowest. A person can share a page more widely afterward."},"exportable":{"type":"boolean","description":"Whether the page offers its own download, when `fileFormat` is `HTML`. Defaults to `false`."},"pageImages":{"oneOf":[{"type":"object","properties":{"mode":{"type":"string","enum":["bound"],"description":"`bound`: each picture has a fixed place on the page. List the pictures in `slots`. The page holds `<img data-moxo-image=\"NAME\" alt=\"...\">` for each name, without `src`. The recommended mode."},"slots":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","maxLength":81,"description":"A short name for the picture, up to 81 characters: letters, numbers, dots and hyphens, starting with a letter or number, such as `hero`. The page uses this exact name in `data-moxo-image` (`bound` mode) or `data-moxo-image-pool` (`pool` mode). An empty name is allowed only on a draft entry."},"fileRef":{"type":"string","maxLength":4000,"description":"The earlier upload the picture comes from, as a file reference such as `{File request / Files}`, up to 4,000 characters. Moxo reads the file when it generates the page and inserts the picture. Don't send image data. Empty only on a draft entry."},"required":{"type":"boolean","description":"Whether the picture must appear. With `true`, generating the page fails when the file has no picture or the page doesn't place this slot. With `false`, the picture is left out when the file has none. Use `false` unless the page is wrong without it."}},"required":["name","fileRef","required"]},"maxItems":12}},"required":["mode","slots"]},{"type":"object","properties":{"mode":{"type":"string","enum":["pool"],"description":"`pool`: the pictures are available and the page decides where each one goes. List them in `files`. The page places `<img data-moxo-image-pool=\"NAME\" alt=\"...\">` only where it uses one, without `src`. Pictures the page doesn't use are not shown."},"files":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","maxLength":81,"description":"A short name for the picture, up to 81 characters: letters, numbers, dots and hyphens, starting with a letter or number, such as `hero`. The page uses this exact name in `data-moxo-image` (`bound` mode) or `data-moxo-image-pool` (`pool` mode). An empty name is allowed only on a draft entry."},"fileRef":{"type":"string","maxLength":4000,"description":"The earlier upload the picture comes from, as a file reference such as `{File request / Files}`, up to 4,000 characters. Moxo reads the file when it generates the page and inserts the picture. Don't send image data. Empty only on a draft entry."}},"required":["name","fileRef"]},"maxItems":12}},"required":["mode","files"]}],"description":"Pictures from earlier uploads to place on the page, when `fileFormat` is `HTML`. Optional. With `mode` `bound` (recommended), each picture has a named slot, `{ name, required, fileRef }`, and the page holds `<img data-moxo-image=\"NAME\" alt=\"...\">` without `src`. With `mode` `pool`, the pictures are listed in `files` as `{ name, fileRef }`, and the page places `<img data-moxo-image-pool=\"NAME\" alt=\"...\">` only where it uses one. `fileRef` is a reference to a file from an earlier step, such as `{File request / Files}`. Don't embed image data."},"pageFiles":{"type":"object","properties":{"mode":{"type":"string","enum":["bound"],"description":"`bound`: each file has a fixed place on the page. The page holds `<div data-moxo-file=\"NAME\"></div>` for each name, and Moxo replaces that element with the file. Files have no `pool` mode."},"slots":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","maxLength":81,"description":"A short name for the file, up to 81 characters: letters, numbers, dots and hyphens, starting with a letter or number, such as `theme`. The page uses this exact name in `data-moxo-file`. An empty name is allowed only on a draft entry."},"source":{"type":"string","enum":["flow","agent"],"description":"Where the file comes from. `flow` (the default): `fileRef`, a file from an earlier step, read when the flow runs. `agent`: `agentFileId`, a text file uploaded on this agent, which is not asked for when the flow starts."},"fileRef":{"type":"string","maxLength":4000,"description":"With `source` `flow`, or no `source`: the earlier upload the text comes from, as a file reference such as `{File request / Files}`, up to 4,000 characters. Moxo reads the file when it generates the page and inserts its text. The file must be text (a stylesheet, an SVG drawing, data or a fixed part of the page) and can't run code. Empty only on a draft entry, and empty when `source` is `agent`."},"agentFileId":{"type":"string","maxLength":80,"description":"With `source` `agent`: the id of a text file uploaded on this agent, up to 80 characters. Leave it unset until a file is uploaded on the agent in Moxo. Empty when `source` is `flow`."},"agentFileName":{"type":"string","maxLength":255},"agentFileSize":{"type":"integer","minimum":0,"maximum":524288},"required":{"type":"boolean","description":"Whether the file must appear. With `true`, generating the page fails when the file is missing, isn't text, would run code, or isn't placed on the page. With `false`, the file is left out when the reference has no text; a file that isn't text or would run code still stops the page. Use `false` unless the page is wrong without it."}},"required":["name","fileRef","required"]},"maxItems":12}},"required":["mode","slots"],"description":"Text files to place on the page, when `fileFormat` is `HTML`. Optional. Each slot is `{ name, required, source, fileRef, agentFileId }`. With `source` `flow` (the default), `fileRef` is a reference to a file from an earlier step, such as `{File request / Files}`, read when the flow runs. With `source` `agent`, `agentFileId` names a text file uploaded on this agent. The page holds an empty `<div data-moxo-file=\"NAME\"></div>` for each slot. A file must be text (a stylesheet, an SVG drawing, data or a fixed part of the page) and can't run code. Remote addresses are not accepted, and files have no `pool` mode."}},"required":["name","type"]},{"type":"object","properties":{"renamedFrom":{"type":"string","minLength":1,"description":"The name this had before. Send it once, when you rename it, so what reads it keeps working."},"templateFile":{"type":"string","description":"A file output's template: a Word, Excel or PowerPoint file uploaded on this agent, as `@file:<name>`."},"jsonSchema":{"type":"object","additionalProperties":{},"description":"A `json` output's JSON Schema."}},"additionalProperties":{}}]},"description":"What the agent returns, by name. Later steps read them."},"modelConfig":{"type":["object","null"],"properties":{"mode":{"type":"string","enum":["auto","effort"],"description":"auto: Moxo picks the model. effort: you pick how hard the task is."},"complexity":{"type":"string","enum":["simple","standard","complex"],"description":"With mode effort: how hard the task is."},"provider":{"type":"string","description":"The model's provider, when one is picked."},"model":{"type":"string","description":"The model, when one is picked."},"connection":{"type":"string","pattern":"^@connection:.+/s","description":"The organization's own AI connection this agent runs on. Kept or removed, never added; connect a new one in Agent Foundry."}},"additionalProperties":{},"description":"Which model the agent runs on."},"toolIds":{"type":["array","null"],"items":{"type":"string"},"description":"The tools the agent can use, by id: `read_prior_steps`, `read_flow_context`, `search_skills`, `read_skill`, `send_email`, `call_webhook`, `call_rest_api`, `call_mcp_tool`, `call_external_app`, `set_field`, `update_org`, `send_notification`, `schedule_reminder`, `fetch_url`, `run_code`, `web_search`, `extract_document`, `query_table`, `append_output`, `browse`, `computer`, `lookup_knowledge` and `ask_specialist`. A tool that needs a connection is chosen here, and a person connects the account in Moxo. When one job needs several apps, give the same agent each app's tool."},"toolConfig":{"type":["object","null"],"properties":{"call_rest_api":{"type":"object","properties":{"connection":{"type":"string","pattern":"^@connection:.+/s","description":"The Secret the REST API tool sends. Kept or removed, never added; pick a new one in Agent Foundry."},"defaultMethod":{"type":"string","enum":["GET","POST","PUT","PATCH","DELETE"],"description":"The method a call uses when the agent names none."}},"required":["connection"],"additionalProperties":{},"description":"Call a REST API with a Secret."},"call_webhook":{"type":"object","properties":{"connection":{"type":"string","pattern":"^@connection:.+/s","description":"The Secret the webhook tool sends. Kept or removed, never added."}},"required":["connection"],"additionalProperties":{},"description":"Send a webhook with a Secret."},"call_mcp_servers":{"type":"array","items":{"type":"object","properties":{"connection":{"type":"string","pattern":"^@connection:.+/s","description":"The MCP server connection. Kept or removed, never added."},"selectedToolNames":{"type":"array","items":{"type":"string"},"description":"The server's tools the agent may call."},"readOnlyToolNames":{"type":"array","items":{"type":"string"},"description":"Tools the server gives no hint for that the builder marked as only reading, so an AI recommendation or pre-fill may call them. A hint from the server always wins."},"serverName":{"type":"string","description":"The server's name as Agent Foundry showed it when it was picked."}},"required":["connection"],"additionalProperties":{}},"description":"The agent's MCP servers, in order. A chat agent keeps up to 20, each read only in a group chat of colleagues; every other agent keeps one."},"call_mcp_tool":{"type":"object","properties":{"connection":{"type":"string","pattern":"^@connection:.+/s","description":"The MCP server connection. Kept or removed, never added."},"selectedToolNames":{"type":"array","items":{"type":"string"},"description":"The server's tools the agent may call."},"readOnlyToolNames":{"type":"array","items":{"type":"string"},"description":"Tools the server gives no hint for that the builder marked as only reading. A hint from the server always wins."},"serverName":{"type":"string","description":"The server's name as Agent Foundry showed it when it was picked."}},"required":["connection"],"additionalProperties":{},"description":"Deprecated: the older form of the agent's one MCP server. A pull returns it as a mirror of the first entry of `call_mcp_servers`. Sent alone it is saved as `call_mcp_servers`; sent with it, it must equal the list's first entry.","deprecated":true},"call_external_app":{"type":"array","items":{"type":"object","properties":{"appId":{"type":"string","description":"The connected app, such as hubspot."},"connectionMode":{"type":"string","enum":["fixed","per_bundle"],"description":"`fixed`: one connection for every run. `per_bundle`: each flow uses the connection of the connection bundle it was started with."},"connection":{"type":"string","pattern":"^@connection:.+/s","description":"The app's connection. Kept or removed, never added; connect a new app in Agent Foundry."},"selectedActionIds":{"type":"array","items":{"type":"string"},"description":"The app's actions the agent may call."}},"required":["appId"],"additionalProperties":{}},"description":"Connected apps the agent works in, each with its actions."},"browse":{"type":"object","properties":{},"additionalProperties":{},"description":"Which sites the agent may browse."},"web_search":{"type":"object","properties":{"allowedDomains":{"type":"array","items":{"type":"string"},"description":"The domains a web search draws on, each with its subdomains. Empty or left out: any public site."}},"additionalProperties":{},"description":"Which sites the agent may search."},"fetch_url":{"type":"object","properties":{"allowedDomains":{"type":"array","items":{"type":"string"},"description":"The domains whose pages the agent may open, each with its subdomains. Empty or left out: any public site."}},"additionalProperties":{},"description":"Which sites the agent may open pages on."},"extract_document":{"type":"object","properties":{"method":{"type":"string","enum":["standard","complex_documents","exact_amounts"],"description":"How documents are read: `standard`, or `complex_documents` with Advanced extract. `exact_amounts` is an older value, read and never written."},"advancedExtract":{"type":"boolean","description":"Advanced extract: a stronger reader for scanned or handwritten pages, where your organization has one."},"advancedOcr":{"type":"boolean","description":"An older form of Advanced extract. Read, never written; use `advancedExtract`."},"arithmeticCheck":{"type":"boolean","description":"Check figures against the document: totals and running balances are checked against the lines they add up. On when left out."},"arithmeticVerification":{"type":"boolean","description":"The older name of `arithmeticCheck`. Read, never written."},"pack":{"type":"object","properties":{"requiredTypes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The document type's id."},"label":{"type":"string","description":"The document type's name."},"hints":{"type":"array","items":{"type":"string"},"description":"Words that point to this type."}},"required":["id","label"],"additionalProperties":{}},"description":"The document types the agent requires."}},"required":["requiredTypes"],"additionalProperties":{},"description":"The document types a gallery agent requires. Set when the agent is installed."},"verificationCriteria":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The check's id on the agent."},"kind":{"type":"string","enum":["journal_footing","custom"],"description":"`journal_footing`: each journal's debits equal its credits. `custom`: a check in your own words."},"statement":{"type":"string","description":"The check, in plain words."},"check":{"type":"string","description":"Set by Moxo: the library check this sentence runs as."},"confirmedStatement":{"type":"string","description":"Set by Moxo: the words the library check was confirmed for."}},"required":["id","kind","statement"],"additionalProperties":{}},"description":"Your own checks on the figures, each a plain sentence."},"documentAbout":{"type":"string","description":"A note on how accounts show up in the document and which lines to ignore."},"documentKindsOff":{"type":"array","items":{"type":"string","enum":["general_ledger","bank_statement","trial_balance","tax_invoice","balance_sheet","fixed_asset_schedule","statement"]},"description":"Verification › Document math: the document kinds whose math is not checked. Left out: every kind is checked."},"documentKind":{"type":"string","description":"An older place for what the document is; a save moves it onto the file input."}},"additionalProperties":false,"description":"How the agent reads documents: Advanced extract, Check figures against the document and the checks under it."},"data_table":{"type":"object","properties":{"grants":{"type":"array","items":{"type":"object","properties":{"table":{"type":"string","pattern":"^@table:.+/s","description":"A data table, by name: `@table:<name>` (`[id:<id>]` after it when two share a name)."},"read":{"type":"boolean","description":"The agent may read the table."},"fields":{"type":"array","items":{"type":"string"},"description":"The table's columns the agent may use, by key."}},"required":["table","read"],"additionalProperties":{}},"description":"The data tables the agent may read or write. Kept or removed, never added; grant a new one in Agent Foundry."}},"additionalProperties":{},"description":"Read and write data tables."},"computer":{"type":"object","properties":{"browsingModel":{"type":"string","description":"Which model browses for the agent's Computer."}},"additionalProperties":{},"description":"The agent's Computer."},"permissions":{"type":"object","properties":{"tools":{"type":"object","additionalProperties":{"type":"string","enum":["allow","ask","off"]},"description":"Each tool's level: `allow`, `ask` (a person approves each call) or `off`."},"rules":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The rule's id, as read."},"tool":{"type":"string","description":"The tool the rule checks."},"fact":{"type":"string","description":"What Moxo checks about the call, such as `recipient_count`."},"op":{"type":"string","description":"How the fact is compared, such as `more_than`."},"value":{"anyOf":[{"type":"boolean"},{"type":"number"},{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"What the fact is compared with."},"then":{"type":"string","enum":["ask","off"],"description":"`ask` (a person approves the call) or `off`."}},"required":["tool","fact","op","value","then"]},"description":"Custom rules the agent already has. Kept or removed, never added or changed (`TOOL_RULES_IN_GUARDRAILS`): write a new limit as one of the agent's guardrails."}},"additionalProperties":{},"description":"Which tool calls the agent may make, must ask about, or may not make."}},"additionalProperties":{},"description":"Each tool's settings. Connections, Secrets and data-table grants are kept or removed, never added: a person adds them in Agent Foundry."},"knowledge":{"type":["array","null"],"items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"The knowledge source, by its name in Agent Foundry (`[id:<id>]` after it when two share a name)."},"required":{"type":"boolean","description":"The agent cannot answer without it."}},"required":["name"],"additionalProperties":false},"description":"Knowledge the agent reads. Upload a new file first (POST /v1/agents/{id}/knowledge/upload-init), then name it here."},"skills":{"type":["array","null"],"items":{"type":"string","pattern":"^@skill:.+/s","description":"A skill, by name: `@skill:<name>` (`[id:<id>]` after it when two share a name)."},"description":"Skills from the organization's library."},"specialistAgents":{"type":["array","null"],"items":{"type":"string","pattern":"^@agent:.+/s","description":"An agent, by name: `@agent:<name>` (`[id:<id>]` after it when two share a name)."},"description":"Other agents this agent may ask."},"guardrails":{"type":["object","null"],"properties":{"maxOutputLength":{"anyOf":[{"type":"null"},{"type":"number","minimum":1,"maximum":100000}],"description":"A soft cap on the length of an answer, in characters."},"alwaysRules":{"type":"array","items":{"type":"string","maxLength":2000},"maxItems":50,"description":"Rules the agent keeps in every answer they apply to, one per item: how it behaves (its tone or language), steps it takes, and what it never does. Checked on every answer. At most 50 entries of up to 2,000 characters each. Sending the list replaces it; `[]` empties it."},"topicsToRefuse":{"type":"array","items":{"type":"string","maxLength":2000},"maxItems":50,"description":"Subjects the agent declines to discuss, one per item, such as `tax advice`. At most 50 entries of up to 2,000 characters each. Sending the list replaces it; `[]` empties it."},"contentRestrictions":{"type":"array","items":{"type":"string"},"description":"Deprecated: use `alwaysRules` and `topicsToRefuse`. The older single list, from before the two. It is still read and still accepted: each entry is kept as a rule or a topic by its meaning until it is moved to one of the two lists. Send `[]` once its entries are moved."},"showSources":{"type":"boolean","description":"Show the sources an answer used."},"showFlagsToAssignee":{"type":"boolean","description":"Show this agent's notes to the person on the step: Prepare's flags, Advise's how the AI got this."},"showReasoningToAssignee":{"type":"boolean","description":"Advise agents only. Whether the person deciding a step reads the reasons under the recommendation. Absent or `true` (the default): they do. `false`: they read the recommendation and what to confirm before acting, without the reasons. Separate from `showFlagsToAssignee`. The flow's managers always read the reasons."},"answersMustCite":{"type":"boolean","description":"Every answer cites a source. Kept for Review, Prepare and Advise agents. Every chat answer is checked against what it read."},"piiHandling":{"type":"string","enum":["off","redact"],"description":"What the agent does with personal details."},"creditLimitPerRun":{"anyOf":[{"type":"null"},{"type":"integer","minimum":1,"maximum":100000}],"description":"The most AI credits one run may use. Empty: no limit."}},"additionalProperties":{},"description":"The agent's limits: rules it keeps, how sure it must be, what it does with personal details."},"supervisorConfig":{"type":["object","null"],"properties":{"enabled":{"type":"boolean","description":"A second model double-checks the agent's work before it is used."},"scope":{"type":"string","enum":["unproved","whole_result"],"description":"What the second review rereads: unproved (the values Moxo's checks could not prove, the default) or whole_result (every value of the result)."},"customRules":{"type":"string","description":"What the second review checks, in words (\"What should it check?\")."}},"additionalProperties":false,"description":"Double-check with a second model: its switch and what it checks."},"verificationConfig":{"type":["object","null"],"properties":{"checkingModel":{"type":"object","properties":{"kind":{"type":"string","enum":["auto","same_as_agent","tier","model","connection","own_agent"],"description":"What the agent's checks run on: auto (Moxo picks a tested checker for each kind of check), same_as_agent, tier (one of Moxo's tiers), model (a model from the agent model picker), connection (a model on one of your AI keys) or own_agent (not accepted yet)."},"tier":{"type":"string","enum":["simple","standard","complex"],"description":"With kind tier: the Moxo tier the checks run on."},"connectionId":{"type":"string","description":"With kind connection: the id of one of your organization's AI connections."},"model":{"type":"string","description":"With kind model: the model's id from the agent model picker. With kind connection: the model on that connection; absent uses the connection's own model."},"agentId":{"type":"string","description":"With kind own_agent: the id of an agent your organization built. Refused at save for now."}},"required":["kind"],"additionalProperties":false,"description":"The model the agent's checks run on. Absent follows the organization's default, else auto."},"yourChecks":{"type":"array","items":{"type":"string"},"maxItems":40,"description":"What else must be true of the agent's work, one check per item. A check Moxo can run as code runs as code; the checking model judges the rest."}},"additionalProperties":false,"description":"The checking model and your own checks."},"sendBackReply":{"type":["string","null"],"enum":["outcome_with_reason","outcome_only",null],"description":"For `review` agents only: what the person who submitted hears when the agent sends the submission back. `outcome_with_reason` (the default) says what to fix, with each reason on its field. `outcome_only` says only that it needs another look, with no reasons or marked fields, for sensitive checks such as fraud or KYC screening. Ignored for other agent types."},"reviewRules":{"type":["object","null"],"properties":{"rules":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The rule's id on the agent. Send it back unchanged with the rule."},"text":{"type":"string","description":"The check, in plain words (up to 1,000 characters)."},"from":{"type":"array","items":{"type":"string"},"description":"The lines of What to check the rule was made from. Empty for a rule a person added."},"origin":{"type":"string","enum":["compiled","edited","added"],"description":"`compiled`: Moxo made it from What to check. `edited`: a person reworded it. `added`: a person wrote it."}},"required":["id","text","from","origin"],"additionalProperties":false},"maxItems":80,"description":"The rules the review checks, in order (up to 80)."},"compiledFor":{"type":"string","description":"Set by Moxo: which What to check the rules were made from. Send it back as you read it."}},"required":["rules"],"additionalProperties":false,"description":"A review agent's rules: the checks Moxo makes from its What to check after each save. When the instructions change, Moxo makes them again and keeps the ones a person edited or added. Ignored for other agent types."},"chatConfig":{"type":["object","null"],"properties":{"displayName":{"type":"string","minLength":1,"maxLength":50,"description":"The name people see in chat. At most 50 characters."},"persona":{"type":"string","description":"How the agent sounds, in words."},"triggerMode":{"type":"string","enum":["auto_reply","mention_only"],"description":"`auto_reply`: the agent answers every message. `mention_only`: only when named."},"coolOffMinutes":{"type":"integer","minimum":0,"maximum":1440,"description":"Minutes the agent stays quiet on a step after an internal user replies. Default 15."},"scopes":{"type":"object","properties":{"portal":{"type":"boolean","description":"The agent answers in the portal. Default on."},"inFlow":{"type":"boolean","description":"The agent answers in a flow's chat. Default on."},"rooms":{"type":"object","properties":{"enabled":{"type":"boolean","description":"The agent answers in group conversations. Default off."},"withExternalPeople":{"type":"boolean","description":"Also in group conversations with external users. Default off."}},"additionalProperties":false,"description":"Group conversations."}},"additionalProperties":false,"description":"Where the agent talks."}},"additionalProperties":false,"description":"A chat agent's settings: its display name, persona and where it talks. When it hands a chat to a person is `escalation`, as for every agent."},"escalation":{"type":["object","null"],"properties":{"escalate":{"type":"string","maxLength":5000,"description":"\"Also escalate when…\", in your own words. An empty string clears it."}},"additionalProperties":false,"description":"Human in the loop › Escalate: `escalate` is the \"Also escalate when…\" text, in your own words. The agent judges it and, when it applies, hands the work to a person and stops. Who it goes to is set on each template."},"requireHumanReview":{"type":["boolean","null"],"description":"Human in the loop › Require human review: a person approves the agent's result before any step that uses it completes, and a step can't turn it off. `automation` and `review` agents only."},"reviewChat":{"type":["boolean","null"],"description":"With `requireHumanReview`: reviewers can chat with the AI to change its draft before they approve. `automation` agents only."},"reviewSampleSize":{"type":["integer","null"],"minimum":1,"maximum":500,"description":"With `requireHumanReview`: reviewers check a sample of at least this many lines of a list result, each picked with the same chance, instead of every line. `null` clears only this minimum. A template step's own `reviewSample` still applies, and while this is set a step can check more lines, never fewer. `automation` agents only."},"actionApprovals":{"type":["object","null"],"properties":{"all":{"type":"boolean","enum":[true],"description":"Every action the agent can take waits for a person's approval, including actions added later."},"tools":{"type":"array","items":{"type":"string","enum":["send_email","set_field","update_org","call_rest_api","call_webhook","call_mcp_tool","call_external_app","send_notification","schedule_reminder"]},"maxItems":9,"description":"Only these actions wait for a person's approval. Each is one of `send_email`, `set_field`, `update_org`, `call_rest_api`, `call_webhook`, `call_mcp_tool`, `call_external_app`, `send_notification` or `schedule_reminder`."}},"additionalProperties":false,"description":"Human in the loop › Approve actions before they run: `all: true` makes every action wait for a person's approval, actions added later included; `tools` only those. A step can add actions, never remove these. `automation` agents only: a `review` agent takes no outside action."},"memoryMode":{"type":["string","null"],"enum":["off","suggest","auto",null],"description":"Memory › Learn from feedback: `off`, `suggest` (each learning waits for a person to keep it; the default) or `auto`."},"selfImprove":{"type":["boolean","null"],"description":"The agent proposes improvements from its runs. Default false."},"spotIssues":{"type":["boolean","null"],"description":"Settings › Flag issues: a Prepare agent flags what looks wrong in what it filled. A new Prepare agent starts with it off."},"computerTasks":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$","description":"The task's key: lower case letters, digits and `_`. It stays when the title changes."},"title":{"type":"string","minLength":1,"maxLength":120,"description":"The task's name."},"enabled":{"type":"boolean","description":"The agent may run the task. Default true."},"goal":{"type":"string","maxLength":1000,"description":"What the task gets done, in words."},"inputs":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$","description":"Its key: lower case letters, digits and `_`. Steps name it."},"label":{"type":"string","maxLength":80,"description":"Its name, as a person reads it."},"required":{"type":"boolean","description":"A run can't start the task without it."}},"required":["key","label","required"],"additionalProperties":false},"maxItems":20,"description":"What a run hands in."},"outputs":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$","description":"Its key: lower case letters, digits and `_`."},"label":{"type":"string","minLength":1,"maxLength":80,"description":"Its name, as a person reads it."}},"required":["key","label"],"additionalProperties":false},"maxItems":20,"description":"What a run reads back."},"useRequests":{"type":"boolean","enum":[false],"description":"`false`: every step runs on the screen, never as the site's own request."},"taught":{"type":"boolean","description":"Set by Moxo: this task was taught by recording. The recording stays in Moxo, so the task can be taught again; the steps here are what the task does."},"renamedFrom":{"type":"string","description":"The key this task had before. Write it once, when you change the key."},"steps":{"type":"array","items":{"type":"object","properties":{"title":{"type":["string","null"],"minLength":1,"maxLength":120,"description":"The step's title. Empty: worded from its action."},"description":{"type":["string","null"],"minLength":1,"maxLength":280,"description":"More about the step, for whoever reads the task."},"gate":{"type":"string","enum":["none","needs_person"],"description":"needs_person: a person does this step (signing in, a password or code). Default none."},"action":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["open"],"description":"`open`: go to a page."},"page":{"type":"object","properties":{"origin":{"type":"string","maxLength":300,"description":"The site, as `https://host[:port]`."},"path":{"type":"string","minLength":1,"maxLength":512,"description":"The page's path, starting with `/`, without a query or fragment."}},"required":["origin","path"],"additionalProperties":false,"description":"A page: its site and path."}},"required":["kind","page"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["click"],"description":"`click`: click a control."},"target":{"type":"object","properties":{"role":{"type":"string","minLength":1,"maxLength":40,"description":"The control's role, such as `button`, `textbox` or `combobox`."},"name":{"type":"string","minLength":1,"maxLength":80,"description":"The control's label, as a screen reader says it."},"frameOrigin":{"type":["string","null"],"maxLength":300,"description":"The site of the frame the control sits in. Null for the page itself."},"ordinal":{"type":"integer","minimum":0,"maximum":50,"description":"Which of the controls with this role and label it is, counting from 0."},"secret":{"type":"boolean","description":"True for a password, one-time code or card field: a person types into it."}},"required":["role","name","frameOrigin","ordinal","secret"],"additionalProperties":false,"description":"A control on the page, by its role and label."}},"required":["kind","target"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["fill"],"description":"`fill`: type a value into a field."},"target":{"type":"object","properties":{"role":{"type":"string","minLength":1,"maxLength":40,"description":"The control's role, such as `button`, `textbox` or `combobox`."},"name":{"type":"string","minLength":1,"maxLength":80,"description":"The control's label, as a screen reader says it."},"frameOrigin":{"type":["string","null"],"maxLength":300,"description":"The site of the frame the control sits in. Null for the page itself."},"ordinal":{"type":"integer","minimum":0,"maximum":50,"description":"Which of the controls with this role and label it is, counting from 0."},"secret":{"type":"boolean","description":"True for a password, one-time code or card field: a person types into it."}},"required":["role","name","frameOrigin","ordinal","secret"],"additionalProperties":false,"description":"A control on the page, by its role and label."},"value":{"oneOf":[{"type":"object","properties":{"from":{"type":"string","enum":["input"],"description":"`input`: one of the task's inputs, which a run hands in."},"input":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$","description":"The input's key."}},"required":["from","input"],"additionalProperties":false},{"type":"object","properties":{"from":{"type":"string","enum":["fixed"],"description":"`fixed`: text the task always uses."},"text":{"type":"string","minLength":1,"maxLength":200,"description":"The text."}},"required":["from","text"],"additionalProperties":false}],"description":"Where the value comes from: an input of the task, or fixed text."},"submit":{"type":"boolean","description":"Press Enter after typing."}},"required":["kind","target","value","submit"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["choose"],"description":"`choose`: pick an option in a list."},"target":{"type":"object","properties":{"role":{"type":"string","minLength":1,"maxLength":40,"description":"The control's role, such as `button`, `textbox` or `combobox`."},"name":{"type":"string","minLength":1,"maxLength":80,"description":"The control's label, as a screen reader says it."},"frameOrigin":{"type":["string","null"],"maxLength":300,"description":"The site of the frame the control sits in. Null for the page itself."},"ordinal":{"type":"integer","minimum":0,"maximum":50,"description":"Which of the controls with this role and label it is, counting from 0."},"secret":{"type":"boolean","description":"True for a password, one-time code or card field: a person types into it."}},"required":["role","name","frameOrigin","ordinal","secret"],"additionalProperties":false,"description":"A control on the page, by its role and label."},"option":{"oneOf":[{"type":"object","properties":{"from":{"type":"string","enum":["input"],"description":"`input`: one of the task's inputs, which a run hands in."},"input":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$","description":"The input's key."}},"required":["from","input"],"additionalProperties":false},{"type":"object","properties":{"from":{"type":"string","enum":["fixed"],"description":"`fixed`: text the task always uses."},"text":{"type":"string","minLength":1,"maxLength":200,"description":"The text."}},"required":["from","text"],"additionalProperties":false}],"description":"The option to pick."}},"required":["kind","target","option"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["press"],"description":"`press`: press a key."},"key":{"type":"string","enum":["Enter","Tab","Escape","Backspace","Delete","Space","ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Home","End","PageUp","PageDown"],"description":"The key."}},"required":["kind","key"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["sign_in"],"description":"`sign_in`: a person signs in to the site."},"site":{"type":"string","minLength":1,"maxLength":253,"pattern":"^[a-z0-9.-]+$","description":"The site's host name."}},"required":["kind","site"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["enter_secret"],"description":"`enter_secret`: a person types a password or code into a field."},"target":{"type":"object","properties":{"role":{"type":"string","minLength":1,"maxLength":40,"description":"The control's role, such as `button`, `textbox` or `combobox`."},"name":{"type":"string","minLength":1,"maxLength":80,"description":"The control's label, as a screen reader says it."},"frameOrigin":{"type":["string","null"],"maxLength":300,"description":"The site of the frame the control sits in. Null for the page itself."},"ordinal":{"type":"integer","minimum":0,"maximum":50,"description":"Which of the controls with this role and label it is, counting from 0."},"secret":{"type":"boolean","description":"True for a password, one-time code or card field: a person types into it."}},"required":["role","name","frameOrigin","ordinal","secret"],"additionalProperties":false,"description":"A control on the page, by its role and label."}},"required":["kind","target"],"additionalProperties":false},{"type":"null"}],"description":"What the step does on the page. Empty for a step written in words only."},"check":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["page_is"],"description":"`page_is`: the browser is on this page."},"page":{"type":"object","properties":{"origin":{"type":"string","maxLength":300,"description":"The site, as `https://host[:port]`."},"path":{"type":"string","minLength":1,"maxLength":512,"description":"The page's path, starting with `/`, without a query or fragment."}},"required":["origin","path"],"additionalProperties":false,"description":"A page: its site and path."}},"required":["kind","page"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["text_shows"],"description":"`text_shows`: this text is on the page."},"text":{"type":"string","minLength":1,"maxLength":120,"description":"The text."}},"required":["kind","text"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["control_shows"],"description":"`control_shows`: this control is on the page."},"role":{"type":"string","minLength":1,"maxLength":40,"description":"The control's role."},"name":{"type":"string","minLength":1,"maxLength":80,"description":"The control's label."}},"required":["kind","role","name"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["field_has"],"description":"`field_has`: a field holds this value."},"target":{"type":"object","properties":{"role":{"type":"string","minLength":1,"maxLength":40,"description":"The control's role, such as `button`, `textbox` or `combobox`."},"name":{"type":"string","minLength":1,"maxLength":80,"description":"The control's label, as a screen reader says it."},"frameOrigin":{"type":["string","null"],"maxLength":300,"description":"The site of the frame the control sits in. Null for the page itself."},"ordinal":{"type":"integer","minimum":0,"maximum":50,"description":"Which of the controls with this role and label it is, counting from 0."},"secret":{"type":"boolean","description":"True for a password, one-time code or card field: a person types into it."}},"required":["role","name","frameOrigin","ordinal","secret"],"additionalProperties":false,"description":"A control on the page, by its role and label."},"value":{"oneOf":[{"type":"object","properties":{"from":{"type":"string","enum":["input"],"description":"`input`: one of the task's inputs, which a run hands in."},"input":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$","description":"The input's key."}},"required":["from","input"],"additionalProperties":false},{"type":"object","properties":{"from":{"type":"string","enum":["fixed"],"description":"`fixed`: text the task always uses."},"text":{"type":"string","minLength":1,"maxLength":200,"description":"The text."}},"required":["from","text"],"additionalProperties":false}],"description":"Where the value comes from: an input of the task, or fixed text."}},"required":["kind","target","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["request_ok"],"description":"`request_ok`: the site answered this request without an error."},"method":{"type":"string","enum":["GET","POST","PUT","PATCH","DELETE"],"description":"The request's method."},"path":{"type":"string","minLength":1,"maxLength":512,"description":"The request's path, without a query."}},"required":["kind","method","path"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","enum":["described"],"description":"`described`: what a person would see, in words."},"words":{"type":"string","minLength":1,"maxLength":200,"description":"What the page should show."}},"required":["kind","words"],"additionalProperties":false},{"type":"null"}],"description":"How a run knows the step worked. Empty when nothing is checked."}},"additionalProperties":false},"minItems":1,"maxItems":40,"description":"The steps, in order."}},"required":["key","title","steps"],"additionalProperties":false},"description":"Tasks taught on the agent's Computer, as their steps. Changed only by a person signed in to Moxo."},"chatDisplayName":{"type":"string","minLength":1,"maxLength":50,"description":"Chat agents: the name shown in chat. Defaults to the agent's name."},"externalSource":{"type":["object","null"],"properties":{"kind":{"type":"string","enum":["grok_bot"],"description":"`grok_bot`: the agent runs on a Grok Bot routine."},"connectionId":{"type":"string","minLength":1,"maxLength":200,"description":"The id of a Grok Bot connection your organization made in **Connected Apps**. `GET /v1/connections?type=app` lists it, with `app: \"Grok Bot\"`."}},"required":["kind","connectionId"],"additionalProperties":false,"description":"Where the agent runs. Leave it out to keep it where it runs; `null` runs it in Moxo. To run it on a Grok Bot routine, send `{ \"kind\": \"grok_bot\", \"connectionId\": \"<id>\" }`. A person makes the connection in **Connected Apps**, never through the API. Only an automation agent runs on Grok Bot, and only on a plan with bring-your-own agents (otherwise `403 FEATURE_DISABLED` with `error.feature: \"agentBYOA\"`). A connection that isn't a Grok Bot connection of your organization returns `400`."}},"additionalProperties":false}}}},"responses":{"200":{"description":"The agent","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/BuilderAgent"}},"required":["success","data"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict: the request can't be applied as sent. `error.code` says why.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"The change can't be saved. Nothing was saved. `error.issues` says where and how to fix each problem.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[false],"description":"Always `false` on an error."},"error":{"type":"object","properties":{"code":{"type":"string","enum":["CHANGE_REFUSED"],"description":"The change can't be saved."},"message":{"type":"string","description":"What happened, in a sentence."},"issues":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string","description":"A stable code for the problem, such as `CONNECTION_IN_FOUNDRY` or `UNKNOWN_KNOWLEDGE`."},"pointer":{"type":"string","description":"Where in the file (or the update body), as a JSON pointer. An empty string is the whole of it."},"problem":{"type":"string","description":"What is wrong, in a sentence."},"fix":{"type":"string","description":"How to resolve it, in a sentence."}},"required":["code","pointer","problem","fix"]},"description":"Why the file can't be pushed. When there are any, nothing is saved."}},"required":["code","message","issues"],"description":"The error, with each problem in `issues`."}},"required":["success","error"]}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/agents/{id}/publish":{"post":{"tags":["AI agents"],"summary":"Publish an AI agent","description":"Makes the draft live, with the same checks as **Publish** in Agent Foundry. A refusal names what to fix (`needs` items with `blocksPublish: true`). Flows that already use the agent move to the new version as their template's agent policy says.\n\nThis runs as the person who owns the token, with exactly their permissions in Moxo, and is recorded as theirs. An organization API key gets `403 PERSON_TOKEN_REQUIRED`.\n\n**Permission:** Manage AI agents (`agents.manage`).\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"x-moxo-person-only":"PERSON_TOKEN_REQUIRED","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The published agent","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/BuilderAgent"}},"required":["success","data"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/agents/{id}/file":{"get":{"tags":["AI agents"],"summary":"Get an AI agent as a file","description":"Guide: [Agents as files](/docs/guides/agents-as-files).\n\nThe agent's draft as a readable `.yaml` file, to keep in a repository and review like code. Send `Accept: application/yaml` for the file itself. `422 FILE_NOT_AVAILABLE` when part of the agent can't be written as a file yet (an output template saved in an older way), or when a part of it holds text shaped like a password, key or token: a file never carries one.\n\n**The file.** `apiVersion: moxo/v1`, `kind: Agent`, then the agent's settings under the names the create body uses: `name`, `agentType`, `instructions`, `inputFields`, `outputFields`, `toolIds`, `toolConfig`, `guardrails`, `modelConfig` and the rest, and its Computer tasks as their steps. No ids. Organization objects are named: `@connection:<name>`, `@table:<name>`, `@skill:<name>`, `@agent:<name>`, `@file:<name>` for a file uploaded on the agent, and knowledge by its name (one whose name another shares with its id beside it: `@skill:Rules [id:<id>]`). Secrets, saved logins, Teach recordings, knowledge files themselves, run history and memory are not in the file. The file's first line names its JSON Schema (`https://developers.moxo.com/docs/schemas/agent-file.v1.json`), so an editor checks it as you type. Same organization only: to copy an agent to another organization, use its export.\n\nThis runs as the person who owns the token, with exactly their permissions in Moxo, and is recorded as theirs. An organization API key gets `403 PERSON_TOKEN_REQUIRED`.\n\n**Permission:** Manage AI agents (`agents.manage`).\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"x-moxo-person-only":"PERSON_TOKEN_REQUIRED","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The file","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on success."},"data":{"allOf":[{"$ref":"#/components/schemas/AgentFile"},{"description":"The file and the draft revision it was read at."}]}},"required":["success","data"]}},"application/yaml":{"schema":{"type":"string"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"This agent can't be written as a file. `error.message` says why.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"put":{"tags":["AI agents"],"summary":"Push an AI agent file","description":"Guide: [Agents as files](/docs/guides/agents-as-files).\n\nCompares the file with the agent's draft and saves what differs, through the same checks as a save in Agent Foundry. **A dry run unless `apply: true`:** the answer says which settings change (`changes`) and nothing is saved. A published agent keeps running its live version: the change waits as unpublished until you publish (`POST /v1/agents/{id}/publish`). A key the file leaves out goes back to empty or its default; what the file can't show (saved logins, Moxo's own markers) stays as it is. To rename an input or output, write its old name on `renamedFrom`, so steps that read it keep working. A push keeps or removes a connection, Secret or data-table grant but never adds or changes one: a person does that in Agent Foundry. New knowledge is uploaded first (`POST /v1/agents/{id}/knowledge/upload-init`), then named. Computer tasks change only from a person's own signed-in Moxo session, never with a token. `422 FILE_REFUSED` lists each problem with where and how to fix it; `409 VERSION_CONFLICT` when `baseVersion` is stale or the agent changed during the push.\n\n**The file.** `apiVersion: moxo/v1`, `kind: Agent`, then the agent's settings under the names the create body uses: `name`, `agentType`, `instructions`, `inputFields`, `outputFields`, `toolIds`, `toolConfig`, `guardrails`, `modelConfig` and the rest, and its Computer tasks as their steps. No ids. Organization objects are named: `@connection:<name>`, `@table:<name>`, `@skill:<name>`, `@agent:<name>`, `@file:<name>` for a file uploaded on the agent, and knowledge by its name (one whose name another shares with its id beside it: `@skill:Rules [id:<id>]`). Secrets, saved logins, Teach recordings, knowledge files themselves, run history and memory are not in the file. The file's first line names its JSON Schema (`https://developers.moxo.com/docs/schemas/agent-file.v1.json`), so an editor checks it as you type. Same organization only: to copy an agent to another organization, use its export.\n\nThis runs as the person who owns the token, with exactly their permissions in Moxo, and is recorded as theirs. An organization API key gets `403 PERSON_TOKEN_REQUIRED`.\n\n**Permission:** Manage AI agents (`agents.manage`).\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"x-moxo-person-only":"PERSON_TOKEN_REQUIRED","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"file":{"type":"string","minLength":1,"maxLength":1048576,"description":"The agent file, as a pull returns it, with your edits. At most 1 MB."},"apply":{"type":"boolean","description":"Save the change. Without it the push is a dry run: the answer is the plan, and nothing is saved."},"baseVersion":{"type":"integer","minimum":0,"description":"Refuse the push (409) if the agent changed since this draft revision: send the `draftRevision` of the pull or dry run you checked."}},"required":["file"],"additionalProperties":false}}}},"responses":{"200":{"description":"The plan, and whether it was saved","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on success."},"data":{"allOf":[{"$ref":"#/components/schemas/AgentFilePushResult"},{"description":"The settings the file changes, and whether they were saved."}]}},"required":["success","data"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict: the request can't be applied as sent. `error.code` says why.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"The file can't be pushed. Nothing was saved. `data.issues` says where and how to fix each problem.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[false],"description":"Always `false` on an error."},"error":{"type":"object","properties":{"code":{"type":"string","enum":["FILE_REFUSED"],"description":"The file can't be pushed."},"message":{"type":"string","description":"What happened, in a sentence."},"issues":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string","description":"A stable code for the problem, such as `CONNECTION_IN_FOUNDRY` or `UNKNOWN_KNOWLEDGE`."},"pointer":{"type":"string","description":"Where in the file (or the update body), as a JSON pointer. An empty string is the whole of it."},"problem":{"type":"string","description":"What is wrong, in a sentence."},"fix":{"type":"string","description":"How to resolve it, in a sentence."}},"required":["code","pointer","problem","fix"]},"description":"Why the file can't be pushed. When there are any, nothing is saved."}},"required":["code","message","issues"],"description":"The error, with each problem in `issues`."},"data":{"allOf":[{"$ref":"#/components/schemas/AgentFilePushResult"},{"description":"The refused plan: nothing was saved."}]}},"required":["success","error","data"]}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/agents/{id}/versions":{"get":{"tags":["AI agents"],"summary":"List an AI agent's versions","description":"Every published version of the agent, newest first: what Agent Foundry's version history lists.\n\nA personal access token reads it with its person's permissions. An organization API key with `templates:read` reads it too, as an admin does; changing it still needs a personal access token.\n\n**Permission for a personal access token:** Manage AI agents (`agents.manage`).\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `templates:read`","security":[{"bearerAuth":["templates:read"]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The published versions, newest first.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on success."},"data":{"type":"array","items":{"$ref":"#/components/schemas/AgentVersion"},"description":"The published versions, newest first."}},"required":["success","data"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/agents/{id}/versions/{versionId}":{"get":{"tags":["AI agents"],"summary":"Get an AI agent version as a file","description":"Guide: [Agents as files](/docs/guides/agents-as-files).\n\nA published version of the agent as a readable `.yaml` file, in the same shape as the draft's file (`GET /v1/agents/{id}/file`), so two versions, or a version and the draft, diff line by line. Send `Accept: application/yaml` for the file itself. `422 FILE_NOT_AVAILABLE` when part of it can't be written as a file.\n\nThis runs as the person who owns the token, with exactly their permissions in Moxo, and is recorded as theirs. An organization API key gets `403 PERSON_TOKEN_REQUIRED`.\n\n**Permission:** Manage AI agents (`agents.manage`).\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"x-moxo-person-only":"PERSON_TOKEN_REQUIRED","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":true,"name":"versionId","in":"path"}],"responses":{"200":{"description":"The version as a file","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on success."},"data":{"allOf":[{"$ref":"#/components/schemas/AgentVersionFile"},{"description":"The version as a file."}]}},"required":["success","data"]}},"application/yaml":{"schema":{"type":"string"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"This version can't be written as a file. `error.message` says why.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/agents/{id}/versions/{versionId}/restore":{"post":{"tags":["AI agents"],"summary":"Restore an AI agent version","description":"Brings back a published version, as **Restore** in Agent Foundry's version history does. A published agent gets it as its draft and keeps running its live version until you publish (`POST /v1/agents/{id}/publish`); an agent never published gets it live. `restoredTo` says which. A version's data-table grants, connected apps and saved sign-ins that the agent doesn't hold now must be yours to grant, as when you create one.\n\nThis runs as the person who owns the token, with exactly their permissions in Moxo, and is recorded as theirs. An organization API key gets `403 PERSON_TOKEN_REQUIRED`.\n\n**Permission:** Manage AI agents (`agents.manage`).\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"x-moxo-person-only":"PERSON_TOKEN_REQUIRED","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":true,"name":"versionId","in":"path"}],"responses":{"200":{"description":"The agent after the restore.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on success."},"data":{"allOf":[{"$ref":"#/components/schemas/BuilderAgent"},{"type":"object","properties":{"restoredTo":{"type":"string","enum":["draft","live"],"description":"`draft`: the agent is published, so the version waits as its draft. `live`: the agent was never published, so the version is its config."}},"required":["restoredTo"]}],"description":"The agent after the restore."}},"required":["success","data"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/agents/{id}/test-files/upload-init":{"post":{"tags":["AI agents"],"summary":"Add a file for an AI agent test run","description":"Returns a one-time upload link for a file a test run reads: an earlier step's upload (`priorStepFiles`) or the files under review (`submissionFiles`). `PUT` the file to `uploadUrl` with `requiredHeaders`, then name its `fileId` in the run. PDF up to 1 GB, an image up to 5 MB. Test files are yours and are removed after 24 hours.\n\nThis runs as the person who owns the token, with exactly their permissions in Moxo, and is recorded as theirs. An organization API key gets `403 PERSON_TOKEN_REQUIRED`.\n\n**Permission:** Manage AI agents (`agents.manage`).\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"x-moxo-person-only":"PERSON_TOKEN_REQUIRED","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"fileName":{"type":"string","minLength":1,"maxLength":255,"description":"The file's name."},"mimeType":{"type":"string","minLength":1,"maxLength":255,"description":"Its type, for example `application/pdf`."},"fileSize":{"type":"integer","exclusiveMinimum":0,"maximum":1073741824,"description":"Its size in bytes."}},"required":["fileName","mimeType","fileSize"]}}}},"responses":{"200":{"description":"The upload link.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on success."},"data":{"type":"object","properties":{"fileId":{"type":"string","description":"The file's id, to name in a run."},"uploadUrl":{"type":"string","description":"Where to `PUT` the file. One use, short-lived."},"requiredHeaders":{"type":"object","additionalProperties":{"type":"string"},"description":"Headers the `PUT` must send."},"expiresInSeconds":{"type":"integer","description":"How long the link works."}},"required":["fileId","uploadUrl","requiredHeaders","expiresInSeconds"],"description":"The upload link."}},"required":["success","data"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/agents/{id}/test-runs":{"post":{"tags":["AI agents"],"summary":"Start an AI agent test run","description":"A Test run is what **Test** in Agent Foundry runs: the agent's saved draft on a step of one of your flow templates, in a hidden test flow. Its tools act for real unless `toolWrites` is `off`, as in Agent Foundry, so starting and stopping one is yours alone. A run is its starter's: another person's run answers `404`. Answers `202` at once with the run's address in `Location`; read it there until `state` is no longer `running`. Send an `Idempotency-Key`: a retry with the same key within ten minutes answers the run the first call started, never a second one. The same test started again while it runs answers `425 TEST_RUN_ALREADY_IN_FLIGHT`. A chat agent tests as a conversation in Agent Foundry, and the Conductor isn't tested on a step (`400 TEST_KIND_NOT_SUPPORTED`).\n\nThis runs as the person who owns the token, with exactly their permissions in Moxo, and is recorded as theirs. An organization API key gets `403 PERSON_TOKEN_REQUIRED`.\n\n**Permission:** Manage AI agents (`agents.manage`).\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"x-moxo-person-only":"PERSON_TOKEN_REQUIRED","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"templateId":{"type":"string","minLength":1,"description":"The flow template whose step the agent runs on."},"stepId":{"type":["string","null"],"minLength":1,"description":"The step under test. For an Automation agent, the step it runs after; `null` runs it before step 1."},"useUnpublishedEdits":{"type":"boolean","default":false,"description":"Run on the template's unpublished edits. Defaults to the published template."},"priorStepResults":{"type":"object","additionalProperties":{"type":"object","additionalProperties":{}},"default":{},"description":"Earlier steps' answers, keyed by the template's step id, then the field's key."},"priorStepFiles":{"type":"array","items":{"type":"object","properties":{"stepId":{"type":"string","minLength":1,"description":"The earlier step the files belong to."},"fieldKey":{"type":"string","minLength":1,"maxLength":200,"description":"The step's own file field (a form's file upload). Leave it out for the step's document output."},"fileIds":{"type":"array","items":{"type":"string","minLength":1},"minItems":1,"maxItems":50,"description":"Files uploaded first with `POST /v1/agents/{id}/test-files/upload-init`."}},"required":["stepId","fileIds"]},"maxItems":10,"default":[],"description":"Files for earlier steps, which the agent reads as a live flow's uploads."},"toolWrites":{"type":"string","enum":["off","allow"],"default":"allow","description":"`allow` (the default) lets the agent's tools act for real, as in production; `off` keeps every outside action from running."},"submission":{"type":"object","additionalProperties":{},"default":{},"description":"Review: the answers under review, keyed as the step stores them."},"submissionFiles":{"type":"array","items":{"type":"object","properties":{"fieldKey":{"type":"string","minLength":1,"maxLength":200,"description":"The step's own file field (a form's file upload). Leave it out for the step's document output."},"fileIds":{"type":"array","items":{"type":"string","minLength":1},"minItems":1,"maxItems":50,"description":"Files uploaded first with `POST /v1/agents/{id}/test-files/upload-init`."}},"required":["fileIds"]},"maxItems":10,"description":"Review: files for the step under review, uploaded first with `POST /v1/agents/{id}/test-files/upload-init`."}},"required":["templateId","stepId"],"additionalProperties":false}}}},"responses":{"202":{"description":"Started. `Location` is the run's address.","headers":{"Location":{"schema":{"type":"string","description":"The run: `/v1/agents/{id}/test-runs/{runId}`."},"required":true,"description":"The run: `/v1/agents/{id}/test-runs/{runId}`."}},"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on success."},"data":{"allOf":[{"$ref":"#/components/schemas/AgentTestRun"},{"description":"The run, `running`."}]}},"required":["success","data"]}}}},"400":{"description":"Refused: `TEST_KIND_NOT_SUPPORTED`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"425":{"description":"The same test is already running. `Retry-After` says when to try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/agents/{id}/test-runs/{runId}":{"get":{"tags":["AI agents"],"summary":"Get an AI agent test run","description":"A Test run is what **Test** in Agent Foundry runs: the agent's saved draft on a step of one of your flow templates, in a hidden test flow. Its tools act for real unless `toolWrites` is `off`, as in Agent Foundry, so starting and stopping one is yours alone. A run is its starter's: another person's run answers `404`. `state` is `running` until it ends; then `result` holds what the agent produced, as Agent Foundry's Test shows it.\n\nThis runs as the person who owns the token, with exactly their permissions in Moxo, and is recorded as theirs. An organization API key gets `403 PERSON_TOKEN_REQUIRED`.\n\n**Permission:** Manage AI agents (`agents.manage`).\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"x-moxo-person-only":"PERSON_TOKEN_REQUIRED","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":true,"name":"runId","in":"path"}],"responses":{"200":{"description":"The run.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on success."},"data":{"allOf":[{"$ref":"#/components/schemas/AgentTestRun"},{"description":"The run."}]}},"required":["success","data"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/agents/{id}/test-runs/{runId}/stop":{"post":{"tags":["AI agents"],"summary":"Stop an AI agent test run","description":"A Test run is what **Test** in Agent Foundry runs: the agent's saved draft on a step of one of your flow templates, in a hidden test flow. Its tools act for real unless `toolWrites` is `off`, as in Agent Foundry, so starting and stopping one is yours alone. A run is its starter's: another person's run answers `404`. Stops it as **Stop** in Agent Foundry does. A run that already finished keeps its own result.\n\nThis runs as the person who owns the token, with exactly their permissions in Moxo, and is recorded as theirs. An organization API key gets `403 PERSON_TOKEN_REQUIRED`.\n\n**Permission:** Manage AI agents (`agents.manage`).\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"x-moxo-person-only":"PERSON_TOKEN_REQUIRED","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":true,"name":"runId","in":"path"}],"responses":{"200":{"description":"The run after the stop.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on success."},"data":{"allOf":[{"$ref":"#/components/schemas/AgentTestRun"},{"description":"The run after the stop."}]}},"required":["success","data"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/agents/{id}/eval-runs":{"post":{"tags":["AI agents"],"summary":"Start an AI agent eval run","description":"An eval run replays your agent's draft over your agent's own examples, kept from its runs (the examples the Improve loop proves changes on), and grades both the draft and the published version with the same grader. Moxo's internal test sets are never used. It replays one change at a time: the instructions, or the model. Free: API eval runs have their own daily share of the Improve loop's budget. With the 8 to 18 examples a run holds, `inconclusive` is the common answer: a run never claims a draft is \"not worse\". Answers `202` at once with the run's address in `Location`; read it there until `state` is `done`. The answer is kept for 24 hours. Send an `Idempotency-Key`: a retry with the same key within ten minutes answers the run the first call started. A person may start 20 an hour (`429 EVAL_RUN_RATE_LIMITED`). When today's share runs out, the run still answers `202` and ends `stopped_at_budget`, with when the share resets.\n\nThis runs as the person who owns the token, with exactly their permissions in Moxo, and is recorded as theirs. An organization API key gets `403 PERSON_TOKEN_REQUIRED`.\n\n**Permission:** Manage AI agents (`agents.manage`).\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"x-moxo-person-only":"PERSON_TOKEN_REQUIRED","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"202":{"description":"Started. `Location` is the run's address.","headers":{"Location":{"schema":{"type":"string","description":"The run: `/v1/agents/{id}/eval-runs/{runId}`."},"required":true,"description":"The run: `/v1/agents/{id}/eval-runs/{runId}`."}},"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on success."},"data":{"allOf":[{"$ref":"#/components/schemas/AgentEvalRun"},{"description":"The run, `running`."}]}},"required":["success","data"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/agents/{id}/eval-runs/{runId}":{"get":{"tags":["AI agents"],"summary":"Get an AI agent eval run","description":"An eval run replays your agent's draft over your agent's own examples, kept from its runs (the examples the Improve loop proves changes on), and grades both the draft and the published version with the same grader. Moxo's internal test sets are never used. It replays one change at a time: the instructions, or the model. Free: API eval runs have their own daily share of the Improve loop's budget. With the 8 to 18 examples a run holds, `inconclusive` is the common answer: a run never claims a draft is \"not worse\". A run is its starter's: another person's run answers `404`.\n\nThis runs as the person who owns the token, with exactly their permissions in Moxo, and is recorded as theirs. An organization API key gets `403 PERSON_TOKEN_REQUIRED`.\n\n**Permission:** Manage AI agents (`agents.manage`).\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"x-moxo-person-only":"PERSON_TOKEN_REQUIRED","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":true,"name":"runId","in":"path"}],"responses":{"200":{"description":"The run.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on success."},"data":{"allOf":[{"$ref":"#/components/schemas/AgentEvalRun"},{"description":"The run."}]}},"required":["success","data"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/agents/{id}/knowledge/upload-init":{"post":{"tags":["AI agents"],"summary":"Add a knowledge file to an AI agent","description":"Returns a one-time upload link. Send the file there yourself, so the file never passes through an AI model:\n\n```bash\ncurl -X PUT -H \"Content-Type: application/pdf\" --upload-file policy.pdf \"<uploadUrl>\"\n```\n\nSend every header in `requiredHeaders`. When `completionUrl` is present, `POST` to it after the upload: the same upload link every upload in this API answers with, beside the knowledge file in `source`. The file is scanned, then its status becomes `READY` (see `GET /v1/agents/{id}/knowledge`) and it joins the agent's draft (`inDraft`): a published agent runs with it after its next publish. A file never sent, or one that cannot be read, is not added. On an agent installed from an Archway bundle, send the header `x-archway-detach-ack: 1` with this call to add the file, which detaches the agent from its bundle; without it the file is kept but not added. Up to 100 MB per file. The other limits, and what counts, are under Knowledge limits in the introduction. Needs the Agent knowledge feature on your plan.\n\nThis runs as the person who owns the token, with exactly their permissions in Moxo, and is recorded as theirs. An organization API key gets `403 PERSON_TOKEN_REQUIRED`.\n\n**Permission:** Manage AI agents (`agents.manage`).\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"x-moxo-person-only":"PERSON_TOKEN_REQUIRED","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"fileName":{"type":"string","minLength":1,"maxLength":500},"fileSize":{"type":"integer","exclusiveMinimum":0,"description":"Size in bytes. Up to 25 MB per file."},"mimeType":{"type":"string","minLength":1,"maxLength":255,"description":"PDF, DOCX, XLSX, CSV, TXT or MD."},"replace":{"type":"boolean","description":"Replace a file with the same name. Without it, a file with the same name is refused."},"replaceSourceId":{"type":"string","minLength":1},"purpose":{"type":"string","enum":["runtime_knowledge"]}},"required":["fileName","fileSize","mimeType"],"additionalProperties":false}}}},"responses":{"201":{"description":"The pending file and its upload link","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"fileId":{"type":"string","description":"The file's id. Its bytes are stored once the `PUT` to `uploadUrl` succeeds.","example":"a3f1c2e4-5b6d-4e7f-8a9b-0c1d2e3f4a5b"},"uploadUrl":{"type":"string","description":"The URL to `PUT` the file's bytes to. It stops working at `expiresAt`."},"requiredHeaders":{"type":"object","additionalProperties":{"type":"string"},"description":"Headers the `PUT` must send exactly as given. The URL's signature covers them, so leaving one out or changing it gets a `403` from the storage service, and retrying won't help.","example":{"Content-Type":"application/pdf"}},"expiresAt":{"type":"string","format":"date-time","description":"When `uploadUrl` stops working. Request a new upload to get a fresh URL."},"expiresInSeconds":{"type":"number","deprecated":true,"description":"Deprecated: how long the link works, in seconds, the same as `expiresAt`. Read `expiresAt`; this field is still sent so integrations built on it keep working."},"completionUrl":{"type":"string","description":"Present on some deployments. When it is present, `POST` to it with an empty body after the `PUT` succeeds: that records the file's size and starts its virus scan. Without that call the file is never scanned, so nobody is ever shown it."},"source":{"$ref":"#/components/schemas/BuilderAgentKnowledgeSource"},"upload":{"type":"object","properties":{"url":{"type":"string","description":"The same as `uploadUrl`."},"method":{"type":"string","enum":["PUT"],"description":"Always `PUT`."},"headers":{"type":"object","additionalProperties":{"type":"string"},"description":"The same as `requiredHeaders`."},"completeUrl":{"type":"string","description":"The same as `completionUrl`."},"expiresInSeconds":{"type":"number","description":"Seconds until `expiresAt`."}},"required":["url","method","headers"],"additionalProperties":false,"deprecated":true,"description":"Deprecated: the upload link in its older shape (`url`, `method`, `headers`, `completeUrl`, `expiresInSeconds`), the same as `uploadUrl`. Read `uploadUrl`; this field is still sent so integrations built on it keep working."}},"required":["fileId","uploadUrl","requiredHeaders","expiresAt","source"],"additionalProperties":false}},"required":["success","data"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/agents/{id}/knowledge":{"get":{"tags":["AI agents"],"summary":"List an AI agent's knowledge files","description":"Returns the AI agent's knowledge files and whether each is `READY`.\n\nA personal access token reads it with its person's permissions. An organization API key with `templates:read` reads it too, as an admin does; changing it still needs a personal access token.\n\n**Permission for a personal access token:** Manage AI agents (`agents.manage`).\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `templates:read`","security":[{"bearerAuth":["templates:read"]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Knowledge files","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"array","items":{"$ref":"#/components/schemas/BuilderAgentKnowledgeSource"}}},"required":["success","data"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/templates/{id}/setup":{"get":{"tags":["Template setup"],"summary":"Get a template's owners, folder and mode","description":"Returns who owns the template, its folder, and whether it runs as predefined or adaptive.\n\nA personal access token reads it with its person's permissions. An organization API key with `templates:read` reads it too, as an admin does; changing it still needs a personal access token.\n\n**Permission for a personal access token:** Edit access to the template.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `templates:read`","security":[{"bearerAuth":["templates:read"]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The setup","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/BuilderTemplateSetup"}},"required":["success","data"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/templates/{id}/owners":{"put":{"tags":["Template setup"],"summary":"Set a template's owners","description":"Owners manage the template and its flows. Send the people (`ownerIds`), or who owns it (`ownerPermission`): named people, admins only, or permission groups. An owner is an active person on your team (an internal user who is active or invited). An id that is not a person in your organization, or a person you add who is an external user, an agent or deactivated, returns `400 VALIDATION_FAILED` and names them; an owner the template already has never blocks a change. Publishing checks every owner: an external owner blocks it, and so do specific owners who are all deactivated.\n\nThis runs as the person who owns the token, with exactly their permissions in Moxo, and is recorded as theirs. An organization API key gets `403 PERSON_TOKEN_REQUIRED`.\n\n**Permission:** Edit access to the template.\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"x-moxo-person-only":"PERSON_TOKEN_REQUIRED","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"ownerPermission":{"type":"object","properties":{"type":{"type":"string","enum":["EXPLICIT_USERS","ADMINS_ONLY","PERMISSION_GROUP"],"description":"`EXPLICIT_USERS`: the people in `ownerIds`. `ADMINS_ONLY`: organization admins. `PERMISSION_GROUP`: the groups in `principals`."},"principals":{"type":"array","items":{"type":"string"}}},"required":["type"],"additionalProperties":false},"ownerIds":{"type":"array","items":{"type":"string","minLength":1},"maxItems":50,"description":"The ids (`usr_…`, from `GET /v1/users`) of the people who own the template. A member's user id is also accepted, including a legacy `_ext_` id. Each owner is an active person on your team: an internal user who is active or invited. An id that is not a person in your organization, including a `usr_…` id that does not resolve here, returns `400 VALIDATION_FAILED` and names that id; a person you add who is an external user, an agent or deactivated returns the same error and names them. An owner the template already has stays."}},"additionalProperties":false}}}},"responses":{"200":{"description":"The setup","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/BuilderTemplateSetup"}},"required":["success","data"]}}}},"400":{"description":"Refused: `VALIDATION_FAILED`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/templates/{id}/live-settings":{"put":{"tags":["Template setup"],"summary":"Change a template's live settings","description":"Live settings apply at once, to new flows and, where the setting says so, to running ones: they are not part of the draft and need no publish. This call sets the Start link's address (`embedId`), whether the people doing tasks see which steps an AI agent did (`revealAIToParticipants`), whether this template's completed flows can be deleted (`allowDeleteCompletedFlows`), and whether people in your organization can ask to join its flows (`allowJoinRequests`). With `alsoRunningFlows`, it applies the template's chat channels or AI visibility to the flows already running. Each change is recorded in the template's activity.\n\nThe other live settings have their own calls: who can start, change and own it (`update_permissions` in `POST /v1/templates/{id}/changes`, `PUT /v1/templates/{id}/owners`), how flows start (`update_flow_start`, `PATCH /v1/templates/{id}/trigger-activation`), notifications, the cover and the AI assistant (`update_settings`, `PUT /v1/templates/{id}/support-config`), the description (`update_template_info`) and the folder (`PUT /v1/templates/{id}/folder`). A Start link address another template uses returns `409 CONFLICT`.\n\nThis runs as the person who owns the token, with exactly their permissions in Moxo, and is recorded as theirs. An organization API key gets `403 PERSON_TOKEN_REQUIRED`.\n\n**Permission:** Edit access to the template.\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"x-moxo-person-only":"PERSON_TOKEN_REQUIRED","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"settings":{"type":"object","properties":{"embedId":{"type":["string","null"],"minLength":1,"maxLength":200,"description":"The Start link's address: the last part of its URL, unique across Moxo. One another template uses returns `409 CONFLICT`."},"revealAIToParticipants":{"type":["boolean","null"],"description":"How AI help appears to people outside your organization on this template: `true` labeled as AI, `false` as your organization's own (no \"AI\" mark or agent name), `null` to follow your organization's default again. Your own people always see AI. Hiding it applies to running flows at once."},"allowDeleteCompletedFlows":{"type":["boolean","null"],"description":"Whether this template's completed flows can be deleted. `false`: nobody can delete them, admins included, and a delete answers `403 COMPLETED_FLOW_KEPT`; it covers flows that completed before the change. `true` or `null`: they can be deleted, as before. Applies at once."},"allowJoinRequests":{"type":["boolean","null"],"description":"Whether people in your organization who open a link to one of this template's flows, without access to it, can ask the flow managers to add them as a viewer. `true`: they can, unless your organization turns requests to join off. `false` or `null`: they can't (the default). Applies at once, to running flows too."}},"additionalProperties":false,"description":"The live settings to change. Send only the ones that change."},"alsoRunningFlows":{"type":"object","properties":{"channelIntegrations":{"type":"array","items":{"type":"string","enum":["slack","teams","webhooks","callAgent"]},"description":"Turn these channels on in every running flow of the template too, as they are on the template: `slack`, `teams`, `webhooks` (outgoing webhooks) and `callAgent`."},"aiVisibility":{"type":"boolean","description":"`true`: running flows reveal AI to the people doing tasks too."}},"additionalProperties":false,"description":"Apply the template's settings to its running flows too. Without it, a setting turned on reaches new flows only."}},"required":["settings"],"additionalProperties":false}}}},"responses":{"200":{"description":"What changed.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."},"data":{"type":"object","properties":{"liveSettingsApplied":{"type":"array","items":{"type":"string"},"description":"The settings this call changed: `embedId`, `aiVisibility`, and so on. Empty when everything was already as sent."},"runningFlowCount":{"type":"integer","description":"How many flows of this template are running."},"reached":{"type":"integer","description":"How many running flows `alsoRunningFlows` changed."}},"required":["liveSettingsApplied","runningFlowCount","reached"],"additionalProperties":false,"description":"What this call changed, and how many running flows it reached."}},"required":["success","data"],"additionalProperties":false}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Refused: `CONFLICT`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/templates/{id}/mode":{"put":{"tags":["Template setup"],"summary":"Set a template's mode","description":"`predefined` runs the steps as designed and has no goal: switching to it clears the goal, and a goal sent with it returns `400 GOAL_NEEDS_ADAPTIVE`. `adaptive` works toward `goal` and needs the Adaptive flows feature on your plan (`403 FEATURE_DISABLED` otherwise). Once a flow has started from the template (a test run doesn't count), its mode can't change: a different mode returns `409 TEMPLATE_MODE_LOCKED`, while the goal can still change.\n\nThis runs as the person who owns the token, with exactly their permissions in Moxo, and is recorded as theirs. An organization API key gets `403 PERSON_TOKEN_REQUIRED`.\n\n**Permission:** Edit access to the template.\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"x-moxo-person-only":"PERSON_TOKEN_REQUIRED","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"mode":{"type":"string","enum":["predefined","adaptive"],"description":"`adaptive` needs Adaptive flows on your organization's plan."},"goal":{"type":["string","null"],"maxLength":2000,"description":"For adaptive: the end state the flow works toward. Leave it out for `predefined`, which has no goal."}},"required":["mode"],"additionalProperties":false}}}},"responses":{"200":{"description":"The setup","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/BuilderTemplateSetup"}},"required":["success","data"]}}}},"400":{"description":"Refused: `GOAL_NEEDS_ADAPTIVE`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Refused: `TEMPLATE_MODE_LOCKED`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/templates/{id}/folder":{"put":{"tags":["Template setup"],"summary":"Move a template to a folder","description":"Name an existing folder with `folderName` or send its `folderId`. `folderId: null` takes the template out of any folder.\n\nThis runs as the person who owns the token, with exactly their permissions in Moxo, and is recorded as theirs. An organization API key gets `403 PERSON_TOKEN_REQUIRED`.\n\n**Permission:** Edit access to the template.\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"x-moxo-person-only":"PERSON_TOKEN_REQUIRED","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"folderId":{"type":["string","null"],"minLength":1,"description":"A folder id, or null for no folder."},"folderName":{"type":"string","minLength":1,"maxLength":200,"description":"The name of an existing folder, instead of `folderId`."}},"additionalProperties":false}}}},"responses":{"200":{"description":"The setup","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/BuilderTemplateSetup"}},"required":["success","data"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict: the request can't be applied as sent. `error.code` says why.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/templates/{id}/support-config":{"get":{"tags":["Template setup"],"summary":"Get a template's chat assistant settings","description":"Returns who answers participants in this template's chat, when it escalates and to which role, its business hours, and whether it replies on its own.\n\nA personal access token reads it with its person's permissions. An organization API key with `templates:read` reads it too, as an admin does; changing it still needs a personal access token.\n\n**Permission for a personal access token:** Edit access to the template.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `templates:read`","security":[{"bearerAuth":["templates:read"]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Settings","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"supportMode":{"type":"string","enum":["AI_ONLY","HUMAN_ONLY","AI_HUMAN"]},"agentId":{"type":["string","null"],"description":"The chat agent that answers, or `null` when none is picked."},"agentName":{"type":"string","maxLength":200},"agentPersona":{"type":["string","null"],"maxLength":2000},"triggerMode":{"type":"string","enum":["auto_reply","mention_only"]},"escalationRole":{"type":["string","null"],"description":"The role (by name) that answers when the assistant hands a conversation to a person, or `null` when none is picked: with none, the assistant never hands off."},"businessHoursTimezone":{"type":["string","null"],"maxLength":100},"businessHoursSchedule":{"description":"Opening hours by day of the week, in `businessHoursTimezone`, as saved: each day `{ start, end }`, or `null` when closed. `null` when not set."},"assistUsesAgentKnowledge":{"type":"boolean"},"templateId":{"type":"string"},"runningFlowsChanged":{"type":"integer","description":"On a write: how many existing flows this change turned the assistant on or off in."},"runningFlows":{"type":"object","properties":{"assistantOff":{"type":"integer"},"assistantOn":{"type":"integer"}},"required":["assistantOff","assistantOn"],"description":"On a read: the template's running flows `alsoRunningFlows` can reach (a flow whose manager turned the assistant off is never counted). Turning the assistant on reaches `assistantOff`; picking a different assistant reaches both."}},"required":["escalationRole","templateId"],"additionalProperties":false}},"required":["success","data"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"put":{"tags":["Template setup"],"summary":"Set a template's chat assistant settings","description":"Changes only the fields you send. `agentId` must be a published chat agent. Name the escalation role with `escalationRole` (its name on the template); `null` clears it.\n\nThis runs as the person who owns the token, with exactly their permissions in Moxo, and is recorded as theirs. An organization API key gets `403 PERSON_TOKEN_REQUIRED`.\n\n**Permission:** Edit access to the template.\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"x-moxo-person-only":"PERSON_TOKEN_REQUIRED","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"supportMode":{"type":"string","enum":["AI_ONLY","HUMAN_ONLY","AI_HUMAN"]},"agentId":{"type":"string","description":"A published chat agent (GET /v1/agents?kind=chat)."},"agentName":{"type":"string","maxLength":200},"agentPersona":{"type":["string","null"],"maxLength":2000},"triggerMode":{"type":"string","enum":["auto_reply","mention_only"]},"escalationRole":{"type":["string","null"],"description":"The role (by name) told when the assistant escalates."},"businessHoursTimezone":{"type":["string","null"],"maxLength":100},"businessHoursSchedule":{},"assistUsesAgentKnowledge":{"type":"boolean"},"alsoRunningFlows":{"type":"boolean","description":"When this change turns the assistant on or picks a different one: also turn it on in the template's running flows. Without it the change reaches new flows only. Turning the assistant off always applies at once, in every flow."}},"additionalProperties":false}}}},"responses":{"200":{"description":"Settings","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"supportMode":{"type":"string","enum":["AI_ONLY","HUMAN_ONLY","AI_HUMAN"]},"agentId":{"type":["string","null"],"description":"The chat agent that answers, or `null` when none is picked."},"agentName":{"type":"string","maxLength":200},"agentPersona":{"type":["string","null"],"maxLength":2000},"triggerMode":{"type":"string","enum":["auto_reply","mention_only"]},"escalationRole":{"type":["string","null"],"description":"The role (by name) that answers when the assistant hands a conversation to a person, or `null` when none is picked: with none, the assistant never hands off."},"businessHoursTimezone":{"type":["string","null"],"maxLength":100},"businessHoursSchedule":{"description":"Opening hours by day of the week, in `businessHoursTimezone`, as saved: each day `{ start, end }`, or `null` when closed. `null` when not set."},"assistUsesAgentKnowledge":{"type":"boolean"},"templateId":{"type":"string"},"runningFlowsChanged":{"type":"integer","description":"On a write: how many existing flows this change turned the assistant on or off in."},"runningFlows":{"type":"object","properties":{"assistantOff":{"type":"integer"},"assistantOn":{"type":"integer"}},"required":["assistantOff","assistantOn"],"description":"On a read: the template's running flows `alsoRunningFlows` can reach (a flow whose manager turned the assistant off is never counted). Turning the assistant on reaches `assistantOff`; picking a different assistant reaches both."}},"required":["escalationRole","templateId"],"additionalProperties":false}},"required":["success","data"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/templates/{id}/faq":{"get":{"tags":["Template setup"],"summary":"List a template's FAQ","description":"Returns the questions and answers the chat assistant uses for this template.\n\nA personal access token reads it with its person's permissions. An organization API key with `templates:read` reads it too, as an admin does; changing it still needs a personal access token.\n\n**Permission for a personal access token:** Edit access to the template.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `templates:read`","security":[{"bearerAuth":["templates:read"]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"FAQ","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"array","items":{"type":"object","properties":{"question":{"type":"string","minLength":1,"maxLength":2000},"answer":{"type":"string","minLength":1,"maxLength":5000},"keywords":{"type":"array","items":{"type":"string"}},"sortOrder":{"type":"integer"},"id":{"type":"string"},"templateId":{"type":"string"}},"required":["question","answer","id","templateId"]}}},"required":["success","data"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"tags":["Template setup"],"summary":"Add a FAQ entry","description":"Adds one question and answer.\n\nThis runs as the person who owns the token, with exactly their permissions in Moxo, and is recorded as theirs. An organization API key gets `403 PERSON_TOKEN_REQUIRED`.\n\n**Permission:** Edit access to the template.\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"x-moxo-person-only":"PERSON_TOKEN_REQUIRED","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"question":{"type":"string","minLength":1,"maxLength":2000},"answer":{"type":"string","minLength":1,"maxLength":5000},"keywords":{"type":"array","items":{"type":"string"}},"sortOrder":{"type":"integer"}},"required":["question","answer"]}}}},"responses":{"201":{"description":"The entry","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"question":{"type":"string","minLength":1,"maxLength":2000},"answer":{"type":"string","minLength":1,"maxLength":5000},"keywords":{"type":"array","items":{"type":"string"}},"sortOrder":{"type":"integer"},"id":{"type":"string"},"templateId":{"type":"string"}},"required":["question","answer","id","templateId"]}},"required":["success","data"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/templates/{id}/faq/{faqId}":{"put":{"tags":["Template setup"],"summary":"Change a FAQ entry","description":"Changes only the fields you send.\n\nThis runs as the person who owns the token, with exactly their permissions in Moxo, and is recorded as theirs. An organization API key gets `403 PERSON_TOKEN_REQUIRED`.\n\n**Permission:** Edit access to the template.\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"x-moxo-person-only":"PERSON_TOKEN_REQUIRED","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":true,"name":"faqId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"question":{"type":"string","minLength":1,"maxLength":2000},"answer":{"type":"string","minLength":1,"maxLength":5000},"keywords":{"type":"array","items":{"type":"string"}},"sortOrder":{"type":"integer"}}}}}},"responses":{"200":{"description":"The entry","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"question":{"type":"string","minLength":1,"maxLength":2000},"answer":{"type":"string","minLength":1,"maxLength":5000},"keywords":{"type":"array","items":{"type":"string"}},"sortOrder":{"type":"integer"},"id":{"type":"string"},"templateId":{"type":"string"}},"required":["question","answer","id","templateId"]}},"required":["success","data"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"tags":["Template setup"],"summary":"Remove a FAQ entry","description":"Removes one entry.\n\nThis runs as the person who owns the token, with exactly their permissions in Moxo, and is recorded as theirs. An organization API key gets `403 PERSON_TOKEN_REQUIRED`.\n\n**Permission:** Edit access to the template.\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"x-moxo-person-only":"PERSON_TOKEN_REQUIRED","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":true,"name":"faqId","in":"path"}],"responses":{"200":{"description":"Removed","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."}},"required":["success"],"additionalProperties":false}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/schedules":{"get":{"tags":["Template start"],"summary":"List schedules","description":"Returns one template's schedules. `templateId` is required; a template you can't start returns 404.\n\nA personal access token reads it with its person's permissions. An organization API key with `templates:read` reads it too, as an admin does; changing it still needs a personal access token.\n\n**Permission for a personal access token:** Manage schedules (`schedules.manage`) and permission to start the template.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `templates:read`","security":[{"bearerAuth":["templates:read"]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"templateId","in":"query"}],"responses":{"200":{"description":"Schedules","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"array","items":{"$ref":"#/components/schemas/BuilderSchedule"}}},"required":["success","data"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"tags":["Template start"],"summary":"Start a template on a schedule","description":"Starts a flow from a published template on a repeating schedule (cron, in `timezone`). Name roles by their name on the template. Needs the Scheduling feature on your plan. A template that was never published, or is archived, returns `409 TEMPLATE_NOT_PUBLISHED`, as a webhook start does. `customFields` is refused the way a start refuses it: a key that names no start field, or a field's id or label in its place, returns `400 VALIDATION_FAILED` naming it, and nothing is saved. An unknown role is refused the same way.\n\nThis runs as the person who owns the token, with exactly their permissions in Moxo, and is recorded as theirs. An organization API key gets `403 PERSON_TOKEN_REQUIRED`.\n\n**Permission:** Manage schedules (`schedules.manage`) and permission to start the template.\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"x-moxo-person-only":"PERSON_TOKEN_REQUIRED","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"templateId":{"type":"string"},"scheduleName":{"type":"string"},"kind":{"type":"string","enum":["cron","weekdays_before_eom"],"description":"Defaults to cron."},"cronPattern":{"type":"string","description":"5 fields: minute hour day-of-month month day-of-week."},"kindParams":{"type":"object","properties":{"n":{"type":"integer","description":"How many weekdays before the end of the month."},"hour":{"type":"integer","description":"Hour of the day, 0 to 23."},"minute":{"type":"integer","description":"Minute of the hour, 0 to 59."}},"required":["n","hour","minute"],"description":"For `weekdays_before_eom`: which weekday before month end, and when."},"timezone":{"type":"string","description":"IANA name, for example America/New_York. Defaults to UTC."},"roleAssignments":{"type":["object","null"],"additionalProperties":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"},"minItems":1}]},"description":"Role → person, or a list of people. Name the role by its key, name or id, and each person by id (`usr_…`, or `user:usr_…` for an internal user)."},"customFields":{"type":["array","null"],"items":{"$ref":"#/components/schemas/CustomFieldValueInput"},"description":"Start-form answers, each field by its `key`, as `POST /v1/templates/{id}/start` takes them. A key that names no start field, or a field's id or label in its place, is refused (`400 VALIDATION_FAILED`), as a start refuses it."},"flowTitleTemplate":{"type":["string","null"]},"flowDue":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["DAYS_AFTER_START"],"description":"Due a number of days after the flow starts."},"days":{"type":"integer","minimum":1,"maximum":3650,"description":"How many days after the flow starts."}},"required":["type","days"]},{"type":"object","properties":{"type":{"type":"string","enum":["DAY_OF_MONTH"],"description":"Due on a day of the month; a day already past rolls to the next month."},"day":{"type":"integer","minimum":1,"maximum":31,"description":"Day of the month, 1 to 31 (31 means the last day of a shorter month)."}},"required":["type","day"]},{"type":"object","properties":{"type":{"type":"string","enum":["DAY_OF_YEAR"],"description":"Due on a date in the year; a date already past rolls to the next year."},"month":{"type":"integer","minimum":1,"maximum":12,"description":"Month, 1 to 12."},"day":{"type":"integer","minimum":1,"maximum":31,"description":"Day of the month."}},"required":["type","month","day"]},{"type":"null"}],"description":"When each flow the schedule starts is due. Leave it out to use the template's own due date."}},"required":["templateId","scheduleName"]}}}},"responses":{"201":{"description":"The schedule","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/BuilderSchedule"}},"required":["success","data"]}}}},"400":{"description":"Refused: `VALIDATION_FAILED`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Refused: `TEMPLATE_NOT_PUBLISHED`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/schedules/{id}":{"put":{"tags":["Template start"],"summary":"Change a schedule","description":"Changes only the fields you send. `scheduleName` and `enabled` apply at once (`enabled: false` pauses it, and `nextRun` is `null` while paused). For a template's own schedule, when it runs and what it starts (`kind`, `cronPattern`, `kindParams`, `timezone`, `roleAssignments`, `customFields`, `flowTitleTemplate`, `flowDue`) are part of the template's setup: a change waits for the template's next publish, as other start settings do. Until then the answer shows the new values with `hasPendingSetup: true`, while `nextRun` and the flows it starts follow the published ones. A schedule a running flow made (a Schedule a flow step) changes at once.\n\nThis runs as the person who owns the token, with exactly their permissions in Moxo, and is recorded as theirs. An organization API key gets `403 PERSON_TOKEN_REQUIRED`.\n\n**Permission:** Manage schedules (`schedules.manage`) and permission to start the template.\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"x-moxo-person-only":"PERSON_TOKEN_REQUIRED","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"scheduleName":{"type":"string"},"kind":{"type":"string","enum":["cron","weekdays_before_eom"],"description":"Defaults to cron."},"cronPattern":{"type":"string","description":"5 fields: minute hour day-of-month month day-of-week."},"kindParams":{"type":"object","properties":{"n":{"type":"integer","description":"How many weekdays before the end of the month."},"hour":{"type":"integer","description":"Hour of the day, 0 to 23."},"minute":{"type":"integer","description":"Minute of the hour, 0 to 59."}},"required":["n","hour","minute"],"description":"For `weekdays_before_eom`: which weekday before month end, and when."},"timezone":{"type":"string","description":"IANA name, for example America/New_York. Defaults to UTC."},"roleAssignments":{"type":["object","null"],"additionalProperties":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"},"minItems":1}]},"description":"Role → person, or a list of people. Name the role by its key, name or id, and each person by id (`usr_…`, or `user:usr_…` for an internal user)."},"customFields":{"type":["array","null"],"items":{"$ref":"#/components/schemas/CustomFieldValueInput"},"description":"Start-form answers, each field by its `key`, as `POST /v1/templates/{id}/start` takes them. A key that names no start field, or a field's id or label in its place, is refused (`400 VALIDATION_FAILED`), as a start refuses it."},"flowTitleTemplate":{"type":["string","null"]},"flowDue":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["DAYS_AFTER_START"],"description":"Due a number of days after the flow starts."},"days":{"type":"integer","minimum":1,"maximum":3650,"description":"How many days after the flow starts."}},"required":["type","days"]},{"type":"object","properties":{"type":{"type":"string","enum":["DAY_OF_MONTH"],"description":"Due on a day of the month; a day already past rolls to the next month."},"day":{"type":"integer","minimum":1,"maximum":31,"description":"Day of the month, 1 to 31 (31 means the last day of a shorter month)."}},"required":["type","day"]},{"type":"object","properties":{"type":{"type":"string","enum":["DAY_OF_YEAR"],"description":"Due on a date in the year; a date already past rolls to the next year."},"month":{"type":"integer","minimum":1,"maximum":12,"description":"Month, 1 to 12."},"day":{"type":"integer","minimum":1,"maximum":31,"description":"Day of the month."}},"required":["type","month","day"]},{"type":"null"}],"description":"When each flow the schedule starts is due. Leave it out to use the template's own due date."},"enabled":{"type":"boolean"}}}}}},"responses":{"200":{"description":"The schedule","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/BuilderSchedule"}},"required":["success","data"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"tags":["Template start"],"summary":"Remove a schedule","description":"No more flows start from it. Flows it already started keep running.\n\nThis runs as the person who owns the token, with exactly their permissions in Moxo, and is recorded as theirs. An organization API key gets `403 PERSON_TOKEN_REQUIRED`.\n\n**Permission:** Manage schedules (`schedules.manage`) and permission to start the template.\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"x-moxo-person-only":"PERSON_TOKEN_REQUIRED","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The schedule that was removed.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."},"data":{"type":"object","properties":{"id":{"type":"string","description":"The removed schedule's id."},"deleted":{"type":"boolean","enum":[true],"description":"Always `true`: the schedule is removed."}},"required":["id","deleted"],"additionalProperties":false,"description":"The schedule that was removed."}},"required":["success","data"],"additionalProperties":false}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flow-triggers":{"get":{"tags":["Template start"],"summary":"List a template's app triggers","description":"Returns the app events that start a flow from this template.\n\nA personal access token reads it with its person's permissions. An organization API key with `templates:read` reads it too, as an admin does; changing it still needs a personal access token.\n\n**Permission for a personal access token:** Configure integrations (`integrations.configure`) and edit access to the template.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `templates:read`","security":[{"bearerAuth":["templates:read"]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"templateId","in":"query"}],"responses":{"200":{"description":"App triggers","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"array","items":{"$ref":"#/components/schemas/BuilderAppTrigger"}}},"required":["success","data"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"tags":["Template start"],"summary":"Start a template on an app event","description":"Starts a flow when something happens in a connected app. A trigger runs on one of the organization's connections: a connection a person made for themselves alone does not count, and naming one is refused with `400 BAD_REQUEST`. A person connects apps in Moxo: when the organization has no connection for `provider`, the response is `409 CONNECTION_REQUIRED` with `error.connectUrl` to share with a person. When there are several, `409 CONNECTION_CHOICE_REQUIRED` lists them: send `connectionId`.\n\nChoose `eventType` from `GET /v1/flow-triggers/providers/{provider}/event-types`.\n\nThis runs as the person who owns the token, with exactly their permissions in Moxo, and is recorded as theirs. An organization API key gets `403 PERSON_TOKEN_REQUIRED`.\n\n**Permission:** Configure integrations (`integrations.configure`) and edit access to the template.\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"x-moxo-person-only":"PERSON_TOKEN_REQUIRED","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"templateId":{"type":"string"},"provider":{"type":"string","description":"The app, for example hubspot or salesforce."},"connectionId":{"type":"string","description":"Leave it out to use the organization's one connection for this app. With none, the request returns `409 CONNECTION_REQUIRED` with a link for a person to connect one. A connection a person made for themselves alone never runs a trigger."},"eventType":{"type":"string","description":"From GET /v1/flow-triggers/providers/{provider}/event-types."},"mapping":{"$ref":"#/components/schemas/AppTriggerMapping"},"filter":{"$ref":"#/components/schemas/AppTriggerFilter"},"enabled":{"type":"boolean"}},"required":["templateId","provider","eventType","mapping","filter"]}}}},"responses":{"201":{"description":"The trigger","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/BuilderAppTrigger"}},"required":["success","data"]}}}},"400":{"description":"Refused: `BAD_REQUEST`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict: the request can't be applied as sent. `error.code` says why.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flow-triggers/{id}":{"patch":{"tags":["Template start"],"summary":"Change an app trigger","description":"Changes only the fields you send; `enabled: false` pauses it.\n\nThis runs as the person who owns the token, with exactly their permissions in Moxo, and is recorded as theirs. An organization API key gets `403 PERSON_TOKEN_REQUIRED`.\n\n**Permission:** Configure integrations (`integrations.configure`) and edit access to the template.\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"x-moxo-person-only":"PERSON_TOKEN_REQUIRED","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"connectionId":{"type":"string","description":"Leave it out to use the organization's one connection for this app. With none, the request returns `409 CONNECTION_REQUIRED` with a link for a person to connect one. A connection a person made for themselves alone never runs a trigger."},"eventType":{"type":"string","description":"From GET /v1/flow-triggers/providers/{provider}/event-types."},"mapping":{"$ref":"#/components/schemas/AppTriggerMapping"},"filter":{"$ref":"#/components/schemas/AppTriggerFilter"},"enabled":{"type":"boolean"}}}}}},"responses":{"200":{"description":"The trigger","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/BuilderAppTrigger"}},"required":["success","data"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"tags":["Template start"],"summary":"Remove an app trigger","description":"No more flows start from it.\n\nThis runs as the person who owns the token, with exactly their permissions in Moxo, and is recorded as theirs. An organization API key gets `403 PERSON_TOKEN_REQUIRED`.\n\n**Permission:** Configure integrations (`integrations.configure`) and edit access to the template.\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"x-moxo-person-only":"PERSON_TOKEN_REQUIRED","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Removed"},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flow-triggers/connections":{"get":{"tags":["Template start"],"summary":"List the connections you can use for an app","description":"Returns the `connectionId` values a trigger can use for `provider` (the organization's connections; one a person made for themselves alone never starts a trigger), and where a person connects a new one.\n\nA personal access token reads it with its person's permissions. An organization API key with `templates:read` reads it too, as an admin does; changing it still needs a personal access token.\n\n**Permission for a personal access token:** Configure integrations (`integrations.configure`) and edit access to the template.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `templates:read`","security":[{"bearerAuth":["templates:read"]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"provider","in":"query"}],"responses":{"200":{"description":"Connections","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"provider":{"type":"string"},"connections":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"}},"required":["id","title"]}},"connectUrl":{"type":"string"}},"required":["provider","connections","connectUrl"]}},"required":["success","data"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flow-triggers/providers/{provider}/event-types":{"get":{"tags":["Template start"],"summary":"List the events an app can start a flow on","description":"Returns values for setting up an app trigger, read from the app.\n\nA personal access token reads it with its person's permissions. An organization API key with `templates:read` reads it too, as an admin does; changing it still needs a personal access token.\n\n**Permission for a personal access token:** Configure integrations (`integrations.configure`) and edit access to the template.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `templates:read`","security":[{"bearerAuth":["templates:read"]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"provider","in":"path"}],"responses":{"200":{"description":"Options","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{}},"required":["success"]}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flow-triggers/providers/{provider}/objects":{"get":{"tags":["Template start"],"summary":"List the record types in a connected app","description":"Returns values for setting up an app trigger, read from the app.\n\nOnly HubSpot and Salesforce list their record types here, for the events that start on a record type you pick. Any other app answers `400 BAD_REQUEST`.\n\nWhen the app can't answer, the call fails with its reason: `400 MISSING_DEPENDENCY` when a choice this one depends on isn't in `resource` yet, `409 RECONNECT_REQUIRED` when the account needs reconnecting, `429 RATE_LIMITED` when the app is limiting requests, and `502 PROVIDER_ERROR` when the app failed.\n\nA personal access token reads it with its person's permissions. An organization API key with `templates:read` reads it too, as an admin does; changing it still needs a personal access token.\n\n**Permission for a personal access token:** Configure integrations (`integrations.configure`) and edit access to the template.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `templates:read`","security":[{"bearerAuth":["templates:read"]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"provider","in":"path"},{"schema":{"type":"string"},"required":true,"name":"connectionId","in":"query"}],"responses":{"200":{"description":"Options","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{}},"required":["success"]}}}},"400":{"description":"A choice this one depends on is missing (`MISSING_DEPENDENCY`), or the query is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"The account needs reconnecting (`RECONNECT_REQUIRED`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"502":{"description":"The app failed to answer (`PROVIDER_ERROR`). Try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flow-triggers/providers/{provider}/fields":{"get":{"tags":["Template start"],"summary":"List the fields an event can fill the start form from","description":"Returns values for setting up an app trigger, read from the app.\n\nWhen the app can't answer, the call fails with its reason: `400 MISSING_DEPENDENCY` when a choice this one depends on isn't in `resource` yet, `409 RECONNECT_REQUIRED` when the account needs reconnecting, `429 RATE_LIMITED` when the app is limiting requests, and `502 PROVIDER_ERROR` when the app failed.\n\nA personal access token reads it with its person's permissions. An organization API key with `templates:read` reads it too, as an admin does; changing it still needs a personal access token.\n\n**Permission for a personal access token:** Configure integrations (`integrations.configure`) and edit access to the template.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `templates:read`","security":[{"bearerAuth":["templates:read"]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"provider","in":"path"},{"schema":{"type":"string"},"required":true,"name":"eventType","in":"query"},{"schema":{"type":"string"},"required":true,"name":"connectionId","in":"query"},{"schema":{"type":"string"},"required":false,"name":"sobject","in":"query"},{"schema":{"type":"string"},"required":false,"name":"watchedField","in":"query"},{"schema":{"type":"string","description":"JSON object of the choices made so far, for an event scoped to one (an Asana project)."},"required":false,"description":"JSON object of the choices made so far, for an event scoped to one (an Asana project).","name":"resource","in":"query"},{"schema":{"type":"string","enum":["true","false"],"description":"`true` reads the fields from the app again instead of the last copy."},"required":false,"description":"`true` reads the fields from the app again instead of the last copy.","name":"refresh","in":"query"}],"responses":{"200":{"description":"Options","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{}},"required":["success"]}}}},"400":{"description":"A choice this one depends on is missing (`MISSING_DEPENDENCY`), or the query is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"The account needs reconnecting (`RECONNECT_REQUIRED`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"502":{"description":"The app failed to answer (`PROVIDER_ERROR`). Try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/flow-triggers/providers/{provider}/resource-options":{"get":{"tags":["Template start"],"summary":"List the choices for an event setting","description":"Returns values for setting up an app trigger, read from the app.\n\nWhen the app can't answer, the call fails with its reason: `400 MISSING_DEPENDENCY` when a choice this one depends on isn't in `resource` yet, `409 RECONNECT_REQUIRED` when the account needs reconnecting, `429 RATE_LIMITED` when the app is limiting requests, and `502 PROVIDER_ERROR` when the app failed.\n\nA personal access token reads it with its person's permissions. An organization API key with `templates:read` reads it too, as an admin does; changing it still needs a personal access token.\n\n**Permission for a personal access token:** Configure integrations (`integrations.configure`) and edit access to the template.\n\n**Tokens:** personal access token, organization API key\n**Scope required:** `templates:read`","security":[{"bearerAuth":["templates:read"]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"provider","in":"path"},{"schema":{"type":"string"},"required":true,"name":"eventType","in":"query"},{"schema":{"type":"string"},"required":true,"name":"connectionId","in":"query"},{"schema":{"type":"string"},"required":true,"name":"key","in":"query"},{"schema":{"type":"string","description":"JSON object of the choices made so far."},"required":false,"description":"JSON object of the choices made so far.","name":"resource","in":"query"}],"responses":{"200":{"description":"Options","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{}},"required":["success"]}}}},"400":{"description":"A choice this one depends on is missing (`MISSING_DEPENDENCY`), or the query is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"The account needs reconnecting (`RECONNECT_REQUIRED`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"502":{"description":"The app failed to answer (`PROVIDER_ERROR`). Try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/email-triggers":{"get":{"tags":["Template start"],"summary":"Get a template's email trigger","description":"Returns the email trigger, or `null` when there is none. It only reads: it never creates a trigger. `inboxAddress` appears once the template is published with **Start by email** on.\n\nThis runs as the person who owns the token, with exactly their permissions in Moxo, and is recorded as theirs. An organization API key gets `403 PERSON_TOKEN_REQUIRED`.\n\n**Permission:** Configure integrations (`integrations.configure`) and edit access to the template.\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"x-moxo-person-only":"PERSON_TOKEN_REQUIRED","parameters":[{"schema":{"type":"string"},"required":true,"name":"templateId","in":"query"}],"responses":{"200":{"description":"The email trigger","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"anyOf":[{"$ref":"#/components/schemas/BuilderEmailTrigger"},{"type":"null"}]}},"required":["success","data"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"tags":["Template start"],"summary":"Start a template from an email","description":"Sets which emails start a flow (`filter`) and what fills the start form and roles (`mapping`). Moxo creates the inbox address. Needs the Email trigger feature on your plan (`403 FEATURE_DISABLED` otherwise, with `error.feature` `triggerEmail`).\n\nA template has one email trigger, so this is an upsert: it answers **201** when it creates the trigger, and **200** with the existing trigger, changed by what you send, when the template already has one. It changes only the fields you send; `mapping` merges as `PATCH` describes.\n\nTwo switches decide whether an email starts a flow. The template's **Start by email** setting decides whether it takes email at all: turn it on with `PATCH /v1/templates/{id}/trigger-activation` (`EMAIL` in `supportedStartModes`). `enabled` is this trigger's own pause: `false` stops emails starting flows while Start by email stays on, and nothing but your `PATCH` turns it back on. Both must be on, and the template published, for an email to start a flow.\n\nThis runs as the person who owns the token, with exactly their permissions in Moxo, and is recorded as theirs. An organization API key gets `403 PERSON_TOKEN_REQUIRED`.\n\n**Permission:** Configure integrations (`integrations.configure`) and edit access to the template.\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"x-moxo-person-only":"PERSON_TOKEN_REQUIRED","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"templateId":{"type":"string"},"enabled":{"type":"boolean","description":"This trigger's pause, the same switch as Email in the app's Start step. `false` stops emails starting flows while the template's Start by email stays on; only `true` lifts it, from here or from the app. Whether the template takes email at all is its Start by email setting (`PATCH /v1/templates/{id}/trigger-activation`). Left out, a new trigger is not paused and an existing one keeps its setting."},"filter":{"type":"object","properties":{"sender":{"type":"string","description":"Text the sender's address or name must contain."},"subject":{"type":"string","description":"Text the subject must contain."}},"description":"Only emails whose sender or subject contains this text start a flow."},"mapping":{"type":"object","properties":{"roleAssignments":{"type":"object","additionalProperties":{"type":"string","enum":["from"]},"description":"Role → `from`: the sender fills that role."},"customFields":{"type":"object","additionalProperties":{"type":"string","enum":["from","fromName","subject","body"]},"description":"Start field key → the email part that fills it."}},"additionalProperties":false,"description":"`roleAssignments`: role → `from` (the sender). `customFields`: start field key → the email part that fills it. A role or a start form field the template doesn't have is refused (`400 VALIDATION_FAILED`, naming it), and nothing is saved; a role named by its name is stored by its id."}},"required":["templateId"]}}}},"responses":{"200":{"description":"The email trigger, changed: the template already had one.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Always `true` on a success."},"data":{"allOf":[{"$ref":"#/components/schemas/BuilderEmailTrigger"},{"description":"The template's email trigger, as changed."}]}},"required":["success","data"]}}}},"201":{"description":"The email trigger, created.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/BuilderEmailTrigger"}},"required":["success","data"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/email-triggers/{id}":{"patch":{"tags":["Template start"],"summary":"Change an email trigger","description":"Changes only the fields you send. `enabled: false` pauses the trigger: emails stop starting flows while the template's Start by email stays on, and only `enabled: true` lifts it (saving or publishing the template never does). It is the same switch as **Email** on the app's Start step, so a pause made here shows there, and switching Email on in the app lifts it. Every answer says both facts: `startByEmail` and `enabled`. `mapping` merges one level deep: `roleAssignments` and `inputs` each replace that whole part when you send it, and a part you leave out is kept. To remove one input, send `inputs` without it. A mapping or conditions change waits for the template's next publish (`hasPendingSetup`).\n\nChanging the conditions or mapping, and resuming (`enabled: true`), need the Email trigger feature on your plan (`403 FEATURE_DISABLED` otherwise); pausing never does.\n\nPausing or resuming alone (`enabled` and nothing else) needs edit permission on the template, not Configure integrations. A person without Configure integrations is answered only `{ id, startByEmail, paused }`: the address, conditions and mapping stay behind that permission.\n\nThis runs as the person who owns the token, with exactly their permissions in Moxo, and is recorded as theirs. An organization API key gets `403 PERSON_TOKEN_REQUIRED`.\n\n**Permission:** Configure integrations (`integrations.configure`) and edit access to the template.\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"x-moxo-person-only":"PERSON_TOKEN_REQUIRED","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean","description":"This trigger's pause, the same switch as Email in the app's Start step. `false` stops emails starting flows while the template's Start by email stays on; only `true` lifts it, from here or from the app. Whether the template takes email at all is its Start by email setting (`PATCH /v1/templates/{id}/trigger-activation`)."},"filter":{"type":["object","null"],"properties":{"sender":{"type":"string","description":"Text the sender's address or name must contain."},"subject":{"type":"string","description":"Text the subject must contain."}},"description":"`null` removes the filter."},"mapping":{"type":"object","properties":{"roleAssignments":{"type":"object","additionalProperties":{"type":"string","enum":["from"]},"description":"Role → `from`: the sender fills that role."},"customFields":{"type":"object","additionalProperties":{"type":"string","enum":["from","fromName","subject","body"]},"description":"Start field key → the email part that fills it."}},"additionalProperties":false,"description":"`roleAssignments`: role → `from` (the sender). `customFields`: start field key → the email part that fills it. A role or a start form field the template doesn't have is refused (`400 VALIDATION_FAILED`, naming it), and nothing is saved; a role named by its name is stored by its id."}}}}}},"responses":{"200":{"description":"The email trigger, or only its pause for a person without Configure integrations","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"anyOf":[{"$ref":"#/components/schemas/BuilderEmailTrigger"},{"$ref":"#/components/schemas/BuilderEmailTriggerPause"}]}},"required":["success","data"]}}}},"400":{"description":"The request is not valid: `VALIDATION_FAILED` names each field in `error.details`, or `error.code` says what is wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"tags":["Template start"],"summary":"Remove an email trigger","description":"Removes the trigger, its inbox address, conditions and mapping, and turns the template's **Start by email** off (whether it was on or paused) in the same step, as **Remove** does in the app, so no later save brings back a trigger you removed. Emails to the address stop starting flows. To stop it for a while and keep its setup, send `PATCH` with `enabled: false` instead.\n\nTurning the email start off changes the template. On a template installed from an Archway bundle it answers `409 ARCHWAY_REQUIRES_DETACH_ACK` and removes nothing; send it again with the header `x-archway-detach-ack: 1` to remove the trigger and detach the template from its bundle.\n\nThis runs as the person who owns the token, with exactly their permissions in Moxo, and is recorded as theirs. An organization API key gets `403 PERSON_TOKEN_REQUIRED`.\n\n**Permission:** Configure integrations (`integrations.configure`) and edit access to the template.\n\n**Tokens:** personal access token","security":[{"bearerAuth":[]}],"x-moxo-person-only":"PERSON_TOKEN_REQUIRED","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Removed"},"401":{"description":"The token is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The token can't do this: its person lacks the permission, or the key lacks the scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found, or you can't see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Refused: `ARCHWAY_REQUIRES_DETACH_ACK`. The description says when; `error.code` says which.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}},"webhooks":{}}