{"openapi":"3.0.3","info":{"title":"iMothership API","version":"1.0.0","description":"For authenticated endpoints, select Authorize and choose either McpOAuth to sign in and approve project access, or ProjectApiKey to enter a project API key (x-api-key). Use one authentication method at a time. Try it out sends real requests. Download this specification at /api/docs/openapi.json. [Connect an AI agent with MCP](/api/docs/mcp)."},"x-error-responses-guide":"### Error responses\n\nEach endpoint lists its applicable error codes and any specific conditions. Errors return JSON with an `error` or `message` string. Some responses also include a `code` or validation `issues`. Exact wording and optional fields vary by endpoint. The shared ErrorResponse schema and downloadable OpenAPI specification describe the response structure.\n\n| Status | Meaning |\n| --- | --- |\n| 400 | Invalid request or filters. Check the supplied values. |\n| 401 | Missing, invalid or expired credentials. |\n| 403 | Permission denied for the requested action or project. |\n| 404 | The requested resource was not found or is not accessible. |\n| 409 | A conflict needs resolving, such as an ambiguous task name, stale revision or busy task. |\n| 500 | The server could not complete the request. |\n\nExample: `{\"error\":\"The request could not be completed.\"}`. Authentication errors may use `{\"message\":\"Missing, invalid or expired credentials\"}`.","externalDocs":{"description":"CLI installation and usage guide","url":"/api/docs/cli"},"servers":[{"url":"/","description":"Current API host"}],"tags":[{"name":"Works","description":"Project works and private report links. [Report access guide](/api/docs/works)"},{"name":"Logs"},{"name":"Tasks","description":"Create, read and run tasks. [Integration shapes and examples](/api/docs/task-integrations) · [Machine-readable reference](/api/docs/task-integrations.json)","externalDocs":{"description":"Integration shapes and examples","url":"/api/docs/task-integrations"}},{"name":"Models","description":"Discover models enabled for the current project."},{"name":"APIs"},{"name":"Skills"},{"name":"Webhooks"},{"name":"Marketplace"},{"name":"Public AI"}],"x-tagGroups":[{"name":"Authenticated Endpoints","tags":["Works","Logs","Tasks","Models","APIs","Skills"]},{"name":"Public Endpoints","tags":["Webhooks","Marketplace","Public AI"]}],"components":{"responses":{"Unauthorized":{"description":"Missing, invalid or expired credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"message":"Missing, invalid or expired credentials"}}}},"Forbidden":{"description":"Permission denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"Permission denied"}}}},"NotFound":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"Resource not found"}}}},"InternalServerError":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"Server error"}}}},"TaskConflict":{"description":"Task revision is stale or the task is queued or running","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"Task revision is stale or the task is queued or running"}}}},"AmbiguousTask":{"description":"Task name is ambiguous; use the task ID","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"Task name is ambiguous; use the task ID"}}}},"RunAsForbidden":{"description":"Project or Run as permission denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"Project or Run as permission denied"}}}},"ProjectScopeForbidden":{"description":"Invalid project credential scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"Invalid project credential scope"}}}},"LogNotFound":{"description":"Project or task name not found or not accessible","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"Project or task name not found or not accessible"}}}},"DefinitionConflict":{"description":"Stale revision, duplicate route/tag, or source file unavailable or shared","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"Stale revision, duplicate route/tag, or source file unavailable or shared"}}}}},"schemas":{"ErrorResponse":{"type":"object","description":"Common error body. Exact wording and optional details vary by endpoint.","properties":{"error":{"type":"string","description":"Readable explanation of the error"},"message":{"type":"string","description":"Readable explanation used by authentication responses instead of error"},"code":{"type":"string","description":"Optional machine-readable error code"},"issues":{"type":"array","description":"Optional field-level details","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"step":{"type":"string"}}}}},"example":{"error":"The request could not be completed."}}},"securitySchemes":{"McpOAuth":{"type":"oauth2","description":"Sign in with email, Google, or Microsoft, then choose a project and approve access. Uses a separate, revocable MCP token. Select only the permissions you need. [Manage connected AI applications](https://www.imothership.com/mcp/connections).","flows":{"authorizationCode":{"authorizationUrl":"/auth/mcp/authorize","tokenUrl":"/auth/mcp/token","scopes":{"mcp:read":"Read project tasks, definitions, models and logs","mcp:write":"Create/edit tasks and definitions, run tasks, and execute APIs/skills"}}}},"ProjectApiKey":{"type":"apiKey","in":"header","name":"x-api-key","description":"An active project API key. Keys default to a service identity independent of the creator's login. Task authoring and operations requiring a user identity need an explicitly selected **Run as user**, who must remain a project and organization member. Webhook secrets cannot authenticate API requests.\n\n> [Open project settings to create an API key](https://www.imothership.com/settings/project). An organization administrator can select the project, expand **API Keys & Webhook Endpoints**, choose type **Api**, and click **Create API Key** with **Active** enabled.\n>\n> Copy the secret when it is created (it is shown only once), then paste it below without a prefix. Sign in to iMothership if prompted."}}},"paths":{"/api/v1/works":{"get":{"tags":["Works"],"security":[{"ProjectApiKey":[]},{"McpOAuth":["mcp:read"]}],"operationId":"listWorks","summary":"List works in the current project","description":"Returns safe metadata for works linked to this project, including whether an entry file is configured. Does not expose source, private settings, or execute reports.","parameters":[{"name":"q","in":"query","description":"Literal name search","schema":{"type":"string","maxLength":100}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":50}},{"name":"skip","in":"query","schema":{"type":"integer","minimum":0,"maximum":1000000,"default":0}}],"responses":{"200":{"description":"Project works","content":{"application/json":{"schema":{"type":"object","properties":{"docs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"has_view":{"type":"boolean"},"app_url":{"type":"string","format":"uri","description":"Normal app URL; requires a browser login."}}}},"total":{"type":"integer"},"limit":{"type":"integer"},"skip":{"type":"integer"},"hasMore":{"type":"boolean"}}}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"403":{"description":"Permission denied","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"404":{"description":"Work or report unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"429":{"description":"Too many report links","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"503":{"description":"Report links unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}},"/api/v1/works/{id}":{"get":{"tags":["Works"],"security":[{"ProjectApiKey":[]},{"McpOAuth":["mcp:read"]}],"operationId":"getWork","summary":"Read work metadata","parameters":[{"name":"id","in":"path","required":true,"description":"Work ID from listWorks","schema":{"type":"string","pattern":"^[a-fA-F0-9]{24}$"}}],"description":"Only works linked to the authenticated project are accessible. app_url is a normal login-protected link.","responses":{"200":{"description":"Work metadata","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"has_view":{"type":"boolean"},"app_url":{"type":"string","format":"uri","description":"Normal app URL; requires a browser login."}}}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"403":{"description":"Permission denied","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"404":{"description":"Work or report unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"429":{"description":"Too many report links","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"503":{"description":"Report links unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}},"/api/v1/works/{id}/view":{"post":{"tags":["Works"],"security":[{"ProjectApiKey":[]},{"McpOAuth":["mcp:write"]}],"operationId":"createWorkViewLink","summary":"Create a private, expiring report view link","parameters":[{"name":"id","in":"path","required":true,"description":"Work ID from listWorks","schema":{"type":"string","pattern":"^[a-fA-F0-9]{24}$"}}],"description":"Opens the private report with live MongoDB data using mcp:read. Defaults to interactive=true and allow_changes=false: data APIs run in an isolated read-only runtime with project collection permissions. Database writes, external HTTP, filesystem, email, module imports and command-executing template tags are blocked. Unsupported APIs fail closed. interactive=false requests files only. Explicit allow_changes=true requires mcp:write and an editor/admin identity and enables normal API execution. Links default to 24 hours and accept 60-86400 seconds and revalidate parent authorization and project/work access. Browser capability is needed to render and interact; MCP returns a link, not a screenshot. When the user requests a link, include the complete returned view_url as a clickable Markdown link [Open report](RETURNED_VIEW_URL) in the same reply, without backticks or code fences. Preserve the entire URL including its token; never invent or truncate it. Give expires_at separately. Sharing privately with the requesting user is intended; do not publish publicly or log the URL. Do not merely announce that the link is ready. See /api/docs/works.","requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"interactive":{"type":"boolean","default":true},"allow_changes":{"type":"boolean","default":false,"description":"Enable mutating actions; requires mcp:write and editor/admin permission."},"expires_in":{"type":"integer","minimum":60,"maximum":86400,"default":86400},"filters":{"type":"object","maxProperties":30,"additionalProperties":{"oneOf":[{"type":"string","maxLength":1000},{"type":"number"},{"type":"boolean"}]},"description":"Exact report query parameters. Authentication/scope fields and template expressions are forbidden."}}},"example":{"interactive":true,"expires_in":86400,"filters":{}}}}},"responses":{"201":{"description":"Private report link","content":{"application/json":{"schema":{"type":"object","properties":{"work":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"has_view":{"type":"boolean"},"app_url":{"type":"string","format":"uri","description":"Normal app URL; requires a browser login."}}},"view_url":{"type":"string","format":"uri","description":"Private bearer URL. Return this complete URL as a clickable Markdown link when the requesting user asks for the report link. Do not publish publicly or log it."},"expires_at":{"type":"string","format":"date-time"},"interactive":{"type":"boolean"},"read_only":{"type":"boolean"},"warning":{"type":"string"}}}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"403":{"description":"Permission denied","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"404":{"description":"Work or report unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"429":{"description":"Too many report links","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"503":{"description":"Report links unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}},"/api/v1/apis":{"get":{"tags":["APIs"],"security":[{"ProjectApiKey":[]},{"McpOAuth":["mcp:read"]}],"operationId":"listApiDefinitions","summary":"List API definitions","description":"Lists definitions in the authenticated project, sorted by request then ID. Returns metadata only. Does not execute APIs or expand skill tags. Use an ID from this list to read the raw source.","parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":50}},{"name":"skip","in":"query","schema":{"type":"integer","minimum":0,"maximum":1000000,"default":0}}],"responses":{"200":{"description":"Definition summaries","content":{"application/json":{"schema":{"type":"object","properties":{"docs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$"},"request":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*(?:/[a-z0-9]+(?:-[a-z0-9]+)*)*$","description":"Unique project route, for example customer/list. Does not include /api/v1/api/ or /api/v1/skill/."},"description":{"type":"string","maxLength":4000},"tag":{"type":"string","minLength":1,"maxLength":100,"pattern":"^(?!__proto__$|constructor$|prototype$)[A-Za-z0-9_-]+$","description":"Reference tag without {{braces}}. Defaults to the final segment of request."},"work_id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Create only: project work for the source file. Defaults to the project Data work. The work must belong exclusively to this project."}}}},"total":{"type":"integer"},"limit":{"type":"integer"},"skip":{"type":"integer"},"hasMore":{"type":"boolean"}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"step":{"type":"string"}}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/DefinitionConflict"},"500":{"$ref":"#/components/responses/InternalServerError"}}}},"/api/v1/apis/{id}":{"get":{"tags":["APIs"],"security":[{"ProjectApiKey":[]},{"McpOAuth":["mcp:read"]}],"operationId":"getApiDefinition","summary":"Read a API definition","description":"Returns raw source and a revision for editing. Does not execute source or expand {{tags}}. Only definitions and source works in the current project are accessible. Runtime credentials and other private command settings are not included.","parameters":[{"name":"id","in":"path","required":true,"description":"Definition ID from the list endpoint","schema":{"type":"string"}}],"responses":{"200":{"description":"Definition source and metadata","content":{"application/json":{"schema":{"type":"object","required":["id","revision","request","content","work_id"],"properties":{"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$"},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$","description":"Required on updates. Copy the revision returned by GET."},"request":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*(?:/[a-z0-9]+(?:-[a-z0-9]+)*)*$","description":"Unique project route, for example customer/list. Does not include /api/v1/api/ or /api/v1/skill/."},"description":{"type":"string","maxLength":4000},"tag":{"type":"string","minLength":1,"maxLength":100,"pattern":"^(?!__proto__$|constructor$|prototype$)[A-Za-z0-9_-]+$","description":"Reference tag without {{braces}}. Defaults to the final segment of request."},"content":{"type":"string","minLength":1,"maxLength":200000,"pattern":"\\S","description":"Raw JavaScript API function body or Markdown skill source. Reading, validating and saving do not execute source or expand tags."},"work_id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Create only: project work for the source file. Defaults to the project Data work. The work must belong exclusively to this project."},"kind":{"type":"string","enum":["api","skill"]}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"step":{"type":"string"}}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/DefinitionConflict"},"500":{"$ref":"#/components/responses/InternalServerError"}}}},"/api/v1/apis/createOrUpdateApi":{"post":{"tags":["APIs"],"security":[{"ProjectApiKey":[]},{"McpOAuth":["mcp:write"]}],"operationId":"createOrUpdateApi","summary":"Create or update a API definition","description":"Create: supply request and content; omit id and revision. work_id defaults to the project Data work. The work must already exist and belong exclusively to this project. Update: GET first, then supply id, revision and changed fields. Omitted fields and private runtime settings are preserved. Source files shared by commands or projects cannot be edited here. New APIs use secure execution. Route names and tags must be unique across project APIs and skills. Saving does not execute source or expand tags. MongoDB source and command metadata save atomically; storage_synced reports synchronization of the download copy.","requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","additionalProperties":false,"properties":{"request":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*(?:/[a-z0-9]+(?:-[a-z0-9]+)*)*$","description":"Unique project route, for example customer/list. Does not include /api/v1/api/ or /api/v1/skill/."},"description":{"type":"string","maxLength":4000},"tag":{"type":"string","minLength":1,"maxLength":100,"pattern":"^(?!__proto__$|constructor$|prototype$)[A-Za-z0-9_-]+$","description":"Reference tag without {{braces}}. Defaults to the final segment of request."},"content":{"type":"string","minLength":1,"maxLength":200000,"pattern":"\\S","description":"Raw JavaScript API function body or Markdown skill source. Reading, validating and saving do not execute source or expand tags."},"work_id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Create only: project work for the source file. Defaults to the project Data work. The work must belong exclusively to this project."}},"required":["request","content"]},{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$"},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$","description":"Required on updates. Copy the revision returned by GET."},"request":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*(?:/[a-z0-9]+(?:-[a-z0-9]+)*)*$","description":"Unique project route, for example customer/list. Does not include /api/v1/api/ or /api/v1/skill/."},"description":{"type":"string","maxLength":4000},"tag":{"type":"string","minLength":1,"maxLength":100,"pattern":"^(?!__proto__$|constructor$|prototype$)[A-Za-z0-9_-]+$","description":"Reference tag without {{braces}}. Defaults to the final segment of request."},"content":{"type":"string","minLength":1,"maxLength":200000,"pattern":"\\S","description":"Raw JavaScript API function body or Markdown skill source. Reading, validating and saving do not execute source or expand tags."}},"required":["id","revision"],"anyOf":[{"required":["request"]},{"required":["description"]},{"required":["tag"]},{"required":["content"]}]}]}}}},"responses":{"200":{"description":"Definition updated","content":{"application/json":{"schema":{"type":"object","properties":{"created":{"type":"boolean"},"definition":{"type":"object","required":["id","revision","request","content","work_id"],"properties":{"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$"},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$","description":"Required on updates. Copy the revision returned by GET."},"request":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*(?:/[a-z0-9]+(?:-[a-z0-9]+)*)*$","description":"Unique project route, for example customer/list. Does not include /api/v1/api/ or /api/v1/skill/."},"description":{"type":"string","maxLength":4000},"tag":{"type":"string","minLength":1,"maxLength":100,"pattern":"^(?!__proto__$|constructor$|prototype$)[A-Za-z0-9_-]+$","description":"Reference tag without {{braces}}. Defaults to the final segment of request."},"content":{"type":"string","minLength":1,"maxLength":200000,"pattern":"\\S","description":"Raw JavaScript API function body or Markdown skill source. Reading, validating and saving do not execute source or expand tags."},"work_id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Create only: project work for the source file. Defaults to the project Data work. The work must belong exclusively to this project."},"kind":{"type":"string","enum":["api","skill"]}}},"storage_synced":{"type":"boolean","description":"Whether download storage was synchronized. The definition is saved even when false; GET its latest revision and save again to retry."},"warnings":{"type":"array","items":{"type":"string"}}}}}}},"201":{"description":"Definition created","content":{"application/json":{"schema":{"type":"object","properties":{"created":{"type":"boolean"},"definition":{"type":"object","required":["id","revision","request","content","work_id"],"properties":{"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$"},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$","description":"Required on updates. Copy the revision returned by GET."},"request":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*(?:/[a-z0-9]+(?:-[a-z0-9]+)*)*$","description":"Unique project route, for example customer/list. Does not include /api/v1/api/ or /api/v1/skill/."},"description":{"type":"string","maxLength":4000},"tag":{"type":"string","minLength":1,"maxLength":100,"pattern":"^(?!__proto__$|constructor$|prototype$)[A-Za-z0-9_-]+$","description":"Reference tag without {{braces}}. Defaults to the final segment of request."},"content":{"type":"string","minLength":1,"maxLength":200000,"pattern":"\\S","description":"Raw JavaScript API function body or Markdown skill source. Reading, validating and saving do not execute source or expand tags."},"work_id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Create only: project work for the source file. Defaults to the project Data work. The work must belong exclusively to this project."},"kind":{"type":"string","enum":["api","skill"]}}},"storage_synced":{"type":"boolean","description":"Whether download storage was synchronized. The definition is saved even when false; GET its latest revision and save again to retry."},"warnings":{"type":"array","items":{"type":"string"}}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"step":{"type":"string"}}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/DefinitionConflict"},"500":{"$ref":"#/components/responses/InternalServerError"}}}},"/api/v1/apis/validate":{"post":{"tags":["APIs"],"security":[{"ProjectApiKey":[]},{"McpOAuth":["mcp:write"]}],"operationId":"validateApiDefinition","summary":"Validate a API definition edit","description":"Same request and scope checks as create/update, without saving, uploading, executing source or expanding tags. Checks request fields, revision, route conflicts and source ownership; does not execute or verify JavaScript behavior.","requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","additionalProperties":false,"properties":{"request":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*(?:/[a-z0-9]+(?:-[a-z0-9]+)*)*$","description":"Unique project route, for example customer/list. Does not include /api/v1/api/ or /api/v1/skill/."},"description":{"type":"string","maxLength":4000},"tag":{"type":"string","minLength":1,"maxLength":100,"pattern":"^(?!__proto__$|constructor$|prototype$)[A-Za-z0-9_-]+$","description":"Reference tag without {{braces}}. Defaults to the final segment of request."},"content":{"type":"string","minLength":1,"maxLength":200000,"pattern":"\\S","description":"Raw JavaScript API function body or Markdown skill source. Reading, validating and saving do not execute source or expand tags."},"work_id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Create only: project work for the source file. Defaults to the project Data work. The work must belong exclusively to this project."}},"required":["request","content"]},{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$"},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$","description":"Required on updates. Copy the revision returned by GET."},"request":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*(?:/[a-z0-9]+(?:-[a-z0-9]+)*)*$","description":"Unique project route, for example customer/list. Does not include /api/v1/api/ or /api/v1/skill/."},"description":{"type":"string","maxLength":4000},"tag":{"type":"string","minLength":1,"maxLength":100,"pattern":"^(?!__proto__$|constructor$|prototype$)[A-Za-z0-9_-]+$","description":"Reference tag without {{braces}}. Defaults to the final segment of request."},"content":{"type":"string","minLength":1,"maxLength":200000,"pattern":"\\S","description":"Raw JavaScript API function body or Markdown skill source. Reading, validating and saving do not execute source or expand tags."}},"required":["id","revision"],"anyOf":[{"required":["request"]},{"required":["description"]},{"required":["tag"]},{"required":["content"]}]}]}}}},"responses":{"200":{"description":"Valid definition request","content":{"application/json":{"schema":{"type":"object","properties":{"valid":{"type":"boolean"},"issues":{"type":"array","items":{"type":"object","additionalProperties":true}}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"step":{"type":"string"}}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/DefinitionConflict"},"500":{"$ref":"#/components/responses/InternalServerError"}}}},"/api/v1/skills":{"get":{"tags":["Skills"],"security":[{"ProjectApiKey":[]},{"McpOAuth":["mcp:read"]}],"operationId":"listSkillDefinitions","summary":"List skill definitions","description":"Lists definitions in the authenticated project, sorted by request then ID. Returns metadata only. Does not execute APIs or expand skill tags. Use an ID from this list to read the raw source.","parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":50}},{"name":"skip","in":"query","schema":{"type":"integer","minimum":0,"maximum":1000000,"default":0}}],"responses":{"200":{"description":"Definition summaries","content":{"application/json":{"schema":{"type":"object","properties":{"docs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$"},"request":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*(?:/[a-z0-9]+(?:-[a-z0-9]+)*)*$","description":"Unique project route, for example customer/list. Does not include /api/v1/api/ or /api/v1/skill/."},"description":{"type":"string","maxLength":4000},"tag":{"type":"string","minLength":1,"maxLength":100,"pattern":"^(?!__proto__$|constructor$|prototype$)[A-Za-z0-9_-]+$","description":"Reference tag without {{braces}}. Defaults to the final segment of request."},"work_id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Create only: project work for the source file. Defaults to the project Data work. The work must belong exclusively to this project."}}}},"total":{"type":"integer"},"limit":{"type":"integer"},"skip":{"type":"integer"},"hasMore":{"type":"boolean"}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"step":{"type":"string"}}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/DefinitionConflict"},"500":{"$ref":"#/components/responses/InternalServerError"}}}},"/api/v1/skills/{id}":{"get":{"tags":["Skills"],"security":[{"ProjectApiKey":[]},{"McpOAuth":["mcp:read"]}],"operationId":"getSkillDefinition","summary":"Read a skill definition","description":"Returns raw source and a revision for editing. Does not execute source or expand {{tags}}. Only definitions and source works in the current project are accessible. Runtime credentials and other private command settings are not included.","parameters":[{"name":"id","in":"path","required":true,"description":"Definition ID from the list endpoint","schema":{"type":"string"}}],"responses":{"200":{"description":"Definition source and metadata","content":{"application/json":{"schema":{"type":"object","required":["id","revision","request","content","work_id"],"properties":{"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$"},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$","description":"Required on updates. Copy the revision returned by GET."},"request":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*(?:/[a-z0-9]+(?:-[a-z0-9]+)*)*$","description":"Unique project route, for example customer/list. Does not include /api/v1/api/ or /api/v1/skill/."},"description":{"type":"string","maxLength":4000},"tag":{"type":"string","minLength":1,"maxLength":100,"pattern":"^(?!__proto__$|constructor$|prototype$)[A-Za-z0-9_-]+$","description":"Reference tag without {{braces}}. Defaults to the final segment of request."},"content":{"type":"string","minLength":1,"maxLength":200000,"pattern":"\\S","description":"Raw JavaScript API function body or Markdown skill source. Reading, validating and saving do not execute source or expand tags."},"work_id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Create only: project work for the source file. Defaults to the project Data work. The work must belong exclusively to this project."},"kind":{"type":"string","enum":["api","skill"]}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"step":{"type":"string"}}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/DefinitionConflict"},"500":{"$ref":"#/components/responses/InternalServerError"}}}},"/api/v1/skills/createOrUpdateSkill":{"post":{"tags":["Skills"],"security":[{"ProjectApiKey":[]},{"McpOAuth":["mcp:write"]}],"operationId":"createOrUpdateSkill","summary":"Create or update a skill definition","description":"Create: supply request and content; omit id and revision. work_id defaults to the project Data work. The work must already exist and belong exclusively to this project. Update: GET first, then supply id, revision and changed fields. Omitted fields and private runtime settings are preserved. Source files shared by commands or projects cannot be edited here. New APIs use secure execution. Route names and tags must be unique across project APIs and skills. Saving does not execute source or expand tags. MongoDB source and command metadata save atomically; storage_synced reports synchronization of the download copy.","requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","additionalProperties":false,"properties":{"request":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*(?:/[a-z0-9]+(?:-[a-z0-9]+)*)*$","description":"Unique project route, for example customer/list. Does not include /api/v1/api/ or /api/v1/skill/."},"description":{"type":"string","maxLength":4000},"tag":{"type":"string","minLength":1,"maxLength":100,"pattern":"^(?!__proto__$|constructor$|prototype$)[A-Za-z0-9_-]+$","description":"Reference tag without {{braces}}. Defaults to the final segment of request."},"content":{"type":"string","minLength":1,"maxLength":200000,"pattern":"\\S","description":"Raw JavaScript API function body or Markdown skill source. Reading, validating and saving do not execute source or expand tags."},"work_id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Create only: project work for the source file. Defaults to the project Data work. The work must belong exclusively to this project."}},"required":["request","content"]},{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$"},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$","description":"Required on updates. Copy the revision returned by GET."},"request":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*(?:/[a-z0-9]+(?:-[a-z0-9]+)*)*$","description":"Unique project route, for example customer/list. Does not include /api/v1/api/ or /api/v1/skill/."},"description":{"type":"string","maxLength":4000},"tag":{"type":"string","minLength":1,"maxLength":100,"pattern":"^(?!__proto__$|constructor$|prototype$)[A-Za-z0-9_-]+$","description":"Reference tag without {{braces}}. Defaults to the final segment of request."},"content":{"type":"string","minLength":1,"maxLength":200000,"pattern":"\\S","description":"Raw JavaScript API function body or Markdown skill source. Reading, validating and saving do not execute source or expand tags."}},"required":["id","revision"],"anyOf":[{"required":["request"]},{"required":["description"]},{"required":["tag"]},{"required":["content"]}]}]}}}},"responses":{"200":{"description":"Definition updated","content":{"application/json":{"schema":{"type":"object","properties":{"created":{"type":"boolean"},"definition":{"type":"object","required":["id","revision","request","content","work_id"],"properties":{"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$"},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$","description":"Required on updates. Copy the revision returned by GET."},"request":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*(?:/[a-z0-9]+(?:-[a-z0-9]+)*)*$","description":"Unique project route, for example customer/list. Does not include /api/v1/api/ or /api/v1/skill/."},"description":{"type":"string","maxLength":4000},"tag":{"type":"string","minLength":1,"maxLength":100,"pattern":"^(?!__proto__$|constructor$|prototype$)[A-Za-z0-9_-]+$","description":"Reference tag without {{braces}}. Defaults to the final segment of request."},"content":{"type":"string","minLength":1,"maxLength":200000,"pattern":"\\S","description":"Raw JavaScript API function body or Markdown skill source. Reading, validating and saving do not execute source or expand tags."},"work_id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Create only: project work for the source file. Defaults to the project Data work. The work must belong exclusively to this project."},"kind":{"type":"string","enum":["api","skill"]}}},"storage_synced":{"type":"boolean","description":"Whether download storage was synchronized. The definition is saved even when false; GET its latest revision and save again to retry."},"warnings":{"type":"array","items":{"type":"string"}}}}}}},"201":{"description":"Definition created","content":{"application/json":{"schema":{"type":"object","properties":{"created":{"type":"boolean"},"definition":{"type":"object","required":["id","revision","request","content","work_id"],"properties":{"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$"},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$","description":"Required on updates. Copy the revision returned by GET."},"request":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*(?:/[a-z0-9]+(?:-[a-z0-9]+)*)*$","description":"Unique project route, for example customer/list. Does not include /api/v1/api/ or /api/v1/skill/."},"description":{"type":"string","maxLength":4000},"tag":{"type":"string","minLength":1,"maxLength":100,"pattern":"^(?!__proto__$|constructor$|prototype$)[A-Za-z0-9_-]+$","description":"Reference tag without {{braces}}. Defaults to the final segment of request."},"content":{"type":"string","minLength":1,"maxLength":200000,"pattern":"\\S","description":"Raw JavaScript API function body or Markdown skill source. Reading, validating and saving do not execute source or expand tags."},"work_id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Create only: project work for the source file. Defaults to the project Data work. The work must belong exclusively to this project."},"kind":{"type":"string","enum":["api","skill"]}}},"storage_synced":{"type":"boolean","description":"Whether download storage was synchronized. The definition is saved even when false; GET its latest revision and save again to retry."},"warnings":{"type":"array","items":{"type":"string"}}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"step":{"type":"string"}}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/DefinitionConflict"},"500":{"$ref":"#/components/responses/InternalServerError"}}}},"/api/v1/skills/validate":{"post":{"tags":["Skills"],"security":[{"ProjectApiKey":[]},{"McpOAuth":["mcp:write"]}],"operationId":"validateSkillDefinition","summary":"Validate a skill definition edit","description":"Same request and scope checks as create/update, without saving, uploading, executing source or expanding tags. Checks request fields, revision, route conflicts and source ownership; does not execute or verify JavaScript behavior.","requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","additionalProperties":false,"properties":{"request":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*(?:/[a-z0-9]+(?:-[a-z0-9]+)*)*$","description":"Unique project route, for example customer/list. Does not include /api/v1/api/ or /api/v1/skill/."},"description":{"type":"string","maxLength":4000},"tag":{"type":"string","minLength":1,"maxLength":100,"pattern":"^(?!__proto__$|constructor$|prototype$)[A-Za-z0-9_-]+$","description":"Reference tag without {{braces}}. Defaults to the final segment of request."},"content":{"type":"string","minLength":1,"maxLength":200000,"pattern":"\\S","description":"Raw JavaScript API function body or Markdown skill source. Reading, validating and saving do not execute source or expand tags."},"work_id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Create only: project work for the source file. Defaults to the project Data work. The work must belong exclusively to this project."}},"required":["request","content"]},{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$"},"revision":{"type":"string","pattern":"^[a-f0-9]{64}$","description":"Required on updates. Copy the revision returned by GET."},"request":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*(?:/[a-z0-9]+(?:-[a-z0-9]+)*)*$","description":"Unique project route, for example customer/list. Does not include /api/v1/api/ or /api/v1/skill/."},"description":{"type":"string","maxLength":4000},"tag":{"type":"string","minLength":1,"maxLength":100,"pattern":"^(?!__proto__$|constructor$|prototype$)[A-Za-z0-9_-]+$","description":"Reference tag without {{braces}}. Defaults to the final segment of request."},"content":{"type":"string","minLength":1,"maxLength":200000,"pattern":"\\S","description":"Raw JavaScript API function body or Markdown skill source. Reading, validating and saving do not execute source or expand tags."}},"required":["id","revision"],"anyOf":[{"required":["request"]},{"required":["description"]},{"required":["tag"]},{"required":["content"]}]}]}}}},"responses":{"200":{"description":"Valid definition request","content":{"application/json":{"schema":{"type":"object","properties":{"valid":{"type":"boolean"},"issues":{"type":"array","items":{"type":"object","additionalProperties":true}}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"step":{"type":"string"}}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/DefinitionConflict"},"500":{"$ref":"#/components/responses/InternalServerError"}}}},"/api/v1/models":{"get":{"tags":["Models"],"operationId":"listModels","summary":"List available models for the current project","security":[{"ProjectApiKey":[]},{"McpOAuth":["mcp:read"]}],"description":"Uses your API key project. Returns active catalog models approved by the organization and not disabled by the project. Organization approvals are inherited when no project override exists. Results are sorted by model then ID. Use model verbatim in task prompts or transcriptions. Credentials and provider availability are checked at execution; no secrets are returned.","parameters":[{"name":"type","in":"query","description":"Optional model type: 1 = language, 2 = media, 3 = speech-to-text. Omit for all types.","schema":{"type":"integer","enum":[1,2,3]}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":100}},{"name":"skip","in":"query","schema":{"type":"integer","minimum":0,"maximum":1000000,"default":0}}],"responses":{"200":{"description":"Available project models","content":{"application/json":{"schema":{"type":"object","properties":{"docs":{"type":"array","items":{"type":"object","required":["id","model","type","provider"],"properties":{"id":{"type":"string"},"model":{"type":"string"},"type":{"type":"integer","enum":[1,2,3]},"provider":{"type":"integer","description":"Provider identifier"}}}},"total":{"type":"integer"},"limit":{"type":"integer"},"skip":{"type":"integer"},"hasMore":{"type":"boolean"}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"step":{"type":"string"}}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalServerError"}}}},"/api/v1/tasks":{"get":{"tags":["Tasks"],"operationId":"listTasks","summary":"List tasks in the current project","security":[{"ProjectApiKey":[]},{"McpOAuth":["mcp:read"]}],"description":"Returns active and inactive task summaries, sorted by name then ID. Project context comes from your API key. Use the returned id with getTask or the logs task filter.","parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":50}},{"name":"skip","in":"query","schema":{"type":"integer","minimum":0,"maximum":1000000,"default":0}}],"responses":{"200":{"description":"Task summaries","content":{"application/json":{"schema":{"type":"object","properties":{"docs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"active":{"type":"boolean"},"schedule":{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["manual","yearly","monthly","weekly","daily","hourly","every_15_minutes","every_5_minutes","every_minute","interval"]},"time":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"HH:mm in the existing scheduler server timezone. Per-task timezone is not supported."},"month":{"type":"integer","minimum":1,"maximum":12},"day_of_month":{"type":"integer","minimum":1,"maximum":31},"day_of_week":{"type":"integer","minimum":0,"maximum":6,"description":"0 = Sunday, 6 = Saturday"},"interval_minutes":{"type":"integer","minimum":1,"maximum":1440},"start_time":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"HH:mm in the existing scheduler server timezone. Per-task timezone is not supported."},"stop_time":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"HH:mm in the existing scheduler server timezone. Per-task timezone is not supported."},"retry_until":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"Same-day retry deadline for daily, weekly, monthly and yearly schedules, inclusive. Defaults to 23:59. Runs retry from the first step after 5, 15, then every 30 minutes until a completed successful log starting on or after the scheduled time exists, or the deadline passes."}},"required":["type"],"oneOf":[{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["manual"]}},"required":["type"]},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["yearly"]},"month":{"type":"integer","minimum":1,"maximum":12},"day_of_month":{"type":"integer","minimum":1,"maximum":31},"time":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"HH:mm in the existing scheduler server timezone. Per-task timezone is not supported."},"retry_until":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"Same-day retry deadline for daily, weekly, monthly and yearly schedules, inclusive. Defaults to 23:59. Runs retry from the first step after 5, 15, then every 30 minutes until a completed successful log starting on or after the scheduled time exists, or the deadline passes."}},"required":["type","month","day_of_month","time"]},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["monthly"]},"day_of_month":{"type":"integer","minimum":1,"maximum":31},"time":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"HH:mm in the existing scheduler server timezone. Per-task timezone is not supported."},"retry_until":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"Same-day retry deadline for daily, weekly, monthly and yearly schedules, inclusive. Defaults to 23:59. Runs retry from the first step after 5, 15, then every 30 minutes until a completed successful log starting on or after the scheduled time exists, or the deadline passes."}},"required":["type","day_of_month","time"]},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["weekly"]},"day_of_week":{"type":"integer","minimum":0,"maximum":6,"description":"0 = Sunday, 6 = Saturday"},"time":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"HH:mm in the existing scheduler server timezone. Per-task timezone is not supported."},"retry_until":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"Same-day retry deadline for daily, weekly, monthly and yearly schedules, inclusive. Defaults to 23:59. Runs retry from the first step after 5, 15, then every 30 minutes until a completed successful log starting on or after the scheduled time exists, or the deadline passes."}},"required":["type","day_of_week","time"]},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["daily"]},"time":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"HH:mm in the existing scheduler server timezone. Per-task timezone is not supported."},"retry_until":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"Same-day retry deadline for daily, weekly, monthly and yearly schedules, inclusive. Defaults to 23:59. Runs retry from the first step after 5, 15, then every 30 minutes until a completed successful log starting on or after the scheduled time exists, or the deadline passes."}},"required":["type","time"]},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["hourly"]}},"required":["type"]},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["every_15_minutes"]}},"required":["type"]},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["every_5_minutes"]}},"required":["type"]},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["every_minute"]}},"required":["type"]},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["interval"]},"interval_minutes":{"type":"integer","minimum":1,"maximum":1440},"start_time":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"HH:mm in the existing scheduler server timezone. Per-task timezone is not supported."},"stop_time":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"HH:mm in the existing scheduler server timezone. Per-task timezone is not supported."}},"required":["type","interval_minutes","start_time","stop_time"]}],"description":"Replaces the schedule when supplied. Defaults to manual on creation. Daily/weekly/monthly/yearly require time and the relevant day/month; interval requires interval_minutes, start_time and stop_time."}}}},"total":{"type":"integer"},"limit":{"type":"integer"},"skip":{"type":"integer"},"hasMore":{"type":"boolean"}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"step":{"type":"string"}}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalServerError"}}}},"/api/v1/tasks/createOrUpdateTask":{"post":{"tags":["Tasks"],"operationId":"createOrUpdateTask","summary":"Create or update a task and its integration steps","security":[{"ProjectApiKey":[]},{"McpOAuth":["mcp:write"]}],"description":"Create: omit id; supply name and steps. Update: GET first and retain revision, step IDs and instruction IDs. Omitted settings are preserved; supplied steps replaces the complete list. Existing private settings and unchanged unsupported steps are preserved. Content edits preserve existing branch layouts; changed layouts require unique names, contiguous children, and one true and one false child per if. New tasks default to inactive. Saving does not run tasks. POST /api/v1/tasks/validate checks the same request without saving. GET /api/v1/tasks/authoring-options lists exact model names and permitted run_as emails. Use ai_agent for agent tasks and ai_answer for direct answers. Transcription uses fields.transcriptions with model and output. Queued/running tasks and stale revisions return 409. Run as must be a project and organization member; using another user requires organization-admin permission. Times use the scheduler host timezone. See /api/docs/task-integrations.json for schemas, examples and error paths.","requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","additionalProperties":false,"properties":{"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S"},"active":{"type":"boolean","default":false,"description":"New tasks are inactive by default. Saving does not queue a run."},"schedule":{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["manual","yearly","monthly","weekly","daily","hourly","every_15_minutes","every_5_minutes","every_minute","interval"]},"time":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"HH:mm in the existing scheduler server timezone. Per-task timezone is not supported."},"month":{"type":"integer","minimum":1,"maximum":12},"day_of_month":{"type":"integer","minimum":1,"maximum":31},"day_of_week":{"type":"integer","minimum":0,"maximum":6,"description":"0 = Sunday, 6 = Saturday"},"interval_minutes":{"type":"integer","minimum":1,"maximum":1440},"start_time":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"HH:mm in the existing scheduler server timezone. Per-task timezone is not supported."},"stop_time":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"HH:mm in the existing scheduler server timezone. Per-task timezone is not supported."},"retry_until":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"Same-day retry deadline for daily, weekly, monthly and yearly schedules, inclusive. Defaults to 23:59. Runs retry from the first step after 5, 15, then every 30 minutes until a completed successful log starting on or after the scheduled time exists, or the deadline passes."}},"required":["type"],"oneOf":[{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["manual"]}},"required":["type"]},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["yearly"]},"month":{"type":"integer","minimum":1,"maximum":12},"day_of_month":{"type":"integer","minimum":1,"maximum":31},"time":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"HH:mm in the existing scheduler server timezone. Per-task timezone is not supported."},"retry_until":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"Same-day retry deadline for daily, weekly, monthly and yearly schedules, inclusive. Defaults to 23:59. Runs retry from the first step after 5, 15, then every 30 minutes until a completed successful log starting on or after the scheduled time exists, or the deadline passes."}},"required":["type","month","day_of_month","time"]},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["monthly"]},"day_of_month":{"type":"integer","minimum":1,"maximum":31},"time":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"HH:mm in the existing scheduler server timezone. Per-task timezone is not supported."},"retry_until":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"Same-day retry deadline for daily, weekly, monthly and yearly schedules, inclusive. Defaults to 23:59. Runs retry from the first step after 5, 15, then every 30 minutes until a completed successful log starting on or after the scheduled time exists, or the deadline passes."}},"required":["type","day_of_month","time"]},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["weekly"]},"day_of_week":{"type":"integer","minimum":0,"maximum":6,"description":"0 = Sunday, 6 = Saturday"},"time":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"HH:mm in the existing scheduler server timezone. Per-task timezone is not supported."},"retry_until":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"Same-day retry deadline for daily, weekly, monthly and yearly schedules, inclusive. Defaults to 23:59. Runs retry from the first step after 5, 15, then every 30 minutes until a completed successful log starting on or after the scheduled time exists, or the deadline passes."}},"required":["type","day_of_week","time"]},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["daily"]},"time":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"HH:mm in the existing scheduler server timezone. Per-task timezone is not supported."},"retry_until":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"Same-day retry deadline for daily, weekly, monthly and yearly schedules, inclusive. Defaults to 23:59. Runs retry from the first step after 5, 15, then every 30 minutes until a completed successful log starting on or after the scheduled time exists, or the deadline passes."}},"required":["type","time"]},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["hourly"]}},"required":["type"]},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["every_15_minutes"]}},"required":["type"]},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["every_5_minutes"]}},"required":["type"]},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["every_minute"]}},"required":["type"]},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["interval"]},"interval_minutes":{"type":"integer","minimum":1,"maximum":1440},"start_time":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"HH:mm in the existing scheduler server timezone. Per-task timezone is not supported."},"stop_time":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"HH:mm in the existing scheduler server timezone. Per-task timezone is not supported."}},"required":["type","interval_minutes","start_time","stop_time"]}],"description":"Replaces the schedule when supplied. Defaults to manual on creation. Daily/weekly/monthly/yearly require time and the relevant day/month; interval requires interval_minutes, start_time and stop_time."},"run_as":{"type":"string","maxLength":254,"minLength":1,"pattern":"^(?:[a-fA-F0-9]{24}|[^\\s@,;]+@[^\\s@,;]+\\.[^\\s@,;]+)$","description":"Project member email address (case-insensitive). A user ID is also accepted for compatibility. Responses return the email. Defaults to the authenticated user on creation. Assigning another user requires organization-admin permission."},"notification":{"type":"string","enum":["errors","all"],"default":"errors"},"notification_emails":{"type":"array","items":{"type":"string","maxLength":254,"minLength":1,"pattern":"^[^\\s@,;]+@[^\\s@,;]+\\.[^\\s@,;]+$"},"minItems":0,"maxItems":50,"description":"Empty array disables email delivery. Defaults to empty on creation."},"log_reference":{"type":"string","maxLength":2000,"description":"Supports existing {{tags}}."},"steps":{"type":"array","items":{"oneOf":[{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["http_request"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"fields":{"type":"object","additionalProperties":false,"properties":{"method":{"type":"string","enum":["GET","POST","PUT","DELETE"]},"url":{"type":"string","maxLength":4000,"minLength":1,"pattern":"\\S"},"headers":{"oneOf":[{"type":"string","maxLength":20000},{"type":"object","additionalProperties":{"type":"string"}}],"description":"Header object or JSON-encoded text; supports {{tags}}."},"body":{"oneOf":[{"type":"string","maxLength":200000},{"type":"object","additionalProperties":true},{"type":"array","items":{}}],"description":"JSON object/array or text."},"format":{"type":"string","enum":["json","text","x-www-form-urlencoded","none"],"default":"json"},"output":{"type":"string","maxLength":100,"minLength":1,"pattern":"^(?!__proto__$|constructor$|prototype$)[A-Za-z_][A-Za-z0-9_]*$","description":"Output tag name without {{braces}}."}},"required":["method","url","output"]},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."}},"required":["type","name","fields"],"title":"http_request","description":"Make an HTTP request. Text fields support existing {{tags}}."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["code"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"fields":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","maxLength":200000,"minLength":1,"pattern":"\\S","description":"JavaScript function body; return the native result. Input {{tags}} are substituted as JavaScript literals: strings already include escaped quotes, arrays/objects retain their structure. Use const po = {{purchase_order_number}}; const orders = {{orders}}; Never wrap input tags in quotes or backticks, or JSON.parse them just to undo substitution. For interpolation, assign the tag to a variable first and then build the string. Do not JSON.stringify the return value just to pass it to another step."},"output":{"type":"string","maxLength":100,"minLength":1,"pattern":"^(?!__proto__$|constructor$|prototype$)[A-Za-z_][A-Za-z0-9_]*$","description":"Output tag name without {{braces}}."},"format":{"type":"string","enum":["none","json","x-www-form-urlencoded"],"default":"json","description":"Select explicitly from the returned value, not the input. String (none): text, IDs, purchase order numbers, and ID-or-null lookups such as return matchingOrder?._id ?? null;. JSON (json): native objects, arrays, numbers or booleans. x-www-form-urlencoded: deliberately URL-encoded form text needed downstream. A null fallback or JSON input does not make a string result JSON. Review every return path and its downstream use. Output processing only; does not change input tag quoting."}},"required":["code","output"]},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."}},"required":["type","name","fields"],"title":"code","description":"Execute a JavaScript server function in the secure runtime."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["for_each"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"fields":{"type":"object","additionalProperties":false,"properties":{"list":{"type":"string","maxLength":1000,"minLength":1,"pattern":"\\S"},"item":{"type":"string","maxLength":100,"minLength":1,"pattern":"^(?!__proto__$|constructor$|prototype$)[A-Za-z_][A-Za-z0-9_]*$","description":"Output tag name without {{braces}}.","default":"item"},"index":{"type":"string","maxLength":100,"minLength":1,"pattern":"^(?!__proto__$|constructor$|prototype$)[A-Za-z_][A-Za-z0-9_]*$","description":"Output tag name without {{braces}}.","default":"index"},"max_iterations":{"type":"integer","minimum":1,"maximum":10000,"default":1000},"continue_on_error":{"type":"boolean","default":false},"output":{"type":"string","maxLength":100,"minLength":1,"pattern":"^(?!__proto__$|constructor$|prototype$)[A-Za-z_][A-Za-z0-9_]*$","description":"Output tag name without {{braces}}."}},"required":["list"]},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."}},"required":["type","name","fields"],"title":"for_each","description":"Repeat child steps over a list. Children refer to this earlier step by name in parent. The current runner does not support a loop or if as a loop child."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["if_statement"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"fields":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","maxLength":200000,"minLength":1,"pattern":"\\S"},"output":{"type":"string","maxLength":100,"minLength":1,"pattern":"^(?!__proto__$|constructor$|prototype$)[A-Za-z_][A-Za-z0-9_]*$","description":"Output tag name without {{braces}}."}},"required":["code","output"]},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."}},"required":["type","name","fields"],"title":"if_statement","description":"Run condition code returning a boolean. Requires one true and one false child, each referring to this step by name in parent and specifying branch. Keep each branch subtree together in list order."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["log_response"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"fields":{"type":"object","additionalProperties":false,"properties":{"subject":{"type":"string","maxLength":500},"body":{"type":"string","maxLength":20000,"minLength":1,"pattern":"\\S"}},"required":["body"]},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."}},"required":["type","name","fields"],"title":"log_response","description":"Append a response to the task log. Supports {{tags}}."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["send_email"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"fields":{"type":"object","additionalProperties":false,"properties":{"to":{"type":"string","maxLength":2000,"minLength":1,"pattern":"\\S"},"subject":{"type":"string","maxLength":500,"minLength":1,"pattern":"\\S"},"body":{"type":"string","maxLength":20000,"minLength":1,"pattern":"\\S"},"include_email_attachments":{"type":"boolean"}},"required":["to","subject","body"]},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."}},"required":["type","name","fields"],"title":"send_email","description":"Send using the Run as user’s connected mailbox. Supports {{tags}} in recipient, subject and body."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["fetch_email"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"fields":{"type":"object","additionalProperties":false,"properties":{"folder":{"type":"string","maxLength":500,"minLength":1,"pattern":"\\S"},"processed_folder":{"type":"string","maxLength":500,"minLength":1,"pattern":"\\S"},"failed_folder":{"type":"string","maxLength":500},"keyword":{"type":"string","maxLength":500},"sender":{"type":"string","maxLength":500},"recipient":{"type":"string","maxLength":500},"body_keyword":{"type":"string","maxLength":500},"single_file":{"type":"boolean"}},"required":["folder","processed_folder"]},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."}},"required":["type","name","fields"],"title":"fetch_email","description":"Read the Run as user’s connected mailbox. Move processed messages to processed_folder."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["ai_answer"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."},"fields":{"type":"object","additionalProperties":false,"properties":{"prompts":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned instruction ID when editing, including when renaming its output."},"prompt":{"type":"string","maxLength":200000,"minLength":1,"pattern":"\\S"},"output":{"type":"string","maxLength":100,"minLength":1,"pattern":"^(?!__proto__$|constructor$|prototype$)[A-Za-z_][A-Za-z0-9_]*$","description":"Output tag name without {{braces}}."},"model":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Exact model name from the model catalog, for example gpt-5.5."},"response":{"type":"string","enum":["string","json","foreach","code","media","task","list"]}},"required":["prompt","output","model","response"]},"minItems":1,"maxItems":100}},"required":["prompts"]}},"required":["type","name","fields"],"title":"ai_answer","description":"Ordered inline AI prompts in fields.prompts. Saved instructions are created automatically."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["ai_answer"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"fields":{"type":"object","additionalProperties":false,"properties":{"question_ids":{"type":"array","items":{"type":"string","pattern":"^[a-fA-F0-9]{24}$"},"minItems":1,"maxItems":100,"description":"Existing instruction (templatequestion) IDs in this project, in execution order. Configure prompt, model, inputs and output on those instructions."}},"required":["question_ids"]},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."}},"required":["type","name","fields"],"title":"ai_answer (instruction IDs)","description":"Compatibility input only. Reads return prompts instead of question_ids."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["ai_agent"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."},"fields":{"type":"object","additionalProperties":false,"properties":{"prompts":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned instruction ID when editing, including when renaming its output."},"prompt":{"type":"string","maxLength":200000,"minLength":1,"pattern":"\\S"},"output":{"type":"string","maxLength":100,"minLength":1,"pattern":"^(?!__proto__$|constructor$|prototype$)[A-Za-z_][A-Za-z0-9_]*$","description":"Output tag name without {{braces}}."},"model":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Exact model name from the model catalog, for example gpt-5.5."},"response":{"type":"string","enum":["string","json","foreach","code","media","task","list"]}},"required":["prompt","output","model","response"]},"minItems":1,"maxItems":100}},"required":["prompts"]}},"required":["type","name","fields"],"title":"ai_agent","description":"Ordered inline AI prompts in fields.prompts. Saved instructions are created automatically."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["ai_agent"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"fields":{"type":"object","additionalProperties":false,"properties":{"question_ids":{"type":"array","items":{"type":"string","pattern":"^[a-fA-F0-9]{24}$"},"minItems":1,"maxItems":100,"description":"Existing instruction (templatequestion) IDs in this project, in execution order. Configure prompt, model, inputs and output on those instructions."}},"required":["question_ids"]},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."}},"required":["type","name","fields"],"title":"ai_agent (instruction IDs)","description":"Compatibility input only. Reads return prompts instead of question_ids."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["transcribe_audio"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"fields":{"type":"object","additionalProperties":false,"properties":{"transcriptions":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$"},"model":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S"},"output":{"type":"string","maxLength":100,"minLength":1,"pattern":"^(?!__proto__$|constructor$|prototype$)[A-Za-z_][A-Za-z0-9_]*$","description":"Output tag name without {{braces}}."}},"required":["model","output"]},"minItems":1,"maxItems":100}},"required":["transcriptions"]},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."}},"required":["type","name","fields"],"title":"transcribe_audio","description":"Transcribe emailAttachments with fields.transcriptions (model and output). Saved question_ids remain compatibility input."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["transcribe_audio"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"fields":{"type":"object","additionalProperties":false,"properties":{"question_ids":{"type":"array","items":{"type":"string","pattern":"^[a-fA-F0-9]{24}$"},"minItems":0,"maxItems":100,"description":"Compatibility input. Empty list preserves the runtime default transcription."}},"required":["question_ids"]},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."}},"required":["type","name","fields"],"title":"transcribe_audio","description":"Transcribe emailAttachments with fields.transcriptions (model and output). Saved question_ids remain compatibility input."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["end"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"fields":{"type":"object","additionalProperties":false,"properties":{}},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."}},"required":["type","name","fields"],"title":"end","description":"End the task run."},{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$"},"type":{"type":"string","enum":["unsupported"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S"},"description":{"type":"string","maxLength":4000},"fields":{"type":"object","additionalProperties":false,"properties":{}},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S"},"branch":{"type":"string","enum":["true","false"]},"integration_category":{"type":"integer","minimum":0,"maximum":1000}},"required":["id","type","name","fields","integration_category"]}]},"minItems":1,"maxItems":100,"description":"Ordered full replacement when supplied. Omit on update to preserve steps. New tasks require at least one step. Only the documented step types are supported in this draft."}},"required":["name","steps"]},{"type":"object","additionalProperties":false,"properties":{"revision":{"type":"string","maxLength":100,"description":"Opaque revision returned by GET. Include on updates to reject stale edits with 409."},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Omit to create. Supply to update an existing task in this project. Names are not identifiers."},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S"},"active":{"type":"boolean","default":false,"description":"New tasks are inactive by default. Saving does not queue a run."},"schedule":{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["manual","yearly","monthly","weekly","daily","hourly","every_15_minutes","every_5_minutes","every_minute","interval"]},"time":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"HH:mm in the existing scheduler server timezone. Per-task timezone is not supported."},"month":{"type":"integer","minimum":1,"maximum":12},"day_of_month":{"type":"integer","minimum":1,"maximum":31},"day_of_week":{"type":"integer","minimum":0,"maximum":6,"description":"0 = Sunday, 6 = Saturday"},"interval_minutes":{"type":"integer","minimum":1,"maximum":1440},"start_time":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"HH:mm in the existing scheduler server timezone. Per-task timezone is not supported."},"stop_time":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"HH:mm in the existing scheduler server timezone. Per-task timezone is not supported."},"retry_until":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"Same-day retry deadline for daily, weekly, monthly and yearly schedules, inclusive. Defaults to 23:59. Runs retry from the first step after 5, 15, then every 30 minutes until a completed successful log starting on or after the scheduled time exists, or the deadline passes."}},"required":["type"],"oneOf":[{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["manual"]}},"required":["type"]},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["yearly"]},"month":{"type":"integer","minimum":1,"maximum":12},"day_of_month":{"type":"integer","minimum":1,"maximum":31},"time":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"HH:mm in the existing scheduler server timezone. Per-task timezone is not supported."},"retry_until":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"Same-day retry deadline for daily, weekly, monthly and yearly schedules, inclusive. Defaults to 23:59. Runs retry from the first step after 5, 15, then every 30 minutes until a completed successful log starting on or after the scheduled time exists, or the deadline passes."}},"required":["type","month","day_of_month","time"]},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["monthly"]},"day_of_month":{"type":"integer","minimum":1,"maximum":31},"time":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"HH:mm in the existing scheduler server timezone. Per-task timezone is not supported."},"retry_until":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"Same-day retry deadline for daily, weekly, monthly and yearly schedules, inclusive. Defaults to 23:59. Runs retry from the first step after 5, 15, then every 30 minutes until a completed successful log starting on or after the scheduled time exists, or the deadline passes."}},"required":["type","day_of_month","time"]},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["weekly"]},"day_of_week":{"type":"integer","minimum":0,"maximum":6,"description":"0 = Sunday, 6 = Saturday"},"time":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"HH:mm in the existing scheduler server timezone. Per-task timezone is not supported."},"retry_until":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"Same-day retry deadline for daily, weekly, monthly and yearly schedules, inclusive. Defaults to 23:59. Runs retry from the first step after 5, 15, then every 30 minutes until a completed successful log starting on or after the scheduled time exists, or the deadline passes."}},"required":["type","day_of_week","time"]},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["daily"]},"time":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"HH:mm in the existing scheduler server timezone. Per-task timezone is not supported."},"retry_until":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"Same-day retry deadline for daily, weekly, monthly and yearly schedules, inclusive. Defaults to 23:59. Runs retry from the first step after 5, 15, then every 30 minutes until a completed successful log starting on or after the scheduled time exists, or the deadline passes."}},"required":["type","time"]},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["hourly"]}},"required":["type"]},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["every_15_minutes"]}},"required":["type"]},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["every_5_minutes"]}},"required":["type"]},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["every_minute"]}},"required":["type"]},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["interval"]},"interval_minutes":{"type":"integer","minimum":1,"maximum":1440},"start_time":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"HH:mm in the existing scheduler server timezone. Per-task timezone is not supported."},"stop_time":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"HH:mm in the existing scheduler server timezone. Per-task timezone is not supported."}},"required":["type","interval_minutes","start_time","stop_time"]}],"description":"Replaces the schedule when supplied. Defaults to manual on creation. Daily/weekly/monthly/yearly require time and the relevant day/month; interval requires interval_minutes, start_time and stop_time."},"run_as":{"type":"string","maxLength":254,"minLength":1,"pattern":"^(?:[a-fA-F0-9]{24}|[^\\s@,;]+@[^\\s@,;]+\\.[^\\s@,;]+)$","description":"Project member email address (case-insensitive). A user ID is also accepted for compatibility. Responses return the email. Defaults to the authenticated user on creation. Assigning another user requires organization-admin permission."},"notification":{"type":"string","enum":["errors","all"],"default":"errors"},"notification_emails":{"type":"array","items":{"type":"string","maxLength":254,"minLength":1,"pattern":"^[^\\s@,;]+@[^\\s@,;]+\\.[^\\s@,;]+$"},"minItems":0,"maxItems":50,"description":"Empty array disables email delivery. Defaults to empty on creation."},"log_reference":{"type":"string","maxLength":2000,"description":"Supports existing {{tags}}."},"steps":{"type":"array","items":{"oneOf":[{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["http_request"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"fields":{"type":"object","additionalProperties":false,"properties":{"method":{"type":"string","enum":["GET","POST","PUT","DELETE"]},"url":{"type":"string","maxLength":4000,"minLength":1,"pattern":"\\S"},"headers":{"oneOf":[{"type":"string","maxLength":20000},{"type":"object","additionalProperties":{"type":"string"}}],"description":"Header object or JSON-encoded text; supports {{tags}}."},"body":{"oneOf":[{"type":"string","maxLength":200000},{"type":"object","additionalProperties":true},{"type":"array","items":{}}],"description":"JSON object/array or text."},"format":{"type":"string","enum":["json","text","x-www-form-urlencoded","none"],"default":"json"},"output":{"type":"string","maxLength":100,"minLength":1,"pattern":"^(?!__proto__$|constructor$|prototype$)[A-Za-z_][A-Za-z0-9_]*$","description":"Output tag name without {{braces}}."}},"required":["method","url","output"]},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."}},"required":["type","name","fields"],"title":"http_request","description":"Make an HTTP request. Text fields support existing {{tags}}."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["code"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"fields":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","maxLength":200000,"minLength":1,"pattern":"\\S","description":"JavaScript function body; return the native result. Input {{tags}} are substituted as JavaScript literals: strings already include escaped quotes, arrays/objects retain their structure. Use const po = {{purchase_order_number}}; const orders = {{orders}}; Never wrap input tags in quotes or backticks, or JSON.parse them just to undo substitution. For interpolation, assign the tag to a variable first and then build the string. Do not JSON.stringify the return value just to pass it to another step."},"output":{"type":"string","maxLength":100,"minLength":1,"pattern":"^(?!__proto__$|constructor$|prototype$)[A-Za-z_][A-Za-z0-9_]*$","description":"Output tag name without {{braces}}."},"format":{"type":"string","enum":["none","json","x-www-form-urlencoded"],"default":"json","description":"Select explicitly from the returned value, not the input. String (none): text, IDs, purchase order numbers, and ID-or-null lookups such as return matchingOrder?._id ?? null;. JSON (json): native objects, arrays, numbers or booleans. x-www-form-urlencoded: deliberately URL-encoded form text needed downstream. A null fallback or JSON input does not make a string result JSON. Review every return path and its downstream use. Output processing only; does not change input tag quoting."}},"required":["code","output"]},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."}},"required":["type","name","fields"],"title":"code","description":"Execute a JavaScript server function in the secure runtime."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["for_each"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"fields":{"type":"object","additionalProperties":false,"properties":{"list":{"type":"string","maxLength":1000,"minLength":1,"pattern":"\\S"},"item":{"type":"string","maxLength":100,"minLength":1,"pattern":"^(?!__proto__$|constructor$|prototype$)[A-Za-z_][A-Za-z0-9_]*$","description":"Output tag name without {{braces}}.","default":"item"},"index":{"type":"string","maxLength":100,"minLength":1,"pattern":"^(?!__proto__$|constructor$|prototype$)[A-Za-z_][A-Za-z0-9_]*$","description":"Output tag name without {{braces}}.","default":"index"},"max_iterations":{"type":"integer","minimum":1,"maximum":10000,"default":1000},"continue_on_error":{"type":"boolean","default":false},"output":{"type":"string","maxLength":100,"minLength":1,"pattern":"^(?!__proto__$|constructor$|prototype$)[A-Za-z_][A-Za-z0-9_]*$","description":"Output tag name without {{braces}}."}},"required":["list"]},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."}},"required":["type","name","fields"],"title":"for_each","description":"Repeat child steps over a list. Children refer to this earlier step by name in parent. The current runner does not support a loop or if as a loop child."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["if_statement"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"fields":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","maxLength":200000,"minLength":1,"pattern":"\\S"},"output":{"type":"string","maxLength":100,"minLength":1,"pattern":"^(?!__proto__$|constructor$|prototype$)[A-Za-z_][A-Za-z0-9_]*$","description":"Output tag name without {{braces}}."}},"required":["code","output"]},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."}},"required":["type","name","fields"],"title":"if_statement","description":"Run condition code returning a boolean. Requires one true and one false child, each referring to this step by name in parent and specifying branch. Keep each branch subtree together in list order."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["log_response"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"fields":{"type":"object","additionalProperties":false,"properties":{"subject":{"type":"string","maxLength":500},"body":{"type":"string","maxLength":20000,"minLength":1,"pattern":"\\S"}},"required":["body"]},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."}},"required":["type","name","fields"],"title":"log_response","description":"Append a response to the task log. Supports {{tags}}."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["send_email"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"fields":{"type":"object","additionalProperties":false,"properties":{"to":{"type":"string","maxLength":2000,"minLength":1,"pattern":"\\S"},"subject":{"type":"string","maxLength":500,"minLength":1,"pattern":"\\S"},"body":{"type":"string","maxLength":20000,"minLength":1,"pattern":"\\S"},"include_email_attachments":{"type":"boolean"}},"required":["to","subject","body"]},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."}},"required":["type","name","fields"],"title":"send_email","description":"Send using the Run as user’s connected mailbox. Supports {{tags}} in recipient, subject and body."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["fetch_email"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"fields":{"type":"object","additionalProperties":false,"properties":{"folder":{"type":"string","maxLength":500,"minLength":1,"pattern":"\\S"},"processed_folder":{"type":"string","maxLength":500,"minLength":1,"pattern":"\\S"},"failed_folder":{"type":"string","maxLength":500},"keyword":{"type":"string","maxLength":500},"sender":{"type":"string","maxLength":500},"recipient":{"type":"string","maxLength":500},"body_keyword":{"type":"string","maxLength":500},"single_file":{"type":"boolean"}},"required":["folder","processed_folder"]},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."}},"required":["type","name","fields"],"title":"fetch_email","description":"Read the Run as user’s connected mailbox. Move processed messages to processed_folder."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["ai_answer"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."},"fields":{"type":"object","additionalProperties":false,"properties":{"prompts":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned instruction ID when editing, including when renaming its output."},"prompt":{"type":"string","maxLength":200000,"minLength":1,"pattern":"\\S"},"output":{"type":"string","maxLength":100,"minLength":1,"pattern":"^(?!__proto__$|constructor$|prototype$)[A-Za-z_][A-Za-z0-9_]*$","description":"Output tag name without {{braces}}."},"model":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Exact model name from the model catalog, for example gpt-5.5."},"response":{"type":"string","enum":["string","json","foreach","code","media","task","list"]}},"required":["prompt","output","model","response"]},"minItems":1,"maxItems":100}},"required":["prompts"]}},"required":["type","name","fields"],"title":"ai_answer","description":"Ordered inline AI prompts in fields.prompts. Saved instructions are created automatically."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["ai_answer"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"fields":{"type":"object","additionalProperties":false,"properties":{"question_ids":{"type":"array","items":{"type":"string","pattern":"^[a-fA-F0-9]{24}$"},"minItems":1,"maxItems":100,"description":"Existing instruction (templatequestion) IDs in this project, in execution order. Configure prompt, model, inputs and output on those instructions."}},"required":["question_ids"]},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."}},"required":["type","name","fields"],"title":"ai_answer (instruction IDs)","description":"Compatibility input only. Reads return prompts instead of question_ids."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["ai_agent"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."},"fields":{"type":"object","additionalProperties":false,"properties":{"prompts":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned instruction ID when editing, including when renaming its output."},"prompt":{"type":"string","maxLength":200000,"minLength":1,"pattern":"\\S"},"output":{"type":"string","maxLength":100,"minLength":1,"pattern":"^(?!__proto__$|constructor$|prototype$)[A-Za-z_][A-Za-z0-9_]*$","description":"Output tag name without {{braces}}."},"model":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Exact model name from the model catalog, for example gpt-5.5."},"response":{"type":"string","enum":["string","json","foreach","code","media","task","list"]}},"required":["prompt","output","model","response"]},"minItems":1,"maxItems":100}},"required":["prompts"]}},"required":["type","name","fields"],"title":"ai_agent","description":"Ordered inline AI prompts in fields.prompts. Saved instructions are created automatically."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["ai_agent"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"fields":{"type":"object","additionalProperties":false,"properties":{"question_ids":{"type":"array","items":{"type":"string","pattern":"^[a-fA-F0-9]{24}$"},"minItems":1,"maxItems":100,"description":"Existing instruction (templatequestion) IDs in this project, in execution order. Configure prompt, model, inputs and output on those instructions."}},"required":["question_ids"]},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."}},"required":["type","name","fields"],"title":"ai_agent (instruction IDs)","description":"Compatibility input only. Reads return prompts instead of question_ids."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["transcribe_audio"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"fields":{"type":"object","additionalProperties":false,"properties":{"transcriptions":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$"},"model":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S"},"output":{"type":"string","maxLength":100,"minLength":1,"pattern":"^(?!__proto__$|constructor$|prototype$)[A-Za-z_][A-Za-z0-9_]*$","description":"Output tag name without {{braces}}."}},"required":["model","output"]},"minItems":1,"maxItems":100}},"required":["transcriptions"]},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."}},"required":["type","name","fields"],"title":"transcribe_audio","description":"Transcribe emailAttachments with fields.transcriptions (model and output). Saved question_ids remain compatibility input."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["transcribe_audio"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"fields":{"type":"object","additionalProperties":false,"properties":{"question_ids":{"type":"array","items":{"type":"string","pattern":"^[a-fA-F0-9]{24}$"},"minItems":0,"maxItems":100,"description":"Compatibility input. Empty list preserves the runtime default transcription."}},"required":["question_ids"]},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."}},"required":["type","name","fields"],"title":"transcribe_audio","description":"Transcribe emailAttachments with fields.transcriptions (model and output). Saved question_ids remain compatibility input."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["end"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"fields":{"type":"object","additionalProperties":false,"properties":{}},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."}},"required":["type","name","fields"],"title":"end","description":"End the task run."},{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$"},"type":{"type":"string","enum":["unsupported"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S"},"description":{"type":"string","maxLength":4000},"fields":{"type":"object","additionalProperties":false,"properties":{}},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S"},"branch":{"type":"string","enum":["true","false"]},"integration_category":{"type":"integer","minimum":0,"maximum":1000}},"required":["id","type","name","fields","integration_category"]}]},"minItems":0,"maxItems":100,"description":"Ordered full replacement when supplied. Omit on update to preserve steps. New tasks require at least one step. Only the documented step types are supported in this draft."},"step_updates":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$"},"description":{"type":"string","maxLength":4000},"fields":{"type":"object","additionalProperties":true}},"required":["id"]},"minItems":1,"maxItems":100,"description":"Content updates by existing step ID. Requires revision; cannot accompany steps. Omitted fields are preserved. fields merges by top-level field name; nested objects and arrays replace their field in full. Cannot add, remove, reorder, rename or change step types or branches. The merged steps are validated before saving."}},"required":["id"],"minProperties":2,"anyOf":[{"required":["name"]},{"required":["active"]},{"required":["schedule"]},{"required":["run_as"]},{"required":["notification"]},{"required":["notification_emails"]},{"required":["log_reference"]},{"required":["steps"]},{"required":["step_updates"]}]}],"description":"Without id: create schema. With id: update schema. Validation accepts the same contract."},"examples":{"updateStep":{"summary":"Update one existing step without resending the task","value":{"id":"6acf242f8548aebf99c99271","revision":"revision-from-get","step_updates":[{"id":"6acf7562f64e61a4fd1dd113","fields":{"code":"const order = {{matchingOrderId}} || {}; return order._id == null;"}}]}},"create":{"summary":"Create an inactive daily HTTP task","value":{"name":"Daily customer report","active":false,"schedule":{"type":"daily","time":"09:00"},"notification":"errors","notification_emails":["ops@example.com"],"log_reference":"Customer report","steps":[{"type":"http_request","name":"Load customers","description":"Fetch the customer list","fields":{"method":"GET","url":"https://example.com/customers","output":"customers"}},{"type":"log_response","name":"Record result","description":"Show the returned customers","fields":{"body":"{{customers}}"}}]}},"ai":{"summary":"Create a task with inline AI prompts","value":{"name":"Match products","steps":[{"type":"ai_answer","name":"Match to product codes.","description":"Match to pricelist","fields":{"prompts":[{"prompt":"Match each order line to the product code in the supplied price list. Return JSON.","output":"matchedProducts","model":"gpt-5.5","response":"json"}]}}]}},"update":{"summary":"Rename an existing task without changing its steps","value":{"id":"0123456789abcdef01234567","name":"Updated customer report"}},"branches":{"summary":"Use earlier step names for if branches and loop children","value":{"name":"Process a list","steps":[{"type":"code","name":"Load orders","fields":{"code":"return [{ number: \"PO1001\" }];","output":"orders"}},{"type":"if_statement","name":"Has orders","fields":{"code":"return {{orders}}.length > 0;","output":"hasOrders"}},{"type":"for_each","name":"Each order","parent":"Has orders","branch":"true","fields":{"list":"orders","item":"order"}},{"type":"log_response","name":"Record order","parent":"Each order","fields":{"body":"{{order.number}}"}},{"type":"log_response","name":"No orders","parent":"Has orders","branch":"false","fields":{"body":"No orders to process."}}]}}}}}},"responses":{"200":{"description":"Task updated","content":{"application/json":{"schema":{"type":"object","properties":{"created":{"type":"boolean"},"task":{"type":"object","additionalProperties":false,"properties":{"revision":{"type":"string","maxLength":100,"description":"Opaque revision returned by GET. Include on updates to reject stale edits with 409."},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Omit to create. Supply to update an existing task in this project. Names are not identifiers."},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S"},"active":{"type":"boolean","default":false,"description":"New tasks are inactive by default. Saving does not queue a run."},"schedule":{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["manual","yearly","monthly","weekly","daily","hourly","every_15_minutes","every_5_minutes","every_minute","interval"]},"time":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"HH:mm in the existing scheduler server timezone. Per-task timezone is not supported."},"month":{"type":"integer","minimum":1,"maximum":12},"day_of_month":{"type":"integer","minimum":1,"maximum":31},"day_of_week":{"type":"integer","minimum":0,"maximum":6,"description":"0 = Sunday, 6 = Saturday"},"interval_minutes":{"type":"integer","minimum":1,"maximum":1440},"start_time":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"HH:mm in the existing scheduler server timezone. Per-task timezone is not supported."},"stop_time":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"HH:mm in the existing scheduler server timezone. Per-task timezone is not supported."},"retry_until":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"Same-day retry deadline for daily, weekly, monthly and yearly schedules, inclusive. Defaults to 23:59. Runs retry from the first step after 5, 15, then every 30 minutes until a completed successful log starting on or after the scheduled time exists, or the deadline passes."}},"required":["type"],"oneOf":[{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["manual"]}},"required":["type"]},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["yearly"]},"month":{"type":"integer","minimum":1,"maximum":12},"day_of_month":{"type":"integer","minimum":1,"maximum":31},"time":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"HH:mm in the existing scheduler server timezone. Per-task timezone is not supported."},"retry_until":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"Same-day retry deadline for daily, weekly, monthly and yearly schedules, inclusive. Defaults to 23:59. Runs retry from the first step after 5, 15, then every 30 minutes until a completed successful log starting on or after the scheduled time exists, or the deadline passes."}},"required":["type","month","day_of_month","time"]},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["monthly"]},"day_of_month":{"type":"integer","minimum":1,"maximum":31},"time":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"HH:mm in the existing scheduler server timezone. Per-task timezone is not supported."},"retry_until":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"Same-day retry deadline for daily, weekly, monthly and yearly schedules, inclusive. Defaults to 23:59. Runs retry from the first step after 5, 15, then every 30 minutes until a completed successful log starting on or after the scheduled time exists, or the deadline passes."}},"required":["type","day_of_month","time"]},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["weekly"]},"day_of_week":{"type":"integer","minimum":0,"maximum":6,"description":"0 = Sunday, 6 = Saturday"},"time":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"HH:mm in the existing scheduler server timezone. Per-task timezone is not supported."},"retry_until":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"Same-day retry deadline for daily, weekly, monthly and yearly schedules, inclusive. Defaults to 23:59. Runs retry from the first step after 5, 15, then every 30 minutes until a completed successful log starting on or after the scheduled time exists, or the deadline passes."}},"required":["type","day_of_week","time"]},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["daily"]},"time":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"HH:mm in the existing scheduler server timezone. Per-task timezone is not supported."},"retry_until":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"Same-day retry deadline for daily, weekly, monthly and yearly schedules, inclusive. Defaults to 23:59. Runs retry from the first step after 5, 15, then every 30 minutes until a completed successful log starting on or after the scheduled time exists, or the deadline passes."}},"required":["type","time"]},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["hourly"]}},"required":["type"]},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["every_15_minutes"]}},"required":["type"]},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["every_5_minutes"]}},"required":["type"]},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["every_minute"]}},"required":["type"]},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["interval"]},"interval_minutes":{"type":"integer","minimum":1,"maximum":1440},"start_time":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"HH:mm in the existing scheduler server timezone. Per-task timezone is not supported."},"stop_time":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"HH:mm in the existing scheduler server timezone. Per-task timezone is not supported."}},"required":["type","interval_minutes","start_time","stop_time"]}],"description":"Replaces the schedule when supplied. Defaults to manual on creation. Daily/weekly/monthly/yearly require time and the relevant day/month; interval requires interval_minutes, start_time and stop_time."},"run_as":{"type":"string","format":"email","nullable":true,"description":"Run as user email, or null if the user no longer exists or has no email address."},"notification":{"type":"string","enum":["errors","all"],"default":"errors"},"notification_emails":{"type":"array","items":{"type":"string","maxLength":254,"minLength":1,"pattern":"^[^\\s@,;]+@[^\\s@,;]+\\.[^\\s@,;]+$"},"minItems":0,"maxItems":50,"description":"Empty array disables email delivery. Defaults to empty on creation."},"log_reference":{"type":"string","maxLength":2000,"description":"Supports existing {{tags}}."},"steps":{"type":"array","items":{"oneOf":[{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["http_request"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"fields":{"type":"object","additionalProperties":false,"properties":{"method":{"type":"string","enum":["GET","POST","PUT","DELETE"]},"url":{"type":"string","maxLength":4000,"minLength":1,"pattern":"\\S"},"headers":{"oneOf":[{"type":"string","maxLength":20000},{"type":"object","additionalProperties":{"type":"string"}}],"description":"Header object or JSON-encoded text; supports {{tags}}."},"body":{"oneOf":[{"type":"string","maxLength":200000},{"type":"object","additionalProperties":true},{"type":"array","items":{}}],"description":"JSON object/array or text."},"format":{"type":"string","enum":["json","text","x-www-form-urlencoded","none"],"default":"json"},"output":{"type":"string","maxLength":100,"minLength":1,"pattern":"^(?!__proto__$|constructor$|prototype$)[A-Za-z_][A-Za-z0-9_]*$","description":"Output tag name without {{braces}}."}},"required":["method","url","output"]},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."}},"required":["type","name","fields"],"title":"http_request","description":"Make an HTTP request. Text fields support existing {{tags}}."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["code"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"fields":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","maxLength":200000,"minLength":1,"pattern":"\\S","description":"JavaScript function body; return the native result. Input {{tags}} are substituted as JavaScript literals: strings already include escaped quotes, arrays/objects retain their structure. Use const po = {{purchase_order_number}}; const orders = {{orders}}; Never wrap input tags in quotes or backticks, or JSON.parse them just to undo substitution. For interpolation, assign the tag to a variable first and then build the string. Do not JSON.stringify the return value just to pass it to another step."},"output":{"type":"string","maxLength":100,"minLength":1,"pattern":"^(?!__proto__$|constructor$|prototype$)[A-Za-z_][A-Za-z0-9_]*$","description":"Output tag name without {{braces}}."},"format":{"type":"string","enum":["none","json","x-www-form-urlencoded"],"default":"json","description":"Select explicitly from the returned value, not the input. String (none): text, IDs, purchase order numbers, and ID-or-null lookups such as return matchingOrder?._id ?? null;. JSON (json): native objects, arrays, numbers or booleans. x-www-form-urlencoded: deliberately URL-encoded form text needed downstream. A null fallback or JSON input does not make a string result JSON. Review every return path and its downstream use. Output processing only; does not change input tag quoting."}},"required":["code","output"]},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."}},"required":["type","name","fields"],"title":"code","description":"Execute a JavaScript server function in the secure runtime."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["for_each"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"fields":{"type":"object","additionalProperties":false,"properties":{"list":{"type":"string","maxLength":1000,"minLength":1,"pattern":"\\S"},"item":{"type":"string","maxLength":100,"minLength":1,"pattern":"^(?!__proto__$|constructor$|prototype$)[A-Za-z_][A-Za-z0-9_]*$","description":"Output tag name without {{braces}}.","default":"item"},"index":{"type":"string","maxLength":100,"minLength":1,"pattern":"^(?!__proto__$|constructor$|prototype$)[A-Za-z_][A-Za-z0-9_]*$","description":"Output tag name without {{braces}}.","default":"index"},"max_iterations":{"type":"integer","minimum":1,"maximum":10000,"default":1000},"continue_on_error":{"type":"boolean","default":false},"output":{"type":"string","maxLength":100,"minLength":1,"pattern":"^(?!__proto__$|constructor$|prototype$)[A-Za-z_][A-Za-z0-9_]*$","description":"Output tag name without {{braces}}."}},"required":["list"]},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."}},"required":["type","name","fields"],"title":"for_each","description":"Repeat child steps over a list. Children refer to this earlier step by name in parent. The current runner does not support a loop or if as a loop child."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["if_statement"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"fields":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","maxLength":200000,"minLength":1,"pattern":"\\S"},"output":{"type":"string","maxLength":100,"minLength":1,"pattern":"^(?!__proto__$|constructor$|prototype$)[A-Za-z_][A-Za-z0-9_]*$","description":"Output tag name without {{braces}}."}},"required":["code","output"]},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."}},"required":["type","name","fields"],"title":"if_statement","description":"Run condition code returning a boolean. Requires one true and one false child, each referring to this step by name in parent and specifying branch. Keep each branch subtree together in list order."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["log_response"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"fields":{"type":"object","additionalProperties":false,"properties":{"subject":{"type":"string","maxLength":500},"body":{"type":"string","maxLength":20000,"minLength":1,"pattern":"\\S"}},"required":["body"]},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."}},"required":["type","name","fields"],"title":"log_response","description":"Append a response to the task log. Supports {{tags}}."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["send_email"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"fields":{"type":"object","additionalProperties":false,"properties":{"to":{"type":"string","maxLength":2000,"minLength":1,"pattern":"\\S"},"subject":{"type":"string","maxLength":500,"minLength":1,"pattern":"\\S"},"body":{"type":"string","maxLength":20000,"minLength":1,"pattern":"\\S"},"include_email_attachments":{"type":"boolean"}},"required":["to","subject","body"]},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."}},"required":["type","name","fields"],"title":"send_email","description":"Send using the Run as user’s connected mailbox. Supports {{tags}} in recipient, subject and body."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["fetch_email"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"fields":{"type":"object","additionalProperties":false,"properties":{"folder":{"type":"string","maxLength":500,"minLength":1,"pattern":"\\S"},"processed_folder":{"type":"string","maxLength":500,"minLength":1,"pattern":"\\S"},"failed_folder":{"type":"string","maxLength":500},"keyword":{"type":"string","maxLength":500},"sender":{"type":"string","maxLength":500},"recipient":{"type":"string","maxLength":500},"body_keyword":{"type":"string","maxLength":500},"single_file":{"type":"boolean"}},"required":["folder","processed_folder"]},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."}},"required":["type","name","fields"],"title":"fetch_email","description":"Read the Run as user’s connected mailbox. Move processed messages to processed_folder."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["ai_answer"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."},"fields":{"type":"object","additionalProperties":false,"properties":{"prompts":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned instruction ID when editing, including when renaming its output."},"prompt":{"type":"string","maxLength":200000,"minLength":1,"pattern":"\\S"},"output":{"type":"string","maxLength":100,"minLength":1,"pattern":"^(?!__proto__$|constructor$|prototype$)[A-Za-z_][A-Za-z0-9_]*$","description":"Output tag name without {{braces}}."},"model":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Exact model name from the model catalog, for example gpt-5.5."},"response":{"type":"string","enum":["string","json","foreach","code","media","task","list"]}},"required":["prompt","output","model","response"]},"minItems":1,"maxItems":100}},"required":["prompts"]}},"required":["type","name","fields"],"title":"ai_answer","description":"Ordered inline AI prompts in fields.prompts. Saved instructions are created automatically."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["ai_answer"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"fields":{"type":"object","additionalProperties":false,"properties":{"question_ids":{"type":"array","items":{"type":"string","pattern":"^[a-fA-F0-9]{24}$"},"minItems":1,"maxItems":100,"description":"Existing instruction (templatequestion) IDs in this project, in execution order. Configure prompt, model, inputs and output on those instructions."}},"required":["question_ids"]},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."}},"required":["type","name","fields"],"title":"ai_answer (instruction IDs)","description":"Compatibility input only. Reads return prompts instead of question_ids."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["ai_agent"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."},"fields":{"type":"object","additionalProperties":false,"properties":{"prompts":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned instruction ID when editing, including when renaming its output."},"prompt":{"type":"string","maxLength":200000,"minLength":1,"pattern":"\\S"},"output":{"type":"string","maxLength":100,"minLength":1,"pattern":"^(?!__proto__$|constructor$|prototype$)[A-Za-z_][A-Za-z0-9_]*$","description":"Output tag name without {{braces}}."},"model":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Exact model name from the model catalog, for example gpt-5.5."},"response":{"type":"string","enum":["string","json","foreach","code","media","task","list"]}},"required":["prompt","output","model","response"]},"minItems":1,"maxItems":100}},"required":["prompts"]}},"required":["type","name","fields"],"title":"ai_agent","description":"Ordered inline AI prompts in fields.prompts. Saved instructions are created automatically."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["ai_agent"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"fields":{"type":"object","additionalProperties":false,"properties":{"question_ids":{"type":"array","items":{"type":"string","pattern":"^[a-fA-F0-9]{24}$"},"minItems":1,"maxItems":100,"description":"Existing instruction (templatequestion) IDs in this project, in execution order. Configure prompt, model, inputs and output on those instructions."}},"required":["question_ids"]},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."}},"required":["type","name","fields"],"title":"ai_agent (instruction IDs)","description":"Compatibility input only. Reads return prompts instead of question_ids."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["transcribe_audio"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"fields":{"type":"object","additionalProperties":false,"properties":{"transcriptions":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$"},"model":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S"},"output":{"type":"string","maxLength":100,"minLength":1,"pattern":"^(?!__proto__$|constructor$|prototype$)[A-Za-z_][A-Za-z0-9_]*$","description":"Output tag name without {{braces}}."}},"required":["model","output"]},"minItems":1,"maxItems":100}},"required":["transcriptions"]},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."}},"required":["type","name","fields"],"title":"transcribe_audio","description":"Transcribe emailAttachments with fields.transcriptions (model and output). Saved question_ids remain compatibility input."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["transcribe_audio"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"fields":{"type":"object","additionalProperties":false,"properties":{"question_ids":{"type":"array","items":{"type":"string","pattern":"^[a-fA-F0-9]{24}$"},"minItems":0,"maxItems":100,"description":"Compatibility input. Empty list preserves the runtime default transcription."}},"required":["question_ids"]},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."}},"required":["type","name","fields"],"title":"transcribe_audio","description":"Transcribe emailAttachments with fields.transcriptions (model and output). Saved question_ids remain compatibility input."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["end"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"fields":{"type":"object","additionalProperties":false,"properties":{}},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."}},"required":["type","name","fields"],"title":"end","description":"End the task run."},{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$"},"type":{"type":"string","enum":["unsupported"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S"},"description":{"type":"string","maxLength":4000},"fields":{"type":"object","additionalProperties":false,"properties":{}},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S"},"branch":{"type":"string","enum":["true","false"]},"integration_category":{"type":"integer","minimum":0,"maximum":1000}},"required":["id","type","name","fields","integration_category"]}]},"description":"Ordered steps with stable IDs. Return unsupported steps unchanged to preserve them."}}}}}}}},"201":{"description":"Task created","content":{"application/json":{"schema":{"type":"object","properties":{"created":{"type":"boolean"},"task":{"type":"object","additionalProperties":false,"properties":{"revision":{"type":"string","maxLength":100,"description":"Opaque revision returned by GET. Include on updates to reject stale edits with 409."},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Omit to create. Supply to update an existing task in this project. Names are not identifiers."},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S"},"active":{"type":"boolean","default":false,"description":"New tasks are inactive by default. Saving does not queue a run."},"schedule":{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["manual","yearly","monthly","weekly","daily","hourly","every_15_minutes","every_5_minutes","every_minute","interval"]},"time":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"HH:mm in the existing scheduler server timezone. Per-task timezone is not supported."},"month":{"type":"integer","minimum":1,"maximum":12},"day_of_month":{"type":"integer","minimum":1,"maximum":31},"day_of_week":{"type":"integer","minimum":0,"maximum":6,"description":"0 = Sunday, 6 = Saturday"},"interval_minutes":{"type":"integer","minimum":1,"maximum":1440},"start_time":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"HH:mm in the existing scheduler server timezone. Per-task timezone is not supported."},"stop_time":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"HH:mm in the existing scheduler server timezone. Per-task timezone is not supported."},"retry_until":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"Same-day retry deadline for daily, weekly, monthly and yearly schedules, inclusive. Defaults to 23:59. Runs retry from the first step after 5, 15, then every 30 minutes until a completed successful log starting on or after the scheduled time exists, or the deadline passes."}},"required":["type"],"oneOf":[{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["manual"]}},"required":["type"]},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["yearly"]},"month":{"type":"integer","minimum":1,"maximum":12},"day_of_month":{"type":"integer","minimum":1,"maximum":31},"time":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"HH:mm in the existing scheduler server timezone. Per-task timezone is not supported."},"retry_until":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"Same-day retry deadline for daily, weekly, monthly and yearly schedules, inclusive. Defaults to 23:59. Runs retry from the first step after 5, 15, then every 30 minutes until a completed successful log starting on or after the scheduled time exists, or the deadline passes."}},"required":["type","month","day_of_month","time"]},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["monthly"]},"day_of_month":{"type":"integer","minimum":1,"maximum":31},"time":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"HH:mm in the existing scheduler server timezone. Per-task timezone is not supported."},"retry_until":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"Same-day retry deadline for daily, weekly, monthly and yearly schedules, inclusive. Defaults to 23:59. Runs retry from the first step after 5, 15, then every 30 minutes until a completed successful log starting on or after the scheduled time exists, or the deadline passes."}},"required":["type","day_of_month","time"]},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["weekly"]},"day_of_week":{"type":"integer","minimum":0,"maximum":6,"description":"0 = Sunday, 6 = Saturday"},"time":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"HH:mm in the existing scheduler server timezone. Per-task timezone is not supported."},"retry_until":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"Same-day retry deadline for daily, weekly, monthly and yearly schedules, inclusive. Defaults to 23:59. Runs retry from the first step after 5, 15, then every 30 minutes until a completed successful log starting on or after the scheduled time exists, or the deadline passes."}},"required":["type","day_of_week","time"]},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["daily"]},"time":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"HH:mm in the existing scheduler server timezone. Per-task timezone is not supported."},"retry_until":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"Same-day retry deadline for daily, weekly, monthly and yearly schedules, inclusive. Defaults to 23:59. Runs retry from the first step after 5, 15, then every 30 minutes until a completed successful log starting on or after the scheduled time exists, or the deadline passes."}},"required":["type","time"]},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["hourly"]}},"required":["type"]},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["every_15_minutes"]}},"required":["type"]},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["every_5_minutes"]}},"required":["type"]},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["every_minute"]}},"required":["type"]},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["interval"]},"interval_minutes":{"type":"integer","minimum":1,"maximum":1440},"start_time":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"HH:mm in the existing scheduler server timezone. Per-task timezone is not supported."},"stop_time":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"HH:mm in the existing scheduler server timezone. Per-task timezone is not supported."}},"required":["type","interval_minutes","start_time","stop_time"]}],"description":"Replaces the schedule when supplied. Defaults to manual on creation. Daily/weekly/monthly/yearly require time and the relevant day/month; interval requires interval_minutes, start_time and stop_time."},"run_as":{"type":"string","format":"email","nullable":true,"description":"Run as user email, or null if the user no longer exists or has no email address."},"notification":{"type":"string","enum":["errors","all"],"default":"errors"},"notification_emails":{"type":"array","items":{"type":"string","maxLength":254,"minLength":1,"pattern":"^[^\\s@,;]+@[^\\s@,;]+\\.[^\\s@,;]+$"},"minItems":0,"maxItems":50,"description":"Empty array disables email delivery. Defaults to empty on creation."},"log_reference":{"type":"string","maxLength":2000,"description":"Supports existing {{tags}}."},"steps":{"type":"array","items":{"oneOf":[{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["http_request"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"fields":{"type":"object","additionalProperties":false,"properties":{"method":{"type":"string","enum":["GET","POST","PUT","DELETE"]},"url":{"type":"string","maxLength":4000,"minLength":1,"pattern":"\\S"},"headers":{"oneOf":[{"type":"string","maxLength":20000},{"type":"object","additionalProperties":{"type":"string"}}],"description":"Header object or JSON-encoded text; supports {{tags}}."},"body":{"oneOf":[{"type":"string","maxLength":200000},{"type":"object","additionalProperties":true},{"type":"array","items":{}}],"description":"JSON object/array or text."},"format":{"type":"string","enum":["json","text","x-www-form-urlencoded","none"],"default":"json"},"output":{"type":"string","maxLength":100,"minLength":1,"pattern":"^(?!__proto__$|constructor$|prototype$)[A-Za-z_][A-Za-z0-9_]*$","description":"Output tag name without {{braces}}."}},"required":["method","url","output"]},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."}},"required":["type","name","fields"],"title":"http_request","description":"Make an HTTP request. Text fields support existing {{tags}}."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["code"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"fields":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","maxLength":200000,"minLength":1,"pattern":"\\S","description":"JavaScript function body; return the native result. Input {{tags}} are substituted as JavaScript literals: strings already include escaped quotes, arrays/objects retain their structure. Use const po = {{purchase_order_number}}; const orders = {{orders}}; Never wrap input tags in quotes or backticks, or JSON.parse them just to undo substitution. For interpolation, assign the tag to a variable first and then build the string. Do not JSON.stringify the return value just to pass it to another step."},"output":{"type":"string","maxLength":100,"minLength":1,"pattern":"^(?!__proto__$|constructor$|prototype$)[A-Za-z_][A-Za-z0-9_]*$","description":"Output tag name without {{braces}}."},"format":{"type":"string","enum":["none","json","x-www-form-urlencoded"],"default":"json","description":"Select explicitly from the returned value, not the input. String (none): text, IDs, purchase order numbers, and ID-or-null lookups such as return matchingOrder?._id ?? null;. JSON (json): native objects, arrays, numbers or booleans. x-www-form-urlencoded: deliberately URL-encoded form text needed downstream. A null fallback or JSON input does not make a string result JSON. Review every return path and its downstream use. Output processing only; does not change input tag quoting."}},"required":["code","output"]},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."}},"required":["type","name","fields"],"title":"code","description":"Execute a JavaScript server function in the secure runtime."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["for_each"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"fields":{"type":"object","additionalProperties":false,"properties":{"list":{"type":"string","maxLength":1000,"minLength":1,"pattern":"\\S"},"item":{"type":"string","maxLength":100,"minLength":1,"pattern":"^(?!__proto__$|constructor$|prototype$)[A-Za-z_][A-Za-z0-9_]*$","description":"Output tag name without {{braces}}.","default":"item"},"index":{"type":"string","maxLength":100,"minLength":1,"pattern":"^(?!__proto__$|constructor$|prototype$)[A-Za-z_][A-Za-z0-9_]*$","description":"Output tag name without {{braces}}.","default":"index"},"max_iterations":{"type":"integer","minimum":1,"maximum":10000,"default":1000},"continue_on_error":{"type":"boolean","default":false},"output":{"type":"string","maxLength":100,"minLength":1,"pattern":"^(?!__proto__$|constructor$|prototype$)[A-Za-z_][A-Za-z0-9_]*$","description":"Output tag name without {{braces}}."}},"required":["list"]},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."}},"required":["type","name","fields"],"title":"for_each","description":"Repeat child steps over a list. Children refer to this earlier step by name in parent. The current runner does not support a loop or if as a loop child."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["if_statement"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"fields":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","maxLength":200000,"minLength":1,"pattern":"\\S"},"output":{"type":"string","maxLength":100,"minLength":1,"pattern":"^(?!__proto__$|constructor$|prototype$)[A-Za-z_][A-Za-z0-9_]*$","description":"Output tag name without {{braces}}."}},"required":["code","output"]},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."}},"required":["type","name","fields"],"title":"if_statement","description":"Run condition code returning a boolean. Requires one true and one false child, each referring to this step by name in parent and specifying branch. Keep each branch subtree together in list order."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["log_response"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"fields":{"type":"object","additionalProperties":false,"properties":{"subject":{"type":"string","maxLength":500},"body":{"type":"string","maxLength":20000,"minLength":1,"pattern":"\\S"}},"required":["body"]},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."}},"required":["type","name","fields"],"title":"log_response","description":"Append a response to the task log. Supports {{tags}}."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["send_email"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"fields":{"type":"object","additionalProperties":false,"properties":{"to":{"type":"string","maxLength":2000,"minLength":1,"pattern":"\\S"},"subject":{"type":"string","maxLength":500,"minLength":1,"pattern":"\\S"},"body":{"type":"string","maxLength":20000,"minLength":1,"pattern":"\\S"},"include_email_attachments":{"type":"boolean"}},"required":["to","subject","body"]},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."}},"required":["type","name","fields"],"title":"send_email","description":"Send using the Run as user’s connected mailbox. Supports {{tags}} in recipient, subject and body."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["fetch_email"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"fields":{"type":"object","additionalProperties":false,"properties":{"folder":{"type":"string","maxLength":500,"minLength":1,"pattern":"\\S"},"processed_folder":{"type":"string","maxLength":500,"minLength":1,"pattern":"\\S"},"failed_folder":{"type":"string","maxLength":500},"keyword":{"type":"string","maxLength":500},"sender":{"type":"string","maxLength":500},"recipient":{"type":"string","maxLength":500},"body_keyword":{"type":"string","maxLength":500},"single_file":{"type":"boolean"}},"required":["folder","processed_folder"]},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."}},"required":["type","name","fields"],"title":"fetch_email","description":"Read the Run as user’s connected mailbox. Move processed messages to processed_folder."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["ai_answer"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."},"fields":{"type":"object","additionalProperties":false,"properties":{"prompts":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned instruction ID when editing, including when renaming its output."},"prompt":{"type":"string","maxLength":200000,"minLength":1,"pattern":"\\S"},"output":{"type":"string","maxLength":100,"minLength":1,"pattern":"^(?!__proto__$|constructor$|prototype$)[A-Za-z_][A-Za-z0-9_]*$","description":"Output tag name without {{braces}}."},"model":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Exact model name from the model catalog, for example gpt-5.5."},"response":{"type":"string","enum":["string","json","foreach","code","media","task","list"]}},"required":["prompt","output","model","response"]},"minItems":1,"maxItems":100}},"required":["prompts"]}},"required":["type","name","fields"],"title":"ai_answer","description":"Ordered inline AI prompts in fields.prompts. Saved instructions are created automatically."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["ai_answer"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"fields":{"type":"object","additionalProperties":false,"properties":{"question_ids":{"type":"array","items":{"type":"string","pattern":"^[a-fA-F0-9]{24}$"},"minItems":1,"maxItems":100,"description":"Existing instruction (templatequestion) IDs in this project, in execution order. Configure prompt, model, inputs and output on those instructions."}},"required":["question_ids"]},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."}},"required":["type","name","fields"],"title":"ai_answer (instruction IDs)","description":"Compatibility input only. Reads return prompts instead of question_ids."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["ai_agent"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."},"fields":{"type":"object","additionalProperties":false,"properties":{"prompts":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned instruction ID when editing, including when renaming its output."},"prompt":{"type":"string","maxLength":200000,"minLength":1,"pattern":"\\S"},"output":{"type":"string","maxLength":100,"minLength":1,"pattern":"^(?!__proto__$|constructor$|prototype$)[A-Za-z_][A-Za-z0-9_]*$","description":"Output tag name without {{braces}}."},"model":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Exact model name from the model catalog, for example gpt-5.5."},"response":{"type":"string","enum":["string","json","foreach","code","media","task","list"]}},"required":["prompt","output","model","response"]},"minItems":1,"maxItems":100}},"required":["prompts"]}},"required":["type","name","fields"],"title":"ai_agent","description":"Ordered inline AI prompts in fields.prompts. Saved instructions are created automatically."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["ai_agent"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"fields":{"type":"object","additionalProperties":false,"properties":{"question_ids":{"type":"array","items":{"type":"string","pattern":"^[a-fA-F0-9]{24}$"},"minItems":1,"maxItems":100,"description":"Existing instruction (templatequestion) IDs in this project, in execution order. Configure prompt, model, inputs and output on those instructions."}},"required":["question_ids"]},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."}},"required":["type","name","fields"],"title":"ai_agent (instruction IDs)","description":"Compatibility input only. Reads return prompts instead of question_ids."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["transcribe_audio"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"fields":{"type":"object","additionalProperties":false,"properties":{"transcriptions":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$"},"model":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S"},"output":{"type":"string","maxLength":100,"minLength":1,"pattern":"^(?!__proto__$|constructor$|prototype$)[A-Za-z_][A-Za-z0-9_]*$","description":"Output tag name without {{braces}}."}},"required":["model","output"]},"minItems":1,"maxItems":100}},"required":["transcriptions"]},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."}},"required":["type","name","fields"],"title":"transcribe_audio","description":"Transcribe emailAttachments with fields.transcriptions (model and output). Saved question_ids remain compatibility input."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["transcribe_audio"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"fields":{"type":"object","additionalProperties":false,"properties":{"question_ids":{"type":"array","items":{"type":"string","pattern":"^[a-fA-F0-9]{24}$"},"minItems":0,"maxItems":100,"description":"Compatibility input. Empty list preserves the runtime default transcription."}},"required":["question_ids"]},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."}},"required":["type","name","fields"],"title":"transcribe_audio","description":"Transcribe emailAttachments with fields.transcriptions (model and output). Saved question_ids remain compatibility input."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["end"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"fields":{"type":"object","additionalProperties":false,"properties":{}},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."}},"required":["type","name","fields"],"title":"end","description":"End the task run."},{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$"},"type":{"type":"string","enum":["unsupported"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S"},"description":{"type":"string","maxLength":4000},"fields":{"type":"object","additionalProperties":false,"properties":{}},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S"},"branch":{"type":"string","enum":["true","false"]},"integration_category":{"type":"integer","minimum":0,"maximum":1000}},"required":["id","type","name","fields","integration_category"]}]},"description":"Ordered steps with stable IDs. Return unsupported steps unchanged to preserve them."}}}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"step":{"type":"string"}}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/RunAsForbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/TaskConflict"},"500":{"$ref":"#/components/responses/InternalServerError"}}}},"/api/v1/tasks/validate":{"post":{"tags":["Tasks"],"operationId":"validateTask","summary":"Validate a task edit without saving or running","security":[{"ProjectApiKey":[]},{"McpOAuth":["mcp:write"]}],"description":"Same body and permissions as createOrUpdateTask. Returns independent schema issues together with JSON Pointer paths. Does not execute code, send email, call providers or create task context.","requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","additionalProperties":false,"properties":{"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S"},"active":{"type":"boolean","default":false,"description":"New tasks are inactive by default. Saving does not queue a run."},"schedule":{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["manual","yearly","monthly","weekly","daily","hourly","every_15_minutes","every_5_minutes","every_minute","interval"]},"time":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"HH:mm in the existing scheduler server timezone. Per-task timezone is not supported."},"month":{"type":"integer","minimum":1,"maximum":12},"day_of_month":{"type":"integer","minimum":1,"maximum":31},"day_of_week":{"type":"integer","minimum":0,"maximum":6,"description":"0 = Sunday, 6 = Saturday"},"interval_minutes":{"type":"integer","minimum":1,"maximum":1440},"start_time":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"HH:mm in the existing scheduler server timezone. Per-task timezone is not supported."},"stop_time":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"HH:mm in the existing scheduler server timezone. Per-task timezone is not supported."},"retry_until":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"Same-day retry deadline for daily, weekly, monthly and yearly schedules, inclusive. Defaults to 23:59. Runs retry from the first step after 5, 15, then every 30 minutes until a completed successful log starting on or after the scheduled time exists, or the deadline passes."}},"required":["type"],"oneOf":[{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["manual"]}},"required":["type"]},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["yearly"]},"month":{"type":"integer","minimum":1,"maximum":12},"day_of_month":{"type":"integer","minimum":1,"maximum":31},"time":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"HH:mm in the existing scheduler server timezone. Per-task timezone is not supported."},"retry_until":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"Same-day retry deadline for daily, weekly, monthly and yearly schedules, inclusive. Defaults to 23:59. Runs retry from the first step after 5, 15, then every 30 minutes until a completed successful log starting on or after the scheduled time exists, or the deadline passes."}},"required":["type","month","day_of_month","time"]},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["monthly"]},"day_of_month":{"type":"integer","minimum":1,"maximum":31},"time":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"HH:mm in the existing scheduler server timezone. Per-task timezone is not supported."},"retry_until":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"Same-day retry deadline for daily, weekly, monthly and yearly schedules, inclusive. Defaults to 23:59. Runs retry from the first step after 5, 15, then every 30 minutes until a completed successful log starting on or after the scheduled time exists, or the deadline passes."}},"required":["type","day_of_month","time"]},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["weekly"]},"day_of_week":{"type":"integer","minimum":0,"maximum":6,"description":"0 = Sunday, 6 = Saturday"},"time":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"HH:mm in the existing scheduler server timezone. Per-task timezone is not supported."},"retry_until":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"Same-day retry deadline for daily, weekly, monthly and yearly schedules, inclusive. Defaults to 23:59. Runs retry from the first step after 5, 15, then every 30 minutes until a completed successful log starting on or after the scheduled time exists, or the deadline passes."}},"required":["type","day_of_week","time"]},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["daily"]},"time":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"HH:mm in the existing scheduler server timezone. Per-task timezone is not supported."},"retry_until":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"Same-day retry deadline for daily, weekly, monthly and yearly schedules, inclusive. Defaults to 23:59. Runs retry from the first step after 5, 15, then every 30 minutes until a completed successful log starting on or after the scheduled time exists, or the deadline passes."}},"required":["type","time"]},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["hourly"]}},"required":["type"]},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["every_15_minutes"]}},"required":["type"]},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["every_5_minutes"]}},"required":["type"]},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["every_minute"]}},"required":["type"]},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["interval"]},"interval_minutes":{"type":"integer","minimum":1,"maximum":1440},"start_time":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"HH:mm in the existing scheduler server timezone. Per-task timezone is not supported."},"stop_time":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"HH:mm in the existing scheduler server timezone. Per-task timezone is not supported."}},"required":["type","interval_minutes","start_time","stop_time"]}],"description":"Replaces the schedule when supplied. Defaults to manual on creation. Daily/weekly/monthly/yearly require time and the relevant day/month; interval requires interval_minutes, start_time and stop_time."},"run_as":{"type":"string","maxLength":254,"minLength":1,"pattern":"^(?:[a-fA-F0-9]{24}|[^\\s@,;]+@[^\\s@,;]+\\.[^\\s@,;]+)$","description":"Project member email address (case-insensitive). A user ID is also accepted for compatibility. Responses return the email. Defaults to the authenticated user on creation. Assigning another user requires organization-admin permission."},"notification":{"type":"string","enum":["errors","all"],"default":"errors"},"notification_emails":{"type":"array","items":{"type":"string","maxLength":254,"minLength":1,"pattern":"^[^\\s@,;]+@[^\\s@,;]+\\.[^\\s@,;]+$"},"minItems":0,"maxItems":50,"description":"Empty array disables email delivery. Defaults to empty on creation."},"log_reference":{"type":"string","maxLength":2000,"description":"Supports existing {{tags}}."},"steps":{"type":"array","items":{"oneOf":[{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["http_request"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"fields":{"type":"object","additionalProperties":false,"properties":{"method":{"type":"string","enum":["GET","POST","PUT","DELETE"]},"url":{"type":"string","maxLength":4000,"minLength":1,"pattern":"\\S"},"headers":{"oneOf":[{"type":"string","maxLength":20000},{"type":"object","additionalProperties":{"type":"string"}}],"description":"Header object or JSON-encoded text; supports {{tags}}."},"body":{"oneOf":[{"type":"string","maxLength":200000},{"type":"object","additionalProperties":true},{"type":"array","items":{}}],"description":"JSON object/array or text."},"format":{"type":"string","enum":["json","text","x-www-form-urlencoded","none"],"default":"json"},"output":{"type":"string","maxLength":100,"minLength":1,"pattern":"^(?!__proto__$|constructor$|prototype$)[A-Za-z_][A-Za-z0-9_]*$","description":"Output tag name without {{braces}}."}},"required":["method","url","output"]},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."}},"required":["type","name","fields"],"title":"http_request","description":"Make an HTTP request. Text fields support existing {{tags}}."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["code"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"fields":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","maxLength":200000,"minLength":1,"pattern":"\\S","description":"JavaScript function body; return the native result. Input {{tags}} are substituted as JavaScript literals: strings already include escaped quotes, arrays/objects retain their structure. Use const po = {{purchase_order_number}}; const orders = {{orders}}; Never wrap input tags in quotes or backticks, or JSON.parse them just to undo substitution. For interpolation, assign the tag to a variable first and then build the string. Do not JSON.stringify the return value just to pass it to another step."},"output":{"type":"string","maxLength":100,"minLength":1,"pattern":"^(?!__proto__$|constructor$|prototype$)[A-Za-z_][A-Za-z0-9_]*$","description":"Output tag name without {{braces}}."},"format":{"type":"string","enum":["none","json","x-www-form-urlencoded"],"default":"json","description":"Select explicitly from the returned value, not the input. String (none): text, IDs, purchase order numbers, and ID-or-null lookups such as return matchingOrder?._id ?? null;. JSON (json): native objects, arrays, numbers or booleans. x-www-form-urlencoded: deliberately URL-encoded form text needed downstream. A null fallback or JSON input does not make a string result JSON. Review every return path and its downstream use. Output processing only; does not change input tag quoting."}},"required":["code","output"]},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."}},"required":["type","name","fields"],"title":"code","description":"Execute a JavaScript server function in the secure runtime."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["for_each"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"fields":{"type":"object","additionalProperties":false,"properties":{"list":{"type":"string","maxLength":1000,"minLength":1,"pattern":"\\S"},"item":{"type":"string","maxLength":100,"minLength":1,"pattern":"^(?!__proto__$|constructor$|prototype$)[A-Za-z_][A-Za-z0-9_]*$","description":"Output tag name without {{braces}}.","default":"item"},"index":{"type":"string","maxLength":100,"minLength":1,"pattern":"^(?!__proto__$|constructor$|prototype$)[A-Za-z_][A-Za-z0-9_]*$","description":"Output tag name without {{braces}}.","default":"index"},"max_iterations":{"type":"integer","minimum":1,"maximum":10000,"default":1000},"continue_on_error":{"type":"boolean","default":false},"output":{"type":"string","maxLength":100,"minLength":1,"pattern":"^(?!__proto__$|constructor$|prototype$)[A-Za-z_][A-Za-z0-9_]*$","description":"Output tag name without {{braces}}."}},"required":["list"]},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."}},"required":["type","name","fields"],"title":"for_each","description":"Repeat child steps over a list. Children refer to this earlier step by name in parent. The current runner does not support a loop or if as a loop child."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["if_statement"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"fields":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","maxLength":200000,"minLength":1,"pattern":"\\S"},"output":{"type":"string","maxLength":100,"minLength":1,"pattern":"^(?!__proto__$|constructor$|prototype$)[A-Za-z_][A-Za-z0-9_]*$","description":"Output tag name without {{braces}}."}},"required":["code","output"]},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."}},"required":["type","name","fields"],"title":"if_statement","description":"Run condition code returning a boolean. Requires one true and one false child, each referring to this step by name in parent and specifying branch. Keep each branch subtree together in list order."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["log_response"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"fields":{"type":"object","additionalProperties":false,"properties":{"subject":{"type":"string","maxLength":500},"body":{"type":"string","maxLength":20000,"minLength":1,"pattern":"\\S"}},"required":["body"]},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."}},"required":["type","name","fields"],"title":"log_response","description":"Append a response to the task log. Supports {{tags}}."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["send_email"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"fields":{"type":"object","additionalProperties":false,"properties":{"to":{"type":"string","maxLength":2000,"minLength":1,"pattern":"\\S"},"subject":{"type":"string","maxLength":500,"minLength":1,"pattern":"\\S"},"body":{"type":"string","maxLength":20000,"minLength":1,"pattern":"\\S"},"include_email_attachments":{"type":"boolean"}},"required":["to","subject","body"]},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."}},"required":["type","name","fields"],"title":"send_email","description":"Send using the Run as user’s connected mailbox. Supports {{tags}} in recipient, subject and body."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["fetch_email"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"fields":{"type":"object","additionalProperties":false,"properties":{"folder":{"type":"string","maxLength":500,"minLength":1,"pattern":"\\S"},"processed_folder":{"type":"string","maxLength":500,"minLength":1,"pattern":"\\S"},"failed_folder":{"type":"string","maxLength":500},"keyword":{"type":"string","maxLength":500},"sender":{"type":"string","maxLength":500},"recipient":{"type":"string","maxLength":500},"body_keyword":{"type":"string","maxLength":500},"single_file":{"type":"boolean"}},"required":["folder","processed_folder"]},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."}},"required":["type","name","fields"],"title":"fetch_email","description":"Read the Run as user’s connected mailbox. Move processed messages to processed_folder."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["ai_answer"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."},"fields":{"type":"object","additionalProperties":false,"properties":{"prompts":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned instruction ID when editing, including when renaming its output."},"prompt":{"type":"string","maxLength":200000,"minLength":1,"pattern":"\\S"},"output":{"type":"string","maxLength":100,"minLength":1,"pattern":"^(?!__proto__$|constructor$|prototype$)[A-Za-z_][A-Za-z0-9_]*$","description":"Output tag name without {{braces}}."},"model":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Exact model name from the model catalog, for example gpt-5.5."},"response":{"type":"string","enum":["string","json","foreach","code","media","task","list"]}},"required":["prompt","output","model","response"]},"minItems":1,"maxItems":100}},"required":["prompts"]}},"required":["type","name","fields"],"title":"ai_answer","description":"Ordered inline AI prompts in fields.prompts. Saved instructions are created automatically."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["ai_answer"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"fields":{"type":"object","additionalProperties":false,"properties":{"question_ids":{"type":"array","items":{"type":"string","pattern":"^[a-fA-F0-9]{24}$"},"minItems":1,"maxItems":100,"description":"Existing instruction (templatequestion) IDs in this project, in execution order. Configure prompt, model, inputs and output on those instructions."}},"required":["question_ids"]},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."}},"required":["type","name","fields"],"title":"ai_answer (instruction IDs)","description":"Compatibility input only. Reads return prompts instead of question_ids."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["ai_agent"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."},"fields":{"type":"object","additionalProperties":false,"properties":{"prompts":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned instruction ID when editing, including when renaming its output."},"prompt":{"type":"string","maxLength":200000,"minLength":1,"pattern":"\\S"},"output":{"type":"string","maxLength":100,"minLength":1,"pattern":"^(?!__proto__$|constructor$|prototype$)[A-Za-z_][A-Za-z0-9_]*$","description":"Output tag name without {{braces}}."},"model":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Exact model name from the model catalog, for example gpt-5.5."},"response":{"type":"string","enum":["string","json","foreach","code","media","task","list"]}},"required":["prompt","output","model","response"]},"minItems":1,"maxItems":100}},"required":["prompts"]}},"required":["type","name","fields"],"title":"ai_agent","description":"Ordered inline AI prompts in fields.prompts. Saved instructions are created automatically."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["ai_agent"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"fields":{"type":"object","additionalProperties":false,"properties":{"question_ids":{"type":"array","items":{"type":"string","pattern":"^[a-fA-F0-9]{24}$"},"minItems":1,"maxItems":100,"description":"Existing instruction (templatequestion) IDs in this project, in execution order. Configure prompt, model, inputs and output on those instructions."}},"required":["question_ids"]},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."}},"required":["type","name","fields"],"title":"ai_agent (instruction IDs)","description":"Compatibility input only. Reads return prompts instead of question_ids."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["transcribe_audio"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"fields":{"type":"object","additionalProperties":false,"properties":{"transcriptions":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$"},"model":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S"},"output":{"type":"string","maxLength":100,"minLength":1,"pattern":"^(?!__proto__$|constructor$|prototype$)[A-Za-z_][A-Za-z0-9_]*$","description":"Output tag name without {{braces}}."}},"required":["model","output"]},"minItems":1,"maxItems":100}},"required":["transcriptions"]},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."}},"required":["type","name","fields"],"title":"transcribe_audio","description":"Transcribe emailAttachments with fields.transcriptions (model and output). Saved question_ids remain compatibility input."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["transcribe_audio"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"fields":{"type":"object","additionalProperties":false,"properties":{"question_ids":{"type":"array","items":{"type":"string","pattern":"^[a-fA-F0-9]{24}$"},"minItems":0,"maxItems":100,"description":"Compatibility input. Empty list preserves the runtime default transcription."}},"required":["question_ids"]},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."}},"required":["type","name","fields"],"title":"transcribe_audio","description":"Transcribe emailAttachments with fields.transcriptions (model and output). Saved question_ids remain compatibility input."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["end"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"fields":{"type":"object","additionalProperties":false,"properties":{}},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."}},"required":["type","name","fields"],"title":"end","description":"End the task run."},{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$"},"type":{"type":"string","enum":["unsupported"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S"},"description":{"type":"string","maxLength":4000},"fields":{"type":"object","additionalProperties":false,"properties":{}},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S"},"branch":{"type":"string","enum":["true","false"]},"integration_category":{"type":"integer","minimum":0,"maximum":1000}},"required":["id","type","name","fields","integration_category"]}]},"minItems":1,"maxItems":100,"description":"Ordered full replacement when supplied. Omit on update to preserve steps. New tasks require at least one step. Only the documented step types are supported in this draft."}},"required":["name","steps"]},{"type":"object","additionalProperties":false,"properties":{"revision":{"type":"string","maxLength":100,"description":"Opaque revision returned by GET. Include on updates to reject stale edits with 409."},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Omit to create. Supply to update an existing task in this project. Names are not identifiers."},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S"},"active":{"type":"boolean","default":false,"description":"New tasks are inactive by default. Saving does not queue a run."},"schedule":{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["manual","yearly","monthly","weekly","daily","hourly","every_15_minutes","every_5_minutes","every_minute","interval"]},"time":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"HH:mm in the existing scheduler server timezone. Per-task timezone is not supported."},"month":{"type":"integer","minimum":1,"maximum":12},"day_of_month":{"type":"integer","minimum":1,"maximum":31},"day_of_week":{"type":"integer","minimum":0,"maximum":6,"description":"0 = Sunday, 6 = Saturday"},"interval_minutes":{"type":"integer","minimum":1,"maximum":1440},"start_time":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"HH:mm in the existing scheduler server timezone. Per-task timezone is not supported."},"stop_time":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"HH:mm in the existing scheduler server timezone. Per-task timezone is not supported."},"retry_until":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"Same-day retry deadline for daily, weekly, monthly and yearly schedules, inclusive. Defaults to 23:59. Runs retry from the first step after 5, 15, then every 30 minutes until a completed successful log starting on or after the scheduled time exists, or the deadline passes."}},"required":["type"],"oneOf":[{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["manual"]}},"required":["type"]},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["yearly"]},"month":{"type":"integer","minimum":1,"maximum":12},"day_of_month":{"type":"integer","minimum":1,"maximum":31},"time":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"HH:mm in the existing scheduler server timezone. Per-task timezone is not supported."},"retry_until":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"Same-day retry deadline for daily, weekly, monthly and yearly schedules, inclusive. Defaults to 23:59. Runs retry from the first step after 5, 15, then every 30 minutes until a completed successful log starting on or after the scheduled time exists, or the deadline passes."}},"required":["type","month","day_of_month","time"]},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["monthly"]},"day_of_month":{"type":"integer","minimum":1,"maximum":31},"time":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"HH:mm in the existing scheduler server timezone. Per-task timezone is not supported."},"retry_until":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"Same-day retry deadline for daily, weekly, monthly and yearly schedules, inclusive. Defaults to 23:59. Runs retry from the first step after 5, 15, then every 30 minutes until a completed successful log starting on or after the scheduled time exists, or the deadline passes."}},"required":["type","day_of_month","time"]},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["weekly"]},"day_of_week":{"type":"integer","minimum":0,"maximum":6,"description":"0 = Sunday, 6 = Saturday"},"time":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"HH:mm in the existing scheduler server timezone. Per-task timezone is not supported."},"retry_until":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"Same-day retry deadline for daily, weekly, monthly and yearly schedules, inclusive. Defaults to 23:59. Runs retry from the first step after 5, 15, then every 30 minutes until a completed successful log starting on or after the scheduled time exists, or the deadline passes."}},"required":["type","day_of_week","time"]},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["daily"]},"time":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"HH:mm in the existing scheduler server timezone. Per-task timezone is not supported."},"retry_until":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"Same-day retry deadline for daily, weekly, monthly and yearly schedules, inclusive. Defaults to 23:59. Runs retry from the first step after 5, 15, then every 30 minutes until a completed successful log starting on or after the scheduled time exists, or the deadline passes."}},"required":["type","time"]},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["hourly"]}},"required":["type"]},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["every_15_minutes"]}},"required":["type"]},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["every_5_minutes"]}},"required":["type"]},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["every_minute"]}},"required":["type"]},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["interval"]},"interval_minutes":{"type":"integer","minimum":1,"maximum":1440},"start_time":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"HH:mm in the existing scheduler server timezone. Per-task timezone is not supported."},"stop_time":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"HH:mm in the existing scheduler server timezone. Per-task timezone is not supported."}},"required":["type","interval_minutes","start_time","stop_time"]}],"description":"Replaces the schedule when supplied. Defaults to manual on creation. Daily/weekly/monthly/yearly require time and the relevant day/month; interval requires interval_minutes, start_time and stop_time."},"run_as":{"type":"string","maxLength":254,"minLength":1,"pattern":"^(?:[a-fA-F0-9]{24}|[^\\s@,;]+@[^\\s@,;]+\\.[^\\s@,;]+)$","description":"Project member email address (case-insensitive). A user ID is also accepted for compatibility. Responses return the email. Defaults to the authenticated user on creation. Assigning another user requires organization-admin permission."},"notification":{"type":"string","enum":["errors","all"],"default":"errors"},"notification_emails":{"type":"array","items":{"type":"string","maxLength":254,"minLength":1,"pattern":"^[^\\s@,;]+@[^\\s@,;]+\\.[^\\s@,;]+$"},"minItems":0,"maxItems":50,"description":"Empty array disables email delivery. Defaults to empty on creation."},"log_reference":{"type":"string","maxLength":2000,"description":"Supports existing {{tags}}."},"steps":{"type":"array","items":{"oneOf":[{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["http_request"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"fields":{"type":"object","additionalProperties":false,"properties":{"method":{"type":"string","enum":["GET","POST","PUT","DELETE"]},"url":{"type":"string","maxLength":4000,"minLength":1,"pattern":"\\S"},"headers":{"oneOf":[{"type":"string","maxLength":20000},{"type":"object","additionalProperties":{"type":"string"}}],"description":"Header object or JSON-encoded text; supports {{tags}}."},"body":{"oneOf":[{"type":"string","maxLength":200000},{"type":"object","additionalProperties":true},{"type":"array","items":{}}],"description":"JSON object/array or text."},"format":{"type":"string","enum":["json","text","x-www-form-urlencoded","none"],"default":"json"},"output":{"type":"string","maxLength":100,"minLength":1,"pattern":"^(?!__proto__$|constructor$|prototype$)[A-Za-z_][A-Za-z0-9_]*$","description":"Output tag name without {{braces}}."}},"required":["method","url","output"]},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."}},"required":["type","name","fields"],"title":"http_request","description":"Make an HTTP request. Text fields support existing {{tags}}."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["code"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"fields":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","maxLength":200000,"minLength":1,"pattern":"\\S","description":"JavaScript function body; return the native result. Input {{tags}} are substituted as JavaScript literals: strings already include escaped quotes, arrays/objects retain their structure. Use const po = {{purchase_order_number}}; const orders = {{orders}}; Never wrap input tags in quotes or backticks, or JSON.parse them just to undo substitution. For interpolation, assign the tag to a variable first and then build the string. Do not JSON.stringify the return value just to pass it to another step."},"output":{"type":"string","maxLength":100,"minLength":1,"pattern":"^(?!__proto__$|constructor$|prototype$)[A-Za-z_][A-Za-z0-9_]*$","description":"Output tag name without {{braces}}."},"format":{"type":"string","enum":["none","json","x-www-form-urlencoded"],"default":"json","description":"Select explicitly from the returned value, not the input. String (none): text, IDs, purchase order numbers, and ID-or-null lookups such as return matchingOrder?._id ?? null;. JSON (json): native objects, arrays, numbers or booleans. x-www-form-urlencoded: deliberately URL-encoded form text needed downstream. A null fallback or JSON input does not make a string result JSON. Review every return path and its downstream use. Output processing only; does not change input tag quoting."}},"required":["code","output"]},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."}},"required":["type","name","fields"],"title":"code","description":"Execute a JavaScript server function in the secure runtime."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["for_each"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"fields":{"type":"object","additionalProperties":false,"properties":{"list":{"type":"string","maxLength":1000,"minLength":1,"pattern":"\\S"},"item":{"type":"string","maxLength":100,"minLength":1,"pattern":"^(?!__proto__$|constructor$|prototype$)[A-Za-z_][A-Za-z0-9_]*$","description":"Output tag name without {{braces}}.","default":"item"},"index":{"type":"string","maxLength":100,"minLength":1,"pattern":"^(?!__proto__$|constructor$|prototype$)[A-Za-z_][A-Za-z0-9_]*$","description":"Output tag name without {{braces}}.","default":"index"},"max_iterations":{"type":"integer","minimum":1,"maximum":10000,"default":1000},"continue_on_error":{"type":"boolean","default":false},"output":{"type":"string","maxLength":100,"minLength":1,"pattern":"^(?!__proto__$|constructor$|prototype$)[A-Za-z_][A-Za-z0-9_]*$","description":"Output tag name without {{braces}}."}},"required":["list"]},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."}},"required":["type","name","fields"],"title":"for_each","description":"Repeat child steps over a list. Children refer to this earlier step by name in parent. The current runner does not support a loop or if as a loop child."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["if_statement"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"fields":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","maxLength":200000,"minLength":1,"pattern":"\\S"},"output":{"type":"string","maxLength":100,"minLength":1,"pattern":"^(?!__proto__$|constructor$|prototype$)[A-Za-z_][A-Za-z0-9_]*$","description":"Output tag name without {{braces}}."}},"required":["code","output"]},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."}},"required":["type","name","fields"],"title":"if_statement","description":"Run condition code returning a boolean. Requires one true and one false child, each referring to this step by name in parent and specifying branch. Keep each branch subtree together in list order."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["log_response"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"fields":{"type":"object","additionalProperties":false,"properties":{"subject":{"type":"string","maxLength":500},"body":{"type":"string","maxLength":20000,"minLength":1,"pattern":"\\S"}},"required":["body"]},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."}},"required":["type","name","fields"],"title":"log_response","description":"Append a response to the task log. Supports {{tags}}."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["send_email"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"fields":{"type":"object","additionalProperties":false,"properties":{"to":{"type":"string","maxLength":2000,"minLength":1,"pattern":"\\S"},"subject":{"type":"string","maxLength":500,"minLength":1,"pattern":"\\S"},"body":{"type":"string","maxLength":20000,"minLength":1,"pattern":"\\S"},"include_email_attachments":{"type":"boolean"}},"required":["to","subject","body"]},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."}},"required":["type","name","fields"],"title":"send_email","description":"Send using the Run as user’s connected mailbox. Supports {{tags}} in recipient, subject and body."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["fetch_email"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"fields":{"type":"object","additionalProperties":false,"properties":{"folder":{"type":"string","maxLength":500,"minLength":1,"pattern":"\\S"},"processed_folder":{"type":"string","maxLength":500,"minLength":1,"pattern":"\\S"},"failed_folder":{"type":"string","maxLength":500},"keyword":{"type":"string","maxLength":500},"sender":{"type":"string","maxLength":500},"recipient":{"type":"string","maxLength":500},"body_keyword":{"type":"string","maxLength":500},"single_file":{"type":"boolean"}},"required":["folder","processed_folder"]},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."}},"required":["type","name","fields"],"title":"fetch_email","description":"Read the Run as user’s connected mailbox. Move processed messages to processed_folder."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["ai_answer"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."},"fields":{"type":"object","additionalProperties":false,"properties":{"prompts":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned instruction ID when editing, including when renaming its output."},"prompt":{"type":"string","maxLength":200000,"minLength":1,"pattern":"\\S"},"output":{"type":"string","maxLength":100,"minLength":1,"pattern":"^(?!__proto__$|constructor$|prototype$)[A-Za-z_][A-Za-z0-9_]*$","description":"Output tag name without {{braces}}."},"model":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Exact model name from the model catalog, for example gpt-5.5."},"response":{"type":"string","enum":["string","json","foreach","code","media","task","list"]}},"required":["prompt","output","model","response"]},"minItems":1,"maxItems":100}},"required":["prompts"]}},"required":["type","name","fields"],"title":"ai_answer","description":"Ordered inline AI prompts in fields.prompts. Saved instructions are created automatically."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["ai_answer"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"fields":{"type":"object","additionalProperties":false,"properties":{"question_ids":{"type":"array","items":{"type":"string","pattern":"^[a-fA-F0-9]{24}$"},"minItems":1,"maxItems":100,"description":"Existing instruction (templatequestion) IDs in this project, in execution order. Configure prompt, model, inputs and output on those instructions."}},"required":["question_ids"]},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."}},"required":["type","name","fields"],"title":"ai_answer (instruction IDs)","description":"Compatibility input only. Reads return prompts instead of question_ids."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["ai_agent"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."},"fields":{"type":"object","additionalProperties":false,"properties":{"prompts":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned instruction ID when editing, including when renaming its output."},"prompt":{"type":"string","maxLength":200000,"minLength":1,"pattern":"\\S"},"output":{"type":"string","maxLength":100,"minLength":1,"pattern":"^(?!__proto__$|constructor$|prototype$)[A-Za-z_][A-Za-z0-9_]*$","description":"Output tag name without {{braces}}."},"model":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Exact model name from the model catalog, for example gpt-5.5."},"response":{"type":"string","enum":["string","json","foreach","code","media","task","list"]}},"required":["prompt","output","model","response"]},"minItems":1,"maxItems":100}},"required":["prompts"]}},"required":["type","name","fields"],"title":"ai_agent","description":"Ordered inline AI prompts in fields.prompts. Saved instructions are created automatically."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["ai_agent"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"fields":{"type":"object","additionalProperties":false,"properties":{"question_ids":{"type":"array","items":{"type":"string","pattern":"^[a-fA-F0-9]{24}$"},"minItems":1,"maxItems":100,"description":"Existing instruction (templatequestion) IDs in this project, in execution order. Configure prompt, model, inputs and output on those instructions."}},"required":["question_ids"]},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."}},"required":["type","name","fields"],"title":"ai_agent (instruction IDs)","description":"Compatibility input only. Reads return prompts instead of question_ids."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["transcribe_audio"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"fields":{"type":"object","additionalProperties":false,"properties":{"transcriptions":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$"},"model":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S"},"output":{"type":"string","maxLength":100,"minLength":1,"pattern":"^(?!__proto__$|constructor$|prototype$)[A-Za-z_][A-Za-z0-9_]*$","description":"Output tag name without {{braces}}."}},"required":["model","output"]},"minItems":1,"maxItems":100}},"required":["transcriptions"]},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."}},"required":["type","name","fields"],"title":"transcribe_audio","description":"Transcribe emailAttachments with fields.transcriptions (model and output). Saved question_ids remain compatibility input."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["transcribe_audio"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"fields":{"type":"object","additionalProperties":false,"properties":{"question_ids":{"type":"array","items":{"type":"string","pattern":"^[a-fA-F0-9]{24}$"},"minItems":0,"maxItems":100,"description":"Compatibility input. Empty list preserves the runtime default transcription."}},"required":["question_ids"]},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."}},"required":["type","name","fields"],"title":"transcribe_audio","description":"Transcribe emailAttachments with fields.transcriptions (model and output). Saved question_ids remain compatibility input."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["end"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"fields":{"type":"object","additionalProperties":false,"properties":{}},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."}},"required":["type","name","fields"],"title":"end","description":"End the task run."},{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$"},"type":{"type":"string","enum":["unsupported"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S"},"description":{"type":"string","maxLength":4000},"fields":{"type":"object","additionalProperties":false,"properties":{}},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S"},"branch":{"type":"string","enum":["true","false"]},"integration_category":{"type":"integer","minimum":0,"maximum":1000}},"required":["id","type","name","fields","integration_category"]}]},"minItems":0,"maxItems":100,"description":"Ordered full replacement when supplied. Omit on update to preserve steps. New tasks require at least one step. Only the documented step types are supported in this draft."},"step_updates":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$"},"description":{"type":"string","maxLength":4000},"fields":{"type":"object","additionalProperties":true}},"required":["id"]},"minItems":1,"maxItems":100,"description":"Content updates by existing step ID. Requires revision; cannot accompany steps. Omitted fields are preserved. fields merges by top-level field name; nested objects and arrays replace their field in full. Cannot add, remove, reorder, rename or change step types or branches. The merged steps are validated before saving."}},"required":["id"],"minProperties":2,"anyOf":[{"required":["name"]},{"required":["active"]},{"required":["schedule"]},{"required":["run_as"]},{"required":["notification"]},{"required":["notification_emails"]},{"required":["log_reference"]},{"required":["steps"]},{"required":["step_updates"]}]}],"description":"Without id: create schema. With id: update schema. Validation accepts the same contract."}}}},"responses":{"200":{"description":"Valid request","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"valid":{"type":"boolean","enum":[true]},"issues":{"type":"array","items":{},"maxItems":0},"warnings":{"type":"array","items":{"type":"string","maxLength":20000},"minItems":0,"maxItems":100}},"required":["valid","issues","warnings"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"step":{"type":"string"}}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/TaskConflict"},"500":{"$ref":"#/components/responses/InternalServerError"}}}},"/api/v1/tasks/authoring-options":{"get":{"tags":["Tasks"],"operationId":"taskAuthoringOptions","summary":"Discover model names and eligible Run as emails","security":[{"ProjectApiKey":[]},{"McpOAuth":["mcp:read"]}],"description":"Returns organization-approved, project-enabled model names and types, permitted project-member emails, and API host timezone information. Provider credentials are not exposed or tested. Scheduler host timezone must match the API host.","responses":{"200":{"description":"Authoring options","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"models":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"model":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S"},"type":{"type":"integer","minimum":1,"maximum":3}},"required":["model","type"]},"minItems":0,"maxItems":10000},"model_types":{"type":"object","additionalProperties":false,"properties":{"1":{"type":"string","enum":["language"]},"2":{"type":"string","enum":["media"]},"3":{"type":"string","enum":["speech_to_text"]}},"required":["1","2","3"]},"run_as":{"type":"array","items":{"type":"string","format":"email"},"minItems":0,"maxItems":10000},"api_server_timezone":{"type":"string","maxLength":20000},"schedule_timezone":{"type":"string","maxLength":20000},"notes":{"type":"array","items":{"type":"string","maxLength":20000},"minItems":0,"maxItems":100}},"required":["models","model_types","run_as","api_server_timezone","schedule_timezone","notes"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"step":{"type":"string"}}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalServerError"}}}},"/api/v1/tasks/step-types":{"get":{"tags":["Tasks"],"operationId":"listTaskStepTypes","summary":"List supported step types and their fields","security":[{"ProjectApiKey":[]},{"McpOAuth":["mcp:read"]}],"description":"Returns schemas for the supported first-draft integration types: http_request, code, for_each, if_statement, log_response, send_email, fetch_email, ai_answer, ai_agent, transcribe_audio, end. Each step uses type, name and optional description, with a fields object for every step (fields.prompts for AI steps). List order determines execution order. Unknown fields and unsupported types are rejected.","responses":{"200":{"description":"Step type descriptions and JSON schemas","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/api/v1/tasks/{id}":{"get":{"tags":["Tasks"],"operationId":"getTask","summary":"Read task settings and ordered steps","security":[{"ProjectApiKey":[]},{"McpOAuth":["mcp:read"]}],"description":"Returns task settings in the authoring API format. Only the fields supported by this draft are represented; advanced integration settings are omitted. Unsupported integration types are marked unsupported with their numeric integration_category; return them unchanged with their IDs to preserve them. Retain revision to detect stale edits. Omit steps when updating just task settings. No authentication credentials from email integrations are returned.","parameters":[{"name":"id","in":"path","required":true,"description":"Task ID or exact task name (case-insensitive) in the current project. URL-encode names, including slashes: Email/TEST becomes Email%2FTEST. A 24-character hexadecimal value is treated as an ID. Use the ID if names are duplicated.","schema":{"type":"string"}}],"responses":{"200":{"description":"Task settings and steps","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"revision":{"type":"string","maxLength":100,"description":"Opaque revision returned by GET. Include on updates to reject stale edits with 409."},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Omit to create. Supply to update an existing task in this project. Names are not identifiers."},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S"},"active":{"type":"boolean","default":false,"description":"New tasks are inactive by default. Saving does not queue a run."},"schedule":{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["manual","yearly","monthly","weekly","daily","hourly","every_15_minutes","every_5_minutes","every_minute","interval"]},"time":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"HH:mm in the existing scheduler server timezone. Per-task timezone is not supported."},"month":{"type":"integer","minimum":1,"maximum":12},"day_of_month":{"type":"integer","minimum":1,"maximum":31},"day_of_week":{"type":"integer","minimum":0,"maximum":6,"description":"0 = Sunday, 6 = Saturday"},"interval_minutes":{"type":"integer","minimum":1,"maximum":1440},"start_time":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"HH:mm in the existing scheduler server timezone. Per-task timezone is not supported."},"stop_time":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"HH:mm in the existing scheduler server timezone. Per-task timezone is not supported."},"retry_until":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"Same-day retry deadline for daily, weekly, monthly and yearly schedules, inclusive. Defaults to 23:59. Runs retry from the first step after 5, 15, then every 30 minutes until a completed successful log starting on or after the scheduled time exists, or the deadline passes."}},"required":["type"],"oneOf":[{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["manual"]}},"required":["type"]},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["yearly"]},"month":{"type":"integer","minimum":1,"maximum":12},"day_of_month":{"type":"integer","minimum":1,"maximum":31},"time":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"HH:mm in the existing scheduler server timezone. Per-task timezone is not supported."},"retry_until":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"Same-day retry deadline for daily, weekly, monthly and yearly schedules, inclusive. Defaults to 23:59. Runs retry from the first step after 5, 15, then every 30 minutes until a completed successful log starting on or after the scheduled time exists, or the deadline passes."}},"required":["type","month","day_of_month","time"]},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["monthly"]},"day_of_month":{"type":"integer","minimum":1,"maximum":31},"time":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"HH:mm in the existing scheduler server timezone. Per-task timezone is not supported."},"retry_until":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"Same-day retry deadline for daily, weekly, monthly and yearly schedules, inclusive. Defaults to 23:59. Runs retry from the first step after 5, 15, then every 30 minutes until a completed successful log starting on or after the scheduled time exists, or the deadline passes."}},"required":["type","day_of_month","time"]},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["weekly"]},"day_of_week":{"type":"integer","minimum":0,"maximum":6,"description":"0 = Sunday, 6 = Saturday"},"time":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"HH:mm in the existing scheduler server timezone. Per-task timezone is not supported."},"retry_until":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"Same-day retry deadline for daily, weekly, monthly and yearly schedules, inclusive. Defaults to 23:59. Runs retry from the first step after 5, 15, then every 30 minutes until a completed successful log starting on or after the scheduled time exists, or the deadline passes."}},"required":["type","day_of_week","time"]},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["daily"]},"time":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"HH:mm in the existing scheduler server timezone. Per-task timezone is not supported."},"retry_until":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"Same-day retry deadline for daily, weekly, monthly and yearly schedules, inclusive. Defaults to 23:59. Runs retry from the first step after 5, 15, then every 30 minutes until a completed successful log starting on or after the scheduled time exists, or the deadline passes."}},"required":["type","time"]},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["hourly"]}},"required":["type"]},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["every_15_minutes"]}},"required":["type"]},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["every_5_minutes"]}},"required":["type"]},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["every_minute"]}},"required":["type"]},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["interval"]},"interval_minutes":{"type":"integer","minimum":1,"maximum":1440},"start_time":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"HH:mm in the existing scheduler server timezone. Per-task timezone is not supported."},"stop_time":{"type":"string","pattern":"^([01][0-9]|2[0-3]):[0-5][0-9]$","description":"HH:mm in the existing scheduler server timezone. Per-task timezone is not supported."}},"required":["type","interval_minutes","start_time","stop_time"]}],"description":"Replaces the schedule when supplied. Defaults to manual on creation. Daily/weekly/monthly/yearly require time and the relevant day/month; interval requires interval_minutes, start_time and stop_time."},"run_as":{"type":"string","format":"email","nullable":true,"description":"Run as user email, or null if the user no longer exists or has no email address."},"notification":{"type":"string","enum":["errors","all"],"default":"errors"},"notification_emails":{"type":"array","items":{"type":"string","maxLength":254,"minLength":1,"pattern":"^[^\\s@,;]+@[^\\s@,;]+\\.[^\\s@,;]+$"},"minItems":0,"maxItems":50,"description":"Empty array disables email delivery. Defaults to empty on creation."},"log_reference":{"type":"string","maxLength":2000,"description":"Supports existing {{tags}}."},"steps":{"type":"array","items":{"oneOf":[{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["http_request"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"fields":{"type":"object","additionalProperties":false,"properties":{"method":{"type":"string","enum":["GET","POST","PUT","DELETE"]},"url":{"type":"string","maxLength":4000,"minLength":1,"pattern":"\\S"},"headers":{"oneOf":[{"type":"string","maxLength":20000},{"type":"object","additionalProperties":{"type":"string"}}],"description":"Header object or JSON-encoded text; supports {{tags}}."},"body":{"oneOf":[{"type":"string","maxLength":200000},{"type":"object","additionalProperties":true},{"type":"array","items":{}}],"description":"JSON object/array or text."},"format":{"type":"string","enum":["json","text","x-www-form-urlencoded","none"],"default":"json"},"output":{"type":"string","maxLength":100,"minLength":1,"pattern":"^(?!__proto__$|constructor$|prototype$)[A-Za-z_][A-Za-z0-9_]*$","description":"Output tag name without {{braces}}."}},"required":["method","url","output"]},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."}},"required":["type","name","fields"],"title":"http_request","description":"Make an HTTP request. Text fields support existing {{tags}}."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["code"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"fields":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","maxLength":200000,"minLength":1,"pattern":"\\S","description":"JavaScript function body; return the native result. Input {{tags}} are substituted as JavaScript literals: strings already include escaped quotes, arrays/objects retain their structure. Use const po = {{purchase_order_number}}; const orders = {{orders}}; Never wrap input tags in quotes or backticks, or JSON.parse them just to undo substitution. For interpolation, assign the tag to a variable first and then build the string. Do not JSON.stringify the return value just to pass it to another step."},"output":{"type":"string","maxLength":100,"minLength":1,"pattern":"^(?!__proto__$|constructor$|prototype$)[A-Za-z_][A-Za-z0-9_]*$","description":"Output tag name without {{braces}}."},"format":{"type":"string","enum":["none","json","x-www-form-urlencoded"],"default":"json","description":"Select explicitly from the returned value, not the input. String (none): text, IDs, purchase order numbers, and ID-or-null lookups such as return matchingOrder?._id ?? null;. JSON (json): native objects, arrays, numbers or booleans. x-www-form-urlencoded: deliberately URL-encoded form text needed downstream. A null fallback or JSON input does not make a string result JSON. Review every return path and its downstream use. Output processing only; does not change input tag quoting."}},"required":["code","output"]},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."}},"required":["type","name","fields"],"title":"code","description":"Execute a JavaScript server function in the secure runtime."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["for_each"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"fields":{"type":"object","additionalProperties":false,"properties":{"list":{"type":"string","maxLength":1000,"minLength":1,"pattern":"\\S"},"item":{"type":"string","maxLength":100,"minLength":1,"pattern":"^(?!__proto__$|constructor$|prototype$)[A-Za-z_][A-Za-z0-9_]*$","description":"Output tag name without {{braces}}.","default":"item"},"index":{"type":"string","maxLength":100,"minLength":1,"pattern":"^(?!__proto__$|constructor$|prototype$)[A-Za-z_][A-Za-z0-9_]*$","description":"Output tag name without {{braces}}.","default":"index"},"max_iterations":{"type":"integer","minimum":1,"maximum":10000,"default":1000},"continue_on_error":{"type":"boolean","default":false},"output":{"type":"string","maxLength":100,"minLength":1,"pattern":"^(?!__proto__$|constructor$|prototype$)[A-Za-z_][A-Za-z0-9_]*$","description":"Output tag name without {{braces}}."}},"required":["list"]},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."}},"required":["type","name","fields"],"title":"for_each","description":"Repeat child steps over a list. Children refer to this earlier step by name in parent. The current runner does not support a loop or if as a loop child."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["if_statement"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"fields":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","maxLength":200000,"minLength":1,"pattern":"\\S"},"output":{"type":"string","maxLength":100,"minLength":1,"pattern":"^(?!__proto__$|constructor$|prototype$)[A-Za-z_][A-Za-z0-9_]*$","description":"Output tag name without {{braces}}."}},"required":["code","output"]},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."}},"required":["type","name","fields"],"title":"if_statement","description":"Run condition code returning a boolean. Requires one true and one false child, each referring to this step by name in parent and specifying branch. Keep each branch subtree together in list order."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["log_response"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"fields":{"type":"object","additionalProperties":false,"properties":{"subject":{"type":"string","maxLength":500},"body":{"type":"string","maxLength":20000,"minLength":1,"pattern":"\\S"}},"required":["body"]},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."}},"required":["type","name","fields"],"title":"log_response","description":"Append a response to the task log. Supports {{tags}}."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["send_email"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"fields":{"type":"object","additionalProperties":false,"properties":{"to":{"type":"string","maxLength":2000,"minLength":1,"pattern":"\\S"},"subject":{"type":"string","maxLength":500,"minLength":1,"pattern":"\\S"},"body":{"type":"string","maxLength":20000,"minLength":1,"pattern":"\\S"},"include_email_attachments":{"type":"boolean"}},"required":["to","subject","body"]},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."}},"required":["type","name","fields"],"title":"send_email","description":"Send using the Run as user’s connected mailbox. Supports {{tags}} in recipient, subject and body."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["fetch_email"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"fields":{"type":"object","additionalProperties":false,"properties":{"folder":{"type":"string","maxLength":500,"minLength":1,"pattern":"\\S"},"processed_folder":{"type":"string","maxLength":500,"minLength":1,"pattern":"\\S"},"failed_folder":{"type":"string","maxLength":500},"keyword":{"type":"string","maxLength":500},"sender":{"type":"string","maxLength":500},"recipient":{"type":"string","maxLength":500},"body_keyword":{"type":"string","maxLength":500},"single_file":{"type":"boolean"}},"required":["folder","processed_folder"]},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."}},"required":["type","name","fields"],"title":"fetch_email","description":"Read the Run as user’s connected mailbox. Move processed messages to processed_folder."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["ai_answer"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."},"fields":{"type":"object","additionalProperties":false,"properties":{"prompts":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned instruction ID when editing, including when renaming its output."},"prompt":{"type":"string","maxLength":200000,"minLength":1,"pattern":"\\S"},"output":{"type":"string","maxLength":100,"minLength":1,"pattern":"^(?!__proto__$|constructor$|prototype$)[A-Za-z_][A-Za-z0-9_]*$","description":"Output tag name without {{braces}}."},"model":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Exact model name from the model catalog, for example gpt-5.5."},"response":{"type":"string","enum":["string","json","foreach","code","media","task","list"]}},"required":["prompt","output","model","response"]},"minItems":1,"maxItems":100}},"required":["prompts"]}},"required":["type","name","fields"],"title":"ai_answer","description":"Ordered inline AI prompts in fields.prompts. Saved instructions are created automatically."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["ai_answer"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"fields":{"type":"object","additionalProperties":false,"properties":{"question_ids":{"type":"array","items":{"type":"string","pattern":"^[a-fA-F0-9]{24}$"},"minItems":1,"maxItems":100,"description":"Existing instruction (templatequestion) IDs in this project, in execution order. Configure prompt, model, inputs and output on those instructions."}},"required":["question_ids"]},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."}},"required":["type","name","fields"],"title":"ai_answer (instruction IDs)","description":"Compatibility input only. Reads return prompts instead of question_ids."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["ai_agent"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."},"fields":{"type":"object","additionalProperties":false,"properties":{"prompts":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned instruction ID when editing, including when renaming its output."},"prompt":{"type":"string","maxLength":200000,"minLength":1,"pattern":"\\S"},"output":{"type":"string","maxLength":100,"minLength":1,"pattern":"^(?!__proto__$|constructor$|prototype$)[A-Za-z_][A-Za-z0-9_]*$","description":"Output tag name without {{braces}}."},"model":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Exact model name from the model catalog, for example gpt-5.5."},"response":{"type":"string","enum":["string","json","foreach","code","media","task","list"]}},"required":["prompt","output","model","response"]},"minItems":1,"maxItems":100}},"required":["prompts"]}},"required":["type","name","fields"],"title":"ai_agent","description":"Ordered inline AI prompts in fields.prompts. Saved instructions are created automatically."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["ai_agent"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"fields":{"type":"object","additionalProperties":false,"properties":{"question_ids":{"type":"array","items":{"type":"string","pattern":"^[a-fA-F0-9]{24}$"},"minItems":1,"maxItems":100,"description":"Existing instruction (templatequestion) IDs in this project, in execution order. Configure prompt, model, inputs and output on those instructions."}},"required":["question_ids"]},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."}},"required":["type","name","fields"],"title":"ai_agent (instruction IDs)","description":"Compatibility input only. Reads return prompts instead of question_ids."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["transcribe_audio"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"fields":{"type":"object","additionalProperties":false,"properties":{"transcriptions":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$"},"model":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S"},"output":{"type":"string","maxLength":100,"minLength":1,"pattern":"^(?!__proto__$|constructor$|prototype$)[A-Za-z_][A-Za-z0-9_]*$","description":"Output tag name without {{braces}}."}},"required":["model","output"]},"minItems":1,"maxItems":100}},"required":["transcriptions"]},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."}},"required":["type","name","fields"],"title":"transcribe_audio","description":"Transcribe emailAttachments with fields.transcriptions (model and output). Saved question_ids remain compatibility input."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["transcribe_audio"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"fields":{"type":"object","additionalProperties":false,"properties":{"question_ids":{"type":"array","items":{"type":"string","pattern":"^[a-fA-F0-9]{24}$"},"minItems":0,"maxItems":100,"description":"Compatibility input. Empty list preserves the runtime default transcription."}},"required":["question_ids"]},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."}},"required":["type","name","fields"],"title":"transcribe_audio","description":"Transcribe emailAttachments with fields.transcriptions (model and output). Saved question_ids remain compatibility input."},{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["end"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Unique step name within this task (case-sensitive after trimming)."},"description":{"type":"string","maxLength":4000},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S","description":"Name of an earlier for_each or if_statement step. Keep child subtrees contiguous."},"branch":{"type":"string","enum":["true","false"],"description":"Marks an If branch head. Set parent to the If step name; saving sets both the If branch target ID and this step's parentIntegrationId atomically. Branch changes require the full steps layout, not step_updates."},"fields":{"type":"object","additionalProperties":false,"properties":{}},"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$","description":"Retain the returned step ID to preserve hidden settings and identity across edits and renames."}},"required":["type","name","fields"],"title":"end","description":"End the task run."},{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string","pattern":"^[a-fA-F0-9]{24}$"},"type":{"type":"string","enum":["unsupported"]},"name":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S"},"description":{"type":"string","maxLength":4000},"fields":{"type":"object","additionalProperties":false,"properties":{}},"parent":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S"},"branch":{"type":"string","enum":["true","false"]},"integration_category":{"type":"integer","minimum":0,"maximum":1000}},"required":["id","type","name","fields","integration_category"]}]},"description":"Ordered steps with stable IDs. Return unsupported steps unchanged to preserve them."}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"step":{"type":"string"}}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/AmbiguousTask"},"500":{"$ref":"#/components/responses/InternalServerError"}}}},"/api/v1/logs":{"get":{"tags":["Logs"],"operationId":"searchLogs","summary":"Retrieve logs by log ID, project, date, status and keyword","security":[{"ProjectApiKey":[]},{"McpOAuth":["mcp:read"]}],"description":"Returns logs, including activity and response text, newest first (date then ID). Uses the project supplied by your API key. Dates filter the log start date. Date-only values use UTC: from starts at midnight, to includes the whole day. ISO timestamps must include a timezone and are inclusive. Keyword is a literal case-insensitive substring in task name, log reference, response or activity.description. Omitted date/keyword filters do not restrict results.","parameters":[{"name":"logId","in":"query","required":false,"description":"Exact log ID (the log's _id). Searches only the current project and combines with all other filters. Unknown IDs return no matches. Omit for all project logs.","schema":{"type":"string","pattern":"^[a-fA-F0-9]{24}$"}},{"name":"from","in":"query","description":"YYYY-MM-DD or ISO timestamp with timezone","schema":{"type":"string"},"example":"2026-10-22"},{"name":"to","in":"query","description":"YYYY-MM-DD or ISO timestamp with timezone","schema":{"type":"string"},"example":"2026-10-22"},{"name":"task","in":"query","required":false,"description":"Task Name or ID. Enter a task ID or an exact task name (case-insensitive) in the current project. Names resolve to IDs, including logs from before a rename. Duplicate names return 409; use the ID. IDs also find historical logs for deleted tasks; unknown IDs return no matches. Omit for all project logs. List tasks with GET /api/v1/tasks.","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"keyword","in":"query","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"status","in":"query","required":false,"description":"Filter by success (status 1), failed (status 2), or running (isRunning true). Success and failed exclude logs still running. Values are case-insensitive. Omit for all statuses.","schema":{"type":"string","enum":["success","failed","running"]}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":50}},{"name":"skip","in":"query","description":"Number of matching logs to skip, not page number","schema":{"type":"integer","minimum":0,"maximum":1000000,"default":0}}],"responses":{"200":{"description":"Matching logs; an empty docs array means no matches","content":{"application/json":{"schema":{"type":"object","required":["project","docs","total","limit","skip","hasMore"],"properties":{"project":{"type":"object","required":["_id","name"],"properties":{"_id":{"type":"string"},"name":{"type":"string"}}},"docs":{"type":"array","items":{"type":"object","properties":{"_id":{"type":"string"},"agentId":{"type":"string"},"agentName":{"type":"string"},"agentQueueId":{"type":"string"},"projectId":{"type":"string"},"date":{"type":"string","format":"date-time"},"status":{"type":"integer","description":"1 = OK, 2 = failed"},"source":{"type":"string"},"reference":{"type":"string"},"response":{"type":"string"},"activity":{"type":"array","items":{"type":"object","properties":{"description":{"type":"string","description":"Activity text; may contain HTML"}}}},"runtime":{"type":"number","description":"Runtime in milliseconds"},"isRunning":{"type":"boolean"},"lastUpdatedOn":{"type":"string","format":"date-time"},"completedOn":{"type":"string","format":"date-time"}}}},"total":{"type":"integer","minimum":0},"limit":{"type":"integer"},"skip":{"type":"integer"},"hasMore":{"type":"boolean"}}}}}},"400":{"description":"Invalid filters or date range","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/ProjectScopeForbidden"},"404":{"$ref":"#/components/responses/LogNotFound"},"409":{"$ref":"#/components/responses/AmbiguousTask"},"500":{"$ref":"#/components/responses/InternalServerError"}}}},"/api/v1/api/{apiPath}":{"get":{"tags":["APIs"],"operationId":"getAPI","summary":"Execute an API","description":"Executes an API or retrieves a skill configured in your project. Use its ID or configured path, for example customer/list. Query parameters, JSON input and the response format depend on that API or skill. Nested paths work in the API; if a client encodes slashes, use the ID. No private API or skill definitions are included in this public specification.","security":[{"ProjectApiKey":[]},{"McpOAuth":["mcp:write"]}],"parameters":[{"name":"apiPath","in":"path","required":true,"description":"API ID or configured path","schema":{"type":"string"}}],"responses":{"200":{"description":"API or skill response (JSON, text, CSV or binary)"},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"step":{"type":"string"}}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalServerError"}}},"post":{"tags":["APIs"],"operationId":"postAPI","summary":"Execute an API","description":"Executes an API or retrieves a skill configured in your project. Use its ID or configured path, for example customer/list. Query parameters, JSON input and the response format depend on that API or skill. Nested paths work in the API; if a client encodes slashes, use the ID. No private API or skill definitions are included in this public specification.","security":[{"ProjectApiKey":[]},{"McpOAuth":["mcp:write"]}],"parameters":[{"name":"apiPath","in":"path","required":true,"description":"API ID or configured path","schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"responses":{"200":{"description":"API or skill response (JSON, text, CSV or binary)"},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"step":{"type":"string"}}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalServerError"}}}},"/api/v1/skill/{skillPath}":{"get":{"tags":["Skills"],"operationId":"getSkill","summary":"Retrieve a skill","description":"Executes an API or retrieves a skill configured in your project. Use its ID or configured path, for example customer/list. Query parameters, JSON input and the response format depend on that API or skill. Nested paths work in the API; if a client encodes slashes, use the ID. No private API or skill definitions are included in this public specification.","security":[{"ProjectApiKey":[]},{"McpOAuth":["mcp:write"]}],"parameters":[{"name":"skillPath","in":"path","required":true,"description":"Skill ID or configured path","schema":{"type":"string"}}],"responses":{"200":{"description":"API or skill response (JSON, text, CSV or binary)"},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"step":{"type":"string"}}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalServerError"}}},"post":{"tags":["Skills"],"operationId":"postSkill","summary":"Retrieve a skill","description":"Executes an API or retrieves a skill configured in your project. Use its ID or configured path, for example customer/list. Query parameters, JSON input and the response format depend on that API or skill. Nested paths work in the API; if a client encodes slashes, use the ID. No private API or skill definitions are included in this public specification.","security":[{"ProjectApiKey":[]},{"McpOAuth":["mcp:write"]}],"parameters":[{"name":"skillPath","in":"path","required":true,"description":"Skill ID or configured path","schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"responses":{"200":{"description":"API or skill response (JSON, text, CSV or binary)"},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"step":{"type":"string"}}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalServerError"}}}},"/api/v1/task/{id}":{"post":{"tags":["Tasks"],"operationId":"queueTask","summary":"Queue a task run","security":[{"ProjectApiKey":[]},{"McpOAuth":["mcp:write"]}],"description":"Queues the task and returns immediately. The current handler does not persist request-body data in the queue record; payload delivery to the worker is not supported.","parameters":[{"name":"id","in":"path","required":true,"description":"Task ID or exact task name (case-insensitive) in the current project. URL-encode the task name, including spaces and slashes. A 24-character hexadecimal value is treated as an ID. Duplicate names return 409; use the task ID.","schema":{"type":"string","minLength":1,"maxLength":200}}],"responses":{"202":{"description":"Agent queued; this does not indicate completion","content":{"application/json":{"schema":{"type":"object","required":["message","queueJobId","status","trackAt"],"properties":{"message":{"type":"string","example":"Agent queued and running"},"queueJobId":{"type":"string","pattern":"^[a-fA-F0-9]{24}$"},"status":{"type":"string","enum":["running"]},"trackAt":{"type":"string","example":"/api/agent/queue/0123456789abcdef01234567"}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"step":{"type":"string"}}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/AmbiguousTask"},"500":{"$ref":"#/components/responses/InternalServerError"}}}},"/api/v1/webhook/{webhookId}":{"post":{"tags":["Webhooks"],"operationId":"receiveWebhook","summary":"Receive an inbound webhook","security":[],"description":"The URL contains an active project key of webhook-endpoint type. Keep the full URL private. An optional resume token continues a waiting agent.","parameters":[{"name":"webhookId","in":"path","required":true,"description":"Webhook endpoint key","schema":{"type":"string"}},{"name":"resume","in":"query","schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{}},"text/plain":{"schema":{"type":"string"}}}},"responses":{"200":{"description":"Webhook recorded","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"step":{"type":"string"}}}}}}}}},"404":{"$ref":"#/components/responses/NotFound"},"410":{"description":"Continuation expired","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"500":{"$ref":"#/components/responses/InternalServerError"}}}},"/api/public-ai/message":{"post":{"tags":["Public AI"],"operationId":"publicAiMessage","summary":"Ask the public AI about iMothership","security":[],"description":"Uses a server-configured demo project. Visitor, IP and global quotas apply. The default maximum message length is 1200 characters; deployments can override it. History retains the last eight messages.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string","example":"How can I automate a workflow?"},"history":{"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["user","assistant"]},"text":{"type":"string"}}}}}}}}},"responses":{"200":{"description":"Guide answer","content":{"application/json":{"schema":{"type":"object","properties":{"answer":{"type":"string"},"remaining":{"type":"integer"},"agent":{"type":"string"}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"step":{"type":"string"}}}}}}}}},"429":{"description":"Demo quota reached","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"500":{"$ref":"#/components/responses/InternalServerError"},"502":{"description":"No answer returned","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"503":{"description":"Demo unavailable or not configured","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}}}}},"/api/pack/public":{"get":{"tags":["Marketplace"],"operationId":"listPublicPacks","summary":"List public marketplace packs","security":[],"parameters":[{"name":"limit","in":"query","schema":{"type":"integer","default":100}}],"responses":{"200":{"description":"Public packs","content":{"application/json":{"schema":{"type":"object","properties":{"docs":{"type":"array","items":{"type":"object","additionalProperties":true}},"total":{"type":"integer"}}}}}},"500":{"$ref":"#/components/responses/InternalServerError"}}}}}}