{"openapi":"3.0.3","info":{"title":"Duvo Public API","description":"Public API for programmatic access to Duvo. Authenticate with API keys created in the Duvo dashboard.","version":"1.0.0"},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"API key authentication. Get your API key from the Duvo dashboard."}},"schemas":{}},"paths":{"/v1/mcp":{"post":{"tags":["MCP"],"description":"MCP JSON-RPC endpoint (Streamable HTTP transport). Exposes every public API route as an LLM-callable tool.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response"}}},"get":{"tags":["MCP"],"description":"MCP Streamable HTTP: GET is not supported (no server-initiated streaming). Use POST.","responses":{"200":{"description":"Default Response"}}}},"/v1/revisions":{"post":{"tags":["Revisions"],"description":"Deprecated: use POST /v1/agents/{agent_id}/revisions instead. Scheduled for removal on 2026-05-22.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"agent_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$","description":"Agent ID"},"name":{"type":"string","minLength":1,"description":"Build name"},"config":{"description":"Build configuration; falls back to the agent default when omitted.","type":"object","properties":{"version":{"type":"string","enum":["v2"],"description":"Schema version discriminator — must be \"v2\" for the current schema"},"data":{"type":"object","properties":{"models":{"type":"object","properties":{"agent":{"type":"object","properties":{"model":{"type":"string","enum":["claude-sonnet-4-6","claude-sonnet-4-6[1m]","claude-opus-4-6","claude-opus-4-6[1m]","claude-opus-4-7","claude-opus-4-7[1m]","d1-max","duvo-1-max","duvo-1-max-sonnet-1m","duvo-1-max-sonnet-4.5","duvo-1-max-sonnet-4.5-1m","duvo-1-max-opus","duvo-1-max-opus-4.5","gpt-4.1","gpt-4o","gpt-4o-mini","gpt-5","gpt-5.1","claude-sonnet-4-20250514","claude-sonnet-4-20250514[1m]","claude-sonnet-4-5-20250929","claude-sonnet-4-5-20250929[1m]","claude-opus-4-1-20250805","claude-opus-4-5-20251101"],"description":"Claude model identifier used for the primary agent loop"}},"required":["model"],"description":"Primary Claude agent model configuration"},"browsing":{"type":"object","properties":{"provider":{"type":"string","enum":["google","anthropic"],"description":"Provider backing the browsing/computer-use model"},"model":{"type":"string","enum":["gemini-2.5-pro","gemini-2.5-flash","gemini-3-pro-preview","claude-haiku-4-5","claude-sonnet-4-5","claude-opus-4-1"],"description":"Model identifier for the browsing provider"}},"required":["provider","model"],"description":"Browsing/computer-use model configuration"}},"required":["agent","browsing"],"description":"Model configuration for each capability the agent uses"},"input":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["system","user","assistant"]},"content":{"anyOf":[{"type":"string"},{"type":"array","items":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"]},"text":{"type":"string"}},"required":["type","text"]},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"]},"detail":{"nullable":true,"type":"string","enum":["low","high","auto"]},"file_id":{"nullable":true,"type":"string"},"url":{"nullable":true,"type":"string"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"]},"file_id":{"type":"string"}},"required":["type","file_id"]}]}}]},"type":{"nullable":true,"type":"string","enum":["message"]}},"required":["role","content"]}}],"description":"Initial agent instructions — either a single system prompt string or a list of structured messages"},"files":{"default":[],"description":"IDs of team files that should be available to the agent","nullable":true,"type":"array","items":{"type":"string"}},"skills":{"default":[],"description":"IDs of skills (team or system) that should be available to the agent","nullable":true,"type":"array","items":{"type":"string"}},"plugins":{"default":[],"description":"Plugins to load — either a built-in plugin name (e.g. \"code-review\") or a GitHub URL (e.g. \"https://github.com/owner/repo\")","nullable":true,"type":"array","items":{"type":"string"}},"subAgents":{"default":[],"description":"IDs of other assignments (agents in the same team) to expose to this assignment as Claude Code subagents. Each sub-assignment runs with its own SOP and connections; the parent can delegate to them via the Agent tool.","nullable":true,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"options":{"description":"Optional runtime options controlling how the agent executes","type":"object","properties":{"browserProvider":{"description":"Browser infrastructure provider","type":"string","enum":["browserbase","browser-use"]},"evaluationSchemaId":{"description":"ID of the evaluation schema to apply to runs of this agent","type":"string"},"benchmarkExpectedOutcomes":{"description":"Expected outcomes used when running benchmark scenarios","type":"array","items":{"type":"object","properties":{"description":{"type":"string","description":"Human-readable description of the expected outcome"},"criteria":{"type":"string","description":"Pass/fail criteria used to evaluate the outcome"}},"required":["description","criteria"]}}},"additionalProperties":{}}},"required":["models","input"],"description":"Agent configuration payload"}},"required":["version","data"]}},"required":["agent_id","name"]}}}},"deprecated":true,"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"build":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"copilot_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"agent_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"name":{"type":"string"},"revision_name":{"nullable":true,"type":"string"},"revision_description":{"nullable":true,"type":"string"},"config":{"nullable":true,"anyOf":[{"type":"object","properties":{"version":{"type":"string","enum":["v1"]},"data":{"type":"object","properties":{"model":{"type":"string"},"temperature":{"nullable":true,"type":"number","minimum":0,"maximum":2},"max_output_tokens":{"nullable":true,"type":"number","minimum":0,"exclusiveMinimum":true},"top_p":{"nullable":true,"type":"number","minimum":0,"maximum":1},"store":{"nullable":true,"type":"boolean"},"tools":{},"input":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["system","user","assistant"]},"content":{"anyOf":[{"type":"string"},{"type":"array","items":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"]},"text":{"type":"string"}},"required":["type","text"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"]},"detail":{"nullable":true,"type":"string","enum":["low","high","auto"]},"file_id":{"nullable":true,"type":"string"},"url":{"nullable":true,"type":"string"}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"]},"file_id":{"type":"string"}},"required":["type","file_id"],"additionalProperties":false}]}}]},"type":{"nullable":true,"type":"string","enum":["message"]}},"required":["role","content"],"additionalProperties":false}}]},"text":{"nullable":true,"type":"object","properties":{"format":{"nullable":true,"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"]}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"]}},"required":["type"],"additionalProperties":false}]}},"additionalProperties":false},"files":{"default":[],"nullable":true,"type":"array","items":{"type":"string"}},"skills":{"default":[],"nullable":true,"type":"array","items":{"type":"string"}}},"required":["model","tools","input","files","skills"],"additionalProperties":false}},"required":["version","data"],"additionalProperties":false},{"type":"object","properties":{"version":{"type":"string","enum":["v2"],"description":"Schema version discriminator — must be \"v2\" for the current schema"},"data":{"type":"object","properties":{"models":{"type":"object","properties":{"agent":{"type":"object","properties":{"model":{"type":"string","enum":["claude-sonnet-4-6","claude-sonnet-4-6[1m]","claude-opus-4-6","claude-opus-4-6[1m]","claude-opus-4-7","claude-opus-4-7[1m]","d1-max","duvo-1-max","duvo-1-max-sonnet-1m","duvo-1-max-sonnet-4.5","duvo-1-max-sonnet-4.5-1m","duvo-1-max-opus","duvo-1-max-opus-4.5","gpt-4.1","gpt-4o","gpt-4o-mini","gpt-5","gpt-5.1","claude-sonnet-4-20250514","claude-sonnet-4-20250514[1m]","claude-sonnet-4-5-20250929","claude-sonnet-4-5-20250929[1m]","claude-opus-4-1-20250805","claude-opus-4-5-20251101"],"description":"Claude model identifier used for the primary agent loop"}},"required":["model"],"additionalProperties":false,"description":"Primary Claude agent model configuration"},"browsing":{"type":"object","properties":{"provider":{"type":"string","enum":["google","anthropic"],"description":"Provider backing the browsing/computer-use model"},"model":{"type":"string","enum":["gemini-2.5-pro","gemini-2.5-flash","gemini-3-pro-preview","claude-haiku-4-5","claude-sonnet-4-5","claude-opus-4-1"],"description":"Model identifier for the browsing provider"}},"required":["provider","model"],"additionalProperties":false,"description":"Browsing/computer-use model configuration"}},"required":["agent","browsing"],"additionalProperties":false,"description":"Model configuration for each capability the agent uses"},"input":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["system","user","assistant"]},"content":{"anyOf":[{"type":"string"},{"type":"array","items":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"]},"text":{"type":"string"}},"required":["type","text"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"]},"detail":{"nullable":true,"type":"string","enum":["low","high","auto"]},"file_id":{"nullable":true,"type":"string"},"url":{"nullable":true,"type":"string"}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"]},"file_id":{"type":"string"}},"required":["type","file_id"],"additionalProperties":false}]}}]},"type":{"nullable":true,"type":"string","enum":["message"]}},"required":["role","content"],"additionalProperties":false}}],"description":"Initial agent instructions — either a single system prompt string or a list of structured messages"},"files":{"default":[],"description":"IDs of team files that should be available to the agent","nullable":true,"type":"array","items":{"type":"string"}},"skills":{"default":[],"description":"IDs of skills (team or system) that should be available to the agent","nullable":true,"type":"array","items":{"type":"string"}},"plugins":{"default":[],"description":"Plugins to load — either a built-in plugin name (e.g. \"code-review\") or a GitHub URL (e.g. \"https://github.com/owner/repo\")","nullable":true,"type":"array","items":{"type":"string"}},"subAgents":{"default":[],"description":"IDs of other assignments (agents in the same team) to expose to this assignment as Claude Code subagents. Each sub-assignment runs with its own SOP and connections; the parent can delegate to them via the Agent tool.","nullable":true,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"options":{"description":"Optional runtime options controlling how the agent executes","type":"object","properties":{"browserProvider":{"description":"Browser infrastructure provider","type":"string","enum":["browserbase","browser-use"]},"evaluationSchemaId":{"description":"ID of the evaluation schema to apply to runs of this agent","type":"string"},"benchmarkExpectedOutcomes":{"description":"Expected outcomes used when running benchmark scenarios","type":"array","items":{"type":"object","properties":{"description":{"type":"string","description":"Human-readable description of the expected outcome"},"criteria":{"type":"string","description":"Pass/fail criteria used to evaluate the outcome"}},"required":["description","criteria"],"additionalProperties":false}}},"additionalProperties":{}}},"required":["models","input","files","skills","plugins","subAgents"],"additionalProperties":false,"description":"Agent configuration payload"}},"required":["version","data"],"additionalProperties":false}]},"status":{"nullable":true,"type":"string"},"revision_number":{"nullable":true,"type":"number"},"parent_build_id":{"nullable":true,"type":"string"},"created_by":{"nullable":true,"type":"string"},"created_by_name":{"nullable":true,"type":"string"},"created_at":{"nullable":true,"type":"string"},"updated_at":{"nullable":true,"type":"string"},"schedules":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"build_id":{"type":"string"},"agent_id":{"type":"string"},"user_id":{"type":"string"},"enabled":{"type":"boolean"},"frequency":{"type":"string","enum":["every_5_minutes","every_15_minutes","hourly","daily","workday","weekly","monthly","custom"]},"time":{"nullable":true,"type":"string"},"timezone":{"type":"string"},"day":{"nullable":true,"type":"string"},"day_of_month":{"nullable":true,"type":"number"},"cron":{"nullable":true,"type":"string"},"source":{"nullable":true,"type":"string"},"task":{"nullable":true,"type":"string"},"recurring":{"nullable":true,"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"user_name":{"nullable":true,"type":"string"},"user_email":{"nullable":true,"type":"string"}},"required":["id","build_id","agent_id","user_id","enabled","frequency","time","timezone","day","day_of_month","cron","source","task","recurring","created_at","updated_at"],"additionalProperties":false}}},"required":["id","copilot_id","agent_id","name","config","status","revision_number","parent_build_id","created_by","created_at","updated_at"],"additionalProperties":false},"agent":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"}},"required":["id"],"additionalProperties":false}},"required":["build","agent"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/revisions/{build_id}":{"get":{"tags":["Revisions"],"description":"Deprecated: use GET /v1/agents/{agent_id}/revisions/{build_id} instead. Scheduled for removal on 2026-05-22.","parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"path","name":"build_id","required":true,"description":"Build ID"}],"deprecated":true,"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"build":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"copilot_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"agent_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"name":{"type":"string"},"revision_name":{"nullable":true,"type":"string"},"revision_description":{"nullable":true,"type":"string"},"config":{"nullable":true,"anyOf":[{"type":"object","properties":{"version":{"type":"string","enum":["v1"]},"data":{"type":"object","properties":{"model":{"type":"string"},"temperature":{"nullable":true,"type":"number","minimum":0,"maximum":2},"max_output_tokens":{"nullable":true,"type":"number","minimum":0,"exclusiveMinimum":true},"top_p":{"nullable":true,"type":"number","minimum":0,"maximum":1},"store":{"nullable":true,"type":"boolean"},"tools":{},"input":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["system","user","assistant"]},"content":{"anyOf":[{"type":"string"},{"type":"array","items":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"]},"text":{"type":"string"}},"required":["type","text"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"]},"detail":{"nullable":true,"type":"string","enum":["low","high","auto"]},"file_id":{"nullable":true,"type":"string"},"url":{"nullable":true,"type":"string"}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"]},"file_id":{"type":"string"}},"required":["type","file_id"],"additionalProperties":false}]}}]},"type":{"nullable":true,"type":"string","enum":["message"]}},"required":["role","content"],"additionalProperties":false}}]},"text":{"nullable":true,"type":"object","properties":{"format":{"nullable":true,"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"]}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"]}},"required":["type"],"additionalProperties":false}]}},"additionalProperties":false},"files":{"default":[],"nullable":true,"type":"array","items":{"type":"string"}},"skills":{"default":[],"nullable":true,"type":"array","items":{"type":"string"}}},"required":["model","tools","input","files","skills"],"additionalProperties":false}},"required":["version","data"],"additionalProperties":false},{"type":"object","properties":{"version":{"type":"string","enum":["v2"],"description":"Schema version discriminator — must be \"v2\" for the current schema"},"data":{"type":"object","properties":{"models":{"type":"object","properties":{"agent":{"type":"object","properties":{"model":{"type":"string","enum":["claude-sonnet-4-6","claude-sonnet-4-6[1m]","claude-opus-4-6","claude-opus-4-6[1m]","claude-opus-4-7","claude-opus-4-7[1m]","d1-max","duvo-1-max","duvo-1-max-sonnet-1m","duvo-1-max-sonnet-4.5","duvo-1-max-sonnet-4.5-1m","duvo-1-max-opus","duvo-1-max-opus-4.5","gpt-4.1","gpt-4o","gpt-4o-mini","gpt-5","gpt-5.1","claude-sonnet-4-20250514","claude-sonnet-4-20250514[1m]","claude-sonnet-4-5-20250929","claude-sonnet-4-5-20250929[1m]","claude-opus-4-1-20250805","claude-opus-4-5-20251101"],"description":"Claude model identifier used for the primary agent loop"}},"required":["model"],"additionalProperties":false,"description":"Primary Claude agent model configuration"},"browsing":{"type":"object","properties":{"provider":{"type":"string","enum":["google","anthropic"],"description":"Provider backing the browsing/computer-use model"},"model":{"type":"string","enum":["gemini-2.5-pro","gemini-2.5-flash","gemini-3-pro-preview","claude-haiku-4-5","claude-sonnet-4-5","claude-opus-4-1"],"description":"Model identifier for the browsing provider"}},"required":["provider","model"],"additionalProperties":false,"description":"Browsing/computer-use model configuration"}},"required":["agent","browsing"],"additionalProperties":false,"description":"Model configuration for each capability the agent uses"},"input":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["system","user","assistant"]},"content":{"anyOf":[{"type":"string"},{"type":"array","items":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"]},"text":{"type":"string"}},"required":["type","text"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"]},"detail":{"nullable":true,"type":"string","enum":["low","high","auto"]},"file_id":{"nullable":true,"type":"string"},"url":{"nullable":true,"type":"string"}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"]},"file_id":{"type":"string"}},"required":["type","file_id"],"additionalProperties":false}]}}]},"type":{"nullable":true,"type":"string","enum":["message"]}},"required":["role","content"],"additionalProperties":false}}],"description":"Initial agent instructions — either a single system prompt string or a list of structured messages"},"files":{"default":[],"description":"IDs of team files that should be available to the agent","nullable":true,"type":"array","items":{"type":"string"}},"skills":{"default":[],"description":"IDs of skills (team or system) that should be available to the agent","nullable":true,"type":"array","items":{"type":"string"}},"plugins":{"default":[],"description":"Plugins to load — either a built-in plugin name (e.g. \"code-review\") or a GitHub URL (e.g. \"https://github.com/owner/repo\")","nullable":true,"type":"array","items":{"type":"string"}},"subAgents":{"default":[],"description":"IDs of other assignments (agents in the same team) to expose to this assignment as Claude Code subagents. Each sub-assignment runs with its own SOP and connections; the parent can delegate to them via the Agent tool.","nullable":true,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"options":{"description":"Optional runtime options controlling how the agent executes","type":"object","properties":{"browserProvider":{"description":"Browser infrastructure provider","type":"string","enum":["browserbase","browser-use"]},"evaluationSchemaId":{"description":"ID of the evaluation schema to apply to runs of this agent","type":"string"},"benchmarkExpectedOutcomes":{"description":"Expected outcomes used when running benchmark scenarios","type":"array","items":{"type":"object","properties":{"description":{"type":"string","description":"Human-readable description of the expected outcome"},"criteria":{"type":"string","description":"Pass/fail criteria used to evaluate the outcome"}},"required":["description","criteria"],"additionalProperties":false}}},"additionalProperties":{}}},"required":["models","input","files","skills","plugins","subAgents"],"additionalProperties":false,"description":"Agent configuration payload"}},"required":["version","data"],"additionalProperties":false}]},"status":{"nullable":true,"type":"string"},"revision_number":{"nullable":true,"type":"number"},"parent_build_id":{"nullable":true,"type":"string"},"created_by":{"nullable":true,"type":"string"},"created_by_name":{"nullable":true,"type":"string"},"created_at":{"nullable":true,"type":"string"},"updated_at":{"nullable":true,"type":"string"},"schedules":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"build_id":{"type":"string"},"agent_id":{"type":"string"},"user_id":{"type":"string"},"enabled":{"type":"boolean"},"frequency":{"type":"string","enum":["every_5_minutes","every_15_minutes","hourly","daily","workday","weekly","monthly","custom"]},"time":{"nullable":true,"type":"string"},"timezone":{"type":"string"},"day":{"nullable":true,"type":"string"},"day_of_month":{"nullable":true,"type":"number"},"cron":{"nullable":true,"type":"string"},"source":{"nullable":true,"type":"string"},"task":{"nullable":true,"type":"string"},"recurring":{"nullable":true,"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"user_name":{"nullable":true,"type":"string"},"user_email":{"nullable":true,"type":"string"}},"required":["id","build_id","agent_id","user_id","enabled","frequency","time","timezone","day","day_of_month","cron","source","task","recurring","created_at","updated_at"],"additionalProperties":false}}},"required":["id","copilot_id","agent_id","name","config","status","revision_number","parent_build_id","created_by","created_at","updated_at"],"additionalProperties":false}},"required":["build"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}},"patch":{"operationId":"updateRevision","tags":["Revisions"],"description":"Update a revision's configuration, name, description, or handover targets. Returns the updated revision.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"config":{"description":"Build configuration object","type":"object","additionalProperties":{}},"handoverTargetIds":{"description":"Agent IDs that this agent can hand over work to","type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"}},"revision_name":{"description":"Optional user-defined name for this revision. Pass null to clear.","nullable":true,"type":"string","minLength":1,"maxLength":80},"revision_description":{"description":"Optional user-defined description for this revision. Pass null to clear.","nullable":true,"type":"string","maxLength":500}}}}}},"parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"path","name":"build_id","required":true,"description":"The build's unique identifier"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"build":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"copilot_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"agent_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"name":{"type":"string"},"revision_name":{"nullable":true,"type":"string"},"revision_description":{"nullable":true,"type":"string"},"config":{"nullable":true,"anyOf":[{"type":"object","properties":{"version":{"type":"string","enum":["v1"]},"data":{"type":"object","properties":{"model":{"type":"string"},"temperature":{"nullable":true,"type":"number","minimum":0,"maximum":2},"max_output_tokens":{"nullable":true,"type":"number","minimum":0,"exclusiveMinimum":true},"top_p":{"nullable":true,"type":"number","minimum":0,"maximum":1},"store":{"nullable":true,"type":"boolean"},"tools":{},"input":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["system","user","assistant"]},"content":{"anyOf":[{"type":"string"},{"type":"array","items":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"]},"text":{"type":"string"}},"required":["type","text"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"]},"detail":{"nullable":true,"type":"string","enum":["low","high","auto"]},"file_id":{"nullable":true,"type":"string"},"url":{"nullable":true,"type":"string"}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"]},"file_id":{"type":"string"}},"required":["type","file_id"],"additionalProperties":false}]}}]},"type":{"nullable":true,"type":"string","enum":["message"]}},"required":["role","content"],"additionalProperties":false}}]},"text":{"nullable":true,"type":"object","properties":{"format":{"nullable":true,"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"]}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"]}},"required":["type"],"additionalProperties":false}]}},"additionalProperties":false},"files":{"default":[],"nullable":true,"type":"array","items":{"type":"string"}},"skills":{"default":[],"nullable":true,"type":"array","items":{"type":"string"}}},"required":["model","tools","input","files","skills"],"additionalProperties":false}},"required":["version","data"],"additionalProperties":false},{"type":"object","properties":{"version":{"type":"string","enum":["v2"],"description":"Schema version discriminator — must be \"v2\" for the current schema"},"data":{"type":"object","properties":{"models":{"type":"object","properties":{"agent":{"type":"object","properties":{"model":{"type":"string","enum":["claude-sonnet-4-6","claude-sonnet-4-6[1m]","claude-opus-4-6","claude-opus-4-6[1m]","claude-opus-4-7","claude-opus-4-7[1m]","d1-max","duvo-1-max","duvo-1-max-sonnet-1m","duvo-1-max-sonnet-4.5","duvo-1-max-sonnet-4.5-1m","duvo-1-max-opus","duvo-1-max-opus-4.5","gpt-4.1","gpt-4o","gpt-4o-mini","gpt-5","gpt-5.1","claude-sonnet-4-20250514","claude-sonnet-4-20250514[1m]","claude-sonnet-4-5-20250929","claude-sonnet-4-5-20250929[1m]","claude-opus-4-1-20250805","claude-opus-4-5-20251101"],"description":"Claude model identifier used for the primary agent loop"}},"required":["model"],"additionalProperties":false,"description":"Primary Claude agent model configuration"},"browsing":{"type":"object","properties":{"provider":{"type":"string","enum":["google","anthropic"],"description":"Provider backing the browsing/computer-use model"},"model":{"type":"string","enum":["gemini-2.5-pro","gemini-2.5-flash","gemini-3-pro-preview","claude-haiku-4-5","claude-sonnet-4-5","claude-opus-4-1"],"description":"Model identifier for the browsing provider"}},"required":["provider","model"],"additionalProperties":false,"description":"Browsing/computer-use model configuration"}},"required":["agent","browsing"],"additionalProperties":false,"description":"Model configuration for each capability the agent uses"},"input":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["system","user","assistant"]},"content":{"anyOf":[{"type":"string"},{"type":"array","items":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"]},"text":{"type":"string"}},"required":["type","text"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"]},"detail":{"nullable":true,"type":"string","enum":["low","high","auto"]},"file_id":{"nullable":true,"type":"string"},"url":{"nullable":true,"type":"string"}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"]},"file_id":{"type":"string"}},"required":["type","file_id"],"additionalProperties":false}]}}]},"type":{"nullable":true,"type":"string","enum":["message"]}},"required":["role","content"],"additionalProperties":false}}],"description":"Initial agent instructions — either a single system prompt string or a list of structured messages"},"files":{"default":[],"description":"IDs of team files that should be available to the agent","nullable":true,"type":"array","items":{"type":"string"}},"skills":{"default":[],"description":"IDs of skills (team or system) that should be available to the agent","nullable":true,"type":"array","items":{"type":"string"}},"plugins":{"default":[],"description":"Plugins to load — either a built-in plugin name (e.g. \"code-review\") or a GitHub URL (e.g. \"https://github.com/owner/repo\")","nullable":true,"type":"array","items":{"type":"string"}},"subAgents":{"default":[],"description":"IDs of other assignments (agents in the same team) to expose to this assignment as Claude Code subagents. Each sub-assignment runs with its own SOP and connections; the parent can delegate to them via the Agent tool.","nullable":true,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"options":{"description":"Optional runtime options controlling how the agent executes","type":"object","properties":{"browserProvider":{"description":"Browser infrastructure provider","type":"string","enum":["browserbase","browser-use"]},"evaluationSchemaId":{"description":"ID of the evaluation schema to apply to runs of this agent","type":"string"},"benchmarkExpectedOutcomes":{"description":"Expected outcomes used when running benchmark scenarios","type":"array","items":{"type":"object","properties":{"description":{"type":"string","description":"Human-readable description of the expected outcome"},"criteria":{"type":"string","description":"Pass/fail criteria used to evaluate the outcome"}},"required":["description","criteria"],"additionalProperties":false}}},"additionalProperties":{}}},"required":["models","input","files","skills","plugins","subAgents"],"additionalProperties":false,"description":"Agent configuration payload"}},"required":["version","data"],"additionalProperties":false}]},"status":{"nullable":true,"type":"string"},"revision_number":{"nullable":true,"type":"number"},"parent_build_id":{"nullable":true,"type":"string"},"created_by":{"nullable":true,"type":"string"},"created_by_name":{"nullable":true,"type":"string"},"created_at":{"nullable":true,"type":"string"},"updated_at":{"nullable":true,"type":"string"},"schedules":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"build_id":{"type":"string"},"agent_id":{"type":"string"},"user_id":{"type":"string"},"enabled":{"type":"boolean"},"frequency":{"type":"string","enum":["every_5_minutes","every_15_minutes","hourly","daily","workday","weekly","monthly","custom"]},"time":{"nullable":true,"type":"string"},"timezone":{"type":"string"},"day":{"nullable":true,"type":"string"},"day_of_month":{"nullable":true,"type":"number"},"cron":{"nullable":true,"type":"string"},"source":{"nullable":true,"type":"string"},"task":{"nullable":true,"type":"string"},"recurring":{"nullable":true,"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"user_name":{"nullable":true,"type":"string"},"user_email":{"nullable":true,"type":"string"}},"required":["id","build_id","agent_id","user_id","enabled","frequency","time","timezone","day","day_of_month","cron","source","task","recurring","created_at","updated_at"],"additionalProperties":false}}},"required":["id","copilot_id","agent_id","name","config","status","revision_number","parent_build_id","created_by","created_at","updated_at"],"additionalProperties":false,"description":"The updated build"}},"required":["build"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/plugins/catalog":{"get":{"operationId":"listPluginCatalog","tags":["Plugins"],"description":"List plugins that can be referenced by name in a build's plugins array. Builds may also reference any public GitHub repository URL (https://github.com/owner/repo) as a plugin; those are not enumerated here.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"plugins":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"Identifier to pass in the build's plugins array."},"type":{"type":"string","enum":["duvo-platform","github"],"description":"Plugin source. 'duvo-platform' plugins are pre-baked into the Duvo runtime; 'github' plugins are downloaded from a user-supplied repository URL at run time."},"description":{"type":"string"}},"required":["name","type","description"],"additionalProperties":false}}},"required":["plugins"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/teams/{team_id}":{"get":{"operationId":"getTeam","tags":["Team"],"description":"Get a team by ID. The API key must be scoped to the requested team.","parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"path","name":"team_id","required":true,"description":"Team ID"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"team":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$","description":"Unique team identifier"},"name":{"type":"string","description":"Human-readable team name"},"organization_id":{"nullable":true,"description":"Parent organization ID, or null if the team is standalone","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"slack_team_id":{"nullable":true,"description":"Linked Slack workspace ID, or null if Slack is not connected","type":"string"},"discovery_mode":{"type":"string","description":"How the team handles agent discovery (e.g. open, closed)"},"created_at":{"type":"string","description":"ISO 8601 creation timestamp"}},"required":["id","name","organization_id","slack_team_id","discovery_mode","created_at"],"additionalProperties":false}},"required":["team"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/integrations":{"get":{"operationId":"listIntegrations","tags":["Integrations"],"description":"List the team's integration catalog: built-in integration types plus any custom connection types defined for the team. OAuth authorization flows are browser-based and cannot be performed via this API; use the Duvo dashboard to complete OAuth-based connections.","parameters":[{"schema":{"type":"string"},"in":"query","name":"type","required":false},{"schema":{"default":100,"type":"integer","minimum":1,"maximum":100},"in":"query","name":"limit","required":false},{"schema":{"type":"integer","minimum":0,"maximum":9007199254740991},"in":"query","name":"offset","required":false}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"integrations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string"},"provider":{"type":"string"},"user_id":{"nullable":true,"type":"string"},"team_id":{"type":"string"},"server_url":{"type":"string"},"transport_type":{"type":"string","enum":["stdio","sse","http"]},"auth_method":{"nullable":true,"type":"string"},"composio_mcp_id":{"default":null,"nullable":true,"type":"string"},"custom_integration_id":{"nullable":true,"type":"string"},"icon_url":{"nullable":true,"type":"string"},"oauth_provider":{"nullable":true,"type":"string"},"oauth_scopes":{"nullable":true,"type":"array","items":{"type":"string"}},"has_headers":{"type":"boolean"},"has_oauth_tokens":{"type":"boolean"},"integration_id":{"nullable":true,"type":"string"},"shared":{"type":"boolean"},"created_by":{"nullable":true,"type":"string"},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"}},"required":["id","name","type","provider","user_id","team_id","composio_mcp_id","created_at","updated_at"],"additionalProperties":false}},"total":{"type":"integer","minimum":0,"maximum":9007199254740991},"limit":{"type":"integer","minimum":1,"maximum":9007199254740991},"offset":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["integrations","total","limit","offset"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/integrations/custom":{"post":{"operationId":"createCustomIntegration","tags":["Integrations"],"description":"Create a custom integration type (team-level catalog entry) that users can then connect as user-provided MCP connections. Requires manager-or-above role.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"auth_method":{"type":"string","enum":["url","apikey","headers","oauth"]},"server_url":{"type":"string","format":"uri"},"oauth_client_id":{"type":"string","minLength":1},"oauth_client_secret":{"type":"string","minLength":1}},"required":["name","auth_method","server_url"]}}}},"security":[{"bearerAuth":[]}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string"},"provider":{"type":"string"},"user_id":{"nullable":true,"type":"string"},"team_id":{"type":"string"},"server_url":{"type":"string"},"transport_type":{"type":"string","enum":["stdio","sse","http"]},"auth_method":{"nullable":true,"type":"string"},"composio_mcp_id":{"default":null,"nullable":true,"type":"string"},"custom_integration_id":{"nullable":true,"type":"string"},"icon_url":{"nullable":true,"type":"string"},"oauth_provider":{"nullable":true,"type":"string"},"oauth_scopes":{"nullable":true,"type":"array","items":{"type":"string"}},"has_headers":{"type":"boolean"},"has_oauth_tokens":{"type":"boolean"},"integration_id":{"nullable":true,"type":"string"},"shared":{"type":"boolean"},"created_by":{"nullable":true,"type":"string"},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"}},"required":["id","name","type","provider","user_id","team_id","composio_mcp_id","created_at","updated_at"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/integrations/custom/{custom_integration_id}":{"delete":{"operationId":"deleteCustomIntegration","tags":["Integrations"],"description":"Delete a custom integration type (team-level catalog entry) and cascade-remove related connections. Requires manager-or-above role.","parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"path","name":"custom_integration_id","required":true,"description":"Custom integration type ID"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}},"required":["success","message"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/connections":{"get":{"operationId":"listConnections","tags":["Connections"],"description":"List the authenticated user's connections (connected integration instances) for the current team. Includes team-shared instances visible to the caller when the org-level Connections sharing setting is on. Filter by integration type with the `type` query parameter.","parameters":[{"schema":{"type":"string"},"in":"query","name":"type","required":false},{"schema":{"default":100,"type":"integer","minimum":1,"maximum":100},"in":"query","name":"limit","required":false},{"schema":{"type":"integer","minimum":0,"maximum":9007199254740991},"in":"query","name":"offset","required":false}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"integrations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string"},"provider":{"type":"string"},"user_id":{"nullable":true,"type":"string"},"team_id":{"type":"string"},"server_url":{"type":"string"},"transport_type":{"type":"string","enum":["stdio","sse","http"]},"auth_method":{"nullable":true,"type":"string"},"composio_mcp_id":{"default":null,"nullable":true,"type":"string"},"custom_integration_id":{"nullable":true,"type":"string"},"icon_url":{"nullable":true,"type":"string"},"oauth_provider":{"nullable":true,"type":"string"},"oauth_scopes":{"nullable":true,"type":"array","items":{"type":"string"}},"has_headers":{"type":"boolean"},"has_oauth_tokens":{"type":"boolean"},"integration_id":{"nullable":true,"type":"string"},"shared":{"type":"boolean"},"created_by":{"nullable":true,"type":"string"},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"}},"required":["id","name","type","provider","user_id","team_id","composio_mcp_id","created_at","updated_at"],"additionalProperties":false}},"total":{"type":"integer","minimum":0,"maximum":9007199254740991},"limit":{"type":"integer","minimum":1,"maximum":9007199254740991},"offset":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["integrations","total","limit","offset"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}},"post":{"operationId":"createConnection","tags":["Connections"],"description":"Create a new user-provided connection (custom MCP server) for the current team. OAuth-based integrations (native, composio) require an interactive browser flow — start them with the dedicated OAuth endpoints (`/v1/connections/oauth/native/:provider/start`, `/v1/connections/oauth/mcp/start`, or `/v1/connections/composio/start`) instead of calling this endpoint directly.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"server_url":{"type":"string","format":"uri"},"type":{"default":"custom_mcp","type":"string"},"provider":{"type":"string","enum":["user"]},"auth_method":{"type":"string","enum":["url","apikey","headers","oauth"]},"custom_integration_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"headers":{"type":"object","properties":{"plaintext":{"type":"object","additionalProperties":{"type":"string"}},"secret":{"type":"object","additionalProperties":{"type":"string"}}}}},"required":["name","provider","auth_method"]}}}},"security":[{"bearerAuth":[]}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string"},"provider":{"type":"string"},"user_id":{"nullable":true,"type":"string"},"team_id":{"type":"string"},"server_url":{"type":"string"},"transport_type":{"type":"string","enum":["stdio","sse","http"]},"auth_method":{"nullable":true,"type":"string"},"composio_mcp_id":{"default":null,"nullable":true,"type":"string"},"custom_integration_id":{"nullable":true,"type":"string"},"icon_url":{"nullable":true,"type":"string"},"oauth_provider":{"nullable":true,"type":"string"},"oauth_scopes":{"nullable":true,"type":"array","items":{"type":"string"}},"has_headers":{"type":"boolean"},"has_oauth_tokens":{"type":"boolean"},"integration_id":{"nullable":true,"type":"string"},"shared":{"type":"boolean"},"created_by":{"nullable":true,"type":"string"},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"}},"required":["id","name","type","provider","user_id","team_id","composio_mcp_id","created_at","updated_at"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/connections/{connection_id}":{"get":{"operationId":"getConnection","tags":["Connections"],"description":"Get one of your connections by ID.","parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"path","name":"connection_id","required":true,"description":"Connection ID"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string"},"provider":{"type":"string"},"user_id":{"nullable":true,"type":"string"},"team_id":{"type":"string"},"server_url":{"type":"string"},"transport_type":{"type":"string","enum":["stdio","sse","http"]},"auth_method":{"nullable":true,"type":"string"},"composio_mcp_id":{"default":null,"nullable":true,"type":"string"},"custom_integration_id":{"nullable":true,"type":"string"},"icon_url":{"nullable":true,"type":"string"},"oauth_provider":{"nullable":true,"type":"string"},"oauth_scopes":{"nullable":true,"type":"array","items":{"type":"string"}},"has_headers":{"type":"boolean"},"has_oauth_tokens":{"type":"boolean"},"integration_id":{"nullable":true,"type":"string"},"shared":{"type":"boolean"},"created_by":{"nullable":true,"type":"string"},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"}},"required":["id","name","type","provider","user_id","team_id","composio_mcp_id","created_at","updated_at"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}},"patch":{"operationId":"updateConnection","tags":["Connections"],"description":"Update an existing connection. For sensitive header values, sending an empty string keeps the existing value; send a new value to overwrite. Toggling `shared` moves the connection between personal and team-shared.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"server_url":{"type":"string","format":"uri"},"auth_method":{"type":"string","enum":["url","oauth","apikey","headers"]},"headers":{"nullable":true,"type":"object","properties":{"plaintext":{"type":"object","additionalProperties":{"type":"string"}},"secret":{"type":"object","additionalProperties":{"type":"string"}}}},"composio_mcp_id":{"nullable":true,"type":"string"},"shared":{"type":"boolean"}}}}}},"parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"path","name":"connection_id","required":true,"description":"Connection ID"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string"},"provider":{"type":"string"},"user_id":{"nullable":true,"type":"string"},"team_id":{"type":"string"},"server_url":{"type":"string"},"transport_type":{"type":"string","enum":["stdio","sse","http"]},"auth_method":{"nullable":true,"type":"string"},"composio_mcp_id":{"default":null,"nullable":true,"type":"string"},"custom_integration_id":{"nullable":true,"type":"string"},"icon_url":{"nullable":true,"type":"string"},"oauth_provider":{"nullable":true,"type":"string"},"oauth_scopes":{"nullable":true,"type":"array","items":{"type":"string"}},"has_headers":{"type":"boolean"},"has_oauth_tokens":{"type":"boolean"},"integration_id":{"nullable":true,"type":"string"},"shared":{"type":"boolean"},"created_by":{"nullable":true,"type":"string"},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"}},"required":["id","name","type","provider","user_id","team_id","composio_mcp_id","created_at","updated_at"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}},"delete":{"operationId":"deleteConnection","tags":["Connections"],"description":"Delete a connection (disconnects the user's connection and removes any triggers bound to it).","parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"path","name":"connection_id","required":true,"description":"Connection ID"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}},"required":["success","message"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/connections/{connection_id}/credentials":{"get":{"operationId":"getConnectionCredentials","tags":["Connections"],"description":"Get the header keys configured for a connection. Sensitive values (api keys, tokens, passwords) are returned as empty strings — the response only reveals which credential fields are set, never their values.","parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"path","name":"connection_id","required":true,"description":"Connection ID"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["id","headers"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/connections/composio/start":{"post":{"operationId":"startComposioConnection","tags":["Connections"],"description":"Start a Composio-backed connection. Returns a `redirect_url` the user must open in a browser to complete the OAuth handshake (or `null` for non-OAuth schemes like API_KEY when the connection finalizes synchronously). After the user completes the flow, call `/v1/connections/composio/finalize` to provision the corresponding Duvo connection.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"auth_config_id":{"type":"string","minLength":1,"description":"Composio auth-config ID for the toolkit. Obtain it from Composio's auth-config catalog or by listing existing configs."},"callback_url":{"type":"string","format":"uri","description":"Where to send the user's browser after they finish the Composio consent screen. Must be an absolute URL."},"auth_scheme":{"description":"Composio auth scheme (e.g. 'OAUTH2', 'API_KEY', 'BEARER_TOKEN'). Required when supplying non-OAuth credentials in `auth_fields`.","type":"string"},"auth_fields":{"description":"Auth field values keyed by field name. For OAuth, these are passed in `connection.data`; for API_KEY/BEARER_TOKEN/etc., these are passed via `connection.state` with the corresponding `auth_scheme`.","type":"object","additionalProperties":{"type":"string"}}},"required":["auth_config_id","callback_url"]}}}},"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"redirect_url":{"nullable":true,"description":"Browser URL the user must visit to complete authorization. Null when the connection was completed synchronously (e.g. for API_KEY auth that did not require a browser flow).","type":"string"},"status":{"nullable":true,"description":"Composio connection status (e.g. 'INITIATED', 'ACTIVE', 'FAILED').","type":"string"},"connected_account_id":{"type":"string","minLength":1,"description":"Composio connected-account ID created by this request. Always present — required by `/v1/connections/composio/finalize` to bind the new connection to the exact account."}},"required":["redirect_url","status","connected_account_id"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/connections/composio/finalize":{"post":{"operationId":"connectComposioIntegration","tags":["Connections"],"description":"Finalize a Composio-backed connection after the start step (`/v1/connections/composio/start`) has produced a `connected_account_id`. Provisions a Composio MCP server bound to that account and persists the connection on the team. Works for both OAuth and non-OAuth start flows. Stale or invalid `connected_account_id`, missing app, or rejected upstream input surfaces as a 4xx via `composioErrorFor`; only genuinely unexpected upstream/persistence failures return 5xx.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"app":{"type":"string","minLength":1,"description":"Composio app slug (e.g. 'slack', 'googlesheets'). Must match a Composio toolkit configured for the team."},"integration_name":{"type":"string","minLength":1,"description":"Human-readable name to display for the connection."},"connected_account_id":{"type":"string","minLength":1,"description":"Composio connected-account ID returned by `/v1/connections/composio/start`. Used to bind this finalize call to the exact account the user just authorized; without it the wrong account could be picked when the team has multiple Composio accounts for the same app."}},"required":["app","integration_name","connected_account_id"]}}}},"security":[{"bearerAuth":[]}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"integration_id":{"type":"string"},"mcp_url":{"type":"string"}},"required":["integration_id","mcp_url"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/connections/mcp/probe":{"post":{"operationId":"probeMcpServer","summary":"Probe an MCP server for available tools","tags":["Connections"],"description":"Probe an MCP server URL and list the tools it exposes. Useful as a dry-run before creating a connection — verifies the URL is reachable, that authentication headers (if any) are correct, and surfaces the tool catalog. Performs no writes; sits alongside `/v1/connections/oauth/mcp/check` (which probes the same URL for OAuth support).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"server_url":{"type":"string","format":"uri","description":"MCP server URL to test"},"headers":{"description":"Optional HTTP headers for authentication","type":"object","additionalProperties":{"type":"string"}}},"required":["server_url"]}}}},"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"tools":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"input_schema":{"type":"object","additionalProperties":{}}},"required":["name"],"additionalProperties":false}},"error":{"type":"string"}},"required":["success"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/connections/oauth/native/{provider}/start":{"post":{"operationId":"startNativeOAuth","tags":["Connections"],"description":"Start an OAuth-based connection with a native provider (Gmail, Google Sheets, Outlook, etc.). Returns an authorization URL that must be opened in a browser by a human end-user; once they grant consent, Duvo creates the matching connection and redirects the browser to the optional `return_url` (or the Duvo dashboard if none is provided). Poll `/v1/connections` to detect the new connection.","requestBody":{"required":true,"content":{"application/json":{"schema":{"default":{},"type":"object","properties":{"return_url":{"description":"Where to send the user's browser after OAuth completes.","type":"string"}},"additionalProperties":{"type":"string"}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"provider","required":true,"description":"OAuth provider slug (e.g. 'google', 'gmail', 'googlesheets', 'outlook'). Must match a configured native OAuth provider."}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"authorization_url":{"type":"string","description":"OAuth provider authorization URL to open in a browser"}},"required":["authorization_url"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/connections/oauth/mcp/start":{"post":{"operationId":"authorizeMcpOAuth","tags":["Connections"],"description":"Start an OAuth-based connection with a remote MCP server using Dynamic Client Registration. Returns an authorization URL the user must open in a browser; once they grant consent, Duvo creates the matching connection and redirects the browser to the optional `returnUrl`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"mcp_server_url":{"type":"string","format":"uri","description":"URL of the MCP server requiring OAuth."},"name":{"type":"string","minLength":1,"description":"Human-readable name to display for the connection."},"custom_integration_id":{"description":"Optional ID of a custom integration this connection should be associated with.","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"return_url":{"description":"Where to send the user's browser after consent completes. Accepts an absolute URL on a domain Duvo allows, or a path relative to the Duvo frontend (e.g. `/integrations/slack`).","type":"string"},"integration_type":{"description":"Optional integration type label.","type":"string"}},"required":["mcp_server_url","name"]}}}},"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"authorization_url":{"type":"string","description":"OAuth provider authorization URL to open in a browser"}},"required":["authorization_url"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/connections/oauth/mcp/check":{"post":{"operationId":"checkMcpOAuth","tags":["Connections"],"description":"Probe an MCP server URL to discover whether it supports OAuth Dynamic Client Registration. Returns the authorization endpoint and required scopes when supported. Useful as a precursor to `/v1/connections/oauth/mcp/start` or `/v1/connections`. Performs no writes.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"mcp_server_url":{"type":"string","format":"uri","description":"URL of the MCP server to probe for OAuth support."}},"required":["mcp_server_url"]}}}},"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"supports_dcr":{"type":"boolean","description":"True if the MCP server advertises OAuth Dynamic Client Registration"},"authorization_endpoint":{"description":"OAuth authorization endpoint advertised by the MCP server, when discoverable","type":"string"},"scopes":{"description":"Scopes the MCP server requests during authorization","type":"array","items":{"type":"string"}}},"required":["supports_dcr"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/runs":{"get":{"operationId":"listRuns","tags":["Runs"],"description":"List runs for the current team. Supports filtering by agent, user, case queue, status, etc. Messages, evaluation data, and case-queue metadata are included where available.","parameters":[{"schema":{"default":20,"type":"number","minimum":1,"maximum":100},"in":"query","name":"limit","required":false,"description":"Number of runs per page (1-100, default 20)"},{"schema":{"type":"number","minimum":0},"in":"query","name":"offset","required":false,"description":"Number of runs to skip"},{"schema":{"default":"created_at","type":"string","enum":["created_at"]},"in":"query","name":"sort_by","required":false,"description":"Field to sort by (default created_at)"},{"schema":{"default":"desc","type":"string","enum":["asc","desc"]},"in":"query","name":"sort_order","required":false,"description":"Sort direction (default desc)"},{"schema":{"type":"string","enum":["not_started","pending","starting","running","waiting","completed","failed","interrupted","stopped","needs_attention"]},"in":"query","name":"status","required":false,"description":"Filter to runs with this status"},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"query","name":"agent_id","required":false,"description":"Filter to runs for this agent"},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"query","name":"user_id","required":false,"description":"Filter to runs owned by this user; non-superadmin callers are scoped to themselves regardless of this value"},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"query","name":"case_queue_id","required":false,"description":"Filter to runs associated with this case queue"},{"schema":{"type":"string"},"in":"query","name":"source","required":false,"description":"Filter to runs created from this source (e.g. api, schedule)"},{"schema":{"type":"string"},"in":"query","name":"search","required":false,"description":"Full-text search across run titles and case titles"},{"schema":{"type":"string","enum":["true","false"]},"in":"query","name":"has_issues","required":false,"description":"If true, only return runs that have evaluation issues"},{"schema":{"type":"string","enum":["critical","medium","low"]},"in":"query","name":"issue_severity","required":false,"description":"If set, only return runs whose latest successful evaluation has at least one failing rubric with this severity (critical | medium | low). Implies has_issues; legacy evaluations without severity companion fields do not match this filter."},{"schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"in":"query","name":"since","required":false},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"query","name":"digest_id","required":false}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"started_at":{"nullable":true,"type":"string","format":"date-time"},"completed_at":{"nullable":true,"type":"string","format":"date-time"},"status":{"type":"string","enum":["not_started","pending","starting","running","waiting","completed","failed","interrupted"]},"source":{"nullable":true,"type":"string"},"title":{"type":"string"},"run_number":{"type":"number"},"agent_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"agent_name":{"type":"string"},"build_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"user_id":{"nullable":true,"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"case_queue_item_id":{"nullable":true,"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"case_queue_id":{"nullable":true,"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"case_queue_name":{"nullable":true,"type":"string"},"case_title":{"nullable":true,"type":"string"},"postponed_to":{"nullable":true,"type":"string","format":"date-time"},"submitted_prompt_count":{"type":"integer","minimum":0,"maximum":9007199254740991},"eval_summaries":{"nullable":true,"type":"object","properties":{"passed":{"type":"number"},"total":{"type":"number"},"final_comment":{"type":"string"},"status":{"type":"string","enum":["ready","unavailable","in_progress"]},"severityCounts":{"type":"object","properties":{"critical":{"type":"integer","minimum":0,"maximum":9007199254740991},"medium":{"type":"integer","minimum":0,"maximum":9007199254740991},"low":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["critical","medium","low"],"additionalProperties":false}},"required":["passed","total","status"],"additionalProperties":false}},"required":["id","created_at","updated_at","started_at","completed_at","status","source","title","run_number","agent_id","agent_name","build_id","user_id","case_queue_item_id","case_queue_id","case_queue_name","case_title","postponed_to","submitted_prompt_count"],"additionalProperties":false}},"total":{"type":"number"}},"required":["data","total"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}},"post":{"operationId":"startRun","tags":["Runs"],"description":"Start a new agent run. Returns immediately with run info - does not wait for completion.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"agent_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$","description":"The agent ID to run"},"message":{"description":"Optional initial message to start the run with (e.g. a trigger payload or user instruction)","type":"string"},"sandbox_id":{"description":"Optional sandbox ID with pre-uploaded files","type":"string"},"webhook_url":{"description":"Webhook URL to POST events to (human_request, run_completed, run_failed, run_interrupted)","type":"string","format":"uri"}},"required":["agent_id"]}}}},"security":[{"bearerAuth":[]}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"run":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$","description":"Unique run identifier"},"agent_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$","description":"ID of the agent being run"},"build_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$","description":"ID of the build being run"},"status":{"type":"string","description":"Current run status"},"source":{"nullable":true,"description":"How the run was initiated","type":"string"},"sandbox_id":{"nullable":true,"description":"The sandbox ID for this run","type":"string"},"started_at":{"nullable":true,"description":"ISO 8601 timestamp when the run started","type":"string"},"completed_at":{"nullable":true,"description":"ISO 8601 timestamp when the run completed","type":"string"},"created_at":{"type":"string","description":"ISO 8601 timestamp when the run was created"},"updated_at":{"type":"string","description":"ISO 8601 timestamp when the run was last updated"},"human_in_the_loop_enabled":{"type":"boolean","description":"Whether this agent can request human input during execution"}},"required":["id","agent_id","build_id","status","source","sandbox_id","started_at","completed_at","created_at","updated_at","human_in_the_loop_enabled"],"additionalProperties":false,"description":"The newly created run"}},"required":["run"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/runs/{run_id}":{"get":{"operationId":"getRun","tags":["Runs"],"description":"Get information about an agent run. Can be polled to check status.","parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"path","name":"run_id","required":true,"description":"The run's unique identifier"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"run":{"nullable":true,"description":"The run details, or null if the run no longer exists","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$","description":"Unique run identifier"},"agent_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$","description":"ID of the agent being run"},"build_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$","description":"ID of the build being run"},"status":{"type":"string","description":"Current run status"},"source":{"nullable":true,"description":"How the run was initiated","type":"string"},"sandbox_id":{"nullable":true,"description":"The sandbox ID for this run","type":"string"},"started_at":{"nullable":true,"description":"ISO 8601 timestamp when the run started","type":"string"},"completed_at":{"nullable":true,"description":"ISO 8601 timestamp when the run completed","type":"string"},"created_at":{"type":"string","description":"ISO 8601 timestamp when the run was created"},"updated_at":{"type":"string","description":"ISO 8601 timestamp when the run was last updated"},"human_in_the_loop_enabled":{"type":"boolean","description":"Whether this agent can request human input during execution"}},"required":["id","agent_id","build_id","status","source","sandbox_id","started_at","completed_at","created_at","updated_at","human_in_the_loop_enabled"],"additionalProperties":false},"pending_human_request":{"description":"The pending human request blocking the run, if any","nullable":true,"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$","description":"Unique human-request identifier"},"title":{"type":"string","description":"Short title for the request"},"description":{"nullable":true,"description":"Longer description of the request","type":"string"},"created_at":{"type":"string","description":"ISO 8601 timestamp when the request was created"},"type":{"type":"string","enum":["approval","question"],"description":"Type of human request: 'approval' for yes/no decisions, 'question' for structured questions with optional predefined answers"},"questions":{"description":"For 'question' type requests, the structured questions with optional predefined answer options","type":"array","items":{"type":"object","properties":{"question":{"type":"string","description":"The question being asked"},"header":{"description":"Short header for the question","type":"string"},"options":{"description":"Predefined answer options","type":"array","items":{"type":"object","properties":{"label":{"type":"string","description":"Display label for the option"},"description":{"description":"Optional explanation of what this option means","type":"string"}},"required":["label"],"additionalProperties":false}},"multi_select":{"description":"Whether multiple options can be selected","type":"boolean"}},"required":["question"],"additionalProperties":false}}},"required":["id","title","description","created_at","type"],"additionalProperties":false}},"required":["run"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/runs/{run_id}/messages":{"post":{"operationId":"postRunMessage","tags":["Runs"],"description":"Post a message to an agent run. This will persist the message and resume the agent execution if the run is in a resumable state (waiting, completed, or interrupted).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","minLength":1,"description":"The message content to send to the agent"}},"required":["message"]}}}},"parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"path","name":"run_id","required":true,"description":"The run's unique identifier"}],"security":[{"bearerAuth":[]}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"object","properties":{"id":{"type":"string","description":"Unique message identifier"},"type":{"type":"string","description":"Message type"},"role":{"type":"string","description":"Sender role"},"timestamp":{"type":"string","description":"ISO 8601 timestamp when the message was posted"},"text_content":{"type":"string","description":"Plain text content of the message"}},"required":["id","type","role","timestamp","text_content"],"additionalProperties":false,"description":"The message that was posted to the run"}},"required":["message"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}},"get":{"operationId":"listRunMessages","tags":["Runs"],"description":"Get paginated messages for an agent run. Messages are returned in chronological order.","parameters":[{"schema":{"default":20,"type":"integer","minimum":1,"maximum":50},"in":"query","name":"limit","required":false,"description":"Number of messages per page (1-50, default 20)"},{"schema":{"type":"integer","minimum":0,"maximum":9007199254740991},"in":"query","name":"offset","required":false,"description":"Number of messages to skip"},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"path","name":"run_id","required":true,"description":"The run's unique identifier"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"messages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Unique message identifier"},"type":{"type":"string","description":"Message type"},"role":{"type":"string","description":"Sender role (e.g., user, assistant, tool)"},"timestamp":{"type":"string","description":"ISO 8601 timestamp when the message was sent"},"text_content":{"description":"Plain text content of the message","type":"string"},"tool_call":{"description":"Tool invocation details when role is assistant","type":"object","properties":{"id":{"type":"string","description":"Tool call identifier"},"name":{"type":"string","description":"Tool name being invoked"},"arguments":{"description":"Arguments passed to the tool","type":"object","additionalProperties":{}}},"required":["id","name"],"additionalProperties":false},"tool_result":{"description":"Tool result details when role is tool","type":"object","properties":{"tool_call_id":{"type":"string","description":"ID of the tool call this result corresponds to"},"result":{"description":"Serialized tool output"},"error":{"description":"Error message if the tool invocation failed","type":"string"}},"required":["tool_call_id"],"additionalProperties":false}},"required":["id","type","role","timestamp"],"additionalProperties":false},"description":"Messages for the run, in chronological order"},"total":{"type":"number","description":"Total number of messages for the run"},"limit":{"type":"number","description":"Number of messages per page"},"offset":{"type":"number","description":"Number of messages skipped"}},"required":["messages","total","limit","offset"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/runs/{run_id}/human-requests/{request_id}/respond":{"post":{"operationId":"respondToHumanRequest","tags":["Runs"],"description":"Respond to a human-in-the-loop request. Use 'approved' (true/false) for approval-type requests, or 'answers' ({question: answer}) for question-type requests. Only works when the run is in 'waiting' status.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"answers":{"description":"For question-type requests: a map of question text to answer. Multi-select answers should be comma-separated.","type":"object","additionalProperties":{"type":"string"}},"approved":{"description":"For approval-type requests: true to approve, false to deny","type":"boolean"}}}}}},"parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"path","name":"run_id","required":true,"description":"The run's unique identifier"},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"path","name":"request_id","required":true,"description":"The human request's unique identifier"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"human_request":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$","description":"Unique human-request identifier"},"run_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$","description":"ID of the run this request belongs to"},"title":{"type":"string","description":"Short title for the request"},"description":{"nullable":true,"description":"Longer description of the request","type":"string"},"response":{"nullable":true,"description":"The response provided by the user","type":"string"},"responded_at":{"nullable":true,"description":"ISO 8601 timestamp when the user responded","type":"string"},"created_at":{"type":"string","description":"ISO 8601 timestamp when the request was created"}},"required":["id","run_id","title","description","response","responded_at","created_at"],"additionalProperties":false}},"required":["human_request"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/runs/{run_id}/stop":{"post":{"operationId":"stopRun","tags":["Runs"],"description":"Stop an agent run. No-op if the run is not currently running.","parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"path","name":"run_id","required":true,"description":"The run's unique identifier"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Whether the stop request succeeded"},"message":{"description":"Optional human-readable detail","type":"string"}},"required":["success"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"502":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/sandboxes":{"post":{"operationId":"createSandbox","tags":["Sandboxes"],"description":"Create a new sandbox for file uploads. The returned sandbox_id can be passed to POST /v1/runs to stage data for a run.","security":[{"bearerAuth":[]}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"sandbox_id":{"type":"string","description":"The newly created sandbox's identifier"},"expires_at":{"type":"string","description":"ISO 8601 timestamp when the sandbox will expire"}},"required":["sandbox_id","expires_at"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/sandboxes/{sandbox_id}/upload-urls":{"post":{"operationId":"createSandboxUploadUrl","tags":["Sandboxes"],"description":"Get a presigned URL for uploading a file into a sandbox. Use for files larger than 10MB; smaller files can be uploaded directly via POST /v1/sandboxes/:sandbox_id/files.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"path":{"type":"string","minLength":1,"description":"Path where the file will be uploaded (e.g. /workspace/data.csv)"}},"required":["path"]}}}},"parameters":[{"schema":{"type":"string","minLength":1},"in":"path","name":"sandbox_id","required":true,"description":"The sandbox's unique identifier"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"upload_url":{"type":"string","format":"uri","description":"Presigned upload URL"},"path":{"type":"string","description":"Path the file will be uploaded to"},"expires_in_seconds":{"type":"number","description":"Seconds until the presigned URL expires"}},"required":["upload_url","path","expires_in_seconds"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/sandboxes/{sandbox_id}/files":{"get":{"operationId":"listSandboxFiles","tags":["Sandboxes"],"description":"List files in a sandbox directory.","parameters":[{"schema":{"default":"/workspace","type":"string"},"in":"query","name":"path","required":false,"description":"Directory to list files from (defaults to /workspace)"},{"schema":{"type":"string","minLength":1},"in":"path","name":"sandbox_id","required":true,"description":"The sandbox's unique identifier"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"File or directory name (basename)"},"path":{"type":"string","description":"Absolute path inside the sandbox"},"type":{"type":"string","enum":["file","dir"],"description":"Whether this entry is a regular file or a directory"},"size_bytes":{"type":"number","description":"Size of the file in bytes (0 for directories)"}},"required":["name","path","type","size_bytes"],"additionalProperties":false},"description":"Entries in the requested directory"}},"required":["files"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}},"post":{"operationId":"uploadSandboxFile","tags":["Sandboxes"],"description":"Upload a file directly to the sandbox. Maximum file size is 10MB. For larger files, use POST /v1/sandboxes/:sandbox_id/upload-urls.","parameters":[{"schema":{"type":"string","minLength":1},"in":"path","name":"sandbox_id","required":true,"description":"The sandbox's unique identifier"}],"security":[{"bearerAuth":[]}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"path":{"type":"string","description":"Path the file was uploaded to"},"size_bytes":{"type":"number","description":"Size of the uploaded file in bytes"}},"required":["path","size_bytes"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"413":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/agents/{agent_id}/schedules":{"get":{"operationId":"listAgentSchedules","tags":["Schedules"],"description":"List all schedules configured for an agent. Returns the schedules you own on this agent.","parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"path","name":"agent_id","required":true,"description":"The agent's unique identifier"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"schedules":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"build_id":{"type":"string"},"agent_id":{"type":"string"},"user_id":{"type":"string"},"enabled":{"type":"boolean"},"frequency":{"type":"string","enum":["every_5_minutes","every_15_minutes","hourly","daily","workday","weekly","monthly","custom"]},"time":{"nullable":true,"type":"string"},"timezone":{"type":"string"},"day":{"nullable":true,"type":"string"},"day_of_month":{"nullable":true,"type":"number"},"cron":{"nullable":true,"type":"string"},"source":{"nullable":true,"type":"string"},"task":{"nullable":true,"type":"string"},"recurring":{"nullable":true,"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"user_name":{"nullable":true,"type":"string"},"user_email":{"nullable":true,"type":"string"}},"required":["id","build_id","agent_id","user_id","enabled","frequency","time","timezone","day","day_of_month","cron","source","task","recurring","created_at","updated_at"],"additionalProperties":false},"description":"Schedules the authenticated user owns on this agent"}},"required":["schedules"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/agents/{agent_id}/case-triggers":{"get":{"operationId":"listAgentCaseTriggers","tags":["Case Triggers"],"description":"List the case triggers configured for an agent. Each trigger automatically dispatches the agent to run cases added to a queue.","parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"path","name":"agent_id","required":true,"description":"The agent's unique identifier"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"case_triggers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"agent_id":{"type":"string"},"case_queue_id":{"type":"string"},"case_queue_name":{"type":"string"},"user_id":{"type":"string"},"enabled":{"type":"boolean"},"concurrency":{"nullable":true,"type":"integer","exclusiveMinimum":true,"maximum":9007199254740991},"created_at":{"type":"string"},"updated_at":{"type":"string"},"creator_display_name":{"nullable":true,"type":"string"},"can_disable":{"type":"boolean"},"has_conflict":{"type":"boolean"},"conflicting_agents":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}}},"required":["id","agent_id","case_queue_id","case_queue_name","user_id","enabled","concurrency","created_at","updated_at","creator_display_name","can_disable","has_conflict","conflicting_agents"],"additionalProperties":false}}},"required":["case_triggers"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}},"post":{"operationId":"createAgentCaseTrigger","tags":["Case Triggers"],"description":"Create a case trigger for an agent. An agent may have at most one case trigger; this returns 409 if one already exists.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"case_queue_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$","description":"Queue whose new cases should trigger this agent"},"enabled":{"type":"boolean","description":"Whether the trigger is active. Disabled triggers do not dispatch runs."},"concurrency":{"description":"Maximum number of concurrent runs for this trigger. Null/omitted means unlimited.","nullable":true,"type":"integer","exclusiveMinimum":true,"maximum":9007199254740991}},"required":["case_queue_id","enabled"]}}}},"parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"path","name":"agent_id","required":true,"description":"The agent's unique identifier"}],"security":[{"bearerAuth":[]}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"case_trigger":{"type":"object","properties":{"id":{"type":"string"},"agent_id":{"type":"string"},"case_queue_id":{"type":"string"},"case_queue_name":{"type":"string"},"user_id":{"type":"string"},"enabled":{"type":"boolean"},"concurrency":{"nullable":true,"type":"integer","exclusiveMinimum":true,"maximum":9007199254740991},"created_at":{"type":"string"},"updated_at":{"type":"string"},"creator_display_name":{"nullable":true,"type":"string"},"can_disable":{"type":"boolean"},"has_conflict":{"type":"boolean"},"conflicting_agents":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}}},"required":["id","agent_id","case_queue_id","case_queue_name","user_id","enabled","concurrency","created_at","updated_at","creator_display_name","can_disable","has_conflict","conflicting_agents"],"additionalProperties":false}},"required":["case_trigger"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/agents/{agent_id}/case-triggers/conflict-preview":{"get":{"operationId":"previewAgentCaseTriggerConflicts","tags":["Case Triggers"],"description":"Preview which other agents would conflict with this agent's case trigger if it pointed at the given case queue. Does not modify the trigger.","parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"query","name":"case_queue_id","required":true,"description":"The case queue to check for conflicts against"},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"path","name":"agent_id","required":true,"description":"The agent's unique identifier"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"has_conflict":{"type":"boolean"},"conflicting_agents":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}}},"required":["has_conflict","conflicting_agents"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/agents/{agent_id}/case-triggers/{trigger_id}":{"get":{"operationId":"getAgentCaseTrigger","tags":["Case Triggers"],"description":"Retrieve a single case trigger by id.","parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"path","name":"agent_id","required":true,"description":"The agent's unique identifier"},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"path","name":"trigger_id","required":true,"description":"The case trigger's unique identifier"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"case_trigger":{"type":"object","properties":{"id":{"type":"string"},"agent_id":{"type":"string"},"case_queue_id":{"type":"string"},"case_queue_name":{"type":"string"},"user_id":{"type":"string"},"enabled":{"type":"boolean"},"concurrency":{"nullable":true,"type":"integer","exclusiveMinimum":true,"maximum":9007199254740991},"created_at":{"type":"string"},"updated_at":{"type":"string"},"creator_display_name":{"nullable":true,"type":"string"},"can_disable":{"type":"boolean"},"has_conflict":{"type":"boolean"},"conflicting_agents":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}}},"required":["id","agent_id","case_queue_id","case_queue_name","user_id","enabled","concurrency","created_at","updated_at","creator_display_name","can_disable","has_conflict","conflicting_agents"],"additionalProperties":false}},"required":["case_trigger"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}},"patch":{"operationId":"updateAgentCaseTrigger","tags":["Case Triggers"],"description":"Update fields on a case trigger. Only the trigger creator or a builder/admin can disable an enabled trigger or change its queue.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"case_queue_id":{"description":"Queue whose new cases should trigger this agent","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"enabled":{"description":"Whether the trigger is active. Disabled triggers do not dispatch runs.","type":"boolean"},"concurrency":{"description":"Maximum number of concurrent runs for this trigger. Null clears the limit.","nullable":true,"type":"integer","exclusiveMinimum":true,"maximum":9007199254740991}}}}}},"parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"path","name":"agent_id","required":true,"description":"The agent's unique identifier"},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"path","name":"trigger_id","required":true,"description":"The case trigger's unique identifier"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"case_trigger":{"type":"object","properties":{"id":{"type":"string"},"agent_id":{"type":"string"},"case_queue_id":{"type":"string"},"case_queue_name":{"type":"string"},"user_id":{"type":"string"},"enabled":{"type":"boolean"},"concurrency":{"nullable":true,"type":"integer","exclusiveMinimum":true,"maximum":9007199254740991},"created_at":{"type":"string"},"updated_at":{"type":"string"},"creator_display_name":{"nullable":true,"type":"string"},"can_disable":{"type":"boolean"},"has_conflict":{"type":"boolean"},"conflicting_agents":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}}},"required":["id","agent_id","case_queue_id","case_queue_name","user_id","enabled","concurrency","created_at","updated_at","creator_display_name","can_disable","has_conflict","conflicting_agents"],"additionalProperties":false}},"required":["case_trigger"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}},"delete":{"operationId":"deleteAgentCaseTrigger","tags":["Case Triggers"],"description":"Delete a case trigger. Only the trigger creator or a builder/admin can delete it.","parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"path","name":"agent_id","required":true,"description":"The agent's unique identifier"},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"path","name":"trigger_id","required":true,"description":"The case trigger's unique identifier"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]}},"required":["success"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/agents/{agent_id}/revisions":{"post":{"operationId":"createRevision","tags":["Revisions"],"description":"Create a new revision for an existing agent.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Build name"},"config":{"description":"Build configuration (latest schema version only; legacy v1 configs are not accepted)","type":"object","properties":{"version":{"type":"string","enum":["v2"],"description":"Schema version discriminator — must be \"v2\" for the current schema"},"data":{"type":"object","properties":{"models":{"type":"object","properties":{"agent":{"type":"object","properties":{"model":{"type":"string","enum":["claude-sonnet-4-6","claude-sonnet-4-6[1m]","claude-opus-4-6","claude-opus-4-6[1m]","claude-opus-4-7","claude-opus-4-7[1m]","d1-max","duvo-1-max","duvo-1-max-sonnet-1m","duvo-1-max-sonnet-4.5","duvo-1-max-sonnet-4.5-1m","duvo-1-max-opus","duvo-1-max-opus-4.5","gpt-4.1","gpt-4o","gpt-4o-mini","gpt-5","gpt-5.1","claude-sonnet-4-20250514","claude-sonnet-4-20250514[1m]","claude-sonnet-4-5-20250929","claude-sonnet-4-5-20250929[1m]","claude-opus-4-1-20250805","claude-opus-4-5-20251101"],"description":"Claude model identifier used for the primary agent loop"}},"required":["model"],"description":"Primary Claude agent model configuration"},"browsing":{"type":"object","properties":{"provider":{"type":"string","enum":["google","anthropic"],"description":"Provider backing the browsing/computer-use model"},"model":{"type":"string","enum":["gemini-2.5-pro","gemini-2.5-flash","gemini-3-pro-preview","claude-haiku-4-5","claude-sonnet-4-5","claude-opus-4-1"],"description":"Model identifier for the browsing provider"}},"required":["provider","model"],"description":"Browsing/computer-use model configuration"}},"required":["agent","browsing"],"description":"Model configuration for each capability the agent uses"},"input":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["system","user","assistant"]},"content":{"anyOf":[{"type":"string"},{"type":"array","items":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"]},"text":{"type":"string"}},"required":["type","text"]},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"]},"detail":{"nullable":true,"type":"string","enum":["low","high","auto"]},"file_id":{"nullable":true,"type":"string"},"url":{"nullable":true,"type":"string"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"]},"file_id":{"type":"string"}},"required":["type","file_id"]}]}}]},"type":{"nullable":true,"type":"string","enum":["message"]}},"required":["role","content"]}}],"description":"Initial agent instructions — either a single system prompt string or a list of structured messages"},"files":{"default":[],"description":"IDs of team files that should be available to the agent","nullable":true,"type":"array","items":{"type":"string"}},"skills":{"default":[],"description":"IDs of skills (team or system) that should be available to the agent","nullable":true,"type":"array","items":{"type":"string"}},"plugins":{"default":[],"description":"Plugins to load — either a built-in plugin name (e.g. \"code-review\") or a GitHub URL (e.g. \"https://github.com/owner/repo\")","nullable":true,"type":"array","items":{"type":"string"}},"subAgents":{"default":[],"description":"IDs of other assignments (agents in the same team) to expose to this assignment as Claude Code subagents. Each sub-assignment runs with its own SOP and connections; the parent can delegate to them via the Agent tool.","nullable":true,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"options":{"description":"Optional runtime options controlling how the agent executes","type":"object","properties":{"browserProvider":{"description":"Browser infrastructure provider","type":"string","enum":["browserbase","browser-use"]},"evaluationSchemaId":{"description":"ID of the evaluation schema to apply to runs of this agent","type":"string"},"benchmarkExpectedOutcomes":{"description":"Expected outcomes used when running benchmark scenarios","type":"array","items":{"type":"object","properties":{"description":{"type":"string","description":"Human-readable description of the expected outcome"},"criteria":{"type":"string","description":"Pass/fail criteria used to evaluate the outcome"}},"required":["description","criteria"]}}},"additionalProperties":{}}},"required":["models","input"],"description":"Agent configuration payload"}},"required":["version","data"]},"handover_target_ids":{"description":"Agent IDs that this agent can hand work off to","type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"}},"source_build_id":{"description":"Build ID to copy integrations and case queue links from","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["name"]}}}},"parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"path","name":"agent_id","required":true,"description":"The agent's unique identifier"}],"security":[{"bearerAuth":[]}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"build":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"copilot_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"agent_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"name":{"type":"string"},"revision_name":{"nullable":true,"type":"string"},"revision_description":{"nullable":true,"type":"string"},"config":{"nullable":true,"anyOf":[{"type":"object","properties":{"version":{"type":"string","enum":["v1"]},"data":{"type":"object","properties":{"model":{"type":"string"},"temperature":{"nullable":true,"type":"number","minimum":0,"maximum":2},"max_output_tokens":{"nullable":true,"type":"number","minimum":0,"exclusiveMinimum":true},"top_p":{"nullable":true,"type":"number","minimum":0,"maximum":1},"store":{"nullable":true,"type":"boolean"},"tools":{},"input":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["system","user","assistant"]},"content":{"anyOf":[{"type":"string"},{"type":"array","items":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"]},"text":{"type":"string"}},"required":["type","text"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"]},"detail":{"nullable":true,"type":"string","enum":["low","high","auto"]},"file_id":{"nullable":true,"type":"string"},"url":{"nullable":true,"type":"string"}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"]},"file_id":{"type":"string"}},"required":["type","file_id"],"additionalProperties":false}]}}]},"type":{"nullable":true,"type":"string","enum":["message"]}},"required":["role","content"],"additionalProperties":false}}]},"text":{"nullable":true,"type":"object","properties":{"format":{"nullable":true,"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"]}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"]}},"required":["type"],"additionalProperties":false}]}},"additionalProperties":false},"files":{"default":[],"nullable":true,"type":"array","items":{"type":"string"}},"skills":{"default":[],"nullable":true,"type":"array","items":{"type":"string"}}},"required":["model","tools","input","files","skills"],"additionalProperties":false}},"required":["version","data"],"additionalProperties":false},{"type":"object","properties":{"version":{"type":"string","enum":["v2"],"description":"Schema version discriminator — must be \"v2\" for the current schema"},"data":{"type":"object","properties":{"models":{"type":"object","properties":{"agent":{"type":"object","properties":{"model":{"type":"string","enum":["claude-sonnet-4-6","claude-sonnet-4-6[1m]","claude-opus-4-6","claude-opus-4-6[1m]","claude-opus-4-7","claude-opus-4-7[1m]","d1-max","duvo-1-max","duvo-1-max-sonnet-1m","duvo-1-max-sonnet-4.5","duvo-1-max-sonnet-4.5-1m","duvo-1-max-opus","duvo-1-max-opus-4.5","gpt-4.1","gpt-4o","gpt-4o-mini","gpt-5","gpt-5.1","claude-sonnet-4-20250514","claude-sonnet-4-20250514[1m]","claude-sonnet-4-5-20250929","claude-sonnet-4-5-20250929[1m]","claude-opus-4-1-20250805","claude-opus-4-5-20251101"],"description":"Claude model identifier used for the primary agent loop"}},"required":["model"],"additionalProperties":false,"description":"Primary Claude agent model configuration"},"browsing":{"type":"object","properties":{"provider":{"type":"string","enum":["google","anthropic"],"description":"Provider backing the browsing/computer-use model"},"model":{"type":"string","enum":["gemini-2.5-pro","gemini-2.5-flash","gemini-3-pro-preview","claude-haiku-4-5","claude-sonnet-4-5","claude-opus-4-1"],"description":"Model identifier for the browsing provider"}},"required":["provider","model"],"additionalProperties":false,"description":"Browsing/computer-use model configuration"}},"required":["agent","browsing"],"additionalProperties":false,"description":"Model configuration for each capability the agent uses"},"input":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["system","user","assistant"]},"content":{"anyOf":[{"type":"string"},{"type":"array","items":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"]},"text":{"type":"string"}},"required":["type","text"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"]},"detail":{"nullable":true,"type":"string","enum":["low","high","auto"]},"file_id":{"nullable":true,"type":"string"},"url":{"nullable":true,"type":"string"}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"]},"file_id":{"type":"string"}},"required":["type","file_id"],"additionalProperties":false}]}}]},"type":{"nullable":true,"type":"string","enum":["message"]}},"required":["role","content"],"additionalProperties":false}}],"description":"Initial agent instructions — either a single system prompt string or a list of structured messages"},"files":{"default":[],"description":"IDs of team files that should be available to the agent","nullable":true,"type":"array","items":{"type":"string"}},"skills":{"default":[],"description":"IDs of skills (team or system) that should be available to the agent","nullable":true,"type":"array","items":{"type":"string"}},"plugins":{"default":[],"description":"Plugins to load — either a built-in plugin name (e.g. \"code-review\") or a GitHub URL (e.g. \"https://github.com/owner/repo\")","nullable":true,"type":"array","items":{"type":"string"}},"subAgents":{"default":[],"description":"IDs of other assignments (agents in the same team) to expose to this assignment as Claude Code subagents. Each sub-assignment runs with its own SOP and connections; the parent can delegate to them via the Agent tool.","nullable":true,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"options":{"description":"Optional runtime options controlling how the agent executes","type":"object","properties":{"browserProvider":{"description":"Browser infrastructure provider","type":"string","enum":["browserbase","browser-use"]},"evaluationSchemaId":{"description":"ID of the evaluation schema to apply to runs of this agent","type":"string"},"benchmarkExpectedOutcomes":{"description":"Expected outcomes used when running benchmark scenarios","type":"array","items":{"type":"object","properties":{"description":{"type":"string","description":"Human-readable description of the expected outcome"},"criteria":{"type":"string","description":"Pass/fail criteria used to evaluate the outcome"}},"required":["description","criteria"],"additionalProperties":false}}},"additionalProperties":{}}},"required":["models","input","files","skills","plugins","subAgents"],"additionalProperties":false,"description":"Agent configuration payload"}},"required":["version","data"],"additionalProperties":false}]},"status":{"nullable":true,"type":"string"},"revision_number":{"nullable":true,"type":"number"},"parent_build_id":{"nullable":true,"type":"string"},"created_by":{"nullable":true,"type":"string"},"created_by_name":{"nullable":true,"type":"string"},"created_at":{"nullable":true,"type":"string"},"updated_at":{"nullable":true,"type":"string"},"schedules":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"build_id":{"type":"string"},"agent_id":{"type":"string"},"user_id":{"type":"string"},"enabled":{"type":"boolean"},"frequency":{"type":"string","enum":["every_5_minutes","every_15_minutes","hourly","daily","workday","weekly","monthly","custom"]},"time":{"nullable":true,"type":"string"},"timezone":{"type":"string"},"day":{"nullable":true,"type":"string"},"day_of_month":{"nullable":true,"type":"number"},"cron":{"nullable":true,"type":"string"},"source":{"nullable":true,"type":"string"},"task":{"nullable":true,"type":"string"},"recurring":{"nullable":true,"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"user_name":{"nullable":true,"type":"string"},"user_email":{"nullable":true,"type":"string"}},"required":["id","build_id","agent_id","user_id","enabled","frequency","time","timezone","day","day_of_month","cron","source","task","recurring","created_at","updated_at"],"additionalProperties":false}}},"required":["id","copilot_id","agent_id","name","config","status","revision_number","parent_build_id","created_by","created_at","updated_at"],"additionalProperties":false},"agent":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"}},"required":["id"],"additionalProperties":false}},"required":["build","agent"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}},"get":{"operationId":"listAgentRevisions","tags":["Revisions"],"description":"List revisions for an agent.","parameters":[{"schema":{"default":20,"type":"integer","minimum":1,"maximum":100},"in":"query","name":"limit","required":false,"description":"Number of revisions per page (1-100, default 20)"},{"schema":{"type":"integer","minimum":0,"maximum":9007199254740991},"in":"query","name":"offset","required":false,"description":"Number of revisions to skip"},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"path","name":"agent_id","required":true,"description":"The agent's unique identifier"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"builds":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"copilot_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"agent_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"name":{"type":"string"},"revision_name":{"nullable":true,"type":"string"},"revision_description":{"nullable":true,"type":"string"},"config":{"nullable":true,"anyOf":[{"type":"object","properties":{"version":{"type":"string","enum":["v1"]},"data":{"type":"object","properties":{"model":{"type":"string"},"temperature":{"nullable":true,"type":"number","minimum":0,"maximum":2},"max_output_tokens":{"nullable":true,"type":"number","minimum":0,"exclusiveMinimum":true},"top_p":{"nullable":true,"type":"number","minimum":0,"maximum":1},"store":{"nullable":true,"type":"boolean"},"tools":{},"input":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["system","user","assistant"]},"content":{"anyOf":[{"type":"string"},{"type":"array","items":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"]},"text":{"type":"string"}},"required":["type","text"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"]},"detail":{"nullable":true,"type":"string","enum":["low","high","auto"]},"file_id":{"nullable":true,"type":"string"},"url":{"nullable":true,"type":"string"}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"]},"file_id":{"type":"string"}},"required":["type","file_id"],"additionalProperties":false}]}}]},"type":{"nullable":true,"type":"string","enum":["message"]}},"required":["role","content"],"additionalProperties":false}}]},"text":{"nullable":true,"type":"object","properties":{"format":{"nullable":true,"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"]}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"]}},"required":["type"],"additionalProperties":false}]}},"additionalProperties":false},"files":{"default":[],"nullable":true,"type":"array","items":{"type":"string"}},"skills":{"default":[],"nullable":true,"type":"array","items":{"type":"string"}}},"required":["model","tools","input","files","skills"],"additionalProperties":false}},"required":["version","data"],"additionalProperties":false},{"type":"object","properties":{"version":{"type":"string","enum":["v2"],"description":"Schema version discriminator — must be \"v2\" for the current schema"},"data":{"type":"object","properties":{"models":{"type":"object","properties":{"agent":{"type":"object","properties":{"model":{"type":"string","enum":["claude-sonnet-4-6","claude-sonnet-4-6[1m]","claude-opus-4-6","claude-opus-4-6[1m]","claude-opus-4-7","claude-opus-4-7[1m]","d1-max","duvo-1-max","duvo-1-max-sonnet-1m","duvo-1-max-sonnet-4.5","duvo-1-max-sonnet-4.5-1m","duvo-1-max-opus","duvo-1-max-opus-4.5","gpt-4.1","gpt-4o","gpt-4o-mini","gpt-5","gpt-5.1","claude-sonnet-4-20250514","claude-sonnet-4-20250514[1m]","claude-sonnet-4-5-20250929","claude-sonnet-4-5-20250929[1m]","claude-opus-4-1-20250805","claude-opus-4-5-20251101"],"description":"Claude model identifier used for the primary agent loop"}},"required":["model"],"additionalProperties":false,"description":"Primary Claude agent model configuration"},"browsing":{"type":"object","properties":{"provider":{"type":"string","enum":["google","anthropic"],"description":"Provider backing the browsing/computer-use model"},"model":{"type":"string","enum":["gemini-2.5-pro","gemini-2.5-flash","gemini-3-pro-preview","claude-haiku-4-5","claude-sonnet-4-5","claude-opus-4-1"],"description":"Model identifier for the browsing provider"}},"required":["provider","model"],"additionalProperties":false,"description":"Browsing/computer-use model configuration"}},"required":["agent","browsing"],"additionalProperties":false,"description":"Model configuration for each capability the agent uses"},"input":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["system","user","assistant"]},"content":{"anyOf":[{"type":"string"},{"type":"array","items":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"]},"text":{"type":"string"}},"required":["type","text"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"]},"detail":{"nullable":true,"type":"string","enum":["low","high","auto"]},"file_id":{"nullable":true,"type":"string"},"url":{"nullable":true,"type":"string"}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"]},"file_id":{"type":"string"}},"required":["type","file_id"],"additionalProperties":false}]}}]},"type":{"nullable":true,"type":"string","enum":["message"]}},"required":["role","content"],"additionalProperties":false}}],"description":"Initial agent instructions — either a single system prompt string or a list of structured messages"},"files":{"default":[],"description":"IDs of team files that should be available to the agent","nullable":true,"type":"array","items":{"type":"string"}},"skills":{"default":[],"description":"IDs of skills (team or system) that should be available to the agent","nullable":true,"type":"array","items":{"type":"string"}},"plugins":{"default":[],"description":"Plugins to load — either a built-in plugin name (e.g. \"code-review\") or a GitHub URL (e.g. \"https://github.com/owner/repo\")","nullable":true,"type":"array","items":{"type":"string"}},"subAgents":{"default":[],"description":"IDs of other assignments (agents in the same team) to expose to this assignment as Claude Code subagents. Each sub-assignment runs with its own SOP and connections; the parent can delegate to them via the Agent tool.","nullable":true,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"options":{"description":"Optional runtime options controlling how the agent executes","type":"object","properties":{"browserProvider":{"description":"Browser infrastructure provider","type":"string","enum":["browserbase","browser-use"]},"evaluationSchemaId":{"description":"ID of the evaluation schema to apply to runs of this agent","type":"string"},"benchmarkExpectedOutcomes":{"description":"Expected outcomes used when running benchmark scenarios","type":"array","items":{"type":"object","properties":{"description":{"type":"string","description":"Human-readable description of the expected outcome"},"criteria":{"type":"string","description":"Pass/fail criteria used to evaluate the outcome"}},"required":["description","criteria"],"additionalProperties":false}}},"additionalProperties":{}}},"required":["models","input","files","skills","plugins","subAgents"],"additionalProperties":false,"description":"Agent configuration payload"}},"required":["version","data"],"additionalProperties":false}]},"status":{"nullable":true,"type":"string"},"revision_number":{"nullable":true,"type":"number"},"parent_build_id":{"nullable":true,"type":"string"},"created_by":{"nullable":true,"type":"string"},"created_by_name":{"nullable":true,"type":"string"},"created_at":{"nullable":true,"type":"string"},"updated_at":{"nullable":true,"type":"string"},"schedules":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"build_id":{"type":"string"},"agent_id":{"type":"string"},"user_id":{"type":"string"},"enabled":{"type":"boolean"},"frequency":{"type":"string","enum":["every_5_minutes","every_15_minutes","hourly","daily","workday","weekly","monthly","custom"]},"time":{"nullable":true,"type":"string"},"timezone":{"type":"string"},"day":{"nullable":true,"type":"string"},"day_of_month":{"nullable":true,"type":"number"},"cron":{"nullable":true,"type":"string"},"source":{"nullable":true,"type":"string"},"task":{"nullable":true,"type":"string"},"recurring":{"nullable":true,"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"user_name":{"nullable":true,"type":"string"},"user_email":{"nullable":true,"type":"string"}},"required":["id","build_id","agent_id","user_id","enabled","frequency","time","timezone","day","day_of_month","cron","source","task","recurring","created_at","updated_at"],"additionalProperties":false}}},"required":["id","copilot_id","agent_id","name","config","status","revision_number","parent_build_id","created_by","created_at","updated_at"],"additionalProperties":false}},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"limit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"offset":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["builds","total","limit","offset"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/agents/{agent_id}/revisions/{build_id}":{"get":{"operationId":"getRevision","tags":["Revisions"],"description":"Get a revision by ID.","parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"path","name":"agent_id","required":true,"description":"The agent's unique identifier"},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"path","name":"build_id","required":true,"description":"The build's unique identifier"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"build":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"copilot_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"agent_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"name":{"type":"string"},"revision_name":{"nullable":true,"type":"string"},"revision_description":{"nullable":true,"type":"string"},"config":{"nullable":true,"anyOf":[{"type":"object","properties":{"version":{"type":"string","enum":["v1"]},"data":{"type":"object","properties":{"model":{"type":"string"},"temperature":{"nullable":true,"type":"number","minimum":0,"maximum":2},"max_output_tokens":{"nullable":true,"type":"number","minimum":0,"exclusiveMinimum":true},"top_p":{"nullable":true,"type":"number","minimum":0,"maximum":1},"store":{"nullable":true,"type":"boolean"},"tools":{},"input":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["system","user","assistant"]},"content":{"anyOf":[{"type":"string"},{"type":"array","items":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"]},"text":{"type":"string"}},"required":["type","text"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"]},"detail":{"nullable":true,"type":"string","enum":["low","high","auto"]},"file_id":{"nullable":true,"type":"string"},"url":{"nullable":true,"type":"string"}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"]},"file_id":{"type":"string"}},"required":["type","file_id"],"additionalProperties":false}]}}]},"type":{"nullable":true,"type":"string","enum":["message"]}},"required":["role","content"],"additionalProperties":false}}]},"text":{"nullable":true,"type":"object","properties":{"format":{"nullable":true,"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"]}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"]}},"required":["type"],"additionalProperties":false}]}},"additionalProperties":false},"files":{"default":[],"nullable":true,"type":"array","items":{"type":"string"}},"skills":{"default":[],"nullable":true,"type":"array","items":{"type":"string"}}},"required":["model","tools","input","files","skills"],"additionalProperties":false}},"required":["version","data"],"additionalProperties":false},{"type":"object","properties":{"version":{"type":"string","enum":["v2"],"description":"Schema version discriminator — must be \"v2\" for the current schema"},"data":{"type":"object","properties":{"models":{"type":"object","properties":{"agent":{"type":"object","properties":{"model":{"type":"string","enum":["claude-sonnet-4-6","claude-sonnet-4-6[1m]","claude-opus-4-6","claude-opus-4-6[1m]","claude-opus-4-7","claude-opus-4-7[1m]","d1-max","duvo-1-max","duvo-1-max-sonnet-1m","duvo-1-max-sonnet-4.5","duvo-1-max-sonnet-4.5-1m","duvo-1-max-opus","duvo-1-max-opus-4.5","gpt-4.1","gpt-4o","gpt-4o-mini","gpt-5","gpt-5.1","claude-sonnet-4-20250514","claude-sonnet-4-20250514[1m]","claude-sonnet-4-5-20250929","claude-sonnet-4-5-20250929[1m]","claude-opus-4-1-20250805","claude-opus-4-5-20251101"],"description":"Claude model identifier used for the primary agent loop"}},"required":["model"],"additionalProperties":false,"description":"Primary Claude agent model configuration"},"browsing":{"type":"object","properties":{"provider":{"type":"string","enum":["google","anthropic"],"description":"Provider backing the browsing/computer-use model"},"model":{"type":"string","enum":["gemini-2.5-pro","gemini-2.5-flash","gemini-3-pro-preview","claude-haiku-4-5","claude-sonnet-4-5","claude-opus-4-1"],"description":"Model identifier for the browsing provider"}},"required":["provider","model"],"additionalProperties":false,"description":"Browsing/computer-use model configuration"}},"required":["agent","browsing"],"additionalProperties":false,"description":"Model configuration for each capability the agent uses"},"input":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["system","user","assistant"]},"content":{"anyOf":[{"type":"string"},{"type":"array","items":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"]},"text":{"type":"string"}},"required":["type","text"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"]},"detail":{"nullable":true,"type":"string","enum":["low","high","auto"]},"file_id":{"nullable":true,"type":"string"},"url":{"nullable":true,"type":"string"}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"]},"file_id":{"type":"string"}},"required":["type","file_id"],"additionalProperties":false}]}}]},"type":{"nullable":true,"type":"string","enum":["message"]}},"required":["role","content"],"additionalProperties":false}}],"description":"Initial agent instructions — either a single system prompt string or a list of structured messages"},"files":{"default":[],"description":"IDs of team files that should be available to the agent","nullable":true,"type":"array","items":{"type":"string"}},"skills":{"default":[],"description":"IDs of skills (team or system) that should be available to the agent","nullable":true,"type":"array","items":{"type":"string"}},"plugins":{"default":[],"description":"Plugins to load — either a built-in plugin name (e.g. \"code-review\") or a GitHub URL (e.g. \"https://github.com/owner/repo\")","nullable":true,"type":"array","items":{"type":"string"}},"subAgents":{"default":[],"description":"IDs of other assignments (agents in the same team) to expose to this assignment as Claude Code subagents. Each sub-assignment runs with its own SOP and connections; the parent can delegate to them via the Agent tool.","nullable":true,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"options":{"description":"Optional runtime options controlling how the agent executes","type":"object","properties":{"browserProvider":{"description":"Browser infrastructure provider","type":"string","enum":["browserbase","browser-use"]},"evaluationSchemaId":{"description":"ID of the evaluation schema to apply to runs of this agent","type":"string"},"benchmarkExpectedOutcomes":{"description":"Expected outcomes used when running benchmark scenarios","type":"array","items":{"type":"object","properties":{"description":{"type":"string","description":"Human-readable description of the expected outcome"},"criteria":{"type":"string","description":"Pass/fail criteria used to evaluate the outcome"}},"required":["description","criteria"],"additionalProperties":false}}},"additionalProperties":{}}},"required":["models","input","files","skills","plugins","subAgents"],"additionalProperties":false,"description":"Agent configuration payload"}},"required":["version","data"],"additionalProperties":false}]},"status":{"nullable":true,"type":"string"},"revision_number":{"nullable":true,"type":"number"},"parent_build_id":{"nullable":true,"type":"string"},"created_by":{"nullable":true,"type":"string"},"created_by_name":{"nullable":true,"type":"string"},"created_at":{"nullable":true,"type":"string"},"updated_at":{"nullable":true,"type":"string"},"schedules":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"build_id":{"type":"string"},"agent_id":{"type":"string"},"user_id":{"type":"string"},"enabled":{"type":"boolean"},"frequency":{"type":"string","enum":["every_5_minutes","every_15_minutes","hourly","daily","workday","weekly","monthly","custom"]},"time":{"nullable":true,"type":"string"},"timezone":{"type":"string"},"day":{"nullable":true,"type":"string"},"day_of_month":{"nullable":true,"type":"number"},"cron":{"nullable":true,"type":"string"},"source":{"nullable":true,"type":"string"},"task":{"nullable":true,"type":"string"},"recurring":{"nullable":true,"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"user_name":{"nullable":true,"type":"string"},"user_email":{"nullable":true,"type":"string"}},"required":["id","build_id","agent_id","user_id","enabled","frequency","time","timezone","day","day_of_month","cron","source","task","recurring","created_at","updated_at"],"additionalProperties":false}}},"required":["id","copilot_id","agent_id","name","config","status","revision_number","parent_build_id","created_by","created_at","updated_at"],"additionalProperties":false}},"required":["build"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/revisions/{build_id}/promote":{"post":{"operationId":"promoteRevision","tags":["Revisions"],"description":"Promote a draft or historic revision to the live version. The live revision is the one used by triggers and new runs. Fails if the revision is already live, or if a draft revision still has an active builder run.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"revision_name":{"description":"Optional display name to set on the promoted revision.","type":"string","minLength":1,"maxLength":80},"revision_description":{"description":"Optional description for the promoted revision. Pass null to clear an existing description.","nullable":true,"type":"string","maxLength":500}}}}}},"parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"path","name":"build_id","required":true,"description":"The build's unique identifier"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/agents":{"post":{"operationId":"createAgent","tags":["Agents"],"description":"Create a new agent. Optionally include a build configuration to create the first build in the same request.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Human-readable agent name"},"thread_id":{"nullable":true,"description":"Existing thread ID to associate with the agent","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"source_build_id":{"nullable":true,"description":"Build ID whose case-queue-consumer setup should be copied to the new agent","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"build":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Build name"},"config":{"type":"object","properties":{"version":{"type":"string","enum":["v2"],"description":"Schema version discriminator — must be \"v2\" for the current schema"},"data":{"type":"object","properties":{"models":{"type":"object","properties":{"agent":{"type":"object","properties":{"model":{"type":"string","enum":["claude-sonnet-4-6","claude-sonnet-4-6[1m]","claude-opus-4-6","claude-opus-4-6[1m]","claude-opus-4-7","claude-opus-4-7[1m]","d1-max","duvo-1-max","duvo-1-max-sonnet-1m","duvo-1-max-sonnet-4.5","duvo-1-max-sonnet-4.5-1m","duvo-1-max-opus","duvo-1-max-opus-4.5","gpt-4.1","gpt-4o","gpt-4o-mini","gpt-5","gpt-5.1","claude-sonnet-4-20250514","claude-sonnet-4-20250514[1m]","claude-sonnet-4-5-20250929","claude-sonnet-4-5-20250929[1m]","claude-opus-4-1-20250805","claude-opus-4-5-20251101"],"description":"Claude model identifier used for the primary agent loop"}},"required":["model"],"description":"Primary Claude agent model configuration"},"browsing":{"type":"object","properties":{"provider":{"type":"string","enum":["google","anthropic"],"description":"Provider backing the browsing/computer-use model"},"model":{"type":"string","enum":["gemini-2.5-pro","gemini-2.5-flash","gemini-3-pro-preview","claude-haiku-4-5","claude-sonnet-4-5","claude-opus-4-1"],"description":"Model identifier for the browsing provider"}},"required":["provider","model"],"description":"Browsing/computer-use model configuration"}},"required":["agent","browsing"],"description":"Model configuration for each capability the agent uses"},"input":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["system","user","assistant"]},"content":{"anyOf":[{"type":"string"},{"type":"array","items":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"]},"text":{"type":"string"}},"required":["type","text"]},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"]},"detail":{"nullable":true,"type":"string","enum":["low","high","auto"]},"file_id":{"nullable":true,"type":"string"},"url":{"nullable":true,"type":"string"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"]},"file_id":{"type":"string"}},"required":["type","file_id"]}]}}]},"type":{"nullable":true,"type":"string","enum":["message"]}},"required":["role","content"]}}],"description":"Initial agent instructions — either a single system prompt string or a list of structured messages"},"files":{"default":[],"description":"IDs of team files that should be available to the agent","nullable":true,"type":"array","items":{"type":"string"}},"skills":{"default":[],"description":"IDs of skills (team or system) that should be available to the agent","nullable":true,"type":"array","items":{"type":"string"}},"plugins":{"default":[],"description":"Plugins to load — either a built-in plugin name (e.g. \"code-review\") or a GitHub URL (e.g. \"https://github.com/owner/repo\")","nullable":true,"type":"array","items":{"type":"string"}},"subAgents":{"default":[],"description":"IDs of other assignments (agents in the same team) to expose to this assignment as Claude Code subagents. Each sub-assignment runs with its own SOP and connections; the parent can delegate to them via the Agent tool.","nullable":true,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"options":{"description":"Optional runtime options controlling how the agent executes","type":"object","properties":{"browserProvider":{"description":"Browser infrastructure provider","type":"string","enum":["browserbase","browser-use"]},"evaluationSchemaId":{"description":"ID of the evaluation schema to apply to runs of this agent","type":"string"},"benchmarkExpectedOutcomes":{"description":"Expected outcomes used when running benchmark scenarios","type":"array","items":{"type":"object","properties":{"description":{"type":"string","description":"Human-readable description of the expected outcome"},"criteria":{"type":"string","description":"Pass/fail criteria used to evaluate the outcome"}},"required":["description","criteria"]}}},"additionalProperties":{}}},"required":["models","input"],"description":"Agent configuration payload"}},"required":["version","data"],"description":"Build configuration (latest schema version only; legacy v1 configs are not accepted)"}},"required":["name","config"],"description":"Optional inline build. When present, a first build is created alongside the agent."}},"required":["name"]}}}},"security":[{"bearerAuth":[]}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"agent":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"name":{"type":"string"},"slack_enabled":{"nullable":true,"type":"boolean"},"microsoft_teams_enabled":{"nullable":true,"type":"boolean"},"agentic_memory_enabled":{"nullable":true,"type":"boolean"},"team_id":{"nullable":true,"type":"string"},"thread_id":{"nullable":true,"type":"string"},"folder_id":{"nullable":true,"type":"string"},"pinned_at":{"nullable":true,"type":"string"},"created_at":{"nullable":true,"type":"string"},"updated_at":{"nullable":true,"type":"string"},"last_run_at":{"nullable":true,"type":"string"},"created_by":{"nullable":true,"type":"object","properties":{"id":{"type":"string"},"name":{"nullable":true,"type":"string"},"email":{"type":"string"}},"required":["id","name","email"],"additionalProperties":false},"updated_by":{"nullable":true,"type":"object","properties":{"id":{"type":"string"},"name":{"nullable":true,"type":"string"},"email":{"type":"string"}},"required":["id","name","email"],"additionalProperties":false},"latest_build":{"nullable":true,"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"copilot_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"agent_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"name":{"type":"string"},"revision_name":{"nullable":true,"type":"string"},"revision_description":{"nullable":true,"type":"string"},"config":{"nullable":true,"anyOf":[{"type":"object","properties":{"version":{"type":"string","enum":["v1"]},"data":{"type":"object","properties":{"model":{"type":"string"},"temperature":{"nullable":true,"type":"number","minimum":0,"maximum":2},"max_output_tokens":{"nullable":true,"type":"number","minimum":0,"exclusiveMinimum":true},"top_p":{"nullable":true,"type":"number","minimum":0,"maximum":1},"store":{"nullable":true,"type":"boolean"},"tools":{},"input":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["system","user","assistant"]},"content":{"anyOf":[{"type":"string"},{"type":"array","items":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"]},"text":{"type":"string"}},"required":["type","text"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"]},"detail":{"nullable":true,"type":"string","enum":["low","high","auto"]},"file_id":{"nullable":true,"type":"string"},"url":{"nullable":true,"type":"string"}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"]},"file_id":{"type":"string"}},"required":["type","file_id"],"additionalProperties":false}]}}]},"type":{"nullable":true,"type":"string","enum":["message"]}},"required":["role","content"],"additionalProperties":false}}]},"text":{"nullable":true,"type":"object","properties":{"format":{"nullable":true,"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"]}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"]}},"required":["type"],"additionalProperties":false}]}},"additionalProperties":false},"files":{"default":[],"nullable":true,"type":"array","items":{"type":"string"}},"skills":{"default":[],"nullable":true,"type":"array","items":{"type":"string"}}},"required":["model","tools","input","files","skills"],"additionalProperties":false}},"required":["version","data"],"additionalProperties":false},{"type":"object","properties":{"version":{"type":"string","enum":["v2"],"description":"Schema version discriminator — must be \"v2\" for the current schema"},"data":{"type":"object","properties":{"models":{"type":"object","properties":{"agent":{"type":"object","properties":{"model":{"type":"string","enum":["claude-sonnet-4-6","claude-sonnet-4-6[1m]","claude-opus-4-6","claude-opus-4-6[1m]","claude-opus-4-7","claude-opus-4-7[1m]","d1-max","duvo-1-max","duvo-1-max-sonnet-1m","duvo-1-max-sonnet-4.5","duvo-1-max-sonnet-4.5-1m","duvo-1-max-opus","duvo-1-max-opus-4.5","gpt-4.1","gpt-4o","gpt-4o-mini","gpt-5","gpt-5.1","claude-sonnet-4-20250514","claude-sonnet-4-20250514[1m]","claude-sonnet-4-5-20250929","claude-sonnet-4-5-20250929[1m]","claude-opus-4-1-20250805","claude-opus-4-5-20251101"],"description":"Claude model identifier used for the primary agent loop"}},"required":["model"],"additionalProperties":false,"description":"Primary Claude agent model configuration"},"browsing":{"type":"object","properties":{"provider":{"type":"string","enum":["google","anthropic"],"description":"Provider backing the browsing/computer-use model"},"model":{"type":"string","enum":["gemini-2.5-pro","gemini-2.5-flash","gemini-3-pro-preview","claude-haiku-4-5","claude-sonnet-4-5","claude-opus-4-1"],"description":"Model identifier for the browsing provider"}},"required":["provider","model"],"additionalProperties":false,"description":"Browsing/computer-use model configuration"}},"required":["agent","browsing"],"additionalProperties":false,"description":"Model configuration for each capability the agent uses"},"input":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["system","user","assistant"]},"content":{"anyOf":[{"type":"string"},{"type":"array","items":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"]},"text":{"type":"string"}},"required":["type","text"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"]},"detail":{"nullable":true,"type":"string","enum":["low","high","auto"]},"file_id":{"nullable":true,"type":"string"},"url":{"nullable":true,"type":"string"}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"]},"file_id":{"type":"string"}},"required":["type","file_id"],"additionalProperties":false}]}}]},"type":{"nullable":true,"type":"string","enum":["message"]}},"required":["role","content"],"additionalProperties":false}}],"description":"Initial agent instructions — either a single system prompt string or a list of structured messages"},"files":{"default":[],"description":"IDs of team files that should be available to the agent","nullable":true,"type":"array","items":{"type":"string"}},"skills":{"default":[],"description":"IDs of skills (team or system) that should be available to the agent","nullable":true,"type":"array","items":{"type":"string"}},"plugins":{"default":[],"description":"Plugins to load — either a built-in plugin name (e.g. \"code-review\") or a GitHub URL (e.g. \"https://github.com/owner/repo\")","nullable":true,"type":"array","items":{"type":"string"}},"subAgents":{"default":[],"description":"IDs of other assignments (agents in the same team) to expose to this assignment as Claude Code subagents. Each sub-assignment runs with its own SOP and connections; the parent can delegate to them via the Agent tool.","nullable":true,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"options":{"description":"Optional runtime options controlling how the agent executes","type":"object","properties":{"browserProvider":{"description":"Browser infrastructure provider","type":"string","enum":["browserbase","browser-use"]},"evaluationSchemaId":{"description":"ID of the evaluation schema to apply to runs of this agent","type":"string"},"benchmarkExpectedOutcomes":{"description":"Expected outcomes used when running benchmark scenarios","type":"array","items":{"type":"object","properties":{"description":{"type":"string","description":"Human-readable description of the expected outcome"},"criteria":{"type":"string","description":"Pass/fail criteria used to evaluate the outcome"}},"required":["description","criteria"],"additionalProperties":false}}},"additionalProperties":{}}},"required":["models","input","files","skills","plugins","subAgents"],"additionalProperties":false,"description":"Agent configuration payload"}},"required":["version","data"],"additionalProperties":false}]},"status":{"nullable":true,"type":"string"},"revision_number":{"nullable":true,"type":"number"},"parent_build_id":{"nullable":true,"type":"string"},"created_by":{"nullable":true,"type":"string"},"created_by_name":{"nullable":true,"type":"string"},"created_at":{"nullable":true,"type":"string"},"updated_at":{"nullable":true,"type":"string"},"schedules":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"build_id":{"type":"string"},"agent_id":{"type":"string"},"user_id":{"type":"string"},"enabled":{"type":"boolean"},"frequency":{"type":"string","enum":["every_5_minutes","every_15_minutes","hourly","daily","workday","weekly","monthly","custom"]},"time":{"nullable":true,"type":"string"},"timezone":{"type":"string"},"day":{"nullable":true,"type":"string"},"day_of_month":{"nullable":true,"type":"number"},"cron":{"nullable":true,"type":"string"},"source":{"nullable":true,"type":"string"},"task":{"nullable":true,"type":"string"},"recurring":{"nullable":true,"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"user_name":{"nullable":true,"type":"string"},"user_email":{"nullable":true,"type":"string"}},"required":["id","build_id","agent_id","user_id","enabled","frequency","time","timezone","day","day_of_month","cron","source","task","recurring","created_at","updated_at"],"additionalProperties":false}}},"required":["id","copilot_id","agent_id","name","config","status","revision_number","parent_build_id","created_by","created_at","updated_at"],"additionalProperties":false},"integration_configs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"integration_id":{"type":"string"},"integration_type":{"type":"string"},"integration_name":{"type":"string"},"created_at":{"type":"string"},"icon_url":{"nullable":true,"type":"string"},"is_connected":{"type":"boolean"}},"required":["id","integration_id","integration_type","integration_name","created_at"],"additionalProperties":false}},"user_triggers":{"type":"object","properties":{"slack_mention":{"type":"boolean"},"slack_channel":{"type":"boolean"},"teams_mention":{"type":"boolean"}},"required":["slack_mention","slack_channel","teams_mention"],"additionalProperties":false},"case_trigger_enabled":{"type":"boolean"},"case_trigger_has_conflict":{"type":"boolean"},"case_trigger_conflicting_agents":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}},"case_queue_name":{"nullable":true,"type":"string"}},"required":["id","name","slack_enabled","microsoft_teams_enabled","agentic_memory_enabled","team_id","thread_id","created_at","updated_at","last_run_at","latest_build","integration_configs"],"additionalProperties":false},"build":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"copilot_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"agent_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"name":{"type":"string"},"revision_name":{"nullable":true,"type":"string"},"revision_description":{"nullable":true,"type":"string"},"config":{"nullable":true,"anyOf":[{"type":"object","properties":{"version":{"type":"string","enum":["v1"]},"data":{"type":"object","properties":{"model":{"type":"string"},"temperature":{"nullable":true,"type":"number","minimum":0,"maximum":2},"max_output_tokens":{"nullable":true,"type":"number","minimum":0,"exclusiveMinimum":true},"top_p":{"nullable":true,"type":"number","minimum":0,"maximum":1},"store":{"nullable":true,"type":"boolean"},"tools":{},"input":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["system","user","assistant"]},"content":{"anyOf":[{"type":"string"},{"type":"array","items":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"]},"text":{"type":"string"}},"required":["type","text"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"]},"detail":{"nullable":true,"type":"string","enum":["low","high","auto"]},"file_id":{"nullable":true,"type":"string"},"url":{"nullable":true,"type":"string"}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"]},"file_id":{"type":"string"}},"required":["type","file_id"],"additionalProperties":false}]}}]},"type":{"nullable":true,"type":"string","enum":["message"]}},"required":["role","content"],"additionalProperties":false}}]},"text":{"nullable":true,"type":"object","properties":{"format":{"nullable":true,"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"]}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"]}},"required":["type"],"additionalProperties":false}]}},"additionalProperties":false},"files":{"default":[],"nullable":true,"type":"array","items":{"type":"string"}},"skills":{"default":[],"nullable":true,"type":"array","items":{"type":"string"}}},"required":["model","tools","input","files","skills"],"additionalProperties":false}},"required":["version","data"],"additionalProperties":false},{"type":"object","properties":{"version":{"type":"string","enum":["v2"],"description":"Schema version discriminator — must be \"v2\" for the current schema"},"data":{"type":"object","properties":{"models":{"type":"object","properties":{"agent":{"type":"object","properties":{"model":{"type":"string","enum":["claude-sonnet-4-6","claude-sonnet-4-6[1m]","claude-opus-4-6","claude-opus-4-6[1m]","claude-opus-4-7","claude-opus-4-7[1m]","d1-max","duvo-1-max","duvo-1-max-sonnet-1m","duvo-1-max-sonnet-4.5","duvo-1-max-sonnet-4.5-1m","duvo-1-max-opus","duvo-1-max-opus-4.5","gpt-4.1","gpt-4o","gpt-4o-mini","gpt-5","gpt-5.1","claude-sonnet-4-20250514","claude-sonnet-4-20250514[1m]","claude-sonnet-4-5-20250929","claude-sonnet-4-5-20250929[1m]","claude-opus-4-1-20250805","claude-opus-4-5-20251101"],"description":"Claude model identifier used for the primary agent loop"}},"required":["model"],"additionalProperties":false,"description":"Primary Claude agent model configuration"},"browsing":{"type":"object","properties":{"provider":{"type":"string","enum":["google","anthropic"],"description":"Provider backing the browsing/computer-use model"},"model":{"type":"string","enum":["gemini-2.5-pro","gemini-2.5-flash","gemini-3-pro-preview","claude-haiku-4-5","claude-sonnet-4-5","claude-opus-4-1"],"description":"Model identifier for the browsing provider"}},"required":["provider","model"],"additionalProperties":false,"description":"Browsing/computer-use model configuration"}},"required":["agent","browsing"],"additionalProperties":false,"description":"Model configuration for each capability the agent uses"},"input":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["system","user","assistant"]},"content":{"anyOf":[{"type":"string"},{"type":"array","items":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"]},"text":{"type":"string"}},"required":["type","text"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"]},"detail":{"nullable":true,"type":"string","enum":["low","high","auto"]},"file_id":{"nullable":true,"type":"string"},"url":{"nullable":true,"type":"string"}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"]},"file_id":{"type":"string"}},"required":["type","file_id"],"additionalProperties":false}]}}]},"type":{"nullable":true,"type":"string","enum":["message"]}},"required":["role","content"],"additionalProperties":false}}],"description":"Initial agent instructions — either a single system prompt string or a list of structured messages"},"files":{"default":[],"description":"IDs of team files that should be available to the agent","nullable":true,"type":"array","items":{"type":"string"}},"skills":{"default":[],"description":"IDs of skills (team or system) that should be available to the agent","nullable":true,"type":"array","items":{"type":"string"}},"plugins":{"default":[],"description":"Plugins to load — either a built-in plugin name (e.g. \"code-review\") or a GitHub URL (e.g. \"https://github.com/owner/repo\")","nullable":true,"type":"array","items":{"type":"string"}},"subAgents":{"default":[],"description":"IDs of other assignments (agents in the same team) to expose to this assignment as Claude Code subagents. Each sub-assignment runs with its own SOP and connections; the parent can delegate to them via the Agent tool.","nullable":true,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"options":{"description":"Optional runtime options controlling how the agent executes","type":"object","properties":{"browserProvider":{"description":"Browser infrastructure provider","type":"string","enum":["browserbase","browser-use"]},"evaluationSchemaId":{"description":"ID of the evaluation schema to apply to runs of this agent","type":"string"},"benchmarkExpectedOutcomes":{"description":"Expected outcomes used when running benchmark scenarios","type":"array","items":{"type":"object","properties":{"description":{"type":"string","description":"Human-readable description of the expected outcome"},"criteria":{"type":"string","description":"Pass/fail criteria used to evaluate the outcome"}},"required":["description","criteria"],"additionalProperties":false}}},"additionalProperties":{}}},"required":["models","input","files","skills","plugins","subAgents"],"additionalProperties":false,"description":"Agent configuration payload"}},"required":["version","data"],"additionalProperties":false}]},"status":{"nullable":true,"type":"string"},"revision_number":{"nullable":true,"type":"number"},"parent_build_id":{"nullable":true,"type":"string"},"created_by":{"nullable":true,"type":"string"},"created_by_name":{"nullable":true,"type":"string"},"created_at":{"nullable":true,"type":"string"},"updated_at":{"nullable":true,"type":"string"},"schedules":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"build_id":{"type":"string"},"agent_id":{"type":"string"},"user_id":{"type":"string"},"enabled":{"type":"boolean"},"frequency":{"type":"string","enum":["every_5_minutes","every_15_minutes","hourly","daily","workday","weekly","monthly","custom"]},"time":{"nullable":true,"type":"string"},"timezone":{"type":"string"},"day":{"nullable":true,"type":"string"},"day_of_month":{"nullable":true,"type":"number"},"cron":{"nullable":true,"type":"string"},"source":{"nullable":true,"type":"string"},"task":{"nullable":true,"type":"string"},"recurring":{"nullable":true,"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"user_name":{"nullable":true,"type":"string"},"user_email":{"nullable":true,"type":"string"}},"required":["id","build_id","agent_id","user_id","enabled","frequency","time","timezone","day","day_of_month","cron","source","task","recurring","created_at","updated_at"],"additionalProperties":false}}},"required":["id","copilot_id","agent_id","name","config","status","revision_number","parent_build_id","created_by","created_at","updated_at"],"additionalProperties":false}},"required":["agent"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}},"get":{"operationId":"listAgents","tags":["Agents"],"description":"List agents for your team.","parameters":[{"schema":{"default":"false","type":"string","enum":["true","false"]},"in":"query","name":"include_schedules","required":false,"description":"Include the authenticated user's schedules for each agent in the response. Schedules are per-user, so this only returns schedules the current user owns."},{"schema":{"default":20,"type":"integer","minimum":1,"maximum":100},"in":"query","name":"limit","required":false,"description":"Number of agents per page (1-100, default 20)"},{"schema":{"type":"integer","minimum":0,"maximum":9007199254740991},"in":"query","name":"offset","required":false,"description":"Number of agents to skip"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"agents":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"name":{"type":"string"},"slack_enabled":{"nullable":true,"type":"boolean"},"microsoft_teams_enabled":{"nullable":true,"type":"boolean"},"agentic_memory_enabled":{"nullable":true,"type":"boolean"},"team_id":{"nullable":true,"type":"string"},"thread_id":{"nullable":true,"type":"string"},"folder_id":{"nullable":true,"type":"string"},"pinned_at":{"nullable":true,"type":"string"},"created_at":{"nullable":true,"type":"string"},"updated_at":{"nullable":true,"type":"string"},"last_run_at":{"nullable":true,"type":"string"},"created_by":{"nullable":true,"type":"object","properties":{"id":{"type":"string"},"name":{"nullable":true,"type":"string"},"email":{"type":"string"}},"required":["id","name","email"],"additionalProperties":false},"updated_by":{"nullable":true,"type":"object","properties":{"id":{"type":"string"},"name":{"nullable":true,"type":"string"},"email":{"type":"string"}},"required":["id","name","email"],"additionalProperties":false},"latest_build":{"nullable":true,"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"copilot_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"agent_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"name":{"type":"string"},"revision_name":{"nullable":true,"type":"string"},"revision_description":{"nullable":true,"type":"string"},"config":{"nullable":true,"anyOf":[{"type":"object","properties":{"version":{"type":"string","enum":["v1"]},"data":{"type":"object","properties":{"model":{"type":"string"},"temperature":{"nullable":true,"type":"number","minimum":0,"maximum":2},"max_output_tokens":{"nullable":true,"type":"number","minimum":0,"exclusiveMinimum":true},"top_p":{"nullable":true,"type":"number","minimum":0,"maximum":1},"store":{"nullable":true,"type":"boolean"},"tools":{},"input":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["system","user","assistant"]},"content":{"anyOf":[{"type":"string"},{"type":"array","items":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"]},"text":{"type":"string"}},"required":["type","text"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"]},"detail":{"nullable":true,"type":"string","enum":["low","high","auto"]},"file_id":{"nullable":true,"type":"string"},"url":{"nullable":true,"type":"string"}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"]},"file_id":{"type":"string"}},"required":["type","file_id"],"additionalProperties":false}]}}]},"type":{"nullable":true,"type":"string","enum":["message"]}},"required":["role","content"],"additionalProperties":false}}]},"text":{"nullable":true,"type":"object","properties":{"format":{"nullable":true,"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"]}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"]}},"required":["type"],"additionalProperties":false}]}},"additionalProperties":false},"files":{"default":[],"nullable":true,"type":"array","items":{"type":"string"}},"skills":{"default":[],"nullable":true,"type":"array","items":{"type":"string"}}},"required":["model","tools","input","files","skills"],"additionalProperties":false}},"required":["version","data"],"additionalProperties":false},{"type":"object","properties":{"version":{"type":"string","enum":["v2"],"description":"Schema version discriminator — must be \"v2\" for the current schema"},"data":{"type":"object","properties":{"models":{"type":"object","properties":{"agent":{"type":"object","properties":{"model":{"type":"string","enum":["claude-sonnet-4-6","claude-sonnet-4-6[1m]","claude-opus-4-6","claude-opus-4-6[1m]","claude-opus-4-7","claude-opus-4-7[1m]","d1-max","duvo-1-max","duvo-1-max-sonnet-1m","duvo-1-max-sonnet-4.5","duvo-1-max-sonnet-4.5-1m","duvo-1-max-opus","duvo-1-max-opus-4.5","gpt-4.1","gpt-4o","gpt-4o-mini","gpt-5","gpt-5.1","claude-sonnet-4-20250514","claude-sonnet-4-20250514[1m]","claude-sonnet-4-5-20250929","claude-sonnet-4-5-20250929[1m]","claude-opus-4-1-20250805","claude-opus-4-5-20251101"],"description":"Claude model identifier used for the primary agent loop"}},"required":["model"],"additionalProperties":false,"description":"Primary Claude agent model configuration"},"browsing":{"type":"object","properties":{"provider":{"type":"string","enum":["google","anthropic"],"description":"Provider backing the browsing/computer-use model"},"model":{"type":"string","enum":["gemini-2.5-pro","gemini-2.5-flash","gemini-3-pro-preview","claude-haiku-4-5","claude-sonnet-4-5","claude-opus-4-1"],"description":"Model identifier for the browsing provider"}},"required":["provider","model"],"additionalProperties":false,"description":"Browsing/computer-use model configuration"}},"required":["agent","browsing"],"additionalProperties":false,"description":"Model configuration for each capability the agent uses"},"input":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["system","user","assistant"]},"content":{"anyOf":[{"type":"string"},{"type":"array","items":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"]},"text":{"type":"string"}},"required":["type","text"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"]},"detail":{"nullable":true,"type":"string","enum":["low","high","auto"]},"file_id":{"nullable":true,"type":"string"},"url":{"nullable":true,"type":"string"}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"]},"file_id":{"type":"string"}},"required":["type","file_id"],"additionalProperties":false}]}}]},"type":{"nullable":true,"type":"string","enum":["message"]}},"required":["role","content"],"additionalProperties":false}}],"description":"Initial agent instructions — either a single system prompt string or a list of structured messages"},"files":{"default":[],"description":"IDs of team files that should be available to the agent","nullable":true,"type":"array","items":{"type":"string"}},"skills":{"default":[],"description":"IDs of skills (team or system) that should be available to the agent","nullable":true,"type":"array","items":{"type":"string"}},"plugins":{"default":[],"description":"Plugins to load — either a built-in plugin name (e.g. \"code-review\") or a GitHub URL (e.g. \"https://github.com/owner/repo\")","nullable":true,"type":"array","items":{"type":"string"}},"subAgents":{"default":[],"description":"IDs of other assignments (agents in the same team) to expose to this assignment as Claude Code subagents. Each sub-assignment runs with its own SOP and connections; the parent can delegate to them via the Agent tool.","nullable":true,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"options":{"description":"Optional runtime options controlling how the agent executes","type":"object","properties":{"browserProvider":{"description":"Browser infrastructure provider","type":"string","enum":["browserbase","browser-use"]},"evaluationSchemaId":{"description":"ID of the evaluation schema to apply to runs of this agent","type":"string"},"benchmarkExpectedOutcomes":{"description":"Expected outcomes used when running benchmark scenarios","type":"array","items":{"type":"object","properties":{"description":{"type":"string","description":"Human-readable description of the expected outcome"},"criteria":{"type":"string","description":"Pass/fail criteria used to evaluate the outcome"}},"required":["description","criteria"],"additionalProperties":false}}},"additionalProperties":{}}},"required":["models","input","files","skills","plugins","subAgents"],"additionalProperties":false,"description":"Agent configuration payload"}},"required":["version","data"],"additionalProperties":false}]},"status":{"nullable":true,"type":"string"},"revision_number":{"nullable":true,"type":"number"},"parent_build_id":{"nullable":true,"type":"string"},"created_by":{"nullable":true,"type":"string"},"created_by_name":{"nullable":true,"type":"string"},"created_at":{"nullable":true,"type":"string"},"updated_at":{"nullable":true,"type":"string"},"schedules":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"build_id":{"type":"string"},"agent_id":{"type":"string"},"user_id":{"type":"string"},"enabled":{"type":"boolean"},"frequency":{"type":"string","enum":["every_5_minutes","every_15_minutes","hourly","daily","workday","weekly","monthly","custom"]},"time":{"nullable":true,"type":"string"},"timezone":{"type":"string"},"day":{"nullable":true,"type":"string"},"day_of_month":{"nullable":true,"type":"number"},"cron":{"nullable":true,"type":"string"},"source":{"nullable":true,"type":"string"},"task":{"nullable":true,"type":"string"},"recurring":{"nullable":true,"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"user_name":{"nullable":true,"type":"string"},"user_email":{"nullable":true,"type":"string"}},"required":["id","build_id","agent_id","user_id","enabled","frequency","time","timezone","day","day_of_month","cron","source","task","recurring","created_at","updated_at"],"additionalProperties":false}}},"required":["id","copilot_id","agent_id","name","config","status","revision_number","parent_build_id","created_by","created_at","updated_at"],"additionalProperties":false},"integration_configs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"integration_id":{"type":"string"},"integration_type":{"type":"string"},"integration_name":{"type":"string"},"created_at":{"type":"string"},"icon_url":{"nullable":true,"type":"string"},"is_connected":{"type":"boolean"}},"required":["id","integration_id","integration_type","integration_name","created_at"],"additionalProperties":false}},"user_triggers":{"type":"object","properties":{"slack_mention":{"type":"boolean"},"slack_channel":{"type":"boolean"},"teams_mention":{"type":"boolean"}},"required":["slack_mention","slack_channel","teams_mention"],"additionalProperties":false},"case_trigger_enabled":{"type":"boolean"},"case_trigger_has_conflict":{"type":"boolean"},"case_trigger_conflicting_agents":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}},"case_queue_name":{"nullable":true,"type":"string"}},"required":["id","name","slack_enabled","microsoft_teams_enabled","agentic_memory_enabled","team_id","thread_id","created_at","updated_at","last_run_at","latest_build","integration_configs"],"additionalProperties":false}},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"limit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"offset":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["agents","total","limit","offset"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/agents/{agent_id}":{"get":{"operationId":"getAgent","tags":["Agents"],"description":"Get an agent by ID.","parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"path","name":"agent_id","required":true,"description":"The agent's unique identifier"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"agent":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"name":{"type":"string"},"slack_enabled":{"nullable":true,"type":"boolean"},"microsoft_teams_enabled":{"nullable":true,"type":"boolean"},"agentic_memory_enabled":{"nullable":true,"type":"boolean"},"team_id":{"nullable":true,"type":"string"},"thread_id":{"nullable":true,"type":"string"},"folder_id":{"nullable":true,"type":"string"},"pinned_at":{"nullable":true,"type":"string"},"created_at":{"nullable":true,"type":"string"},"updated_at":{"nullable":true,"type":"string"},"last_run_at":{"nullable":true,"type":"string"},"created_by":{"nullable":true,"type":"object","properties":{"id":{"type":"string"},"name":{"nullable":true,"type":"string"},"email":{"type":"string"}},"required":["id","name","email"],"additionalProperties":false},"updated_by":{"nullable":true,"type":"object","properties":{"id":{"type":"string"},"name":{"nullable":true,"type":"string"},"email":{"type":"string"}},"required":["id","name","email"],"additionalProperties":false},"latest_build":{"nullable":true,"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"copilot_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"agent_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"name":{"type":"string"},"revision_name":{"nullable":true,"type":"string"},"revision_description":{"nullable":true,"type":"string"},"config":{"nullable":true,"anyOf":[{"type":"object","properties":{"version":{"type":"string","enum":["v1"]},"data":{"type":"object","properties":{"model":{"type":"string"},"temperature":{"nullable":true,"type":"number","minimum":0,"maximum":2},"max_output_tokens":{"nullable":true,"type":"number","minimum":0,"exclusiveMinimum":true},"top_p":{"nullable":true,"type":"number","minimum":0,"maximum":1},"store":{"nullable":true,"type":"boolean"},"tools":{},"input":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["system","user","assistant"]},"content":{"anyOf":[{"type":"string"},{"type":"array","items":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"]},"text":{"type":"string"}},"required":["type","text"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"]},"detail":{"nullable":true,"type":"string","enum":["low","high","auto"]},"file_id":{"nullable":true,"type":"string"},"url":{"nullable":true,"type":"string"}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"]},"file_id":{"type":"string"}},"required":["type","file_id"],"additionalProperties":false}]}}]},"type":{"nullable":true,"type":"string","enum":["message"]}},"required":["role","content"],"additionalProperties":false}}]},"text":{"nullable":true,"type":"object","properties":{"format":{"nullable":true,"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"]}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"]}},"required":["type"],"additionalProperties":false}]}},"additionalProperties":false},"files":{"default":[],"nullable":true,"type":"array","items":{"type":"string"}},"skills":{"default":[],"nullable":true,"type":"array","items":{"type":"string"}}},"required":["model","tools","input","files","skills"],"additionalProperties":false}},"required":["version","data"],"additionalProperties":false},{"type":"object","properties":{"version":{"type":"string","enum":["v2"],"description":"Schema version discriminator — must be \"v2\" for the current schema"},"data":{"type":"object","properties":{"models":{"type":"object","properties":{"agent":{"type":"object","properties":{"model":{"type":"string","enum":["claude-sonnet-4-6","claude-sonnet-4-6[1m]","claude-opus-4-6","claude-opus-4-6[1m]","claude-opus-4-7","claude-opus-4-7[1m]","d1-max","duvo-1-max","duvo-1-max-sonnet-1m","duvo-1-max-sonnet-4.5","duvo-1-max-sonnet-4.5-1m","duvo-1-max-opus","duvo-1-max-opus-4.5","gpt-4.1","gpt-4o","gpt-4o-mini","gpt-5","gpt-5.1","claude-sonnet-4-20250514","claude-sonnet-4-20250514[1m]","claude-sonnet-4-5-20250929","claude-sonnet-4-5-20250929[1m]","claude-opus-4-1-20250805","claude-opus-4-5-20251101"],"description":"Claude model identifier used for the primary agent loop"}},"required":["model"],"additionalProperties":false,"description":"Primary Claude agent model configuration"},"browsing":{"type":"object","properties":{"provider":{"type":"string","enum":["google","anthropic"],"description":"Provider backing the browsing/computer-use model"},"model":{"type":"string","enum":["gemini-2.5-pro","gemini-2.5-flash","gemini-3-pro-preview","claude-haiku-4-5","claude-sonnet-4-5","claude-opus-4-1"],"description":"Model identifier for the browsing provider"}},"required":["provider","model"],"additionalProperties":false,"description":"Browsing/computer-use model configuration"}},"required":["agent","browsing"],"additionalProperties":false,"description":"Model configuration for each capability the agent uses"},"input":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["system","user","assistant"]},"content":{"anyOf":[{"type":"string"},{"type":"array","items":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"]},"text":{"type":"string"}},"required":["type","text"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"]},"detail":{"nullable":true,"type":"string","enum":["low","high","auto"]},"file_id":{"nullable":true,"type":"string"},"url":{"nullable":true,"type":"string"}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"]},"file_id":{"type":"string"}},"required":["type","file_id"],"additionalProperties":false}]}}]},"type":{"nullable":true,"type":"string","enum":["message"]}},"required":["role","content"],"additionalProperties":false}}],"description":"Initial agent instructions — either a single system prompt string or a list of structured messages"},"files":{"default":[],"description":"IDs of team files that should be available to the agent","nullable":true,"type":"array","items":{"type":"string"}},"skills":{"default":[],"description":"IDs of skills (team or system) that should be available to the agent","nullable":true,"type":"array","items":{"type":"string"}},"plugins":{"default":[],"description":"Plugins to load — either a built-in plugin name (e.g. \"code-review\") or a GitHub URL (e.g. \"https://github.com/owner/repo\")","nullable":true,"type":"array","items":{"type":"string"}},"subAgents":{"default":[],"description":"IDs of other assignments (agents in the same team) to expose to this assignment as Claude Code subagents. Each sub-assignment runs with its own SOP and connections; the parent can delegate to them via the Agent tool.","nullable":true,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"options":{"description":"Optional runtime options controlling how the agent executes","type":"object","properties":{"browserProvider":{"description":"Browser infrastructure provider","type":"string","enum":["browserbase","browser-use"]},"evaluationSchemaId":{"description":"ID of the evaluation schema to apply to runs of this agent","type":"string"},"benchmarkExpectedOutcomes":{"description":"Expected outcomes used when running benchmark scenarios","type":"array","items":{"type":"object","properties":{"description":{"type":"string","description":"Human-readable description of the expected outcome"},"criteria":{"type":"string","description":"Pass/fail criteria used to evaluate the outcome"}},"required":["description","criteria"],"additionalProperties":false}}},"additionalProperties":{}}},"required":["models","input","files","skills","plugins","subAgents"],"additionalProperties":false,"description":"Agent configuration payload"}},"required":["version","data"],"additionalProperties":false}]},"status":{"nullable":true,"type":"string"},"revision_number":{"nullable":true,"type":"number"},"parent_build_id":{"nullable":true,"type":"string"},"created_by":{"nullable":true,"type":"string"},"created_by_name":{"nullable":true,"type":"string"},"created_at":{"nullable":true,"type":"string"},"updated_at":{"nullable":true,"type":"string"},"schedules":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"build_id":{"type":"string"},"agent_id":{"type":"string"},"user_id":{"type":"string"},"enabled":{"type":"boolean"},"frequency":{"type":"string","enum":["every_5_minutes","every_15_minutes","hourly","daily","workday","weekly","monthly","custom"]},"time":{"nullable":true,"type":"string"},"timezone":{"type":"string"},"day":{"nullable":true,"type":"string"},"day_of_month":{"nullable":true,"type":"number"},"cron":{"nullable":true,"type":"string"},"source":{"nullable":true,"type":"string"},"task":{"nullable":true,"type":"string"},"recurring":{"nullable":true,"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"user_name":{"nullable":true,"type":"string"},"user_email":{"nullable":true,"type":"string"}},"required":["id","build_id","agent_id","user_id","enabled","frequency","time","timezone","day","day_of_month","cron","source","task","recurring","created_at","updated_at"],"additionalProperties":false}}},"required":["id","copilot_id","agent_id","name","config","status","revision_number","parent_build_id","created_by","created_at","updated_at"],"additionalProperties":false},"integration_configs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"integration_id":{"type":"string"},"integration_type":{"type":"string"},"integration_name":{"type":"string"},"created_at":{"type":"string"},"icon_url":{"nullable":true,"type":"string"},"is_connected":{"type":"boolean"}},"required":["id","integration_id","integration_type","integration_name","created_at"],"additionalProperties":false}},"user_triggers":{"type":"object","properties":{"slack_mention":{"type":"boolean"},"slack_channel":{"type":"boolean"},"teams_mention":{"type":"boolean"}},"required":["slack_mention","slack_channel","teams_mention"],"additionalProperties":false},"case_trigger_enabled":{"type":"boolean"},"case_trigger_has_conflict":{"type":"boolean"},"case_trigger_conflicting_agents":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}},"case_queue_name":{"nullable":true,"type":"string"}},"required":["id","name","slack_enabled","microsoft_teams_enabled","agentic_memory_enabled","team_id","thread_id","created_at","updated_at","last_run_at","latest_build","integration_configs"],"additionalProperties":false}},"required":["agent"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Short error code"},"team_id":{"description":"ID of the team that owns the agent, so the client can auto-switch teams","type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}},"patch":{"operationId":"updateAgent","tags":["Agents"],"description":"Update an agent's display name or delivery settings.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"New agent display name."},"slack_enabled":{"type":"boolean","description":"Whether the agent is reachable via Slack."},"microsoft_teams_enabled":{"type":"boolean","description":"Whether the agent is reachable via Microsoft Teams."},"agentic_memory_enabled":{"type":"boolean","description":"Toggle agentic memory for the agent."},"thread_id":{"nullable":true,"description":"Thread id to associate with the agent, or null to clear.","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"pinned":{"type":"boolean","description":"Pin the agent to the top of the team's assignment list (true) or unpin it (false)."}}}}}},"parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"path","name":"agent_id","required":true,"description":"The agent's unique identifier"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"agent":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"name":{"type":"string"},"slack_enabled":{"nullable":true,"type":"boolean"},"microsoft_teams_enabled":{"nullable":true,"type":"boolean"},"agentic_memory_enabled":{"nullable":true,"type":"boolean"},"team_id":{"nullable":true,"type":"string"},"thread_id":{"nullable":true,"type":"string"},"folder_id":{"nullable":true,"type":"string"},"pinned_at":{"nullable":true,"type":"string"},"created_at":{"nullable":true,"type":"string"},"updated_at":{"nullable":true,"type":"string"},"last_run_at":{"nullable":true,"type":"string"},"created_by":{"nullable":true,"type":"object","properties":{"id":{"type":"string"},"name":{"nullable":true,"type":"string"},"email":{"type":"string"}},"required":["id","name","email"],"additionalProperties":false},"updated_by":{"nullable":true,"type":"object","properties":{"id":{"type":"string"},"name":{"nullable":true,"type":"string"},"email":{"type":"string"}},"required":["id","name","email"],"additionalProperties":false},"latest_build":{"nullable":true,"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"copilot_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"agent_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"name":{"type":"string"},"revision_name":{"nullable":true,"type":"string"},"revision_description":{"nullable":true,"type":"string"},"config":{"nullable":true,"anyOf":[{"type":"object","properties":{"version":{"type":"string","enum":["v1"]},"data":{"type":"object","properties":{"model":{"type":"string"},"temperature":{"nullable":true,"type":"number","minimum":0,"maximum":2},"max_output_tokens":{"nullable":true,"type":"number","minimum":0,"exclusiveMinimum":true},"top_p":{"nullable":true,"type":"number","minimum":0,"maximum":1},"store":{"nullable":true,"type":"boolean"},"tools":{},"input":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["system","user","assistant"]},"content":{"anyOf":[{"type":"string"},{"type":"array","items":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"]},"text":{"type":"string"}},"required":["type","text"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"]},"detail":{"nullable":true,"type":"string","enum":["low","high","auto"]},"file_id":{"nullable":true,"type":"string"},"url":{"nullable":true,"type":"string"}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"]},"file_id":{"type":"string"}},"required":["type","file_id"],"additionalProperties":false}]}}]},"type":{"nullable":true,"type":"string","enum":["message"]}},"required":["role","content"],"additionalProperties":false}}]},"text":{"nullable":true,"type":"object","properties":{"format":{"nullable":true,"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"]}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["json_object"]}},"required":["type"],"additionalProperties":false}]}},"additionalProperties":false},"files":{"default":[],"nullable":true,"type":"array","items":{"type":"string"}},"skills":{"default":[],"nullable":true,"type":"array","items":{"type":"string"}}},"required":["model","tools","input","files","skills"],"additionalProperties":false}},"required":["version","data"],"additionalProperties":false},{"type":"object","properties":{"version":{"type":"string","enum":["v2"],"description":"Schema version discriminator — must be \"v2\" for the current schema"},"data":{"type":"object","properties":{"models":{"type":"object","properties":{"agent":{"type":"object","properties":{"model":{"type":"string","enum":["claude-sonnet-4-6","claude-sonnet-4-6[1m]","claude-opus-4-6","claude-opus-4-6[1m]","claude-opus-4-7","claude-opus-4-7[1m]","d1-max","duvo-1-max","duvo-1-max-sonnet-1m","duvo-1-max-sonnet-4.5","duvo-1-max-sonnet-4.5-1m","duvo-1-max-opus","duvo-1-max-opus-4.5","gpt-4.1","gpt-4o","gpt-4o-mini","gpt-5","gpt-5.1","claude-sonnet-4-20250514","claude-sonnet-4-20250514[1m]","claude-sonnet-4-5-20250929","claude-sonnet-4-5-20250929[1m]","claude-opus-4-1-20250805","claude-opus-4-5-20251101"],"description":"Claude model identifier used for the primary agent loop"}},"required":["model"],"additionalProperties":false,"description":"Primary Claude agent model configuration"},"browsing":{"type":"object","properties":{"provider":{"type":"string","enum":["google","anthropic"],"description":"Provider backing the browsing/computer-use model"},"model":{"type":"string","enum":["gemini-2.5-pro","gemini-2.5-flash","gemini-3-pro-preview","claude-haiku-4-5","claude-sonnet-4-5","claude-opus-4-1"],"description":"Model identifier for the browsing provider"}},"required":["provider","model"],"additionalProperties":false,"description":"Browsing/computer-use model configuration"}},"required":["agent","browsing"],"additionalProperties":false,"description":"Model configuration for each capability the agent uses"},"input":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["system","user","assistant"]},"content":{"anyOf":[{"type":"string"},{"type":"array","items":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["input_text"]},"text":{"type":"string"}},"required":["type","text"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["input_image"]},"detail":{"nullable":true,"type":"string","enum":["low","high","auto"]},"file_id":{"nullable":true,"type":"string"},"url":{"nullable":true,"type":"string"}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["input_file"]},"file_id":{"type":"string"}},"required":["type","file_id"],"additionalProperties":false}]}}]},"type":{"nullable":true,"type":"string","enum":["message"]}},"required":["role","content"],"additionalProperties":false}}],"description":"Initial agent instructions — either a single system prompt string or a list of structured messages"},"files":{"default":[],"description":"IDs of team files that should be available to the agent","nullable":true,"type":"array","items":{"type":"string"}},"skills":{"default":[],"description":"IDs of skills (team or system) that should be available to the agent","nullable":true,"type":"array","items":{"type":"string"}},"plugins":{"default":[],"description":"Plugins to load — either a built-in plugin name (e.g. \"code-review\") or a GitHub URL (e.g. \"https://github.com/owner/repo\")","nullable":true,"type":"array","items":{"type":"string"}},"subAgents":{"default":[],"description":"IDs of other assignments (agents in the same team) to expose to this assignment as Claude Code subagents. Each sub-assignment runs with its own SOP and connections; the parent can delegate to them via the Agent tool.","nullable":true,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"options":{"description":"Optional runtime options controlling how the agent executes","type":"object","properties":{"browserProvider":{"description":"Browser infrastructure provider","type":"string","enum":["browserbase","browser-use"]},"evaluationSchemaId":{"description":"ID of the evaluation schema to apply to runs of this agent","type":"string"},"benchmarkExpectedOutcomes":{"description":"Expected outcomes used when running benchmark scenarios","type":"array","items":{"type":"object","properties":{"description":{"type":"string","description":"Human-readable description of the expected outcome"},"criteria":{"type":"string","description":"Pass/fail criteria used to evaluate the outcome"}},"required":["description","criteria"],"additionalProperties":false}}},"additionalProperties":{}}},"required":["models","input","files","skills","plugins","subAgents"],"additionalProperties":false,"description":"Agent configuration payload"}},"required":["version","data"],"additionalProperties":false}]},"status":{"nullable":true,"type":"string"},"revision_number":{"nullable":true,"type":"number"},"parent_build_id":{"nullable":true,"type":"string"},"created_by":{"nullable":true,"type":"string"},"created_by_name":{"nullable":true,"type":"string"},"created_at":{"nullable":true,"type":"string"},"updated_at":{"nullable":true,"type":"string"},"schedules":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"build_id":{"type":"string"},"agent_id":{"type":"string"},"user_id":{"type":"string"},"enabled":{"type":"boolean"},"frequency":{"type":"string","enum":["every_5_minutes","every_15_minutes","hourly","daily","workday","weekly","monthly","custom"]},"time":{"nullable":true,"type":"string"},"timezone":{"type":"string"},"day":{"nullable":true,"type":"string"},"day_of_month":{"nullable":true,"type":"number"},"cron":{"nullable":true,"type":"string"},"source":{"nullable":true,"type":"string"},"task":{"nullable":true,"type":"string"},"recurring":{"nullable":true,"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"user_name":{"nullable":true,"type":"string"},"user_email":{"nullable":true,"type":"string"}},"required":["id","build_id","agent_id","user_id","enabled","frequency","time","timezone","day","day_of_month","cron","source","task","recurring","created_at","updated_at"],"additionalProperties":false}}},"required":["id","copilot_id","agent_id","name","config","status","revision_number","parent_build_id","created_by","created_at","updated_at"],"additionalProperties":false},"integration_configs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"integration_id":{"type":"string"},"integration_type":{"type":"string"},"integration_name":{"type":"string"},"created_at":{"type":"string"},"icon_url":{"nullable":true,"type":"string"},"is_connected":{"type":"boolean"}},"required":["id","integration_id","integration_type","integration_name","created_at"],"additionalProperties":false}},"user_triggers":{"type":"object","properties":{"slack_mention":{"type":"boolean"},"slack_channel":{"type":"boolean"},"teams_mention":{"type":"boolean"}},"required":["slack_mention","slack_channel","teams_mention"],"additionalProperties":false},"case_trigger_enabled":{"type":"boolean"},"case_trigger_has_conflict":{"type":"boolean"},"case_trigger_conflicting_agents":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}},"case_queue_name":{"nullable":true,"type":"string"}},"required":["id","name","slack_enabled","microsoft_teams_enabled","agentic_memory_enabled","team_id","thread_id","created_at","updated_at","last_run_at","latest_build","integration_configs"],"additionalProperties":false}},"required":["agent"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/agents/{agent_id}/revisions/{build_id}/integrations":{"get":{"operationId":"listRevisionIntegrations","tags":["Revision Integrations"],"description":"List integrations attached to an agent revision.","parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"path","name":"agent_id","required":true,"description":"Agent ID"},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"path","name":"build_id","required":true,"description":"Build ID"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"integrations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"integration_id":{"nullable":true,"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"custom_integration_id":{"nullable":true,"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"integration_type":{"type":"string"},"integration_name":{"type":"string"},"created_at":{"type":"string"}},"required":["id","integration_id","custom_integration_id","integration_type","integration_name","created_at"],"additionalProperties":false}}},"required":["integrations"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}},"post":{"operationId":"attachRevisionIntegrations","tags":["Revision Integrations"],"description":"Attach one or more integrations to an agent revision. To pin specific connections after attachment, use POST /v1/agents/:agent_id/revisions/:build_id/integrations/:integration_id/connections.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"integration_ids":{"minItems":1,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"description":"Integration IDs (or custom integration IDs) to attach to the revision"}},"required":["integration_ids"]}}}},"parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"path","name":"agent_id","required":true,"description":"Agent ID"},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"path","name":"build_id","required":true,"description":"Build ID"}],"security":[{"bearerAuth":[]}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"True if integrations were attached"},"count":{"type":"number","description":"Number of new integrations attached to the revision"}},"required":["success","count"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/agents/{agent_id}/revisions/{build_id}/integrations/{integration_id}":{"delete":{"operationId":"removeRevisionIntegration","tags":["Revision Integrations"],"description":"Remove an integration from an agent revision. Removes the slot for everyone on the revision, including all per-user connection pins. Requires edit permission on the agent.","parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"path","name":"agent_id","required":true,"description":"Agent ID"},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"path","name":"build_id","required":true,"description":"Build ID"},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"path","name":"integration_id","required":true,"description":"Integration ID (catalog integration ID or slot ID from the list response)"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"True if the integration was removed"}},"required":["success"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/agents/{agent_id}/revisions/{build_id}/integrations/{integration_id}/connections":{"get":{"operationId":"listRevisionIntegrationConnections","tags":["Revision Integrations"],"description":"List the connections you have pinned to this build's integration slot. Multi-pin is supported: you can pin multiple connections to the same slot.","parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"path","name":"agent_id","required":true,"description":"Agent ID"},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"path","name":"build_id","required":true,"description":"Build ID"},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"path","name":"integration_id","required":true,"description":"Integration ID (catalog integration ID or slot ID from the list response)"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"connections":{"type":"array","items":{"type":"object","properties":{"connection_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$","description":"Connection (integration_instance) identifier"},"created_at":{"type":"string","description":"ISO 8601 timestamp when the pin was created"}},"required":["connection_id","created_at"],"additionalProperties":false},"description":"Connections pinned by the calling user to this slot"}},"required":["connections"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}},"post":{"operationId":"pinRevisionIntegrationConnection","tags":["Revision Integrations"],"description":"Pin one of your connections (from GET /v1/connections) to this build's integration slot. Multi-pin is supported: a single user can pin multiple connections to the same slot.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"connection_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$","description":"ID of one of your connections (from GET /v1/connections) to pin to this slot"}},"required":["connection_id"]}}}},"parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"path","name":"agent_id","required":true,"description":"Agent ID"},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"path","name":"build_id","required":true,"description":"Build ID"},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"path","name":"integration_id","required":true,"description":"Integration ID (catalog integration ID or slot ID from the list response)"}],"security":[{"bearerAuth":[]}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"True if the connection was pinned"}},"required":["success"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/agents/{agent_id}/revisions/{build_id}/integrations/{integration_id}/connections/{connection_id}":{"delete":{"operationId":"unpinRevisionIntegrationConnection","tags":["Revision Integrations"],"description":"Unpin one of your connections from this build's integration slot. The connection itself is not deleted; only the binding to this slot is removed.","parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"path","name":"agent_id","required":true,"description":"Agent ID"},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"path","name":"build_id","required":true,"description":"Build ID"},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"path","name":"integration_id","required":true,"description":"Integration ID (catalog integration ID or slot ID from the list response)"},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"path","name":"connection_id","required":true,"description":"Connection ID to unpin"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"True if the connection is no longer pinned to the slot"}},"required":["success"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/agents/{agent_id}/revisions/{build_id}/integrations/{integration_id}/queues":{"get":{"operationId":"listRevisionIntegrationQueues","tags":["Revision Integrations"],"description":"List the case queues linked to this build's case-queue integration slot. Only meaningful for case-queue-producer and case-queue-consumer integrations.","parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"path","name":"agent_id","required":true,"description":"Agent ID"},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"path","name":"build_id","required":true,"description":"Build ID"},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"path","name":"integration_id","required":true,"description":"Integration ID"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"queues":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}}},"required":["queues"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}},"put":{"operationId":"replaceRevisionIntegrationQueues","tags":["Revision Integrations"],"description":"Replace the set of case queues linked to this build's case-queue integration slot. Send the full desired queue list — any queues not in the list will be unlinked. Requires edit permission on the agent.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"queue_ids":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"description":"Full set of queue IDs to link to this slot. Replaces any existing links."}},"required":["queue_ids"]}}}},"parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"path","name":"agent_id","required":true,"description":"Agent ID"},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"path","name":"build_id","required":true,"description":"Build ID"},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"path","name":"integration_id","required":true,"description":"Integration ID"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"queues":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}}},"required":["queues"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/agent-folders":{"get":{"operationId":"listAgentFolders","tags":["Agent Folders"],"description":"List all agent folders for the authenticated team.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"folders":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$","description":"Unique folder identifier"},"name":{"type":"string","description":"Folder display name"},"team_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$","description":"ID of the team that owns the folder"},"parent_folder_id":{"nullable":true,"description":"Parent folder ID, or null if this is a root folder","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"created_at":{"type":"string","description":"ISO 8601 creation timestamp"},"updated_at":{"type":"string","description":"ISO 8601 last-update timestamp"},"agent_count":{"type":"number","description":"Number of agents directly inside this folder"},"subfolder_count":{"type":"number","description":"Number of direct subfolders inside this folder"}},"required":["id","name","team_id","parent_folder_id","created_at","updated_at","agent_count","subfolder_count"],"additionalProperties":false},"description":"Agent folders owned by the authenticated team"}},"required":["folders"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}},"post":{"operationId":"createAgentFolder","tags":["Agent Folders"],"description":"Create a new agent folder.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100,"description":"Human-readable folder name"},"parent_folder_id":{"nullable":true,"description":"Parent folder ID for nested folders. Omit or null to create at the root level.","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"}},"required":["name"]}}}},"security":[{"bearerAuth":[]}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"folder":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$","description":"Unique folder identifier"},"name":{"type":"string","description":"Human-readable folder name"},"team_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$","description":"Team that owns the folder"},"parent_folder_id":{"nullable":true,"description":"Parent folder ID, or null if at the root level","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"created_at":{"type":"string","description":"ISO 8601 creation timestamp"},"updated_at":{"type":"string","description":"ISO 8601 last-updated timestamp"}},"required":["id","name","team_id","parent_folder_id","created_at","updated_at"],"additionalProperties":false}},"required":["folder"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/agent-folders/{folder_id}":{"patch":{"operationId":"updateAgentFolder","tags":["Agent Folders"],"description":"Rename an agent folder or move it to a new parent.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"description":"New folder name","type":"string","minLength":1,"maxLength":100},"parent_folder_id":{"description":"New parent folder ID. Pass null to move the folder to the root level.","nullable":true,"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"}}}}}},"parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"path","name":"folder_id","required":true,"description":"The folder's unique identifier"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"folder":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$","description":"Unique folder identifier"},"name":{"type":"string","description":"Human-readable folder name"},"team_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$","description":"Team that owns the folder"},"parent_folder_id":{"nullable":true,"description":"Parent folder ID, or null if at the root level","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"created_at":{"type":"string","description":"ISO 8601 creation timestamp"},"updated_at":{"type":"string","description":"ISO 8601 last-updated timestamp"}},"required":["id","name","team_id","parent_folder_id","created_at","updated_at"],"additionalProperties":false}},"required":["folder"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}},"delete":{"operationId":"deleteAgentFolder","tags":["Agent Folders"],"description":"Delete an agent folder. If the folder contains assignments or subfolders, pass `force=true` to delete it and move the contained assignments to the root level.","parameters":[{"schema":{"type":"string"},"in":"query","name":"force","required":false,"description":"Pass 'true' to delete a folder that still contains assignments or subfolders. Any contained assignments will be moved to the root level."},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"path","name":"folder_id","required":true,"description":"The folder's unique identifier"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Always true on success"}},"required":["success"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Short error message"},"message":{"description":"Human-readable error detail","type":"string"},"has_contents":{"description":"True when the folder still contains assignments or subfolders","type":"boolean"},"agent_count":{"description":"Number of assignments that would be moved to the root level if force=true were passed","type":"number"}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/agent-folders/move-agents":{"post":{"operationId":"moveAgentsToFolder","tags":["Agent Folders"],"description":"Move one or more agents (assignments) into a folder, or to the root level.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"agent_ids":{"minItems":1,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"description":"IDs of the agents (assignments) to move. Must be unique."},"folder_id":{"nullable":true,"description":"Destination folder ID. Pass null to move the agents to the root level.","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"}},"required":["agent_ids","folder_id"]}}}},"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Always true on success"},"moved_count":{"type":"number","description":"Number of agents that were moved"}},"required":["success","moved_count"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/teams/{teamId}/members":{"get":{"operationId":"listTeamMembers","tags":["Team"],"description":"List members of a team. The authenticated session or API key must be scoped to the requested team.","parameters":[{"schema":{"default":50,"type":"integer","minimum":1,"maximum":100},"in":"query","name":"limit","required":false,"description":"Number of members per page (1-100, default 50)"},{"schema":{"type":"integer","minimum":0,"maximum":9007199254740991},"in":"query","name":"offset","required":false,"description":"Number of members to skip"},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"path","name":"teamId","required":true,"description":"Team ID"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"members":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"name":{"nullable":true,"type":"string"},"email":{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"role":{"type":"string"},"inheritedFromOrg":{"default":false,"type":"boolean"}},"required":["id","name","email","role","inheritedFromOrg"],"additionalProperties":false}},"total":{"type":"integer","minimum":0,"maximum":9007199254740991},"limit":{"type":"integer","exclusiveMinimum":true,"maximum":9007199254740991},"offset":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["members","total","limit","offset"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/skills":{"post":{"operationId":"createSkill","tags":["Skills"],"description":"Create or update a skill from a JSON body. The server constructs SKILL.md from the provided fields and stores it. If a skill with the same name already exists in the team, it is updated.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":64,"description":"Skill name. 1-64 lowercase alphanumeric chars and hyphens; no leading/trailing or consecutive hyphens."},"description":{"type":"string","minLength":1,"maxLength":1024,"description":"1-1024 chars describing what the skill does and when to invoke it."},"content":{"type":"string","description":"Markdown body of SKILL.md without YAML frontmatter. The server prepends the frontmatter from the other fields."},"license":{"description":"Optional: license name or reference to a bundled license file.","type":"string"},"compatibility":{"description":"Optional: 1-500 chars describing environment requirements.","type":"string","maxLength":500},"metadata":{"description":"Optional: arbitrary key-value metadata.","type":"object","additionalProperties":{}},"allowed-tools":{"description":"Optional (experimental): space-delimited list of pre-approved tools.","type":"string"}},"required":["name","description","content"]}}}},"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"skill":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$","description":"Unique skill identifier"},"name":{"type":"string","description":"Human-readable skill name"},"description":{"type":"string","description":"Short summary of what the skill does"},"team_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$","description":"ID of the team that owns the skill"}},"required":["id","name","description","team_id"],"additionalProperties":false,"description":"The created or updated skill"}},"required":["skill"],"additionalProperties":false}}}},"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"skill":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$","description":"Unique skill identifier"},"name":{"type":"string","description":"Human-readable skill name"},"description":{"type":"string","description":"Short summary of what the skill does"},"team_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$","description":"ID of the team that owns the skill"}},"required":["id","name","description","team_id"],"additionalProperties":false,"description":"The created or updated skill"}},"required":["skill"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Short error code"},"message":{"description":"Human-readable error message","type":"string"},"validationErrors":{"description":"Per-field validation errors, present on frontmatter validation failure","type":"array","items":{"type":"object","properties":{"field":{"type":"string","description":"Name of the invalid field"},"message":{"type":"string","description":"Validation error message for the field"}},"required":["field","message"],"additionalProperties":false}}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Short error code"},"message":{"description":"Human-readable error message","type":"string"},"validationErrors":{"description":"Per-field validation errors, present on frontmatter validation failure","type":"array","items":{"type":"object","properties":{"field":{"type":"string","description":"Name of the invalid field"},"message":{"type":"string","description":"Validation error message for the field"}},"required":["field","message"],"additionalProperties":false}}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Short error code"},"message":{"description":"Human-readable error message","type":"string"},"validationErrors":{"description":"Per-field validation errors, present on frontmatter validation failure","type":"array","items":{"type":"object","properties":{"field":{"type":"string","description":"Name of the invalid field"},"message":{"type":"string","description":"Validation error message for the field"}},"required":["field","message"],"additionalProperties":false}}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Short error code"},"message":{"description":"Human-readable error message","type":"string"},"validationErrors":{"description":"Per-field validation errors, present on frontmatter validation failure","type":"array","items":{"type":"object","properties":{"field":{"type":"string","description":"Name of the invalid field"},"message":{"type":"string","description":"Validation error message for the field"}},"required":["field","message"],"additionalProperties":false}}},"required":["error"],"additionalProperties":false}}}}}},"get":{"operationId":"listSkills","tags":["Skills"],"description":"List all skills for the current team, including system skills.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"skills":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$","description":"Unique skill identifier"},"name":{"type":"string","description":"Human-readable skill name"},"description":{"type":"string","description":"Short summary of what the skill does"},"team_id":{"nullable":true,"description":"ID of the team that owns the skill, or null for system skills","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"updated_at":{"type":"string","description":"ISO timestamp of the last update"},"updated_by_user_id":{"nullable":true,"description":"User ID of the last person who updated the skill","type":"string"},"updated_by_user_name":{"nullable":true,"description":"Display name of the last person who updated the skill (falls back to email)","type":"string"}},"required":["id","name","description","team_id","updated_at","updated_by_user_id","updated_by_user_name"],"additionalProperties":false},"description":"Skills available to the current team (team and system skills)"}},"required":["skills"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/skills/upload":{"post":{"operationId":"uploadSkill","tags":["Skills"],"description":"Create or update a skill by uploading a SKILL.md file or a ZIP archive containing SKILL.md at the root. If a skill with the same name exists in the team, it will be updated.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"skill":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"name":{"type":"string"},"description":{"type":"string"},"team_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"}},"required":["id","name","description","team_id"],"additionalProperties":false}},"required":["skill"],"additionalProperties":false}}}},"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"skill":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"name":{"type":"string"},"description":{"type":"string"},"team_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"}},"required":["id","name","description","team_id"],"additionalProperties":false}},"required":["skill"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"validationErrors":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}},"required":["field","message"],"additionalProperties":false}}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"validationErrors":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}},"required":["field","message"],"additionalProperties":false}}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"validationErrors":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}},"required":["field","message"],"additionalProperties":false}}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"validationErrors":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}},"required":["field","message"],"additionalProperties":false}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/skills/system":{"get":{"operationId":"listSystemSkills","tags":["Skills"],"description":"List all system skills (skills available to all teams).","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"skills":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$","description":"Unique skill identifier"},"name":{"type":"string","description":"Human-readable skill name"},"description":{"type":"string","description":"Short summary of what the skill does"}},"required":["id","name","description"],"additionalProperties":false},"description":"System skills available to all teams"}},"required":["skills"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/skills/{skill_id}":{"delete":{"operationId":"deleteSkill","tags":["Skills"],"description":"Delete a skill for the current team.","parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"path","name":"skill_id","required":true,"description":"Skill ID."}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"True if the skill was deleted"},"message":{"type":"string","description":"Human-readable result message"}},"required":["success","message"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/skills/{skill_id}/download":{"get":{"operationId":"downloadSkill","tags":["Skills"],"description":"Download a custom skill as a ZIP archive. Only custom (team-owned) skills can be downloaded.","parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"path","name":"skill_id","required":true,"description":"Skill ID."}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/skills/{skill_id}/files":{"get":{"operationId":"listSkillFiles","tags":["Skills"],"description":"List all files in a skill.","parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"path","name":"skill_id","required":true,"description":"Skill ID."}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"File name (basename)"},"path":{"type":"string","description":"Relative path of the file inside the skill"},"size":{"description":"File size in bytes","type":"number"},"contentType":{"description":"MIME content type of the file","type":"string"},"updatedAt":{"description":"ISO 8601 timestamp of the last update","type":"string"}},"required":["name","path"],"additionalProperties":false},"description":"Files contained in the skill"}},"required":["files"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/skills/{skill_id}/files/{*}":{"get":{"operationId":"getSkillFileContent","tags":["Skills"],"description":"Get the content of a file in a skill.","parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"path","name":"skill_id","required":true,"description":"Skill ID."},{"schema":{"type":"string","minLength":1},"in":"path","name":"*","required":true,"description":"Relative path to the file inside the skill, e.g. SKILL.md."}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"content":{"type":"string","description":"UTF-8 decoded contents of the file"},"path":{"type":"string","description":"Relative path of the file inside the skill"},"contentType":{"description":"MIME content type inferred from the file extension","type":"string"}},"required":["content","path"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}},"put":{"operationId":"updateSkillFile","tags":["Skills"],"description":"Update the content of a file in a skill. Only team skills can be edited.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"content":{"type":"string","description":"New UTF-8 text content for the file."}},"required":["content"]}}}},"parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"path","name":"skill_id","required":true,"description":"Skill ID."},{"schema":{"type":"string","minLength":1},"in":"path","name":"*","required":true,"description":"Relative path to the file inside the skill, e.g. SKILL.md."}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"True if the file was updated"},"message":{"type":"string","description":"Human-readable result message"},"skill":{"description":"Updated skill metadata, present only when SKILL.md was edited","type":"object","properties":{"id":{"type":"string","description":"Unique skill identifier"},"name":{"type":"string","description":"Updated skill name parsed from SKILL.md"},"description":{"type":"string","description":"Updated skill description parsed from SKILL.md"}},"required":["id","name","description"],"additionalProperties":false}},"required":["success","message"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Short error code"},"message":{"description":"Human-readable error message","type":"string"},"validationErrors":{"description":"Per-field validation errors, present on frontmatter validation failure","type":"array","items":{"type":"object","properties":{"field":{"type":"string","description":"Name of the invalid field"},"message":{"type":"string","description":"Validation error message for the field"}},"required":["field","message"],"additionalProperties":false}}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Short error code"},"message":{"description":"Human-readable error message","type":"string"},"validationErrors":{"description":"Per-field validation errors, present on frontmatter validation failure","type":"array","items":{"type":"object","properties":{"field":{"type":"string","description":"Name of the invalid field"},"message":{"type":"string","description":"Validation error message for the field"}},"required":["field","message"],"additionalProperties":false}}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Short error code"},"message":{"description":"Human-readable error message","type":"string"},"validationErrors":{"description":"Per-field validation errors, present on frontmatter validation failure","type":"array","items":{"type":"object","properties":{"field":{"type":"string","description":"Name of the invalid field"},"message":{"type":"string","description":"Validation error message for the field"}},"required":["field","message"],"additionalProperties":false}}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Short error code"},"message":{"description":"Human-readable error message","type":"string"},"validationErrors":{"description":"Per-field validation errors, present on frontmatter validation failure","type":"array","items":{"type":"object","properties":{"field":{"type":"string","description":"Name of the invalid field"},"message":{"type":"string","description":"Validation error message for the field"}},"required":["field","message"],"additionalProperties":false}}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Short error code"},"message":{"description":"Human-readable error message","type":"string"},"validationErrors":{"description":"Per-field validation errors, present on frontmatter validation failure","type":"array","items":{"type":"object","properties":{"field":{"type":"string","description":"Name of the invalid field"},"message":{"type":"string","description":"Validation error message for the field"}},"required":["field","message"],"additionalProperties":false}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/skills/{skill_id}/assignments":{"get":{"operationId":"listSkillAssignments","tags":["Skills"],"description":"List the assignments in the current team whose live build references the given skill. Used to warn users that editing a skill will affect every assignment that uses it.","parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"skill_id","required":true,"description":"Skill ID."}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"assignments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Unique assignment (agent) identifier"},"name":{"type":"string","description":"Human-readable assignment name"}},"required":["id","name"],"additionalProperties":false},"description":"Assignments in the current team whose live build uses the skill"},"total":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Total number of assignments referencing the skill"}},"required":["assignments","total"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/files":{"get":{"operationId":"listFiles","tags":["Files"],"description":"List files for the current team.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Unique file identifier"},"name":{"type":"string","description":"File name (basename)"},"path":{"type":"string","description":"Relative path of the file inside the team's storage"},"created_at":{"description":"ISO 8601 timestamp when the file was created","type":"string"},"updated_at":{"description":"ISO 8601 timestamp of the last update","type":"string"},"metadata":{"description":"File metadata from object storage","nullable":true,"type":"object","properties":{"mimetype":{"description":"MIME type of the file","type":"string"},"size":{"description":"File size in bytes","type":"number"}},"additionalProperties":false}},"required":["id","name","path"],"additionalProperties":false},"description":"Files visible to the current team"}},"required":["files"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}},"patch":{"operationId":"renameFile","tags":["Files"],"description":"Rename a file in team storage.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"relativePath":{"type":"string","minLength":1,"description":"Current path of the file relative to the team's storage root"},"newFilenameOnly":{"type":"string","minLength":1,"description":"New file name (no extension; the existing extension is preserved)"}},"required":["relativePath","newFilenameOnly"]}}}},"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"True if the operation succeeded"}},"required":["success"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/files/create-upload-url":{"post":{"operationId":"createFileUploadUrl","tags":["Files"],"description":"Generate a signed URL for uploading a file directly to GCS.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"fileName":{"type":"string","minLength":1,"description":"Name of the file to upload"},"contentType":{"type":"string","minLength":1,"description":"MIME type of the file"}},"required":["fileName","contentType"]}}}},"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"signedUrl":{"type":"string","format":"uri","description":"The signed URL for uploading"},"expiresAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$","description":"When the URL expires"},"filePath":{"type":"string","description":"The path where the file will be stored"}},"required":["signedUrl","expiresAt","filePath"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/files/{*}":{"delete":{"operationId":"deleteFile","tags":["Files"],"description":"Delete a file from team storage.","parameters":[{"schema":{"type":"string","minLength":1},"in":"path","name":"*","required":true,"description":"Path of the file to delete relative to the team's storage root"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"True if the operation succeeded"}},"required":["success"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/files/download-url/{*}":{"get":{"operationId":"getFileDownloadUrl","tags":["Files"],"description":"Generate a signed download URL for a file.","parameters":[{"schema":{"type":"string","minLength":1},"in":"path","name":"*","required":true,"description":"Path of the file relative to the team's storage root"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri","description":"Signed download URL"},"expiresAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$","description":"ISO 8601 timestamp when the URL expires"}},"required":["url","expiresAt"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/files/content/{*}":{"get":{"operationId":"getFileContent","tags":["Files"],"description":"Get the content of a text file.","parameters":[{"schema":{"type":"string","minLength":1},"in":"path","name":"*","required":true,"description":"Path of the file relative to the team's storage root"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"content":{"type":"string","description":"UTF-8 decoded contents of the file"},"path":{"type":"string","description":"Relative path of the file"},"contentType":{"description":"MIME content type inferred from the file extension","type":"string"}},"required":["content","path"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}},"put":{"operationId":"updateFileContent","tags":["Files"],"description":"Update the content of a text file.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"content":{"type":"string","description":"New UTF-8 text content for the file"}},"required":["content"]}}}},"parameters":[{"schema":{"type":"string","minLength":1},"in":"path","name":"*","required":true,"description":"Path of the file relative to the team's storage root"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"True if the operation succeeded"}},"required":["success"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/profile":{"get":{"operationId":"getProfile","tags":["Team"],"description":"Get the profile of the authenticated user (the owner of the API key).","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"profile":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"name":{"nullable":true,"type":"string"},"email":{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"teamId":{"nullable":true,"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"}},"required":["id","name","email","teamId"],"additionalProperties":false}},"required":["profile"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/clarity-v2/processes":{"get":{"operationId":"listClarityProcesses","tags":["ClarityV2"],"description":"List Clarity processes for the current team, most recently created first. Returns lightweight metadata (capture counts, contributors, status) suitable for building a picker; the per-process read model is available via `GET /v1/clarity-v2/processes/:process_id`. Both v1 (legacy) and v2 processes are returned; filter on `version` if you only care about one. Capped at 100 per page.","parameters":[{"schema":{"default":50,"type":"integer","minimum":1,"maximum":100},"in":"query","name":"limit","required":false,"description":"Number of processes per page (1-100, default 50)"},{"schema":{"type":"integer","minimum":0,"maximum":9007199254740991},"in":"query","name":"offset","required":false,"description":"Number of processes to skip (default 0)"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"processes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"name":{"type":"string"},"status":{"type":"string","enum":["draft","collecting","generating","generating-current-process","generating-transformation-proposal","review","complete","generation_failed"]},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"1 = legacy clarity, 2 = clarity v2"},"capture_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"capture_counts":{"type":"object","properties":{"video":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"interview":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"document":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["video","interview","document"],"additionalProperties":false},"pending_invitation_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"contributors":{"type":"array","items":{"type":"object","properties":{"user_id":{"type":"string"},"user_name":{"type":"string"}},"required":["user_id","user_name"],"additionalProperties":false}},"created_at":{"type":"string"},"created_by_name":{"nullable":true,"type":"string"}},"required":["id","name","status","version","capture_count","pending_invitation_count","contributors","created_at","created_by_name"],"additionalProperties":false}},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"limit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"offset":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["processes","total","limit","offset"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/clarity-v2/processes/{process_id}":{"get":{"operationId":"getClarityProcess","tags":["ClarityV2"],"description":"Get the v2 read model for a clarity process: the process row (with operational fields like generation_error, generation_progress, custom_prompt), its captures, and the lightweight version arrays for both snapshot tabs. The full payload of any specific snapshot is fetched lazily via the per-snapshot detail endpoints (`GET .../current-process/:id` and `GET .../transformation-proposal/:id`); this read model deliberately doesn't carry it so the response stays small.","parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"path","name":"process_id","required":true,"description":"The clarity process id"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"process":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$","description":"Clarity process id"},"team_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$","description":"Owning team id"},"user_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$","description":"Creator user id"},"name":{"type":"string","description":"Process name"},"status":{"type":"string","enum":["draft","collecting","generating","generating-current-process","generating-transformation-proposal","review","complete","generation_failed"],"description":"Lifecycle status"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Schema version (always 2 here)"},"generation_error":{"nullable":true,"description":"Error message from the most recent failed generation, if any","type":"string"},"generation_progress":{"nullable":true,"description":"Live progress checklist while a generation is in flight; null otherwise. Field names inside the payload are camelCase, matching the legacy v1 generation-progress shape.","type":"object","properties":{"steps":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"status":{"type":"string","enum":["pending","in_progress","complete"]},"order":{"type":"number"},"count":{"type":"number"}},"required":["key","label","status","order"],"additionalProperties":false}}},"required":["steps"],"additionalProperties":false},"custom_prompt":{"nullable":true,"description":"User-supplied custom prompt that steers generation","type":"string"},"created_at":{"type":"string","description":"ISO 8601 creation timestamp"},"updated_at":{"type":"string","description":"ISO 8601 last-update timestamp"}},"required":["id","team_id","user_id","name","status","version","generation_error","generation_progress","custom_prompt","created_at","updated_at"],"additionalProperties":false},"current_process_versions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$","description":"Snapshot id"},"process_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$","description":"Parent clarity_process id"},"parent_current_process_id":{"nullable":true,"description":"Parent current-process snapshot this draft forked from","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"created_at":{"type":"string","description":"ISO 8601 creation timestamp"},"status":{"type":"string","enum":["live","historic","draft","generating"],"description":"Versioning state. Only one 'live' row per process at a time; drafts may be edited or generating before promotion."},"creator_type":{"type":"string","enum":["human","ai"],"description":"Whether this row was created by a user edit ('human') or an AI pipeline run ('ai')."},"user_id":{"nullable":true,"description":"Creator user id (the human who edited or triggered the run).","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"sandbox_id":{"nullable":true,"description":"E2B sandbox id that produced AI rows; null for user edits.","type":"string"},"last_session_id":{"nullable":true,"description":"Claude SDK session id for artifact-chat follow-up reuse.","type":"string"}},"required":["id","process_id","parent_current_process_id","created_at","status","creator_type","user_id","sandbox_id","last_session_id"],"additionalProperties":false},"description":"All non-deleted current-process snapshots, newest first. Lightweight rows (no `data`) for the version-picker UI. Clients lazy-fetch the live (or selected) snapshot via the per-snapshot detail endpoint."},"transformation_proposal_versions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$","description":"Proposal id"},"process_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$","description":"Parent clarity_process id"},"clarity_current_process_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$","description":"The current-process snapshot this proposal was generated against (provenance only; the live proposal can target any current-process snapshot)."},"parent_transformation_proposal_id":{"nullable":true,"description":"Parent transformation-proposal snapshot this draft forked from","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"created_at":{"type":"string","description":"ISO 8601 creation timestamp"},"status":{"type":"string","enum":["live","historic","draft","generating"],"description":"Versioning state. Only one 'live' row per process at a time; drafts may be edited or generating before promotion."},"creator_type":{"type":"string","enum":["human","ai"],"description":"Whether this row was created by a user edit ('human') or an AI pipeline run ('ai')."},"user_id":{"nullable":true,"description":"Creator user id (the human who edited or triggered the run).","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"sandbox_id":{"nullable":true,"description":"E2B sandbox id that produced AI rows; null for user edits.","type":"string"},"last_session_id":{"nullable":true,"description":"Claude SDK session id for artifact-chat follow-up reuse.","type":"string"},"extra_capture_requests":{"description":"Active extra-capture requests for this proposal. Populated only on the live proposal version row in the read-model endpoint so the FE can render assignment UI without a second round-trip; historic versions return an empty array. Other endpoints (e.g. admin snapshot views) may omit it entirely, in which case it is `undefined`. The standalone list endpoint stays the source of truth for paginated/admin views.","type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$","description":"Extra-capture-request id"},"proposal_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$","description":"The transformation proposal this request belongs to"},"step_id":{"type":"string","description":"Step id within the proposal's BPMN graph"},"capture_id":{"nullable":true,"description":"Capture that fulfilled this request, once one is created","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"requested_user_id":{"nullable":true,"description":"Assigned team member, if any","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"status":{"type":"string","enum":["requested","captured","resolved"],"description":"Lifecycle status of the request"},"gap":{"type":"string","description":"Plain-language gap blocking automation"},"suggested_prompt":{"nullable":true,"description":"LLM-produced suggested capture prompt","type":"string"},"priority":{"type":"string","enum":["low","medium","high"],"description":"Priority of fulfilling this request"},"created_at":{"type":"string","description":"ISO 8601 creation timestamp"},"updated_at":{"type":"string","description":"ISO 8601 last-update timestamp"}},"required":["id","proposal_id","step_id","capture_id","requested_user_id","status","gap","suggested_prompt","priority","created_at","updated_at"],"additionalProperties":false}}},"required":["id","process_id","clarity_current_process_id","parent_transformation_proposal_id","created_at","status","creator_type","user_id","sandbox_id","last_session_id"],"additionalProperties":false},"description":"All non-deleted transformation-proposal snapshots, newest first. Lightweight rows (no `data`) for the version-picker UI."},"captures":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"processId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"userId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"userName":{"type":"string"},"type":{"type":"string","enum":["video","interview","document","screenshare"]},"videoUrl":{"nullable":true,"type":"string"},"videoTranscript":{"nullable":true,"type":"string"},"transcript":{"nullable":true,"type":"array","items":{"type":"object","properties":{"source":{"type":"string","enum":["ai","user","interviewer"]},"message":{"type":"string","minLength":1},"timestamp":{"type":"number"}},"required":["source","message"],"additionalProperties":false}},"status":{"type":"string","enum":["pending","recording","processing","complete","failed"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","processId","userId","type","videoUrl","videoTranscript","transcript","status","createdAt","updatedAt"],"additionalProperties":false},"description":"All captures (videos, interviews, documents) attached to this process. Field names follow the legacy v1 capture wire format (camelCase) so existing capture consumers keep working unchanged."}},"required":["process","current_process_versions","transformation_proposal_versions","captures"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/clarity-v2/processes/{process_id}/current-process":{"post":{"operationId":"generateClarityCurrentProcess","tags":["ClarityV2"],"description":"Trigger the generateCurrentProcess pipeline for a v2 clarity process. Returns 202 immediately and finalises the snapshot asynchronously via the cc-server webhook stream. Visible through GET /v1/clarity-v2/processes/:process_id once complete.","parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"path","name":"process_id","required":true,"description":"The clarity process id"}],"security":[{"bearerAuth":[]}],"responses":{"202":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Generation kickoff was accepted"}},"required":["success"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/clarity-v2/processes/{process_id}/transformation-proposal":{"post":{"operationId":"generateClarityTransformationProposal","tags":["ClarityV2"],"description":"Trigger a transformation-proposal pipeline for a v2 clarity process. With no body or `current_process_id`, runs the generate pipeline against the chosen current-process snapshot (latest by default). With `regenerate_from: <previousProposalId>`, runs the regenerate pipeline anchored to the prior proposal's current-process and the extra captures collected since. Returns 202 immediately and finalises asynchronously via the cc-server webhook stream.","requestBody":{"required":true,"content":{"application/json":{"schema":{"default":{},"type":"object","properties":{"current_process_id":{"description":"ID of a `clarity_current_process` row to anchor the new proposal to. When supplied, runs the generate pipeline against that snapshot. Defaults to the latest snapshot for the process.","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"regenerate_from":{"description":"ID of a `clarity_transformation_proposal` row to refine. When supplied, runs the regenerate pipeline using that proposal's current-process snapshot as the anchor and the extra captures collected since.","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"}},"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"path","name":"process_id","required":true,"description":"The clarity process id"}],"security":[{"bearerAuth":[]}],"responses":{"202":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true],"description":"Generation kickoff was accepted"}},"required":["success"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/clarity-v2/processes/{process_id}/transformation-proposal/stop":{"post":{"operationId":"stopClarityTransformationProposal","tags":["ClarityV2"],"description":"Stop an in-flight transformation-proposal generation. Reads the sandbox id from the process row, kills the sandbox, flips the process back to `review`, and clears the sandbox marker so any late webhook from the killed run is dropped as stale.","parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"path","name":"process_id","required":true,"description":"The clarity process id"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/clarity-v2/processes/{process_id}/postprocess":{"post":{"operationId":"postprocessClaritySnapshot","tags":["ClarityV2"],"description":"Re-run postprocessing agents on an existing v2 clarity snapshot. Targets either the current-process snapshot or the transformation-proposal snapshot, identified by id in the body. Flips the process status to `generating` and returns 202 immediately; agents run asynchronously and flip the status back to `review` once they settle.","requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["current_process"]},"current_process_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$","description":"ID of the `clarity_current_process` snapshot to re-postprocess."}},"required":["type","current_process_id"]},{"type":"object","properties":{"type":{"type":"string","enum":["transformation_proposal"]},"transformation_proposal_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$","description":"ID of the `clarity_transformation_proposal` snapshot to re-postprocess."}},"required":["type","transformation_proposal_id"]}]}}}},"parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"path","name":"process_id","required":true,"description":"The clarity process id"}],"security":[{"bearerAuth":[]}],"responses":{"202":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/clarity-v2/processes/{process_id}/current-process/{current_process_id}":{"delete":{"operationId":"revertClarityCurrentProcess","tags":["ClarityV2"],"description":"Archive a current-process snapshot for a clarity v2 process. v2 only — returns 403 for v1 processes.","parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"path","name":"process_id","required":true,"description":"The clarity process id"},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"path","name":"current_process_id","required":true,"description":"The current-process snapshot id"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}},"get":{"operationId":"getClarityCurrentProcessSnapshot","tags":["ClarityV2"],"description":"Fetch the full payload of a single current-process snapshot, including the BPMN `data` JSONB. Lazy-loaded by the picker when the user selects a specific version. v2 only.","parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"path","name":"process_id","required":true,"description":"The clarity process id"},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"path","name":"current_process_id","required":true,"description":"The current-process snapshot id"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"snapshot":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$","description":"Snapshot id"},"parent_current_process_id":{"nullable":true,"description":"Parent current-process snapshot this draft forked from","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"data":{"type":"object","properties":{"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Schema version for the current process data payload. Increment on breaking changes to the data shape so consumers can branch on the version field."},"steps":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Stable identifier for the step. Referenced by targetSteps[].stepId and by postprocessing agents annotating specific steps. Example: \"step-review-invoice\""},"nodeType":{"type":"string","enum":["event","task","gateway"],"description":"BPMN top-level category. \"event\" for things that happen (start/end/timer/message/escalation), \"task\" for work performed, \"gateway\" for branching decisions."},"nodeSubtype":{"type":"string","enum":["start","end","timer","message","escalation","user","service","send","receive","manual","businessRule","script","exclusive","parallel","inclusive"],"description":"Specific BPMN element. Events: \"start\", \"end\", \"timer\", \"message\", \"escalation\". Tasks: \"user\", \"service\", \"send\", \"receive\", \"manual\", \"businessRule\", \"script\". Gateways: \"exclusive\", \"parallel\", \"inclusive\"."},"targetSteps":{"type":"array","items":{"type":"object","properties":{"stepId":{"type":"string","minLength":1,"description":"Id of the step this edge points to. Must match an existing step.id in the same steps array. Example: \"step-review-invoice\""},"label":{"nullable":true,"description":"Human-readable label shown on the BPMN edge. For gateways, the outcome answer; for default flows, \"Otherwise\". Examples: \"Approved\", \"> $5k\", \"Otherwise\"","type":"string"},"isDefault":{"type":"boolean","description":"True on exactly one outgoing edge of an exclusive or inclusive gateway, marking the fallback taken when no other condition matches. False on all other edges."}},"required":["stepId","label","isDefault"],"additionalProperties":false},"description":"Outgoing BPMN edges from this step. Empty array only on end events. Exclusive and inclusive gateways must have ≥2 entries with exactly one isDefault: true."},"title":{"type":"string","minLength":1,"description":"Short action-oriented heading, 2-5 words. Used as the step's name in lists and BPMN node labels. Example: \"Review invoice\""},"description":{"type":"string","minLength":1,"description":"Full prose paragraph describing what happens in this step in natural language. Used for documentation reconstruction. Example: \"Finance reviews the invoice in NetSuite, checking line item accuracy and matching against the purchase order before flagging for approval.\""},"action":{"nullable":true,"description":"Verb-led one-liner summarizing the concrete action performed. Example: \"Reviews invoice line items in NetSuite against the purchase order.\"","type":"string","minLength":1},"rationale":{"type":"string","minLength":1,"description":"Why this step exists in the process — its purpose or business reason. Used by downstream agents to assess whether the step is essential or removable. Example: \"Catches mispriced line items before they reach the customer and prevents downstream credit notes.\""},"role":{"nullable":true,"description":"Performer of this step — the specific job title, team, or system. Use \"Duvo\" for automated actions and \"System\" for system-triggered steps. Examples: \"Finance Analyst\", \"Sales Operations\", \"Duvo\", \"System\"","type":"string","minLength":1},"sources":{"minItems":1,"type":"array","items":{"type":"object","properties":{"attribution":{"type":"string","minLength":1,"description":"Human-readable source label identifying who or what the evidence comes from. Examples: \"Anna (sales interview)\", \"Onboarding SOP §3.2\", \"Slack #ops 2024-06-12\""},"excerpt":{"type":"string","minLength":1,"description":"Verbatim supporting text quoted from the capture, document, or transcript. Example: \"We always wait for finance to sign off before sending the invoice.\""}},"required":["attribution","excerpt"],"additionalProperties":false},"description":"Evidence supporting this step's existence and details. At least one source is required — every step must trace back to something in the captures."},"system":{"nullable":true,"description":"System, tool, or application used to perform this step. Null when the step is purely manual or is a decision/event with no associated tool. Examples: \"NetSuite\", \"Gmail\", \"Excel\", null","type":"string"},"input":{"nullable":true,"description":"Information or artifacts required to start this step. Null on start events or steps with no preconditions. Example: \"Invoice PDF and matching purchase order number\"","type":"string"},"output":{"nullable":true,"description":"What this step produces or updates. Null on pure waits or events that emit nothing. Example: \"Approved invoice record in NetSuite with reviewer signature\"","type":"string"},"condition":{"nullable":true,"description":"Decision criteria or precondition that gates this step. Null when the step is unconditional. For gateway nodes, this is the question being evaluated. Example: \"Only when invoice total exceeds $10,000\"","type":"string"},"exception":{"nullable":true,"description":"Known exceptions, errors, or failure modes observed in the captures for this step. Null when none were mentioned. Example: \"Customer disputes line items or PO number does not match\"","type":"string"},"handling":{"nullable":true,"description":"How exceptions or escalations are handled — escalation path, fallback action, or retry strategy. Null when no exception or no handling described. Example: \"Escalate to AP manager via email and pause processing until resolved\"","type":"string"},"assumptions":{"nullable":true,"description":"Assumptions the LLM made when extracting this step that were not directly stated in captures. Null if none. Used by verification agents to flag risky inferences. Example: [\"Invoices are reviewed within 24 hours of receipt\"]","type":"array","items":{"type":"string"}},"openQuestions":{"nullable":true,"description":"Specific gaps in understanding that a follow-up capture should address. Null if none. Drives the next interview or document request. Example: [\"Is there a backup approver when the AP manager is out of office?\"]","type":"array","items":{"type":"string"}},"confidence":{"type":"string","enum":["low","medium","high"],"description":"Confidence in the accuracy of this step given evidence quality and completeness. \"high\" = directly stated by multiple sources, \"medium\" = stated by one source or inferred from strong signals, \"low\" = inferred with significant assumptions."},"extraCaptureNeeded":{"nullable":true,"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$","description":"Id of the `clarity_proposal_extra_capture_request` row this slot points at. Created server-side by the agent after the LLM call; the LLM never produces this value."},"gap":{"type":"string","minLength":1,"description":"Plain-language description of what about this step is unknown or under-specified, blocking automation. One short sentence. Example: \"We don't know which fields the AP analyst copies from the invoice into NetSuite.\""},"proposal":{"description":"What the new capture should include in order to resolve the gap — concrete actions, screens, or decisions the user should walk through. Optional: omit when no specific proposal can be inferred. Example: \"Walk through reviewing one invoice in NetSuite end-to-end while narrating each field you check.\"","nullable":true,"type":"string","minLength":1}},"required":["id","gap"],"additionalProperties":false},"readiness":{"description":"Automation-readiness rating for this step. \"high\" = fully automatable today, \"medium\" = partially automatable or needs minor changes, \"low\" = blocked by manual review, judgement, or missing data.","nullable":true,"type":"string","enum":["low","medium","high"]},"readinessRationale":{"description":"One-sentence justification for the readiness rating, citing the specific signals that drove the choice. Example: \"Requires human judgement on edge cases that are not documented in the captures.\"","nullable":true,"type":"string"}},"required":["id","nodeType","nodeSubtype","targetSteps","title","description","action","rationale","role","sources","system","input","output","condition","exception","handling","assumptions","openQuestions","confidence"],"additionalProperties":false},"description":"Ordered steps describing how the process works today, extracted from captures. Array position is the canonical order; BPMN topology is encoded by each step's targetSteps[] edges."},"swot":{"description":"SWOT analysis produced by the swot-analysis postprocessing agent. `undefined` = agent has not yet run; `null` = agent ran and produced no analysis.","nullable":true,"type":"object","properties":{"strengths":{"type":"array","items":{"type":"string","minLength":1},"description":"Internal advantages of the current process — capabilities, resources, or design choices that work in its favour today. Phrase each as a short, evidence-backed statement. Example: \"Bartenders know regulars by name, which keeps service personal during peak hours.\""},"weaknesses":{"type":"array","items":{"type":"string","minLength":1},"description":"Internal limitations of the current process — gaps, inefficiencies, or fragile assumptions visible in how it runs today. Phrase each as a short, evidence-backed statement. Example: \"Manual pour times balloon during rushes because there is only one tap.\""},"opportunities":{"type":"array","items":{"type":"string","minLength":1},"description":"External openings the current process could exploit — adjacent automations, scale effects, or unmet needs surfaced by the captures. Example: \"POS data could feed dynamic pricing for slow hours.\""},"threats":{"type":"array","items":{"type":"string","minLength":1},"description":"External risks that could degrade the current process — regulatory, operational, technological, or human factors visible in the captures. Example: \"New ID-check legislation will require staff to interrupt every order.\""}},"required":["strengths","weaknesses","opportunities","threats"],"additionalProperties":false},"summary":{"description":"One short paragraph (3-5 sentences) describing the captured process at a glance. Surfaced at the top of the current-process tab so reviewers can orient themselves before scanning the steps. Example: \"Customers order beer at the bar; the bartender greets them, picks an option matching their preference, pours and garnishes the glass, then rings the order through the POS before serving.\"","nullable":true,"type":"string","minLength":1}},"required":["version","steps"],"additionalProperties":false,"description":"Opaque BPMN payload describing the captured process. Field names inside `data` are camelCase by design."},"created_at":{"type":"string","description":"ISO 8601 creation timestamp"},"updated_at":{"type":"string","description":"ISO 8601 last-update timestamp"},"status":{"type":"string","enum":["live","historic","draft","generating"],"description":"Versioning state. Only one 'live' row per process at a time; drafts may be edited or generating before promotion."},"creator_type":{"type":"string","enum":["human","ai"],"description":"Whether this row was created by a user edit ('human') or an AI pipeline run ('ai')."},"user_id":{"nullable":true,"description":"Creator user id (the human who edited or triggered the run).","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"sandbox_id":{"nullable":true,"description":"E2B sandbox id that produced AI rows; null for user edits.","type":"string"},"last_session_id":{"nullable":true,"description":"Claude SDK session id for artifact-chat follow-up reuse.","type":"string"}},"required":["id","parent_current_process_id","data","created_at","updated_at","status","creator_type","user_id","sandbox_id","last_session_id"],"additionalProperties":false}},"required":["snapshot"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/clarity-v2/processes/{process_id}/transformation-proposal/{transformation_proposal_id}":{"delete":{"operationId":"revertClarityTransformationProposal","tags":["ClarityV2"],"description":"Archive a transformation proposal for a clarity v2 process. v2 only — returns 403 for v1 processes.","parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"path","name":"process_id","required":true,"description":"The clarity process id"},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"path","name":"transformation_proposal_id","required":true,"description":"The transformation proposal id"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}},"get":{"operationId":"getClarityTransformationProposalSnapshot","tags":["ClarityV2"],"description":"Fetch the full payload of a single transformation-proposal snapshot, including the BPMN `data` JSONB. Lazy-loaded by the picker when the user selects a specific version. v2 only.","parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"path","name":"process_id","required":true,"description":"The clarity process id"},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"path","name":"transformation_proposal_id","required":true,"description":"The transformation-proposal snapshot id"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"snapshot":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$","description":"Proposal id"},"parent_transformation_proposal_id":{"nullable":true,"description":"Parent transformation-proposal snapshot this draft forked from","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"data":{"type":"object","properties":{"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Schema version for the transformation proposal data payload. Increment on breaking changes to the data shape so consumers can branch on the version field."},"steps":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Stable identifier for the step. Referenced by targetSteps[].stepId and by postprocessing agents annotating specific steps. Example: \"step-review-invoice\""},"nodeType":{"type":"string","enum":["event","task","gateway"],"description":"BPMN top-level category. \"event\" for things that happen (start/end/timer/message/escalation), \"task\" for work performed, \"gateway\" for branching decisions."},"nodeSubtype":{"type":"string","enum":["start","end","timer","message","escalation","user","service","send","receive","manual","businessRule","script","exclusive","parallel","inclusive"],"description":"Specific BPMN element. Events: \"start\", \"end\", \"timer\", \"message\", \"escalation\". Tasks: \"user\", \"service\", \"send\", \"receive\", \"manual\", \"businessRule\", \"script\". Gateways: \"exclusive\", \"parallel\", \"inclusive\"."},"targetSteps":{"type":"array","items":{"type":"object","properties":{"stepId":{"type":"string","minLength":1,"description":"Id of the step this edge points to. Must match an existing step.id in the same steps array. Example: \"step-review-invoice\""},"label":{"nullable":true,"description":"Human-readable label shown on the BPMN edge. For gateways, the outcome answer; for default flows, \"Otherwise\". Examples: \"Approved\", \"> $5k\", \"Otherwise\"","type":"string"},"isDefault":{"type":"boolean","description":"True on exactly one outgoing edge of an exclusive or inclusive gateway, marking the fallback taken when no other condition matches. False on all other edges."}},"required":["stepId","label","isDefault"],"additionalProperties":false},"description":"Outgoing BPMN edges from this step. Empty array only on end events. Exclusive and inclusive gateways must have ≥2 entries with exactly one isDefault: true."},"title":{"type":"string","minLength":1,"description":"Short action-oriented heading, 2-5 words. Used as the step's name in lists and BPMN node labels. Example: \"Review invoice\""},"description":{"type":"string","minLength":1,"description":"Full prose paragraph describing what happens in this step in natural language. Used for documentation reconstruction. Example: \"Finance reviews the invoice in NetSuite, checking line item accuracy and matching against the purchase order before flagging for approval.\""},"action":{"nullable":true,"description":"Verb-led one-liner summarizing the concrete action performed. Example: \"Reviews invoice line items in NetSuite against the purchase order.\"","type":"string","minLength":1},"rationale":{"type":"string","minLength":1,"description":"Why this step exists in the process — its purpose or business reason. Used by downstream agents to assess whether the step is essential or removable. Example: \"Catches mispriced line items before they reach the customer and prevents downstream credit notes.\""},"role":{"nullable":true,"description":"Performer of this step — the specific job title, team, or system. Use \"Duvo\" for automated actions and \"System\" for system-triggered steps. Examples: \"Finance Analyst\", \"Sales Operations\", \"Duvo\", \"System\"","type":"string","minLength":1},"sources":{"minItems":1,"type":"array","items":{"type":"object","properties":{"attribution":{"type":"string","minLength":1,"description":"Human-readable source label identifying who or what the evidence comes from. Examples: \"Anna (sales interview)\", \"Onboarding SOP §3.2\", \"Slack #ops 2024-06-12\""},"excerpt":{"type":"string","minLength":1,"description":"Verbatim supporting text quoted from the capture, document, or transcript. Example: \"We always wait for finance to sign off before sending the invoice.\""}},"required":["attribution","excerpt"],"additionalProperties":false},"description":"Evidence supporting this step's existence and details. At least one source is required — every step must trace back to something in the captures."},"system":{"nullable":true,"description":"System, tool, or application used to perform this step. Null when the step is purely manual or is a decision/event with no associated tool. Examples: \"NetSuite\", \"Gmail\", \"Excel\", null","type":"string"},"input":{"nullable":true,"description":"Information or artifacts required to start this step. Null on start events or steps with no preconditions. Example: \"Invoice PDF and matching purchase order number\"","type":"string"},"output":{"nullable":true,"description":"What this step produces or updates. Null on pure waits or events that emit nothing. Example: \"Approved invoice record in NetSuite with reviewer signature\"","type":"string"},"condition":{"nullable":true,"description":"Decision criteria or precondition that gates this step. Null when the step is unconditional. For gateway nodes, this is the question being evaluated. Example: \"Only when invoice total exceeds $10,000\"","type":"string"},"exception":{"nullable":true,"description":"Known exceptions, errors, or failure modes observed in the captures for this step. Null when none were mentioned. Example: \"Customer disputes line items or PO number does not match\"","type":"string"},"handling":{"nullable":true,"description":"How exceptions or escalations are handled — escalation path, fallback action, or retry strategy. Null when no exception or no handling described. Example: \"Escalate to AP manager via email and pause processing until resolved\"","type":"string"},"assumptions":{"nullable":true,"description":"Assumptions the LLM made when extracting this step that were not directly stated in captures. Null if none. Used by verification agents to flag risky inferences. Example: [\"Invoices are reviewed within 24 hours of receipt\"]","type":"array","items":{"type":"string"}},"openQuestions":{"nullable":true,"description":"Specific gaps in understanding that a follow-up capture should address. Null if none. Drives the next interview or document request. Example: [\"Is there a backup approver when the AP manager is out of office?\"]","type":"array","items":{"type":"string"}},"confidence":{"type":"string","enum":["low","medium","high"],"description":"Confidence in the accuracy of this step given evidence quality and completeness. \"high\" = directly stated by multiple sources, \"medium\" = stated by one source or inferred from strong signals, \"low\" = inferred with significant assumptions."},"extraCaptureNeeded":{"nullable":true,"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$","description":"Id of the `clarity_proposal_extra_capture_request` row this slot points at. Created server-side by the agent after the LLM call; the LLM never produces this value."},"gap":{"type":"string","minLength":1,"description":"Plain-language description of what about this step is unknown or under-specified, blocking automation. One short sentence. Example: \"We don't know which fields the AP analyst copies from the invoice into NetSuite.\""},"proposal":{"description":"What the new capture should include in order to resolve the gap — concrete actions, screens, or decisions the user should walk through. Optional: omit when no specific proposal can be inferred. Example: \"Walk through reviewing one invoice in NetSuite end-to-end while narrating each field you check.\"","nullable":true,"type":"string","minLength":1}},"required":["id","gap"],"additionalProperties":false},"readiness":{"description":"Automation-readiness rating for this step. \"high\" = fully automatable today, \"medium\" = partially automatable or needs minor changes, \"low\" = blocked by manual review, judgement, or missing data.","nullable":true,"type":"string","enum":["low","medium","high"]},"readinessRationale":{"description":"One-sentence justification for the readiness rating, citing the specific signals that drove the choice. Example: \"Requires human judgement on edge cases that are not documented in the captures.\"","nullable":true,"type":"string"}},"required":["id","nodeType","nodeSubtype","targetSteps","title","description","action","rationale","role","sources","system","input","output","condition","exception","handling","assumptions","openQuestions","confidence"],"additionalProperties":false},"description":"Ordered steps describing the proposed redesigned process. Same shape as the current process steps; BPMN topology is encoded by each step's targetSteps[] edges."},"summary":{"description":"One short paragraph (3-5 sentences) describing the proposed transformed process at a glance. Surfaced at the top of the transformation-proposal tab so reviewers can orient themselves before scanning the steps. Example: \"Customers self-order on a tablet at the bar; a smart tap auto-pours the chosen beer into a labelled glass, which the customer collects from the pickup counter once payment clears.\"","nullable":true,"type":"string","minLength":1},"projectedImpact":{"description":"Answer-first, MECE-structured business case. 4-8 sentences of prose + one markdown assumptions table. Null when team context is insufficient to produce any quantitative or qualitative assessment.","nullable":true,"type":"string","minLength":1}},"required":["version","steps"],"additionalProperties":false,"description":"Opaque BPMN payload for the proposed transformed process. Field names inside `data` are camelCase by design."},"created_at":{"type":"string","description":"ISO 8601 creation timestamp"},"updated_at":{"type":"string","description":"ISO 8601 last-update timestamp"},"status":{"type":"string","enum":["live","historic","draft","generating"],"description":"Versioning state. Only one 'live' row per process at a time; drafts may be edited or generating before promotion."},"creator_type":{"type":"string","enum":["human","ai"],"description":"Whether this row was created by a user edit ('human') or an AI pipeline run ('ai')."},"user_id":{"nullable":true,"description":"Creator user id (the human who edited or triggered the run).","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"sandbox_id":{"nullable":true,"description":"E2B sandbox id that produced AI rows; null for user edits.","type":"string"},"last_session_id":{"nullable":true,"description":"Claude SDK session id for artifact-chat follow-up reuse.","type":"string"}},"required":["id","parent_transformation_proposal_id","data","created_at","updated_at","status","creator_type","user_id","sandbox_id","last_session_id"],"additionalProperties":false}},"required":["snapshot"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/clarity-v2/processes/{process_id}/automation":{"post":{"operationId":"buildClarityAutomation","tags":["ClarityV2"],"description":"Hand the latest transformation proposal for a v2 clarity process off to the workflow-builder pipeline. Returns 202 with the new run id; the LLM run completes asynchronously.","parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"path","name":"process_id","required":true,"description":"The clarity process id"}],"security":[{"bearerAuth":[]}],"responses":{"202":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"automation_run":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$","description":"Workflow-builder run id"},"status":{"type":"string","enum":["generating"],"description":"Always `generating` immediately after kickoff"}},"required":["id","status"],"additionalProperties":false}},"required":["automation_run"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/clarity-v2/processes/{process_id}/transformation-proposals/{transformation_proposal_id}/extra-capture-requests":{"get":{"operationId":"listClarityExtraCaptureRequests","tags":["ClarityV2"],"description":"List active extra-capture requests for a given transformation proposal of a Clarity v2 process. The caller is expected to know the proposal id from the V2 read model and skip the call when no proposal exists yet.","parameters":[{"schema":{"default":20,"type":"integer","minimum":1,"maximum":100},"in":"query","name":"limit","required":false,"description":"Number of results per page (1-100, default 20)"},{"schema":{"type":"integer","minimum":0,"maximum":9007199254740991},"in":"query","name":"offset","required":false,"description":"Number of results to skip (default 0)"},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"path","name":"process_id","required":true,"description":"The clarity process id"},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"path","name":"transformation_proposal_id","required":true,"description":"The transformation proposal id"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"requests":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$","description":"Extra-capture-request id"},"proposal_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$","description":"The transformation proposal this request belongs to"},"step_id":{"type":"string","description":"Step id within the proposal's BPMN graph"},"capture_id":{"nullable":true,"description":"Capture that fulfilled this request, once one is created","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"requested_user_id":{"nullable":true,"description":"Assigned team member, if any","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"status":{"type":"string","enum":["requested","captured","resolved"],"description":"Lifecycle status of the request"},"gap":{"type":"string","description":"Plain-language gap blocking automation"},"suggested_prompt":{"nullable":true,"description":"LLM-produced suggested capture prompt","type":"string"},"priority":{"type":"string","enum":["low","medium","high"],"description":"Priority of fulfilling this request"},"created_at":{"type":"string","description":"ISO 8601 creation timestamp"},"updated_at":{"type":"string","description":"ISO 8601 last-update timestamp"}},"required":["id","proposal_id","step_id","capture_id","requested_user_id","status","gap","suggested_prompt","priority","created_at","updated_at"],"additionalProperties":false}},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Total matching rows across all pages"},"limit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Page size that was applied"},"offset":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Offset that was applied"}},"required":["requests","total","limit","offset"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/clarity-v2/processes/{process_id}/transformation-proposals/{transformation_proposal_id}/extra-capture-requests/{request_id}/assign":{"patch":{"operationId":"assignClarityExtraCaptureRequest","tags":["ClarityV2"],"description":"Assign (or unassign, with `user_id: null`) a team member to fulfil an extra-capture request. Restricted to admins and managers.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"user_id":{"nullable":true,"description":"Team member to assign, or null to unassign","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"}},"required":["user_id"]}}}},"parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"path","name":"process_id","required":true,"description":"The clarity process id"},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"path","name":"transformation_proposal_id","required":true,"description":"The transformation proposal id"},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"path","name":"request_id","required":true,"description":"The extra-capture-request id"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"request":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$","description":"Extra-capture-request id"},"proposal_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$","description":"The transformation proposal this request belongs to"},"step_id":{"type":"string","description":"Step id within the proposal's BPMN graph"},"capture_id":{"nullable":true,"description":"Capture that fulfilled this request, once one is created","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"requested_user_id":{"nullable":true,"description":"Assigned team member, if any","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"status":{"type":"string","enum":["requested","captured","resolved"],"description":"Lifecycle status of the request"},"gap":{"type":"string","description":"Plain-language gap blocking automation"},"suggested_prompt":{"nullable":true,"description":"LLM-produced suggested capture prompt","type":"string"},"priority":{"type":"string","enum":["low","medium","high"],"description":"Priority of fulfilling this request"},"created_at":{"type":"string","description":"ISO 8601 creation timestamp"},"updated_at":{"type":"string","description":"ISO 8601 last-update timestamp"}},"required":["id","proposal_id","step_id","capture_id","requested_user_id","status","gap","suggested_prompt","priority","created_at","updated_at"],"additionalProperties":false,"description":"The updated extra-capture request, including the new assignee"}},"required":["request"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/clarity-v2/processes/{process_id}/current-process/{current_process_id}/promote":{"post":{"operationId":"promoteClarityCurrentProcess","tags":["ClarityV2"],"description":"Promote a draft or historic current-process snapshot to live. Demotes the previously live row to historic in the same transaction. No-op if the target is already live. v2 only.","parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"path","name":"process_id","required":true,"description":"The clarity process id"},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"path","name":"current_process_id","required":true,"description":"The current-process snapshot id to promote"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"snapshot":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$","description":"Snapshot id"},"parent_current_process_id":{"nullable":true,"description":"Parent current-process snapshot this draft forked from","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"data":{"type":"object","properties":{"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Schema version for the current process data payload. Increment on breaking changes to the data shape so consumers can branch on the version field."},"steps":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Stable identifier for the step. Referenced by targetSteps[].stepId and by postprocessing agents annotating specific steps. Example: \"step-review-invoice\""},"nodeType":{"type":"string","enum":["event","task","gateway"],"description":"BPMN top-level category. \"event\" for things that happen (start/end/timer/message/escalation), \"task\" for work performed, \"gateway\" for branching decisions."},"nodeSubtype":{"type":"string","enum":["start","end","timer","message","escalation","user","service","send","receive","manual","businessRule","script","exclusive","parallel","inclusive"],"description":"Specific BPMN element. Events: \"start\", \"end\", \"timer\", \"message\", \"escalation\". Tasks: \"user\", \"service\", \"send\", \"receive\", \"manual\", \"businessRule\", \"script\". Gateways: \"exclusive\", \"parallel\", \"inclusive\"."},"targetSteps":{"type":"array","items":{"type":"object","properties":{"stepId":{"type":"string","minLength":1,"description":"Id of the step this edge points to. Must match an existing step.id in the same steps array. Example: \"step-review-invoice\""},"label":{"nullable":true,"description":"Human-readable label shown on the BPMN edge. For gateways, the outcome answer; for default flows, \"Otherwise\". Examples: \"Approved\", \"> $5k\", \"Otherwise\"","type":"string"},"isDefault":{"type":"boolean","description":"True on exactly one outgoing edge of an exclusive or inclusive gateway, marking the fallback taken when no other condition matches. False on all other edges."}},"required":["stepId","label","isDefault"],"additionalProperties":false},"description":"Outgoing BPMN edges from this step. Empty array only on end events. Exclusive and inclusive gateways must have ≥2 entries with exactly one isDefault: true."},"title":{"type":"string","minLength":1,"description":"Short action-oriented heading, 2-5 words. Used as the step's name in lists and BPMN node labels. Example: \"Review invoice\""},"description":{"type":"string","minLength":1,"description":"Full prose paragraph describing what happens in this step in natural language. Used for documentation reconstruction. Example: \"Finance reviews the invoice in NetSuite, checking line item accuracy and matching against the purchase order before flagging for approval.\""},"action":{"nullable":true,"description":"Verb-led one-liner summarizing the concrete action performed. Example: \"Reviews invoice line items in NetSuite against the purchase order.\"","type":"string","minLength":1},"rationale":{"type":"string","minLength":1,"description":"Why this step exists in the process — its purpose or business reason. Used by downstream agents to assess whether the step is essential or removable. Example: \"Catches mispriced line items before they reach the customer and prevents downstream credit notes.\""},"role":{"nullable":true,"description":"Performer of this step — the specific job title, team, or system. Use \"Duvo\" for automated actions and \"System\" for system-triggered steps. Examples: \"Finance Analyst\", \"Sales Operations\", \"Duvo\", \"System\"","type":"string","minLength":1},"sources":{"minItems":1,"type":"array","items":{"type":"object","properties":{"attribution":{"type":"string","minLength":1,"description":"Human-readable source label identifying who or what the evidence comes from. Examples: \"Anna (sales interview)\", \"Onboarding SOP §3.2\", \"Slack #ops 2024-06-12\""},"excerpt":{"type":"string","minLength":1,"description":"Verbatim supporting text quoted from the capture, document, or transcript. Example: \"We always wait for finance to sign off before sending the invoice.\""}},"required":["attribution","excerpt"],"additionalProperties":false},"description":"Evidence supporting this step's existence and details. At least one source is required — every step must trace back to something in the captures."},"system":{"nullable":true,"description":"System, tool, or application used to perform this step. Null when the step is purely manual or is a decision/event with no associated tool. Examples: \"NetSuite\", \"Gmail\", \"Excel\", null","type":"string"},"input":{"nullable":true,"description":"Information or artifacts required to start this step. Null on start events or steps with no preconditions. Example: \"Invoice PDF and matching purchase order number\"","type":"string"},"output":{"nullable":true,"description":"What this step produces or updates. Null on pure waits or events that emit nothing. Example: \"Approved invoice record in NetSuite with reviewer signature\"","type":"string"},"condition":{"nullable":true,"description":"Decision criteria or precondition that gates this step. Null when the step is unconditional. For gateway nodes, this is the question being evaluated. Example: \"Only when invoice total exceeds $10,000\"","type":"string"},"exception":{"nullable":true,"description":"Known exceptions, errors, or failure modes observed in the captures for this step. Null when none were mentioned. Example: \"Customer disputes line items or PO number does not match\"","type":"string"},"handling":{"nullable":true,"description":"How exceptions or escalations are handled — escalation path, fallback action, or retry strategy. Null when no exception or no handling described. Example: \"Escalate to AP manager via email and pause processing until resolved\"","type":"string"},"assumptions":{"nullable":true,"description":"Assumptions the LLM made when extracting this step that were not directly stated in captures. Null if none. Used by verification agents to flag risky inferences. Example: [\"Invoices are reviewed within 24 hours of receipt\"]","type":"array","items":{"type":"string"}},"openQuestions":{"nullable":true,"description":"Specific gaps in understanding that a follow-up capture should address. Null if none. Drives the next interview or document request. Example: [\"Is there a backup approver when the AP manager is out of office?\"]","type":"array","items":{"type":"string"}},"confidence":{"type":"string","enum":["low","medium","high"],"description":"Confidence in the accuracy of this step given evidence quality and completeness. \"high\" = directly stated by multiple sources, \"medium\" = stated by one source or inferred from strong signals, \"low\" = inferred with significant assumptions."},"extraCaptureNeeded":{"nullable":true,"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$","description":"Id of the `clarity_proposal_extra_capture_request` row this slot points at. Created server-side by the agent after the LLM call; the LLM never produces this value."},"gap":{"type":"string","minLength":1,"description":"Plain-language description of what about this step is unknown or under-specified, blocking automation. One short sentence. Example: \"We don't know which fields the AP analyst copies from the invoice into NetSuite.\""},"proposal":{"description":"What the new capture should include in order to resolve the gap — concrete actions, screens, or decisions the user should walk through. Optional: omit when no specific proposal can be inferred. Example: \"Walk through reviewing one invoice in NetSuite end-to-end while narrating each field you check.\"","nullable":true,"type":"string","minLength":1}},"required":["id","gap"],"additionalProperties":false},"readiness":{"description":"Automation-readiness rating for this step. \"high\" = fully automatable today, \"medium\" = partially automatable or needs minor changes, \"low\" = blocked by manual review, judgement, or missing data.","nullable":true,"type":"string","enum":["low","medium","high"]},"readinessRationale":{"description":"One-sentence justification for the readiness rating, citing the specific signals that drove the choice. Example: \"Requires human judgement on edge cases that are not documented in the captures.\"","nullable":true,"type":"string"}},"required":["id","nodeType","nodeSubtype","targetSteps","title","description","action","rationale","role","sources","system","input","output","condition","exception","handling","assumptions","openQuestions","confidence"],"additionalProperties":false},"description":"Ordered steps describing how the process works today, extracted from captures. Array position is the canonical order; BPMN topology is encoded by each step's targetSteps[] edges."},"swot":{"description":"SWOT analysis produced by the swot-analysis postprocessing agent. `undefined` = agent has not yet run; `null` = agent ran and produced no analysis.","nullable":true,"type":"object","properties":{"strengths":{"type":"array","items":{"type":"string","minLength":1},"description":"Internal advantages of the current process — capabilities, resources, or design choices that work in its favour today. Phrase each as a short, evidence-backed statement. Example: \"Bartenders know regulars by name, which keeps service personal during peak hours.\""},"weaknesses":{"type":"array","items":{"type":"string","minLength":1},"description":"Internal limitations of the current process — gaps, inefficiencies, or fragile assumptions visible in how it runs today. Phrase each as a short, evidence-backed statement. Example: \"Manual pour times balloon during rushes because there is only one tap.\""},"opportunities":{"type":"array","items":{"type":"string","minLength":1},"description":"External openings the current process could exploit — adjacent automations, scale effects, or unmet needs surfaced by the captures. Example: \"POS data could feed dynamic pricing for slow hours.\""},"threats":{"type":"array","items":{"type":"string","minLength":1},"description":"External risks that could degrade the current process — regulatory, operational, technological, or human factors visible in the captures. Example: \"New ID-check legislation will require staff to interrupt every order.\""}},"required":["strengths","weaknesses","opportunities","threats"],"additionalProperties":false},"summary":{"description":"One short paragraph (3-5 sentences) describing the captured process at a glance. Surfaced at the top of the current-process tab so reviewers can orient themselves before scanning the steps. Example: \"Customers order beer at the bar; the bartender greets them, picks an option matching their preference, pours and garnishes the glass, then rings the order through the POS before serving.\"","nullable":true,"type":"string","minLength":1}},"required":["version","steps"],"additionalProperties":false,"description":"Opaque BPMN payload describing the captured process. Field names inside `data` are camelCase by design."},"created_at":{"type":"string","description":"ISO 8601 creation timestamp"},"updated_at":{"type":"string","description":"ISO 8601 last-update timestamp"},"status":{"type":"string","enum":["live","historic","draft","generating"],"description":"Versioning state. Only one 'live' row per process at a time; drafts may be edited or generating before promotion."},"creator_type":{"type":"string","enum":["human","ai"],"description":"Whether this row was created by a user edit ('human') or an AI pipeline run ('ai')."},"user_id":{"nullable":true,"description":"Creator user id (the human who edited or triggered the run).","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"sandbox_id":{"nullable":true,"description":"E2B sandbox id that produced AI rows; null for user edits.","type":"string"},"last_session_id":{"nullable":true,"description":"Claude SDK session id for artifact-chat follow-up reuse.","type":"string"}},"required":["id","parent_current_process_id","data","created_at","updated_at","status","creator_type","user_id","sandbox_id","last_session_id"],"additionalProperties":false}},"required":["snapshot"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/clarity-v2/processes/{process_id}/transformation-proposal/{transformation_proposal_id}/promote":{"post":{"operationId":"promoteClarityTransformationProposal","tags":["ClarityV2"],"description":"Promote a draft or historic transformation-proposal snapshot to live. Demotes the previously live row to historic in the same transaction. No-op if the target is already live. Live uniqueness is scoped to process_id (not the current-process anchor). v2 only.","parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"path","name":"process_id","required":true,"description":"The clarity process id"},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"path","name":"transformation_proposal_id","required":true,"description":"The transformation-proposal snapshot id to promote"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"snapshot":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$","description":"Proposal id"},"parent_transformation_proposal_id":{"nullable":true,"description":"Parent transformation-proposal snapshot this draft forked from","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"data":{"type":"object","properties":{"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Schema version for the transformation proposal data payload. Increment on breaking changes to the data shape so consumers can branch on the version field."},"steps":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Stable identifier for the step. Referenced by targetSteps[].stepId and by postprocessing agents annotating specific steps. Example: \"step-review-invoice\""},"nodeType":{"type":"string","enum":["event","task","gateway"],"description":"BPMN top-level category. \"event\" for things that happen (start/end/timer/message/escalation), \"task\" for work performed, \"gateway\" for branching decisions."},"nodeSubtype":{"type":"string","enum":["start","end","timer","message","escalation","user","service","send","receive","manual","businessRule","script","exclusive","parallel","inclusive"],"description":"Specific BPMN element. Events: \"start\", \"end\", \"timer\", \"message\", \"escalation\". Tasks: \"user\", \"service\", \"send\", \"receive\", \"manual\", \"businessRule\", \"script\". Gateways: \"exclusive\", \"parallel\", \"inclusive\"."},"targetSteps":{"type":"array","items":{"type":"object","properties":{"stepId":{"type":"string","minLength":1,"description":"Id of the step this edge points to. Must match an existing step.id in the same steps array. Example: \"step-review-invoice\""},"label":{"nullable":true,"description":"Human-readable label shown on the BPMN edge. For gateways, the outcome answer; for default flows, \"Otherwise\". Examples: \"Approved\", \"> $5k\", \"Otherwise\"","type":"string"},"isDefault":{"type":"boolean","description":"True on exactly one outgoing edge of an exclusive or inclusive gateway, marking the fallback taken when no other condition matches. False on all other edges."}},"required":["stepId","label","isDefault"],"additionalProperties":false},"description":"Outgoing BPMN edges from this step. Empty array only on end events. Exclusive and inclusive gateways must have ≥2 entries with exactly one isDefault: true."},"title":{"type":"string","minLength":1,"description":"Short action-oriented heading, 2-5 words. Used as the step's name in lists and BPMN node labels. Example: \"Review invoice\""},"description":{"type":"string","minLength":1,"description":"Full prose paragraph describing what happens in this step in natural language. Used for documentation reconstruction. Example: \"Finance reviews the invoice in NetSuite, checking line item accuracy and matching against the purchase order before flagging for approval.\""},"action":{"nullable":true,"description":"Verb-led one-liner summarizing the concrete action performed. Example: \"Reviews invoice line items in NetSuite against the purchase order.\"","type":"string","minLength":1},"rationale":{"type":"string","minLength":1,"description":"Why this step exists in the process — its purpose or business reason. Used by downstream agents to assess whether the step is essential or removable. Example: \"Catches mispriced line items before they reach the customer and prevents downstream credit notes.\""},"role":{"nullable":true,"description":"Performer of this step — the specific job title, team, or system. Use \"Duvo\" for automated actions and \"System\" for system-triggered steps. Examples: \"Finance Analyst\", \"Sales Operations\", \"Duvo\", \"System\"","type":"string","minLength":1},"sources":{"minItems":1,"type":"array","items":{"type":"object","properties":{"attribution":{"type":"string","minLength":1,"description":"Human-readable source label identifying who or what the evidence comes from. Examples: \"Anna (sales interview)\", \"Onboarding SOP §3.2\", \"Slack #ops 2024-06-12\""},"excerpt":{"type":"string","minLength":1,"description":"Verbatim supporting text quoted from the capture, document, or transcript. Example: \"We always wait for finance to sign off before sending the invoice.\""}},"required":["attribution","excerpt"],"additionalProperties":false},"description":"Evidence supporting this step's existence and details. At least one source is required — every step must trace back to something in the captures."},"system":{"nullable":true,"description":"System, tool, or application used to perform this step. Null when the step is purely manual or is a decision/event with no associated tool. Examples: \"NetSuite\", \"Gmail\", \"Excel\", null","type":"string"},"input":{"nullable":true,"description":"Information or artifacts required to start this step. Null on start events or steps with no preconditions. Example: \"Invoice PDF and matching purchase order number\"","type":"string"},"output":{"nullable":true,"description":"What this step produces or updates. Null on pure waits or events that emit nothing. Example: \"Approved invoice record in NetSuite with reviewer signature\"","type":"string"},"condition":{"nullable":true,"description":"Decision criteria or precondition that gates this step. Null when the step is unconditional. For gateway nodes, this is the question being evaluated. Example: \"Only when invoice total exceeds $10,000\"","type":"string"},"exception":{"nullable":true,"description":"Known exceptions, errors, or failure modes observed in the captures for this step. Null when none were mentioned. Example: \"Customer disputes line items or PO number does not match\"","type":"string"},"handling":{"nullable":true,"description":"How exceptions or escalations are handled — escalation path, fallback action, or retry strategy. Null when no exception or no handling described. Example: \"Escalate to AP manager via email and pause processing until resolved\"","type":"string"},"assumptions":{"nullable":true,"description":"Assumptions the LLM made when extracting this step that were not directly stated in captures. Null if none. Used by verification agents to flag risky inferences. Example: [\"Invoices are reviewed within 24 hours of receipt\"]","type":"array","items":{"type":"string"}},"openQuestions":{"nullable":true,"description":"Specific gaps in understanding that a follow-up capture should address. Null if none. Drives the next interview or document request. Example: [\"Is there a backup approver when the AP manager is out of office?\"]","type":"array","items":{"type":"string"}},"confidence":{"type":"string","enum":["low","medium","high"],"description":"Confidence in the accuracy of this step given evidence quality and completeness. \"high\" = directly stated by multiple sources, \"medium\" = stated by one source or inferred from strong signals, \"low\" = inferred with significant assumptions."},"extraCaptureNeeded":{"nullable":true,"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$","description":"Id of the `clarity_proposal_extra_capture_request` row this slot points at. Created server-side by the agent after the LLM call; the LLM never produces this value."},"gap":{"type":"string","minLength":1,"description":"Plain-language description of what about this step is unknown or under-specified, blocking automation. One short sentence. Example: \"We don't know which fields the AP analyst copies from the invoice into NetSuite.\""},"proposal":{"description":"What the new capture should include in order to resolve the gap — concrete actions, screens, or decisions the user should walk through. Optional: omit when no specific proposal can be inferred. Example: \"Walk through reviewing one invoice in NetSuite end-to-end while narrating each field you check.\"","nullable":true,"type":"string","minLength":1}},"required":["id","gap"],"additionalProperties":false},"readiness":{"description":"Automation-readiness rating for this step. \"high\" = fully automatable today, \"medium\" = partially automatable or needs minor changes, \"low\" = blocked by manual review, judgement, or missing data.","nullable":true,"type":"string","enum":["low","medium","high"]},"readinessRationale":{"description":"One-sentence justification for the readiness rating, citing the specific signals that drove the choice. Example: \"Requires human judgement on edge cases that are not documented in the captures.\"","nullable":true,"type":"string"}},"required":["id","nodeType","nodeSubtype","targetSteps","title","description","action","rationale","role","sources","system","input","output","condition","exception","handling","assumptions","openQuestions","confidence"],"additionalProperties":false},"description":"Ordered steps describing the proposed redesigned process. Same shape as the current process steps; BPMN topology is encoded by each step's targetSteps[] edges."},"summary":{"description":"One short paragraph (3-5 sentences) describing the proposed transformed process at a glance. Surfaced at the top of the transformation-proposal tab so reviewers can orient themselves before scanning the steps. Example: \"Customers self-order on a tablet at the bar; a smart tap auto-pours the chosen beer into a labelled glass, which the customer collects from the pickup counter once payment clears.\"","nullable":true,"type":"string","minLength":1},"projectedImpact":{"description":"Answer-first, MECE-structured business case. 4-8 sentences of prose + one markdown assumptions table. Null when team context is insufficient to produce any quantitative or qualitative assessment.","nullable":true,"type":"string","minLength":1}},"required":["version","steps"],"additionalProperties":false,"description":"Opaque BPMN payload for the proposed transformed process. Field names inside `data` are camelCase by design."},"created_at":{"type":"string","description":"ISO 8601 creation timestamp"},"updated_at":{"type":"string","description":"ISO 8601 last-update timestamp"},"status":{"type":"string","enum":["live","historic","draft","generating"],"description":"Versioning state. Only one 'live' row per process at a time; drafts may be edited or generating before promotion."},"creator_type":{"type":"string","enum":["human","ai"],"description":"Whether this row was created by a user edit ('human') or an AI pipeline run ('ai')."},"user_id":{"nullable":true,"description":"Creator user id (the human who edited or triggered the run).","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"sandbox_id":{"nullable":true,"description":"E2B sandbox id that produced AI rows; null for user edits.","type":"string"},"last_session_id":{"nullable":true,"description":"Claude SDK session id for artifact-chat follow-up reuse.","type":"string"}},"required":["id","parent_transformation_proposal_id","data","created_at","updated_at","status","creator_type","user_id","sandbox_id","last_session_id"],"additionalProperties":false}},"required":["snapshot"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/queues":{"get":{"operationId":"listQueues","tags":["Case Queues"],"description":"List case queues for your team.","parameters":[{"schema":{"default":250,"type":"integer","minimum":1,"maximum":250},"in":"query","name":"limit","required":false,"description":"Number of queues per page (1-250, default 250)"},{"schema":{"type":"integer","minimum":0,"maximum":9007199254740991},"in":"query","name":"offset","required":false,"description":"Number of queues to skip"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"queues":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"name":{"type":"string"},"description":{"nullable":true,"type":"string"},"folder_id":{"nullable":true,"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"created_at":{"type":"string"},"has_approvals":{"type":"boolean"}},"required":["id","name","description","folder_id","created_at","has_approvals"],"additionalProperties":false}},"total":{"type":"number"},"limit":{"type":"number"},"offset":{"type":"number"}},"required":["queues","total","limit","offset"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}},"post":{"operationId":"createQueue","tags":["Case Queues"],"description":"Create a new case queue.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100,"description":"Queue name. Must be unique within the team."},"description":{"description":"Optional human-readable description.","nullable":true,"type":"string","maxLength":500},"folder_id":{"description":"Optional folder to nest the queue under.","nullable":true,"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"}},"required":["name"]}}}},"security":[{"bearerAuth":[]}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"queue":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"name":{"type":"string"},"description":{"nullable":true,"type":"string"},"folder_id":{"nullable":true,"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"created_at":{"type":"string"},"has_approvals":{"type":"boolean"}},"required":["id","name","description","folder_id","created_at","has_approvals"],"additionalProperties":false}},"required":["queue"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/queues/{queue_id}":{"get":{"operationId":"getQueue","tags":["Case Queues"],"description":"Get a case queue by ID.","parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"path","name":"queue_id","required":true,"description":"The queue's unique identifier"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"queue":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"name":{"type":"string"},"description":{"nullable":true,"type":"string"},"folder_id":{"nullable":true,"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"created_at":{"type":"string"},"has_approvals":{"type":"boolean"}},"required":["id","name","description","folder_id","created_at","has_approvals"],"additionalProperties":false}},"required":["queue"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}},"patch":{"operationId":"updateQueue","tags":["Case Queues"],"description":"Update a case queue.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"description":"New queue name. Must be unique within the team.","type":"string","minLength":1,"maxLength":100},"description":{"description":"New description, or null to clear.","nullable":true,"type":"string","maxLength":500},"folder_id":{"description":"New folder id, or null to move to the root.","nullable":true,"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"}}}}}},"parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"path","name":"queue_id","required":true,"description":"The queue's unique identifier"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"queue":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"name":{"type":"string"},"description":{"nullable":true,"type":"string"},"folder_id":{"nullable":true,"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"created_at":{"type":"string"},"has_approvals":{"type":"boolean"}},"required":["id","name","description","folder_id","created_at","has_approvals"],"additionalProperties":false}},"required":["queue"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}},"delete":{"operationId":"deleteQueue","tags":["Case Queues"],"description":"Delete a case queue. Interrupts all associated running jobs first and returns the number of deleted cases plus the IDs of runs that were stopped.","parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"path","name":"queue_id","required":true,"description":"The queue's unique identifier"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"deleted_case_count":{"type":"number"},"interrupted_run_ids":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"}}},"required":["success","deleted_case_count","interrupted_run_ids"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/queues/{queue_id}/cases":{"delete":{"operationId":"clearQueueCases","tags":["Cases"],"description":"Delete every case in a queue. Interrupts any associated running jobs first. Destructive — not exposed via MCP.","parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"path","name":"queue_id","required":true,"description":"The queue's unique identifier"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"deletedCount":{"type":"number"},"interruptedRunIds":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"}}},"required":["success","deletedCount","interruptedRunIds"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}},"get":{"operationId":"listCases","tags":["Cases"],"description":"List cases in a queue. Supports status, date-range, and free-text filters via query params. For label filters, use POST /v1/queues/:queue_id/cases/search.","parameters":[{"schema":{"default":20,"type":"integer","minimum":1,"maximum":100},"in":"query","name":"limit","required":false,"description":"Number of cases per page (1-100, default 20)."},{"schema":{"type":"integer","minimum":0,"maximum":9007199254740991},"in":"query","name":"offset","required":false,"description":"Zero-based offset for pagination."},{"schema":{"type":"string"},"in":"query","name":"status","required":false,"description":"Filter by one or more case statuses (comma-separated). Values: pending, claimed, completed, failed, needs_input, postponed."},{"schema":{"type":"string"},"in":"query","name":"search","required":false,"description":"Full-text search across case title and data."},{"schema":{"type":"string"},"in":"query","name":"created_at_from","required":false,"description":"Return only cases created on or after this ISO-8601 timestamp."},{"schema":{"type":"string"},"in":"query","name":"updated_at_from","required":false,"description":"Return only cases updated on or after this ISO-8601 timestamp."},{"schema":{"default":"created_at","type":"string","enum":["created_at","updated_at","postponed_to"]},"in":"query","name":"sort_by","required":false,"description":"Field to sort by. Default: created_at."},{"schema":{"default":"desc","type":"string","enum":["asc","desc"]},"in":"query","name":"sort_order","required":false,"description":"Sort direction. Default: desc."},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"path","name":"queue_id","required":true,"description":"The queue's unique identifier"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"cases":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"queue_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"title":{"type":"string"},"data":{"type":"string"},"status":{"type":"string","enum":["pending","claimed","completed","failed"]},"claimed_at":{"nullable":true,"type":"string"},"claimed_by_run_id":{"nullable":true,"type":"string"},"completed_at":{"nullable":true,"type":"string"},"postponed_to":{"nullable":true,"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"created_by_user_id":{"nullable":true,"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"created_by_user_name":{"nullable":true,"type":"string"},"created_by_user_email":{"nullable":true,"type":"string"},"agent_run_status":{"nullable":true,"type":"string"},"agent_run_user_id":{"nullable":true,"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"pending_human_request_id":{"nullable":true,"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"pending_approval_batch_id":{"nullable":true,"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"pending_approval_assignee_user_ids":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"}},"approval_approved_count":{"type":"integer","minimum":0,"maximum":9007199254740991},"approval_rejected_count":{"type":"integer","minimum":0,"maximum":9007199254740991},"search_match_data_snippet":{"type":"object","properties":{"before":{"type":"string"},"match":{"type":"string"},"after":{"type":"string"}},"required":["before","match","after"],"additionalProperties":false},"labels":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"key":{"type":"string"},"value":{"type":"string","minLength":1},"color_hue":{"type":"integer","minimum":0,"maximum":360}},"required":["id","key","value","color_hue"],"additionalProperties":false}}},"required":["id","queue_id","title","data","status","claimed_at","claimed_by_run_id","completed_at","postponed_to","created_at","updated_at","created_by_user_id","created_by_user_name","created_by_user_email","agent_run_status","agent_run_user_id","pending_human_request_id","pending_approval_batch_id","pending_approval_assignee_user_ids","approval_approved_count","approval_rejected_count","labels"],"additionalProperties":false}},"total":{"type":"number"},"limit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"offset":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["cases","total","limit","offset"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}},"post":{"operationId":"createCases","tags":["Cases"],"description":"Create one or more cases in a queue. Provide either a single `case` object or a `cases` array (1-100); providing both returns 400. Each case accepts a title (max 500 chars), optional free-form `data`, and optional labels that will be assigned to the case on creation (missing labels are created on the queue).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"case":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":500,"description":"Short title for the case (max 500 characters). Put long context in `data`."},"data":{"description":"Additional data for the case. Free-form text or JSON; Assignments receive this on claim.","type":"string"},"labels":{"description":"Optional labels to assign to the case at creation. Labels are created on the queue if they don't already exist.","maxItems":50,"type":"array","items":{"type":"object","properties":{"key":{"default":"","description":"Label key (omit for a simple tag).","type":"string"},"value":{"type":"string","minLength":1,"description":"Label value (required)."}},"required":["value"]}}},"required":["title"]},"cases":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":500,"description":"Short title for the case (max 500 characters). Put long context in `data`."},"data":{"description":"Additional data for the case. Free-form text or JSON; Assignments receive this on claim.","type":"string"},"labels":{"description":"Optional labels to assign to the case at creation. Labels are created on the queue if they don't already exist.","maxItems":50,"type":"array","items":{"type":"object","properties":{"key":{"default":"","description":"Label key (omit for a simple tag).","type":"string"},"value":{"type":"string","minLength":1,"description":"Label value (required)."}},"required":["value"]}}},"required":["title"]}}}}}}},"parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"path","name":"queue_id","required":true,"description":"The queue's unique identifier"}],"security":[{"bearerAuth":[]}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"added_cases":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"queue_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"title":{"type":"string"},"data":{"type":"string"},"status":{"type":"string","enum":["pending","claimed","completed","failed"]},"claimed_at":{"nullable":true,"type":"string"},"claimed_by_run_id":{"nullable":true,"type":"string"},"completed_at":{"nullable":true,"type":"string"},"postponed_to":{"nullable":true,"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"created_by_user_id":{"nullable":true,"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"created_by_user_name":{"nullable":true,"type":"string"},"created_by_user_email":{"nullable":true,"type":"string"},"agent_run_status":{"nullable":true,"type":"string"},"agent_run_user_id":{"nullable":true,"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"pending_human_request_id":{"nullable":true,"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"pending_approval_batch_id":{"nullable":true,"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"pending_approval_assignee_user_ids":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"}},"approval_approved_count":{"type":"integer","minimum":0,"maximum":9007199254740991},"approval_rejected_count":{"type":"integer","minimum":0,"maximum":9007199254740991},"search_match_data_snippet":{"type":"object","properties":{"before":{"type":"string"},"match":{"type":"string"},"after":{"type":"string"}},"required":["before","match","after"],"additionalProperties":false},"labels":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"key":{"type":"string"},"value":{"type":"string","minLength":1},"color_hue":{"type":"integer","minimum":0,"maximum":360}},"required":["id","key","value","color_hue"],"additionalProperties":false}}},"required":["id","queue_id","title","data","status","claimed_at","claimed_by_run_id","completed_at","postponed_to","created_at","updated_at","created_by_user_id","created_by_user_name","created_by_user_email","agent_run_status","agent_run_user_id","pending_human_request_id","pending_approval_batch_id","pending_approval_assignee_user_ids","approval_approved_count","approval_rejected_count","labels"],"additionalProperties":false}}},"required":["added_cases"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/queues/{queue_id}/cases/search":{"post":{"operationId":"searchCases","tags":["Cases"],"description":"Search cases in a queue with rich filters (multi-status, date ranges, label-based filters). Use this when the simple query-string filters on GET /v1/queues/:queue_id/cases aren't enough.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"filters":{"default":{},"type":"object","properties":{"status":{"type":"array","items":{"type":"string","enum":["pending","claimed","completed","failed","needs_input","postponed"]}},"created_at_from":{"type":"string"},"updated_at_from":{"type":"string"},"labels":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}}},"limit":{"default":25,"type":"integer","minimum":1,"maximum":100},"offset":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"sort_by":{"default":"created_at","type":"string","enum":["created_at","updated_at","postponed_to"]},"sort_order":{"default":"desc","type":"string","enum":["asc","desc"]},"search":{"type":"string"}}}}}},"parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"path","name":"queue_id","required":true,"description":"The queue's unique identifier"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"cases":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"queue_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"title":{"type":"string"},"data":{"type":"string"},"status":{"type":"string","enum":["pending","claimed","completed","failed"]},"claimed_at":{"nullable":true,"type":"string"},"claimed_by_run_id":{"nullable":true,"type":"string"},"completed_at":{"nullable":true,"type":"string"},"postponed_to":{"nullable":true,"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"created_by_user_id":{"nullable":true,"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"created_by_user_name":{"nullable":true,"type":"string"},"created_by_user_email":{"nullable":true,"type":"string"},"agent_run_status":{"nullable":true,"type":"string"},"agent_run_user_id":{"nullable":true,"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"pending_human_request_id":{"nullable":true,"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"pending_approval_batch_id":{"nullable":true,"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"pending_approval_assignee_user_ids":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"}},"approval_approved_count":{"type":"integer","minimum":0,"maximum":9007199254740991},"approval_rejected_count":{"type":"integer","minimum":0,"maximum":9007199254740991},"search_match_data_snippet":{"type":"object","properties":{"before":{"type":"string"},"match":{"type":"string"},"after":{"type":"string"}},"required":["before","match","after"],"additionalProperties":false},"labels":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"key":{"type":"string"},"value":{"type":"string","minLength":1},"color_hue":{"type":"integer","minimum":0,"maximum":360}},"required":["id","key","value","color_hue"],"additionalProperties":false}}},"required":["id","queue_id","title","data","status","claimed_at","claimed_by_run_id","completed_at","postponed_to","created_at","updated_at","created_by_user_id","created_by_user_name","created_by_user_email","agent_run_status","agent_run_user_id","pending_human_request_id","pending_approval_batch_id","pending_approval_assignee_user_ids","approval_approved_count","approval_rejected_count","labels"],"additionalProperties":false}},"total":{"type":"number"},"limit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"offset":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["cases","total","limit","offset"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/cases/{case_id}":{"get":{"operationId":"getCase","tags":["Cases"],"description":"Get a case by ID. Returns the case, its event history, and every case-approval batch ever created on the case (newest first).","parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"path","name":"case_id","required":true,"description":"The case's unique identifier"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"case":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"queue_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"title":{"type":"string"},"data":{"type":"string"},"status":{"type":"string","enum":["pending","claimed","completed","failed"]},"claimed_at":{"nullable":true,"type":"string"},"claimed_by_run_id":{"nullable":true,"type":"string"},"completed_at":{"nullable":true,"type":"string"},"postponed_to":{"nullable":true,"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"created_by_user_id":{"nullable":true,"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"created_by_user_name":{"nullable":true,"type":"string"},"created_by_user_email":{"nullable":true,"type":"string"},"agent_run_status":{"nullable":true,"type":"string"},"agent_run_user_id":{"nullable":true,"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"pending_human_request_id":{"nullable":true,"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"pending_approval_batch_id":{"nullable":true,"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"pending_approval_assignee_user_ids":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"}},"approval_approved_count":{"type":"integer","minimum":0,"maximum":9007199254740991},"approval_rejected_count":{"type":"integer","minimum":0,"maximum":9007199254740991},"search_match_data_snippet":{"type":"object","properties":{"before":{"type":"string"},"match":{"type":"string"},"after":{"type":"string"}},"required":["before","match","after"],"additionalProperties":false},"labels":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"key":{"type":"string"},"value":{"type":"string","minLength":1},"color_hue":{"type":"integer","minimum":0,"maximum":360}},"required":["id","key","value","color_hue"],"additionalProperties":false}}},"required":["id","queue_id","title","data","status","claimed_at","claimed_by_run_id","completed_at","postponed_to","created_at","updated_at","created_by_user_id","created_by_user_name","created_by_user_email","agent_run_status","agent_run_user_id","pending_human_request_id","pending_approval_batch_id","pending_approval_assignee_user_ids","approval_approved_count","approval_rejected_count","labels"],"additionalProperties":false},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"case_queue_item_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"agent_run_id":{"nullable":true,"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"human_request_id":{"nullable":true,"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"type":{"type":"string"},"created_at":{"type":"string"},"agent_id":{"nullable":true,"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"agent_name":{"nullable":true,"type":"string"},"user_id":{"nullable":true,"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"user_name":{"nullable":true,"type":"string"},"user_email":{"nullable":true,"type":"string"},"human_request_title":{"nullable":true,"type":"string"}},"required":["id","case_queue_item_id","agent_run_id","human_request_id","type","created_at","agent_id","agent_name","user_id","user_name","user_email","human_request_title"],"additionalProperties":false}},"approvalBatches":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"case_queue_item_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"agent_run_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"title":{"type":"string"},"created_at":{"type":"string"},"resolved_at":{"nullable":true,"type":"string"},"cancelled_at":{"nullable":true,"type":"string"},"cancellation_reason":{"nullable":true,"type":"string"},"rows":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"assignee_user_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"assignee_name":{"nullable":true,"type":"string"},"assignee_email":{"nullable":true,"type":"string"},"prompt":{"type":"string"},"decision":{"nullable":true,"type":"string","enum":["approved","rejected"]},"responded_at":{"nullable":true,"type":"string"},"responded_by_user_id":{"nullable":true,"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"responded_by_name":{"nullable":true,"type":"string"},"responded_by_email":{"nullable":true,"type":"string"},"cancelled_at":{"nullable":true,"type":"string"},"cancellation_reason":{"nullable":true,"type":"string"}},"required":["id","assignee_user_id","assignee_name","assignee_email","prompt","decision","responded_at","responded_by_user_id","responded_by_name","responded_by_email","cancelled_at","cancellation_reason"],"additionalProperties":false}}},"required":["id","case_queue_item_id","agent_run_id","title","created_at","resolved_at","cancelled_at","cancellation_reason","rows"],"additionalProperties":false}}},"required":["case","events","approvalBatches"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}},"delete":{"operationId":"deleteCase","tags":["Cases"],"description":"Delete a case. Interrupts any associated running jobs first.","parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"path","name":"case_id","required":true,"description":"The case's unique identifier"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"interruptedRunIds":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"}}},"required":["success","interruptedRunIds"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/cases/{case_id}/runs":{"get":{"operationId":"listCaseRuns","tags":["Cases"],"description":"List Jobs (agent runs) that have claimed or received handover of a case, newest first. Capped at 50 ownership events.","parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"case_id","required":true,"description":"The case's unique identifier"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"runs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"case_queue_item_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"agent_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"agent_name":{"type":"string"},"status":{"type":"string","enum":["not_started","pending","starting","running","waiting","completed","failed","interrupted"]},"source":{"nullable":true,"type":"string"},"created_at":{"type":"string"},"started_at":{"nullable":true,"type":"string"},"completed_at":{"nullable":true,"type":"string"},"claimed_at":{"type":"string"},"has_pending_human_request":{"type":"boolean"},"pending_human_request_title":{"nullable":true,"type":"string"},"evaluation":{"type":"object","properties":{"passed":{"type":"number"},"total":{"type":"number"},"final_comment":{"type":"string"},"status":{"type":"string","enum":["ready","unavailable","in_progress"]},"severityCounts":{"type":"object","properties":{"critical":{"type":"integer","minimum":0,"maximum":9007199254740991},"medium":{"type":"integer","minimum":0,"maximum":9007199254740991},"low":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["critical","medium","low"],"additionalProperties":false}},"required":["passed","total","status"],"additionalProperties":false},"user_id":{"nullable":true,"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"user_name":{"nullable":true,"type":"string"},"user_email":{"nullable":true,"type":"string"}},"required":["id","case_queue_item_id","agent_id","agent_name","status","source","created_at","started_at","completed_at","claimed_at","has_pending_human_request","pending_human_request_title","evaluation","user_id","user_name","user_email"],"additionalProperties":false}}},"required":["runs"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/cases/{case_id}/runs/{run_id}/recent-messages":{"get":{"operationId":"listCaseRunRecentMessages","tags":["Cases"],"description":"Return the latest qualifying messages (assistant text + tool calls) for a Job on a case, newest last. Used to populate the live body of a running Job card in the case Activity timeline.","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":10},"in":"query","name":"limit","required":false,"description":"Maximum number of qualifying messages to return. Defaults to 3, must be between 1 and 10."},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"case_id","required":true,"description":"The case's unique identifier"},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"in":"path","name":"run_id","required":true,"description":"The agent run's unique identifier"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"messages":{"type":"array","items":{"anyOf":[{"allOf":[{"type":"object","properties":{"id":{"type":"string"},"type":{"anyOf":[{"type":"string","enum":["text"]},{"type":"string","enum":["tool_call"]},{"type":"string","enum":["tool_result"]},{"type":"string","enum":["system"]},{"type":"string","enum":["thinking"]}]},"runtime":{"anyOf":[{"type":"string","enum":["responses"]},{"type":"string","enum":["terminal-agent"]}]},"timestamp":{"type":"string"},"raw_message":{"anyOf":[{"type":"object","properties":{"session_id":{"type":"string"},"uuid":{"type":"string"}},"required":["session_id","uuid"],"additionalProperties":{}}]},"role":{"anyOf":[{"type":"string","enum":["user"]},{"type":"string","enum":["assistant"]},{"type":"string","enum":["system"]}]}},"required":["id","type","runtime","timestamp","raw_message","role"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["text"]},"role":{"anyOf":[{"type":"string","enum":["assistant"]},{"type":"string","enum":["user"]}]},"text_content":{"type":"string"},"metadata":{"type":"object","properties":{"isAgentInstruction":{"type":"boolean"}},"additionalProperties":{}}},"required":["type","role","text_content"],"additionalProperties":false}]},{"allOf":[{"type":"object","properties":{"id":{"type":"string"},"type":{"anyOf":[{"type":"string","enum":["text"]},{"type":"string","enum":["tool_call"]},{"type":"string","enum":["tool_result"]},{"type":"string","enum":["system"]},{"type":"string","enum":["thinking"]}]},"runtime":{"anyOf":[{"type":"string","enum":["responses"]},{"type":"string","enum":["terminal-agent"]}]},"timestamp":{"type":"string"},"raw_message":{"anyOf":[{"type":"object","properties":{"session_id":{"type":"string"},"uuid":{"type":"string"}},"required":["session_id","uuid"],"additionalProperties":{}}]},"role":{"anyOf":[{"type":"string","enum":["user"]},{"type":"string","enum":["assistant"]},{"type":"string","enum":["system"]}]}},"required":["id","type","runtime","timestamp","raw_message","role"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["thinking"]},"role":{"type":"string","enum":["assistant"]},"text_content":{"type":"string"}},"required":["type","role","text_content"],"additionalProperties":false}]},{"allOf":[{"type":"object","properties":{"id":{"type":"string"},"type":{"anyOf":[{"type":"string","enum":["text"]},{"type":"string","enum":["tool_call"]},{"type":"string","enum":["tool_result"]},{"type":"string","enum":["system"]},{"type":"string","enum":["thinking"]}]},"runtime":{"anyOf":[{"type":"string","enum":["responses"]},{"type":"string","enum":["terminal-agent"]}]},"timestamp":{"type":"string"},"raw_message":{"anyOf":[{"type":"object","properties":{"session_id":{"type":"string"},"uuid":{"type":"string"}},"required":["session_id","uuid"],"additionalProperties":{}}]},"role":{"anyOf":[{"type":"string","enum":["user"]},{"type":"string","enum":["assistant"]},{"type":"string","enum":["system"]}]}},"required":["id","type","runtime","timestamp","raw_message","role"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["tool_call"]},"role":{"type":"string","enum":["assistant"]},"mcp_server_label":{"type":"string"},"tool_call":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"arguments":{"type":"object","additionalProperties":{}}},"required":["id","name"],"additionalProperties":false}},"required":["type","role","tool_call"],"additionalProperties":false}]},{"allOf":[{"type":"object","properties":{"id":{"type":"string"},"type":{"anyOf":[{"type":"string","enum":["text"]},{"type":"string","enum":["tool_call"]},{"type":"string","enum":["tool_result"]},{"type":"string","enum":["system"]},{"type":"string","enum":["thinking"]}]},"runtime":{"anyOf":[{"type":"string","enum":["responses"]},{"type":"string","enum":["terminal-agent"]}]},"timestamp":{"type":"string"},"raw_message":{"anyOf":[{"type":"object","properties":{"session_id":{"type":"string"},"uuid":{"type":"string"}},"required":["session_id","uuid"],"additionalProperties":{}}]},"role":{"anyOf":[{"type":"string","enum":["user"]},{"type":"string","enum":["assistant"]},{"type":"string","enum":["system"]}]}},"required":["id","type","runtime","timestamp","raw_message","role"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["tool_result"]},"role":{"type":"string","enum":["assistant"]},"mcp_server_label":{"type":"string"},"tool_result":{"type":"object","properties":{"tool_call_id":{"type":"string"},"result":{},"error":{"type":"string"}},"required":["tool_call_id"],"additionalProperties":false}},"required":["type","role","tool_result"],"additionalProperties":false}]},{"anyOf":[{"allOf":[{"type":"object","properties":{"id":{"type":"string"},"runtime":{"anyOf":[{"type":"string","enum":["responses"]},{"type":"string","enum":["terminal-agent"]}]},"timestamp":{"type":"string"},"role":{"type":"string","enum":["duvo"]},"type":{"anyOf":[{"type":"string","enum":["agent_run_created"]},{"type":"string","enum":["session_started"]},{"type":"string","enum":["session_completed"]},{"type":"string","enum":["session_interrupted"]},{"type":"string","enum":["session_error"]},{"type":"string","enum":["browser_session_created"]}]}},"required":["id","runtime","timestamp","role","type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["session_started"]}},"required":["type"],"additionalProperties":false}]},{"allOf":[{"type":"object","properties":{"id":{"type":"string"},"runtime":{"anyOf":[{"type":"string","enum":["responses"]},{"type":"string","enum":["terminal-agent"]}]},"timestamp":{"type":"string"},"role":{"type":"string","enum":["duvo"]},"type":{"anyOf":[{"type":"string","enum":["agent_run_created"]},{"type":"string","enum":["session_started"]},{"type":"string","enum":["session_completed"]},{"type":"string","enum":["session_interrupted"]},{"type":"string","enum":["session_error"]},{"type":"string","enum":["browser_session_created"]}]}},"required":["id","runtime","timestamp","role","type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["session_completed"]}},"required":["type"],"additionalProperties":false}]},{"allOf":[{"type":"object","properties":{"id":{"type":"string"},"runtime":{"anyOf":[{"type":"string","enum":["responses"]},{"type":"string","enum":["terminal-agent"]}]},"timestamp":{"type":"string"},"role":{"type":"string","enum":["duvo"]},"type":{"anyOf":[{"type":"string","enum":["agent_run_created"]},{"type":"string","enum":["session_started"]},{"type":"string","enum":["session_completed"]},{"type":"string","enum":["session_interrupted"]},{"type":"string","enum":["session_error"]},{"type":"string","enum":["browser_session_created"]}]}},"required":["id","runtime","timestamp","role","type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["session_interrupted"]}},"required":["type"],"additionalProperties":false}]},{"allOf":[{"type":"object","properties":{"id":{"type":"string"},"runtime":{"anyOf":[{"type":"string","enum":["responses"]},{"type":"string","enum":["terminal-agent"]}]},"timestamp":{"type":"string"},"role":{"type":"string","enum":["duvo"]},"type":{"anyOf":[{"type":"string","enum":["agent_run_created"]},{"type":"string","enum":["session_started"]},{"type":"string","enum":["session_completed"]},{"type":"string","enum":["session_interrupted"]},{"type":"string","enum":["session_error"]},{"type":"string","enum":["browser_session_created"]}]}},"required":["id","runtime","timestamp","role","type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["agent_run_created"]},"agent_run_id":{"type":"string"}},"required":["type","agent_run_id"],"additionalProperties":false}]},{"allOf":[{"type":"object","properties":{"id":{"type":"string"},"runtime":{"anyOf":[{"type":"string","enum":["responses"]},{"type":"string","enum":["terminal-agent"]}]},"timestamp":{"type":"string"},"role":{"type":"string","enum":["duvo"]},"type":{"anyOf":[{"type":"string","enum":["agent_run_created"]},{"type":"string","enum":["session_started"]},{"type":"string","enum":["session_completed"]},{"type":"string","enum":["session_interrupted"]},{"type":"string","enum":["session_error"]},{"type":"string","enum":["browser_session_created"]}]}},"required":["id","runtime","timestamp","role","type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["browser_session_created"]},"browser_session_id":{"type":"string"}},"required":["type","browser_session_id"],"additionalProperties":false}]},{"allOf":[{"type":"object","properties":{"id":{"type":"string"},"runtime":{"anyOf":[{"type":"string","enum":["responses"]},{"type":"string","enum":["terminal-agent"]}]},"timestamp":{"type":"string"},"role":{"type":"string","enum":["duvo"]},"type":{"anyOf":[{"type":"string","enum":["agent_run_created"]},{"type":"string","enum":["session_started"]},{"type":"string","enum":["session_completed"]},{"type":"string","enum":["session_interrupted"]},{"type":"string","enum":["session_error"]},{"type":"string","enum":["browser_session_created"]}]}},"required":["id","runtime","timestamp","role","type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["session_error"]},"error":{"type":"string"}},"required":["type","error"],"additionalProperties":false}]}]}]}}},"required":["messages"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/queues/{queue_id}/cases/bulk-delegate":{"post":{"operationId":"bulkDelegateCases","tags":["Cases"],"description":"Delegate multiple cases to a chosen agent, overriding the queue's default consumer. Any active runs on the selected cases are interrupted first; the cases are then reset to pending and assigned to the chosen agent for the next dispatcher tick. The chosen agent must already be connected to the queue as a case-queue-consumer (with the trigger enabled or disabled).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"case_ids":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"description":"Case IDs to delegate (1-100)."},"agent_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$","description":"The agent that should run on the selected cases. Must be a consumer of this queue."}},"required":["case_ids","agent_id"]}}}},"parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"path","name":"queue_id","required":true,"description":"The queue's unique identifier"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"delegatedCount":{"type":"number"},"skippedCount":{"type":"number"}},"required":["delegatedCount","skippedCount"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/queues/{queue_id}/cases/bulk-delete":{"post":{"operationId":"bulkDeleteCases","tags":["Cases"],"description":"Delete multiple cases from a queue. Any active runs are interrupted first.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"case_ids":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"description":"Case IDs to delete (1-100)."}},"required":["case_ids"]}}}},"parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"path","name":"queue_id","required":true,"description":"The queue's unique identifier"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"deletedCount":{"type":"number"},"interruptedRunIds":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"}}},"required":["deletedCount","interruptedRunIds"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/queues/{queue_id}/cases/bulk-retry":{"post":{"operationId":"bulkRetryCases","tags":["Cases"],"description":"Retry multiple cases by resetting them to pending. Any active runs are interrupted first. Cases already pending are skipped.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"case_ids":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"description":"Case IDs to retry (1-100)."}},"required":["case_ids"]}}}},"parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"path","name":"queue_id","required":true,"description":"The queue's unique identifier"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"retriedCount":{"type":"number"},"skippedCount":{"type":"number"}},"required":["retriedCount","skippedCount"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/queues/{queue_id}/cases/bulk-update-status":{"post":{"operationId":"bulkUpdateCaseStatus","tags":["Cases"],"description":"Update the status of multiple cases to completed or failed. Interrupts any active runs and cancels pending human requests.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"case_ids":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"description":"Case IDs to update (1-100)."},"status":{"type":"string","enum":["completed","failed"],"description":"Terminal status to set on each case."}},"required":["case_ids","status"]}}}},"parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"path","name":"queue_id","required":true,"description":"The queue's unique identifier"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"updatedCount":{"type":"number"},"skippedCount":{"type":"number"},"interruptedRunIds":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"}}},"required":["updatedCount","skippedCount","interruptedRunIds"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/queues/{queue_id}/cases/{case_id}/labels":{"post":{"operationId":"assignCaseLabels","tags":["Cases"],"description":"Assign one or more labels to a case. Creates the labels on the queue if they don't already exist.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"labels":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"object","properties":{"key":{"default":"","type":"string"},"value":{"type":"string","minLength":1}},"required":["value"]}}},"required":["labels"]}}}},"parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"path","name":"queue_id","required":true,"description":"The queue's unique identifier"},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"path","name":"case_id","required":true,"description":"The case's unique identifier"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"labels":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"key":{"type":"string"},"value":{"type":"string","minLength":1},"color_hue":{"type":"integer","minimum":0,"maximum":360}},"required":["id","key","value","color_hue"],"additionalProperties":false}}},"required":["labels"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}},"get":{"operationId":"listCaseLabels","tags":["Cases"],"description":"List all labels assigned to a case.","parameters":[{"schema":{"default":1000,"type":"integer","minimum":1,"maximum":1000},"in":"query","name":"limit","required":false,"description":"Maximum number of labels to return."},{"schema":{"type":"integer","minimum":0,"maximum":9007199254740991},"in":"query","name":"offset","required":false,"description":"Zero-based offset for pagination."},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"path","name":"queue_id","required":true,"description":"The queue's unique identifier"},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"path","name":"case_id","required":true,"description":"The case's unique identifier"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"labels":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"key":{"type":"string"},"value":{"type":"string","minLength":1},"color_hue":{"type":"integer","minimum":0,"maximum":360}},"required":["id","key","value","color_hue"],"additionalProperties":false}}},"required":["labels"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/queues/{queue_id}/labels":{"get":{"operationId":"listQueueLabels","tags":["Cases"],"description":"List every label defined on a queue along with the count of cases each label is assigned to.","parameters":[{"schema":{"default":1000,"type":"integer","minimum":1,"maximum":1000},"in":"query","name":"limit","required":false,"description":"Maximum number of labels to return."},{"schema":{"type":"integer","minimum":0,"maximum":9007199254740991},"in":"query","name":"offset","required":false,"description":"Zero-based offset for pagination."},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"path","name":"queue_id","required":true,"description":"The queue's unique identifier"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"labels":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"key":{"type":"string"},"value":{"type":"string","minLength":1},"color_hue":{"type":"integer","minimum":0,"maximum":360},"case_count":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["id","key","value","color_hue","case_count"],"additionalProperties":false}}},"required":["labels"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}},"post":{"operationId":"createQueueLabel","tags":["Cases"],"description":"Create a label on a queue without assigning it to a case.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"key":{"default":"","type":"string"},"value":{"type":"string","minLength":1},"color_hue":{"type":"integer","minimum":0,"maximum":360}},"required":["value"]}}}},"parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"path","name":"queue_id","required":true,"description":"The queue's unique identifier"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"label":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"key":{"type":"string"},"value":{"type":"string","minLength":1},"color_hue":{"type":"integer","minimum":0,"maximum":360},"case_count":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["id","key","value","color_hue","case_count"],"additionalProperties":false}},"required":["label"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/queues/{queue_id}/cases/{case_id}/labels/unlink":{"post":{"operationId":"unlinkCaseLabels","tags":["Cases"],"description":"Remove the given labels from a case.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"label_ids":{"minItems":1,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"}}},"required":["label_ids"]}}}},"parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"path","name":"queue_id","required":true,"description":"The queue's unique identifier"},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"path","name":"case_id","required":true,"description":"The case's unique identifier"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/queues/{queue_id}/labels/{label_id}":{"delete":{"operationId":"deleteQueueLabel","tags":["Cases"],"description":"Delete a label from a queue. Cascade-deletes all assignments of this label on existing cases.","parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"path","name":"queue_id","required":true,"description":"The queue's unique identifier"},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"path","name":"label_id","required":true,"description":"The label's unique identifier"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}},"patch":{"operationId":"updateQueueLabel","tags":["Cases"],"description":"Update a label's key, value, or color. Renaming key/value affects every case assigned to this label.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"key":{"type":"string"},"value":{"type":"string","minLength":1},"color_hue":{"type":"integer","minimum":0,"maximum":360}},"required":["value"]}}}},"parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"path","name":"queue_id","required":true,"description":"The queue's unique identifier"},{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"path","name":"label_id","required":true,"description":"The label's unique identifier"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"label":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"key":{"type":"string"},"value":{"type":"string","minLength":1},"color_hue":{"type":"integer","minimum":0,"maximum":360}},"required":["id","key","value","color_hue"],"additionalProperties":false}},"required":["label"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/queues/{queue_id}/agents":{"get":{"operationId":"listQueueAgents","tags":["Case Queues"],"description":"List agents bound to a queue as producers (agents that push cases into the queue) or consumers (agents triggered by cases in the queue).","parameters":[{"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"in":"path","name":"queue_id","required":true,"description":"The queue's unique identifier"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"queue_name":{"type":"string"},"producers":{"type":"array","items":{"type":"object","properties":{"agent_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"agent_name":{"type":"string"},"case_trigger_enabled":{"type":"boolean"},"case_trigger_queue_name":{"nullable":true,"type":"string"},"problems":{"type":"array","items":{"type":"string","enum":["multiple_triggers","producer_consumer_mix"]}}},"required":["agent_id","agent_name","case_trigger_enabled","case_trigger_queue_name","problems"],"additionalProperties":false}},"consumers":{"type":"array","items":{"type":"object","properties":{"agent_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"agent_name":{"type":"string"},"case_trigger_enabled":{"type":"boolean"},"is_handover_target":{"type":"boolean"},"problems":{"type":"array","items":{"type":"string","enum":["multiple_triggers","producer_consumer_mix"]}}},"required":["agent_id","agent_name","case_trigger_enabled","is_handover_target","problems"],"additionalProperties":false}}},"required":["queue_name","producers","consumers"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}}},"servers":[{"url":"https://api.duvo.ai","description":"Production server"}],"tags":[{"name":"Runs","description":"Start, monitor, and manage agent runs (Jobs in the Duvo UI)"},{"name":"Sandboxes","description":"Create sandboxes and upload files for agent runs"},{"name":"Case Queues","description":"Manage case queues and their agent bindings"},{"name":"Cases","description":"Create, list, and manage cases and their labels within queues"},{"name":"Case Approvals","description":"Submit decisions on pending case approval requests issued by an agent run"},{"name":"Agents","description":"Create and manage agents (Assignments in the Duvo UI) for automation workloads"},{"name":"Revisions","description":"Create and manage agent revisions — the underlying Setup for an Assignment"},{"name":"Agent Folders","description":"Organize agents (Assignments in the Duvo UI) into folders"},{"name":"Schedules","description":"List schedules configured for an agent (Assignment in the Duvo UI)"},{"name":"Case Triggers","description":"Configure case triggers that automatically dispatch agent runs (Jobs in the Duvo UI) for cases added to a queue"},{"name":"MCP","description":"MCP JSON-RPC endpoint exposing public API routes as LLM-callable tools"},{"name":"Skills","description":"Manage team and system skills (reusable knowledge packs)."},{"name":"Files","description":"Manage team files (knowledge base)."},{"name":"Plugins","description":"Discover plugins that can be referenced from a revision."},{"name":"Team","description":"Inspect the team and members associated with the API key"},{"name":"Integrations","description":"Browse the team's catalog of available integration types"},{"name":"Connections","description":"Manage your connected integrations"},{"name":"Revision Integrations","description":"Attach integrations to assignment revisions, pin specific connections, and link case queues"},{"name":"ClarityV2","description":"Manage Clarity v2 process snapshots, transformation proposals, and the extra-capture-request follow-up loop"}]}