{"openapi":"3.1.0","info":{"title":"Open Browser API","version":"1.0.0","description":"Bounded, verified web execution. All write endpoints accept Idempotency-Key."},"servers":[{"url":"https://openbrowser.run"}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}},"responses":{"Error":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{}}}}}}}}},"schemas":{"RunCreate":{"type":"object","required":["goal"],"properties":{"goal":{"type":"string","minLength":3,"maxLength":2000},"allowedDomains":{"type":"array","items":{"type":"string"},"maxItems":20},"skill":{"type":"string"},"inputs":{"type":"object","additionalProperties":{"type":"string"}},"budget":{"type":"object","properties":{"maxSteps":{"type":"integer","maximum":200},"maxSeconds":{"type":"integer","maximum":900}}}}},"Run":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"state":{"enum":["queued","running","needs_consent","blocked","failed","partial","unknown","complete","canceled"]},"summary":{"type":"string"},"result":{"type":"object"},"verification":{"type":"object"},"artifacts":{"type":"array","items":{"type":"object"}},"events":{"type":"array","items":{"type":"object"}}}},"SkillRun":{"type":"object","properties":{"inputs":{"type":"object","additionalProperties":{"type":"string"}}}},"ScheduleCreate":{"type":"object","required":["everyMinutes"],"properties":{"skill":{"type":"string"},"goal":{"type":"string"},"inputs":{"type":"object"},"everyMinutes":{"type":"integer","minimum":60},"timezone":{"type":"string"},"expiresAt":{"type":"string","format":"date-time"}}}}},"paths":{"/api/health":{"get":{"summary":"Service health, database and worker status","responses":{"200":{"description":"OK"},"default":{"$ref":"#/components/responses/Error"}}}},"/api/revision":{"get":{"summary":"Deployed revision","responses":{"200":{"description":"OK"},"default":{"$ref":"#/components/responses/Error"}}}},"/api/v1/capabilities":{"get":{"summary":"Verified capabilities and external gates","responses":{"200":{"description":"OK"},"default":{"$ref":"#/components/responses/Error"}}}},"/api/v1/plans":{"get":{"summary":"Plans and limits","responses":{"200":{"description":"OK"},"default":{"$ref":"#/components/responses/Error"}}}},"/api/v1/runs":{"get":{"summary":"List runs (cursor pagination via before=nextCursor)","security":[{"bearer":[]}],"x-scope":"runs:read","responses":{"200":{"description":"OK"},"default":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"before","in":"query","schema":{"type":"string","format":"date-time"}},{"name":"limit","in":"query","schema":{"type":"integer","maximum":100}}]},"post":{"summary":"Start a run","security":[{"bearer":[]}],"x-scope":"runs:write","responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Run"}}}},"default":{"$ref":"#/components/responses/Error"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunCreate"}}}},"parameters":[{"name":"Idempotency-Key","in":"header","schema":{"type":"string"}}]}},"/api/v1/runs/plan":{"post":{"summary":"Preview the plan and outcome contract for a goal without running it","security":[{"bearer":[]}],"x-scope":"runs:read","responses":{"200":{"description":"OK"},"default":{"$ref":"#/components/responses/Error"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunCreate"}}}}}},"/api/v1/runs/{id}":{"get":{"summary":"Get a run with events (after=<event id>) and artifacts","security":[{"bearer":[]}],"x-scope":"runs:read","responses":{"200":{"description":"OK"},"default":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}]}},"/api/v1/runs/{id}/stream":{"get":{"summary":"Server-sent events for a run; resume with Last-Event-ID","security":[{"bearer":[]}],"x-scope":"runs:read","responses":{"200":{"description":"OK"},"default":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}]}},"/api/v1/runs/{id}/takeover":{"get":{"summary":"Whether the run is waiting for its user (authorized takeover) and until when","security":[{"bearer":[]}],"x-scope":"runs:read","responses":{"200":{"description":"OK"},"default":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}]},"post":{"summary":"Take control of the waiting run in its isolated browser. Signed-in members only; API keys are refused","security":[{"bearer":[]}],"x-scope":"session","responses":{"200":{"description":"OK"},"default":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}]},"delete":{"summary":"Release control without finishing","security":[{"bearer":[]}],"x-scope":"session","responses":{"200":{"description":"OK"},"default":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}]}},"/api/v1/runs/{id}/takeover/frame":{"get":{"summary":"Latest frame as image/jpeg (X-Takeover-Token header; after=<seq> answers 204 when unchanged)","security":[{"bearer":[]}],"x-scope":"session","responses":{"200":{"description":"OK"},"default":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}]}},"/api/v1/runs/{id}/takeover/input":{"post":{"summary":"Relay a click, typed text (max 200), an allowed key or a scroll to the page (X-Takeover-Token header; 10 per second)","security":[{"bearer":[]}],"x-scope":"session","responses":{"200":{"description":"OK"},"default":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}]}},"/api/v1/runs/{id}/takeover/done":{"post":{"summary":"Tell the run to continue in the same browser","security":[{"bearer":[]}],"x-scope":"session","responses":{"200":{"description":"OK"},"default":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}]}},"/api/v1/runs/{id}/cancel":{"post":{"summary":"Cancel a run","security":[{"bearer":[]}],"x-scope":"runs:write","responses":{"200":{"description":"OK"},"default":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}]}},"/api/v1/runs/{id}/retry":{"post":{"summary":"Retry a read-only run","security":[{"bearer":[]}],"x-scope":"runs:write","responses":{"200":{"description":"OK"},"default":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}]}},"/api/v1/runs/{id}/save-skill":{"post":{"summary":"Compile a verified run into a versioned skill","security":[{"bearer":[]}],"x-scope":"skills:write","responses":{"200":{"description":"OK"},"default":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}]}},"/api/v1/artifacts/{id}/link":{"get":{"summary":"Signed download link valid for 10 minutes","security":[{"bearer":[]}],"x-scope":"artifacts:read","responses":{"200":{"description":"OK"},"default":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}]}},"/api/v1/skills":{"get":{"summary":"List skills","security":[{"bearer":[]}],"x-scope":"skills:read","responses":{"200":{"description":"OK"},"default":{"$ref":"#/components/responses/Error"}}},"post":{"summary":"Create or version a skill","security":[{"bearer":[]}],"x-scope":"skills:write","responses":{"200":{"description":"OK"},"default":{"$ref":"#/components/responses/Error"}}}},"/api/v1/skills/{slug}":{"get":{"summary":"Skill detail: guided steps, inputs with examples, versions, quality from real runs, drift, candidate","security":[{"bearer":[]}],"x-scope":"skills:read","responses":{"200":{"description":"OK"},"default":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"}}]}},"/api/v1/skills/{slug}/candidate":{"post":{"summary":"Stage an edited copy as a candidate version (step edits)","security":[{"bearer":[]}],"x-scope":"skills:write","responses":{"200":{"description":"OK"},"default":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"}}]},"delete":{"summary":"Discard the candidate","security":[{"bearer":[]}],"x-scope":"skills:write","responses":{"200":{"description":"OK"},"default":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"}}]}},"/api/v1/skills/{slug}/test":{"post":{"summary":"Test run of the active or candidate version (not counted in quality)","security":[{"bearer":[]}],"x-scope":"runs:write","responses":{"200":{"description":"OK"},"default":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"}}]}},"/api/v1/skills/{slug}/promote":{"post":{"summary":"Make the candidate active; requires its latest replay (a test run is a one-run replay) to be verified on every input set","security":[{"bearer":[]}],"x-scope":"skills:write","responses":{"200":{"description":"OK"},"default":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"}}]}},"/api/v1/skills/{slug}/replay":{"post":{"summary":"Replay a version on up to 5 input sets (default: recent verified production inputs; explicit sets required for skills with secret inputs). Not counted in quality","security":[{"bearer":[]}],"x-scope":"runs:write","responses":{"200":{"description":"OK"},"default":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"}}]}},"/api/v1/skills/{slug}/replays/{id}":{"get":{"summary":"Replay batch state: running, verified, failed or incomplete, with each run","security":[{"bearer":[]}],"x-scope":"skills:read","responses":{"200":{"description":"OK"},"default":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}]}},"/api/v1/skills/{slug}/compare":{"get":{"summary":"Before/after: changed steps, quality, last run and last replay of two versions (default: in use vs candidate)","security":[{"bearer":[]}],"x-scope":"skills:read","responses":{"200":{"description":"OK"},"default":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"}},{"name":"base","in":"query","schema":{"type":"integer"}},{"name":"target","in":"query","schema":{"type":"integer"}}]}},"/api/v1/skills/{slug}/pin":{"post":{"summary":"Pin this workspace to an active version ({\"version\": n}) or unpin ({\"version\": null})","security":[{"bearer":[]}],"x-scope":"skills:write","responses":{"200":{"description":"OK"},"default":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"}}]}},"/api/v1/runs/{id}/frames":{"get":{"summary":"Redacted frames captured during the run (signed image links)","security":[{"bearer":[]}],"x-scope":"runs:read","responses":{"200":{"description":"OK"},"default":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}]}},"/api/v1/runs/{id}/viewer-grants":{"post":{"summary":"Create a 10-minute watch-only link for this run","security":[{"bearer":[]}],"x-scope":"runs:write","responses":{"200":{"description":"OK"},"default":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}]},"delete":{"summary":"Revoke all watch-only links for this run","security":[{"bearer":[]}],"x-scope":"runs:write","responses":{"200":{"description":"OK"},"default":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}]}},"/api/v1/runs/{id}/live":{"get":{"summary":"Watch-only state, timeline and frames; session or ?grant= token","responses":{"200":{"description":"OK"},"default":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}]}},"/api/v1/skills/{slug}/run":{"post":{"summary":"Run a skill","security":[{"bearer":[]}],"x-scope":"runs:write","responses":{"200":{"description":"OK"},"default":{"$ref":"#/components/responses/Error"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SkillRun"}}}},"parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"}}]}},"/api/v1/portals":{"get":{"summary":"Supported supplier portals (today: the controlled test fixture only)","security":[{"bearer":[]}],"x-scope":"runs:read","responses":{"200":{"description":"OK"},"default":{"$ref":"#/components/responses/Error"}}}},"/api/v1/connections":{"get":{"summary":"List linked portal accounts with status and health; secrets are never returned","security":[{"bearer":[]}],"x-scope":"runs:read","responses":{"200":{"description":"OK"},"default":{"$ref":"#/components/responses/Error"}}},"post":{"summary":"Link a portal account with explicit consent and an expiry (signed-in account only)","security":[{"bearer":[]}],"x-scope":"account","responses":{"200":{"description":"OK"},"default":{"$ref":"#/components/responses/Error"}}}},"/api/v1/connections/{id}":{"delete":{"summary":"Revoke a link at once: secret wiped, schedules paused, queued runs refused","security":[{"bearer":[]}],"x-scope":"account","responses":{"200":{"description":"OK"},"default":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}]}},"/api/v1/connections/{id}/run":{"post":{"summary":"Run the portal task for a linked account (the run carries no secret)","security":[{"bearer":[]}],"x-scope":"runs:write","responses":{"200":{"description":"OK"},"default":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","schema":{"type":"string"}}]}},"/api/v1/connections/{id}/schedule":{"post":{"summary":"Schedule the portal task: daily, weekly or monthly","security":[{"bearer":[]}],"x-scope":"schedules:write","responses":{"200":{"description":"OK"},"default":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}]}},"/api/v1/documents":{"get":{"summary":"Normalized documents collected through connections (filter: connection, period)","security":[{"bearer":[]}],"x-scope":"artifacts:read","responses":{"200":{"description":"OK"},"default":{"$ref":"#/components/responses/Error"}}}},"/api/v1/runs/{id}/deliveries":{"get":{"summary":"Webhook delivery receipts for a run","security":[{"bearer":[]}],"x-scope":"runs:read","responses":{"200":{"description":"OK"},"default":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}]}},"/api/v1/webhooks":{"get":{"summary":"List webhooks with delivery stats","security":[{"bearer":[]}],"x-scope":"account","responses":{"200":{"description":"OK"},"default":{"$ref":"#/components/responses/Error"}}},"post":{"summary":"Register a signed webhook (secret returned once)","security":[{"bearer":[]}],"x-scope":"account","responses":{"200":{"description":"OK"},"default":{"$ref":"#/components/responses/Error"}}}},"/api/v1/webhooks/{id}":{"delete":{"summary":"Disable a webhook","security":[{"bearer":[]}],"x-scope":"account","responses":{"200":{"description":"OK"},"default":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}]}},"/api/v1/webhooks/{id}/deliveries":{"get":{"summary":"Recent deliveries of a webhook (delivered, pending, dead)","security":[{"bearer":[]}],"x-scope":"account","responses":{"200":{"description":"OK"},"default":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}]}},"/api/v1/webhooks/{id}/redrive":{"post":{"summary":"Queue dead deliveries again (same event ids)","security":[{"bearer":[]}],"x-scope":"account","responses":{"200":{"description":"OK"},"default":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}]}},"/api/v1/evidence":{"get":{"summary":"Saved files across runs: filter by q, host, state, from, to (YYYY-MM-DD), sha prefix; cursor paging; format=csv exports up to 1000 rows","security":[{"bearer":[]}],"x-scope":"artifacts:read","responses":{"200":{"description":"OK"},"default":{"$ref":"#/components/responses/Error"}}}},"/api/v1/runs/{id}/receipt":{"get":{"summary":"Signed receipt of a finished run (Ed25519 over canonical JSON; verify with the SDK verifyReceipt)","security":[{"bearer":[]}],"x-scope":"runs:read","responses":{"200":{"description":"OK"},"default":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}]}},"/api/v1/schedules":{"get":{"summary":"List schedules","security":[{"bearer":[]}],"x-scope":"runs:read","responses":{"200":{"description":"OK"},"default":{"$ref":"#/components/responses/Error"}}},"post":{"summary":"Create a schedule","security":[{"bearer":[]}],"x-scope":"schedules:write","responses":{"200":{"description":"OK"},"default":{"$ref":"#/components/responses/Error"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScheduleCreate"}}}}}}}}