{"openapi":"3.0.3","info":{"title":"Happyrobot Public API","description":"Public API endpoints for Happyrobot","version":"0.1.1"},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"Opaque"}},"schemas":{"RunDetailsUpdate":{"type":"object","oneOf":[{"type":"object","properties":{"type":{"enum":["new_message"]},"message":{"type":"object"}},"required":["type","message"],"additionalProperties":true},{"type":"object","properties":{"type":{"enum":["new_node_output"]}},"additionalProperties":true},{"type":"object","properties":{"type":{"enum":["new_session"]}},"additionalProperties":true}]}}},"paths":{"/api-key/describe":{"get":{"summary":"Describe the current API key","tags":["API Keys"],"description":"Returns metadata for the API key used in the Authorization header.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"orgId":{"type":"string"},"org_slug":{"type":"string"},"org_name":{"type":"string"},"name":{"type":"string"},"prefix":{"type":"string"},"lastFour":{"type":"string","minLength":4,"maxLength":4},"createdAt":{"type":"string"},"lastUsedAt":{"nullable":true,"type":"string"},"revokedAt":{"nullable":true,"type":"string"}},"required":["id","orgId","org_slug","org_name","name","prefix","lastFour","createdAt","lastUsedAt","revokedAt"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/runs/":{"get":{"summary":"[Legacy] List runs","tags":["Runs"],"description":"Lists runs for a use case. **Deprecated**: prefer GET /workflows/:workflow_id/runs instead.","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":"query","name":"use_case_id","required":true},{"schema":{"default":1,"type":"integer","minimum":1,"maximum":9007199254740991},"in":"query","name":"page","required":false},{"schema":{"default":100,"type":"integer","minimum":1,"maximum":2000},"in":"query","name":"page_size","required":false},{"schema":{"default":"desc","type":"string","enum":["asc","desc"]},"in":"query","name":"sort","required":false},{"schema":{"type":"string","enum":["scheduled","running","completed","canceled","failed"]},"in":"query","name":"status","required":false},{"schema":{"anyOf":[{"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))$"},{"type":"string","enum":[""]}]},"in":"query","name":"start_date","required":false},{"schema":{"anyOf":[{"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))$"},{"type":"string","enum":[""]}]},"in":"query","name":"end_date","required":false},{"schema":{"anyOf":[{"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))$"},{"type":"string","enum":[""]}]},"in":"query","name":"completed_start_date","required":false},{"schema":{"anyOf":[{"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))$"},{"type":"string","enum":[""]}]},"in":"query","name":"completed_end_date","required":false},{"schema":{"type":"string","enum":["correct","incorrect","critical"]},"in":"query","name":"annotation","required":false}],"deprecated":true,"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["scheduled","running","completed","canceled","failed"]},"org_id":{"type":"string"},"timestamp":{"type":"string"},"use_case_id":{"type":"string"},"version_id":{"type":"string"},"annotation":{"nullable":true,"type":"string","enum":["correct","incorrect","critical"]},"completed_at":{"nullable":true,"type":"string"},"input_tokens":{"nullable":true,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"output_tokens":{"nullable":true,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"data":{"type":"object","additionalProperties":{}}},"required":["id","status","org_id","timestamp","use_case_id","version_id","annotation","completed_at","input_tokens","output_tokens","data"],"additionalProperties":false}},"pagination":{"type":"object","properties":{"page":{"type":"integer","minimum":1,"maximum":9007199254740991},"pageSize":{"type":"integer","minimum":1,"maximum":9007199254740991},"totalPages":{"type":"integer","minimum":0,"maximum":9007199254740991},"totalRecords":{"type":"integer","minimum":0,"maximum":9007199254740991},"hasNextPage":{"type":"boolean"},"hasPreviousPage":{"type":"boolean"}},"required":["page","pageSize","totalPages","totalRecords","hasNextPage","hasPreviousPage"],"additionalProperties":false}},"required":["data","pagination"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/runs/{run_id}/cancel":{"post":{"summary":"Cancel a run","tags":["Runs"],"description":"Cancels a running or scheduled run for the caller's org by proxying to the workflows service.","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":"run_id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string"}},"required":["status"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"502":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/runs/{run_id}/recordings":{"get":{"summary":"Get recordings for a run","tags":["Runs"],"description":"Returns signed URLs for call recordings associated with a run. Optionally filter by session_id.","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":"query","name":"session_id","required":false},{"schema":{"default":1,"type":"integer","minimum":1,"maximum":7},"in":"query","name":"url_expires_in_days","required":false},{"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}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"recordings":{"type":"array","items":{"type":"object","properties":{"session_id":{"type":"string"},"url":{"type":"string"}},"required":["session_id","url"],"additionalProperties":false}}},"required":["recordings"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}}}}}}},"/runs/{run_id}/sessions":{"get":{"summary":"List run sessions","tags":["Runs"],"description":"Returns paginated sessions for a run, ordered by timestamp.","parameters":[{"schema":{"default":1,"type":"integer","minimum":1,"maximum":9007199254740991},"in":"query","name":"page","required":false},{"schema":{"default":50,"type":"integer","minimum":1,"maximum":100},"in":"query","name":"page_size","required":false},{"schema":{"default":"desc","type":"string","enum":["asc","desc"]},"in":"query","name":"sort","required":false},{"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}],"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}-[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)$"},"org_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)$"},"use_case_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)$"},"version_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)$"},"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)$"},"user_number":{"type":"string"},"status":{"type":"string"},"type":{"type":"string"},"duration":{"nullable":true,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"timestamp":{"type":"string"},"call_connected_at":{"nullable":true,"type":"string"},"sip_code":{"nullable":true,"type":"string"},"sip_reason":{"nullable":true,"type":"string"},"failure_reason":{"nullable":true,"type":"string"},"llm_model":{"nullable":true,"type":"string"},"stt_model":{"nullable":true,"type":"string"},"tts_model":{"nullable":true,"type":"string"},"voice_id":{"nullable":true,"type":"string"},"languages":{"nullable":true,"type":"array","items":{"type":"string"}}},"required":["id","org_id","use_case_id","version_id","run_id","user_number","status","type","duration","timestamp","call_connected_at","sip_code","sip_reason","failure_reason","llm_model","stt_model","tts_model","voice_id","languages"],"additionalProperties":false}},"pagination":{"type":"object","properties":{"page":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"page_size":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total_pages":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total_records":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"has_next_page":{"type":"boolean"},"has_previous_page":{"type":"boolean"}},"required":["page","page_size","total_pages","total_records","has_next_page","has_previous_page"],"additionalProperties":false}},"required":["data","pagination"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/runs/{run_id}":{"get":{"summary":"Get run","tags":["Runs"],"description":"Returns metadata for a single run. Use /runs/:run_id/nodes for node summaries, /runs/:run_id/outputs/:output_id for a full node output payload, /runs/:run_id/sessions for session data, and /runs/:run_id/flags for issues.","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":"run_id","required":true}],"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}-[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)$"},"org_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)$"},"workflow_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)$"},"version_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)$"},"status":{"type":"string","enum":["not_started","scheduled","running","skipped","succeeded","completed","canceled","failed"]},"annotation":{"nullable":true,"type":"string","enum":["correct","incorrect","critical"]},"timestamp":{"type":"string"},"completed_at":{"nullable":true,"type":"string"},"execution_environment":{"nullable":true,"type":"string"}},"required":["id","org_id","workflow_id","version_id","status","annotation","timestamp","completed_at","execution_environment"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/runs/{run_id}/nodes":{"get":{"summary":"List run nodes","tags":["Runs"],"description":"Returns lightweight run node execution records in timestamp order.","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":"query","name":"node_persistent_id","required":true,"description":"Optional node persistent ID filter"},{"schema":{"default":"asc","type":"string","enum":["asc","desc"]},"in":"query","name":"sort","required":false},{"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}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"output_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)$"},"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)$"},"node_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)$"},"node_persistent_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)$"},"name":{"nullable":true,"type":"string"},"node_type":{"nullable":true,"type":"string"},"status":{"nullable":true,"type":"string","enum":["not_started","scheduled","running","completed","succeeded","failed","canceled","skipped"]},"error":{"nullable":true,"type":"string"},"timestamp":{"type":"string"}},"required":["output_id","run_id","node_id","node_persistent_id","name","node_type","status","error","timestamp"],"additionalProperties":false}},"edges":{"type":"array","items":{"type":"object","properties":{"from_output_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)$"},"to_output_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)$"},"from_node_persistent_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)$"},"to_node_persistent_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)$"},"conditional_expr":{"nullable":true,"type":"string"}},"required":["from_output_id","to_output_id","from_node_persistent_id","to_node_persistent_id","conditional_expr"],"additionalProperties":false}}},"required":["data","edges"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/runs/{run_id}/outputs/{output_id}":{"get":{"summary":"Get run output","tags":["Runs"],"description":"Returns the full payload for a single output execution in a run.","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":"run_id","required":true},{"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":"output_id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"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)$"},"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)$"},"node_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)$"},"node_persistent_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)$"},"session_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)$"},"chat_session_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)$"},"event_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)$"},"name":{"nullable":true,"type":"string"},"node_type":{"nullable":true,"type":"string"},"data":{"nullable":true,"type":"object","additionalProperties":{}},"error":{"nullable":true,"type":"string"},"status":{"nullable":true,"type":"string","enum":["not_started","scheduled","running","completed","succeeded","failed","canceled","skipped"]},"scope":{"nullable":true,"type":"string","enum":["workflow","subworkflow"]},"is_multiple":{"type":"boolean"},"data_deleted":{"type":"boolean"},"input_tokens":{"nullable":true,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"output_tokens":{"nullable":true,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"cached_input_tokens":{"nullable":true,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"input":{"nullable":true,"type":"object","additionalProperties":{}},"timestamp":{"type":"string"}},"required":["id","run_id","node_id","node_persistent_id","session_id","chat_session_id","event_id","name","node_type","data","error","status","scope","is_multiple","data_deleted","input_tokens","output_tokens","cached_input_tokens","input","timestamp"],"additionalProperties":false}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"422":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/runs/{run_id}/mark":{"post":{"summary":"Mark run annotation","tags":["Runs"],"description":"Marks a run as correct, incorrect, or critical. When marked as incorrect or critical with a correction message, an issue is automatically created.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"annotation":{"type":"string","enum":["correct","incorrect","critical"],"description":"Mark the run as correct, incorrect, or critical"},"correction":{"description":"Explanation of what went wrong. Required to create an issue when annotation is incorrect or critical.","type":"string"}},"required":["annotation"]}}},"required":true},"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":"run_id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"annotation":{"type":"string","enum":["correct","incorrect","critical"]},"issue_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)$"}},"required":["message","annotation"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/runs/{run_id}/flags":{"get":{"summary":"List run flags","tags":["Runs"],"description":"Returns paginated flags (issues) for a run, ordered by creation date.","parameters":[{"schema":{"default":1,"type":"integer","minimum":1,"maximum":9007199254740991},"in":"query","name":"page","required":false},{"schema":{"default":50,"type":"integer","minimum":1,"maximum":100},"in":"query","name":"page_size","required":false},{"schema":{"default":"desc","type":"string","enum":["asc","desc"]},"in":"query","name":"sort","required":false},{"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}],"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}-[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)$"},"status":{"type":"string"},"priority":{"type":"string"},"type":{"type":"string"},"correction":{"nullable":true,"type":"string"},"correction_reason":{"nullable":true,"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","status","priority","type","correction","correction_reason","created_at","updated_at"],"additionalProperties":false}},"pagination":{"type":"object","properties":{"page":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"page_size":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total_pages":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total_records":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"has_next_page":{"type":"boolean"},"has_previous_page":{"type":"boolean"}},"required":["page","page_size","total_pages","total_records","has_next_page","has_previous_page"],"additionalProperties":false}},"required":["data","pagination"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/runs/{run_id}/audits":{"get":{"summary":"List audit remarks for a run","tags":["Runs"],"description":"Returns all northstar audit remarks for a specific run, showing per-criterion pass/fail grades.","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":"run_id","required":true}],"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}-[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)$"},"northstar_name":{"type":"string"},"grade":{"type":"string","enum":["passed","failed","not_applicable"]},"correction":{"nullable":true,"type":"string"},"correction_reason":{"nullable":true,"type":"string"},"message_ids":{"type":"array","items":{"type":"string"}},"status":{"type":"string","enum":["open","resolved","dismissed"]}},"required":["id","northstar_name","grade","correction","correction_reason","message_ids","status"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/billing/usage/totals":{"get":{"summary":"Get total org usage between date range","tags":["Billing"],"description":"Returns aggregated total usage data for the authenticated organization between the provided start and end datetimes (inclusive).","parameters":[{"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|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"in":"query","name":"start","required":true},{"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|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"in":"query","name":"end","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"customerId":{"type":"string"},"startDate":{"type":"string"},"endDate":{"type":"string"},"usage":{"type":"object","properties":{"totalMinutes":{"type":"number"},"totalEmails":{"type":"number"},"totalText":{"type":"number"}},"required":["totalMinutes","totalEmails","totalText"],"additionalProperties":false}},"required":["customerId","startDate","endDate","usage"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/billing/usage/details":{"get":{"summary":"Get org usage by use case between date range (keyed)","tags":["Billing"],"description":"Returns usage data grouped by requested use_case_id values for the authenticated organization between the provided start and end datetimes (inclusive). If no use_case_id is provided, returns results for all use cases in the org. The response is keyed by use_case_id. Accepts multiple use_case_id parameters or a comma-separated list.","parameters":[{"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|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"in":"query","name":"start","required":true},{"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|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"in":"query","name":"end","required":true},{"schema":{"anyOf":[{"type":"string","minLength":1},{"type":"array","items":{"type":"string","minLength":1}}]},"in":"query","name":"use_case_id","required":false}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"customerId":{"type":"string"},"startDate":{"type":"string"},"endDate":{"type":"string"},"useCases":{"type":"array","items":{"type":"object","properties":{"totalMinutes":{"type":"number"},"totalEmails":{"type":"number"},"totalText":{"type":"number"},"useCaseName":{"type":"string"},"useCaseId":{"type":"string"}},"required":["totalMinutes","totalEmails","totalText","useCaseName","useCaseId"],"additionalProperties":false}}},"required":["customerId","startDate","endDate","useCases"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/billing/usage/credits":{"get":{"summary":"Get credit consumption by component per workflow","tags":["Billing"],"description":"Returns credit consumption per workflow, bucketed by the requested granularity (daily/weekly/monthly). Components is a nested classification breakdown: each category (L1, e.g. 'Voice') contains subcomponents (L2, e.g. 'LLM'), and L2 subcomponents can contain their own subcomponents (L3, e.g. 'Reasoning Agent'). Each component carries credits/volume/volume_unit. Categories and subcomponents use the same labels shown in the platform Usage page (Settings -> Usage), so the breakdown matches what customers see in the app. Category and subcomponent credits sum to total_credits; usage not classified into an L1/L2 bucket is returned under the 'Other' category. Scoped to the authenticated organization via API key. Queries the local billing ClickHouse instance. Filters accept names (e.g. filter_by_folder_1=APAC&filter_by_folder_2=Ocean Freight). Filtering is supported on the top 3 folder levels (filter_by_folder_1/2/3); a level filter includes all use cases nested below it and excludes any above it. folder_path in the response is the full chain at any depth, even beyond 3 levels. Workflows can be filtered by name (filter_by_workflow) or by id (filter_by_workflow_id, exact); each row also returns workflow_id. Filters across levels use AND logic; multiple values within a filter use OR.","parameters":[{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"start_date","required":true},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"end_date","required":true},{"schema":{"default":"daily","type":"string","enum":["daily","weekly","monthly"]},"in":"query","name":"granularity","required":false},{"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"in":"query","name":"filter_by_folder_1","required":false},{"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"in":"query","name":"filter_by_folder_2","required":false},{"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"in":"query","name":"filter_by_folder_3","required":false},{"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"in":"query","name":"filter_by_workflow","required":false},{"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"in":"query","name":"filter_by_workflow_id","required":false}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"workspace_name":{"type":"string"},"start_date":{"type":"string"},"end_date":{"type":"string"},"granularity":{"type":"string"},"unit":{"type":"string","enum":["credits"]},"data":{"type":"array","items":{"type":"object","properties":{"period":{"type":"string"},"folder_path":{"type":"array","items":{"type":"string"}},"workflow_id":{"type":"string"},"workflow_name":{"type":"string"},"components":{"type":"array","items":{"type":"object","properties":{"category":{"type":"string"},"credits":{"type":"number"},"subcomponents":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"credits":{"type":"number"},"volume":{"type":"number"},"volume_unit":{"type":"string"},"subcomponents":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"credits":{"type":"number"},"volume":{"type":"number"},"volume_unit":{"type":"string"}},"required":["name","credits","volume","volume_unit"],"additionalProperties":false}}},"required":["name","credits","volume","volume_unit"],"additionalProperties":false}}},"required":["category","credits","subcomponents"],"additionalProperties":false}},"total_credits":{"type":"number"}},"required":["period","folder_path","workflow_id","workflow_name","components","total_credits"],"additionalProperties":false}}},"required":["workspace_name","start_date","end_date","granularity","unit","data"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/use-cases/":{"get":{"summary":"[Legacy] List use cases","tags":["Use Cases"],"description":"Returns use cases for the authenticated org along with the live production version if available (or the most recent version as fallback). **Deprecated**: prefer GET /workflows instead.","parameters":[{"schema":{"type":"string","enum":["true","false"]},"in":"query","name":"is_deleted","required":false},{"schema":{"type":"string","enum":["true","false"]},"in":"query","name":"is_live","required":false},{"schema":{"type":"string","enum":["true","false"]},"in":"query","name":"is_published","required":false}],"deprecated":true,"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"org_id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"icon":{"nullable":true,"type":"string"},"folder_id":{"nullable":true,"type":"string"},"data_retention_days":{"nullable":true,"type":"number"},"timestamp":{"type":"string"},"latest_version":{"nullable":true,"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"version_number":{"nullable":true,"type":"number"},"is_published":{"type":"boolean"},"is_live":{"type":"boolean"},"environment":{"type":"string"},"published_at":{"nullable":true,"type":"string"},"timestamp":{"type":"string"}},"required":["id","name","is_published","is_live","timestamp"],"additionalProperties":false}},"required":["id","org_id","name","slug","timestamp","latest_version"],"additionalProperties":false}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/contacts/resolve":{"get":{"summary":"Lookup contact by identifier","tags":["Contacts"],"description":"Returns contact if found by type and value. Returns 404 if not found. Does not create new contacts.","parameters":[{"schema":{"type":"string","enum":["phone_number","email"]},"in":"query","name":"type","required":true},{"schema":{"type":"string","minLength":1},"in":"query","name":"value","required":true}],"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}-[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)$"},"type":{"nullable":true,"type":"string"},"value":{"type":"string"},"contact_summary":{"nullable":true,"type":"string"},"extracted_attributes":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","type","value","contact_summary","extracted_attributes","created_at","updated_at"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/contacts/":{"get":{"summary":"List contacts","tags":["Contacts"],"description":"Returns paginated contacts for the organization. Uses cursor-based pagination.","parameters":[{"schema":{"default":50,"type":"integer","minimum":1,"maximum":100},"in":"query","name":"limit","required":false},{"schema":{"type":"string"},"in":"query","name":"cursor","required":false},{"schema":{"type":"string"},"in":"query","name":"search","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}-[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)$"},"type":{"nullable":true,"type":"string"},"value":{"type":"string"},"contact_summary":{"nullable":true,"type":"string"},"extracted_attributes":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}},"created_at":{"type":"string"},"updated_at":{"type":"string"},"interactions_count":{"type":"object","additionalProperties":{"type":"number"}},"tags":{"type":"array","items":{"type":"string"}},"last_interaction_date":{"nullable":true,"type":"string"},"has_blocked_workflows":{"type":"boolean"}},"required":["id","type","value","contact_summary","extracted_attributes","created_at","updated_at","interactions_count","tags","has_blocked_workflows"],"additionalProperties":false}},"next_cursor":{"nullable":true,"type":"string"},"has_more":{"type":"boolean"}},"required":["data","next_cursor","has_more"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/contacts/{contact_id}":{"get":{"summary":"Get contact","tags":["Contacts"],"description":"Returns a single contact with interaction and memory counts","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":"contact_id","required":true}],"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}-[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)$"},"type":{"nullable":true,"type":"string"},"value":{"type":"string"},"contact_summary":{"nullable":true,"type":"string"},"extracted_attributes":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}},"created_at":{"type":"string"},"updated_at":{"type":"string"},"interaction_count":{"type":"number"},"memory_count":{"type":"number"}},"required":["id","type","value","contact_summary","extracted_attributes","created_at","updated_at","interaction_count","memory_count"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/contacts/{contact_id}/interactions":{"get":{"summary":"List contact interactions","tags":["Contacts"],"description":"Returns paginated communication events for a contact","parameters":[{"schema":{"default":50,"type":"integer","minimum":1,"maximum":100},"in":"query","name":"limit","required":false},{"schema":{"type":"string"},"in":"query","name":"cursor","required":false},{"schema":{"default":"timestamp:desc","type":"string","enum":["timestamp:asc","timestamp:desc"]},"in":"query","name":"sort","required":false},{"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":"contact_id","required":true}],"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}-[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)$"},"channel":{"nullable":true,"type":"string"},"tags":{"type":"array","items":{"type":"string"}},"interaction_summary":{"nullable":true,"type":"string"},"extracted_attributes":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}},"timestamp":{"type":"string"}},"required":["id","channel","tags","interaction_summary","extracted_attributes","timestamp"],"additionalProperties":false}},"next_cursor":{"nullable":true,"type":"string"},"has_more":{"type":"boolean"}},"required":["data","next_cursor","has_more"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/contacts/{contact_id}/memories":{"get":{"summary":"List contact memories","tags":["Contacts"],"description":"Returns paginated memories for a contact","parameters":[{"schema":{"default":50,"type":"integer","minimum":1,"maximum":100},"in":"query","name":"limit","required":false},{"schema":{"type":"string"},"in":"query","name":"cursor","required":false},{"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":"contact_id","required":true}],"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}-[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)$"},"content":{"type":"string"},"communication_event_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)$"},"created_at":{"type":"string"}},"required":["id","content","communication_event_id","created_at"],"additionalProperties":false}},"next_cursor":{"nullable":true,"type":"string"},"has_more":{"type":"boolean"}},"required":["data","next_cursor","has_more"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/knowledge-bases/":{"get":{"tags":["Knowledge Bases"],"description":"List all knowledge bases for the organization.","responses":{"200":{"description":"Default Response"}}},"post":{"tags":["Knowledge Bases"],"description":"Create a new knowledge base for the organization.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"description":{"type":"string"},"max_file_size_mb":{"type":"integer","minimum":1,"maximum":1024}},"required":["name"]}}},"required":true},"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"knowledge_base":{"type":"object","properties":{"id":{"type":"string"},"org_id":{"type":"string"},"name":{"type":"string"},"description":{"nullable":true,"type":"string"},"max_file_size_mb":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","org_id","name","description","max_file_size_mb","created_at","updated_at"],"additionalProperties":false}},"required":["knowledge_base"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/knowledge-bases/{kbId}/files":{"get":{"tags":["Knowledge Bases"],"description":"List all files in a knowledge base. Use this endpoint to check file processing status after triggering chunking via POST /:kbId/trigger-chunking.","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":"kbId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"files":{"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)$"},"kb_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)$"},"file_size_in_bytes":{"type":"integer","minimum":-2147483648,"maximum":2147483647},"org_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)$"},"external_uri":{"type":"string"},"name":{"type":"string","maxLength":256},"type":{"type":"string","maxLength":256},"uploaded_by":{"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)$"},"last_updated":{"type":"string","format":"date-time"},"processing_status":{"nullable":true,"type":"string","maxLength":64},"chunking_config":{"nullable":true,"anyOf":[{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"string","nullable":true,"enum":[null]}]},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}]},"summary":{"nullable":true,"type":"string"},"summary_keywords":{"nullable":true,"type":"array","items":{"type":"string"}},"parsed_content":{"nullable":true,"type":"string"},"source_url":{"nullable":true,"type":"string"},"source_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)$"},"content_hash":{"nullable":true,"type":"string"},"alchemist_elixir_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)$"},"created_at":{"type":"string","format":"date-time"},"uploaded_by_email":{"nullable":true,"type":"string"}},"required":["id","kb_id","file_size_in_bytes","org_id","external_uri","name","type","uploaded_by","last_updated","processing_status","chunking_config","summary","summary_keywords","parsed_content","source_url","source_id","content_hash","alchemist_elixir_id","created_at"],"additionalProperties":false}}},"required":["files"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/knowledge-bases/{kbId}/upload-urls":{"post":{"tags":["Knowledge Bases"],"description":"Step 1 of the file upload flow. Creates file records in the database and returns presigned S3 URLs (valid for 3 minutes). Upload files directly to S3 using the returned uploadUrl for each file, then call POST /:kbId/trigger-chunking with the returned fileIds to start processing.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"object","properties":{"fileName":{"type":"string","minLength":1},"contentType":{"type":"string","minLength":1},"contentLength":{"type":"number","minimum":0,"exclusiveMinimum":true}},"required":["fileName","contentType","contentLength"]}}},"required":["files"]}}},"required":true},"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":"kbId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"object","properties":{"fileId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"fileName":{"type":"string"},"uploadUrl":{"type":"string","format":"uri"}},"required":["fileId","fileName","uploadUrl"],"additionalProperties":false}}},"required":["files"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/knowledge-bases/{kbId}/trigger-chunking":{"post":{"tags":["Knowledge Bases"],"description":"Step 2 of the file upload flow. Call this endpoint after uploading files to S3 using the presigned URLs from POST /:kbId/upload-urls. Triggers embedding generation for the specified files. Files will be available in the knowledge base within 10-15 minutes. Use GET /:kbId/files to check processing status.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"fileIds":{"minItems":1,"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)$"}}},"required":["fileIds"]}}},"required":true},"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":"kbId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"fileIds":{"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)$"}}},"required":["message","fileIds"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/knowledge-bases/{kbId}":{"delete":{"tags":["Knowledge Bases"],"description":"Delete a knowledge base and all associated files and chunks. This action is irreversible.","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":"kbId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"kbId":{"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":["message","kbId"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/knowledge-bases/{kbId}/files/{fileId}":{"delete":{"tags":["Knowledge Bases"],"description":"Delete a file from a knowledge base. This removes the file from storage and deletes all associated chunks. This action is irreversible.","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":"kbId","required":true},{"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":"fileId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"fileId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["message","fileId"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/workflows/":{"get":{"summary":"List workflows","tags":["Workflows"],"description":"Returns paginated workflows for the authenticated organization. Each workflow includes its latest version info (live production version preferred, otherwise most recent). Supports searching by name and filtering by folder.","parameters":[{"schema":{"default":1,"type":"integer","minimum":1,"maximum":9007199254740991},"in":"query","name":"page","required":false},{"schema":{"default":50,"type":"integer","minimum":1,"maximum":100},"in":"query","name":"page_size","required":false},{"schema":{"default":"desc","type":"string","enum":["asc","desc"]},"in":"query","name":"sort","required":false},{"schema":{"type":"string"},"in":"query","name":"search","required":false},{"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":"query","name":"folder_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}-[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)$"},"org_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)$"},"name":{"type":"string"},"slug":{"type":"string"},"icon":{"nullable":true,"type":"string"},"folder_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)$"},"data_retention_days":{"nullable":true,"type":"number"},"timestamp":{"type":"string"},"latest_version":{"nullable":true,"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"version_number":{"nullable":true,"type":"number"},"is_published":{"type":"boolean"},"is_live":{"type":"boolean"},"environment":{"type":"string"},"workflow_version":{"description":"Workflow engine version for this version: 2 = legacy, 3 = explicit-edges engine (loop/path/loop_break nodes available).","type":"number"},"published_at":{"nullable":true,"type":"string"},"timestamp":{"type":"string"}},"required":["id","name","slug","is_published","is_live","timestamp"],"additionalProperties":false}},"required":["id","org_id","name","slug","timestamp","latest_version"],"additionalProperties":false}},"pagination":{"type":"object","properties":{"page":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"page_size":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total_pages":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total_records":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"has_next_page":{"type":"boolean"},"has_previous_page":{"type":"boolean"}},"required":["page","page_size","total_pages","total_records","has_next_page","has_previous_page"],"additionalProperties":false}},"required":["data","pagination"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}},"post":{"summary":"Create a workflow","tags":["Workflows"],"description":"Creates a new workflow in the authenticated organization. Supports three creation modes:\n\n1. **Plain** — Creates an empty workflow with an initial version.\n2. **From template** — Use `from_template` to create a pre-configured workflow with trigger and agent nodes. Available templates: `voice-agent`, `inbound-voice-agent`, `whatsapp-agent`, `sms-agent`, `email-agent`, `chatbot-agent`. Credentials are auto-discovered from the organization.\n3. **With version and nodes** — Use `version` to provide custom version metadata and an optional `nodes` array to define the workflow structure inline. The first node must be a `trigger`, subsequent nodes reference their parent via `parent_index`.\n\n`from_template` and `version` are mutually exclusive.\n\nOptionally, pass a `variables` array to create workflow-scoped environment variables alongside the workflow.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"icon":{"default":"robot","type":"string"},"folder_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)$"},"settings":{"type":"object","properties":{"data_retention_days":{"nullable":true,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"audits_enabled":{"type":"boolean"},"audit_sampling_bps":{"type":"integer","minimum":0,"maximum":10000},"audit_conditions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"ors":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"ands":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"field":{"type":"object","properties":{"group_id":{"type":"string"},"variable_id":{"type":"string"}},"required":["group_id","variable_id"]},"condition":{"type":"string"},"value":{"type":"array","items":{"description":"!IMPORTANT: This schema describes one Paragraph object. When the containing field is an array of this schema, send a flat Paragraph[] array. Do not send a bare Paragraph object. Only send Paragraph[][] when the containing field is explicitly an array of arrays. Paragraph object schema: {type: 'paragraph', children: Array<{text: string} | {type: 'variable', children: [{text: ''}], group_id: string, variable_id: string}>}"}}}}}},"required":["ands"]}},"output":{"type":"array","items":{"description":"!IMPORTANT: This schema describes one Paragraph object. When the containing field is an array of this schema, send a flat Paragraph[] array. Do not send a bare Paragraph object. Only send Paragraph[][] when the containing field is explicitly an array of arrays. Paragraph object schema: {type: 'paragraph', children: Array<{text: string} | {type: 'variable', children: [{text: ''}], group_id: string, variable_id: string}>}"}}}}},"out_of_office_hours":{"type":"object","additionalProperties":{"type":"object","properties":{"timezone":{"type":"string","minLength":1},"weekly_schedule":{"minItems":7,"maxItems":7,"type":"array","items":{"nullable":true,"type":"array","items":{"nullable":true,"type":"object","properties":{"start":{"type":"string","pattern":"^(([0-1][0-9]|2[0-3]):[0-5][0-9]|24:00)$"},"end":{"type":"string","pattern":"^(([0-1][0-9]|2[0-3]):[0-5][0-9]|24:00)$"}},"required":["start","end"]}}},"off_days":{"type":"object","additionalProperties":{"type":"array","items":{"type":"object","properties":{"start":{"type":"string","pattern":"^(([0-1][0-9]|2[0-3]):[0-5][0-9]|24:00)$"},"end":{"type":"string","pattern":"^(([0-1][0-9]|2[0-3]):[0-5][0-9]|24:00)$"}},"required":["start","end"]}}}},"required":["timezone","weekly_schedule"]}},"webhooks":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["url"]}},"workflow_approval_process_settings":{"type":"object","properties":{"environments":{"type":"object","properties":{"production":{"type":"boolean"},"staging":{"type":"boolean"},"development":{"type":"boolean"}},"required":["production","staging","development"]}},"required":["environments"]},"deployment":{"description":"@internal","type":"object","properties":{"owner":{"nullable":true,"type":"string","maxLength":256},"pod_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)$"},"category_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)$"},"stage_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)$"},"description":{"nullable":true,"type":"string"},"linked_workflow_ids":{"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)$"}}}}}},"from_template":{"oneOf":[{"type":"object","properties":{"template":{"type":"string","enum":["voice-agent"]},"inputs":{"default":{},"type":"object","properties":{"agent_name":{"description":"Display name for the AI voice agent.","type":"string"},"prompt":{"description":"Prompt node overrides.","type":"object","properties":{"prompt_md":{"description":"Agent system prompt in markdown format.","type":"string"},"initial_message":{"description":"The first message the agent says when the call/conversation starts.","type":"string"},"initial_message_uninterruptible":{"description":"Whether the voice agent initial message is uninterruptible.","type":"boolean"},"model":{"description":"LLM model selection as a TemplatedValue (e.g. { type: \"static\", static: { id: \"turbo-one\", name: \"gpt-4.1\" } }).","type":"object","properties":{"type":{"type":"string","enum":["static","dynamic"]},"static":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"}},"required":["id","name"]},"dynamic":{"type":"array","items":{"description":"!IMPORTANT: This schema describes one Paragraph object. When the containing field is an array of this schema, send a flat Paragraph[] array. Do not send a bare Paragraph object. Only send Paragraph[][] when the containing field is explicitly an array of arrays. Paragraph object schema: {type: 'paragraph', children: Array<{text: string} | {type: 'variable', children: [{text: ''}], group_id: string, variable_id: string}>}"}}},"required":["type"]}}}}}},"required":["template"]},{"type":"object","properties":{"template":{"type":"string","enum":["inbound-voice-agent"]},"inputs":{"default":{},"type":"object","properties":{"agent_name":{"description":"Display name for the inbound voice agent.","type":"string"},"prompt":{"description":"Prompt node overrides.","type":"object","properties":{"prompt_md":{"description":"Agent system prompt in markdown format.","type":"string"},"initial_message":{"description":"The first message the agent says when the call/conversation starts.","type":"string"},"initial_message_uninterruptible":{"description":"Whether the voice agent initial message is uninterruptible.","type":"boolean"},"model":{"description":"LLM model selection as a TemplatedValue (e.g. { type: \"static\", static: { id: \"turbo-one\", name: \"gpt-4.1\" } }).","type":"object","properties":{"type":{"type":"string","enum":["static","dynamic"]},"static":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"}},"required":["id","name"]},"dynamic":{"type":"array","items":{"description":"!IMPORTANT: This schema describes one Paragraph object. When the containing field is an array of this schema, send a flat Paragraph[] array. Do not send a bare Paragraph object. Only send Paragraph[][] when the containing field is explicitly an array of arrays. Paragraph object schema: {type: 'paragraph', children: Array<{text: string} | {type: 'variable', children: [{text: ''}], group_id: string, variable_id: string}>}"}}},"required":["type"]}}}}}},"required":["template"]},{"type":"object","properties":{"template":{"type":"string","enum":["whatsapp-agent"]},"inputs":{"default":{},"type":"object","properties":{"agent_name":{"description":"Display name for the WhatsApp agent.","type":"string"},"prompt":{"description":"Prompt node overrides.","type":"object","properties":{"prompt_md":{"description":"Agent system prompt in markdown format.","type":"string"},"initial_message":{"description":"The first message the agent says when the call/conversation starts.","type":"string"},"initial_message_uninterruptible":{"description":"Whether the voice agent initial message is uninterruptible.","type":"boolean"},"model":{"description":"LLM model selection as a TemplatedValue (e.g. { type: \"static\", static: { id: \"turbo-one\", name: \"gpt-4.1\" } }).","type":"object","properties":{"type":{"type":"string","enum":["static","dynamic"]},"static":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"}},"required":["id","name"]},"dynamic":{"type":"array","items":{"description":"!IMPORTANT: This schema describes one Paragraph object. When the containing field is an array of this schema, send a flat Paragraph[] array. Do not send a bare Paragraph object. Only send Paragraph[][] when the containing field is explicitly an array of arrays. Paragraph object schema: {type: 'paragraph', children: Array<{text: string} | {type: 'variable', children: [{text: ''}], group_id: string, variable_id: string}>}"}}},"required":["type"]}}}}}},"required":["template"]},{"type":"object","properties":{"template":{"type":"string","enum":["sms-agent"]},"inputs":{"default":{},"type":"object","properties":{"agent_name":{"description":"Display name for the SMS agent.","type":"string"},"prompt":{"description":"Prompt node overrides.","type":"object","properties":{"prompt_md":{"description":"Agent system prompt in markdown format.","type":"string"},"initial_message":{"description":"The first message the agent says when the call/conversation starts.","type":"string"},"initial_message_uninterruptible":{"description":"Whether the voice agent initial message is uninterruptible.","type":"boolean"},"model":{"description":"LLM model selection as a TemplatedValue (e.g. { type: \"static\", static: { id: \"turbo-one\", name: \"gpt-4.1\" } }).","type":"object","properties":{"type":{"type":"string","enum":["static","dynamic"]},"static":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"}},"required":["id","name"]},"dynamic":{"type":"array","items":{"description":"!IMPORTANT: This schema describes one Paragraph object. When the containing field is an array of this schema, send a flat Paragraph[] array. Do not send a bare Paragraph object. Only send Paragraph[][] when the containing field is explicitly an array of arrays. Paragraph object schema: {type: 'paragraph', children: Array<{text: string} | {type: 'variable', children: [{text: ''}], group_id: string, variable_id: string}>}"}}},"required":["type"]}}}}}},"required":["template"]},{"type":"object","properties":{"template":{"type":"string","enum":["email-agent"]},"inputs":{"default":{},"type":"object","properties":{"agent_name":{"description":"Display name for the Email agent.","type":"string"},"email_to":{"description":"Default recipient email address.","type":"string"},"prompt":{"description":"Prompt node overrides.","type":"object","properties":{"prompt_md":{"description":"Agent system prompt in markdown format.","type":"string"},"initial_message":{"description":"The first message the agent says when the call/conversation starts.","type":"string"},"initial_message_uninterruptible":{"description":"Whether the voice agent initial message is uninterruptible.","type":"boolean"},"model":{"description":"LLM model selection as a TemplatedValue (e.g. { type: \"static\", static: { id: \"turbo-one\", name: \"gpt-4.1\" } }).","type":"object","properties":{"type":{"type":"string","enum":["static","dynamic"]},"static":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"}},"required":["id","name"]},"dynamic":{"type":"array","items":{"description":"!IMPORTANT: This schema describes one Paragraph object. When the containing field is an array of this schema, send a flat Paragraph[] array. Do not send a bare Paragraph object. Only send Paragraph[][] when the containing field is explicitly an array of arrays. Paragraph object schema: {type: 'paragraph', children: Array<{text: string} | {type: 'variable', children: [{text: ''}], group_id: string, variable_id: string}>}"}}},"required":["type"]}}}}}},"required":["template"]},{"type":"object","properties":{"template":{"type":"string","enum":["chatbot-agent"]},"inputs":{"default":{},"type":"object","properties":{"agent_name":{"description":"Display name for the chatbot agent.","type":"string"},"prompt":{"description":"Prompt node overrides.","type":"object","properties":{"prompt_md":{"description":"Agent system prompt in markdown format.","type":"string"},"initial_message":{"description":"The first message the agent says when the call/conversation starts.","type":"string"},"initial_message_uninterruptible":{"description":"Whether the voice agent initial message is uninterruptible.","type":"boolean"},"model":{"description":"LLM model selection as a TemplatedValue (e.g. { type: \"static\", static: { id: \"turbo-one\", name: \"gpt-4.1\" } }).","type":"object","properties":{"type":{"type":"string","enum":["static","dynamic"]},"static":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"}},"required":["id","name"]},"dynamic":{"type":"array","items":{"description":"!IMPORTANT: This schema describes one Paragraph object. When the containing field is an array of this schema, send a flat Paragraph[] array. Do not send a bare Paragraph object. Only send Paragraph[][] when the containing field is explicitly an array of arrays. Paragraph object schema: {type: 'paragraph', children: Array<{text: string} | {type: 'variable', children: [{text: ''}], group_id: string, variable_id: string}>}"}}},"required":["type"]}}}}}},"required":["template"]}]},"variables":{"description":"Optional list of workflow-scoped variables to create alongside the workflow.","maxItems":100,"type":"array","items":{"type":"object","properties":{"key":{"type":"string","minLength":1},"value_production":{"type":"string"},"value_staging":{"type":"string"},"value_development":{"type":"string"},"is_hidden_in_ui":{"default":false,"type":"boolean"}},"required":["key","value_production","value_staging","value_development"]}},"version":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"nodes":{"description":"Ordered list of nodes to create. The first node must be a trigger.","minItems":1,"maxItems":50,"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["trigger"]},"event_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 trigger event ID"},"name":{"description":"Display name override","type":"string"},"configuration":{"description":"Trigger-specific configuration (JSONB)","type":"object","additionalProperties":{}},"webhook_payload":{"description":"Expected payload for webhook nodes. When provided, this is saved as the node output so downstream nodes can reference it.","type":"object","additionalProperties":{}}},"required":["type","event_id"]},{"type":"object","properties":{"type":{"type":"string","enum":["action"]},"event_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 action event ID"},"name":{"description":"Display name override","type":"string"},"configuration":{"description":"Action-specific configuration (JSONB)","type":"object","additionalProperties":{}},"parent_node_index":{"description":"Index of the parent node in the nodes array. Required for non-trigger nodes.","type":"integer","minimum":0,"maximum":9007199254740991},"webhook_payload":{"description":"Expected payload for webhook nodes. When provided, this is saved as the node output so downstream nodes can reference it.","type":"object","additionalProperties":{}}},"required":["type","event_id"]},{"type":"object","properties":{"type":{"type":"string","enum":["agent"]},"event_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 event ID"},"name":{"description":"Display name override","type":"string"},"configuration":{"description":"Agent-specific configuration (JSONB)","type":"object","additionalProperties":{}},"prompt":{"description":"Prompt configuration for the auto-generated prompt child node","type":"object","properties":{"prompt_md":{"description":"Agent system prompt in markdown","type":"string"},"initial_message":{"description":"Agent initial message — accepts a plain string or Plate paragraph array","type":"array","items":{}},"initial_message_uninterruptible":{"description":"Whether the voice agent initial message is uninterruptible.","type":"boolean"}}},"parent_node_index":{"description":"Index of the parent node in the nodes array. Required for non-trigger nodes.","type":"integer","minimum":0,"maximum":9007199254740991}},"required":["type","event_id"]},{"type":"object","properties":{"type":{"type":"string","enum":["tool"]},"name":{"description":"Display name override","type":"string"},"function":{"description":"Tool function definition.","type":"object","properties":{"description":{"type":"array","items":{}},"message":{"type":"object","properties":{"type":{"type":"string","enum":["ai","fixed","none"]},"description":{"type":"array","items":{}},"example":{"type":"string"}}},"parameters":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"array","items":{}},"example":{"type":"string"},"required":{"type":"boolean"}},"required":["name"]}},"hold_music":{"type":"object","properties":{"type":{"type":"string","enum":["static","dynamic"]},"static":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"}},"required":["id","name"]},"dynamic":{"type":"array","items":{"description":"!IMPORTANT: This schema describes one Paragraph object. When the containing field is an array of this schema, send a flat Paragraph[] array. Do not send a bare Paragraph object. Only send Paragraph[][] when the containing field is explicitly an array of arrays. Paragraph object schema: {type: 'paragraph', children: Array<{text: string} | {type: 'variable', children: [{text: ''}], group_id: string, variable_id: string}>}"}}},"required":["type"]},"hold_music_asset_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)$"},"tool_index_id":{"type":"string"},"tool_index_hash":{"type":"string"},"is_mcp":{"type":"boolean"},"mcp_server_credential_id":{"type":"string"},"mcp_tool_name":{"type":"string"}}},"parent_node_index":{"description":"Index of the parent node in the nodes array. Required for non-trigger nodes.","type":"integer","minimum":0,"maximum":9007199254740991}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["prompt"]},"name":{"description":"Display name override","type":"string"},"prompt_md":{"description":"System prompt in markdown (prompt nodes only)","type":"string"},"initial_message":{"description":"Initial message — accepts a plain string or Plate paragraph array (prompt nodes only)","type":"array","items":{}},"initial_message_uninterruptible":{"description":"Whether the voice agent initial message is uninterruptible.","type":"boolean"},"model":{"description":"LLM model selection as a TemplatedValue (e.g. { type: \"static\", static: { id: \"turbo-one\", name: \"gpt-4.1\" } }).","type":"object","properties":{"type":{"type":"string","enum":["static","dynamic"]},"static":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"}},"required":["id","name"]},"dynamic":{"type":"array","items":{"description":"!IMPORTANT: This schema describes one Paragraph object. When the containing field is an array of this schema, send a flat Paragraph[] array. Do not send a bare Paragraph object. Only send Paragraph[][] when the containing field is explicitly an array of arrays. Paragraph object schema: {type: 'paragraph', children: Array<{text: string} | {type: 'variable', children: [{text: ''}], group_id: string, variable_id: string}>}"}}},"required":["type"]},"parent_node_index":{"description":"Index of the parent node in the nodes array. Required for non-trigger nodes.","type":"integer","minimum":0,"maximum":9007199254740991}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["condition"]},"name":{"description":"Display name override","type":"string"},"type_of_condition":{"description":"Type of condition branch. \"conditional\" evaluates rules, \"fallback\" catches unmatched cases.","type":"string","enum":["fallback","conditional"]},"order":{"description":"Order among sibling conditional branches. Auto-calculated if omitted.","type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"conditions":{"description":"Condition rules. Each entry follows the ConditionSchema: { id?, title?, ors: [{ ands: [{ field: { group_id, variable_id }, condition: '', value: [{ type: 'paragraph', children: [{ text: '...' }] }] }] }], output?: [...] }. The 'value' field MUST be an array of Plate paragraph objects — plain strings are rejected. Use an empty array [] to clear all conditions.","type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"ors":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"ands":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"field":{"type":"object","properties":{"group_id":{"type":"string"},"variable_id":{"type":"string"}},"required":["group_id","variable_id"]},"condition":{"type":"string"},"value":{"type":"array","items":{"description":"!IMPORTANT: This schema describes one Paragraph object. When the containing field is an array of this schema, send a flat Paragraph[] array. Do not send a bare Paragraph object. Only send Paragraph[][] when the containing field is explicitly an array of arrays. Paragraph object schema: {type: 'paragraph', children: Array<{text: string} | {type: 'variable', children: [{text: ''}], group_id: string, variable_id: string}>}"}}}}}},"required":["ands"]}},"output":{"type":"array","items":{"description":"!IMPORTANT: This schema describes one Paragraph object. When the containing field is an array of this schema, send a flat Paragraph[] array. Do not send a bare Paragraph object. Only send Paragraph[][] when the containing field is explicitly an array of arrays. Paragraph object schema: {type: 'paragraph', children: Array<{text: string} | {type: 'variable', children: [{text: ''}], group_id: string, variable_id: string}>}"}}}}},"parent_node_index":{"description":"Index of the parent node in the nodes array. Required for non-trigger nodes.","type":"integer","minimum":0,"maximum":9007199254740991}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["module-change"]},"name":{"description":"Display name override","type":"string"},"configuration":{"description":"Module-change configuration (JSONB). Defaults to {}.","type":"object","additionalProperties":{}},"module_node_index":{"description":"Index of the target prompt node in the nodes array. Resolved to configuration.moduleId after all nodes are created.","type":"integer","minimum":0,"maximum":9007199254740991},"parent_node_index":{"description":"Index of the parent node in the nodes array. Required for non-trigger nodes.","type":"integer","minimum":0,"maximum":9007199254740991}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["loop"]},"name":{"description":"Display name override","type":"string"},"execute_in_parallel":{"description":"Whether loop iterations run in parallel. Defaults to true. This only controls execution strategy; variables produced by loop body nodes resolve as lists outside the loop in both sequential and parallel modes.","type":"boolean"},"iterate_for":{"description":"Fixed number of iterations. Mutually exclusive with iterate_over. Fixed-count loop bodies expose iteration_index and execute_in_parallel.","nullable":true,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"iterate_over":{"description":"Expression to iterate over (array variable). Mutually exclusive with iterate_for. Collection loop bodies expose iteration_index, execute_in_parallel, and the configured loop_variable.","nullable":true,"type":"string"},"loop_variable":{"description":"Collection loops only. Name of the current item variable accessible inside the loop body. Defaults to \"iteration_element\". Collection loops also expose iteration_index and execute_in_parallel. Fixed-count loops expose iteration_index and execute_in_parallel instead.","nullable":true,"type":"string"},"do_child_run":{"description":"Whether each iteration runs as a standalone child run instead of inline in the parent run. Defaults to false.","type":"boolean"},"configuration":{"description":"Tolerated fallback: loop settings may be nested here instead of at the top level. They are hoisted to the top level server-side (a top-level value wins), so this is type-validated. Prefer setting the fields at the top level.","type":"object","properties":{"execute_in_parallel":{"type":"boolean"},"iterate_for":{"nullable":true,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"iterate_over":{"nullable":true,"type":"string"},"loop_variable":{"nullable":true,"type":"string"},"do_child_run":{"type":"boolean"}}},"parent_node_index":{"description":"Index of the parent node in the nodes array. Required for non-trigger nodes.","type":"integer","minimum":0,"maximum":9007199254740991}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["path"]},"name":{"description":"Display name override","type":"string"},"parent_node_index":{"description":"Index of the parent node in the nodes array. Required for non-trigger nodes.","type":"integer","minimum":0,"maximum":9007199254740991}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["loop_break"]},"name":{"description":"Display name override","type":"string"},"parent_node_index":{"description":"Index of the parent node in the nodes array. Required for non-trigger nodes.","type":"integer","minimum":0,"maximum":9007199254740991}},"required":["type"]}]}}}},"skip_test_all":{"default":false,"description":"When true, skip the automatic background test-all validation after node creation. Useful when the caller will run test-all separately (e.g. MCP tools that need synchronous results).","type":"boolean"}},"required":["name"]}}},"required":true},"security":[{"bearerAuth":[]}],"responses":{"201":{"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}-[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)$"},"org_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)$"},"name":{"type":"string"},"slug":{"type":"string"},"icon":{"nullable":true,"type":"string"},"folder_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)$"},"timestamp":{"type":"string"},"latest_version":{"nullable":true,"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"version_number":{"nullable":true,"type":"number"},"is_published":{"type":"boolean"},"is_live":{"type":"boolean"},"environment":{"type":"string"},"workflow_version":{"description":"Workflow engine version for this version: 2 = legacy, 3 = explicit-edges engine (loop/path/loop_break nodes available).","type":"number"},"published_at":{"nullable":true,"type":"string"},"timestamp":{"type":"string"}},"required":["id","name","slug","is_published","is_live","timestamp"],"additionalProperties":false},"variables":{"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)$"},"key":{"type":"string"},"value_production":{"type":"string"},"value_staging":{"type":"string"},"value_development":{"type":"string"},"is_hidden_in_ui":{"type":"boolean"}},"required":["id","key","value_production","value_staging","value_development","is_hidden_in_ui"],"additionalProperties":false}}},"required":["id","org_id","name","slug","timestamp","latest_version"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/workflows/{workflow_id}":{"get":{"summary":"Get a workflow","tags":["Workflows"],"description":"Returns a single workflow by UUID or slug, including its latest version info (live production version preferred, otherwise most recent).","parameters":[{"schema":{"type":"string","minLength":1},"in":"path","name":"workflow_id","required":true,"description":"Workflow UUID or slug"}],"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}-[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)$"},"org_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)$"},"name":{"type":"string"},"slug":{"type":"string"},"icon":{"nullable":true,"type":"string"},"folder_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)$"},"data_retention_days":{"nullable":true,"type":"number"},"timestamp":{"type":"string"},"latest_version":{"nullable":true,"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"version_number":{"nullable":true,"type":"number"},"is_published":{"type":"boolean"},"is_live":{"type":"boolean"},"environment":{"type":"string"},"workflow_version":{"description":"Workflow engine version for this version: 2 = legacy, 3 = explicit-edges engine (loop/path/loop_break nodes available).","type":"number"},"published_at":{"nullable":true,"type":"string"},"timestamp":{"type":"string"}},"required":["id","name","slug","is_published","is_live","timestamp"],"additionalProperties":false},"live_version":{"nullable":true,"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"version_number":{"nullable":true,"type":"number"},"is_published":{"type":"boolean"},"is_live":{"type":"boolean"},"environment":{"type":"string"},"workflow_version":{"description":"Workflow engine version for this version: 2 = legacy, 3 = explicit-edges engine (loop/path/loop_break nodes available).","type":"number"},"published_at":{"nullable":true,"type":"string"},"timestamp":{"type":"string"}},"required":["id","name","slug","is_published","is_live","timestamp"],"additionalProperties":false}},"required":["id","org_id","name","slug","timestamp","latest_version","live_version"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}},"patch":{"summary":"Update a workflow","tags":["Workflows"],"description":"Updates workflow metadata and settings. Accepts a workflow UUID or slug as the path parameter. Set `folder_id` to `null` to move the workflow to the root level. Use `settings` to update configuration such as webhooks, out-of-office hours, approval process, data retention, and audits. This endpoint does not modify versions or nodes.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"icon":{"type":"string"},"folder_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)$"},"settings":{"type":"object","properties":{"data_retention_days":{"nullable":true,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"audits_enabled":{"type":"boolean"},"audit_sampling_bps":{"type":"integer","minimum":0,"maximum":10000},"audit_conditions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"ors":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"ands":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"field":{"type":"object","properties":{"group_id":{"type":"string"},"variable_id":{"type":"string"}},"required":["group_id","variable_id"]},"condition":{"type":"string"},"value":{"type":"array","items":{"description":"!IMPORTANT: This schema describes one Paragraph object. When the containing field is an array of this schema, send a flat Paragraph[] array. Do not send a bare Paragraph object. Only send Paragraph[][] when the containing field is explicitly an array of arrays. Paragraph object schema: {type: 'paragraph', children: Array<{text: string} | {type: 'variable', children: [{text: ''}], group_id: string, variable_id: string}>}"}}}}}},"required":["ands"]}},"output":{"type":"array","items":{"description":"!IMPORTANT: This schema describes one Paragraph object. When the containing field is an array of this schema, send a flat Paragraph[] array. Do not send a bare Paragraph object. Only send Paragraph[][] when the containing field is explicitly an array of arrays. Paragraph object schema: {type: 'paragraph', children: Array<{text: string} | {type: 'variable', children: [{text: ''}], group_id: string, variable_id: string}>}"}}}}},"out_of_office_hours":{"type":"object","additionalProperties":{"type":"object","properties":{"timezone":{"type":"string","minLength":1},"weekly_schedule":{"minItems":7,"maxItems":7,"type":"array","items":{"nullable":true,"type":"array","items":{"nullable":true,"type":"object","properties":{"start":{"type":"string","pattern":"^(([0-1][0-9]|2[0-3]):[0-5][0-9]|24:00)$"},"end":{"type":"string","pattern":"^(([0-1][0-9]|2[0-3]):[0-5][0-9]|24:00)$"}},"required":["start","end"]}}},"off_days":{"type":"object","additionalProperties":{"type":"array","items":{"type":"object","properties":{"start":{"type":"string","pattern":"^(([0-1][0-9]|2[0-3]):[0-5][0-9]|24:00)$"},"end":{"type":"string","pattern":"^(([0-1][0-9]|2[0-3]):[0-5][0-9]|24:00)$"}},"required":["start","end"]}}}},"required":["timezone","weekly_schedule"]}},"webhooks":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["url"]}},"workflow_approval_process_settings":{"type":"object","properties":{"environments":{"type":"object","properties":{"production":{"type":"boolean"},"staging":{"type":"boolean"},"development":{"type":"boolean"}},"required":["production","staging","development"]}},"required":["environments"]},"deployment":{"description":"@internal","type":"object","properties":{"owner":{"nullable":true,"type":"string","maxLength":256},"pod_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)$"},"category_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)$"},"stage_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)$"},"description":{"nullable":true,"type":"string"},"linked_workflow_ids":{"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)$"}}}}}}}}}}},"parameters":[{"schema":{"type":"string","minLength":1},"in":"path","name":"workflow_id","required":true,"description":"Workflow UUID or slug"}],"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}-[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)$"},"org_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)$"},"name":{"type":"string"},"slug":{"type":"string"},"icon":{"nullable":true,"type":"string"},"folder_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)$"},"timestamp":{"type":"string"}},"required":["id","org_id","name","slug","timestamp"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}},"delete":{"summary":"Delete a workflow","tags":["Workflows"],"description":"Soft-deletes a workflow by UUID or slug. The workflow must not have any live versions — unpublish all versions before deleting.","parameters":[{"schema":{"type":"string","minLength":1},"in":"path","name":"workflow_id","required":true,"description":"Workflow UUID or slug"}],"security":[{"bearerAuth":[]}],"responses":{"204":{"description":"Workflow deleted","content":{"application/json":{"schema":{"description":"Workflow deleted"}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/workflows/{workflow_id}/versions":{"get":{"summary":"List workflow versions","tags":["Workflows"],"description":"Returns paginated versions for a workflow. Supports searching by version number or version name.","parameters":[{"schema":{"default":1,"type":"integer","minimum":1,"maximum":9007199254740991},"in":"query","name":"page","required":false},{"schema":{"default":50,"type":"integer","minimum":1,"maximum":100},"in":"query","name":"page_size","required":false},{"schema":{"default":"desc","type":"string","enum":["asc","desc"]},"in":"query","name":"sort","required":false},{"schema":{"type":"string"},"in":"query","name":"search","required":false},{"schema":{"type":"string","minLength":1},"in":"path","name":"workflow_id","required":true,"description":"Workflow UUID or slug"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"version_number":{"nullable":true,"type":"number"},"is_published":{"type":"boolean"},"is_live":{"type":"boolean"},"environment":{"type":"string"},"workflow_version":{"description":"Workflow engine version for this version: 2 = legacy, 3 = explicit-edges engine (loop/path/loop_break nodes available).","type":"number"},"published_at":{"nullable":true,"type":"string"},"timestamp":{"type":"string"}},"required":["id","name","slug","is_published","is_live","timestamp"],"additionalProperties":false}},"pagination":{"type":"object","properties":{"page":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"page_size":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total_pages":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total_records":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"has_next_page":{"type":"boolean"},"has_previous_page":{"type":"boolean"}},"required":["page","page_size","total_pages","total_records","has_next_page","has_previous_page"],"additionalProperties":false}},"required":["data","pagination"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/workflows/templates":{"get":{"summary":"List workflow templates","tags":["Workflows"],"description":"Returns a paginated list of available workflow templates. Each template includes a description and the inputs it accepts (marked as required or optional). Use a template's name in the `from_template.template` field when creating a workflow.","parameters":[{"schema":{"default":1,"type":"integer","minimum":1,"maximum":9007199254740991},"in":"query","name":"page","required":false},{"schema":{"default":50,"type":"integer","minimum":1,"maximum":100},"in":"query","name":"page_size","required":false},{"schema":{"type":"string"},"in":"query","name":"search","required":false}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"template":{"type":"string"},"description":{"type":"string"},"inputs":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string"},"required":{"type":"boolean"},"description":{"type":"string"},"options":{"type":"array","items":{"type":"string"}},"default":{"type":"string"}},"required":["name","type","required","description"],"additionalProperties":false}}},"required":["template","description","inputs"],"additionalProperties":false}},"pagination":{"type":"object","properties":{"page":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"page_size":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total_pages":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total_records":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"has_next_page":{"type":"boolean"},"has_previous_page":{"type":"boolean"}},"required":["page","page_size","total_pages","total_records","has_next_page","has_previous_page"],"additionalProperties":false}},"required":["data","pagination"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/workflows/{workflow_id}/duplicate":{"post":{"summary":"Duplicate a workflow","tags":["Workflows"],"description":"Creates a copy of a workflow including all its nodes and configurations. The duplicated workflow is created as a new unpublished workflow with version number 1. If the source uses workflow engine v2, the duplicate remains an editable v2 draft and cannot be published through the public API until upgraded to v3. The existing published v2 source remains live and continues running until explicitly unpublished.\n\n- **name** — Optional. Display name for the new workflow. Defaults to `'{original name} Copy'`.\n- **version_id** — Optional. The specific version to duplicate. Defaults to the latest version of the source workflow.\n- **org_id** — Optional. Target organization for the copy. Defaults to the API key's organization. Cross-org duplication requires access to both organizations.\n\nSensitive configurations (e.g. phone numbers, SIP trunks) are cleared during duplication and must be reconfigured.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"description":"Display name for the new workflow. When omitted, defaults to '{original workflow name} Copy'.","type":"string","minLength":1},"org_id":{"description":"Target organization ID for the duplicated workflow. Defaults to the organization of the API key. Cross-org duplication requires access to both organizations.","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)$"},"version_id":{"description":"The version to duplicate. When omitted, defaults to the latest version of the source workflow.","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)$"},"wait_for_test_all":{"default":false,"description":"When true, block until the post-duplication test-all finishes and return per-node results in `test_all_results`. When false (default), test-all is fired in the background and the response returns immediately.","type":"boolean"}}}}}},"parameters":[{"schema":{"type":"string","minLength":1},"in":"path","name":"workflow_id","required":true,"description":"Workflow UUID or slug"}],"security":[{"bearerAuth":[]}],"responses":{"201":{"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}-[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)$"},"org_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)$"},"name":{"type":"string"},"slug":{"type":"string"},"icon":{"nullable":true,"type":"string"},"folder_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)$"},"timestamp":{"type":"string"},"version":{"nullable":true,"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"version_number":{"nullable":true,"type":"number"},"is_published":{"type":"boolean"},"is_live":{"type":"boolean"},"environment":{"type":"string"},"workflow_version":{"description":"Workflow engine version for this version: 2 = legacy, 3 = explicit-edges engine (loop/path/loop_break nodes available).","type":"number"},"published_at":{"nullable":true,"type":"string"},"timestamp":{"type":"string"}},"required":["id","name","slug","is_published","is_live","timestamp"],"additionalProperties":false},"warnings":{"type":"array","items":{"type":"string"}},"test_all_results":{"type":"array","items":{"type":"object","properties":{"node_id":{"type":"string"},"persistent_id":{"type":"string"},"name":{"type":"string"},"status":{"type":"string","enum":["success","failed","skipped"]},"error":{"type":"string"}},"required":["node_id","persistent_id","name","status"],"additionalProperties":false}}},"required":["id","org_id","name","slug","timestamp","version"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/workflows/{workflow_id}/variables":{"get":{"summary":"List workflow variables","tags":["Workflow Variables"],"description":"Returns paginated variables scoped to a specific workflow. Accepts a workflow UUID or slug as the path parameter.","parameters":[{"schema":{"default":1,"type":"integer","minimum":1,"maximum":9007199254740991},"in":"query","name":"page","required":false},{"schema":{"default":50,"type":"integer","minimum":1,"maximum":100},"in":"query","name":"page_size","required":false},{"schema":{"default":"asc","type":"string","enum":["asc","desc"]},"in":"query","name":"sort","required":false},{"schema":{"type":"string","minLength":1},"in":"path","name":"workflow_id","required":true,"description":"Workflow UUID or slug"}],"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}-[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)$"},"workflow_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)$"},"org_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)$"},"key":{"type":"string"},"value_production":{"type":"string"},"value_staging":{"type":"string"},"value_development":{"type":"string"},"is_hidden_in_ui":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","workflow_id","org_id","key","value_production","value_staging","value_development","is_hidden_in_ui","created_at","updated_at"],"additionalProperties":false}},"pagination":{"type":"object","properties":{"page":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"page_size":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total_pages":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total_records":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"has_next_page":{"type":"boolean"},"has_previous_page":{"type":"boolean"}},"required":["page","page_size","total_pages","total_records","has_next_page","has_previous_page"],"additionalProperties":false}},"required":["data","pagination"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}},"post":{"summary":"Create a workflow variable","tags":["Workflow Variables"],"description":"Creates a new variable scoped to the specified workflow. Accepts a workflow UUID or slug as the path parameter.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"key":{"type":"string","minLength":1},"value_production":{"type":"string"},"value_staging":{"type":"string"},"value_development":{"type":"string"},"is_hidden_in_ui":{"default":false,"type":"boolean"}},"required":["key","value_production","value_staging","value_development"]}}},"required":true},"parameters":[{"schema":{"type":"string","minLength":1},"in":"path","name":"workflow_id","required":true,"description":"Workflow UUID or slug"}],"security":[{"bearerAuth":[]}],"responses":{"201":{"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}-[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)$"},"workflow_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)$"},"org_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)$"},"key":{"type":"string"},"value_production":{"type":"string"},"value_staging":{"type":"string"},"value_development":{"type":"string"},"is_hidden_in_ui":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","workflow_id","org_id","key","value_production","value_staging","value_development","is_hidden_in_ui","created_at","updated_at"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/workflows/{workflow_id}/variables/{variable_id}":{"patch":{"summary":"Update a workflow variable","tags":["Workflow Variables"],"description":"Updates one or more fields on a variable. Only the fields provided in the request body are updated.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"key":{"type":"string","minLength":1},"value_production":{"type":"string"},"value_staging":{"type":"string"},"value_development":{"type":"string"},"is_hidden_in_ui":{"type":"boolean"}}}}}},"parameters":[{"schema":{"type":"string","minLength":1},"in":"path","name":"workflow_id","required":true,"description":"Workflow UUID or slug"},{"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":"variable_id","required":true,"description":"Variable UUID"}],"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}-[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)$"},"workflow_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)$"},"org_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)$"},"key":{"type":"string"},"value_production":{"type":"string"},"value_staging":{"type":"string"},"value_development":{"type":"string"},"is_hidden_in_ui":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","workflow_id","org_id","key","value_production","value_staging","value_development","is_hidden_in_ui","created_at","updated_at"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}},"delete":{"summary":"Delete a workflow variable","tags":["Workflow Variables"],"description":"Permanently deletes a variable from a workflow. This action cannot be undone.","parameters":[{"schema":{"type":"string","minLength":1},"in":"path","name":"workflow_id","required":true,"description":"Workflow UUID or slug"},{"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":"variable_id","required":true,"description":"Variable UUID"}],"security":[{"bearerAuth":[]}],"responses":{"204":{"description":"Variable deleted","content":{"application/json":{"schema":{"description":"Variable deleted"}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/workflows/{workflow_id}/publish":{"post":{"summary":"Publish a workflow","tags":["Workflows"],"description":"Publishes the latest version of the specified workflow to make it live. Before publishing, all action nodes are checked for test errors and untested status. If untested nodes exist (with no errors), a synchronous test-all is triggered first. If any node has test errors, the publish is blocked and errors are returned. Workflow engine v2 versions cannot be published through the public API. Existing published v2 versions remain live and continue running until explicitly unpublished; this endpoint does not stop them.\n\nFor an eligible v3 target, returns an error if the workflow already has a live version. After the target passes readiness checks, use the unpublish endpoint to take the current version offline, then retry the publish request. Accepts a workflow UUID or slug as the path parameter.","requestBody":{"content":{"application/json":{"schema":{"nullable":true,"type":"object","properties":{"environment":{"default":"production","description":"Target environment for publishing","type":"string","enum":["production","staging","development"]}}}}}},"parameters":[{"schema":{"type":"string","minLength":1},"in":"path","name":"workflow_id","required":true,"description":"Workflow UUID or slug"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"is_published":{"type":"boolean"},"is_live":{"type":"boolean"},"environment":{"type":"string"},"missing_variables":{"description":"Variable references that could not be resolved against upstream nodes. Informational — does not block publishing.","type":"array","items":{"type":"object","properties":{"node_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)$","description":"The node containing the broken reference"},"node_name":{"nullable":true,"description":"Display name of the node","type":"string"},"missing_variables":{"type":"array","items":{"type":"object","properties":{"group_id":{"type":"string","description":"The referenced variable group ID (persistent_id of the source node)"},"variable_id":{"type":"string","description":"The referenced variable ID within the group"}},"required":["group_id","variable_id"],"additionalProperties":false},"description":"Variable references that could not be resolved"}},"required":["node_id","node_name","missing_variables"],"additionalProperties":false}}},"required":["id","is_published","is_live","environment"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"number"},"errors":{"type":"array","items":{"type":"object","properties":{"node_id":{"type":"string"},"name":{"nullable":true,"type":"string"},"error":{"type":"string"}},"required":["node_id","name","error"],"additionalProperties":false}},"missing_variables":{"description":"Variable references that could not be resolved against upstream nodes.","type":"array","items":{"type":"object","properties":{"node_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)$","description":"The node containing the broken reference"},"node_name":{"nullable":true,"description":"Display name of the node","type":"string"},"missing_variables":{"type":"array","items":{"type":"object","properties":{"group_id":{"type":"string","description":"The referenced variable group ID (persistent_id of the source node)"},"variable_id":{"type":"string","description":"The referenced variable ID within the group"}},"required":["group_id","variable_id"],"additionalProperties":false},"description":"Variable references that could not be resolved"}},"required":["node_id","node_name","missing_variables"],"additionalProperties":false}}},"required":["error","message","statusCode"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"502":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/workflows/{workflow_id}/unpublish":{"post":{"summary":"Unpublish a workflow","tags":["Workflows"],"description":"Finds the currently live version for the workflow and unpublishes it. The version is taken offline and unlocked for editing. Returns 400 if no version is currently live. Accepts a workflow UUID or slug as the path parameter.","parameters":[{"schema":{"type":"string","minLength":1},"in":"path","name":"workflow_id","required":true,"description":"Workflow UUID or slug"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"is_published":{"type":"boolean"},"is_live":{"type":"boolean"}},"required":["id","is_published","is_live"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"502":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/workflows/{workflow_id}/runs":{"get":{"summary":"List workflow runs","tags":["Workflows"],"description":"Returns paginated runs for a workflow. Supports filtering by status, date ranges, and annotation.","parameters":[{"schema":{"default":1,"type":"integer","minimum":1,"maximum":9007199254740991},"in":"query","name":"page","required":false},{"schema":{"default":100,"type":"integer","minimum":1,"maximum":2000},"in":"query","name":"page_size","required":false},{"schema":{"default":"desc","type":"string","enum":["asc","desc"]},"in":"query","name":"sort","required":false},{"schema":{"type":"string","enum":["scheduled","running","completed","canceled","failed"]},"in":"query","name":"status","required":false},{"schema":{"anyOf":[{"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))$"},{"type":"string","enum":[""]}]},"in":"query","name":"start_date","required":false},{"schema":{"anyOf":[{"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))$"},{"type":"string","enum":[""]}]},"in":"query","name":"end_date","required":false},{"schema":{"anyOf":[{"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))$"},{"type":"string","enum":[""]}]},"in":"query","name":"completed_start_date","required":false},{"schema":{"anyOf":[{"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))$"},{"type":"string","enum":[""]}]},"in":"query","name":"completed_end_date","required":false},{"schema":{"type":"string","enum":["correct","incorrect","critical"]},"in":"query","name":"annotation","required":false},{"schema":{"type":"string","minLength":1},"in":"path","name":"workflow_id","required":true,"description":"Workflow UUID or slug"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["not_started","scheduled","running","skipped","succeeded","completed","canceled","failed"]},"org_id":{"type":"string"},"timestamp":{"type":"string"},"use_case_id":{"type":"string"},"version_id":{"type":"string"},"annotation":{"nullable":true,"type":"string","enum":["correct","incorrect","critical"]},"completed_at":{"nullable":true,"type":"string"},"input_tokens":{"nullable":true,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"output_tokens":{"nullable":true,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"data":{"type":"object","additionalProperties":{}}},"required":["id","status","org_id","timestamp","use_case_id","version_id","annotation","completed_at","input_tokens","output_tokens","data"],"additionalProperties":false}},"pagination":{"type":"object","properties":{"page":{"type":"integer","minimum":1,"maximum":9007199254740991},"pageSize":{"type":"integer","minimum":1,"maximum":9007199254740991},"totalPages":{"type":"integer","minimum":0,"maximum":9007199254740991},"totalRecords":{"type":"integer","minimum":0,"maximum":9007199254740991},"hasNextPage":{"type":"boolean"},"hasPreviousPage":{"type":"boolean"}},"required":["page","pageSize","totalPages","totalRecords","hasNextPage","hasPreviousPage"],"additionalProperties":false}},"required":["data","pagination"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}},"post":{"summary":"Trigger a workflow run","tags":["Workflows"],"description":"Starts a new run for a workflow by proxying to the hooks service. Accepts either a JSON body with payload/environment fields, or a multipart/form-data request with a file and optional form fields (pass environment as a query param for multipart). Supports targeting different environments (production, staging, development).","parameters":[{"schema":{"type":"string","minLength":1},"in":"path","name":"workflow_id","required":true,"description":"Workflow UUID or slug"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"run_id":{"type":"string"},"queued_run_ids":{"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)$"}},"status":{"type":"string"},"message":{"type":"string"}},"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"502":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/workflows/{workflow_id}/sessions":{"get":{"summary":"List workflow sessions","tags":["Workflows"],"description":"Returns paginated sessions for a workflow across all runs, ordered by timestamp.","parameters":[{"schema":{"default":1,"type":"integer","minimum":1,"maximum":9007199254740991},"in":"query","name":"page","required":false},{"schema":{"default":50,"type":"integer","minimum":1,"maximum":100},"in":"query","name":"page_size","required":false},{"schema":{"default":"desc","type":"string","enum":["asc","desc"]},"in":"query","name":"sort","required":false},{"schema":{"type":"string","minLength":1},"in":"path","name":"workflow_id","required":true,"description":"Workflow UUID or slug"}],"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}-[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)$"},"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)$"},"version_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)$"},"status":{"type":"string"},"type":{"type":"string"},"duration":{"nullable":true,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"timestamp":{"type":"string"},"failure_reason":{"nullable":true,"type":"string"}},"required":["id","run_id","version_id","status","type","duration","timestamp","failure_reason"],"additionalProperties":false}},"pagination":{"type":"object","properties":{"page":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"page_size":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total_pages":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total_records":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"has_next_page":{"type":"boolean"},"has_previous_page":{"type":"boolean"}},"required":["page","page_size","total_pages","total_records","has_next_page","has_previous_page"],"additionalProperties":false}},"required":["data","pagination"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/workflows/{workflow_id}/cancel-runs":{"post":{"summary":"Cancel active workflow runs","tags":["Workflows"],"description":"Cancels all current and queued runs for the workflow. By default, the currently live workflow version is also unpublished. Set unpublish_workflow to false to keep the workflow published after cancellation. Accepts a workflow UUID or slug as the path parameter.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"unpublish_workflow":{"type":"boolean"}}}}}},"parameters":[{"schema":{"type":"string","minLength":1},"in":"path","name":"workflow_id","required":true,"description":"Workflow UUID or slug"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string"},"workflow_toggle_result":{"nullable":true,"type":"object","properties":{"success":{"type":"boolean"},"unpublished_version_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)$"},"message":{"type":"string"},"error":{"type":"string"}},"required":["success"],"additionalProperties":false}},"required":["status","workflow_toggle_result"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"502":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/workflows/{workflow_id}/audits/northstars":{"get":{"summary":"List northstar audits for a workflow","tags":["Audits"],"description":"Returns paginated northstar audit results for a workflow, showing pass/fail rates per behavioral criterion.","parameters":[{"schema":{"type":"string"},"in":"query","name":"from_date","required":false},{"schema":{"type":"string"},"in":"query","name":"to_date","required":false},{"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":"query","name":"version_id","required":false},{"schema":{"type":"string"},"in":"query","name":"enabled","required":false},{"schema":{"type":"string"},"in":"query","name":"search","required":false},{"schema":{"default":1,"type":"integer","minimum":1,"maximum":9007199254740991},"in":"query","name":"page","required":false},{"schema":{"default":50,"type":"integer","minimum":1,"maximum":200},"in":"query","name":"page_size","required":false},{"schema":{"type":"string","minLength":1},"in":"path","name":"workflow_id","required":true,"description":"Workflow UUID or slug"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"northstar_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)$"},"northstar_name":{"type":"string"},"description":{"type":"array","items":{"type":"object","additionalProperties":{}}},"category":{"nullable":true,"type":"string"},"use_case_name":{"type":"string"},"use_case_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)$"},"workflow_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)$"},"pass_count":{"type":"number"},"fail_count":{"type":"number"},"na_count":{"type":"number"},"total_count":{"type":"number"},"pass_rate":{"nullable":true,"type":"number"},"latest_failure":{"nullable":true,"type":"string"},"latest_occurrence":{"type":"string"},"enabled":{"type":"boolean"},"version_id":{"type":"string"},"version_number":{"nullable":true,"type":"number"},"version_name":{"nullable":true,"type":"string"}},"required":["northstar_id","northstar_name","description","category","use_case_name","use_case_id","workflow_id","pass_count","fail_count","na_count","total_count","pass_rate","latest_failure","latest_occurrence","enabled","version_id","version_number","version_name"],"additionalProperties":false}},"pagination":{"type":"object","properties":{"page":{"type":"number"},"page_size":{"type":"number"},"total_pages":{"type":"number"},"total_records":{"type":"number"},"has_next_page":{"type":"boolean"},"has_previous_page":{"type":"boolean"}},"required":["page","page_size","total_pages","total_records","has_next_page","has_previous_page"],"additionalProperties":false}},"required":["data","pagination"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/workflows/{workflow_id}/audits/northstars/{northstar_id}/remarks":{"get":{"summary":"List audit remarks for a northstar","tags":["Audits"],"description":"Returns cursor-paginated audit remarks for a specific northstar criterion, optionally filtered by grade.","parameters":[{"schema":{"type":"string","enum":["passed","failed","not_applicable"]},"in":"query","name":"grade","required":false},{"schema":{"type":"string"},"in":"query","name":"cursor","required":false},{"schema":{"default":25,"type":"integer","minimum":1,"maximum":100},"in":"query","name":"limit","required":false},{"schema":{"type":"string","minLength":1},"in":"path","name":"workflow_id","required":true,"description":"Workflow UUID or slug"},{"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":"northstar_id","required":true}],"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}-[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)$"},"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)$"},"timestamp":{"type":"string"},"run_url":{"type":"string"},"grade":{"type":"string","enum":["passed","failed","not_applicable"]},"passed":{"nullable":true,"type":"boolean"},"message_ids":{"type":"array","items":{"type":"string"}},"correction":{"nullable":true,"type":"string"},"correction_reason":{"nullable":true,"type":"string"},"org_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)$"},"user_feedback":{"nullable":true,"type":"object","properties":{"polarity":{"type":"boolean"},"issue_attribution":{"nullable":true,"type":"string"}},"required":["polarity","issue_attribution"],"additionalProperties":false}},"required":["id","run_id","timestamp","run_url","grade","message_ids","correction","correction_reason","org_id"],"additionalProperties":false}},"next_cursor":{"nullable":true,"type":"string"},"total":{"type":"number"}},"required":["data","next_cursor","total"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/workflows/{workflow_id}/audits/remarks":{"get":{"summary":"List audit remarks for a workflow","tags":["Audits"],"description":"Returns cursor-paginated behavioral audit remarks across all northstar criteria for a workflow. Optionally filter by northstar, grade, or status.","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":"query","name":"northstar_id","required":false},{"schema":{"type":"string","enum":["passed","failed","not_applicable"]},"in":"query","name":"grade","required":false},{"schema":{"type":"string","enum":["open","resolved","dismissed"]},"in":"query","name":"status","required":false},{"schema":{"type":"string"},"in":"query","name":"cursor","required":false},{"schema":{"default":25,"type":"integer","minimum":1,"maximum":100},"in":"query","name":"limit","required":false},{"schema":{"type":"string","minLength":1},"in":"path","name":"workflow_id","required":true,"description":"Workflow UUID or slug"}],"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}-[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)$"},"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)$"},"run_url":{"type":"string"},"timestamp":{"type":"string"},"grade":{"type":"string","enum":["passed","failed","not_applicable"]},"passed":{"nullable":true,"type":"boolean"},"status":{"type":"string","enum":["open","resolved","dismissed"]},"northstar_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)$"},"northstar_name":{"type":"string"},"message_ids":{"type":"array","items":{"type":"string"}},"messages":{"type":"array","items":{"type":"object","properties":{"role":{"type":"string"},"content":{"type":"string"}},"required":["role","content"],"additionalProperties":false}},"correction":{"nullable":true,"type":"string"},"correction_reason":{"nullable":true,"type":"string"},"org_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)$"},"user_feedback":{"nullable":true,"type":"object","properties":{"polarity":{"type":"boolean"},"issue_attribution":{"nullable":true,"type":"string"}},"required":["polarity","issue_attribution"],"additionalProperties":false}},"required":["id","run_id","run_url","timestamp","grade","status","northstar_id","northstar_name","message_ids","messages","correction","correction_reason","org_id"],"additionalProperties":false}},"next_cursor":{"nullable":true,"type":"string"},"total":{"type":"number"}},"required":["data","next_cursor","total"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/workflows/{workflow_id}/audits/node-errors":{"get":{"summary":"List node errors for a workflow","tags":["Audits"],"description":"Returns paginated node execution errors for a workflow, grouped by node and error type.","parameters":[{"schema":{"type":"string"},"in":"query","name":"from_date","required":false},{"schema":{"type":"string"},"in":"query","name":"to_date","required":false},{"schema":{"type":"string"},"in":"query","name":"search","required":false},{"schema":{"default":1,"type":"integer","minimum":1,"maximum":9007199254740991},"in":"query","name":"page","required":false},{"schema":{"default":50,"type":"integer","minimum":1,"maximum":200},"in":"query","name":"page_size","required":false},{"schema":{"type":"string","minLength":1},"in":"path","name":"workflow_id","required":true,"description":"Workflow UUID or slug"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"node_id":{"type":"string"},"persistent_node_id":{"type":"string"},"error":{"type":"string"},"node_name":{"type":"string"},"use_case_name":{"type":"string"},"count":{"type":"number"},"latest_timestamp":{"type":"string"},"earliest_timestamp":{"type":"string"}},"required":["node_id","persistent_node_id","error","node_name","use_case_name","count","latest_timestamp","earliest_timestamp"],"additionalProperties":false}},"pagination":{"type":"object","properties":{"page":{"type":"number"},"page_size":{"type":"number"},"total_pages":{"type":"number"},"total_records":{"type":"number"},"has_next_page":{"type":"boolean"},"has_previous_page":{"type":"boolean"}},"required":["page","page_size","total_pages","total_records","has_next_page","has_previous_page"],"additionalProperties":false}},"required":["data","pagination"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/workflows/{workflow_id}/audits/stats":{"get":{"summary":"Get audit stats for the live workflow version","tags":["Audits"],"description":"Returns aggregate audit statistics for the live (or most recently audited) version of a workflow.","parameters":[{"schema":{"type":"string","minLength":1},"in":"path","name":"workflow_id","required":true,"description":"Workflow UUID or slug"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"pass_rate_24h":{"nullable":true,"type":"number"},"pass_count_24h":{"type":"number"},"total_count_24h":{"type":"number"},"average_run_score":{"nullable":true,"type":"number"},"audited_run_count":{"type":"number"},"version_id":{"nullable":true,"type":"string"},"version_number":{"nullable":true,"type":"number"},"version_name":{"nullable":true,"type":"string"},"is_live":{"type":"boolean"}},"required":["pass_rate_24h","pass_count_24h","total_count_24h","average_run_score","audited_run_count","version_id","version_number","version_name","is_live"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/workflows/{workflow_id}/audits/versions":{"get":{"summary":"List audited versions for a workflow","tags":["Audits"],"description":"Returns all versions of a workflow that have audit data, indicating which is the live version.","parameters":[{"schema":{"type":"string","minLength":1},"in":"path","name":"workflow_id","required":true,"description":"Workflow UUID or slug"}],"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}-[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)$"},"version_number":{"nullable":true,"type":"number"},"name":{"nullable":true,"type":"string"},"is_live":{"type":"boolean"}},"required":["id","version_number","name","is_live"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/workflows/{workflow_id}/issues":{"get":{"summary":"List issues for a workflow","tags":["Issues"],"description":"Returns paginated quality issues (flags) for a workflow, optionally filtered by status or source.","parameters":[{"schema":{"default":1,"type":"integer","minimum":1,"maximum":9007199254740991},"in":"query","name":"page","required":false},{"schema":{"default":50,"type":"integer","minimum":1,"maximum":200},"in":"query","name":"page_size","required":false},{"schema":{"type":"string","enum":["open","approved","rejected","closed"]},"in":"query","name":"status","required":false},{"schema":{"type":"string","enum":["manual","auto"]},"in":"query","name":"source","required":false},{"schema":{"type":"string","minLength":1},"in":"path","name":"workflow_id","required":true,"description":"Workflow UUID or slug"}],"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}-[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)$"},"run_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)$"},"session_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)$"},"message_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)$"},"type":{"type":"string"},"priority":{"type":"string"},"status":{"type":"string"},"source":{"type":"string"},"description":{"nullable":true,"type":"string"},"correction":{"nullable":true,"type":"string"},"correction_reason":{"nullable":true,"type":"string"},"metric_key":{"nullable":true,"type":"string"},"metric_value":{"nullable":true,"type":"number"},"threshold_value":{"nullable":true,"type":"number"},"version_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)$"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","run_id","session_id","message_id","type","priority","status","source","description","correction","correction_reason","metric_key","metric_value","threshold_value","version_id","created_at","updated_at"],"additionalProperties":false}},"pagination":{"type":"object","properties":{"page":{"type":"number"},"page_size":{"type":"number"},"total_pages":{"type":"number"},"total_records":{"type":"number"},"has_next_page":{"type":"boolean"},"has_previous_page":{"type":"boolean"}},"required":["page","page_size","total_pages","total_records","has_next_page","has_previous_page"],"additionalProperties":false}},"required":["data","pagination"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/apps/{app_slug}/duplicate":{"post":{"summary":"Duplicate an app","tags":["Apps"],"description":"Creates a copy of a managed custom app, including source code and custom environment variables.\n\nThis is a long-running request and may take a while before responding.\n\n- **name** — Optional. Display name for the new app. Defaults to `'{original name} Copy'`.\n- **description** — Optional. Defaults to the source app description.\n- **tag_ids** — Optional. Tags to assign on the new app.\n\nPlatform-managed environment variables are regenerated for the new app. Service credentials are **not** copied and must be reconfigured. Only managed Next.js apps can be duplicated.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"description":"Display name for the new app. When omitted, defaults to '{original app name} Copy'.","type":"string","minLength":1,"maxLength":256},"description":{"description":"Description for the new app. When omitted, defaults to the source app description.","type":"string"},"tag_ids":{"description":"Tag IDs to assign to the duplicated app in the current organization.","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)$"}}}}}}},"parameters":[{"schema":{"type":"string","minLength":1},"in":"path","name":"app_slug","required":true,"description":"Slug of the source app to duplicate"}],"security":[{"bearerAuth":[]}],"responses":{"201":{"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}-[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)$"},"org_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)$"},"name":{"type":"string"},"slug":{"type":"string"},"description":{"nullable":true,"type":"string"},"public_url":{"nullable":true,"type":"string"},"tag_ids":{"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)$"}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","org_id","name","slug","description","public_url","tag_ids","created_at","updated_at"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/versions/{version_id}/":{"get":{"summary":"Get a version with nodes summary","tags":["Versions"],"description":"Returns a single version by UUID or slug with metadata, node count, node counts by type, and the list of events (action node types) used.","parameters":[{"schema":{"type":"string","minLength":1},"in":"path","name":"version_id","required":true,"description":"Version UUID or slug"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"workflow_slug":{"type":"string"},"version_number":{"nullable":true,"type":"number"},"is_published":{"type":"boolean"},"is_live":{"type":"boolean"},"environment":{"type":"string"},"workflow_version":{"type":"number"},"published_at":{"nullable":true,"type":"string"},"timestamp":{"type":"string"},"node_count":{"type":"number"},"node_counts_by_type":{"type":"object","additionalProperties":{"type":"number"}},"events":{"type":"array","items":{"type":"object","properties":{"event_id":{"type":"string"},"name":{"type":"string"}},"required":["event_id","name"],"additionalProperties":false}},"changelog":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"description":{"nullable":true,"type":"string"},"created_at":{"type":"string"},"created_by":{"nullable":true,"type":"object","properties":{"type":{"type":"string","enum":["user","api_key"]},"name":{"nullable":true,"type":"string"}},"required":["type","name"],"additionalProperties":false}},"required":["id","type","description","created_at","created_by"],"additionalProperties":false}}},"required":["id","name","slug","is_published","is_live","timestamp","node_count","node_counts_by_type","events","changelog"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}},"patch":{"summary":"Update a version","tags":["Versions"],"description":"Updates version metadata (name and/or description). Accepts a version UUID or slug as the path parameter.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"description":"Version display name","type":"string","minLength":1,"maxLength":256},"description":{"description":"Version description","type":"string"}}}}}},"parameters":[{"schema":{"type":"string","minLength":1},"in":"path","name":"version_id","required":true,"description":"Version UUID or slug"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"workflow_slug":{"type":"string"},"version_number":{"nullable":true,"type":"number"},"is_published":{"type":"boolean"},"is_live":{"type":"boolean"},"environment":{"type":"string"},"workflow_version":{"type":"number"},"published_at":{"nullable":true,"type":"string"},"timestamp":{"type":"string"},"description":{"nullable":true,"type":"string"}},"required":["id","name","slug","is_published","is_live","timestamp"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/versions/{version_id}/fork":{"post":{"summary":"Fork a version","tags":["Versions"],"description":"Creates a new version by copying all nodes from the specified version. The new version gets the next available version number and is unlocked/unpublished. If the source uses workflow engine v2, the fork remains an editable v2 draft and cannot be published through the public API until upgraded to v3. Any existing published v2 version remains live and continues running until explicitly unpublished. Accepts a version UUID or slug as the path parameter.","parameters":[{"schema":{"type":"string","minLength":1},"in":"path","name":"version_id","required":true,"description":"Version UUID or slug"}],"security":[{"bearerAuth":[]}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"workflow_slug":{"type":"string"},"version_number":{"nullable":true,"type":"number"},"is_published":{"type":"boolean"},"is_live":{"type":"boolean"},"environment":{"type":"string"},"workflow_version":{"type":"number"},"published_at":{"nullable":true,"type":"string"},"timestamp":{"type":"string"},"description":{"nullable":true,"type":"string"},"source_version_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)$"},"warnings":{"type":"array","items":{"type":"string"}}},"required":["id","name","slug","is_published","is_live","timestamp"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/versions/{version_id}/publish":{"post":{"summary":"Publish a version","tags":["Versions"],"description":"Publishes the specified version to make it live. Before publishing, node configuration completeness is validated. If untested nodes exist, a synchronous test-all is triggered automatically. Test errors do not block publishing (matching UI behavior) but are returned as informational warnings in the `test_errors` field. Workflow engine v2 versions cannot be published through the public API. Existing published v2 versions remain live and continue running until explicitly unpublished; this endpoint does not stop them.\n\nFor an eligible v3 target, either `unpublish_version_id` or `force: true` must be provided when a live version exists. Use `unpublish_version_id` to explicitly specify the live version to replace. Use `force: true` to automatically unpublish whatever version is currently live.","requestBody":{"content":{"application/json":{"schema":{"nullable":true,"type":"object","properties":{"unpublish_version_id":{"description":"ID of the currently live version to unpublish before publishing this one. Required when the workflow already has a live version, unless force is 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)$"},"environment":{"default":"production","description":"Target environment for publishing","type":"string","enum":["production","staging","development"]},"force":{"default":false,"description":"When true, automatically unpublishes any currently live version without requiring unpublish_version_id.","type":"boolean"}}}}}},"parameters":[{"schema":{"type":"string","minLength":1},"in":"path","name":"version_id","required":true,"description":"Version UUID or slug"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"is_published":{"type":"boolean"},"is_live":{"type":"boolean"},"environment":{"type":"string"},"missing_variables":{"description":"Variable references that could not be resolved against upstream nodes. Informational — does not block publishing.","type":"array","items":{"type":"object","properties":{"node_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)$","description":"The node containing the broken reference"},"node_name":{"nullable":true,"description":"Display name of the node","type":"string"},"missing_variables":{"type":"array","items":{"type":"object","properties":{"group_id":{"type":"string","description":"The referenced variable group ID (persistent_id of the source node)"},"variable_id":{"type":"string","description":"The referenced variable ID within the group"}},"required":["group_id","variable_id"],"additionalProperties":false},"description":"Variable references that could not be resolved"}},"required":["node_id","node_name","missing_variables"],"additionalProperties":false}},"test_errors":{"description":"Nodes with test errors at time of publishing. Informational — does not block publishing (matches UI behavior).","type":"array","items":{"type":"object","properties":{"node_id":{"type":"string"},"name":{"nullable":true,"type":"string"},"error":{"type":"string"}},"required":["node_id","name","error"],"additionalProperties":false}}},"required":["id","is_published","is_live","environment"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"number"},"errors":{"type":"array","items":{"type":"object","properties":{"node_id":{"type":"string"},"name":{"nullable":true,"type":"string"},"error":{"type":"string"}},"required":["node_id","name","error"],"additionalProperties":false}},"missing_variables":{"description":"Variable references that could not be resolved against upstream nodes.","type":"array","items":{"type":"object","properties":{"node_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)$","description":"The node containing the broken reference"},"node_name":{"nullable":true,"description":"Display name of the node","type":"string"},"missing_variables":{"type":"array","items":{"type":"object","properties":{"group_id":{"type":"string","description":"The referenced variable group ID (persistent_id of the source node)"},"variable_id":{"type":"string","description":"The referenced variable ID within the group"}},"required":["group_id","variable_id"],"additionalProperties":false},"description":"Variable references that could not be resolved"}},"required":["node_id","node_name","missing_variables"],"additionalProperties":false}}},"required":["error","message","statusCode"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"502":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/versions/{version_id}/lock":{"post":{"summary":"Lock a version","tags":["Versions"],"description":"Locks the specified version, preventing further edits to its nodes. Accepts a version UUID or slug as the path parameter.","parameters":[{"schema":{"type":"string","minLength":1},"in":"path","name":"version_id","required":true,"description":"Version UUID or slug"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"is_published":{"type":"boolean"},"is_live":{"type":"boolean"}},"required":["id","is_published","is_live"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/versions/{version_id}/unlock":{"post":{"summary":"Unlock a version","tags":["Versions"],"description":"Unlocks the specified version, allowing edits to its nodes. A version that is currently live cannot be unlocked — use unpublish instead. Accepts a version UUID or slug as the path parameter.","parameters":[{"schema":{"type":"string","minLength":1},"in":"path","name":"version_id","required":true,"description":"Version UUID or slug"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"is_published":{"type":"boolean"},"is_live":{"type":"boolean"}},"required":["id","is_published","is_live"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/versions/{version_id}/unpublish":{"post":{"summary":"Unpublish a version","tags":["Versions"],"description":"Unpublishes the version (takes it offline) and unlocks it for editing. The version will no longer be live and its published lock is removed, allowing further modifications. The version must currently be live. Accepts a version UUID or slug as the path parameter.","parameters":[{"schema":{"type":"string","minLength":1},"in":"path","name":"version_id","required":true,"description":"Version UUID or slug"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"is_published":{"type":"boolean"},"is_live":{"type":"boolean"}},"required":["id","is_published","is_live"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"502":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/versions/{version_id}/nodes":{"get":{"summary":"List version nodes","tags":["Versions"],"description":"Returns all workflow nodes belonging to the specified version. The version can be identified by its UUID or slug.","parameters":[{"schema":{"type":"string","minLength":1},"in":"path","name":"version_id","required":true,"description":"Version UUID or slug"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"oneOf":[{"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)$"},"persistent_id":{"nullable":true,"type":"string"},"version_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)$"},"workflow_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)$"},"org_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)$"},"parent_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)$"},"type":{"type":"string","enum":["action"]},"name":{"nullable":true,"type":"string"},"sort_index":{"nullable":true,"type":"number"},"is_complete":{"nullable":true,"type":"boolean"},"configuration":{"nullable":true,"type":"object","additionalProperties":{}},"node_output":{"nullable":true,"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)$"},"node_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)$"},"type":{"nullable":true,"type":"string"},"data":{"nullable":true,"type":"object","additionalProperties":{}},"timestamp":{"type":"string"}},"required":["id","node_id","timestamp"],"additionalProperties":false},"timestamp":{"type":"string"},"event_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_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})$"},"trigger_interval":{"nullable":true,"type":"string"},"multi_event_behavior":{"nullable":true,"type":"string"}},"required":["id","version_id","workflow_id","org_id","type","timestamp"],"additionalProperties":false},{"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)$"},"persistent_id":{"nullable":true,"type":"string"},"version_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)$"},"workflow_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)$"},"org_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)$"},"parent_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)$"},"type":{"type":"string","enum":["prompt"]},"name":{"nullable":true,"type":"string"},"sort_index":{"nullable":true,"type":"number"},"is_complete":{"nullable":true,"type":"boolean"},"configuration":{"nullable":true,"type":"object","additionalProperties":{}},"node_output":{"nullable":true,"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)$"},"node_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)$"},"type":{"nullable":true,"type":"string"},"data":{"nullable":true,"type":"object","additionalProperties":{}},"timestamp":{"type":"string"}},"required":["id","node_id","timestamp"],"additionalProperties":false},"timestamp":{"type":"string"},"prompt":{"nullable":true},"prompt_md":{"nullable":true,"type":"string"},"initial_message":{"nullable":true},"initial_message_uninterruptible":{"type":"boolean"},"model":{"nullable":true}},"required":["id","version_id","workflow_id","org_id","type","timestamp"],"additionalProperties":false},{"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)$"},"persistent_id":{"nullable":true,"type":"string"},"version_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)$"},"workflow_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)$"},"org_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)$"},"parent_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)$"},"type":{"type":"string","enum":["tool"]},"name":{"nullable":true,"type":"string"},"sort_index":{"nullable":true,"type":"number"},"is_complete":{"nullable":true,"type":"boolean"},"configuration":{"nullable":true,"type":"object","additionalProperties":{}},"node_output":{"nullable":true,"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)$"},"node_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)$"},"type":{"nullable":true,"type":"string"},"data":{"nullable":true,"type":"object","additionalProperties":{}},"timestamp":{"type":"string"}},"required":["id","node_id","timestamp"],"additionalProperties":false},"timestamp":{"type":"string"},"function":{"nullable":true,"type":"object","additionalProperties":{}}},"required":["id","version_id","workflow_id","org_id","type","timestamp"],"additionalProperties":false},{"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)$"},"persistent_id":{"nullable":true,"type":"string"},"version_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)$"},"workflow_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)$"},"org_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)$"},"parent_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)$"},"type":{"type":"string","enum":["condition"]},"name":{"nullable":true,"type":"string"},"sort_index":{"nullable":true,"type":"number"},"is_complete":{"nullable":true,"type":"boolean"},"configuration":{"nullable":true,"type":"object","additionalProperties":{}},"node_output":{"nullable":true,"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)$"},"node_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)$"},"type":{"nullable":true,"type":"string"},"data":{"nullable":true,"type":"object","additionalProperties":{}},"timestamp":{"type":"string"}},"required":["id","node_id","timestamp"],"additionalProperties":false},"timestamp":{"type":"string"},"type_of_condition":{"nullable":true,"type":"string"},"order":{"nullable":true,"type":"number"},"conditions":{"nullable":true,"type":"array","items":{}}},"required":["id","version_id","workflow_id","org_id","type","timestamp"],"additionalProperties":false},{"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)$"},"persistent_id":{"nullable":true,"type":"string"},"version_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)$"},"workflow_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)$"},"org_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)$"},"parent_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)$"},"type":{"type":"string","enum":["module-change"]},"name":{"nullable":true,"type":"string"},"sort_index":{"nullable":true,"type":"number"},"is_complete":{"nullable":true,"type":"boolean"},"configuration":{"nullable":true,"type":"object","additionalProperties":{}},"node_output":{"nullable":true,"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)$"},"node_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)$"},"type":{"nullable":true,"type":"string"},"data":{"nullable":true,"type":"object","additionalProperties":{}},"timestamp":{"type":"string"}},"required":["id","node_id","timestamp"],"additionalProperties":false},"timestamp":{"type":"string"}},"required":["id","version_id","workflow_id","org_id","type","timestamp"],"additionalProperties":false},{"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)$"},"persistent_id":{"nullable":true,"type":"string"},"version_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)$"},"workflow_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)$"},"org_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)$"},"parent_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)$"},"type":{"type":"string","enum":["path"]},"name":{"nullable":true,"type":"string"},"sort_index":{"nullable":true,"type":"number"},"is_complete":{"nullable":true,"type":"boolean"},"configuration":{"nullable":true,"type":"object","additionalProperties":{}},"node_output":{"nullable":true,"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)$"},"node_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)$"},"type":{"nullable":true,"type":"string"},"data":{"nullable":true,"type":"object","additionalProperties":{}},"timestamp":{"type":"string"}},"required":["id","node_id","timestamp"],"additionalProperties":false},"timestamp":{"type":"string"}},"required":["id","version_id","workflow_id","org_id","type","timestamp"],"additionalProperties":false},{"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)$"},"persistent_id":{"nullable":true,"type":"string"},"version_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)$"},"workflow_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)$"},"org_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)$"},"parent_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)$"},"type":{"type":"string","enum":["loop"]},"name":{"nullable":true,"type":"string"},"sort_index":{"nullable":true,"type":"number"},"is_complete":{"nullable":true,"type":"boolean"},"configuration":{"nullable":true,"type":"object","additionalProperties":{}},"node_output":{"nullable":true,"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)$"},"node_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)$"},"type":{"nullable":true,"type":"string"},"data":{"nullable":true,"type":"object","additionalProperties":{}},"timestamp":{"type":"string"}},"required":["id","node_id","timestamp"],"additionalProperties":false},"timestamp":{"type":"string"}},"required":["id","version_id","workflow_id","org_id","type","timestamp"],"additionalProperties":false},{"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)$"},"persistent_id":{"nullable":true,"type":"string"},"version_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)$"},"workflow_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)$"},"org_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)$"},"parent_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)$"},"type":{"type":"string","enum":["loop_break"]},"name":{"nullable":true,"type":"string"},"sort_index":{"nullable":true,"type":"number"},"is_complete":{"nullable":true,"type":"boolean"},"configuration":{"nullable":true,"type":"object","additionalProperties":{}},"node_output":{"nullable":true,"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)$"},"node_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)$"},"type":{"nullable":true,"type":"string"},"data":{"nullable":true,"type":"object","additionalProperties":{}},"timestamp":{"type":"string"}},"required":["id","node_id","timestamp"],"additionalProperties":false},"timestamp":{"type":"string"}},"required":["id","version_id","workflow_id","org_id","type","timestamp"],"additionalProperties":false},{"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)$"},"persistent_id":{"nullable":true,"type":"string"},"version_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)$"},"workflow_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)$"},"org_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)$"},"parent_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)$"},"type":{"type":"string","enum":["loop_end"]},"name":{"nullable":true,"type":"string"},"sort_index":{"nullable":true,"type":"number"},"is_complete":{"nullable":true,"type":"boolean"},"configuration":{"nullable":true,"type":"object","additionalProperties":{}},"node_output":{"nullable":true,"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)$"},"node_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)$"},"type":{"nullable":true,"type":"string"},"data":{"nullable":true,"type":"object","additionalProperties":{}},"timestamp":{"type":"string"}},"required":["id","node_id","timestamp"],"additionalProperties":false},"timestamp":{"type":"string"}},"required":["id","version_id","workflow_id","org_id","type","timestamp"],"additionalProperties":false},{"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)$"},"persistent_id":{"nullable":true,"type":"string"},"version_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)$"},"workflow_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)$"},"org_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)$"},"parent_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)$"},"type":{"type":"string","enum":["cron"]},"name":{"nullable":true,"type":"string"},"sort_index":{"nullable":true,"type":"number"},"is_complete":{"nullable":true,"type":"boolean"},"configuration":{"nullable":true,"type":"object","additionalProperties":{}},"node_output":{"nullable":true,"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)$"},"node_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)$"},"type":{"nullable":true,"type":"string"},"data":{"nullable":true,"type":"object","additionalProperties":{}},"timestamp":{"type":"string"}},"required":["id","node_id","timestamp"],"additionalProperties":false},"timestamp":{"type":"string"}},"required":["id","version_id","workflow_id","org_id","type","timestamp"],"additionalProperties":false}]}}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}},"post":{"summary":"Add nodes to a version","tags":["Versions"],"description":"Adds one or more nodes to the specified version. Nodes are processed sequentially in array order, so later nodes can reference earlier ones via `parent_node_index` (0-based index into this array) or existing DB nodes via `parent_node_id`. Each node must include a `type` discriminator: `\"trigger\"`, `\"action\"`, `\"agent\"`, `\"tool\"`, `\"prompt\"`, `\"condition\"`, `\"module-change\"`, `\"loop\"`, `\"path\"`, or `\"loop_break\"`. When a trigger node is included, all existing nodes in the version are replaced and the batch defines the entire workflow from scratch. The entire operation is atomic — if any node fails, all changes are rolled back.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"nodes":{"minItems":1,"maxItems":50,"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["trigger"]},"event_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 trigger event ID"},"name":{"description":"Display name override","type":"string"},"configuration":{"description":"Trigger-specific configuration (JSONB)","type":"object","additionalProperties":{}},"webhook_payload":{"description":"Expected payload for webhook nodes. When provided, this is saved as the node output so downstream nodes can reference it.","type":"object","additionalProperties":{}}},"required":["type","event_id"]},{"type":"object","properties":{"type":{"type":"string","enum":["action"]},"event_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 action event ID"},"name":{"description":"Display name override","type":"string"},"configuration":{"description":"Action-specific configuration (JSONB)","type":"object","additionalProperties":{}},"parent_node_id":{"description":"ID of an existing parent node. Mutually exclusive with parent_node_index.","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)$"},"parent_node_index":{"description":"0-based index of a node earlier in this request's nodes array to use as parent. Mutually exclusive with parent_node_id.","type":"integer","minimum":0,"maximum":9007199254740991},"webhook_payload":{"description":"Expected payload for webhook nodes. When provided, this is saved as the node output so downstream nodes can reference it.","type":"object","additionalProperties":{}}},"required":["type","event_id"]},{"type":"object","properties":{"type":{"type":"string","enum":["agent"]},"event_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 event ID"},"name":{"description":"Display name override","type":"string"},"configuration":{"description":"Agent-specific configuration (JSONB)","type":"object","additionalProperties":{}},"prompt":{"description":"Prompt configuration for the auto-generated prompt child node","type":"object","properties":{"prompt_md":{"description":"Agent system prompt in markdown","type":"string"},"initial_message":{"description":"Agent initial message — accepts a plain string or Plate paragraph array","type":"array","items":{}},"initial_message_uninterruptible":{"description":"Whether the voice agent initial message is uninterruptible.","type":"boolean"}}},"parent_node_id":{"description":"ID of an existing parent node. Mutually exclusive with parent_node_index.","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)$"},"parent_node_index":{"description":"0-based index of a node earlier in this request's nodes array to use as parent. Mutually exclusive with parent_node_id.","type":"integer","minimum":0,"maximum":9007199254740991}},"required":["type","event_id"]},{"type":"object","properties":{"type":{"type":"string","enum":["tool"]},"name":{"description":"Display name override","type":"string"},"function":{"description":"Tool function definition.","type":"object","properties":{"description":{"type":"array","items":{}},"message":{"type":"object","properties":{"type":{"type":"string","enum":["ai","fixed","none"]},"description":{"type":"array","items":{}},"example":{"type":"string"}}},"parameters":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"array","items":{}},"example":{"type":"string"},"required":{"type":"boolean"}},"required":["name"]}},"hold_music":{"type":"object","properties":{"type":{"type":"string","enum":["static","dynamic"]},"static":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"}},"required":["id","name"]},"dynamic":{"type":"array","items":{"description":"!IMPORTANT: This schema describes one Paragraph object. When the containing field is an array of this schema, send a flat Paragraph[] array. Do not send a bare Paragraph object. Only send Paragraph[][] when the containing field is explicitly an array of arrays. Paragraph object schema: {type: 'paragraph', children: Array<{text: string} | {type: 'variable', children: [{text: ''}], group_id: string, variable_id: string}>}"}}},"required":["type"]},"hold_music_asset_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)$"},"tool_index_id":{"type":"string"},"tool_index_hash":{"type":"string"},"is_mcp":{"type":"boolean"},"mcp_server_credential_id":{"type":"string"},"mcp_tool_name":{"type":"string"}}},"parent_node_id":{"description":"ID of an existing parent node. Mutually exclusive with parent_node_index.","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)$"},"parent_node_index":{"description":"0-based index of a node earlier in this request's nodes array to use as parent. Mutually exclusive with parent_node_id.","type":"integer","minimum":0,"maximum":9007199254740991}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["prompt"]},"name":{"description":"Display name override","type":"string"},"prompt_md":{"description":"System prompt in markdown (prompt nodes only)","type":"string"},"initial_message":{"description":"Initial message — accepts a plain string or Plate paragraph array (prompt nodes only)","type":"array","items":{}},"initial_message_uninterruptible":{"description":"Whether the voice agent initial message is uninterruptible.","type":"boolean"},"model":{"description":"LLM model selection as a TemplatedValue (e.g. { type: \"static\", static: { id: \"turbo-one\", name: \"gpt-4.1\" } }).","type":"object","properties":{"type":{"type":"string","enum":["static","dynamic"]},"static":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"}},"required":["id","name"]},"dynamic":{"type":"array","items":{"description":"!IMPORTANT: This schema describes one Paragraph object. When the containing field is an array of this schema, send a flat Paragraph[] array. Do not send a bare Paragraph object. Only send Paragraph[][] when the containing field is explicitly an array of arrays. Paragraph object schema: {type: 'paragraph', children: Array<{text: string} | {type: 'variable', children: [{text: ''}], group_id: string, variable_id: string}>}"}}},"required":["type"]},"parent_node_id":{"description":"ID of an existing parent node. Mutually exclusive with parent_node_index.","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)$"},"parent_node_index":{"description":"0-based index of a node earlier in this request's nodes array to use as parent. Mutually exclusive with parent_node_id.","type":"integer","minimum":0,"maximum":9007199254740991}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["condition"]},"name":{"description":"Display name override","type":"string"},"type_of_condition":{"description":"Type of condition branch. \"conditional\" evaluates rules, \"fallback\" catches unmatched cases.","type":"string","enum":["fallback","conditional"]},"order":{"description":"Order among sibling conditional branches. Auto-calculated if omitted.","type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"conditions":{"description":"Condition rules. Each entry follows the ConditionSchema: { id?, title?, ors: [{ ands: [{ field: { group_id, variable_id }, condition: '', value: [{ type: 'paragraph', children: [{ text: '...' }] }] }] }], output?: [...] }. The 'value' field MUST be an array of Plate paragraph objects — plain strings are rejected. Use an empty array [] to clear all conditions.","type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"ors":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"ands":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"field":{"type":"object","properties":{"group_id":{"type":"string"},"variable_id":{"type":"string"}},"required":["group_id","variable_id"]},"condition":{"type":"string"},"value":{"type":"array","items":{"description":"!IMPORTANT: This schema describes one Paragraph object. When the containing field is an array of this schema, send a flat Paragraph[] array. Do not send a bare Paragraph object. Only send Paragraph[][] when the containing field is explicitly an array of arrays. Paragraph object schema: {type: 'paragraph', children: Array<{text: string} | {type: 'variable', children: [{text: ''}], group_id: string, variable_id: string}>}"}}}}}},"required":["ands"]}},"output":{"type":"array","items":{"description":"!IMPORTANT: This schema describes one Paragraph object. When the containing field is an array of this schema, send a flat Paragraph[] array. Do not send a bare Paragraph object. Only send Paragraph[][] when the containing field is explicitly an array of arrays. Paragraph object schema: {type: 'paragraph', children: Array<{text: string} | {type: 'variable', children: [{text: ''}], group_id: string, variable_id: string}>}"}}}}},"parent_node_id":{"description":"ID of an existing parent node. Mutually exclusive with parent_node_index.","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)$"},"parent_node_index":{"description":"0-based index of a node earlier in this request's nodes array to use as parent. Mutually exclusive with parent_node_id.","type":"integer","minimum":0,"maximum":9007199254740991}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["module-change"]},"name":{"description":"Display name override","type":"string"},"configuration":{"description":"Module-change configuration (JSONB). Defaults to {}.","type":"object","additionalProperties":{}},"module_node_index":{"description":"Index of the target prompt node in the nodes array. Resolved to configuration.moduleId after all nodes are created.","type":"integer","minimum":0,"maximum":9007199254740991},"parent_node_id":{"description":"ID of an existing parent node. Mutually exclusive with parent_node_index.","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)$"},"parent_node_index":{"description":"0-based index of a node earlier in this request's nodes array to use as parent. Mutually exclusive with parent_node_id.","type":"integer","minimum":0,"maximum":9007199254740991}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["loop"]},"name":{"description":"Display name override","type":"string"},"execute_in_parallel":{"description":"Whether loop iterations run in parallel. Defaults to true. This only controls execution strategy; variables produced by loop body nodes resolve as lists outside the loop in both sequential and parallel modes.","type":"boolean"},"iterate_for":{"description":"Fixed number of iterations. Mutually exclusive with iterate_over. Fixed-count loop bodies expose iteration_index and execute_in_parallel.","nullable":true,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"iterate_over":{"description":"Expression to iterate over (array variable). Mutually exclusive with iterate_for. Collection loop bodies expose iteration_index, execute_in_parallel, and the configured loop_variable.","nullable":true,"type":"string"},"loop_variable":{"description":"Collection loops only. Name of the current item variable accessible inside the loop body. Defaults to \"iteration_element\". Collection loops also expose iteration_index and execute_in_parallel. Fixed-count loops expose iteration_index and execute_in_parallel instead.","nullable":true,"type":"string"},"do_child_run":{"description":"Whether each iteration runs as a standalone child run instead of inline in the parent run. Defaults to false.","type":"boolean"},"configuration":{"description":"Tolerated fallback: loop settings may be nested here instead of at the top level. They are hoisted to the top level server-side (a top-level value wins), so this is type-validated. Prefer setting the fields at the top level.","type":"object","properties":{"execute_in_parallel":{"type":"boolean"},"iterate_for":{"nullable":true,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"iterate_over":{"nullable":true,"type":"string"},"loop_variable":{"nullable":true,"type":"string"},"do_child_run":{"type":"boolean"}}},"parent_node_id":{"description":"ID of an existing parent node. Mutually exclusive with parent_node_index.","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)$"},"parent_node_index":{"description":"0-based index of a node earlier in this request's nodes array to use as parent. Mutually exclusive with parent_node_id.","type":"integer","minimum":0,"maximum":9007199254740991}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["path"]},"name":{"description":"Display name override","type":"string"},"parent_node_id":{"description":"ID of an existing parent node. Mutually exclusive with parent_node_index.","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)$"},"parent_node_index":{"description":"0-based index of a node earlier in this request's nodes array to use as parent. Mutually exclusive with parent_node_id.","type":"integer","minimum":0,"maximum":9007199254740991}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["loop_break"]},"name":{"description":"Display name override","type":"string"},"parent_node_id":{"description":"ID of an existing parent node. Mutually exclusive with parent_node_index.","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)$"},"parent_node_index":{"description":"0-based index of a node earlier in this request's nodes array to use as parent. Mutually exclusive with parent_node_id.","type":"integer","minimum":0,"maximum":9007199254740991}},"required":["type"]}]}}},"required":["nodes"]}}},"required":true},"parameters":[{"schema":{"type":"string","minLength":1},"in":"path","name":"version_id","required":true,"description":"Version UUID or slug"}],"security":[{"bearerAuth":[]}],"responses":{"201":{"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}-[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)$"},"version_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)$"},"type":{"type":"string"},"name":{"nullable":true,"type":"string"},"parent_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)$"},"event_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})$"},"timestamp":{"type":"string"},"loop_end_id":{"description":"ID of the auto-created loop_end node (only present for loop nodes)","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)$"},"condition_id":{"description":"ID of the auto-created condition child (only present for path nodes)","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)$"},"fallback_id":{"description":"ID of the auto-created fallback child (only present for path nodes)","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":["id","version_id","type","timestamp"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/versions/{version_id}/nodes/{node_id}":{"get":{"summary":"Get a single node","tags":["Versions"],"description":"Returns the full details of a single node including its configuration. For webhook trigger nodes (INCOMING_HOOK or PREDEFINED_REQUEST), the response also includes production, staging, development, and test webhook URLs.","parameters":[{"schema":{"type":"string","minLength":1},"in":"path","name":"version_id","required":true,"description":"Version UUID or slug"},{"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":"node_id","required":true,"description":"Node UUID"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"allOf":[{"oneOf":[{"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)$"},"persistent_id":{"nullable":true,"type":"string"},"version_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)$"},"workflow_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)$"},"org_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)$"},"parent_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)$"},"type":{"type":"string","enum":["action"]},"name":{"nullable":true,"type":"string"},"sort_index":{"nullable":true,"type":"number"},"is_complete":{"nullable":true,"type":"boolean"},"configuration":{"nullable":true,"type":"object","additionalProperties":{}},"node_output":{"nullable":true,"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)$"},"node_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)$"},"type":{"nullable":true,"type":"string"},"data":{"nullable":true,"type":"object","additionalProperties":{}},"timestamp":{"type":"string"}},"required":["id","node_id","timestamp"],"additionalProperties":false},"timestamp":{"type":"string"},"event_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_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})$"},"trigger_interval":{"nullable":true,"type":"string"},"multi_event_behavior":{"nullable":true,"type":"string"}},"required":["id","version_id","workflow_id","org_id","type","timestamp"],"additionalProperties":false},{"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)$"},"persistent_id":{"nullable":true,"type":"string"},"version_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)$"},"workflow_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)$"},"org_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)$"},"parent_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)$"},"type":{"type":"string","enum":["prompt"]},"name":{"nullable":true,"type":"string"},"sort_index":{"nullable":true,"type":"number"},"is_complete":{"nullable":true,"type":"boolean"},"configuration":{"nullable":true,"type":"object","additionalProperties":{}},"node_output":{"nullable":true,"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)$"},"node_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)$"},"type":{"nullable":true,"type":"string"},"data":{"nullable":true,"type":"object","additionalProperties":{}},"timestamp":{"type":"string"}},"required":["id","node_id","timestamp"],"additionalProperties":false},"timestamp":{"type":"string"},"prompt":{"nullable":true},"prompt_md":{"nullable":true,"type":"string"},"initial_message":{"nullable":true},"initial_message_uninterruptible":{"type":"boolean"},"model":{"nullable":true}},"required":["id","version_id","workflow_id","org_id","type","timestamp"],"additionalProperties":false},{"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)$"},"persistent_id":{"nullable":true,"type":"string"},"version_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)$"},"workflow_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)$"},"org_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)$"},"parent_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)$"},"type":{"type":"string","enum":["tool"]},"name":{"nullable":true,"type":"string"},"sort_index":{"nullable":true,"type":"number"},"is_complete":{"nullable":true,"type":"boolean"},"configuration":{"nullable":true,"type":"object","additionalProperties":{}},"node_output":{"nullable":true,"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)$"},"node_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)$"},"type":{"nullable":true,"type":"string"},"data":{"nullable":true,"type":"object","additionalProperties":{}},"timestamp":{"type":"string"}},"required":["id","node_id","timestamp"],"additionalProperties":false},"timestamp":{"type":"string"},"function":{"nullable":true,"type":"object","additionalProperties":{}}},"required":["id","version_id","workflow_id","org_id","type","timestamp"],"additionalProperties":false},{"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)$"},"persistent_id":{"nullable":true,"type":"string"},"version_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)$"},"workflow_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)$"},"org_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)$"},"parent_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)$"},"type":{"type":"string","enum":["condition"]},"name":{"nullable":true,"type":"string"},"sort_index":{"nullable":true,"type":"number"},"is_complete":{"nullable":true,"type":"boolean"},"configuration":{"nullable":true,"type":"object","additionalProperties":{}},"node_output":{"nullable":true,"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)$"},"node_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)$"},"type":{"nullable":true,"type":"string"},"data":{"nullable":true,"type":"object","additionalProperties":{}},"timestamp":{"type":"string"}},"required":["id","node_id","timestamp"],"additionalProperties":false},"timestamp":{"type":"string"},"type_of_condition":{"nullable":true,"type":"string"},"order":{"nullable":true,"type":"number"},"conditions":{"nullable":true,"type":"array","items":{}}},"required":["id","version_id","workflow_id","org_id","type","timestamp"],"additionalProperties":false},{"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)$"},"persistent_id":{"nullable":true,"type":"string"},"version_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)$"},"workflow_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)$"},"org_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)$"},"parent_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)$"},"type":{"type":"string","enum":["module-change"]},"name":{"nullable":true,"type":"string"},"sort_index":{"nullable":true,"type":"number"},"is_complete":{"nullable":true,"type":"boolean"},"configuration":{"nullable":true,"type":"object","additionalProperties":{}},"node_output":{"nullable":true,"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)$"},"node_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)$"},"type":{"nullable":true,"type":"string"},"data":{"nullable":true,"type":"object","additionalProperties":{}},"timestamp":{"type":"string"}},"required":["id","node_id","timestamp"],"additionalProperties":false},"timestamp":{"type":"string"}},"required":["id","version_id","workflow_id","org_id","type","timestamp"],"additionalProperties":false},{"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)$"},"persistent_id":{"nullable":true,"type":"string"},"version_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)$"},"workflow_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)$"},"org_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)$"},"parent_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)$"},"type":{"type":"string","enum":["path"]},"name":{"nullable":true,"type":"string"},"sort_index":{"nullable":true,"type":"number"},"is_complete":{"nullable":true,"type":"boolean"},"configuration":{"nullable":true,"type":"object","additionalProperties":{}},"node_output":{"nullable":true,"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)$"},"node_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)$"},"type":{"nullable":true,"type":"string"},"data":{"nullable":true,"type":"object","additionalProperties":{}},"timestamp":{"type":"string"}},"required":["id","node_id","timestamp"],"additionalProperties":false},"timestamp":{"type":"string"}},"required":["id","version_id","workflow_id","org_id","type","timestamp"],"additionalProperties":false},{"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)$"},"persistent_id":{"nullable":true,"type":"string"},"version_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)$"},"workflow_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)$"},"org_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)$"},"parent_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)$"},"type":{"type":"string","enum":["loop"]},"name":{"nullable":true,"type":"string"},"sort_index":{"nullable":true,"type":"number"},"is_complete":{"nullable":true,"type":"boolean"},"configuration":{"nullable":true,"type":"object","additionalProperties":{}},"node_output":{"nullable":true,"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)$"},"node_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)$"},"type":{"nullable":true,"type":"string"},"data":{"nullable":true,"type":"object","additionalProperties":{}},"timestamp":{"type":"string"}},"required":["id","node_id","timestamp"],"additionalProperties":false},"timestamp":{"type":"string"}},"required":["id","version_id","workflow_id","org_id","type","timestamp"],"additionalProperties":false},{"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)$"},"persistent_id":{"nullable":true,"type":"string"},"version_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)$"},"workflow_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)$"},"org_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)$"},"parent_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)$"},"type":{"type":"string","enum":["loop_break"]},"name":{"nullable":true,"type":"string"},"sort_index":{"nullable":true,"type":"number"},"is_complete":{"nullable":true,"type":"boolean"},"configuration":{"nullable":true,"type":"object","additionalProperties":{}},"node_output":{"nullable":true,"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)$"},"node_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)$"},"type":{"nullable":true,"type":"string"},"data":{"nullable":true,"type":"object","additionalProperties":{}},"timestamp":{"type":"string"}},"required":["id","node_id","timestamp"],"additionalProperties":false},"timestamp":{"type":"string"}},"required":["id","version_id","workflow_id","org_id","type","timestamp"],"additionalProperties":false},{"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)$"},"persistent_id":{"nullable":true,"type":"string"},"version_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)$"},"workflow_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)$"},"org_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)$"},"parent_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)$"},"type":{"type":"string","enum":["loop_end"]},"name":{"nullable":true,"type":"string"},"sort_index":{"nullable":true,"type":"number"},"is_complete":{"nullable":true,"type":"boolean"},"configuration":{"nullable":true,"type":"object","additionalProperties":{}},"node_output":{"nullable":true,"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)$"},"node_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)$"},"type":{"nullable":true,"type":"string"},"data":{"nullable":true,"type":"object","additionalProperties":{}},"timestamp":{"type":"string"}},"required":["id","node_id","timestamp"],"additionalProperties":false},"timestamp":{"type":"string"}},"required":["id","version_id","workflow_id","org_id","type","timestamp"],"additionalProperties":false},{"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)$"},"persistent_id":{"nullable":true,"type":"string"},"version_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)$"},"workflow_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)$"},"org_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)$"},"parent_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)$"},"type":{"type":"string","enum":["cron"]},"name":{"nullable":true,"type":"string"},"sort_index":{"nullable":true,"type":"number"},"is_complete":{"nullable":true,"type":"boolean"},"configuration":{"nullable":true,"type":"object","additionalProperties":{}},"node_output":{"nullable":true,"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)$"},"node_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)$"},"type":{"nullable":true,"type":"string"},"data":{"nullable":true,"type":"object","additionalProperties":{}},"timestamp":{"type":"string"}},"required":["id","node_id","timestamp"],"additionalProperties":false},"timestamp":{"type":"string"}},"required":["id","version_id","workflow_id","org_id","type","timestamp"],"additionalProperties":false}]},{"type":"object","properties":{"webhook_urls":{"description":"Webhook URLs for webhook trigger nodes. Only present when the node is a webhook trigger (INCOMING_HOOK or PREDEFINED_REQUEST).","type":"object","properties":{"production":{"type":"string","description":"Production webhook URL"},"staging":{"type":"string","description":"Staging webhook URL"},"development":{"type":"string","description":"Development webhook URL"},"test":{"type":"string","description":"Test webhook URL (targets this specific version)"}},"required":["production","staging","development","test"],"additionalProperties":false}},"additionalProperties":false}]}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}},"put":{"summary":"Update a node","tags":["Versions"],"description":"Updates the specified node. The request body must include a `type` discriminator matching the node type. Updatable fields depend on the type:\n- **trigger**: `name`, `configuration`, `webhook_payload`\n- **action**: `name`, `configuration`, `webhook_payload`\n- **agent**: `name`, `configuration`, `prompt`\n- **tool**: `name`, `function`\n- **prompt**: `name`, `prompt_md`, `initial_message`, `model`\n- **condition**: `name`, `type_of_condition`, `order`, `conditions`\n- **module-change**: `name`, `configuration`\n- **loop**: `name`, `execute_in_parallel`, `iterate_for`, `iterate_over`, `loop_variable` (collection loops only), `do_child_run`\n- **path**: `name`\n- **loop_break**: `name`\n\nWhen `configuration` is provided for action/agent nodes, it is validated against the event-specific schema from the events registry.","requestBody":{"content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["trigger"]},"event_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 trigger event ID"},"name":{"description":"Display name override","type":"string"},"configuration":{"description":"Trigger-specific configuration (JSONB)","type":"object","additionalProperties":{}},"webhook_payload":{"description":"Expected payload for webhook nodes. When provided, this is saved as the node output so downstream nodes can reference it.","type":"object","additionalProperties":{}}},"required":["type","event_id"]},{"type":"object","properties":{"type":{"type":"string","enum":["action"]},"event_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 action event ID"},"name":{"description":"Display name override","type":"string"},"configuration":{"description":"Action-specific configuration (JSONB)","type":"object","additionalProperties":{}},"webhook_payload":{"description":"Expected payload for webhook nodes. When provided, this is saved as the node output so downstream nodes can reference it.","type":"object","additionalProperties":{}}},"required":["type","event_id"]},{"type":"object","properties":{"type":{"type":"string","enum":["agent"]},"event_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 event ID"},"name":{"description":"Display name override","type":"string"},"configuration":{"description":"Agent-specific configuration (JSONB)","type":"object","additionalProperties":{}},"prompt":{"description":"Prompt configuration for the auto-generated prompt child node","type":"object","properties":{"prompt_md":{"description":"Agent system prompt in markdown","type":"string"},"initial_message":{"description":"Agent initial message — accepts a plain string or Plate paragraph array","type":"array","items":{}},"initial_message_uninterruptible":{"description":"Whether the voice agent initial message is uninterruptible.","type":"boolean"}}}},"required":["type","event_id"]},{"type":"object","properties":{"type":{"type":"string","enum":["prompt"]},"name":{"description":"Display name override","type":"string"},"prompt_md":{"description":"System prompt in markdown (prompt nodes only)","type":"string"},"initial_message":{"description":"Initial message — accepts a plain string or Plate paragraph array (prompt nodes only)","type":"array","items":{}},"initial_message_uninterruptible":{"description":"Whether the voice agent initial message is uninterruptible.","type":"boolean"},"model":{"description":"LLM model selection as a TemplatedValue (e.g. { type: \"static\", static: { id: \"turbo-one\", name: \"gpt-4.1\" } }).","type":"object","properties":{"type":{"type":"string","enum":["static","dynamic"]},"static":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"}},"required":["id","name"]},"dynamic":{"type":"array","items":{"description":"!IMPORTANT: This schema describes one Paragraph object. When the containing field is an array of this schema, send a flat Paragraph[] array. Do not send a bare Paragraph object. Only send Paragraph[][] when the containing field is explicitly an array of arrays. Paragraph object schema: {type: 'paragraph', children: Array<{text: string} | {type: 'variable', children: [{text: ''}], group_id: string, variable_id: string}>}"}}},"required":["type"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["tool"]},"name":{"description":"Display name override","type":"string"},"function":{"description":"Tool function definition.","type":"object","properties":{"description":{"type":"array","items":{}},"message":{"type":"object","properties":{"type":{"type":"string","enum":["ai","fixed","none"]},"description":{"type":"array","items":{}},"example":{"type":"string"}}},"parameters":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"array","items":{}},"example":{"type":"string"},"required":{"type":"boolean"}},"required":["name"]}},"hold_music":{"type":"object","properties":{"type":{"type":"string","enum":["static","dynamic"]},"static":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"}},"required":["id","name"]},"dynamic":{"type":"array","items":{"description":"!IMPORTANT: This schema describes one Paragraph object. When the containing field is an array of this schema, send a flat Paragraph[] array. Do not send a bare Paragraph object. Only send Paragraph[][] when the containing field is explicitly an array of arrays. Paragraph object schema: {type: 'paragraph', children: Array<{text: string} | {type: 'variable', children: [{text: ''}], group_id: string, variable_id: string}>}"}}},"required":["type"]},"hold_music_asset_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)$"},"tool_index_id":{"type":"string"},"tool_index_hash":{"type":"string"},"is_mcp":{"type":"boolean"},"mcp_server_credential_id":{"type":"string"},"mcp_tool_name":{"type":"string"}}}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["condition"]},"name":{"description":"Display name override","type":"string"},"type_of_condition":{"description":"Type of condition branch. \"conditional\" evaluates rules, \"fallback\" catches unmatched cases.","type":"string","enum":["fallback","conditional"]},"order":{"description":"Order among sibling conditional branches. Auto-calculated if omitted.","type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"conditions":{"description":"Condition rules. Each entry follows the ConditionSchema: { id?, title?, ors: [{ ands: [{ field: { group_id, variable_id }, condition: '', value: [{ type: 'paragraph', children: [{ text: '...' }] }] }] }], output?: [...] }. The 'value' field MUST be an array of Plate paragraph objects — plain strings are rejected. Use an empty array [] to clear all conditions.","type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"ors":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"ands":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"field":{"type":"object","properties":{"group_id":{"type":"string"},"variable_id":{"type":"string"}},"required":["group_id","variable_id"]},"condition":{"type":"string"},"value":{"type":"array","items":{"description":"!IMPORTANT: This schema describes one Paragraph object. When the containing field is an array of this schema, send a flat Paragraph[] array. Do not send a bare Paragraph object. Only send Paragraph[][] when the containing field is explicitly an array of arrays. Paragraph object schema: {type: 'paragraph', children: Array<{text: string} | {type: 'variable', children: [{text: ''}], group_id: string, variable_id: string}>}"}}}}}},"required":["ands"]}},"output":{"type":"array","items":{"description":"!IMPORTANT: This schema describes one Paragraph object. When the containing field is an array of this schema, send a flat Paragraph[] array. Do not send a bare Paragraph object. Only send Paragraph[][] when the containing field is explicitly an array of arrays. Paragraph object schema: {type: 'paragraph', children: Array<{text: string} | {type: 'variable', children: [{text: ''}], group_id: string, variable_id: string}>}"}}}}}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["module-change"]},"name":{"description":"Display name override","type":"string"},"configuration":{"description":"Module-change configuration (JSONB). Defaults to {}.","type":"object","additionalProperties":{}},"module_node_index":{"description":"Index of the target prompt node in the nodes array. Resolved to configuration.moduleId after all nodes are created.","type":"integer","minimum":0,"maximum":9007199254740991}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["loop"]},"name":{"description":"Display name override","type":"string"},"execute_in_parallel":{"description":"Whether loop iterations run in parallel. Defaults to true. This only controls execution strategy; variables produced by loop body nodes resolve as lists outside the loop in both sequential and parallel modes.","type":"boolean"},"iterate_for":{"description":"Fixed number of iterations. Mutually exclusive with iterate_over. Fixed-count loop bodies expose iteration_index and execute_in_parallel.","nullable":true,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"iterate_over":{"description":"Expression to iterate over (array variable). Mutually exclusive with iterate_for. Collection loop bodies expose iteration_index, execute_in_parallel, and the configured loop_variable.","nullable":true,"type":"string"},"loop_variable":{"description":"Collection loops only. Name of the current item variable accessible inside the loop body. Defaults to \"iteration_element\". Collection loops also expose iteration_index and execute_in_parallel. Fixed-count loops expose iteration_index and execute_in_parallel instead.","nullable":true,"type":"string"},"do_child_run":{"description":"Whether each iteration runs as a standalone child run instead of inline in the parent run. Defaults to false.","type":"boolean"},"configuration":{"description":"Tolerated fallback: loop settings may be nested here instead of at the top level. They are hoisted to the top level server-side (a top-level value wins), so this is type-validated. Prefer setting the fields at the top level.","type":"object","properties":{"execute_in_parallel":{"type":"boolean"},"iterate_for":{"nullable":true,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"iterate_over":{"nullable":true,"type":"string"},"loop_variable":{"nullable":true,"type":"string"},"do_child_run":{"type":"boolean"}}}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["loop_break"]},"name":{"description":"Display name override","type":"string"}},"required":["type"]}]}}}},"parameters":[{"schema":{"type":"string","minLength":1},"in":"path","name":"version_id","required":true,"description":"Version UUID or slug"},{"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":"node_id","required":true,"description":"Node UUID to update"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"oneOf":[{"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)$"},"persistent_id":{"nullable":true,"type":"string"},"version_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)$"},"workflow_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)$"},"org_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)$"},"parent_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)$"},"type":{"type":"string","enum":["action"]},"name":{"nullable":true,"type":"string"},"sort_index":{"nullable":true,"type":"number"},"is_complete":{"nullable":true,"type":"boolean"},"configuration":{"nullable":true,"type":"object","additionalProperties":{}},"node_output":{"nullable":true,"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)$"},"node_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)$"},"type":{"nullable":true,"type":"string"},"data":{"nullable":true,"type":"object","additionalProperties":{}},"timestamp":{"type":"string"}},"required":["id","node_id","timestamp"],"additionalProperties":false},"timestamp":{"type":"string"},"event_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_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})$"},"trigger_interval":{"nullable":true,"type":"string"},"multi_event_behavior":{"nullable":true,"type":"string"}},"required":["id","version_id","workflow_id","org_id","type","timestamp"],"additionalProperties":false},{"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)$"},"persistent_id":{"nullable":true,"type":"string"},"version_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)$"},"workflow_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)$"},"org_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)$"},"parent_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)$"},"type":{"type":"string","enum":["prompt"]},"name":{"nullable":true,"type":"string"},"sort_index":{"nullable":true,"type":"number"},"is_complete":{"nullable":true,"type":"boolean"},"configuration":{"nullable":true,"type":"object","additionalProperties":{}},"node_output":{"nullable":true,"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)$"},"node_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)$"},"type":{"nullable":true,"type":"string"},"data":{"nullable":true,"type":"object","additionalProperties":{}},"timestamp":{"type":"string"}},"required":["id","node_id","timestamp"],"additionalProperties":false},"timestamp":{"type":"string"},"prompt":{"nullable":true},"prompt_md":{"nullable":true,"type":"string"},"initial_message":{"nullable":true},"initial_message_uninterruptible":{"type":"boolean"},"model":{"nullable":true}},"required":["id","version_id","workflow_id","org_id","type","timestamp"],"additionalProperties":false},{"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)$"},"persistent_id":{"nullable":true,"type":"string"},"version_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)$"},"workflow_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)$"},"org_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)$"},"parent_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)$"},"type":{"type":"string","enum":["tool"]},"name":{"nullable":true,"type":"string"},"sort_index":{"nullable":true,"type":"number"},"is_complete":{"nullable":true,"type":"boolean"},"configuration":{"nullable":true,"type":"object","additionalProperties":{}},"node_output":{"nullable":true,"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)$"},"node_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)$"},"type":{"nullable":true,"type":"string"},"data":{"nullable":true,"type":"object","additionalProperties":{}},"timestamp":{"type":"string"}},"required":["id","node_id","timestamp"],"additionalProperties":false},"timestamp":{"type":"string"},"function":{"nullable":true,"type":"object","additionalProperties":{}}},"required":["id","version_id","workflow_id","org_id","type","timestamp"],"additionalProperties":false},{"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)$"},"persistent_id":{"nullable":true,"type":"string"},"version_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)$"},"workflow_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)$"},"org_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)$"},"parent_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)$"},"type":{"type":"string","enum":["condition"]},"name":{"nullable":true,"type":"string"},"sort_index":{"nullable":true,"type":"number"},"is_complete":{"nullable":true,"type":"boolean"},"configuration":{"nullable":true,"type":"object","additionalProperties":{}},"node_output":{"nullable":true,"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)$"},"node_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)$"},"type":{"nullable":true,"type":"string"},"data":{"nullable":true,"type":"object","additionalProperties":{}},"timestamp":{"type":"string"}},"required":["id","node_id","timestamp"],"additionalProperties":false},"timestamp":{"type":"string"},"type_of_condition":{"nullable":true,"type":"string"},"order":{"nullable":true,"type":"number"},"conditions":{"nullable":true,"type":"array","items":{}}},"required":["id","version_id","workflow_id","org_id","type","timestamp"],"additionalProperties":false},{"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)$"},"persistent_id":{"nullable":true,"type":"string"},"version_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)$"},"workflow_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)$"},"org_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)$"},"parent_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)$"},"type":{"type":"string","enum":["module-change"]},"name":{"nullable":true,"type":"string"},"sort_index":{"nullable":true,"type":"number"},"is_complete":{"nullable":true,"type":"boolean"},"configuration":{"nullable":true,"type":"object","additionalProperties":{}},"node_output":{"nullable":true,"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)$"},"node_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)$"},"type":{"nullable":true,"type":"string"},"data":{"nullable":true,"type":"object","additionalProperties":{}},"timestamp":{"type":"string"}},"required":["id","node_id","timestamp"],"additionalProperties":false},"timestamp":{"type":"string"}},"required":["id","version_id","workflow_id","org_id","type","timestamp"],"additionalProperties":false},{"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)$"},"persistent_id":{"nullable":true,"type":"string"},"version_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)$"},"workflow_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)$"},"org_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)$"},"parent_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)$"},"type":{"type":"string","enum":["path"]},"name":{"nullable":true,"type":"string"},"sort_index":{"nullable":true,"type":"number"},"is_complete":{"nullable":true,"type":"boolean"},"configuration":{"nullable":true,"type":"object","additionalProperties":{}},"node_output":{"nullable":true,"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)$"},"node_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)$"},"type":{"nullable":true,"type":"string"},"data":{"nullable":true,"type":"object","additionalProperties":{}},"timestamp":{"type":"string"}},"required":["id","node_id","timestamp"],"additionalProperties":false},"timestamp":{"type":"string"}},"required":["id","version_id","workflow_id","org_id","type","timestamp"],"additionalProperties":false},{"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)$"},"persistent_id":{"nullable":true,"type":"string"},"version_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)$"},"workflow_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)$"},"org_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)$"},"parent_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)$"},"type":{"type":"string","enum":["loop"]},"name":{"nullable":true,"type":"string"},"sort_index":{"nullable":true,"type":"number"},"is_complete":{"nullable":true,"type":"boolean"},"configuration":{"nullable":true,"type":"object","additionalProperties":{}},"node_output":{"nullable":true,"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)$"},"node_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)$"},"type":{"nullable":true,"type":"string"},"data":{"nullable":true,"type":"object","additionalProperties":{}},"timestamp":{"type":"string"}},"required":["id","node_id","timestamp"],"additionalProperties":false},"timestamp":{"type":"string"}},"required":["id","version_id","workflow_id","org_id","type","timestamp"],"additionalProperties":false},{"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)$"},"persistent_id":{"nullable":true,"type":"string"},"version_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)$"},"workflow_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)$"},"org_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)$"},"parent_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)$"},"type":{"type":"string","enum":["loop_break"]},"name":{"nullable":true,"type":"string"},"sort_index":{"nullable":true,"type":"number"},"is_complete":{"nullable":true,"type":"boolean"},"configuration":{"nullable":true,"type":"object","additionalProperties":{}},"node_output":{"nullable":true,"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)$"},"node_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)$"},"type":{"nullable":true,"type":"string"},"data":{"nullable":true,"type":"object","additionalProperties":{}},"timestamp":{"type":"string"}},"required":["id","node_id","timestamp"],"additionalProperties":false},"timestamp":{"type":"string"}},"required":["id","version_id","workflow_id","org_id","type","timestamp"],"additionalProperties":false},{"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)$"},"persistent_id":{"nullable":true,"type":"string"},"version_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)$"},"workflow_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)$"},"org_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)$"},"parent_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)$"},"type":{"type":"string","enum":["loop_end"]},"name":{"nullable":true,"type":"string"},"sort_index":{"nullable":true,"type":"number"},"is_complete":{"nullable":true,"type":"boolean"},"configuration":{"nullable":true,"type":"object","additionalProperties":{}},"node_output":{"nullable":true,"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)$"},"node_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)$"},"type":{"nullable":true,"type":"string"},"data":{"nullable":true,"type":"object","additionalProperties":{}},"timestamp":{"type":"string"}},"required":["id","node_id","timestamp"],"additionalProperties":false},"timestamp":{"type":"string"}},"required":["id","version_id","workflow_id","org_id","type","timestamp"],"additionalProperties":false},{"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)$"},"persistent_id":{"nullable":true,"type":"string"},"version_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)$"},"workflow_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)$"},"org_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)$"},"parent_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)$"},"type":{"type":"string","enum":["cron"]},"name":{"nullable":true,"type":"string"},"sort_index":{"nullable":true,"type":"number"},"is_complete":{"nullable":true,"type":"boolean"},"configuration":{"nullable":true,"type":"object","additionalProperties":{}},"node_output":{"nullable":true,"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)$"},"node_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)$"},"type":{"nullable":true,"type":"string"},"data":{"nullable":true,"type":"object","additionalProperties":{}},"timestamp":{"type":"string"}},"required":["id","node_id","timestamp"],"additionalProperties":false},"timestamp":{"type":"string"}},"required":["id","version_id","workflow_id","org_id","type","timestamp"],"additionalProperties":false}]}},"required":["data"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}},"delete":{"summary":"Delete a node","tags":["Versions"],"description":"Deletes the specified node. For tool, condition, and paths-root nodes, owned child nodes are also cascade-deleted. For action, prompt, and module-change nodes, children are reparented to the deleted node's parent so the workflow chain is preserved. Agent nodes delete their internal children (prompt + tools) while reparenting downstream workflow nodes. The trigger node (root node with no parent) cannot be deleted.","parameters":[{"schema":{"type":"string","minLength":1},"in":"path","name":"version_id","required":true,"description":"Version UUID or slug"},{"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":"node_id","required":true,"description":"Node UUID to delete"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"deleted_node_ids":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"description":"IDs of all nodes that were deleted"}},"required":["deleted_node_ids"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/versions/{version_id}/nodes/{node_id}/available-vars":{"get":{"summary":"List available variables for a node","tags":["Versions"],"description":"Returns all variable groups available to the specified node, including system variables, environment variables, and upstream node outputs.","parameters":[{"schema":{"type":"string","minLength":1},"in":"path","name":"version_id","required":true,"description":"Version UUID or slug"},{"schema":{"type":"string"},"in":"path","name":"node_id","required":true,"description":"The UUID of the node"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"event_id":{"type":"string"},"icon":{"type":"string"},"name":{"type":"string"},"is_complete":{"type":"boolean"},"is_list":{"description":"Whether variables in this group resolve as arrays. Loop body outputs set this when referenced outside the loop; sequential and parallel loops both return lists, including one-item lists for single-iteration loops.","type":"boolean"},"variables":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","enum":["string","number","boolean","null","object","array"]},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"string","nullable":true,"enum":[null]}]}},"required":["id","name"],"additionalProperties":false}},"integration_name":{"type":"string"}},"required":["id","name","is_complete","variables"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/versions/{version_id}/nodes/{node_id}/config-schema":{"get":{"summary":"Get config schema for a node","tags":["Versions"],"description":"Returns the configuration schema for the node's event, including field types, required fields, current values, defaults, and validation status. Only works for action nodes (nodes with an event_id).","parameters":[{"schema":{"type":"string","minLength":1},"in":"path","name":"version_id","required":true,"description":"Version UUID or slug"},{"schema":{"type":"string"},"in":"path","name":"node_id","required":true,"description":"The UUID of the node"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"event_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})$"},"event_name":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/schema0"}},"current_values":{"nullable":true,"type":"object","additionalProperties":{}},"defaults":{"nullable":true,"type":"object","additionalProperties":{}},"validation":{"type":"object","properties":{"is_valid":{"type":"boolean"},"issues":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}},"required":["is_valid","issues"],"additionalProperties":false},"available_options":{"nullable":true,"type":"object","properties":{"models":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"}},"required":["id","name"],"additionalProperties":false}},"phone_numbers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"number":{"type":"string"}},"required":["id","name","number"],"additionalProperties":false}},"voices":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"language":{"type":"string"},"gender":{"type":"string"}},"required":["id","name","language","gender"],"additionalProperties":false}},"languages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}},"credentials":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"}},"required":["id","title"],"additionalProperties":false}}},"additionalProperties":false}},"required":["event_id","event_name","fields","current_values","defaults","validation","available_options"],"additionalProperties":false}},"required":["data"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/versions/{version_id}/nodes/{node_id}/custom-output":{"put":{"summary":"Set custom node output","tags":["Versions"],"description":"Sets a custom JSON object as the node's output for testing purposes. This creates a new node output record and links it to the node, marking the node as complete. Useful for defining output schemas on trigger nodes, webhooks, or any node where you want to manually specify the output shape without running the actual test.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","additionalProperties":{},"description":"JSON object to use as the node's output. Must be an object — arrays and primitives are not allowed."}},"required":["data"]}}},"required":true},"parameters":[{"schema":{"type":"string","minLength":1},"in":"path","name":"version_id","required":true,"description":"Version UUID or slug"},{"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":"node_id","required":true,"description":"Node UUID"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"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)$"},"node_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)$"},"data":{"nullable":true,"type":"object","additionalProperties":{}},"timestamp":{"type":"string"}},"required":["id","node_id","data","timestamp"],"additionalProperties":false}},"required":["data"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/versions/{version_id}/nodes/{node_id}/test":{"post":{"summary":"Test a single node","tags":["Versions"],"description":"Triggers a test run for a single node in the specified version. The node must have a complete configuration and the version must not be published. Returns the generated node output (schema) on success.","requestBody":{"content":{"application/json":{"schema":{"default":{},"nullable":true,"type":"object","properties":{"environment":{"default":"development","description":"Environment to use for variable resolution","type":"string","enum":["production","staging","development"]}}}}}},"parameters":[{"schema":{"type":"string","minLength":1},"in":"path","name":"version_id","required":true,"description":"Version UUID or slug"},{"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":"node_id","required":true,"description":"Node UUID"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"node_id":{"type":"string"},"type":{"nullable":true,"type":"string"},"data":{"nullable":true},"error":{"nullable":true,"type":"string"},"timestamp":{"type":"string"}},"required":["id","node_id","data","timestamp"],"additionalProperties":false}},"required":["data"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"502":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"504":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/versions/{version_id}/test-all":{"post":{"summary":"Test all nodes in a version","tags":["Versions"],"description":"Triggers a synchronous test-all run for every testable node in the specified version. Nodes are executed in dependency waves — independent nodes run in parallel. If a node fails, dependent nodes are skipped. The endpoint blocks until all nodes have been tested and returns per-node results.","requestBody":{"content":{"application/json":{"schema":{"default":{},"nullable":true,"type":"object","properties":{"environment":{"default":"development","description":"Environment to use for variable resolution","type":"string","enum":["production","staging","development"]}}}}}},"parameters":[{"schema":{"type":"string","minLength":1},"in":"path","name":"version_id","required":true,"description":"Version UUID or slug"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"node_id":{"type":"string"},"persistent_id":{"type":"string"},"name":{"type":"string"},"status":{"type":"string","enum":["success","failed","skipped"]},"error":{"type":"string"}},"required":["node_id","persistent_id","name","status"],"additionalProperties":false}}},"required":["results"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"502":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/versions/{version_id}/prompt-issues":{"get":{"summary":"List prompt issues","tags":["Versions"],"description":"Returns prompt quality issues for all prompt nodes in the specified version. Issues are generated asynchronously by the platform's prompt analysis system. Each prompt node includes its current prompt text, issue generation status, and any open (non-rejected) issues with recommendations.","parameters":[{"schema":{"type":"string","minLength":1},"in":"path","name":"version_id","required":true,"description":"Version UUID or slug"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"node_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)$"},"node_name":{"nullable":true,"type":"string"},"prompt_md":{"nullable":true,"type":"string"},"initial_message":{"nullable":true},"issue_generation_status":{"nullable":true,"type":"string"},"issues":{"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)$"},"issue_type":{"type":"string"},"recommendation":{"type":"string"},"status":{"type":"string"}},"required":["id","issue_type","recommendation","status"],"additionalProperties":false}}},"required":["node_id","node_name","prompt_md","initial_message","issue_generation_status","issues"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/workflow-folders/":{"get":{"summary":"List workflow folders","tags":["Workflow Folders"],"description":"Returns paginated workflow folders for the authenticated organization. Supports searching by name.","parameters":[{"schema":{"default":1,"type":"integer","minimum":1,"maximum":9007199254740991},"in":"query","name":"page","required":false},{"schema":{"default":50,"type":"integer","minimum":1,"maximum":100},"in":"query","name":"page_size","required":false},{"schema":{"type":"string"},"in":"query","name":"search","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}-[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)$"},"slug":{"type":"string"},"name":{"type":"string"},"parent_folder_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)$"},"org_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)$"},"folder_type":{"type":"string","enum":["normal","playground_root","playground_user"]}},"required":["id","slug","name","parent_folder_id","org_id","folder_type"],"additionalProperties":false}},"pagination":{"type":"object","properties":{"page":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"page_size":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total_pages":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total_records":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"has_next_page":{"type":"boolean"},"has_previous_page":{"type":"boolean"}},"required":["page","page_size","total_pages","total_records","has_next_page","has_previous_page"],"additionalProperties":false}},"required":["data","pagination"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}},"post":{"summary":"Create a workflow folder","tags":["Workflow Folders"],"description":"Creates a new workflow folder in the authenticated organization. Optionally nest it under a parent folder.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"parent_folder_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)$"}},"required":["name"]}}},"required":true},"security":[{"bearerAuth":[]}],"responses":{"201":{"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}-[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)$"},"slug":{"type":"string"},"name":{"type":"string"},"parent_folder_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)$"},"org_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)$"},"folder_type":{"type":"string","enum":["normal","playground_root","playground_user"]}},"required":["id","slug","name","parent_folder_id","org_id","folder_type"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/workflow-folders/{folder_id}":{"get":{"summary":"Get a workflow folder","tags":["Workflow Folders"],"description":"Returns a single workflow folder by UUID or slug.","parameters":[{"schema":{"type":"string","minLength":1},"in":"path","name":"folder_id","required":true,"description":"Folder UUID or slug"}],"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}-[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)$"},"slug":{"type":"string"},"name":{"type":"string"},"parent_folder_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)$"},"org_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)$"},"folder_type":{"type":"string","enum":["normal","playground_root","playground_user"]}},"required":["id","slug","name","parent_folder_id","org_id","folder_type"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}},"put":{"summary":"Update a workflow folder","tags":["Workflow Folders"],"description":"Updates the name of a workflow folder identified by UUID or slug.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1}},"required":["name"]}}},"required":true},"parameters":[{"schema":{"type":"string","minLength":1},"in":"path","name":"folder_id","required":true,"description":"Folder UUID or slug"}],"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}-[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)$"},"slug":{"type":"string"},"name":{"type":"string"},"parent_folder_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)$"},"org_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)$"},"folder_type":{"type":"string","enum":["normal","playground_root","playground_user"]}},"required":["id","slug","name","parent_folder_id","org_id","folder_type"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}},"delete":{"summary":"Delete a workflow folder","tags":["Workflow Folders"],"description":"Deletes a workflow folder by UUID or slug. Workflows inside the folder are moved to the folder specified by `move_to`, or to the parent folder if `move_to` is omitted. Sub-folders are also moved to the same destination.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"move_to":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Folder ID to move the contained workflows to. If omitted, workflows are moved to the parent folder (one level up)."}}}}}},"parameters":[{"schema":{"type":"string","minLength":1},"in":"path","name":"folder_id","required":true,"description":"Folder UUID or slug"}],"security":[{"bearerAuth":[]}],"responses":{"204":{"description":"Folder deleted","content":{"application/json":{"schema":{"description":"Folder deleted"}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/phone-numbers/":{"get":{"summary":"List phone numbers","tags":["Phone Numbers"],"description":"Returns all phone numbers for the authenticated organization, including Twilio, Telnyx, and SIP trunk numbers with caller ID information.","parameters":[{"schema":{"type":"string"},"in":"query","name":"restrict","required":false,"description":"Comma-separated filter values: INBOUND, OUTBOUND_WITH_CALLBACK, OUTBOUND_WITH_CALLBACK_STAGING, OUTBOUND_WITH_CALLBACK_DEVELOPMENT, ALL"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"nullable":true,"type":"string"},"number":{"type":"string"},"caller_id":{"type":"string","enum":["us","them"]},"toll_free_verification":{"type":"object","properties":{"status":{"type":"string"}},"additionalProperties":false},"type":{"type":"string","enum":["twilio"]},"has_sip_trunk_in_preferred_region":{"type":"boolean"},"sip_trunk_status":{"type":"string","enum":["valid","invalid","none"]}},"required":["id","name","number","caller_id","type","has_sip_trunk_in_preferred_region","sip_trunk_status"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string"},"name":{"nullable":true,"type":"string"},"number":{"type":"string"},"caller_id":{"type":"string","enum":["us","them"]},"toll_free_verification":{"type":"object","properties":{"status":{"type":"string"}},"additionalProperties":false},"type":{"type":"string","enum":["telnyx"]}},"required":["id","name","number","caller_id","type"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string"},"name":{"nullable":true,"type":"string"},"number":{"type":"string"},"caller_id":{"type":"string","enum":["us","them"]},"toll_free_verification":{"type":"object","properties":{"status":{"type":"string"}},"additionalProperties":false},"type":{"type":"string","enum":["sip"]},"inbound_trunk_id":{"nullable":true,"type":"string"},"outbound_trunk_id":{"nullable":true,"type":"string"},"org_id":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","number","caller_id","type","inbound_trunk_id","outbound_trunk_id","org_id","created_at","updated_at"],"additionalProperties":false}]}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}},"post":{"summary":"Purchase a phone number","tags":["Phone Numbers"],"description":"Purchases a new phone number from Twilio or Telnyx. For toll-free numbers (US/CA only), also submits toll-free verification. Rate limited to one purchase every 10 minutes per organization. Send force=true in the body to bypass this limit (use with caution — each number has a recurring monthly cost).","requestBody":{"content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"name":{"type":"string","minLength":1},"area_code":{"type":"string"},"number_type":{"type":"string","enum":["regular","toll_free"]},"provider":{"type":"string","enum":["twilio"]},"country_code":{"default":"US","type":"string","minLength":2,"maxLength":2},"phone_number_type":{"type":"string","enum":["local","toll_free","national","mobile"]},"bundle_id":{"nullable":true,"type":"string"},"address_sid":{"nullable":true,"type":"string"},"business_profile_application_id":{"description":"Approved Twilio Compliance Business Profile application ID. Only used when provider is twilio; US Twilio numbers without one cannot call US destinations until a Business Profile is assigned.","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)$"},"force":{"description":"Set to true to bypass the 10-minute rate limit between phone number purchases. Use with caution: each phone number incurs a recurring monthly cost.","type":"boolean"},"sms_url":{"type":"string"},"sms_method":{"default":"POST","type":"string","enum":["POST","GET"]},"sms_fallback_url":{"type":"string"},"sms_fallback_method":{"default":"POST","type":"string","enum":["POST","GET"]},"business_name":{"type":"string"},"business_website":{"type":"string"},"business_address_line_1":{"type":"string"},"business_address_line_2":{"type":"string"},"business_city":{"type":"string"},"business_state":{"type":"string"},"business_postal_code":{"type":"string"},"business_country":{"default":"US","type":"string"},"business_type":{"type":"string","enum":["PRIVATE_PROFIT","PUBLIC_PROFIT","SOLE_PROPRIETOR","NON_PROFIT","GOVERNMENT"]},"business_registration_number":{"type":"string"},"business_registration_authority":{"type":"string","enum":["EIN","CBN","CRN","PROVINCIAL_NUMBER","VAT","ACN","ABN","BRN","SIREN","SIRET","NZBN","USt-IdNr","CIF","NIF","CNPJ","UID","NEQ","OTHER"]},"business_registration_country":{"type":"string","minLength":2,"maxLength":2},"contact_first_name":{"type":"string"},"contact_last_name":{"type":"string"},"contact_email":{"type":"string"},"contact_phone":{"type":"string"},"notification_email":{"type":"string"},"message_volume":{"type":"string"},"use_categories":{"type":"array","items":{"type":"string"}},"workflow_summary":{"type":"string"},"production_message_sample":{"type":"string"},"opt_in_type":{"type":"string","enum":["VERBAL","WEB_FORM","PAPER_FORM","VIA_TEXT","MOBILE_QR_CODE","IMPORT","IMPORT_PLEASE_REPLACE"]},"opt_in_image_url":{"type":"string"},"additional_information":{"type":"string"}},"required":["name","number_type","provider","phone_number_type"]},{"type":"object","properties":{"name":{"type":"string","minLength":1},"area_code":{"type":"string"},"number_type":{"type":"string","enum":["regular","toll_free"]},"provider":{"type":"string","enum":["telnyx"]},"country_code":{"default":"US","type":"string","minLength":2,"maxLength":2},"phone_number_type":{"type":"string","enum":["local","toll_free","national","mobile"]},"bundle_id":{"nullable":true,"type":"string"},"address_sid":{"nullable":true,"type":"string"},"business_profile_application_id":{"description":"Approved Twilio Compliance Business Profile application ID. Only used when provider is twilio; US Twilio numbers without one cannot call US destinations until a Business Profile is assigned.","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)$"},"force":{"description":"Set to true to bypass the 10-minute rate limit between phone number purchases. Use with caution: each phone number incurs a recurring monthly cost.","type":"boolean"}},"required":["name","number_type","provider","phone_number_type"]}]}}}},"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"verification_failed":{"type":"boolean"},"setup_price":{"type":"number"},"recurring_price":{"type":"number"}},"required":["message"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/phone-numbers/validate-toll-free-numbers":{"post":{"summary":"Validate toll-free numbers for TextAgent","tags":["Phone Numbers"],"description":"Validates toll-free phone numbers for use with TextAgent SMS. Outbound numbers are always valid. Inbound numbers are blocked if a live inbound TextAgent already uses them.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"phone_numbers":{"minItems":1,"type":"array","items":{"type":"string"}},"message_direction":{"type":"string","enum":["inbound","outbound"]}},"required":["phone_numbers","message_direction"]}}},"required":true},"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"phone_number":{"type":"string"},"is_valid":{"type":"boolean"},"reason":{"type":"string"},"conflict_info":{"type":"object","properties":{"workflow":{"type":"object","properties":{"name":{"type":"string"},"slug":{"type":"string"}},"required":["name","slug"],"additionalProperties":false},"version":{"type":"object","properties":{"name":{"type":"string"},"version_number":{"nullable":true,"type":"number"},"environment":{"type":"string"},"slug":{"type":"string"}},"required":["name","version_number","environment","slug"],"additionalProperties":false},"event":{"type":"object","properties":{"name":{"type":"string"},"id":{"type":"string"}},"required":["name","id"],"additionalProperties":false},"status":{"type":"string","enum":["draft","locked","live"]},"phone_number":{"type":"string"},"channel":{"type":"string","enum":["sms"]},"message_direction":{"type":"string","enum":["inbound","outbound"]},"provider":{"type":"string","enum":["use_existing_toll_free"]}},"required":["workflow","version","event","status","phone_number","channel","message_direction","provider"],"additionalProperties":false}},"required":["phone_number","is_valid"],"additionalProperties":false}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/phone-numbers/tollfree-verification/{verification_sid}":{"delete":{"summary":"Delete a toll-free verification","tags":["Phone Numbers"],"description":"Deletes a toll-free verification request by its SID.","parameters":[{"schema":{"type":"string","minLength":1},"in":"path","name":"verification_sid","required":true,"description":"Toll-free verification SID"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/phone-numbers/free-up-number":{"post":{"summary":"Free up a phone number","tags":["Phone Numbers"],"description":"Removes a phone number from all workflows it is assigned to. The phone number must not be used in any live version.","parameters":[{"schema":{"type":"string","minLength":1},"in":"path","name":"phone_number_id","required":true,"description":"Phone number ID (Twilio SID or Telnyx ID)"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/phone-numbers/delete-number":{"post":{"summary":"Delete a phone number","tags":["Phone Numbers"],"description":"Permanently deletes a phone number. The phone number must not be in use by any workflow.","parameters":[{"schema":{"type":"string","minLength":1},"in":"path","name":"phone_number_id","required":true,"description":"Phone number ID (Twilio SID or Telnyx ID)"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/phone-numbers/usage":{"get":{"summary":"Get phone number usage","tags":["Phone Numbers"],"description":"Returns usage information for a phone number across all workflows and versions.","parameters":[{"schema":{"type":"string","minLength":1},"in":"path","name":"phone_number_id","required":true,"description":"Phone number ID (Twilio SID or Telnyx ID)"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"workflow":{"type":"object","properties":{"name":{"type":"string"},"slug":{"type":"string"}},"required":["name","slug"],"additionalProperties":false},"version":{"type":"object","properties":{"name":{"type":"string"},"version_number":{"nullable":true,"type":"number"},"environment":{"type":"string"},"slug":{"type":"string"}},"required":["name","version_number","environment","slug"],"additionalProperties":false},"event":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"],"additionalProperties":false},"status":{"type":"string","enum":["draft","locked","live"]}},"required":["workflow","version","event","status"],"additionalProperties":false}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/phone-numbers/remove-from-workflow":{"post":{"summary":"Remove phone number from a workflow","tags":["Phone Numbers"],"description":"Removes a phone number from a specific workflow and version. The version must not be live.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"workflow_slug":{"type":"string","minLength":1},"version_slug":{"type":"string","minLength":1}},"required":["workflow_slug","version_slug"]}}},"required":true},"parameters":[{"schema":{"type":"string","minLength":1},"in":"path","name":"phone_number_id","required":true,"description":"Phone number ID (Twilio SID or Telnyx ID)"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/phone-numbers/tollfree-verification":{"get":{"summary":"Get toll-free verification status","tags":["Phone Numbers"],"description":"Returns toll-free verification status and submitted data for a phone number. Returns 204 when no verification exists.","parameters":[{"schema":{"type":"string","minLength":1},"in":"path","name":"phone_number_id","required":true,"description":"Phone number ID (Twilio SID or Telnyx ID)"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string"},"sid":{"type":"string"},"business_name":{"type":"string"},"business_website":{"type":"string"},"notification_email":{"type":"string"},"tollfree_phone_number_sid":{"type":"string"},"business_street_address":{"type":"string"},"business_street_address_2":{"type":"string"},"business_city":{"type":"string"},"business_state_province":{"type":"string"},"business_postal_code":{"type":"string"},"business_country":{"type":"string"},"workflow_categories":{"type":"array","items":{"type":"string"}},"workflow_summary":{"type":"string"},"message_volume":{"type":"string"},"business_contact_email":{"type":"string"},"business_contact_first_name":{"type":"string"},"business_contact_last_name":{"type":"string"},"business_contact_phone":{"type":"string"},"production_message_sample":{"type":"string"},"opt_in_type":{"type":"string"},"opt_in_image_urls":{"type":"array","items":{"type":"string"}},"additional_information":{"type":"string"},"date_created":{"type":"string"},"date_updated":{"type":"string"}},"additionalProperties":false}}}},"204":{"description":"No verification exists","content":{"application/json":{"schema":{"description":"No verification exists"}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}},"post":{"summary":"Submit toll-free verification","tags":["Phone Numbers"],"description":"Submits a toll-free verification request for a phone number. Requires business_name, notification_email, and sms_url.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"business_name":{"type":"string","minLength":1},"notification_email":{"type":"string","minLength":1,"format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"sms_url":{"type":"string","minLength":1,"format":"uri"},"country_code":{"default":"US","type":"string","minLength":2,"maxLength":2},"phone_number_type":{"type":"string","enum":["local","toll_free","national","mobile"]},"compliance_action":{"type":"string","enum":["ordering","porting"]},"bundle_id":{"nullable":true,"type":"string"},"address_sid":{"nullable":true,"type":"string"},"sms_method":{"default":"POST","type":"string","enum":["POST","GET"]},"sms_fallback_url":{"type":"string"},"sms_fallback_method":{"default":"POST","type":"string","enum":["POST","GET"]},"business_website":{"type":"string"},"business_type":{"type":"string","enum":["PRIVATE_PROFIT","PUBLIC_PROFIT","SOLE_PROPRIETOR","NON_PROFIT","GOVERNMENT"]},"business_registration_number":{"type":"string"},"business_registration_authority":{"type":"string","enum":["EIN","CBN","CRN","PROVINCIAL_NUMBER","VAT","ACN","ABN","BRN","SIREN","SIRET","NZBN","USt-IdNr","CIF","NIF","CNPJ","UID","NEQ","OTHER"]},"business_registration_country":{"type":"string","minLength":2,"maxLength":2},"business_address_line_1":{"type":"string"},"business_address_line_2":{"type":"string"},"business_city":{"type":"string"},"business_state":{"type":"string"},"business_postal_code":{"type":"string"},"business_country":{"default":"US","type":"string"},"contact_first_name":{"type":"string"},"contact_last_name":{"type":"string"},"contact_email":{"type":"string"},"contact_phone":{"type":"string"},"message_volume":{"type":"string"},"use_categories":{"type":"array","items":{"type":"string"}},"workflow_summary":{"type":"string"},"production_message_sample":{"type":"string"},"opt_in_type":{"type":"string","enum":["VERBAL","WEB_FORM","PAPER_FORM","VIA_TEXT","MOBILE_QR_CODE","IMPORT","IMPORT_PLEASE_REPLACE"]},"opt_in_image_url":{"type":"string"},"additional_information":{"type":"string"}},"required":["business_name","notification_email","sms_url","phone_number_type"]}}},"required":true},"parameters":[{"schema":{"type":"string","minLength":1},"in":"path","name":"phone_number_id","required":true,"description":"Phone number ID (Twilio SID or Telnyx ID)"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/phone-numbers/sip-trunk":{"post":{"summary":"Create and attach SIP trunk","tags":["Phone Numbers"],"description":"Creates a SIP trunk and attaches it to a Twilio phone number. Sets up both inbound and outbound trunks in LiveKit.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{}}}}},"parameters":[{"schema":{"type":"string","minLength":1},"in":"path","name":"phone_number_id","required":true,"description":"Phone number ID (Twilio SID or Telnyx ID)"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/phone-numbers/{id}":{"put":{"summary":"Update a phone number","tags":["Phone Numbers"],"description":"Updates the display name and caller ID setting for a phone number.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"caller_id":{"type":"string","enum":["us","them"]}},"required":["name","caller_id"]}}},"required":true},"parameters":[{"schema":{"type":"string","minLength":1},"in":"path","name":"id","required":true,"description":"Phone number ID"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/sip-trunks/":{"get":{"summary":"List SIP trunks","tags":["SIP Trunks"],"description":"Returns all SIP trunks for the organization.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"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)$"},"org_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)$"},"number":{"type":"string"},"inbound_trunk_id":{"nullable":true,"type":"string"},"outbound_trunk_id":{"nullable":true,"type":"string"},"name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","org_id","number","inbound_trunk_id","outbound_trunk_id","name","created_at","updated_at"],"additionalProperties":false}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}},"post":{"summary":"Create a SIP trunk","tags":["SIP Trunks"],"description":"Creates a new SIP trunk with inbound and outbound LiveKit trunks. Rate limited to one creation every 10 minutes per organization. Send force=true in the body to bypass this limit (use with caution — each trunk has a recurring monthly cost).","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"number":{"type":"string","minLength":1,"pattern":"^\\+\\d+$"},"name":{"type":"string","minLength":1},"address":{"type":"string"},"transport":{"default":"udp","type":"string","enum":["udp","tcp","tls"]},"auth_username":{"type":"string"},"auth_password":{"type":"string"},"allowed_addresses":{"type":"array","items":{"type":"string","minLength":1,"pattern":"^(?:(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)\\.){3}(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(?:\\/(?:3[0-2]|[12]\\d|[1-9]))?$"}},"attributes_to_headers":{"type":"object","additionalProperties":{"type":"string","minLength":1,"pattern":"^[!#$%&'*+\\-.^_`|~0-9A-Za-z]+$"}},"provider":{"type":"string","enum":["twilio","telnyx","custom"]},"direction":{"default":"both","type":"string","enum":["inbound","outbound","both"]},"tag_ids":{"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)$"}},"force":{"description":"Set to true to bypass the 10-minute rate limit between SIP trunk creations. Use with caution: each SIP trunk incurs a recurring monthly cost.","type":"boolean"}},"required":["number","name"]}}},"required":true},"security":[{"bearerAuth":[]}],"responses":{"201":{"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}-[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)$"},"org_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)$"},"number":{"type":"string"},"inbound_trunk_id":{"nullable":true,"type":"string"},"outbound_trunk_id":{"nullable":true,"type":"string"},"name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","org_id","number","inbound_trunk_id","outbound_trunk_id","name","created_at","updated_at"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/sip-trunks/options":{"get":{"summary":"Get SIP trunk options","tags":["SIP Trunks"],"description":"Returns trunk options for UI (id, name, number).","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"number":{"type":"string"}},"required":["id","name","number"],"additionalProperties":false}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/sip-trunks/bulk":{"post":{"summary":"Create multiple SIP trunks","tags":["SIP Trunks"],"description":"Creates multiple SIP trunks from a shared configuration. Returns the successfully created trunks. Rate limited to one creation every 10 minutes per organization. Send force=true in the body to bypass this limit (use with caution — each trunk has a recurring monthly cost).","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"numbers":{"minItems":1,"type":"array","items":{"type":"string"}},"address":{"type":"string"},"transport":{"default":"udp","type":"string","enum":["udp","tcp","tls"]},"auth_username":{"type":"string"},"auth_password":{"type":"string"},"allowed_addresses":{"type":"array","items":{"type":"string","minLength":1,"pattern":"^(?:(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)\\.){3}(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(?:\\/(?:3[0-2]|[12]\\d|[1-9]))?$"}},"attributes_to_headers":{"type":"object","additionalProperties":{"type":"string","minLength":1,"pattern":"^[!#$%&'*+\\-.^_`|~0-9A-Za-z]+$"}},"direction":{"default":"both","type":"string","enum":["inbound","outbound","both"]},"tag_ids":{"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)$"}},"force":{"description":"Set to true to bypass the 10-minute rate limit between SIP trunk creations. Use with caution: each SIP trunk incurs a recurring monthly cost.","type":"boolean"}},"required":["numbers"]}}},"required":true},"security":[{"bearerAuth":[]}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"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)$"},"org_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)$"},"number":{"type":"string"},"inbound_trunk_id":{"nullable":true,"type":"string"},"outbound_trunk_id":{"nullable":true,"type":"string"},"name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","org_id","number","inbound_trunk_id","outbound_trunk_id","name","created_at","updated_at"],"additionalProperties":false}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/sip-trunks/{id}":{"get":{"summary":"Get a SIP trunk","tags":["SIP Trunks"],"description":"Returns a single SIP trunk by ID.","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":"id","required":true,"description":"SIP trunk 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}-[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)$"},"org_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)$"},"number":{"type":"string"},"inbound_trunk_id":{"nullable":true,"type":"string"},"outbound_trunk_id":{"nullable":true,"type":"string"},"name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","org_id","number","inbound_trunk_id","outbound_trunk_id","name","created_at","updated_at"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}},"put":{"summary":"Update a SIP trunk","tags":["SIP Trunks"],"description":"Updates a SIP trunk by ID.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"number":{"type":"string","minLength":1,"pattern":"^\\+\\d+$"},"name":{"type":"string","minLength":1},"address":{"type":"string"},"transport":{"default":"udp","type":"string","enum":["udp","tcp","tls"]},"auth_username":{"type":"string"},"auth_password":{"type":"string"},"allowed_addresses":{"type":"array","items":{"type":"string","minLength":1,"pattern":"^(?:(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)\\.){3}(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(?:\\/(?:3[0-2]|[12]\\d|[1-9]))?$"}},"attributes_to_headers":{"type":"object","additionalProperties":{"type":"string","minLength":1,"pattern":"^[!#$%&'*+\\-.^_`|~0-9A-Za-z]+$"}},"provider":{"type":"string","enum":["twilio","telnyx","custom"]},"direction":{"default":"both","type":"string","enum":["inbound","outbound","both"]},"tag_ids":{"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)$"}},"force":{"description":"Set to true to bypass the 10-minute rate limit between SIP trunk creations. Use with caution: each SIP trunk incurs a recurring monthly cost.","type":"boolean"}}}}}},"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":"id","required":true,"description":"SIP trunk 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}-[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)$"},"org_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)$"},"number":{"type":"string"},"inbound_trunk_id":{"nullable":true,"type":"string"},"outbound_trunk_id":{"nullable":true,"type":"string"},"name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","org_id","number","inbound_trunk_id","outbound_trunk_id","name","created_at","updated_at"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}},"delete":{"summary":"Delete a SIP trunk","tags":["SIP Trunks"],"description":"Deletes a SIP trunk by ID. Fails if the trunk is still in use by a workflow.","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":"id","required":true,"description":"SIP trunk ID"}],"security":[{"bearerAuth":[]}],"responses":{"204":{"description":"Deleted","content":{"application/json":{"schema":{"description":"Deleted"}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/integrations/":{"get":{"summary":"List integrations","tags":["Integrations"],"description":"Returns available integrations with optional events and credentials. Delegated providers (CRM, HRIS, ATS, etc.) are expanded into individual entries. Supports filtering by category, provider, and search. Paginated (default: 20 per page).","parameters":[{"schema":{"type":"string"},"in":"query","name":"search","required":false},{"schema":{"type":"string"},"in":"query","name":"category","required":false,"description":"Filter by category. Works for both internal groups (e.g. 'Communications', 'Data') and delegated categories (e.g. 'crm', 'hris', 'ats'). Case-insensitive."},{"schema":{"type":"string"},"in":"query","name":"provider","required":false,"description":"Filter by provider slug. Works for both internal integrations (e.g. 'gmail', 'slack') and delegated providers (e.g. 'hubspot', 'workday')."},{"schema":{"type":"string","enum":["true","false"]},"in":"query","name":"include_events","required":false,"description":"If true, include events per integration (default: false)"},{"schema":{"type":"string","enum":["true","false"]},"in":"query","name":"include_credentials","required":false,"description":"If true, include the organization's connected credentials per integration (default: false)"},{"schema":{"type":"string","enum":["true","false"]},"in":"query","name":"include_config_schema","required":false,"description":"If true, include config_schema per event. Only effective when include_events=true (default: false)"},{"schema":{"default":1,"type":"integer","minimum":1,"maximum":9007199254740991},"in":"query","name":"page","required":false},{"schema":{"default":20,"type":"integer","minimum":1,"maximum":100},"in":"query","name":"page_size","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"},"name":{"type":"string"},"group":{"type":"string"},"icon":{"type":"string"},"description":{"type":"string"},"docs_url":{"type":"string"},"website_url":{"type":"string"},"is_top":{"type":"boolean"},"requires_credentials":{"type":"boolean"},"agent_specific":{"type":"boolean"},"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})$"},"name":{"type":"string"},"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})$"},"type":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"0 = trigger, 1 = action"},"description":{"type":"string"},"is_instant":{"type":"boolean"},"has_cron_trigger":{"type":"boolean"},"coming_soon":{"type":"boolean"},"config_schema":{"nullable":true,"type":"array","items":{"$ref":"#/components/schemas/schema0"}},"delegated_category":{"description":"Non-null for delegated provider events (e.g. 'crm', 'hris'). When present, the node configuration must include _merge_provider_slug.","nullable":true,"type":"string"}},"required":["id","name","integration_id","type","description","is_instant","has_cron_trigger","coming_soon"],"additionalProperties":false}},"credentials":{"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)$"},"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})$"},"title":{"type":"string"},"timestamp":{"type":"string"}},"required":["id","integration_id","title","timestamp"],"additionalProperties":false}},"credential_config":{"nullable":true,"type":"object","properties":{"credential_types":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"display_name":{"type":"string"},"description":{"type":"string"},"flow":{"type":"string","enum":["oauth","form"]},"fields":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","enum":["string","password","email","number","boolean","select"]},"required":{"type":"boolean"},"description":{"type":"string"},"options":{"type":"array","items":{"type":"string"}}},"required":["name","label","type","required"],"additionalProperties":false}}},"required":["type","display_name","description","flow","fields"],"additionalProperties":false}},"default_credential_type":{"type":"string"}},"required":["credential_types","default_credential_type"],"additionalProperties":false}},"required":["id","name","group","icon","description","docs_url","website_url","is_top","requires_credentials","agent_specific"],"additionalProperties":false}},"pagination":{"type":"object","properties":{"page":{"type":"number"},"page_size":{"type":"number"},"total_pages":{"type":"number"},"total_records":{"type":"number"},"has_next_page":{"type":"boolean"},"has_previous_page":{"type":"boolean"}},"required":["page","page_size","total_pages","total_records","has_next_page","has_previous_page"],"additionalProperties":false}},"required":["data","pagination"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/integrations/categories":{"get":{"summary":"List integration categories with providers","tags":["Integrations"],"description":"Returns a unified map of categories to their available providers. Includes both internal integration groups (Communications, Data, etc.) and delegated provider categories (CRM, HRIS, ATS, etc.).","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","additionalProperties":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"icon":{"nullable":true,"type":"string"}},"required":["id","name","slug","icon"],"additionalProperties":false}}}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/integrations/whatsapp/message-templates":{"get":{"summary":"List WhatsApp message templates","tags":["Integration Resources"],"description":"Returns all approved WhatsApp message templates for the given credential and business account.","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":"query","name":"credential_id","required":true},{"schema":{"type":"string"},"in":"query","name":"business_account_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"},"name":{"type":"string"},"description":{"type":"string"},"disabled":{"type":"boolean"},"metadata":{"type":"object","properties":{"language":{"type":"string"},"category":{"type":"string"},"status":{"type":"string"},"components":{"type":"array","items":{}}},"required":["language","category","status"],"additionalProperties":false}},"required":["name"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/integrations/whatsapp/businesses":{"get":{"summary":"List WhatsApp businesses","tags":["Integration Resources"],"description":"Returns all WhatsApp businesses associated with the organization's credentials.","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":"query","name":"credential_id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/integrations/whatsapp/business-accounts":{"get":{"summary":"List WhatsApp business accounts","tags":["Integration Resources"],"description":"Returns all WhatsApp business accounts for a given business ID.","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":"query","name":"credential_id","required":true},{"schema":{"type":"string"},"in":"query","name":"business_id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/integrations/whatsapp/phone-numbers":{"get":{"summary":"List WhatsApp phone numbers","tags":["Integration Resources"],"description":"Returns all WhatsApp phone numbers for a given business account ID.","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":"query","name":"credential_id","required":true},{"schema":{"type":"string"},"in":"query","name":"business_account_id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/integrations/slack/channels":{"get":{"summary":"List Slack channels","tags":["Integration Resources"],"description":"Returns all Slack channels accessible with the organization's credentials.","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":"query","name":"credential_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"},"name":{"type":"string"},"description":{"type":"string"}},"required":["id","name"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/integrations/slack/users":{"get":{"summary":"List Slack users","tags":["Integration Resources"],"description":"Returns all Slack users accessible with the organization's credentials.","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":"query","name":"credential_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"},"name":{"type":"string"},"description":{"type":"string"}},"required":["id","name"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/integrations/google-sheets/spreadsheets":{"get":{"summary":"List Google Sheets spreadsheets","tags":["Integration Resources"],"description":"Returns Google Sheets spreadsheets accessible with the organization's credentials. Supports search and cursor-based pagination.","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":"query","name":"credential_id","required":false},{"schema":{"type":"string"},"in":"query","name":"search","required":false},{"schema":{"type":"string"},"in":"query","name":"page_token","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"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}},"next_page_token":{"type":"string"}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/integrations/google-sheets/worksheets":{"get":{"summary":"List Google Sheets worksheets","tags":["Integration Resources"],"description":"Returns all worksheets (tabs) within a Google Sheets spreadsheet.","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":"query","name":"credential_id","required":false},{"schema":{"type":"string"},"in":"query","name":"spreadsheet_id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/integrations/google-sheets/columns":{"get":{"summary":"List Google Sheets columns","tags":["Integration Resources"],"description":"Returns all column headers from a specific worksheet within a Google Sheets spreadsheet.","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":"query","name":"credential_id","required":false},{"schema":{"type":"string"},"in":"query","name":"spreadsheet_id","required":true},{"schema":{"type":"string"},"in":"query","name":"worksheet_name","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/integrations/google-sheets/rows":{"get":{"summary":"List Google Sheets rows","tags":["Integration Resources"],"description":"Returns all rows from a specific worksheet within a Google Sheets spreadsheet.","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":"query","name":"credential_id","required":false},{"schema":{"type":"string"},"in":"query","name":"spreadsheet_id","required":true},{"schema":{"type":"string"},"in":"query","name":"worksheet_name","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/integrations/teams/teams":{"get":{"summary":"List Microsoft Teams teams","tags":["Integration Resources"],"description":"Returns all Microsoft Teams teams accessible with the organization's credentials.","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":"query","name":"credential_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"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/integrations/teams/channels":{"get":{"summary":"List Microsoft Teams channels","tags":["Integration Resources"],"description":"Returns all Microsoft Teams channels. Optionally filter by team ID.","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":"query","name":"credential_id","required":false},{"schema":{"type":"string"},"in":"query","name":"team_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"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/integrations/teams/users":{"get":{"summary":"List Microsoft Teams users","tags":["Integration Resources"],"description":"Returns all Microsoft Teams users accessible with the organization's credentials.","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":"query","name":"credential_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"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/integrations/twilio-sms/phone-numbers":{"get":{"summary":"List Twilio SMS phone numbers","tags":["Integration Resources"],"description":"Returns all Twilio SMS phone numbers available for the organization.","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":"query","name":"credential_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"},"name":{"type":"string"},"description":{"type":"string"}},"required":["id","name"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/integrations/telnyx-sms/phone-numbers":{"get":{"summary":"List Telnyx SMS phone numbers","tags":["Integration Resources"],"description":"Returns all Telnyx SMS phone numbers available for the organization.","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":"query","name":"credential_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"},"name":{"type":"string"},"description":{"type":"string"}},"required":["id","name"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/integrations/{integrationId}":{"get":{"summary":"Get an integration","tags":["Integrations"],"description":"Returns a single integration by ID, including its events and the organization's connected credentials. Supports both native integration UUIDs and delegated provider composite IDs (e.g. {uuid}--{provider_slug}).","parameters":[{"schema":{"type":"string"},"in":"path","name":"integrationId","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"group":{"type":"string"},"icon":{"type":"string"},"description":{"type":"string"},"docs_url":{"type":"string"},"website_url":{"type":"string"},"is_top":{"type":"boolean"},"requires_credentials":{"type":"boolean"},"agent_specific":{"type":"boolean"},"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})$"},"name":{"type":"string"},"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})$"},"type":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"0 = trigger, 1 = action"},"description":{"type":"string"},"is_instant":{"type":"boolean"},"has_cron_trigger":{"type":"boolean"},"coming_soon":{"type":"boolean"},"config_schema":{"nullable":true,"type":"array","items":{"$ref":"#/components/schemas/schema0"}},"delegated_category":{"description":"Non-null for delegated provider events (e.g. 'crm', 'hris'). When present, the node configuration must include _merge_provider_slug.","nullable":true,"type":"string"}},"required":["id","name","integration_id","type","description","is_instant","has_cron_trigger","coming_soon"],"additionalProperties":false}},"credentials":{"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)$"},"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})$"},"title":{"type":"string"},"timestamp":{"type":"string"}},"required":["id","integration_id","title","timestamp"],"additionalProperties":false}},"credential_config":{"nullable":true,"type":"object","properties":{"credential_types":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"display_name":{"type":"string"},"description":{"type":"string"},"flow":{"type":"string","enum":["oauth","form"]},"fields":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","enum":["string","password","email","number","boolean","select"]},"required":{"type":"boolean"},"description":{"type":"string"},"options":{"type":"array","items":{"type":"string"}}},"required":["name","label","type","required"],"additionalProperties":false}}},"required":["type","display_name","description","flow","fields"],"additionalProperties":false}},"default_credential_type":{"type":"string"}},"required":["credential_types","default_credential_type"],"additionalProperties":false}},"required":["id","name","group","icon","description","docs_url","website_url","is_top","requires_credentials","agent_specific"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/integrations/{integrationId}/create-credential":{"post":{"summary":"Create a credential for an integration","tags":["Integrations"],"description":"Creates a new credential for a form-based integration. OAuth integrations are not supported via API — use the HappyRobot platform UI instead.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"credential_type":{"type":"string"},"title":{"type":"string"},"data":{"type":"object","additionalProperties":{}}},"required":["title","data"]}}},"required":true},"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":"integrationId","required":true}],"security":[{"bearerAuth":[]}],"responses":{"201":{"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}-[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)$"},"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})$"},"title":{"type":"string"},"timestamp":{"type":"string"}},"required":["id","integration_id","title","timestamp"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"405":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/sessions/":{"get":{"summary":"List sessions by caller ID","tags":["Sessions"],"description":"Returns paginated sessions whose caller phone number matches caller_id, ordered by timestamp. Optionally filter by session timestamp with start_date and/or end_date (ISO 8601). Resolves the phone number to a contact, so a session is only returned if it produced a communication event. Use the session id with GET /sessions/{session_id}/messages to fetch the transcript.","parameters":[{"schema":{"type":"string","minLength":1},"in":"query","name":"caller_id","required":true},{"schema":{"anyOf":[{"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))$"},{"type":"string","enum":[""]}]},"in":"query","name":"start_date","required":false},{"schema":{"anyOf":[{"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))$"},{"type":"string","enum":[""]}]},"in":"query","name":"end_date","required":false},{"schema":{"default":1,"type":"integer","minimum":1,"maximum":9007199254740991},"in":"query","name":"page","required":false},{"schema":{"default":50,"type":"integer","minimum":1,"maximum":100},"in":"query","name":"page_size","required":false},{"schema":{"default":"desc","type":"string","enum":["asc","desc"]},"in":"query","name":"sort","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}-[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)$"},"org_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)$"},"use_case_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)$"},"version_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)$"},"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)$"},"user_number":{"type":"string"},"status":{"type":"string"},"type":{"type":"string"},"duration":{"nullable":true,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"timestamp":{"type":"string"},"call_connected_at":{"nullable":true,"type":"string"},"sip_code":{"nullable":true,"type":"string"},"sip_reason":{"nullable":true,"type":"string"},"failure_reason":{"nullable":true,"type":"string"},"llm_model":{"nullable":true,"type":"string"},"stt_model":{"nullable":true,"type":"string"},"tts_model":{"nullable":true,"type":"string"},"voice_id":{"nullable":true,"type":"string"},"languages":{"nullable":true,"type":"array","items":{"type":"string"}}},"required":["id","org_id","use_case_id","version_id","run_id","user_number","status","type","duration","timestamp","call_connected_at","sip_code","sip_reason","failure_reason","llm_model","stt_model","tts_model","voice_id","languages"],"additionalProperties":false}},"pagination":{"type":"object","properties":{"page":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"page_size":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total_pages":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total_records":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"has_next_page":{"type":"boolean"},"has_previous_page":{"type":"boolean"}},"required":["page","page_size","total_pages","total_records","has_next_page","has_previous_page"],"additionalProperties":false}},"required":["data","pagination"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/sessions/{session_id}/stream":{"get":{"summary":"Stream session messages (SSE)","tags":["Sessions"],"description":"Opens a Server-Sent Events stream for a single session. Optionally backfills the most recent messages. The stream emits `message` events in real-time and closes when the session ends.","parameters":[{"schema":{"default":0,"type":"integer","minimum":0,"maximum":1000},"in":"query","name":"backfillLimit","required":false},{"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":"session_id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}}}}}},"/sessions/{session_id}":{"get":{"summary":"Get session","tags":["Sessions"],"description":"Returns metadata for a single session.","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":"session_id","required":true}],"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}-[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)$"},"org_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)$"},"use_case_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)$"},"version_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)$"},"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)$"},"user_number":{"type":"string"},"status":{"type":"string"},"type":{"type":"string"},"duration":{"nullable":true,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"timestamp":{"type":"string"},"call_connected_at":{"nullable":true,"type":"string"},"sip_code":{"nullable":true,"type":"string"},"sip_reason":{"nullable":true,"type":"string"},"failure_reason":{"nullable":true,"type":"string"},"llm_model":{"nullable":true,"type":"string"},"stt_model":{"nullable":true,"type":"string"},"tts_model":{"nullable":true,"type":"string"},"voice_id":{"nullable":true,"type":"string"},"languages":{"nullable":true,"type":"array","items":{"type":"string"}}},"required":["id","org_id","use_case_id","version_id","run_id","user_number","status","type","duration","timestamp","call_connected_at","sip_code","sip_reason","failure_reason","llm_model","stt_model","tts_model","voice_id","languages"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/sessions/{session_id}/messages":{"get":{"summary":"List session messages","tags":["Sessions"],"description":"Returns paginated messages for a session, ordered by timestamp.","parameters":[{"schema":{"default":1,"type":"integer","minimum":1,"maximum":9007199254740991},"in":"query","name":"page","required":false},{"schema":{"default":50,"type":"integer","minimum":1,"maximum":100},"in":"query","name":"page_size","required":false},{"schema":{"default":"asc","type":"string","enum":["asc","desc"]},"in":"query","name":"sort","required":false},{"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":"session_id","required":true}],"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}-[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)$"},"session_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)$"},"role":{"type":"string"},"status":{"nullable":true,"type":"string"},"content":{"type":"string"},"timestamp":{"type":"string"},"is_filler":{"type":"boolean"},"is_interrupted":{"type":"boolean"},"tool_calls":{"nullable":true},"artifacts":{"nullable":true},"turn_index":{"nullable":true,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","session_id","role","status","content","timestamp","is_filler","is_interrupted","tool_calls","artifacts","turn_index"],"additionalProperties":false}},"pagination":{"type":"object","properties":{"page":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"page_size":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total_pages":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total_records":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"has_next_page":{"type":"boolean"},"has_previous_page":{"type":"boolean"}},"required":["page","page_size","total_pages","total_records","has_next_page","has_previous_page"],"additionalProperties":false}},"required":["data","pagination"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/messages/{message_id}/flags":{"get":{"summary":"List message flags","tags":["Messages"],"description":"Returns paginated flags (issues) for a specific message, ordered by creation date.","parameters":[{"schema":{"default":1,"type":"integer","minimum":1,"maximum":9007199254740991},"in":"query","name":"page","required":false},{"schema":{"default":50,"type":"integer","minimum":1,"maximum":100},"in":"query","name":"page_size","required":false},{"schema":{"default":"desc","type":"string","enum":["asc","desc"]},"in":"query","name":"sort","required":false},{"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":"message_id","required":true}],"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}-[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)$"},"status":{"type":"string"},"priority":{"type":"string"},"type":{"type":"string"},"correction":{"nullable":true,"type":"string"},"correction_reason":{"nullable":true,"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","status","priority","type","correction","correction_reason","created_at","updated_at"],"additionalProperties":false}},"pagination":{"type":"object","properties":{"page":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"page_size":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total_pages":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total_records":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"has_next_page":{"type":"boolean"},"has_previous_page":{"type":"boolean"}},"required":["page","page_size","total_pages","total_records","has_next_page","has_previous_page"],"additionalProperties":false}},"required":["data","pagination"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}},"post":{"summary":"Create message flag","tags":["Messages"],"description":"Creates a new flag (issue) on a specific message. The flag is linked to the message and its parent run.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"default":"message","description":"The type of issue to create","type":"string","enum":["transcriber","message","tool_call","run","interruption"]},"priority":{"default":"medium","description":"Priority level of the flag","type":"string","enum":["low","medium","high"]},"correction":{"description":"Correction text explaining what went wrong","type":"string"},"correction_reason":{"description":"Reason or category for the correction","type":"string"}}}}}},"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":"message_id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"201":{"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}-[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)$"},"status":{"type":"string"},"priority":{"type":"string"},"type":{"type":"string"},"correction":{"nullable":true,"type":"string"},"correction_reason":{"nullable":true,"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","status","priority","type","correction","correction_reason","created_at","updated_at"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/org/":{"get":{"summary":"Get current organization","tags":["Organization"],"description":"Returns basic information about the authenticated organization.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"tier":{"nullable":true,"type":"string"}},"required":["id","name","slug"],"additionalProperties":false}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/org/members/":{"post":{"summary":"Add a member to the current organization","tags":["Organization"],"description":"Adds a member to the authenticated organization by email. Internal users are added immediately; everyone else receives an email invitation to accept. Role must be editor or viewer (owners cannot be assigned via the API); defaults to viewer.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"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":{"default":"viewer","type":"string","enum":["editor","viewer"]}},"required":["email"]}}},"required":true},"security":[{"bearerAuth":[]}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"org_id":{"type":"string"},"email":{"type":"string"},"role":{"type":"string","enum":["editor","viewer"]},"status":{"type":"string","enum":["member","invited"]}},"required":["org_id","email","role","status"],"additionalProperties":false}},"required":["data"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}},"delete":{"summary":"Remove a member from the current organization","tags":["Organization"],"description":"Removes a member from the authenticated organization, identified by email or user_id. Owners cannot be removed via the API.","parameters":[{"schema":{"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,}$"},"in":"query","name":"email","required":false},{"schema":{"type":"string"},"in":"query","name":"user_id","required":false}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]}},"required":["success"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/mcp/":{"get":{"summary":"List MCP servers","tags":["MCP Servers"],"description":"Returns paginated MCP servers for the authenticated organization.","parameters":[{"schema":{"default":1,"type":"integer","minimum":1,"maximum":9007199254740991},"in":"query","name":"page","required":false},{"schema":{"default":20,"type":"integer","minimum":1,"maximum":100},"in":"query","name":"page_size","required":false},{"schema":{"default":"desc","type":"string","enum":["asc","desc"]},"in":"query","name":"sort","required":false},{"schema":{"type":"string"},"in":"query","name":"search","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}-[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)$"},"server_name":{"type":"string"},"server_url":{"type":"string"},"auth_type":{"type":"string","enum":["none","bearer","api_key","oauth2"]},"oauth2_credential_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)$"},"staging_oauth2_credential_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)$"},"development_oauth2_credential_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)$"},"auth_header_name":{"type":"string"},"custom_headers":{"type":"object","additionalProperties":{"type":"string"}},"staging_server_url":{"type":"string"},"development_server_url":{"type":"string"},"tools":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"input_schema":{}},"required":["name"],"additionalProperties":false}},"last_connected_at":{"type":"string"},"title":{"type":"string"},"timestamp":{"type":"string"}},"required":["id","server_name","server_url","auth_type","tools","last_connected_at","title","timestamp"],"additionalProperties":false}},"pagination":{"type":"object","properties":{"page":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"page_size":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total_pages":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total_records":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"has_next_page":{"type":"boolean"},"has_previous_page":{"type":"boolean"}},"required":["page","page_size","total_pages","total_records","has_next_page","has_previous_page"],"additionalProperties":false}},"required":["data","pagination"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}},"post":{"summary":"Create MCP server","tags":["MCP Servers"],"description":"Creates a new MCP server connection. Tests connectivity and discovers available tools before saving.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"server_name":{"type":"string","minLength":1},"server_url":{"type":"string","format":"uri"},"auth_type":{"type":"string","enum":["none","bearer","api_key","oauth2"]},"auth_token":{"type":"string"},"oauth2_credential_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)$"},"staging_oauth2_credential_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)$"},"development_oauth2_credential_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)$"},"auth_header_name":{"type":"string"},"custom_headers":{"type":"object","additionalProperties":{"type":"string"}},"staging_server_url":{"anyOf":[{"type":"string","format":"uri"},{"type":"string","enum":[""]}]},"staging_auth_token":{"type":"string"},"development_server_url":{"anyOf":[{"type":"string","format":"uri"},{"type":"string","enum":[""]}]},"development_auth_token":{"type":"string"},"title":{"type":"string"}},"required":["server_name","server_url","auth_type"]}}},"required":true},"security":[{"bearerAuth":[]}],"responses":{"201":{"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}-[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)$"},"server_name":{"type":"string"},"server_url":{"type":"string"},"auth_type":{"type":"string","enum":["none","bearer","api_key","oauth2"]},"oauth2_credential_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)$"},"staging_oauth2_credential_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)$"},"development_oauth2_credential_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)$"},"auth_header_name":{"type":"string"},"custom_headers":{"type":"object","additionalProperties":{"type":"string"}},"staging_server_url":{"type":"string"},"development_server_url":{"type":"string"},"tools":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"input_schema":{}},"required":["name"],"additionalProperties":false}},"last_connected_at":{"type":"string"},"title":{"type":"string"},"timestamp":{"type":"string"}},"required":["id","server_name","server_url","auth_type","tools","last_connected_at","title","timestamp"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/mcp/{mcpId}/refresh":{"post":{"summary":"Refresh MCP server tools","tags":["MCP Servers"],"description":"Re-connects to an existing MCP server and refreshes the list of discovered tools.","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":"mcpId","required":true}],"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}-[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)$"},"server_name":{"type":"string"},"server_url":{"type":"string"},"auth_type":{"type":"string","enum":["none","bearer","api_key","oauth2"]},"oauth2_credential_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)$"},"staging_oauth2_credential_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)$"},"development_oauth2_credential_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)$"},"auth_header_name":{"type":"string"},"custom_headers":{"type":"object","additionalProperties":{"type":"string"}},"staging_server_url":{"type":"string"},"development_server_url":{"type":"string"},"tools":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"input_schema":{}},"required":["name"],"additionalProperties":false}},"last_connected_at":{"type":"string"},"title":{"type":"string"},"timestamp":{"type":"string"}},"required":["id","server_name","server_url","auth_type","tools","last_connected_at","title","timestamp"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/mcp/authorized-orgs":{"get":{"summary":"List authorized organizations","tags":["MCP Servers"],"description":"Returns the organizations this MCP token is authorized to act on.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"orgs":{"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)$"},"slug":{"type":"string"},"name":{"type":"string"}},"required":["id","slug","name"],"additionalProperties":false}}},"required":["orgs"],"additionalProperties":false}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/nodes/{node_id}/northstars":{"get":{"summary":"List northstars for a prompt node","tags":["Northstars"],"description":"Returns all northstars for a prompt node along with AI generation and coverage assessment statuses.","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":"node_id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"array","items":{"type":"object","additionalProperties":{}}},"category":{"type":"string"},"category_config":{"nullable":true},"enabled":{"type":"boolean"},"priority":{"type":"string"},"positive_examples":{"type":"array","items":{"type":"object","additionalProperties":{}}},"negative_examples":{"type":"array","items":{"type":"object","additionalProperties":{}}},"node_ids":{"nullable":true,"type":"array","items":{"type":"string"}},"agent_id":{"nullable":true,"type":"string"},"org_id":{"type":"string"},"workflow_id":{"nullable":true,"type":"string"},"version_id":{"nullable":true,"type":"string"},"prompt_node_id":{"nullable":true,"type":"string"},"prompt_component_id":{"nullable":true,"type":"string"},"folder_id":{"nullable":true,"type":"string"},"regenerated_from_northstar_id":{"nullable":true,"type":"string"},"is_deleted":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"user_feedback":{"nullable":true,"type":"object","properties":{"id":{"type":"string"},"northstar_id":{"type":"string"},"correctness":{"type":"number"},"feedback":{"nullable":true,"type":"string"},"created_at":{"type":"string"},"created_by":{"nullable":true,"type":"string"},"created_by_api_key":{"nullable":true,"type":"string"}},"required":["id","northstar_id","correctness","created_at"],"additionalProperties":false}},"required":["id","name","description","category","category_config","enabled","priority","positive_examples","negative_examples","node_ids","agent_id","org_id","workflow_id","version_id","prompt_node_id","prompt_component_id","folder_id","regenerated_from_northstar_id","is_deleted","created_at","updated_at"],"additionalProperties":false}},"folders":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}},"generation_status":{"nullable":true,"type":"string","enum":["in_progress","completed","error"]},"coverage_assessment_status":{"nullable":true,"type":"string","enum":["in_progress","completed","error"]}},"required":["data","folders","generation_status","coverage_assessment_status"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}},"post":{"summary":"Create a northstar for a prompt node","tags":["Northstars"],"description":"Create a new northstar evaluation criterion for this prompt node.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"description":{"type":"array","items":{"type":"object","additionalProperties":{}}},"category":{"type":"string","enum":["notes","style","tool","sequential"]},"version_id":{"type":"string","minLength":1,"description":"Version UUID or slug"},"priority":{"type":"string","enum":["low","medium","high"]},"positive_examples":{"type":"array","items":{"type":"object","additionalProperties":{}}},"negative_examples":{"type":"array","items":{"type":"object","additionalProperties":{}}},"category_config":{"type":"object","properties":{"current_stage":{"type":"string","minLength":1},"prerequisite_stage":{"type":"string","minLength":1}},"required":["current_stage","prerequisite_stage"]},"folder_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)$"}},"required":["name","description","category","version_id"]}}},"required":true},"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":"node_id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"northstar":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"array","items":{"type":"object","additionalProperties":{}}},"category":{"type":"string"},"category_config":{"nullable":true},"enabled":{"type":"boolean"},"priority":{"type":"string"},"positive_examples":{"type":"array","items":{"type":"object","additionalProperties":{}}},"negative_examples":{"type":"array","items":{"type":"object","additionalProperties":{}}},"node_ids":{"nullable":true,"type":"array","items":{"type":"string"}},"agent_id":{"nullable":true,"type":"string"},"org_id":{"type":"string"},"workflow_id":{"nullable":true,"type":"string"},"version_id":{"nullable":true,"type":"string"},"prompt_node_id":{"nullable":true,"type":"string"},"prompt_component_id":{"nullable":true,"type":"string"},"folder_id":{"nullable":true,"type":"string"},"regenerated_from_northstar_id":{"nullable":true,"type":"string"},"is_deleted":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"user_feedback":{"nullable":true,"type":"object","properties":{"id":{"type":"string"},"northstar_id":{"type":"string"},"correctness":{"type":"number"},"feedback":{"nullable":true,"type":"string"},"created_at":{"type":"string"},"created_by":{"nullable":true,"type":"string"},"created_by_api_key":{"nullable":true,"type":"string"}},"required":["id","northstar_id","correctness","created_at"],"additionalProperties":false}},"required":["id","name","description","category","category_config","enabled","priority","positive_examples","negative_examples","node_ids","agent_id","org_id","workflow_id","version_id","prompt_node_id","prompt_component_id","folder_id","regenerated_from_northstar_id","is_deleted","created_at","updated_at"],"additionalProperties":false}},"required":["northstar"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/nodes/{node_id}/northstars/generate":{"post":{"summary":"Generate northstars for a prompt node","tags":["Northstars"],"description":"Generate northstars for this node using AI. If northstars already exist they are force-regenerated.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"version_id":{"type":"string","minLength":1,"description":"Version UUID or slug"}},"required":["version_id"]}}},"required":true},"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":"node_id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/nodes/{node_id}/northstars/batch-toggle":{"patch":{"summary":"Batch toggle northstars","tags":["Northstars"],"description":"Enable or disable all northstars for this prompt node at once.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"}},"required":["enabled"]}}},"required":true},"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":"node_id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"updated_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["updated_count"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/nodes/{node_id}/northstars/iterate":{"post":{"summary":"Iterate northstars for a prompt node","tags":["Northstars"],"description":"Rewrite existing northstars to reflect recent changes made to the prompt node.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"version_id":{"type":"string","minLength":1,"description":"Version UUID or slug"}},"required":["version_id"]}}},"required":true},"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":"node_id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/nodes/{node_id}/northstars/assess-coverage":{"post":{"summary":"Assess northstar coverage for a prompt node","tags":["Northstars"],"description":"Trigger an AI assessment of how well current northstars cover the prompt's expected behaviors.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"version_id":{"type":"string","minLength":1,"description":"Version UUID or slug"}},"required":["version_id"]}}},"required":true},"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":"node_id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/nodes/{node_id}/northstars/folders":{"post":{"summary":"Create a northstar folder for a prompt node","tags":["Northstars"],"description":"Create a folder for organizing this prompt node's northstars. File northstars into it via folder_id on create or update.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1}},"required":["name"]}}},"required":true},"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":"node_id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"folder":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}},"required":["folder"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/nodes/{node_id}/custom-evals":{"get":{"summary":"List custom evals for a prompt node","tags":["Custom Evals"],"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":"node_id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"org_id":{"type":"string"},"workflow_id":{"nullable":true,"type":"string"},"prompt_node_id":{"type":"string"},"prompt_node_persistent_id":{"nullable":true,"type":"string"},"name":{"type":"string"},"description":{"nullable":true,"type":"string"},"test_messages":{"type":"array","items":{"type":"object","additionalProperties":{}}},"expected_response":{"nullable":true,"type":"string"},"judge_model":{"nullable":true,"type":"string"},"expected_tool_calls":{"nullable":true,"type":"array","items":{"type":"object","additionalProperties":{}}},"variables":{"type":"object","additionalProperties":{}},"source_run_id":{"nullable":true,"type":"string"},"is_deleted":{"type":"boolean"},"eval_mode":{"type":"string"},"examples":{"type":"array","items":{"type":"object","additionalProperties":{}}},"northstar_ids":{"type":"array","items":{"type":"string"}},"folder_id":{"nullable":true,"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","org_id","workflow_id","prompt_node_id","prompt_node_persistent_id","name","description","test_messages","expected_response","judge_model","expected_tool_calls","variables","source_run_id","is_deleted","eval_mode","examples","northstar_ids","folder_id","created_at","updated_at"],"additionalProperties":false}},"folders":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}}},"required":["data","folders"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}},"post":{"summary":"Create a custom eval for a prompt node","tags":["Custom Evals"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"test_messages":{"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["user","assistant","tool"]},"content":{"type":"string"},"turn_index":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"tool_calls":{"type":"array","items":{"type":"object","properties":{"function":{"type":"object","properties":{"name":{"type":"string"},"arguments":{"type":"string"}},"required":["name","arguments"]},"id":{"type":"string"}},"required":["function"]}},"tool_call_id":{"type":"string"}},"required":["role","content","turn_index"]}},"description":{"type":"string"},"expected_response":{"type":"string"},"judge_model":{"default":"gpt-5.4-nano-medium","type":"string"},"expected_tool_calls":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"args_description":{"type":"object","additionalProperties":{"type":"string"}}},"required":["name"]}},"variables":{"type":"object","additionalProperties":{}},"source_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)$"},"eval_mode":{"type":"string","enum":["custom","northstar"]},"northstar_ids":{"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)$"}}},"required":["name","test_messages"]}}},"required":true},"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":"node_id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"test":{"type":"object","properties":{"id":{"type":"string"},"org_id":{"type":"string"},"workflow_id":{"nullable":true,"type":"string"},"prompt_node_id":{"type":"string"},"prompt_node_persistent_id":{"nullable":true,"type":"string"},"name":{"type":"string"},"description":{"nullable":true,"type":"string"},"test_messages":{"type":"array","items":{"type":"object","additionalProperties":{}}},"expected_response":{"nullable":true,"type":"string"},"judge_model":{"nullable":true,"type":"string"},"expected_tool_calls":{"nullable":true,"type":"array","items":{"type":"object","additionalProperties":{}}},"variables":{"type":"object","additionalProperties":{}},"source_run_id":{"nullable":true,"type":"string"},"is_deleted":{"type":"boolean"},"eval_mode":{"type":"string"},"examples":{"type":"array","items":{"type":"object","additionalProperties":{}}},"northstar_ids":{"type":"array","items":{"type":"string"}},"folder_id":{"nullable":true,"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","org_id","workflow_id","prompt_node_id","prompt_node_persistent_id","name","description","test_messages","expected_response","judge_model","expected_tool_calls","variables","source_run_id","is_deleted","eval_mode","examples","northstar_ids","folder_id","created_at","updated_at"],"additionalProperties":false}},"required":["test"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/nodes/{node_id}/custom-evals/tools":{"get":{"summary":"Get available tools for custom evals","tags":["Custom Evals"],"description":"Available tool/function definitions for this node — for building expected_tool_calls.","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":"node_id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"tools":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"function":{"type":"object","additionalProperties":{}}},"required":["id","name","function"],"additionalProperties":false}}},"required":["tools"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/nodes/{node_id}/custom-evals/default-variables":{"get":{"summary":"Get default variables for custom evals","tags":["Custom Evals"],"description":"Merged default variable values available at runtime (org + use-case + workflow levels).","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":"query","name":"version_id","required":true},{"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":"node_id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"variables":{"type":"object","additionalProperties":{}}},"required":["variables"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/nodes/{node_id}/custom-evals/extract-from-run":{"post":{"summary":"Extract custom eval from a run","tags":["Custom Evals"],"description":"Build a custom eval from an existing run. Auto-extracts messages, variables, and suggests a name.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"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)$"},"message_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)$"}},"required":["run_id","message_id"]}}},"required":true},"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":"node_id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"messages":{"type":"array","items":{"type":"object","additionalProperties":{}}},"variables":{"type":"object","additionalProperties":{}},"suggested_name":{"type":"string"},"source_run_id":{"type":"string"},"navigation_info":{"type":"object","properties":{"prompt_node_id":{"type":"string"},"workflow_id":{"type":"string"}},"required":["prompt_node_id","workflow_id"],"additionalProperties":false}},"required":["messages","variables","suggested_name","source_run_id","navigation_info"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/nodes/{node_id}/custom-evals/folders":{"post":{"summary":"Create a custom eval folder for a prompt node","tags":["Custom Evals"],"description":"Create a folder for organizing this prompt node's custom evals. File evals into it via folder_id on update.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1}},"required":["name"]}}},"required":true},"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":"node_id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"folder":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}},"required":["folder"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/nodes/{node_id}/adversarial-tests":{"get":{"summary":"List adversarial tests for a node","tags":["Adversarial Tests"],"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":"query","name":"version_id","required":false},{"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":"node_id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"org_id":{"type":"string"},"workflow_id":{"type":"string"},"agent_node_id":{"type":"string"},"agent_node_persistent_id":{"type":"string"},"suite_id":{"nullable":true,"type":"string"},"folder_id":{"nullable":true,"type":"string"},"name":{"type":"string"},"description":{"nullable":true,"type":"string"},"is_deleted":{"type":"boolean"},"adversarial_prompt":{"type":"string"},"adversarial_model":{"type":"string"},"variables":{"type":"object","additionalProperties":{}},"template_variables":{"nullable":true,"type":"array","items":{"type":"object","additionalProperties":{}}},"graph_path":{"nullable":true,"type":"array","items":{"type":"string"}},"timeout_seconds":{"type":"number"},"scope_mode":{"type":"string","enum":["all","by_category"]},"scoped_categories":{"nullable":true,"type":"array","items":{"type":"string","enum":["notes","style","contradiction","tool","sequential"]}},"created_by":{"nullable":true,"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","org_id","workflow_id","agent_node_id","agent_node_persistent_id","name","description","is_deleted","adversarial_prompt","adversarial_model","variables","timeout_seconds","scope_mode","scoped_categories","created_by","created_at","updated_at"],"additionalProperties":false}},"folders":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}}},"required":["data","folders"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}},"post":{"summary":"Create an adversarial test for a node","tags":["Adversarial Tests"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"adversarial_prompt":{"type":"string","minLength":1},"description":{"type":"string"},"adversarial_model":{"type":"string"},"variables":{"type":"object","additionalProperties":{}},"timeout_seconds":{"type":"integer","exclusiveMinimum":true,"maximum":9007199254740991},"scope_mode":{"type":"string","enum":["all","by_category"]},"scoped_categories":{"minItems":1,"type":"array","items":{"type":"string","enum":["notes","style","tool","sequential"]}}},"required":["name","adversarial_prompt"]}}},"required":true},"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":"node_id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"test":{"type":"object","properties":{"id":{"type":"string"},"org_id":{"type":"string"},"workflow_id":{"type":"string"},"agent_node_id":{"type":"string"},"agent_node_persistent_id":{"type":"string"},"suite_id":{"nullable":true,"type":"string"},"folder_id":{"nullable":true,"type":"string"},"name":{"type":"string"},"description":{"nullable":true,"type":"string"},"is_deleted":{"type":"boolean"},"adversarial_prompt":{"type":"string"},"adversarial_model":{"type":"string"},"variables":{"type":"object","additionalProperties":{}},"template_variables":{"nullable":true,"type":"array","items":{"type":"object","additionalProperties":{}}},"graph_path":{"nullable":true,"type":"array","items":{"type":"string"}},"timeout_seconds":{"type":"number"},"scope_mode":{"type":"string","enum":["all","by_category"]},"scoped_categories":{"nullable":true,"type":"array","items":{"type":"string","enum":["notes","style","contradiction","tool","sequential"]}},"created_by":{"nullable":true,"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","org_id","workflow_id","agent_node_id","agent_node_persistent_id","name","description","is_deleted","adversarial_prompt","adversarial_model","variables","timeout_seconds","scope_mode","scoped_categories","created_by","created_at","updated_at"],"additionalProperties":false}},"required":["test"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/nodes/{node_id}/adversarial-tests/folders":{"post":{"summary":"Create an adversarial folder for an agent node","tags":["Adversarial Tests"],"description":"Create a folder for organizing this agent node's adversarial tests and suites. File them into it via folder_id on update.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1}},"required":["name"]}}},"required":true},"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":"node_id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"folder":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}},"required":["folder"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/nodes/{node_id}/adversarial-suites":{"get":{"summary":"List adversarial suites for a node","tags":["Adversarial Suites"],"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":"query","name":"version_id","required":false},{"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":"node_id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"org_id":{"type":"string"},"workflow_id":{"type":"string"},"agent_node_id":{"type":"string"},"agent_node_persistent_id":{"type":"string"},"folder_id":{"nullable":true,"type":"string"},"name":{"type":"string"},"is_deleted":{"type":"boolean"},"adversarial_model":{"type":"string"},"timeout_seconds":{"type":"number"},"generation_prompt":{"type":"string"},"generation_count":{"type":"number"},"generation_status":{"type":"string"},"generation_error":{"nullable":true,"type":"string"},"scope_mode":{"type":"string","enum":["all","by_category"]},"scoped_categories":{"nullable":true,"type":"array","items":{"type":"string","enum":["notes","style","contradiction","tool","sequential"]}},"created_by":{"nullable":true,"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","org_id","workflow_id","agent_node_id","agent_node_persistent_id","name","is_deleted","adversarial_model","timeout_seconds","generation_prompt","generation_count","generation_status","scope_mode","scoped_categories","created_by","created_at","updated_at"],"additionalProperties":false}},"folders":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}}},"required":["data","folders"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}},"post":{"summary":"Create an adversarial suite for a node","tags":["Adversarial Suites"],"description":"Create a suite. The generation_prompt drives AI auto-generation of individual tests.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"generation_prompt":{"type":"string","minLength":1},"adversarial_model":{"type":"string"},"timeout_seconds":{"type":"integer","exclusiveMinimum":true,"maximum":9007199254740991},"generation_count":{"type":"integer","exclusiveMinimum":true,"maximum":9007199254740991},"scope_mode":{"type":"string","enum":["all","by_category"]},"scoped_categories":{"minItems":1,"type":"array","items":{"type":"string","enum":["notes","style","tool","sequential"]}}},"required":["name","generation_prompt"]}}},"required":true},"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":"node_id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"suite":{"type":"object","properties":{"id":{"type":"string"},"org_id":{"type":"string"},"workflow_id":{"type":"string"},"agent_node_id":{"type":"string"},"agent_node_persistent_id":{"type":"string"},"folder_id":{"nullable":true,"type":"string"},"name":{"type":"string"},"is_deleted":{"type":"boolean"},"adversarial_model":{"type":"string"},"timeout_seconds":{"type":"number"},"generation_prompt":{"type":"string"},"generation_count":{"type":"number"},"generation_status":{"type":"string"},"generation_error":{"nullable":true,"type":"string"},"scope_mode":{"type":"string","enum":["all","by_category"]},"scoped_categories":{"nullable":true,"type":"array","items":{"type":"string","enum":["notes","style","contradiction","tool","sequential"]}},"created_by":{"nullable":true,"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","org_id","workflow_id","agent_node_id","agent_node_persistent_id","name","is_deleted","adversarial_model","timeout_seconds","generation_prompt","generation_count","generation_status","scope_mode","scoped_categories","created_by","created_at","updated_at"],"additionalProperties":false}},"required":["suite"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/northstars/{northstar_id}":{"get":{"summary":"Get a northstar by ID","tags":["Northstars"],"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":"northstar_id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"northstar":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"array","items":{"type":"object","additionalProperties":{}}},"category":{"type":"string"},"category_config":{"nullable":true},"enabled":{"type":"boolean"},"priority":{"type":"string"},"positive_examples":{"type":"array","items":{"type":"object","additionalProperties":{}}},"negative_examples":{"type":"array","items":{"type":"object","additionalProperties":{}}},"node_ids":{"nullable":true,"type":"array","items":{"type":"string"}},"agent_id":{"nullable":true,"type":"string"},"org_id":{"type":"string"},"workflow_id":{"nullable":true,"type":"string"},"version_id":{"nullable":true,"type":"string"},"prompt_node_id":{"nullable":true,"type":"string"},"prompt_component_id":{"nullable":true,"type":"string"},"folder_id":{"nullable":true,"type":"string"},"regenerated_from_northstar_id":{"nullable":true,"type":"string"},"is_deleted":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"user_feedback":{"nullable":true,"type":"object","properties":{"id":{"type":"string"},"northstar_id":{"type":"string"},"correctness":{"type":"number"},"feedback":{"nullable":true,"type":"string"},"created_at":{"type":"string"},"created_by":{"nullable":true,"type":"string"},"created_by_api_key":{"nullable":true,"type":"string"}},"required":["id","northstar_id","correctness","created_at"],"additionalProperties":false}},"required":["id","name","description","category","category_config","enabled","priority","positive_examples","negative_examples","node_ids","agent_id","org_id","workflow_id","version_id","prompt_node_id","prompt_component_id","folder_id","regenerated_from_northstar_id","is_deleted","created_at","updated_at"],"additionalProperties":false}},"required":["northstar"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}},"patch":{"summary":"Update a northstar","tags":["Northstars"],"description":"Update any subset of: name, description, category, examples, enabled state, priority, or folder_id.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"description":{"type":"array","items":{"type":"object","additionalProperties":{}}},"category":{"type":"string","enum":["notes","style","contradiction","tool","sequential"]},"enabled":{"type":"boolean"},"priority":{"type":"string","enum":["low","medium","high"]},"positive_examples":{"type":"array","items":{"type":"object","additionalProperties":{}}},"negative_examples":{"type":"array","items":{"type":"object","additionalProperties":{}}},"category_config":{"nullable":true,"type":"object","properties":{"current_stage":{"type":"string","minLength":1},"prerequisite_stage":{"type":"string","minLength":1}},"required":["current_stage","prerequisite_stage"]},"folder_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)$"}}}}}},"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":"northstar_id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"northstar":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"array","items":{"type":"object","additionalProperties":{}}},"category":{"type":"string"},"category_config":{"nullable":true},"enabled":{"type":"boolean"},"priority":{"type":"string"},"positive_examples":{"type":"array","items":{"type":"object","additionalProperties":{}}},"negative_examples":{"type":"array","items":{"type":"object","additionalProperties":{}}},"node_ids":{"nullable":true,"type":"array","items":{"type":"string"}},"agent_id":{"nullable":true,"type":"string"},"org_id":{"type":"string"},"workflow_id":{"nullable":true,"type":"string"},"version_id":{"nullable":true,"type":"string"},"prompt_node_id":{"nullable":true,"type":"string"},"prompt_component_id":{"nullable":true,"type":"string"},"folder_id":{"nullable":true,"type":"string"},"regenerated_from_northstar_id":{"nullable":true,"type":"string"},"is_deleted":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"user_feedback":{"nullable":true,"type":"object","properties":{"id":{"type":"string"},"northstar_id":{"type":"string"},"correctness":{"type":"number"},"feedback":{"nullable":true,"type":"string"},"created_at":{"type":"string"},"created_by":{"nullable":true,"type":"string"},"created_by_api_key":{"nullable":true,"type":"string"}},"required":["id","northstar_id","correctness","created_at"],"additionalProperties":false}},"required":["id","name","description","category","category_config","enabled","priority","positive_examples","negative_examples","node_ids","agent_id","org_id","workflow_id","version_id","prompt_node_id","prompt_component_id","folder_id","regenerated_from_northstar_id","is_deleted","created_at","updated_at"],"additionalProperties":false}},"required":["northstar"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}},"delete":{"summary":"Delete a northstar","tags":["Northstars"],"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":"northstar_id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/northstars/{northstar_id}/history":{"get":{"summary":"Get northstar history","tags":["Northstars"],"description":"Fetch the full regeneration chain — every version this northstar was derived from, oldest first.","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":"northstar_id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"history":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"array","items":{"type":"object","additionalProperties":{}}},"category":{"type":"string"},"category_config":{"nullable":true},"enabled":{"type":"boolean"},"priority":{"type":"string"},"positive_examples":{"type":"array","items":{"type":"object","additionalProperties":{}}},"negative_examples":{"type":"array","items":{"type":"object","additionalProperties":{}}},"node_ids":{"nullable":true,"type":"array","items":{"type":"string"}},"agent_id":{"nullable":true,"type":"string"},"org_id":{"type":"string"},"workflow_id":{"nullable":true,"type":"string"},"version_id":{"nullable":true,"type":"string"},"prompt_node_id":{"nullable":true,"type":"string"},"prompt_component_id":{"nullable":true,"type":"string"},"folder_id":{"nullable":true,"type":"string"},"regenerated_from_northstar_id":{"nullable":true,"type":"string"},"is_deleted":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"user_feedback":{"nullable":true,"type":"object","properties":{"id":{"type":"string"},"northstar_id":{"type":"string"},"correctness":{"type":"number"},"feedback":{"nullable":true,"type":"string"},"created_at":{"type":"string"},"created_by":{"nullable":true,"type":"string"},"created_by_api_key":{"nullable":true,"type":"string"}},"required":["id","northstar_id","correctness","created_at"],"additionalProperties":false}},"required":["id","name","description","category","category_config","enabled","priority","positive_examples","negative_examples","node_ids","agent_id","org_id","workflow_id","version_id","prompt_node_id","prompt_component_id","folder_id","regenerated_from_northstar_id","is_deleted","created_at","updated_at"],"additionalProperties":false}}},"required":["history"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/northstars/{northstar_id}/feedback":{"post":{"summary":"Submit northstar feedback","tags":["Northstars"],"description":"Submit a correctness rating (-2 = strongly wrong, +2 = strongly correct). One entry per API key/user.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"correctness":{"type":"integer","minimum":-2,"maximum":2},"feedback":{"type":"string"},"trigger_regeneration":{"type":"boolean"}},"required":["correctness"]}}},"required":true},"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":"northstar_id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"feedback":{"type":"object","properties":{"id":{"type":"string"},"correctness":{"type":"number"},"feedback":{"nullable":true,"type":"string"},"created_at":{"type":"string"}},"required":["id","correctness","created_at"],"additionalProperties":false}},"required":["feedback"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}},"delete":{"summary":"Delete northstar feedback","tags":["Northstars"],"description":"Remove your feedback on a northstar.","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":"northstar_id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/custom-evals/{eval_id}":{"get":{"summary":"Get a custom eval by ID","tags":["Custom Evals"],"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":"eval_id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"test":{"type":"object","properties":{"id":{"type":"string"},"org_id":{"type":"string"},"workflow_id":{"nullable":true,"type":"string"},"prompt_node_id":{"type":"string"},"prompt_node_persistent_id":{"nullable":true,"type":"string"},"name":{"type":"string"},"description":{"nullable":true,"type":"string"},"test_messages":{"type":"array","items":{"type":"object","additionalProperties":{}}},"expected_response":{"nullable":true,"type":"string"},"judge_model":{"nullable":true,"type":"string"},"expected_tool_calls":{"nullable":true,"type":"array","items":{"type":"object","additionalProperties":{}}},"variables":{"type":"object","additionalProperties":{}},"source_run_id":{"nullable":true,"type":"string"},"is_deleted":{"type":"boolean"},"eval_mode":{"type":"string"},"examples":{"type":"array","items":{"type":"object","additionalProperties":{}}},"northstar_ids":{"type":"array","items":{"type":"string"}},"folder_id":{"nullable":true,"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","org_id","workflow_id","prompt_node_id","prompt_node_persistent_id","name","description","test_messages","expected_response","judge_model","expected_tool_calls","variables","source_run_id","is_deleted","eval_mode","examples","northstar_ids","folder_id","created_at","updated_at"],"additionalProperties":false}},"required":["test"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}},"patch":{"summary":"Update a custom eval","tags":["Custom Evals"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"description":{"type":"string"},"test_messages":{"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["user","assistant","tool"]},"content":{"type":"string"},"turn_index":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"tool_calls":{"type":"array","items":{"type":"object","properties":{"function":{"type":"object","properties":{"name":{"type":"string"},"arguments":{"type":"string"}},"required":["name","arguments"]},"id":{"type":"string"}},"required":["function"]}},"tool_call_id":{"type":"string"}},"required":["role","content","turn_index"]}},"expected_response":{"type":"string"},"judge_model":{"nullable":true,"type":"string"},"expected_tool_calls":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"args_description":{"type":"object","additionalProperties":{"type":"string"}}},"required":["name"]}},"variables":{"type":"object","additionalProperties":{}},"eval_mode":{"type":"string","enum":["custom","northstar"]},"northstar_ids":{"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)$"}},"folder_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)$"}}}}}},"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":"eval_id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"test":{"type":"object","properties":{"id":{"type":"string"},"org_id":{"type":"string"},"workflow_id":{"nullable":true,"type":"string"},"prompt_node_id":{"type":"string"},"prompt_node_persistent_id":{"nullable":true,"type":"string"},"name":{"type":"string"},"description":{"nullable":true,"type":"string"},"test_messages":{"type":"array","items":{"type":"object","additionalProperties":{}}},"expected_response":{"nullable":true,"type":"string"},"judge_model":{"nullable":true,"type":"string"},"expected_tool_calls":{"nullable":true,"type":"array","items":{"type":"object","additionalProperties":{}}},"variables":{"type":"object","additionalProperties":{}},"source_run_id":{"nullable":true,"type":"string"},"is_deleted":{"type":"boolean"},"eval_mode":{"type":"string"},"examples":{"type":"array","items":{"type":"object","additionalProperties":{}}},"northstar_ids":{"type":"array","items":{"type":"string"}},"folder_id":{"nullable":true,"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","org_id","workflow_id","prompt_node_id","prompt_node_persistent_id","name","description","test_messages","expected_response","judge_model","expected_tool_calls","variables","source_run_id","is_deleted","eval_mode","examples","northstar_ids","folder_id","created_at","updated_at"],"additionalProperties":false}},"required":["test"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}},"delete":{"summary":"Delete a custom eval","tags":["Custom Evals"],"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":"eval_id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/custom-evals/{eval_id}/run":{"post":{"summary":"Run a custom eval","tags":["Custom Evals"],"description":"Execute the eval asynchronously. Poll /custom-evals/:eval_id/runs for results.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"version_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)$"}},"required":["version_id"]}}},"required":true},"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":"eval_id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"202":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"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)$"}},"required":["run_id"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/custom-evals/{eval_id}/runs":{"get":{"summary":"List custom eval runs","tags":["Custom Evals"],"parameters":[{"schema":{"default":20,"type":"integer","exclusiveMinimum":true,"maximum":100},"in":"query","name":"limit","required":false},{"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":"eval_id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"runs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"custom_test_id":{"type":"string"},"input_messages":{"type":"array","items":{"type":"object","additionalProperties":{}}},"output_messages":{"type":"array","items":{"type":"object","additionalProperties":{}}},"actual_tool_calls":{"nullable":true,"type":"array","items":{"type":"object","additionalProperties":{}}},"passed":{"nullable":true,"type":"boolean"},"judge_reasoning":{"nullable":true,"type":"string"},"tool_calls_matched":{"nullable":true,"type":"boolean"},"version_id":{"nullable":true,"type":"string"},"version_name":{"nullable":true,"type":"string"},"version_number":{"nullable":true,"type":"number"},"created_at":{"type":"string"}},"required":["id","custom_test_id","input_messages","output_messages","actual_tool_calls","passed","version_id","created_at"],"additionalProperties":false}}},"required":["runs"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/adversarial-tests/{test_id}":{"get":{"summary":"Get an adversarial test by ID","tags":["Adversarial Tests"],"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":"test_id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"test":{"type":"object","properties":{"id":{"type":"string"},"org_id":{"type":"string"},"workflow_id":{"type":"string"},"agent_node_id":{"type":"string"},"agent_node_persistent_id":{"type":"string"},"suite_id":{"nullable":true,"type":"string"},"folder_id":{"nullable":true,"type":"string"},"name":{"type":"string"},"description":{"nullable":true,"type":"string"},"is_deleted":{"type":"boolean"},"adversarial_prompt":{"type":"string"},"adversarial_model":{"type":"string"},"variables":{"type":"object","additionalProperties":{}},"template_variables":{"nullable":true,"type":"array","items":{"type":"object","additionalProperties":{}}},"graph_path":{"nullable":true,"type":"array","items":{"type":"string"}},"timeout_seconds":{"type":"number"},"scope_mode":{"type":"string","enum":["all","by_category"]},"scoped_categories":{"nullable":true,"type":"array","items":{"type":"string","enum":["notes","style","contradiction","tool","sequential"]}},"created_by":{"nullable":true,"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","org_id","workflow_id","agent_node_id","agent_node_persistent_id","name","description","is_deleted","adversarial_prompt","adversarial_model","variables","timeout_seconds","scope_mode","scoped_categories","created_by","created_at","updated_at"],"additionalProperties":false}},"required":["test"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}},"patch":{"summary":"Update an adversarial test","tags":["Adversarial Tests"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"description":{"type":"string"},"adversarial_prompt":{"type":"string"},"adversarial_model":{"type":"string"},"variables":{"type":"object","additionalProperties":{}},"timeout_seconds":{"type":"integer","exclusiveMinimum":true,"maximum":9007199254740991},"scope_mode":{"type":"string","enum":["all","by_category"]},"scoped_categories":{"minItems":1,"type":"array","items":{"type":"string","enum":["notes","style","tool","sequential"]}},"folder_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)$"}}}}}},"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":"test_id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"test":{"type":"object","properties":{"id":{"type":"string"},"org_id":{"type":"string"},"workflow_id":{"type":"string"},"agent_node_id":{"type":"string"},"agent_node_persistent_id":{"type":"string"},"suite_id":{"nullable":true,"type":"string"},"folder_id":{"nullable":true,"type":"string"},"name":{"type":"string"},"description":{"nullable":true,"type":"string"},"is_deleted":{"type":"boolean"},"adversarial_prompt":{"type":"string"},"adversarial_model":{"type":"string"},"variables":{"type":"object","additionalProperties":{}},"template_variables":{"nullable":true,"type":"array","items":{"type":"object","additionalProperties":{}}},"graph_path":{"nullable":true,"type":"array","items":{"type":"string"}},"timeout_seconds":{"type":"number"},"scope_mode":{"type":"string","enum":["all","by_category"]},"scoped_categories":{"nullable":true,"type":"array","items":{"type":"string","enum":["notes","style","contradiction","tool","sequential"]}},"created_by":{"nullable":true,"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","org_id","workflow_id","agent_node_id","agent_node_persistent_id","name","description","is_deleted","adversarial_prompt","adversarial_model","variables","timeout_seconds","scope_mode","scoped_categories","created_by","created_at","updated_at"],"additionalProperties":false}},"required":["test"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}},"delete":{"summary":"Delete an adversarial test","tags":["Adversarial Tests"],"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":"test_id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/adversarial-tests/{test_id}/run":{"post":{"summary":"Run an adversarial test","tags":["Adversarial Tests"],"description":"Execute the adversarial test asynchronously. Poll /adversarial-tests/:test_id/runs for results.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"version_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)$"},"variables":{"type":"object","additionalProperties":{}}},"required":["version_id"]}}},"required":true},"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":"test_id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"202":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"test_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)$"}},"required":["test_run_id"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/adversarial-tests/{test_id}/runs":{"get":{"summary":"List adversarial test runs","tags":["Adversarial Tests"],"parameters":[{"schema":{"default":20,"type":"integer","exclusiveMinimum":true,"maximum":100},"in":"query","name":"limit","required":false},{"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":"test_id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"runs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"adversarial_test_id":{"type":"string"},"status":{"type":"string"},"audit_remarks":{"type":"array","items":{"type":"object","properties":{"northstar_id":{"type":"string"},"grade":{"type":"string","enum":["passed","failed","not_applicable"]},"correction":{"type":"string"},"correction_reason":{"type":"string"},"model":{"type":"string"}},"required":["northstar_id","grade","correction_reason","model"],"additionalProperties":false}},"started_at":{"nullable":true,"type":"string"},"completed_at":{"nullable":true,"type":"string"},"version_id":{"nullable":true,"type":"string"},"version_name":{"nullable":true,"type":"string"},"version_number":{"nullable":true,"type":"number"},"created_at":{"type":"string"}},"required":["id","adversarial_test_id","status","audit_remarks","started_at","completed_at","created_at"],"additionalProperties":false}}},"required":["runs"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/adversarial-tests/runs/{run_id}":{"get":{"summary":"Get adversarial test run by ID","tags":["Adversarial Tests"],"description":"Full status and audit remarks for a single test run.","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":"run_id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"run":{"type":"object","properties":{"id":{"type":"string"},"adversarial_test_id":{"type":"string"},"status":{"type":"string"},"audit_remarks":{"type":"array","items":{"type":"object","properties":{"northstar_id":{"type":"string"},"grade":{"type":"string","enum":["passed","failed","not_applicable"]},"correction":{"type":"string"},"correction_reason":{"type":"string"},"model":{"type":"string"}},"required":["northstar_id","grade","correction_reason","model"],"additionalProperties":false}},"started_at":{"nullable":true,"type":"string"},"completed_at":{"nullable":true,"type":"string"},"version_id":{"nullable":true,"type":"string"},"version_name":{"nullable":true,"type":"string"},"version_number":{"nullable":true,"type":"number"},"created_at":{"type":"string"}},"required":["id","adversarial_test_id","status","audit_remarks","started_at","completed_at","created_at"],"additionalProperties":false}},"required":["run"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/adversarial-tests/runs/{run_id}/messages":{"get":{"summary":"Get adversarial test run messages","tags":["Adversarial Tests"],"description":"The full conversation that took place during this adversarial test run.","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":"run_id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"messages":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["new_message"]},"message":{"type":"object","properties":{"role":{"type":"string"},"content":{"type":"string"}},"required":["role","content"],"additionalProperties":false}},"required":["type","message"],"additionalProperties":false}}},"required":["messages"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/adversarial-tests/{test_id}/effective-scope":{"get":{"summary":"Get the resolved audit scope for an adversarial test","tags":["Adversarial Tests"],"description":"Returns the northstar categories that BEA will grade against when this test runs. Generated tests inherit the suite's scope; standalone tests carry their own. Use this to display 'currently grading against tags: [...]' without re-implementing the resolution.","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":"test_id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"mode":{"type":"string","enum":["all","by_category"]},"categories":{"type":"array","items":{"type":"string","enum":["notes","style","contradiction","tool","sequential"]}},"source":{"type":"string","enum":["test","suite","default"]}},"required":["mode","categories","source"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/adversarial-suites/{suite_id}":{"get":{"summary":"Get an adversarial suite by ID","tags":["Adversarial Suites"],"description":"Returns the suite and the mermaid workflow graph if already generated.","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":"suite_id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"suite":{"type":"object","properties":{"id":{"type":"string"},"org_id":{"type":"string"},"workflow_id":{"type":"string"},"agent_node_id":{"type":"string"},"agent_node_persistent_id":{"type":"string"},"folder_id":{"nullable":true,"type":"string"},"name":{"type":"string"},"is_deleted":{"type":"boolean"},"adversarial_model":{"type":"string"},"timeout_seconds":{"type":"number"},"generation_prompt":{"type":"string"},"generation_count":{"type":"number"},"generation_status":{"type":"string"},"generation_error":{"nullable":true,"type":"string"},"scope_mode":{"type":"string","enum":["all","by_category"]},"scoped_categories":{"nullable":true,"type":"array","items":{"type":"string","enum":["notes","style","contradiction","tool","sequential"]}},"created_by":{"nullable":true,"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","org_id","workflow_id","agent_node_id","agent_node_persistent_id","name","is_deleted","adversarial_model","timeout_seconds","generation_prompt","generation_count","generation_status","scope_mode","scoped_categories","created_by","created_at","updated_at"],"additionalProperties":false},"workflow_graph_mermaid":{"nullable":true,"type":"string"}},"required":["suite"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}},"patch":{"summary":"Update an adversarial suite","tags":["Adversarial Suites"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"adversarial_model":{"type":"string"},"timeout_seconds":{"type":"integer","exclusiveMinimum":true,"maximum":9007199254740991},"generation_prompt":{"type":"string"},"generation_count":{"type":"integer","exclusiveMinimum":true,"maximum":9007199254740991},"scope_mode":{"type":"string","enum":["all","by_category"]},"scoped_categories":{"minItems":1,"type":"array","items":{"type":"string","enum":["notes","style","tool","sequential"]}},"folder_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)$"}}}}}},"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":"suite_id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"suite":{"type":"object","properties":{"id":{"type":"string"},"org_id":{"type":"string"},"workflow_id":{"type":"string"},"agent_node_id":{"type":"string"},"agent_node_persistent_id":{"type":"string"},"folder_id":{"nullable":true,"type":"string"},"name":{"type":"string"},"is_deleted":{"type":"boolean"},"adversarial_model":{"type":"string"},"timeout_seconds":{"type":"number"},"generation_prompt":{"type":"string"},"generation_count":{"type":"number"},"generation_status":{"type":"string"},"generation_error":{"nullable":true,"type":"string"},"scope_mode":{"type":"string","enum":["all","by_category"]},"scoped_categories":{"nullable":true,"type":"array","items":{"type":"string","enum":["notes","style","contradiction","tool","sequential"]}},"created_by":{"nullable":true,"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","org_id","workflow_id","agent_node_id","agent_node_persistent_id","name","is_deleted","adversarial_model","timeout_seconds","generation_prompt","generation_count","generation_status","scope_mode","scoped_categories","created_by","created_at","updated_at"],"additionalProperties":false}},"required":["suite"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}},"delete":{"summary":"Delete an adversarial suite","tags":["Adversarial Suites"],"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":"suite_id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/adversarial-suites/{suite_id}/generate":{"post":{"summary":"Generate adversarial suite tests","tags":["Adversarial Suites"],"description":"Auto-generate individual adversarial tests from the suite's generation_prompt using AI.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"version_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)$"},"variables":{"type":"object","additionalProperties":{}}}}}}},"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":"suite_id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["in_progress"]}},"required":["status"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/adversarial-suites/{suite_id}/generate-graph":{"post":{"summary":"Generate adversarial suite workflow graph","tags":["Adversarial Suites"],"description":"Generate a mermaid workflow graph visualizing the test paths in this suite.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"version_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)$"}},"required":["version_id"]}}},"required":true},"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":"suite_id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]},"error":{"type":"string"}},"required":["status"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/adversarial-suites/{suite_id}/run":{"post":{"summary":"Run an adversarial suite","tags":["Adversarial Suites"],"description":"Execute all tests in the suite asynchronously.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"version_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)$"}},"required":["version_id"]}}},"required":true},"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":"suite_id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"202":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"suite_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)$"}},"required":["suite_run_id"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/adversarial-suites/{suite_id}/runs":{"get":{"summary":"List adversarial suite runs","tags":["Adversarial Suites"],"parameters":[{"schema":{"default":20,"type":"integer","exclusiveMinimum":true,"maximum":100},"in":"query","name":"limit","required":false},{"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":"suite_id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"runs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"suite_id":{"type":"string"},"status":{"type":"string"},"total_tests":{"type":"number"},"completed_tests":{"type":"number"},"passed_tests":{"type":"number"},"failed_tests":{"type":"number"},"workflow_id":{"nullable":true,"type":"string"},"version_id":{"nullable":true,"type":"string"},"version_name":{"nullable":true,"type":"string"},"version_number":{"nullable":true,"type":"number"},"started_at":{"nullable":true,"type":"string"},"completed_at":{"nullable":true,"type":"string"},"created_at":{"type":"string"}},"required":["id","suite_id","status","total_tests","completed_tests","passed_tests","failed_tests","started_at","completed_at","created_at"],"additionalProperties":false}}},"required":["runs"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/adversarial-suites/runs/{suite_run_id}":{"get":{"summary":"Get adversarial suite run by ID","tags":["Adversarial Suites"],"description":"Full status and aggregate counts for a suite run.","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":"suite_run_id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"run":{"type":"object","properties":{"id":{"type":"string"},"suite_id":{"type":"string"},"status":{"type":"string"},"total_tests":{"type":"number"},"completed_tests":{"type":"number"},"passed_tests":{"type":"number"},"failed_tests":{"type":"number"},"workflow_id":{"nullable":true,"type":"string"},"version_id":{"nullable":true,"type":"string"},"version_name":{"nullable":true,"type":"string"},"version_number":{"nullable":true,"type":"number"},"started_at":{"nullable":true,"type":"string"},"completed_at":{"nullable":true,"type":"string"},"created_at":{"type":"string"}},"required":["id","suite_id","status","total_tests","completed_tests","passed_tests","failed_tests","started_at","completed_at","created_at"],"additionalProperties":false}},"required":["run"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/adversarial-suites/runs/{suite_run_id}/test-runs":{"get":{"summary":"List test runs in a suite run","tags":["Adversarial Suites"],"description":"All individual adversarial test results within this suite run.","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":"suite_run_id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"test_runs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"test_name":{"type":"string"},"status":{"type":"string"},"audit_remarks":{"type":"array","items":{"type":"object","properties":{"northstar_id":{"type":"string"},"grade":{"type":"string","enum":["passed","failed","not_applicable"]},"correction":{"type":"string"},"correction_reason":{"type":"string"},"model":{"type":"string"}},"required":["northstar_id","grade","correction_reason","model"],"additionalProperties":false}},"started_at":{"nullable":true,"type":"string"},"completed_at":{"nullable":true,"type":"string"},"created_at":{"type":"string"}},"required":["id","test_name","status","audit_remarks","started_at","completed_at","created_at"],"additionalProperties":false}}},"required":["test_runs"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/audit-remarks/{audit_remark_id}":{"get":{"summary":"Get an audit remark by ID","tags":["Audits"],"description":"Returns a single behavioral audit remark, including its northstar criterion, grade, correction, evaluated messages, and status.","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":"audit_remark_id","required":true}],"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}-[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)$"},"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)$"},"run_url":{"type":"string"},"timestamp":{"type":"string"},"updated_at":{"type":"string"},"grade":{"type":"string","enum":["passed","failed","not_applicable"]},"passed":{"nullable":true,"type":"boolean"},"status":{"type":"string","enum":["open","resolved","dismissed"]},"category":{"type":"string"},"northstar_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)$"},"northstar_name":{"type":"string"},"use_case_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)$"},"node_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)$"},"message_ids":{"type":"array","items":{"type":"string"}},"messages":{"type":"array","items":{"type":"object","properties":{"role":{"type":"string"},"content":{"type":"string"}},"required":["role","content"],"additionalProperties":false}},"correction":{"nullable":true,"type":"string"},"correction_reason":{"nullable":true,"type":"string"},"org_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)$"},"user_feedback":{"nullable":true,"type":"object","properties":{"polarity":{"type":"boolean"},"issue_attribution":{"nullable":true,"type":"string"}},"required":["polarity","issue_attribution"],"additionalProperties":false}},"required":["id","run_id","run_url","timestamp","updated_at","grade","status","category","northstar_id","northstar_name","use_case_id","node_id","message_ids","messages","correction","correction_reason","org_id"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/audit-remarks/{audit_remark_id}/feedback":{"post":{"summary":"Submit feedback for an audit remark","tags":["Audits"],"description":"Submit a thumbs up/down for an audit remark. Requires a user-level API key. A thumbs-up automatically adds the remark as a northstar example.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"polarity":{"type":"boolean"},"issue_attribution":{"description":"Attribution when polarity is false","type":"string","enum":["auditor","northstar"]},"comment":{"type":"string"}},"required":["polarity"]}}},"required":true},"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":"audit_remark_id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"201":{"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}-[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)$"},"polarity":{"type":"boolean"},"issue_attribution":{"nullable":true,"type":"string"},"comment":{"nullable":true,"type":"string"},"audit_remark_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)$"},"northstar_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)$"},"created_by":{"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)$"},"created_at":{"type":"string"}},"required":["id","polarity","issue_attribution","comment","audit_remark_id","northstar_id","created_by","created_at"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}},"get":{"summary":"Get feedback for an audit remark","tags":["Audits"],"description":"Returns the current user's feedback for an audit remark, or null if none exists. Requires a user-level API key.","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":"audit_remark_id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"nullable":true,"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)$"},"polarity":{"type":"boolean"},"issue_attribution":{"nullable":true,"type":"string"},"comment":{"nullable":true,"type":"string"},"audit_remark_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)$"},"northstar_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)$"},"created_by":{"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)$"},"created_at":{"type":"string"}},"required":["id","polarity","issue_attribution","comment","audit_remark_id","northstar_id","created_by","created_at"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}},"delete":{"summary":"Delete feedback for an audit remark","tags":["Audits"],"description":"Removes the current user's feedback for an audit remark. Requires a user-level API key.","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":"audit_remark_id","required":true}],"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"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/issues/{issue_id}":{"patch":{"summary":"Update issue status","tags":["Issues"],"description":"Updates the status of a quality issue (flag).","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["open","approved","rejected","closed"]}},"required":["status"]}}},"required":true},"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":"issue_id","required":true}],"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}-[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)$"},"status":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","status","updated_at"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/events/{event_id}/config-schema":{"get":{"summary":"Get config schema for an event","tags":["Events"],"description":"Returns the configuration schema for an event, including field types, required fields, defaults, and available options. Use this to inspect what an event expects before creating a node.","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":"event_id","required":true,"description":"The event ID"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"event_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})$"},"event_name":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/schema0"}},"defaults":{"nullable":true,"type":"object","additionalProperties":{}},"available_options":{"nullable":true,"type":"object","properties":{"models":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"}},"required":["id","name"],"additionalProperties":false}},"phone_numbers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"number":{"type":"string"}},"required":["id","name","number"],"additionalProperties":false}},"voices":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"language":{"type":"string"},"gender":{"type":"string"}},"required":["id","name","language","gender"],"additionalProperties":false}},"languages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}},"credentials":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"}},"required":["id","title"],"additionalProperties":false}}},"additionalProperties":false}},"required":["event_id","event_name","fields","defaults","available_options"],"additionalProperties":false}},"required":["data"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/twin/schema":{"get":{"summary":"Get Twin database schema","tags":["Twin"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"kind":{"type":"string","enum":["table","view"]},"columns":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string"},"isPrimary":{"type":"boolean"}},"required":["name","type","isPrimary"],"additionalProperties":false}}},"required":["name","kind","columns"],"additionalProperties":false}}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/twin/tables":{"post":{"summary":"Create a Twin table","tags":["Twin"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"tableName":{"type":"string"},"columns":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string","enum":["int8","text","boolean","timestamp","uuid","jsonb","float8"]},"defaultValue":{"nullable":true,"type":"string"},"isPrimary":{"type":"boolean"},"isNullable":{"type":"boolean"},"primaryKeyGeneration":{"type":"string","enum":["auto","manual"]}},"required":["name","type","defaultValue","isPrimary"]}}},"required":["tableName","columns"]}}},"required":true},"security":[{"bearerAuth":[]}],"responses":{"201":{"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"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/twin/tables/{tableName}":{"get":{"summary":"Get Twin table data","tags":["Twin"],"parameters":[{"schema":{"default":50,"type":"integer","minimum":1,"maximum":500},"in":"query","name":"limit","required":false},{"schema":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"in":"query","name":"offset","required":false},{"schema":{"type":"string"},"in":"path","name":"tableName","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"tableName":{"type":"string"},"kind":{"type":"string","enum":["table","view"]},"rows":{"type":"array","items":{"type":"object","additionalProperties":{}}},"total":{"type":"number"}},"required":["tableName","kind","rows","total"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}},"delete":{"summary":"Drop a Twin table","tags":["Twin"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tableName","required":true}],"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"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/twin/tables/{tableName}/rows":{"post":{"summary":"Insert a row into a Twin table","tags":["Twin"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"values":{"type":"object","additionalProperties":{"type":"string"}}},"required":["values"]}}},"required":true},"parameters":[{"schema":{"type":"string"},"in":"path","name":"tableName","required":true}],"security":[{"bearerAuth":[]}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}},"patch":{"summary":"Update a row in a Twin table","tags":["Twin"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"primaryKey":{"type":"object","additionalProperties":{}},"updates":{"type":"object","additionalProperties":{}}},"required":["primaryKey","updates"]}}},"required":true},"parameters":[{"schema":{"type":"string"},"in":"path","name":"tableName","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}},"delete":{"summary":"Delete rows from a Twin table","tags":["Twin"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"rowKeys":{"type":"array","items":{"type":"object","additionalProperties":{}}}},"required":["rowKeys"]}}},"required":true},"parameters":[{"schema":{"type":"string"},"in":"path","name":"tableName","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"deletedCount":{"type":"number"}},"required":["deletedCount"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/twin/sql":{"post":{"summary":"Execute SQL on Twin database","tags":["Twin"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"sql":{"type":"string"}},"required":["sql"]}}},"required":true},"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"command":{"type":"string"},"rowCount":{"nullable":true,"type":"number"},"fields":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"dataTypeId":{"type":"number"}},"required":["name","dataTypeId"],"additionalProperties":false}},"rows":{"type":"array","items":{"type":"object","additionalProperties":{}}},"truncated":{"type":"boolean"},"truncationReason":{"nullable":true,"type":"string","enum":["row_cap","response_size_cap"]},"limits":{"type":"object","properties":{"maxRows":{"type":"number"},"maxResponseBytes":{"type":"number"}},"required":["maxRows","maxResponseBytes"],"additionalProperties":false},"returnedRows":{"type":"number"},"schemaCacheReloadAttempted":{"type":"boolean"},"schemaCacheReloaded":{"type":"boolean"}},"required":["command","rowCount","fields","rows","truncated","truncationReason","limits","returnedRows","schemaCacheReloadAttempted","schemaCacheReloaded"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/twin/dump":{"post":{"summary":"Create a Twin workflow dump table","tags":["Twin"],"description":"Creates a Twin table plus a dump config that maps workflow run values into its columns. Unlike POST /twin/tables (a bare table), the server resolves the workflow's variable catalog and binds each column to a variable, so completed runs populate the table automatically. Captures every variable by default; use `include` for a subset and `pk` to choose the primary key.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"workflowId":{"type":"string","minLength":1,"description":"Workflow (use case) UUID or slug to dump runs from"},"tableName":{"type":"string","minLength":1},"include":{"description":"Subset of variables to capture (by name or group_id.variable_id). Omit to capture every variable the workflow produces.","type":"array","items":{"type":"string","minLength":1}},"pk":{"description":"Variable to use as the primary key (by name or group_id.variable_id). Omit to add a synthetic run_id primary key.","type":"string","minLength":1}},"required":["workflowId","tableName"]}}},"required":true},"security":[{"bearerAuth":[]}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"config":{"type":"object","properties":{"id":{"type":"string"},"org_id":{"type":"string"},"twin_instance_id":{"type":"string"},"use_case_id":{"type":"string"},"table_name":{"type":"string"},"column_mappings":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string","enum":["int8","text","boolean","timestamp","uuid","jsonb","float8"]},"variableRef":{"type":"array","items":{"description":"!IMPORTANT: This schema describes one Paragraph object. When the containing field is an array of this schema, send a flat Paragraph[] array. Do not send a bare Paragraph object. Only send Paragraph[][] when the containing field is explicitly an array of arrays. Paragraph object schema: {type: 'paragraph', children: Array<{text: string} | {type: 'variable', children: [{text: ''}], group_id: string, variable_id: string}>}"}},"isPrimary":{"type":"boolean"}},"required":["name","type","variableRef","isPrimary"],"additionalProperties":false}},"status":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","org_id","twin_instance_id","use_case_id","table_name","column_mappings","status","created_at","updated_at"],"additionalProperties":false}},"required":["success","config"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/chat/tokens/":{"post":{"summary":"Create a chat client token","tags":["Chat"],"description":"Generates a scoped JWT for browser-side chat operations. Call this from your backend with your API key, then pass the token to the frontend.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"workflow_id":{"type":"string","minLength":1,"description":"Workflow UUID or slug to scope the token to"},"data":{"description":"Payload data to pass to the chat agent as trigger variables","type":"object","additionalProperties":{}},"env":{"default":"production","description":"Environment to use for session initialization","type":"string","enum":["production","staging","development"]},"ttl_seconds":{"default":3600,"description":"Token lifetime in seconds. Defaults to 3600 (1 hour). Min 60s, max 24h.","type":"integer","minimum":60,"maximum":86400}},"required":["workflow_id"]}}},"required":true},"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"expires_at":{"type":"string","description":"ISO 8601 timestamp"}},"required":["token","expires_at"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"}},"required":["error"],"additionalProperties":false}}}}}}},"/realtime/tokens":{"post":{"summary":"Create a realtime client token","tags":["Realtime"],"description":"Generates a scoped JWT for browser-side realtime connections.","requestBody":{"content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"channel":{"type":"string","enum":["runs_firehose"]},"use_case_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)$"}},"required":["channel","use_case_id"]},{"type":"object","properties":{"channel":{"type":"string","enum":["run_detail"]},"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)$"}},"required":["channel","run_id"]},{"type":"object","properties":{"channel":{"type":"string","enum":["conversations_org"]}},"required":["channel"]},{"type":"object","properties":{"channel":{"type":"string","enum":["conversation_group"]},"group_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)$"}},"required":["channel","group_id"]},{"type":"object","properties":{"channel":{"type":"string","enum":["adversarial_test"]},"test_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)$"}},"required":["channel","test_run_id"]}]}}}},"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"expires_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":["token","expires_at"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/artifacts/resolve":{"post":{"summary":"Resolve artifact download URLs","tags":["Artifacts"],"description":"Returns fresh presigned URLs for one or more artifact S3 keys.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"s3_keys":{"minItems":1,"maxItems":500,"type":"array","items":{"type":"string","minLength":1}},"expires_in":{"type":"integer","minimum":60,"maximum":604800}},"required":["s3_keys"]}}},"required":true},"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"s3_key":{"type":"string"},"presigned_url":{"nullable":true,"type":"string"},"error":{"nullable":true,"type":"string"}},"required":["s3_key","presigned_url","error"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/voice/tokens/":{"post":{"summary":"Create a voice call token","tags":["Voice"],"description":"Generates a LiveKit token for browser-side voice calls with AI agents. Call this from your backend with your API key, then pass the token to the frontend. Use workflow_id to start a new call, or session_id to join/take over an in-progress call.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"workflow_id":{"description":"Workflow UUID or slug to scope the token to. Starts a new call. Mutually exclusive with session_id.","type":"string","minLength":1},"session_id":{"description":"ID of an in-progress session to join. Generates a token for the session's existing LiveKit room. Mutually exclusive with workflow_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)$"},"should_takeover":{"default":false,"description":"Required to be true when joining a session (session_id). Explicit opt-in confirming the joining participant takes over the call and the AI agent drops. Not valid for a new call (workflow_id).","type":"boolean"},"data":{"description":"Payload data to pass to the voice agent as participant attributes (workflow_id only)","type":"object","additionalProperties":{}},"env":{"default":"production","description":"Environment to use for version resolution (workflow_id only)","type":"string","enum":["production","staging","development"]},"ttl_seconds":{"default":21600,"description":"LiveKit token lifetime in seconds. Defaults to 21600 (6 hours) to match LiveKit's default. Min 60s, max 24h. The browser must (re)connect before this expires; LiveKit does not refresh tokens on an active call.","type":"integer","minimum":60,"maximum":86400}}}}}},"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","description":"LiveKit WebSocket URL"},"token":{"type":"string","description":"LiveKit access token"},"room_name":{"type":"string","description":"LiveKit room name"},"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)$","description":"Run ID for tracking"}},"required":["url","token","room_name","run_id"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"}},"required":["error"],"additionalProperties":false}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"}},"required":["error"],"additionalProperties":false}}}}}}},"/signals/keys":{"get":{"summary":"List signal keys for the org","tags":["Signals"],"description":"Returns all configured custom signal keys for nodes in the API key org.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"keys":{"type":"array","items":{"type":"string"}}},"required":["keys"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"502":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}},"post":{"summary":"Add a custom signal key to node","tags":["Signals"],"description":"Appends a custom signal key to the target node configuration in all environments.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"node_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)$"},"key":{"type":"string","minLength":1,"maxLength":256,"pattern":"^[a-zA-Z0-9_\\-.*#]+(?:\\.[a-zA-Z0-9_\\-.*#]+)*$"}},"required":["node_id","key"]}}},"required":true},"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"node_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)$"},"keys":{"type":"array","items":{"type":"string"}}},"required":["node_id","keys"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"502":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}},"delete":{"summary":"Delete a custom signal key from node","tags":["Signals"],"description":"Removes a custom signal key from the target node configuration in all environments.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"node_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)$"},"key":{"type":"string","minLength":1,"maxLength":256,"pattern":"^[a-zA-Z0-9_\\-.*#]+(?:\\.[a-zA-Z0-9_\\-.*#]+)*$"}},"required":["node_id","key"]}}},"required":true},"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"node_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)$"},"keys":{"type":"array","items":{"type":"string"}}},"required":["node_id","keys"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"502":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/signals/":{"post":{"summary":"Publish an immediate signal","tags":["Signals"],"description":"Publishes a signal to internal signal service. payload.org_id is always derived from API key org. Built-in keys (org., usecase., session.) are allowed for targeting active sessions.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":256,"pattern":"^[a-zA-Z0-9_\\-.*#]+(?:\\.[a-zA-Z0-9_\\-.*#]+)*$"},"keys":{"minItems":1,"type":"array","items":{"type":"string","minLength":1,"maxLength":256,"pattern":"^[a-zA-Z0-9_\\-.*#]+(?:\\.[a-zA-Z0-9_\\-.*#]+)*$"}},"env":{"type":"string","enum":["production","staging","development"]},"payload":{"type":"object","additionalProperties":{}},"metadata":{"type":"object","additionalProperties":{}}},"required":["payload"]}}},"required":true},"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"dispatch_id":{"type":"string"},"signal_id":{"type":"string"},"status":{"type":"string"},"published_at":{"type":"string"},"keys":{"type":"array","items":{"type":"string"}},"signals":{"type":"array","items":{"type":"object","properties":{"signal_id":{"type":"string"},"key":{"type":"string"},"status":{"type":"string"}},"required":["signal_id","key","status"],"additionalProperties":false}}},"required":["status","published_at"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"502":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/signals/scheduled-signals":{"post":{"summary":"Schedule a delayed signal","tags":["Signals"],"description":"Schedules a delayed signal in internal signal service. payload.org_id is always derived from API key org.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":256,"pattern":"^[a-zA-Z0-9_\\-.*#]+(?:\\.[a-zA-Z0-9_\\-.*#]+)*$"},"env":{"type":"string","enum":["production","staging","development"]},"payload":{"type":"object","additionalProperties":{}},"delay_seconds":{"type":"integer","exclusiveMinimum":true,"maximum":9007199254740991},"metadata":{"type":"object","additionalProperties":{}}},"required":["key","payload","delay_seconds"]}}},"required":true},"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"scheduled_signal_id":{"type":"string"},"status":{"type":"string"},"deliver_at":{"type":"string"}},"required":["scheduled_signal_id","status","deliver_at"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"502":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/signals/scheduled-signals/{scheduled_signal_id}":{"patch":{"summary":"Patch a scheduled signal","tags":["Signals"],"description":"Updates a scheduled signal. When payload is provided, payload.org_id is always derived from API key org.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":256,"pattern":"^[a-zA-Z0-9_\\-.*#]+(?:\\.[a-zA-Z0-9_\\-.*#]+)*$"},"env":{"type":"string","enum":["production","staging","development"]},"payload":{"type":"object","additionalProperties":{}},"delay_seconds":{"type":"integer","exclusiveMinimum":true,"maximum":9007199254740991},"metadata":{"type":"object","additionalProperties":{}}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"scheduled_signal_id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"scheduled_signal_id":{"type":"string"},"status":{"type":"string"},"deliver_at":{"type":"string"}},"required":["scheduled_signal_id","status","deliver_at"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"502":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}},"delete":{"summary":"Delete a scheduled signal","tags":["Signals"],"description":"Cancels a scheduled signal.","parameters":[{"schema":{"type":"string"},"in":"path","name":"scheduled_signal_id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"204":{"description":"Scheduled signal deleted","content":{"application/json":{"schema":{"description":"Scheduled signal deleted"}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}},"502":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"statusCode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"details":{}},"required":["error"],"additionalProperties":false}}}}}}},"/chat/sessions/":{"post":{"summary":"Create a chat session","tags":["Chat"],"description":"Creates a new chat session for the workflow scoped in the client token.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"session_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)$"},"status":{"type":"string"}},"required":["session_id","status"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"}},"required":["error"],"additionalProperties":false}}}},"502":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"}},"required":["error"],"additionalProperties":false}}}}}}},"/chat/sessions/{id}/messages":{"post":{"summary":"Send a chat message","tags":["Chat"],"description":"Sends a user message to the chat session. The AI response will arrive via WebSocket.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"content":{"type":"string","description":"Message text content"},"artifacts":{"description":"Attached file references","type":"array","items":{"type":"object","properties":{"type":{"default":"raw","type":"string"},"media_id":{"type":"string"},"s3_key":{"type":"string"},"mime_type":{"type":"string"},"presigned_url":{"type":"string"},"filename":{"type":"string"},"size_bytes":{"type":"number"},"artifact_text":{"type":"string"}},"required":["media_id","mime_type"]}}},"required":["content"]}}},"required":true},"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":"id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"object","properties":{"id":{"type":"string"},"session_id":{"type":"string"},"content":{"type":"string"},"role":{"type":"string"},"created_at":{"type":"string"}},"required":["id","session_id","content","role","created_at"],"additionalProperties":false}},"required":["message"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"}},"required":["error"],"additionalProperties":false}}}},"502":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"}},"required":["error"],"additionalProperties":false}}}}}}},"/chat/sessions/{id}/close":{"post":{"summary":"Close a chat session","tags":["Chat"],"description":"Ends the chat session, stopping the AI agent. The session cannot be resumed after this call.","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":"id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string"},"session_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)$"}},"required":["status","session_id"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"}},"required":["error"],"additionalProperties":false}}}},"502":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"}},"required":["error"],"additionalProperties":false}}}}}}},"/chat/sessions/{id}/history":{"get":{"summary":"Get chat session history","tags":["Chat"],"description":"Retrieves message history for a chat session. Useful for page reloads or reconnects.","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":"id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"session_id":{"type":"string"},"status":{"type":"string"},"started_at":{"type":"string"},"last_activity":{"type":"string"},"messages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"role":{"type":"string"},"content":{"type":"string"},"timestamp":{"type":"string"},"metadata":{"type":"object","additionalProperties":{}},"artifacts":{"type":"array","items":{"type":"object","properties":{"media_id":{"type":"string"},"filename":{"type":"string"},"mime_type":{"type":"string"},"file_size":{"type":"number"},"presigned_url":{"type":"string"}},"required":["media_id","filename","mime_type"],"additionalProperties":false}}},"required":["id","role","content","timestamp"],"additionalProperties":false}},"metadata":{"type":"object","additionalProperties":{}}},"required":["session_id","status","started_at","last_activity","messages"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"}},"required":["error"],"additionalProperties":false}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"}},"required":["error"],"additionalProperties":false}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"}},"required":["error"],"additionalProperties":false}}}},"502":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"}},"required":["error"],"additionalProperties":false}}}}}}},"/chat/upload/presigned":{"get":{"summary":"Get presigned upload URL","tags":["Chat"],"description":"Returns a presigned S3 URL for direct file upload from the browser. After uploading, call POST /chat/upload/complete to register the artifact.","parameters":[{"schema":{"type":"string"},"in":"query","name":"filename","required":true},{"schema":{"type":"string"},"in":"query","name":"mime_type","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"artifact_id":{"type":"string"},"upload_url":{"type":"string"},"s3_uri":{"type":"string"},"max_file_size":{"type":"number"}},"required":["artifact_id","upload_url","s3_uri","max_file_size"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"}},"required":["error"],"additionalProperties":false}}}},"502":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"}},"required":["error"],"additionalProperties":false}}}}}}},"/chat/upload/complete":{"post":{"summary":"Complete file upload","tags":["Chat"],"description":"Registers an uploaded artifact after direct S3 upload. Call this after uploading the file to the presigned URL.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"artifact_id":{"type":"string"},"s3_uri":{"type":"string"},"filename":{"type":"string"},"mime_type":{"type":"string"},"size_bytes":{"type":"number","minimum":0,"exclusiveMinimum":true}},"required":["artifact_id","s3_uri","filename","mime_type","size_bytes"]}}},"required":true},"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"artifact_id":{"type":"string"},"status":{"type":"string"}},"required":["artifact_id","status"],"additionalProperties":false}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"}},"required":["error"],"additionalProperties":false}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"}},"required":["error"],"additionalProperties":false}}}},"413":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"}},"required":["error"],"additionalProperties":false}}}},"502":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"}},"required":["error"],"additionalProperties":false}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"statusCode":{"type":"number"}},"required":["error"],"additionalProperties":false}}}}}}}},"servers":[{"url":"https://platform.happyrobot.ai/api/v2"}],"security":[{"bearerAuth":[]}]}