{"openapi":"3.1.0","info":{"title":"OpFlow API","version":"1.0.0","description":"Public REST API for OpFlow bots, agents and runs. Authenticate with an opflow_ bearer token (Developer → API & MCP)."},"servers":[{"url":"https://opflow-sandbox.pages.dev/api/v1"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"opflow_<token>"}}},"paths":{"/bots":{"get":{"summary":"List bots","operationId":"listBots","responses":{"200":{"description":"OK"}}}},"/bots/{id}":{"get":{"summary":"Get a bot","operationId":"getBot","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"},"404":{"description":"Not found"}}}},"/bots/{id}/run":{"post":{"summary":"Run a bot","operationId":"runBot","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"trigger_payload":{"type":"object"}}}}}},"responses":{"200":{"description":"Run result"},"409":{"description":"Disabled"}}}},"/sub-agents/{id}/run":{"post":{"summary":"Run an agent","operationId":"runSubAgent","description":"Runs one agent (a focused job that carries out bots; called a sub agent until 2026-10-12). Process agents run their bots; AI agents need a goal. POST /agents/{id}/run was this path until 2026-10-05, answers 410 until 2026-11-15, and runs agents again after that.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"goal":{"type":"string","description":"Required for AI agents"}}}}}},"responses":{"200":{"description":"Run result"},"400":{"description":"Missing goal or bad JSON"},"404":{"description":"Not found"}}}},"/runs":{"get":{"summary":"List runs","operationId":"listRuns","parameters":[{"name":"workflow_id","in":"query","schema":{"type":"string"}},{"name":"status","in":"query","schema":{"type":"string","enum":["pending","running","success","failed","waiting"]}},{"name":"limit","in":"query","schema":{"type":"integer","maximum":100}}],"responses":{"200":{"description":"OK"}}}},"/runs/{id}":{"get":{"summary":"Get a run with steps","operationId":"getRun","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"},"404":{"description":"Not found"}}}}}}