{"openapi":"3.1.0","info":{"title":"Super Flows API","version":"1","description":"Connect your team’s apps once. Build workflows from app actions, AI agents, conditions, databases and delays. Run them on a schedule, on an app event or from code, and see every step."},"servers":[{"url":"/"}],"paths":{"/api/health":{"get":{"tags":["Health"],"summary":"Check the service","security":[],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"ok"}},"required":["status"],"additionalProperties":false}}}}}}},"/api/v1/dashboard":{"get":{"tags":["Dashboard"],"summary":"What needs attention and what ran","description":"Agent actions waiting for approval, steps that failed in the last 7 days, app event triggers that stopped, the organization's most recent runs, and counts.","security":[{"organizationKey":[]},{"session":[]}],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Dashboard"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`no_active_organization`, `forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/projects":{"get":{"tags":["Projects"],"summary":"List projects","description":"Newest first. Page until `nextCursor` is null.","security":[{"organizationKey":[]},{"session":[]}],"parameters":[{"in":"query","name":"cursor","schema":{"type":"string"}},{"in":"query","name":"limit","schema":{"default":20,"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectPage"}}}},"400":{"description":"`invalid_request`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`no_active_organization`, `forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Projects"],"summary":"Create a project","security":[{"organizationKey":[]},{"session":[]}],"parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectInput"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Project"}}}},"400":{"description":"`invalid_request`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`plan_limit_reached`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`no_active_organization`, `forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/projects/{id}":{"get":{"tags":["Projects"],"summary":"Get a project","security":[{"organizationKey":[]},{"session":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Project"}}}},"400":{"description":"`invalid_request`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`no_active_organization`, `forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`project_not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Projects"],"summary":"Update a project","security":[{"organizationKey":[]},{"session":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"description":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Project"}}}},"400":{"description":"`invalid_request`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`no_active_organization`, `forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`project_not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Projects"],"summary":"Delete a project","security":[{"organizationKey":[]},{"session":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Deleted"}}}},"400":{"description":"`invalid_request`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`no_active_organization`, `forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`project_not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/skills":{"get":{"tags":["Skills"],"summary":"List skills","description":"Organization skills and, for a signed-in user, their own. Newest first; page until `nextCursor` is null.","security":[{"organizationKey":[]},{"session":[]}],"parameters":[{"in":"query","name":"cursor","schema":{"type":"string"}},{"in":"query","name":"limit","schema":{"default":20,"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SkillPage"}}}},"400":{"description":"`invalid_request`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`no_active_organization`, `forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Skills"],"summary":"Create a skill","description":"`owner` is `organization` (every member and API key) or `me` (listed and editable by you alone).","security":[{"organizationKey":[]},{"session":[]}],"parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SkillInput"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Skill"}}}},"400":{"description":"`invalid_request`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`no_active_organization`, `forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`skill_name_taken`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/skills/{id}":{"get":{"tags":["Skills"],"summary":"Get a skill","security":[{"organizationKey":[]},{"session":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Skill"}}}},"400":{"description":"`invalid_request`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`no_active_organization`, `forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`skill_not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Skills"],"summary":"Update a skill","security":[{"organizationKey":[]},{"session":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","maxLength":64,"pattern":"^[a-z0-9]+(-[a-z0-9]+)*$"},"description":{"type":"string","minLength":1,"maxLength":1024},"instructions":{"type":"string","minLength":1},"owner":{"default":"organization","type":"string","enum":["organization","me"]}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Skill"}}}},"400":{"description":"`invalid_request`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`no_active_organization`, `forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`skill_not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`skill_name_taken`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Skills"],"summary":"Delete a skill","security":[{"organizationKey":[]},{"session":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Deleted"}}}},"400":{"description":"`invalid_request`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`no_active_organization`, `forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`skill_not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/databases":{"get":{"tags":["Databases"],"summary":"List databases","description":"The organization's databases, newest first; page until `nextCursor` is null.","security":[{"organizationKey":[]},{"session":[]}],"parameters":[{"in":"query","name":"cursor","schema":{"type":"string"}},{"in":"query","name":"limit","schema":{"default":20,"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DatabasePage"}}}},"400":{"description":"`invalid_request`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`no_active_organization`, `forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Databases"],"summary":"Create a database","description":"An empty SQL database owned by the organization. Tables are created in the explorer or with `query`.","security":[{"organizationKey":[]},{"session":[]}],"parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DatabaseInput"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Database"}}}},"400":{"description":"`invalid_request`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`plan_limit_reached`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`no_active_organization`, `forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`database_name_taken`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/databases/{id}":{"get":{"tags":["Databases"],"summary":"Get a database","security":[{"organizationKey":[]},{"session":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Database"}}}},"400":{"description":"`invalid_request`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`no_active_organization`, `forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`database_not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Databases"],"summary":"Update a database","security":[{"organizationKey":[]},{"session":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","maxLength":64,"pattern":"^[a-z0-9]+(-[a-z0-9]+)*$"},"description":{"default":"","type":"string","maxLength":1024}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Database"}}}},"400":{"description":"`invalid_request`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`no_active_organization`, `forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`database_not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`database_name_taken`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Databases"],"summary":"Delete a database","security":[{"organizationKey":[]},{"session":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Deleted"}}}},"400":{"description":"`invalid_request`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`no_active_organization`, `forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`database_not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/databases/{id}/query":{"post":{"tags":["Databases"],"summary":"Run SQL","description":"Runs the statements in order with `?` placeholders bound from `params`, one result per statement. The batch is one transaction: the first failure rolls it all back and answers `query_failed` with SQLite's message and the index of the statement. The rows of a batch may total 16 MiB serialized; past that the batch rolls back and answers `result_too_large` with the bytes read so far, so add a LIMIT or select fewer columns. A statement that spends 30 s of CPU is killed by the platform: the batch rolls back and the route answers 500.","security":[{"organizationKey":[]},{"session":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/QueryInput"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QueryOutput"}}}},"400":{"description":"`invalid_request`, `query_failed`, `result_too_large`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`no_active_organization`, `forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`database_not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/agents":{"get":{"tags":["Agents"],"summary":"List agents","description":"The organization's agents, newest first; page until `nextCursor` is null.","security":[{"organizationKey":[]},{"session":[]}],"parameters":[{"in":"query","name":"cursor","schema":{"type":"string"}},{"in":"query","name":"limit","schema":{"default":20,"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentPage"}}}},"400":{"description":"`invalid_request`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`no_active_organization`, `forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Agents"],"summary":"Create an agent","description":"An agent owned by the organization: every member may chat with it, edit it and delete it.","security":[{"organizationKey":[]},{"session":[]}],"parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentInput"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Agent"}}}},"400":{"description":"`invalid_request`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`plan_limit_reached`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`no_active_organization`, `forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`agent_name_taken`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/agents/{id}":{"get":{"tags":["Agents"],"summary":"Get an agent","security":[{"organizationKey":[]},{"session":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Agent"}}}},"400":{"description":"`invalid_request`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`no_active_organization`, `forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`agent_not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Agents"],"summary":"Update an agent","security":[{"organizationKey":[]},{"session":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","maxLength":64,"pattern":"^[a-z0-9]+(-[a-z0-9]+)*$"},"description":{"type":"string","maxLength":1024},"instructions":{"type":"string"},"provider":{"type":"string","enum":["gateway","workers-ai"]},"model":{"type":"string"},"thinkingLevel":{"type":"string","enum":["off","minimal","low","medium","high","xhigh"]},"apps":{"type":"array","items":{"$ref":"#/components/schemas/AppGrant"}},"skills":{"type":"array","items":{"type":"string"}},"databases":{"type":"array","items":{"type":"string"}},"databaseWrites":{"type":"array","items":{"type":"string"}}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Agent"}}}},"400":{"description":"`invalid_request`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`no_active_organization`, `forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`agent_not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`agent_name_taken`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Agents"],"summary":"Delete an agent","security":[{"organizationKey":[]},{"session":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Deleted"}}}},"400":{"description":"`invalid_request`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`no_active_organization`, `forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`agent_not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/projects/{projectId}/workflows":{"get":{"tags":["Workflows"],"summary":"List a project's workflows","description":"Newest first. Page until `nextCursor` is null.","security":[{"organizationKey":[]},{"session":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string"},"required":true},{"in":"query","name":"cursor","schema":{"type":"string"}},{"in":"query","name":"limit","schema":{"default":20,"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowPage"}}}},"400":{"description":"`invalid_request`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`no_active_organization`, `forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`project_not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Workflows"],"summary":"Create a workflow","description":"The diagram starts as the draft; publish it to make it live.","security":[{"organizationKey":[]},{"session":[]}],"parameters":[{"in":"path","name":"projectId","schema":{"type":"string"},"required":true}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowInput"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Workflow"}}}},"400":{"description":"`invalid_request`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`no_active_organization`, `forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`project_not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/workflows/{id}":{"get":{"tags":["Workflows"],"summary":"Get a workflow","description":"Returns the draft diagram.","security":[{"organizationKey":[]},{"session":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowDetail"}}}},"400":{"description":"`invalid_request`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`no_active_organization`, `forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`workflow_not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Workflows"],"summary":"Update a workflow","description":"Saves the draft. The live version changes only when you publish.","security":[{"organizationKey":[]},{"session":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"description":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"diagram":{"$ref":"#/components/schemas/Diagram"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Workflow"}}}},"400":{"description":"`invalid_request`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`no_active_organization`, `forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`workflow_not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Workflows"],"summary":"Delete a workflow","security":[{"organizationKey":[]},{"session":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Deleted"}}}},"400":{"description":"`invalid_request`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`no_active_organization`, `forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`workflow_not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/workflows/{id}/publish":{"post":{"tags":["Workflows"],"summary":"Publish a workflow","description":"Freezes the draft as the next numbered version, which becomes the live one for scheduled, app event and API runs, and schedules its Trigger's next run. Each App event trigger subscribes in Super Connect first: a subscription it refuses answers `subscription_failed` with its message, and nothing is saved. Publishing past the plan's active app subscriptions answers `plan_limit_reached` before anything is subscribed; triggers with the same connection, trigger and filter share one. An Action that names no connection must find one for every trigger that reaches it: the trigger's own connection when it is the same app's, else the app's only connection. An Agent node must pick one of the organization's agents. A paused workflow's triggers stay off until it resumes.","security":[{"organizationKey":[]},{"session":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowPublishInput"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowVersion"}}}},"400":{"description":"`invalid_request`, `invalid_workflow`, `subscription_failed`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`plan_limit_reached`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`no_active_organization`, `forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`workflow_not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/workflows/{id}/pause":{"post":{"tags":["Workflows"],"summary":"Pause a workflow","description":"Stops its triggers: no scheduled or app event runs start until it resumes. Manual and API runs still work.","security":[{"organizationKey":[]},{"session":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Workflow"}}}},"400":{"description":"`invalid_request`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`no_active_organization`, `forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`workflow_not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/workflows/{id}/resume":{"post":{"tags":["Workflows"],"summary":"Resume a workflow","description":"Turns the live version's triggers back on. Nothing that happened while it was paused runs. Resuming past the plan's active app subscriptions answers `plan_limit_reached`.","security":[{"organizationKey":[]},{"session":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Workflow"}}}},"400":{"description":"`invalid_request`, `subscription_failed`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`plan_limit_reached`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`no_active_organization`, `forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`workflow_not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/workflows/{id}/versions":{"get":{"tags":["Workflows"],"summary":"List a workflow's versions","description":"Newest first, so the first entry is the live version. Page until `nextCursor` is null.","security":[{"organizationKey":[]},{"session":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string"},"required":true},{"in":"query","name":"cursor","schema":{"type":"string"}},{"in":"query","name":"limit","schema":{"default":20,"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowVersionPage"}}}},"400":{"description":"`invalid_request`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`no_active_organization`, `forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`workflow_not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/workflows/{id}/runs":{"post":{"tags":["Workflow runs"],"summary":"Run a workflow","description":"Runs the live version, or the draft with `draft: true`, from one of its triggers with `input` as that trigger's payload. Poll the returned run until its status is `complete`, `errored` or `terminated`.","security":[{"organizationKey":[]},{"session":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowRunInput"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowRun"}}}},"400":{"description":"`invalid_request`, `invalid_workflow`, `trigger_required`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`plan_limit_reached`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`no_active_organization`, `forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`workflow_not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`not_published`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"tags":["Workflow runs"],"summary":"List a workflow's runs","description":"Newest first. Page until `nextCursor` is null.","security":[{"organizationKey":[]},{"session":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string"},"required":true},{"in":"query","name":"cursor","schema":{"type":"string"}},{"in":"query","name":"limit","schema":{"default":20,"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowRunPage"}}}},"400":{"description":"`invalid_request`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`no_active_organization`, `forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`workflow_not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/runs/{id}":{"get":{"tags":["Workflow runs"],"summary":"Get a run","description":"Its status, the state of every node it reached, and the diagram it ran.","security":[{"organizationKey":[]},{"session":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowRun"}}}},"400":{"description":"`invalid_request`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`no_active_organization`, `forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`run_not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/runs/{id}/approvals/{approvalId}":{"post":{"tags":["Workflow runs"],"summary":"Approve or deny an action waiting for approval","description":"Decides an action an agent step asked approval for. Approving runs it; denying resumes the agent with the reason. The run continues either way. Any member of the organization may decide.","security":[{"organizationKey":[]},{"session":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string"},"required":true},{"in":"path","name":"approvalId","schema":{"type":"string"},"required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"decision":{"type":"string","enum":["approve","deny"]},"reason":{"type":"string","maxLength":1000}},"required":["decision"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApprovalDecision"}}}},"400":{"description":"`invalid_request`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`no_active_organization`, `forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`run_not_found`, `approval_not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`approval_not_pending`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/workflows/{id}/events":{"get":{"tags":["Workflow events"],"summary":"List a workflow's app events","description":"The app events that reached the workflow's triggers, newest first, with what each trigger did. Events are kept for 30 days. Page until `nextCursor` is null.","security":[{"organizationKey":[]},{"session":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string"},"required":true},{"in":"query","name":"cursor","schema":{"type":"string"}},{"in":"query","name":"limit","schema":{"default":20,"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppEventPage"}}}},"400":{"description":"`invalid_request`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`no_active_organization`, `forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`workflow_not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/workflows/{id}/events/{eventId}/replay":{"post":{"tags":["Workflow events"],"summary":"Replay an app event","description":"Queues the stored event again for one of the workflow's triggers, which starts a run of the live version. A trigger that already started a run for the event starts nothing new; a trigger that is no longer live records `no_listener`.","security":[{"organizationKey":[]},{"session":[]}],"parameters":[{"in":"path","name":"id","schema":{"type":"string"},"required":true},{"in":"path","name":"eventId","schema":{"type":"string"},"required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"triggerNodeId":{"type":"string"}},"required":["triggerNodeId"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"queued":{"type":"boolean","const":true}},"required":["queued"],"additionalProperties":false}}}},"400":{"description":"`invalid_request`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`no_active_organization`, `forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`event_not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/billing":{"get":{"tags":["Billing"],"summary":"Get the organization's plan","security":[{"organizationKey":[]},{"session":[]}],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Billing"}}}},"401":{"description":"`unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`no_active_organization`, `forbidden`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"schemas":{"ProjectInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"description":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}},"required":["name"]},"SkillInput":{"type":"object","properties":{"name":{"type":"string","maxLength":64,"pattern":"^[a-z0-9]+(-[a-z0-9]+)*$"},"description":{"type":"string","minLength":1,"maxLength":1024},"instructions":{"type":"string","minLength":1},"owner":{"default":"organization","type":"string","enum":["organization","me"]}},"required":["name","description","instructions"]},"DatabaseInput":{"type":"object","properties":{"name":{"type":"string","maxLength":64,"pattern":"^[a-z0-9]+(-[a-z0-9]+)*$"},"description":{"default":"","type":"string","maxLength":1024}},"required":["name"]},"QueryInput":{"type":"object","properties":{"statements":{"minItems":1,"maxItems":100,"type":"array","items":{"$ref":"#/components/schemas/SqlStatement"}}},"required":["statements"]},"SqlStatement":{"type":"object","properties":{"sql":{"type":"string","minLength":1,"maxLength":100000},"params":{"default":[],"maxItems":100,"type":"array","items":{"$ref":"#/components/schemas/SqlValue"}}},"required":["sql"]},"SqlValue":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"null"},{"type":"object","properties":{"blob":{"type":"string"}},"required":["blob"]}],"description":"A cell: text, number, null, or `{ blob }` as base64."},"AgentInput":{"type":"object","properties":{"name":{"type":"string","maxLength":64,"pattern":"^[a-z0-9]+(-[a-z0-9]+)*$"},"description":{"type":"string","maxLength":1024},"instructions":{"type":"string"},"provider":{"type":"string","enum":["gateway","workers-ai"]},"model":{"type":"string"},"thinkingLevel":{"type":"string","enum":["off","minimal","low","medium","high","xhigh"]},"apps":{"type":"array","items":{"$ref":"#/components/schemas/AppGrant"}},"skills":{"type":"array","items":{"type":"string"}},"databases":{"type":"array","items":{"type":"string"}},"databaseWrites":{"type":"array","items":{"type":"string"}}},"required":["name"]},"AppGrant":{"type":"object","properties":{"connectionId":{"type":"string"},"integrationId":{"type":"string"},"actions":{"type":"array","items":{"type":"string"},"description":"`provider__action` refs"},"approvals":{"type":"array","items":{"type":"string"},"description":"The picked refs that wait for approval before running"}},"required":["connectionId","integrationId","actions","approvals"]},"WorkflowInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"description":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"diagram":{"$ref":"#/components/schemas/Diagram"}},"required":["name"]},"Diagram":{"type":"object","properties":{"nodes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"data":{"type":"object","properties":{"type":{"type":"string"},"properties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["type","properties"],"additionalProperties":{}}},"required":["id","data"],"additionalProperties":{}}},"edges":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"source":{"type":"string"},"target":{"type":"string"},"sourceHandle":{"type":["string","null"]}},"required":["id","source","target"],"additionalProperties":{}}}},"required":["nodes","edges"],"additionalProperties":{},"description":"The workflow builder's nodes and edges, plus its layout."},"WorkflowPublishInput":{"default":{},"type":"object","properties":{"timeZone":{"default":"UTC","description":"The IANA time zone the Trigger schedule's dates and times are in.","type":"string"}}},"WorkflowRunInput":{"default":{},"type":"object","properties":{"input":{"default":"","description":"The trigger payload; JSON text is readable as `{{trigger.<path>}}`.","type":"string","maxLength":100000},"draft":{"default":false,"description":"Run the draft instead of the live version.","type":"boolean"},"triggerNodeId":{"description":"The Trigger node to start from. Required when the workflow has several.","type":"string"}}},"Dashboard":{"type":"object","properties":{"activity":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"runs":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["date","runs"],"additionalProperties":false},"description":"Runs started on each of the last seven UTC calendar days, including today."},"approvals":{"type":"array","items":{"type":"object","properties":{"runId":{"type":"string"},"workflowId":{"type":"string"},"workflowName":{"type":"string"},"tool":{"type":"string"},"expiresAt":{"type":"string"}},"required":["runId","workflowId","workflowName","tool","expiresAt"],"additionalProperties":false}},"failures":{"type":"array","items":{"type":"object","properties":{"runId":{"type":"string"},"workflowId":{"type":"string"},"workflowName":{"type":"string"},"step":{"type":"string"},"error":{"type":["string","null"]},"at":{"type":"string"}},"required":["runId","workflowId","workflowName","step","error","at"],"additionalProperties":false}},"triggers":{"type":"array","items":{"type":"object","properties":{"triggerNodeId":{"type":"string"},"connectionId":{"type":"string"},"status":{"type":"string","enum":["active","error","stopped"]},"error":{"type":["string","null"]},"health":{"description":"The connection's health; null when it is disconnected.","type":["string","null"]},"workflowId":{"type":"string"},"workflowName":{"type":"string"}},"required":["triggerNodeId","connectionId","status","error","health","workflowId","workflowName"],"additionalProperties":false,"description":"Only app event triggers whose subscription or connection is not healthy."}},"runs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"workflowId":{"type":"string"},"workflowName":{"type":"string"},"projectId":{"type":"string"},"projectName":{"type":"string"},"trigger":{"type":"string","enum":["manual","api","schedule","event"]},"status":{"type":"string","enum":["queued","running","paused","errored","terminated","complete","waiting","waitingForPause","rollingBack","unknown"]},"createdAt":{"type":"string"}},"required":["id","workflowId","workflowName","projectId","projectName","trigger","status","createdAt"],"additionalProperties":false}},"counts":{"type":"object","properties":{"projects":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"workflows":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"published":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"connections":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"runsThisWeek":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["projects","workflows","published","connections","runsThisWeek"],"additionalProperties":false}},"required":["activity","approvals","failures","triggers","runs","counts"],"additionalProperties":false},"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"ProjectPage":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Project"}},"nextCursor":{"type":["string","null"]}},"required":["data","nextCursor"],"additionalProperties":false},"Project":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"createdBy":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","description","createdBy","createdAt","updatedAt"],"additionalProperties":false},"Deleted":{"type":"object","properties":{"deleted":{"type":"boolean","const":true}},"required":["deleted"],"additionalProperties":false},"SkillPage":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Skill"}},"nextCursor":{"type":["string","null"]}},"required":["data","nextCursor"],"additionalProperties":false},"Skill":{"type":"object","properties":{"id":{"type":"string"},"userId":{"type":["string","null"]},"name":{"type":"string"},"description":{"type":"string"},"instructions":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","userId","name","description","instructions","createdAt","updatedAt"],"additionalProperties":false},"DatabasePage":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Database"}},"nextCursor":{"type":["string","null"]}},"required":["data","nextCursor"],"additionalProperties":false},"Database":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","description","createdAt","updatedAt"],"additionalProperties":false},"QueryOutput":{"type":"object","properties":{"results":{"type":"array","items":{"$ref":"#/components/schemas/QueryResult"}}},"required":["results"],"additionalProperties":false},"QueryResult":{"type":"object","properties":{"columns":{"type":"array","items":{"type":"string"}},"rows":{"type":"array","items":{"type":"array","items":{"$ref":"#/components/schemas/SqlValueOutput"}}},"meta":{"type":"object","properties":{"rowsRead":{"type":"number"},"rowsWritten":{"type":"number"}},"required":["rowsRead","rowsWritten"],"additionalProperties":false}},"required":["columns","rows","meta"],"additionalProperties":false},"AgentPage":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Agent"}},"nextCursor":{"type":["string","null"]}},"required":["data","nextCursor"],"additionalProperties":false},"Agent":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"instructions":{"type":"string"},"provider":{"type":"string","enum":["gateway","workers-ai"]},"model":{"type":"string","description":"Empty runs the provider's default model"},"thinkingLevel":{"type":"string","enum":["off","minimal","low","medium","high","xhigh"]},"apps":{"type":"array","items":{"$ref":"#/components/schemas/AppGrantOutput"},"description":"Per app connection, the actions the agent may call there"},"skills":{"type":"array","items":{"type":"string"},"description":"Skill ids mounted on the agent"},"databases":{"type":"array","items":{"type":"string"},"description":"Database ids the agent may query"},"databaseWrites":{"type":"array","items":{"type":"string"},"description":"The picked databases the agent may also write to"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","description","instructions","provider","model","thinkingLevel","apps","skills","databases","databaseWrites","createdAt","updatedAt"],"additionalProperties":false},"WorkflowPage":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/WorkflowSummary"}},"nextCursor":{"type":["string","null"]}},"required":["data","nextCursor"],"additionalProperties":false},"WorkflowSummary":{"type":"object","properties":{"id":{"type":"string"},"projectId":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"publishedVersion":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"The live version's number; null until the first publish."},"pausedAt":{"description":"When the workflow was paused; its triggers don't fire until it resumes.","type":["string","null"]},"createdBy":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","projectId","name","description","publishedVersion","pausedAt","createdBy","createdAt","updatedAt"],"additionalProperties":false},"Workflow":{"type":"object","properties":{"id":{"type":"string"},"projectId":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"publishedVersion":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"The live version's number; null until the first publish."},"pausedAt":{"description":"When the workflow was paused; its triggers don't fire until it resumes.","type":["string","null"]},"createdBy":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"diagram":{"$ref":"#/components/schemas/Diagram"}},"required":["id","projectId","name","description","publishedVersion","pausedAt","createdBy","createdAt","updatedAt","diagram"],"additionalProperties":false},"WorkflowDetail":{"type":"object","properties":{"id":{"type":"string"},"projectId":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"publishedVersion":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"The live version's number; null until the first publish."},"pausedAt":{"description":"When the workflow was paused; its triggers don't fire until it resumes.","type":["string","null"]},"createdBy":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"diagram":{"$ref":"#/components/schemas/Diagram"},"nextRunAt":{"description":"When the live version's Trigger schedule runs next; null when it doesn't.","type":["string","null"]}},"required":["id","projectId","name","description","publishedVersion","pausedAt","createdBy","createdAt","updatedAt","diagram","nextRunAt"],"additionalProperties":false},"WorkflowVersion":{"type":"object","properties":{"id":{"type":"string"},"workflowId":{"type":"string"},"number":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"timeZone":{"type":"string"},"publishedBy":{"type":["string","null"]},"publishedAt":{"type":"string"}},"required":["id","workflowId","number","timeZone","publishedBy","publishedAt"],"additionalProperties":false},"WorkflowVersionPage":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/WorkflowVersion"}},"nextCursor":{"type":["string","null"]}},"required":["data","nextCursor"],"additionalProperties":false},"WorkflowRun":{"type":"object","properties":{"id":{"type":"string"},"workflowId":{"type":"string"},"version":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"The published version it ran; null for a run of the draft."},"trigger":{"type":"string","enum":["manual","api","schedule","event"]},"triggerNodeId":{"description":"The Trigger node that started the run; null for older runs.","type":["string","null"]},"status":{"type":"string","enum":["queued","running","paused","errored","terminated","complete","waiting","waitingForPause","rollingBack","unknown"]},"createdBy":{"type":["string","null"]},"createdAt":{"type":"string"},"input":{"type":"string"},"reply":{"description":"The text of the nodes the run ended on.","type":["string","null"]},"error":{"type":["string","null"]},"steps":{"type":"array","items":{"$ref":"#/components/schemas/WorkflowRunStep"},"description":"The nodes the run reached, in the order they started."},"diagram":{"description":"The diagram as it ran.","$ref":"#/components/schemas/Diagram"}},"required":["id","workflowId","version","trigger","triggerNodeId","status","createdBy","createdAt","input","reply","error","steps","diagram"],"additionalProperties":false},"WorkflowRunStep":{"type":"object","properties":{"nodeId":{"type":"string"},"status":{"type":"string","enum":["running","waiting","done","error","skipped"]},"via":{"type":"array","items":{"type":"string"},"description":"The edges that fired into this node."},"input":{"type":["string","null"]},"output":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},{"type":"null"}],"description":"Each output field, as `{{nodes.<nodeId>.<field>}}` reads it."},"error":{"type":["string","null"]},"ms":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"startedAt":{"type":"string"}},"required":["nodeId","status","via","input","output","error","ms","startedAt"],"additionalProperties":false},"WorkflowRunPage":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/WorkflowRunSummary"}},"nextCursor":{"type":["string","null"]}},"required":["data","nextCursor"],"additionalProperties":false},"WorkflowRunSummary":{"type":"object","properties":{"id":{"type":"string"},"workflowId":{"type":"string"},"version":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"The published version it ran; null for a run of the draft."},"trigger":{"type":"string","enum":["manual","api","schedule","event"]},"triggerNodeId":{"description":"The Trigger node that started the run; null for older runs.","type":["string","null"]},"status":{"type":"string","enum":["queued","running","paused","errored","terminated","complete","waiting","waitingForPause","rollingBack","unknown"]},"createdBy":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","workflowId","version","trigger","triggerNodeId","status","createdBy","createdAt"],"additionalProperties":false},"ApprovalDecision":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["pending","approved","denied","expired"]},"tool":{"type":"string"},"reason":{"type":["string","null"]},"result":{}},"required":["id","status","tool","reason","result"],"additionalProperties":false},"AppEventPage":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/AppEvent"}},"nextCursor":{"type":["string","null"]}},"required":["data","nextCursor"],"additionalProperties":false},"AppEvent":{"type":"object","properties":{"id":{"type":"string"},"triggerId":{"type":"string","description":"The Super Connect trigger, like `slack/message-received`."},"preview":{"type":"string","description":"The first 300 characters of the payload."},"firedAt":{"type":"string"},"receivedAt":{"type":"string"},"outcomes":{"type":"array","items":{"type":"object","properties":{"triggerNodeId":{"type":"string"},"outcome":{"type":"string","enum":["started","limit_reached","no_listener","error","dead"]},"runId":{"type":["string","null"]},"error":{"type":["string","null"]},"at":{"type":"string"}},"required":["triggerNodeId","outcome","runId","error","at"],"additionalProperties":false},"description":"What each of the workflow's triggers did with the event."}},"required":["id","triggerId","preview","firedAt","receivedAt","outcomes"],"additionalProperties":false},"Billing":{"type":"object","properties":{"plan":{"type":"string"},"label":{"type":"string"},"complimentary":{"type":"boolean","description":"Whether the plan was granted for free, instead of subscribed to."},"limits":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"}},"usage":{"type":"object","properties":{"runs":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"emails":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"aiSpend":{"type":"number","description":"Dollars, estimated at list price"},"since":{"type":"string"}},"required":["runs","emails","aiSpend","since"],"additionalProperties":false,"description":"Runs started, notification emails sent and AI spent on the platform's key this calendar month (UTC)."},"credit":{"description":"Dollars of AI credit left, spent on the platform's key once the month's allowance is used. Below zero when a turn overshot it; null when the organization was never granted any.","type":["number","null"]},"appSubscriptions":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Active app subscriptions: the distinct Super Connect subscriptions the organization's live App event triggers use."},"subscription":{"anyOf":[{"type":"object","properties":{"status":{"type":"string"},"periodEnd":{"type":["string","null"]},"cancelAt":{"type":["string","null"]}},"required":["status","periodEnd","cancelAt"],"additionalProperties":false},{"type":"null"}]}},"required":["plan","label","complimentary","limits","usage","credit","appSubscriptions","subscription"],"additionalProperties":false},"SqlValueOutput":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"null"},{"type":"object","properties":{"blob":{"type":"string"}},"required":["blob"],"additionalProperties":false}],"description":"A cell: text, number, null, or `{ blob }` as base64."},"AppGrantOutput":{"type":"object","properties":{"connectionId":{"type":"string"},"integrationId":{"type":"string"},"actions":{"type":"array","items":{"type":"string"},"description":"`provider__action` refs"},"approvals":{"type":"array","items":{"type":"string"},"description":"The picked refs that wait for approval before running"}},"required":["connectionId","integrationId","actions","approvals"],"additionalProperties":false}},"securitySchemes":{"organizationKey":{"type":"http","scheme":"bearer","description":"An organization key, `sf_…`, created on the API keys page."},"session":{"type":"apiKey","in":"cookie","name":"__Secure-better-auth.session_token","description":"A signed-in dashboard session cookie."}}}}