{"openapi":"3.1.0","info":{"title":"Kaab API","version":"1.39","description":"Unbreakable web automation API. Every job is the execution of a program; clients switch on `status`.","license":{"name":"Proprietary","url":"https://kaab.ist/terms"},"contact":{"name":"Kaabist","url":"https://kaab.ist","email":"support@kaab.ist"}},"servers":[{"url":"https://api.kaab.ist/v1","description":"Production"}],"security":[{"bearerAuth":[]}],"tags":[{"name":"jobs","description":"Run programs and act on parked jobs"},{"name":"batches","description":"Bulk job creation"},{"name":"programs","description":"Programs, versions and aliases"},{"name":"sessions","description":"Stored browser sessions"},{"name":"proposals","description":"Machine-generated changes awaiting approval"},{"name":"schedules","description":"Cron schedules and change detection"},{"name":"webhooks","description":"Event delivery"},{"name":"org","description":"Organisation, credits, keys and providers"}],"paths":{"/jobs":{"post":{"operationId":"createJob","summary":"Create a job from a program reference or the url + extract shorthand","tags":["jobs"],"x-kaab-scope":"run","x-kaab-action":"job.run","parameters":[{"in":"header","name":"idempotency-key","description":"24 h idempotency window","schema":{"type":"string","maxLength":255,"description":"24 h idempotency window"}},{"in":"header","name":"prefer","description":"`wait=<1-60>`: wait up to that many seconds for the job to finish","schema":{"type":"string","description":"`wait=<1-60>`: wait up to that many seconds for the job to finish"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"program":{"type":"string","minLength":1},"inputs":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}},"definition":{"$ref":"#/components/schemas/ProgramDefinition"},"url":{"type":"string","format":"uri"},"extract":{"$ref":"#/components/schemas/ExtractSchema"},"session":{"type":"string","minLength":1},"options":{"type":"object","properties":{"region":{"type":"string","enum":["eu","us"]},"max_tier":{"type":"string","enum":["http","browser","stealth"]},"prefer_tier":{"type":"string","enum":["http","browser","stealth"]},"assets":{"type":"string","enum":["block","allow"]},"block_urls":{"type":"array","items":{"type":"string","minLength":1,"maxLength":500},"maxItems":50},"proxy":{"type":"object","properties":{"mode":{"type":"string","enum":["platform","byo"]},"byo_id":{"type":"string","pattern":"^byo_[0-9a-hjkmnp-tv-z]{26}$"},"country":{"type":"string","pattern":"^[A-Z]{2}$"},"pool":{"type":"string","enum":["datacenter","residential","mobile"]},"fallback":{"type":"string","enum":["platform","none"]}},"additionalProperties":false},"llm":{"type":"object","properties":{"byo_id":{"type":"string","pattern":"^byo_[0-9a-hjkmnp-tv-z]{26}$"}},"additionalProperties":false},"captcha":{"type":"object","properties":{"byo_id":{"type":"string","pattern":"^byo_[0-9a-hjkmnp-tv-z]{26}$"}},"additionalProperties":false},"session":{"type":"string","minLength":1},"resume_from_session":{"type":"boolean"},"session_probe":{"type":"string","enum":["http","browser"]},"cache":{"type":"object","properties":{"max_age":{"type":"integer","minimum":0,"maximum":86400}},"required":["max_age"],"additionalProperties":false},"viewport":{"type":"object","properties":{"width":{"type":"integer","minimum":320,"maximum":3840},"height":{"type":"integer","minimum":240,"maximum":2160}},"required":["width","height"],"additionalProperties":false},"browser_profile":{"type":"string","enum":["desktop","mobile"]},"engine":{"type":"string","enum":["chromium","firefox"]},"fill_mode":{"type":"string","enum":["insert","type"]},"follow_popups":{"type":"boolean"},"locale":{"type":"string","minLength":2},"timezone":{"type":"string","minLength":1},"max_duration_ms":{"type":"integer","minimum":1000,"maximum":3600000},"max_credits":{"type":"integer","minimum":1},"max_steps":{"type":"integer","minimum":1,"maximum":200},"headers":{"type":"object","additionalProperties":{"type":"string"}},"canary":{"type":"object","properties":{"enabled":{"type":"boolean"},"cron":{"type":"string","minLength":1},"url":{"type":"string"},"inputs":{"type":"object","additionalProperties":{}}},"additionalProperties":false},"obstacles":{"type":"object","properties":{"allow_hide":{"type":"boolean"},"ignore":{"type":"array","items":{"type":"string","minLength":1},"maxItems":20}},"additionalProperties":false}},"additionalProperties":false},"policies":{"type":"object","properties":{"strict":{"type":"boolean"},"include_raw":{"type":"boolean"},"on_session_expired":{"type":"string","enum":["fail","park","refresh"]},"captcha":{"type":"string","enum":["park","solve","fail"]},"screenshot":{"type":"string","enum":["never","on_failure","always"]}},"additionalProperties":false},"webhook_url":{"type":"string","format":"uri"},"tags":{"type":"array","items":{"type":"string","minLength":1,"maxLength":64},"maxItems":20},"dry_run":{"type":"boolean"},"cache":{"type":"object","properties":{"max_age":{"type":"integer","minimum":0,"maximum":86400}},"required":["max_age"],"additionalProperties":false}},"additionalProperties":false}}}},"responses":{"200":{"description":"Finished within the `Prefer: wait` budget","headers":{"X-Kaab-Request-Id":{"description":"Request correlation id","schema":{"type":"string"}},"X-Credits-Remaining":{"description":"Credits left after this call","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per window","schema":{"type":"string"}},"X-RateLimit-Remaining":{"description":"Requests left in the window","schema":{"type":"string"}},"X-RateLimit-Reset":{"description":"Window reset, unix seconds","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}}},"202":{"description":"Accepted; poll or wait for the webhook","headers":{"X-Kaab-Request-Id":{"description":"Request correlation id","schema":{"type":"string"}},"X-Credits-Remaining":{"description":"Credits left after this call","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per window","schema":{"type":"string"}},"X-RateLimit-Remaining":{"description":"Requests left in the window","schema":{"type":"string"}},"X-RateLimit-Reset":{"description":"Window reset, unix seconds","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}}},"400":{"description":"`request_invalid`: request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"`insufficient_credits`: top up to continue","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The key's scope does not cover this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflicting state (see `error.code`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Semantically invalid request (see `error.code`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"`internal`: unexpected server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"get":{"operationId":"listJobs","summary":"List jobs, newest first","tags":["jobs"],"x-kaab-scope":"read","x-kaab-action":"job.read","x-kaab-session-auth":true,"parameters":[{"in":"query","name":"limit","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"in":"query","name":"cursor","schema":{"type":"string","minLength":1}},{"in":"query","name":"status","schema":{"type":"string","enum":["queued","running","awaiting_input","needs_attention","succeeded","failed","canceled"]}},{"in":"query","name":"program","schema":{"type":"string","minLength":1}},{"in":"query","name":"tag","schema":{"type":"string","minLength":1}},{"in":"query","name":"batch","schema":{"type":"string","pattern":"^bat_[0-9a-hjkmnp-tv-z]{26}$"}},{"in":"query","name":"schedule","schema":{"type":"string","pattern":"^sch_[0-9a-hjkmnp-tv-z]{26}$"}},{"in":"query","name":"created_after","schema":{"type":"string","format":"date-time"}},{"in":"query","name":"created_before","schema":{"type":"string","format":"date-time"}},{"in":"query","name":"mode","schema":{"type":"string","enum":["live","test"]}}],"responses":{"200":{"description":"Job page","headers":{"X-Kaab-Request-Id":{"description":"Request correlation id","schema":{"type":"string"}},"X-Credits-Remaining":{"description":"Credits left after this call","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per window","schema":{"type":"string"}},"X-RateLimit-Remaining":{"description":"Requests left in the window","schema":{"type":"string"}},"X-RateLimit-Reset":{"description":"Window reset, unix seconds","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Job"}},"next_cursor":{"type":["string","null"]}},"required":["data","next_cursor"],"additionalProperties":false}}}},"400":{"description":"`request_invalid`: request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The key's scope does not cover this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"`internal`: unexpected server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/jobs/batch":{"post":{"operationId":"createJobBatch","summary":"Create up to 1000 jobs from one program","tags":["jobs"],"x-kaab-scope":"run","x-kaab-action":"job.run","parameters":[{"in":"header","name":"idempotency-key","description":"24 h idempotency window","schema":{"type":"string","maxLength":255,"description":"24 h idempotency window"}},{"in":"header","name":"prefer","description":"`wait=<1-60>`: wait up to that many seconds for the job to finish","schema":{"type":"string","description":"`wait=<1-60>`: wait up to that many seconds for the job to finish"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"program":{"type":"string","minLength":1},"url":{"type":"string","format":"uri"},"extract":{"$ref":"#/components/schemas/ExtractSchema"},"options":{"type":"object","properties":{"region":{"type":"string","enum":["eu","us"]},"max_tier":{"type":"string","enum":["http","browser","stealth"]},"prefer_tier":{"type":"string","enum":["http","browser","stealth"]},"assets":{"type":"string","enum":["block","allow"]},"block_urls":{"type":"array","items":{"type":"string","minLength":1,"maxLength":500},"maxItems":50},"proxy":{"type":"object","properties":{"mode":{"type":"string","enum":["platform","byo"]},"byo_id":{"type":"string","pattern":"^byo_[0-9a-hjkmnp-tv-z]{26}$"},"country":{"type":"string","pattern":"^[A-Z]{2}$"},"pool":{"type":"string","enum":["datacenter","residential","mobile"]},"fallback":{"type":"string","enum":["platform","none"]}},"additionalProperties":false},"llm":{"type":"object","properties":{"byo_id":{"type":"string","pattern":"^byo_[0-9a-hjkmnp-tv-z]{26}$"}},"additionalProperties":false},"captcha":{"type":"object","properties":{"byo_id":{"type":"string","pattern":"^byo_[0-9a-hjkmnp-tv-z]{26}$"}},"additionalProperties":false},"session":{"type":"string","minLength":1},"resume_from_session":{"type":"boolean"},"session_probe":{"type":"string","enum":["http","browser"]},"cache":{"type":"object","properties":{"max_age":{"type":"integer","minimum":0,"maximum":86400}},"required":["max_age"],"additionalProperties":false},"viewport":{"type":"object","properties":{"width":{"type":"integer","minimum":320,"maximum":3840},"height":{"type":"integer","minimum":240,"maximum":2160}},"required":["width","height"],"additionalProperties":false},"browser_profile":{"type":"string","enum":["desktop","mobile"]},"engine":{"type":"string","enum":["chromium","firefox"]},"fill_mode":{"type":"string","enum":["insert","type"]},"follow_popups":{"type":"boolean"},"locale":{"type":"string","minLength":2},"timezone":{"type":"string","minLength":1},"max_duration_ms":{"type":"integer","minimum":1000,"maximum":3600000},"max_credits":{"type":"integer","minimum":1},"max_steps":{"type":"integer","minimum":1,"maximum":200},"headers":{"type":"object","additionalProperties":{"type":"string"}},"canary":{"type":"object","properties":{"enabled":{"type":"boolean"},"cron":{"type":"string","minLength":1},"url":{"type":"string"},"inputs":{"type":"object","additionalProperties":{}}},"additionalProperties":false},"obstacles":{"type":"object","properties":{"allow_hide":{"type":"boolean"},"ignore":{"type":"array","items":{"type":"string","minLength":1},"maxItems":20}},"additionalProperties":false}},"additionalProperties":false},"items":{"type":"array","items":{"type":"object","properties":{"inputs":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}},"url":{"type":"string","format":"uri"},"tags":{"type":"array","items":{"type":"string","minLength":1,"maxLength":64},"maxItems":20}},"additionalProperties":false},"minItems":1,"maxItems":1000},"webhook_url":{"type":"string","format":"uri"}},"required":["items"],"additionalProperties":false}}}},"responses":{"202":{"description":"Batch accepted","headers":{"X-Kaab-Request-Id":{"description":"Request correlation id","schema":{"type":"string"}},"X-Credits-Remaining":{"description":"Credits left after this call","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per window","schema":{"type":"string"}},"X-RateLimit-Remaining":{"description":"Requests left in the window","schema":{"type":"string"}},"X-RateLimit-Reset":{"description":"Window reset, unix seconds","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Batch"}}}},"400":{"description":"`request_invalid`: request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"`insufficient_credits`: top up to continue","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The key's scope does not cover this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflicting state (see `error.code`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Semantically invalid request (see `error.code`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"`internal`: unexpected server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/jobs/estimate":{"post":{"operationId":"estimateJob","summary":"Estimate the credit cost of a job without enqueuing it","tags":["jobs"],"x-kaab-scope":"read","x-kaab-action":"job.read","x-kaab-session-auth":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"program":{"type":"string","minLength":1},"inputs":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}},"definition":{"$ref":"#/components/schemas/ProgramDefinition"},"url":{"type":"string","format":"uri"},"extract":{"$ref":"#/components/schemas/ExtractSchema"},"session":{"type":"string","minLength":1},"options":{"type":"object","properties":{"region":{"type":"string","enum":["eu","us"]},"max_tier":{"type":"string","enum":["http","browser","stealth"]},"prefer_tier":{"type":"string","enum":["http","browser","stealth"]},"assets":{"type":"string","enum":["block","allow"]},"block_urls":{"type":"array","items":{"type":"string","minLength":1,"maxLength":500},"maxItems":50},"proxy":{"type":"object","properties":{"mode":{"type":"string","enum":["platform","byo"]},"byo_id":{"type":"string","pattern":"^byo_[0-9a-hjkmnp-tv-z]{26}$"},"country":{"type":"string","pattern":"^[A-Z]{2}$"},"pool":{"type":"string","enum":["datacenter","residential","mobile"]},"fallback":{"type":"string","enum":["platform","none"]}},"additionalProperties":false},"llm":{"type":"object","properties":{"byo_id":{"type":"string","pattern":"^byo_[0-9a-hjkmnp-tv-z]{26}$"}},"additionalProperties":false},"captcha":{"type":"object","properties":{"byo_id":{"type":"string","pattern":"^byo_[0-9a-hjkmnp-tv-z]{26}$"}},"additionalProperties":false},"session":{"type":"string","minLength":1},"resume_from_session":{"type":"boolean"},"session_probe":{"type":"string","enum":["http","browser"]},"cache":{"type":"object","properties":{"max_age":{"type":"integer","minimum":0,"maximum":86400}},"required":["max_age"],"additionalProperties":false},"viewport":{"type":"object","properties":{"width":{"type":"integer","minimum":320,"maximum":3840},"height":{"type":"integer","minimum":240,"maximum":2160}},"required":["width","height"],"additionalProperties":false},"browser_profile":{"type":"string","enum":["desktop","mobile"]},"engine":{"type":"string","enum":["chromium","firefox"]},"fill_mode":{"type":"string","enum":["insert","type"]},"follow_popups":{"type":"boolean"},"locale":{"type":"string","minLength":2},"timezone":{"type":"string","minLength":1},"max_duration_ms":{"type":"integer","minimum":1000,"maximum":3600000},"max_credits":{"type":"integer","minimum":1},"max_steps":{"type":"integer","minimum":1,"maximum":200},"headers":{"type":"object","additionalProperties":{"type":"string"}},"canary":{"type":"object","properties":{"enabled":{"type":"boolean"},"cron":{"type":"string","minLength":1},"url":{"type":"string"},"inputs":{"type":"object","additionalProperties":{}}},"additionalProperties":false},"obstacles":{"type":"object","properties":{"allow_hide":{"type":"boolean"},"ignore":{"type":"array","items":{"type":"string","minLength":1},"maxItems":20}},"additionalProperties":false}},"additionalProperties":false},"policies":{"type":"object","properties":{"strict":{"type":"boolean"},"include_raw":{"type":"boolean"},"on_session_expired":{"type":"string","enum":["fail","park","refresh"]},"captcha":{"type":"string","enum":["park","solve","fail"]},"screenshot":{"type":"string","enum":["never","on_failure","always"]}},"additionalProperties":false},"webhook_url":{"type":"string","format":"uri"},"tags":{"type":"array","items":{"type":"string","minLength":1,"maxLength":64},"maxItems":20},"dry_run":{"type":"boolean"},"cache":{"type":"object","properties":{"max_age":{"type":"integer","minimum":0,"maximum":86400}},"required":["max_age"],"additionalProperties":false}},"additionalProperties":false}}}},"responses":{"200":{"description":"Estimate","headers":{"X-Kaab-Request-Id":{"description":"Request correlation id","schema":{"type":"string"}},"X-Credits-Remaining":{"description":"Credits left after this call","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per window","schema":{"type":"string"}},"X-RateLimit-Remaining":{"description":"Requests left in the window","schema":{"type":"string"}},"X-RateLimit-Reset":{"description":"Window reset, unix seconds","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"credits_min":{"type":"number"},"credits_max":{"type":"number"},"tier_expected":{"type":"string","enum":["http","browser","stealth"]},"cache":{"type":"string","enum":["possible","no"]}},"required":["credits_min","credits_max","tier_expected","cache"],"additionalProperties":false}}}},"400":{"description":"`request_invalid`: request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The key's scope does not cover this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"`internal`: unexpected server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/jobs/{id}":{"get":{"operationId":"getJob","summary":"Read the job envelope; `Prefer: wait` long-polls for a state change","tags":["jobs"],"x-kaab-scope":"read","x-kaab-action":"job.read","x-kaab-session-auth":true,"parameters":[{"in":"path","name":"id","schema":{"type":"string","pattern":"^job_[0-9a-hjkmnp-tv-z]{26}$"},"required":true},{"in":"query","name":"since_status","description":"With `Prefer: wait`: answer once the status differs from this one (the state you last saw) instead of from the state at request start.","schema":{"type":"string","enum":["queued","running","awaiting_input","needs_attention","succeeded","failed","canceled"],"description":"With `Prefer: wait`: answer once the status differs from this one (the state you last saw) instead of from the state at request start."}},{"in":"header","name":"prefer","description":"`wait=<1-60>`: wait up to that many seconds for the job to finish","schema":{"type":"string","description":"`wait=<1-60>`: wait up to that many seconds for the job to finish"}}],"responses":{"200":{"description":"Job envelope","headers":{"X-Kaab-Request-Id":{"description":"Request correlation id","schema":{"type":"string"}},"X-Credits-Remaining":{"description":"Credits left after this call","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per window","schema":{"type":"string"}},"X-RateLimit-Remaining":{"description":"Requests left in the window","schema":{"type":"string"}},"X-RateLimit-Reset":{"description":"Window reset, unix seconds","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}}},"400":{"description":"`request_invalid`: request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The key's scope does not cover this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"`internal`: unexpected server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/jobs/{id}/steps":{"get":{"operationId":"listJobSteps","summary":"Per-step records with timings, snapshots and healing information","tags":["jobs"],"x-kaab-scope":"read","x-kaab-action":"job.read","x-kaab-session-auth":true,"parameters":[{"in":"path","name":"id","schema":{"type":"string","pattern":"^job_[0-9a-hjkmnp-tv-z]{26}$"},"required":true}],"responses":{"200":{"description":"Step records","headers":{"X-Kaab-Request-Id":{"description":"Request correlation id","schema":{"type":"string"}},"X-Credits-Remaining":{"description":"Credits left after this call","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per window","schema":{"type":"string"}},"X-RateLimit-Remaining":{"description":"Requests left in the window","schema":{"type":"string"}},"X-RateLimit-Reset":{"description":"Window reset, unix seconds","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/StepRecord"}}},"required":["data"],"additionalProperties":false}}}},"400":{"description":"`request_invalid`: request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The key's scope does not cover this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"`internal`: unexpected server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/jobs/{id}/snapshot":{"get":{"operationId":"getJobSnapshot","summary":"Redirect to a presigned snapshot JSON URL","tags":["jobs"],"x-kaab-scope":"read","x-kaab-action":"job.read","parameters":[{"in":"path","name":"id","schema":{"type":"string","pattern":"^job_[0-9a-hjkmnp-tv-z]{26}$"},"required":true},{"in":"query","name":"step","schema":{"type":"string","minLength":1}}],"responses":{"302":{"description":"Presigned snapshot URL, valid 15 minutes","headers":{"X-Kaab-Request-Id":{"description":"Request correlation id","schema":{"type":"string"}},"X-Credits-Remaining":{"description":"Credits left after this call","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per window","schema":{"type":"string"}},"X-RateLimit-Remaining":{"description":"Requests left in the window","schema":{"type":"string"}},"X-RateLimit-Reset":{"description":"Window reset, unix seconds","schema":{"type":"string"}},"Location":{"description":"Location","schema":{"type":"string"}}}},"400":{"description":"`request_invalid`: request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The key's scope does not cover this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"`internal`: unexpected server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/jobs/{id}/screenshot":{"get":{"operationId":"getJobScreenshot","summary":"Redirect to a presigned screenshot URL","tags":["jobs"],"x-kaab-scope":"read","x-kaab-action":"job.read","parameters":[{"in":"path","name":"id","schema":{"type":"string","pattern":"^job_[0-9a-hjkmnp-tv-z]{26}$"},"required":true},{"in":"query","name":"step","schema":{"type":"string","minLength":1}}],"responses":{"302":{"description":"Presigned JPEG URL, valid 15 minutes","headers":{"X-Kaab-Request-Id":{"description":"Request correlation id","schema":{"type":"string"}},"X-Credits-Remaining":{"description":"Credits left after this call","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per window","schema":{"type":"string"}},"X-RateLimit-Remaining":{"description":"Requests left in the window","schema":{"type":"string"}},"X-RateLimit-Reset":{"description":"Window reset, unix seconds","schema":{"type":"string"}},"Location":{"description":"Location","schema":{"type":"string"}}}},"400":{"description":"`request_invalid`: request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The key's scope does not cover this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"`internal`: unexpected server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/jobs/{id}/artifacts/{name}":{"get":{"operationId":"getJobArtifact","summary":"Redirect to a presigned artifact URL","tags":["jobs"],"x-kaab-scope":"read","x-kaab-action":"job.read","parameters":[{"in":"path","name":"id","schema":{"type":"string","pattern":"^job_[0-9a-hjkmnp-tv-z]{26}$"},"required":true},{"in":"path","name":"name","schema":{"type":"string","minLength":1},"required":true}],"responses":{"302":{"description":"Presigned artifact URL, valid 15 minutes","headers":{"X-Kaab-Request-Id":{"description":"Request correlation id","schema":{"type":"string"}},"X-Credits-Remaining":{"description":"Credits left after this call","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per window","schema":{"type":"string"}},"X-RateLimit-Remaining":{"description":"Requests left in the window","schema":{"type":"string"}},"X-RateLimit-Reset":{"description":"Window reset, unix seconds","schema":{"type":"string"}},"Location":{"description":"Location","schema":{"type":"string"}}}},"400":{"description":"`request_invalid`: request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The key's scope does not cover this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"`internal`: unexpected server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/jobs/{id}/input":{"post":{"operationId":"submitJobInput","summary":"Supply the value an `await_input` step is waiting for","tags":["jobs"],"x-kaab-scope":"run","x-kaab-action":"job.resume","x-kaab-session-auth":true,"parameters":[{"in":"path","name":"id","schema":{"type":"string","pattern":"^job_[0-9a-hjkmnp-tv-z]{26}$"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"values":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["values"],"additionalProperties":false},{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}]}}}},"responses":{"200":{"description":"Job resumed","headers":{"X-Kaab-Request-Id":{"description":"Request correlation id","schema":{"type":"string"}},"X-Credits-Remaining":{"description":"Credits left after this call","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per window","schema":{"type":"string"}},"X-RateLimit-Remaining":{"description":"Requests left in the window","schema":{"type":"string"}},"X-RateLimit-Reset":{"description":"Window reset, unix seconds","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}}},"400":{"description":"`request_invalid`: request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"`insufficient_credits`: top up to continue","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The key's scope does not cover this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflicting state (see `error.code`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Semantically invalid request (see `error.code`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"`internal`: unexpected server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/jobs/{id}/resume":{"post":{"operationId":"resumeJob","summary":"Apply a proposal, skip a step, retry from a checkpoint, continue or abort","tags":["jobs"],"x-kaab-scope":"run","x-kaab-action":"job.resume","x-kaab-session-auth":true,"parameters":[{"in":"path","name":"id","schema":{"type":"string","pattern":"^job_[0-9a-hjkmnp-tv-z]{26}$"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"apply":{"type":"string","pattern":"^prp_[0-9a-hjkmnp-tv-z]{26}$"},"promote":{"type":"boolean"},"remember":{"type":"string","enum":["none","site"]}},"required":["apply"],"additionalProperties":false},{"type":"object","properties":{"skip_step":{"type":"boolean","const":true}},"required":["skip_step"],"additionalProperties":false},{"type":"object","properties":{"retry_from":{"type":"string","minLength":1}},"required":["retry_from"],"additionalProperties":false},{"type":"object","properties":{"continue":{"type":"boolean","const":true}},"required":["continue"],"additionalProperties":false},{"type":"object","properties":{"abort":{"type":"boolean","const":true}},"required":["abort"],"additionalProperties":false}]}}}},"responses":{"200":{"description":"Job resumed","headers":{"X-Kaab-Request-Id":{"description":"Request correlation id","schema":{"type":"string"}},"X-Credits-Remaining":{"description":"Credits left after this call","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per window","schema":{"type":"string"}},"X-RateLimit-Remaining":{"description":"Requests left in the window","schema":{"type":"string"}},"X-RateLimit-Reset":{"description":"Window reset, unix seconds","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}}},"400":{"description":"`request_invalid`: request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"`insufficient_credits`: top up to continue","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The key's scope does not cover this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflicting state (see `error.code`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Semantically invalid request (see `error.code`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"`internal`: unexpected server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/jobs/{id}/takeover":{"post":{"operationId":"takeoverJob","summary":"Open a live browser session on a parked job","tags":["jobs"],"x-kaab-scope":"run","x-kaab-action":"job.takeover","parameters":[{"in":"path","name":"id","schema":{"type":"string","pattern":"^job_[0-9a-hjkmnp-tv-z]{26}$"},"required":true}],"responses":{"201":{"description":"Live session","headers":{"X-Kaab-Request-Id":{"description":"Request correlation id","schema":{"type":"string"}},"X-Credits-Remaining":{"description":"Credits left after this call","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per window","schema":{"type":"string"}},"X-RateLimit-Remaining":{"description":"Requests left in the window","schema":{"type":"string"}},"X-RateLimit-Reset":{"description":"Window reset, unix seconds","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"live_url":{"type":"string","format":"uri"},"token":{"type":"string"},"expires_in":{"type":"integer","minimum":1}},"required":["live_url","token","expires_in"],"additionalProperties":false}}}},"400":{"description":"`request_invalid`: request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"`insufficient_credits`: top up to continue","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The key's scope does not cover this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflicting state (see `error.code`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Semantically invalid request (see `error.code`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"`internal`: unexpected server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/jobs/{id}/cancel":{"post":{"operationId":"cancelJob","summary":"Cancel a job and release its reserved credits","tags":["jobs"],"x-kaab-scope":"run","x-kaab-action":"job.cancel","x-kaab-session-auth":true,"parameters":[{"in":"path","name":"id","schema":{"type":"string","pattern":"^job_[0-9a-hjkmnp-tv-z]{26}$"},"required":true}],"responses":{"200":{"description":"Job canceled","headers":{"X-Kaab-Request-Id":{"description":"Request correlation id","schema":{"type":"string"}},"X-Credits-Remaining":{"description":"Credits left after this call","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per window","schema":{"type":"string"}},"X-RateLimit-Remaining":{"description":"Requests left in the window","schema":{"type":"string"}},"X-RateLimit-Reset":{"description":"Window reset, unix seconds","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}}},"400":{"description":"`request_invalid`: request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"`insufficient_credits`: top up to continue","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The key's scope does not cover this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflicting state (see `error.code`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Semantically invalid request (see `error.code`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"`internal`: unexpected server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/batches/{id}":{"get":{"operationId":"getBatch","summary":"Read batch counters","tags":["batches"],"x-kaab-scope":"read","x-kaab-action":"job.read","x-kaab-session-auth":true,"parameters":[{"in":"path","name":"id","schema":{"type":"string","pattern":"^bat_[0-9a-hjkmnp-tv-z]{26}$"},"required":true}],"responses":{"200":{"description":"Batch","headers":{"X-Kaab-Request-Id":{"description":"Request correlation id","schema":{"type":"string"}},"X-Credits-Remaining":{"description":"Credits left after this call","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per window","schema":{"type":"string"}},"X-RateLimit-Remaining":{"description":"Requests left in the window","schema":{"type":"string"}},"X-RateLimit-Reset":{"description":"Window reset, unix seconds","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Batch"}}}},"400":{"description":"`request_invalid`: request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The key's scope does not cover this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"`internal`: unexpected server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/batches/{id}/jobs":{"get":{"operationId":"listBatchJobs","summary":"List the jobs of a batch","tags":["batches"],"x-kaab-scope":"read","x-kaab-action":"job.read","x-kaab-session-auth":true,"parameters":[{"in":"path","name":"id","schema":{"type":"string","pattern":"^bat_[0-9a-hjkmnp-tv-z]{26}$"},"required":true},{"in":"query","name":"limit","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"in":"query","name":"cursor","schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Job page","headers":{"X-Kaab-Request-Id":{"description":"Request correlation id","schema":{"type":"string"}},"X-Credits-Remaining":{"description":"Credits left after this call","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per window","schema":{"type":"string"}},"X-RateLimit-Remaining":{"description":"Requests left in the window","schema":{"type":"string"}},"X-RateLimit-Reset":{"description":"Window reset, unix seconds","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Job"}},"next_cursor":{"type":["string","null"]}},"required":["data","next_cursor"],"additionalProperties":false}}}},"400":{"description":"`request_invalid`: request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The key's scope does not cover this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"`internal`: unexpected server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/programs":{"post":{"operationId":"createProgram","summary":"Create a program and its first version","tags":["programs"],"x-kaab-scope":"run","x-kaab-action":"program.write","x-kaab-session-auth":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{1,62}$"},"description":{"type":"string","maxLength":1000},"definition":{"$ref":"#/components/schemas/ProgramDefinition"},"publish":{"type":"boolean","default":true},"draft_id":{"type":"string","pattern":"^dft_[0-9a-hjkmnp-tv-z]{26}$","description":"The builder draft this version was built from; its picker confirmations move to it."}},"required":["name","definition"],"additionalProperties":false}}}},"responses":{"201":{"description":"Program","headers":{"X-Kaab-Request-Id":{"description":"Request correlation id","schema":{"type":"string"}},"X-Credits-Remaining":{"description":"Credits left after this call","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per window","schema":{"type":"string"}},"X-RateLimit-Remaining":{"description":"Requests left in the window","schema":{"type":"string"}},"X-RateLimit-Reset":{"description":"Window reset, unix seconds","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Program"}}}},"400":{"description":"`request_invalid`: request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"`insufficient_credits`: top up to continue","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The key's scope does not cover this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflicting state (see `error.code`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Semantically invalid request (see `error.code`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"`internal`: unexpected server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"get":{"operationId":"listPrograms","summary":"List programs","tags":["programs"],"x-kaab-scope":"read","x-kaab-action":"program.read","x-kaab-session-auth":true,"parameters":[{"in":"query","name":"limit","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"in":"query","name":"cursor","schema":{"type":"string","minLength":1}},{"in":"query","name":"name","schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Program page","headers":{"X-Kaab-Request-Id":{"description":"Request correlation id","schema":{"type":"string"}},"X-Credits-Remaining":{"description":"Credits left after this call","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per window","schema":{"type":"string"}},"X-RateLimit-Remaining":{"description":"Requests left in the window","schema":{"type":"string"}},"X-RateLimit-Reset":{"description":"Window reset, unix seconds","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Program"}},"next_cursor":{"type":["string","null"]}},"required":["data","next_cursor"],"additionalProperties":false}}}},"400":{"description":"`request_invalid`: request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The key's scope does not cover this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"`internal`: unexpected server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/programs/lint":{"post":{"operationId":"lintProgram","summary":"Lint a program definition and return the normalized document","tags":["programs"],"x-kaab-scope":"read","x-kaab-action":"program.read","x-kaab-session-auth":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"definition":{}},"additionalProperties":false}}}},"responses":{"200":{"description":"Lint result","headers":{"X-Kaab-Request-Id":{"description":"Request correlation id","schema":{"type":"string"}},"X-Credits-Remaining":{"description":"Credits left after this call","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per window","schema":{"type":"string"}},"X-RateLimit-Remaining":{"description":"Requests left in the window","schema":{"type":"string"}},"X-RateLimit-Reset":{"description":"Window reset, unix seconds","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string","enum":["E001","E002","E003","E004","E005","E006","E007","E008","E009","E010","E011","E012","E013","E014","W001","W002","W003","W004","W005","W006","W007","W008","W009","W010"]},"path":{"type":"string"},"message":{"type":"string"}},"required":["code","path","message"],"additionalProperties":false}},"warnings":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string","enum":["E001","E002","E003","E004","E005","E006","E007","E008","E009","E010","E011","E012","E013","E014","W001","W002","W003","W004","W005","W006","W007","W008","W009","W010"]},"path":{"type":"string"},"message":{"type":"string"}},"required":["code","path","message"],"additionalProperties":false}},"normalized":{"type":["object","null"],"additionalProperties":{}}},"required":["errors","warnings","normalized"],"additionalProperties":false}}}},"400":{"description":"`request_invalid`: request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The key's scope does not cover this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"`internal`: unexpected server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/programs/{id}":{"get":{"operationId":"getProgram","summary":"Read a program by id or name","tags":["programs"],"x-kaab-scope":"read","x-kaab-action":"program.read","x-kaab-session-auth":true,"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true}],"responses":{"200":{"description":"Program","headers":{"X-Kaab-Request-Id":{"description":"Request correlation id","schema":{"type":"string"}},"X-Credits-Remaining":{"description":"Credits left after this call","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per window","schema":{"type":"string"}},"X-RateLimit-Remaining":{"description":"Requests left in the window","schema":{"type":"string"}},"X-RateLimit-Reset":{"description":"Window reset, unix seconds","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Program"}}}},"400":{"description":"`request_invalid`: request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The key's scope does not cover this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"`internal`: unexpected server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"operationId":"updateProgram","summary":"Rename a program or change its description and canary settings","tags":["programs"],"x-kaab-scope":"run","x-kaab-action":"program.write","x-kaab-session-auth":true,"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{1,62}$"},"description":{"type":["string","null"],"maxLength":1000},"canary":{"type":"object","properties":{"enabled":{"type":"boolean"},"cron":{"type":"string","minLength":1},"url":{"type":"string"},"inputs":{"type":"object","additionalProperties":{}}},"additionalProperties":false}},"additionalProperties":false}}}},"responses":{"200":{"description":"Program","headers":{"X-Kaab-Request-Id":{"description":"Request correlation id","schema":{"type":"string"}},"X-Credits-Remaining":{"description":"Credits left after this call","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per window","schema":{"type":"string"}},"X-RateLimit-Remaining":{"description":"Requests left in the window","schema":{"type":"string"}},"X-RateLimit-Reset":{"description":"Window reset, unix seconds","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Program"}}}},"400":{"description":"`request_invalid`: request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"`insufficient_credits`: top up to continue","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The key's scope does not cover this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflicting state (see `error.code`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Semantically invalid request (see `error.code`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"`internal`: unexpected server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"operationId":"deleteProgram","summary":"Soft-delete a program","tags":["programs"],"x-kaab-scope":"admin","x-kaab-action":"program.write","x-kaab-session-auth":true,"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true}],"responses":{"204":{"description":"Deleted","headers":{"X-Kaab-Request-Id":{"description":"Request correlation id","schema":{"type":"string"}},"X-Credits-Remaining":{"description":"Credits left after this call","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per window","schema":{"type":"string"}},"X-RateLimit-Remaining":{"description":"Requests left in the window","schema":{"type":"string"}},"X-RateLimit-Reset":{"description":"Window reset, unix seconds","schema":{"type":"string"}}}},"400":{"description":"`request_invalid`: request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"`insufficient_credits`: top up to continue","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The key's scope does not cover this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflicting state (see `error.code`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Semantically invalid request (see `error.code`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"`internal`: unexpected server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/programs/{id}/versions":{"get":{"operationId":"listProgramVersions","summary":"List the versions of a program","tags":["programs"],"x-kaab-scope":"read","x-kaab-action":"program.read","x-kaab-session-auth":true,"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true},{"in":"query","name":"limit","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"in":"query","name":"cursor","schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Version page","headers":{"X-Kaab-Request-Id":{"description":"Request correlation id","schema":{"type":"string"}},"X-Credits-Remaining":{"description":"Credits left after this call","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per window","schema":{"type":"string"}},"X-RateLimit-Remaining":{"description":"Requests left in the window","schema":{"type":"string"}},"X-RateLimit-Reset":{"description":"Window reset, unix seconds","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ProgramVersion"}},"next_cursor":{"type":["string","null"]}},"required":["data","next_cursor"],"additionalProperties":false}}}},"400":{"description":"`request_invalid`: request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The key's scope does not cover this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"`internal`: unexpected server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"operationId":"createProgramVersion","summary":"Add a version to a program","tags":["programs"],"x-kaab-scope":"run","x-kaab-action":"program.write","x-kaab-session-auth":true,"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"definition":{"$ref":"#/components/schemas/ProgramDefinition"},"notes":{"type":"string","maxLength":1000},"publish":{"type":"boolean","default":true},"draft_id":{"type":"string","pattern":"^dft_[0-9a-hjkmnp-tv-z]{26}$","description":"The builder draft this version was built from; its picker confirmations move to it."}},"required":["definition"],"additionalProperties":false}}}},"responses":{"201":{"description":"Version","headers":{"X-Kaab-Request-Id":{"description":"Request correlation id","schema":{"type":"string"}},"X-Credits-Remaining":{"description":"Credits left after this call","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per window","schema":{"type":"string"}},"X-RateLimit-Remaining":{"description":"Requests left in the window","schema":{"type":"string"}},"X-RateLimit-Reset":{"description":"Window reset, unix seconds","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProgramVersion"}}}},"400":{"description":"`request_invalid`: request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"`insufficient_credits`: top up to continue","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The key's scope does not cover this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflicting state (see `error.code`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Semantically invalid request (see `error.code`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"`internal`: unexpected server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/programs/{id}/versions/{n}":{"put":{"operationId":"updateProgramVersion","summary":"Replace a draft version's definition in place; published versions are immutable","tags":["programs"],"x-kaab-scope":"run","x-kaab-action":"program.write","x-kaab-session-auth":true,"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true},{"in":"path","name":"n","schema":{"type":"integer","minimum":1},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"definition":{"$ref":"#/components/schemas/ProgramDefinition"},"notes":{"type":"string","maxLength":1000},"draft_id":{"type":"string","pattern":"^dft_[0-9a-hjkmnp-tv-z]{26}$","description":"The builder draft this version was built from; its picker confirmations move to it."}},"required":["definition"],"additionalProperties":false}}}},"responses":{"200":{"description":"Version","headers":{"X-Kaab-Request-Id":{"description":"Request correlation id","schema":{"type":"string"}},"X-Credits-Remaining":{"description":"Credits left after this call","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per window","schema":{"type":"string"}},"X-RateLimit-Remaining":{"description":"Requests left in the window","schema":{"type":"string"}},"X-RateLimit-Reset":{"description":"Window reset, unix seconds","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProgramVersion"}}}},"400":{"description":"`request_invalid`: request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"`insufficient_credits`: top up to continue","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The key's scope does not cover this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflicting state (see `error.code`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Semantically invalid request (see `error.code`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"`internal`: unexpected server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"operationId":"deleteProgramVersion","summary":"Delete a draft version (it is archived); published versions are immutable","tags":["programs"],"x-kaab-scope":"run","x-kaab-action":"program.write","x-kaab-session-auth":true,"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true},{"in":"path","name":"n","schema":{"type":"integer","minimum":1},"required":true}],"responses":{"204":{"description":"Deleted","headers":{"X-Kaab-Request-Id":{"description":"Request correlation id","schema":{"type":"string"}},"X-Credits-Remaining":{"description":"Credits left after this call","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per window","schema":{"type":"string"}},"X-RateLimit-Remaining":{"description":"Requests left in the window","schema":{"type":"string"}},"X-RateLimit-Reset":{"description":"Window reset, unix seconds","schema":{"type":"string"}}}},"400":{"description":"`request_invalid`: request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"`insufficient_credits`: top up to continue","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The key's scope does not cover this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflicting state (see `error.code`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Semantically invalid request (see `error.code`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"`internal`: unexpected server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"get":{"operationId":"getProgramVersion","summary":"Read one version including its definition","tags":["programs"],"x-kaab-scope":"read","x-kaab-action":"program.read","x-kaab-session-auth":true,"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true},{"in":"path","name":"n","schema":{"type":"integer","minimum":1},"required":true}],"responses":{"200":{"description":"Version","headers":{"X-Kaab-Request-Id":{"description":"Request correlation id","schema":{"type":"string"}},"X-Credits-Remaining":{"description":"Credits left after this call","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per window","schema":{"type":"string"}},"X-RateLimit-Remaining":{"description":"Requests left in the window","schema":{"type":"string"}},"X-RateLimit-Reset":{"description":"Window reset, unix seconds","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProgramVersion"}}}},"400":{"description":"`request_invalid`: request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The key's scope does not cover this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"`internal`: unexpected server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/programs/{id}/versions/{n}/publish":{"post":{"operationId":"publishProgramVersion","summary":"Publish a draft version and move the `latest` alias","tags":["programs"],"x-kaab-scope":"run","x-kaab-action":"program.publish","x-kaab-session-auth":true,"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true},{"in":"path","name":"n","schema":{"type":"integer","minimum":1},"required":true}],"responses":{"200":{"description":"Version","headers":{"X-Kaab-Request-Id":{"description":"Request correlation id","schema":{"type":"string"}},"X-Credits-Remaining":{"description":"Credits left after this call","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per window","schema":{"type":"string"}},"X-RateLimit-Remaining":{"description":"Requests left in the window","schema":{"type":"string"}},"X-RateLimit-Reset":{"description":"Window reset, unix seconds","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProgramVersion"}}}},"400":{"description":"`request_invalid`: request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"`insufficient_credits`: top up to continue","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The key's scope does not cover this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflicting state (see `error.code`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Semantically invalid request (see `error.code`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"`internal`: unexpected server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/programs/{id}/versions/{n}/diff":{"get":{"operationId":"diffProgramVersion","summary":"RFC 6902 JSON Patch between two versions","tags":["programs"],"x-kaab-scope":"read","x-kaab-action":"program.read","x-kaab-session-auth":true,"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true},{"in":"path","name":"n","schema":{"type":"integer","minimum":1},"required":true},{"in":"query","name":"against","schema":{"type":"integer","minimum":1},"required":true}],"responses":{"200":{"description":"Patch","headers":{"X-Kaab-Request-Id":{"description":"Request correlation id","schema":{"type":"string"}},"X-Credits-Remaining":{"description":"Credits left after this call","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per window","schema":{"type":"string"}},"X-RateLimit-Remaining":{"description":"Requests left in the window","schema":{"type":"string"}},"X-RateLimit-Reset":{"description":"Window reset, unix seconds","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"patch":{"type":"array","items":{"type":"object","properties":{"op":{"type":"string","enum":["add","remove","replace","move","copy","test"]},"path":{"type":"string"},"from":{"type":"string"},"value":{}},"required":["op","path"],"additionalProperties":false}}},"required":["patch"],"additionalProperties":false}}}},"400":{"description":"`request_invalid`: request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The key's scope does not cover this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"`internal`: unexpected server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/programs/{id}/versions/{n}/replay":{"post":{"operationId":"replayProgramVersion","summary":"Run extraction against a stored snapshot without fetching","tags":["programs"],"x-kaab-scope":"run","x-kaab-action":"program.write","x-kaab-session-auth":true,"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true},{"in":"path","name":"n","schema":{"type":"integer","minimum":1},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"snapshot":{"anyOf":[{"type":"string","minLength":1},{"type":"string","const":"ground_truth"}]}},"required":["snapshot"],"additionalProperties":false}}}},"responses":{"200":{"description":"Replay result","headers":{"X-Kaab-Request-Id":{"description":"Request correlation id","schema":{"type":"string"}},"X-Credits-Remaining":{"description":"Credits left after this call","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per window","schema":{"type":"string"}},"X-RateLimit-Remaining":{"description":"Requests left in the window","schema":{"type":"string"}},"X-RateLimit-Reset":{"description":"Window reset, unix seconds","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","additionalProperties":{}},"raw":{"type":"object","additionalProperties":{}},"warnings":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string","enum":["null_marker","parse_failed","out_of_range","required_missing","list_short","fill_rate_drop","escalated","healed_locator_used","obstacle_dismissed","field_empty","step_skipped","cache_hit","byo_fallback_used","pdf_source_not_extractable","pdf_no_text","pdf_pages_truncated","redirect_not_followed","pagination_incomplete","captcha_inject_navigated"]},"field":{"type":["string","null"]},"raw":{"type":["string","null"]},"step":{"type":["string","null"]},"message":{"type":"string"},"detail":{"type":"string"},"count":{"type":"integer","minimum":1},"of":{"type":"integer","minimum":0},"hint":{"type":"object","properties":{"date_format":{"type":"string"},"date_formats":{"type":"array","items":{"type":"string"}},"ambiguous":{"type":"boolean","const":true},"locale":{"type":"string"}},"additionalProperties":false}},"required":["code"],"additionalProperties":false}}},"required":["data","raw","warnings"],"additionalProperties":false}}}},"400":{"description":"`request_invalid`: request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"`insufficient_credits`: top up to continue","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The key's scope does not cover this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflicting state (see `error.code`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Semantically invalid request (see `error.code`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"`internal`: unexpected server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/programs/{id}/aliases/{alias}":{"put":{"operationId":"setProgramAlias","summary":"Point an alias at a version","tags":["programs"],"x-kaab-scope":"run","x-kaab-action":"alias.update","x-kaab-session-auth":true,"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true},{"in":"path","name":"alias","schema":{"type":"string","minLength":1},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"version":{"type":"integer","minimum":1}},"required":["version"],"additionalProperties":false}}}},"responses":{"200":{"description":"Program","headers":{"X-Kaab-Request-Id":{"description":"Request correlation id","schema":{"type":"string"}},"X-Credits-Remaining":{"description":"Credits left after this call","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per window","schema":{"type":"string"}},"X-RateLimit-Remaining":{"description":"Requests left in the window","schema":{"type":"string"}},"X-RateLimit-Reset":{"description":"Window reset, unix seconds","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Program"}}}},"400":{"description":"`request_invalid`: request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"`insufficient_credits`: top up to continue","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The key's scope does not cover this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflicting state (see `error.code`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Semantically invalid request (see `error.code`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"`internal`: unexpected server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"operationId":"deleteProgramAlias","summary":"Remove an alias","tags":["programs"],"x-kaab-scope":"run","x-kaab-action":"alias.update","x-kaab-session-auth":true,"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true},{"in":"path","name":"alias","schema":{"type":"string","minLength":1},"required":true}],"responses":{"204":{"description":"Deleted","headers":{"X-Kaab-Request-Id":{"description":"Request correlation id","schema":{"type":"string"}},"X-Credits-Remaining":{"description":"Credits left after this call","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per window","schema":{"type":"string"}},"X-RateLimit-Remaining":{"description":"Requests left in the window","schema":{"type":"string"}},"X-RateLimit-Reset":{"description":"Window reset, unix seconds","schema":{"type":"string"}}}},"400":{"description":"`request_invalid`: request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"`insufficient_credits`: top up to continue","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The key's scope does not cover this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflicting state (see `error.code`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Semantically invalid request (see `error.code`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"`internal`: unexpected server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/sessions":{"post":{"operationId":"createSession","summary":"Store a browser storage state as a reusable session","tags":["sessions"],"x-kaab-scope":"run","x-kaab-action":"session.write","x-kaab-session-auth":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{1,62}$"},"storage_state":{"type":"object","properties":{"cookies":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"value":{"type":"string"},"domain":{"type":"string"},"path":{"type":"string"},"expires":{"type":"number"},"httpOnly":{"type":"boolean"},"secure":{"type":"boolean"},"sameSite":{"type":"string","enum":["Strict","Lax","None"]}},"required":["name","value","domain","path","expires","httpOnly","secure","sameSite"],"additionalProperties":false}},"origins":{"type":"array","items":{"type":"object","properties":{"origin":{"type":"string"},"localStorage":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"value":{"type":"string"}},"required":["name","value"],"additionalProperties":false}}},"required":["origin","localStorage"],"additionalProperties":false}}},"required":["cookies","origins"],"additionalProperties":false},"origins":{"type":"array","items":{"type":"string"}},"concurrency":{"type":"string","enum":["exclusive","shared"],"default":"exclusive"},"refresh":{"type":"object","properties":{"program":{"type":"string","minLength":1},"inputs":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["program"],"additionalProperties":false}},"required":["name","storage_state"],"additionalProperties":false}}}},"responses":{"201":{"description":"Session","headers":{"X-Kaab-Request-Id":{"description":"Request correlation id","schema":{"type":"string"}},"X-Credits-Remaining":{"description":"Credits left after this call","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per window","schema":{"type":"string"}},"X-RateLimit-Remaining":{"description":"Requests left in the window","schema":{"type":"string"}},"X-RateLimit-Reset":{"description":"Window reset, unix seconds","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Session"}}}},"400":{"description":"`request_invalid`: request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"`insufficient_credits`: top up to continue","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The key's scope does not cover this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflicting state (see `error.code`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Semantically invalid request (see `error.code`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"`internal`: unexpected server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"get":{"operationId":"listSessions","summary":"List sessions","tags":["sessions"],"x-kaab-scope":"read","x-kaab-action":"session.read","x-kaab-session-auth":true,"parameters":[{"in":"query","name":"limit","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"in":"query","name":"cursor","schema":{"type":"string","minLength":1}},{"in":"query","name":"status","schema":{"type":"string","enum":["valid","expired","unknown"]}}],"responses":{"200":{"description":"Session page","headers":{"X-Kaab-Request-Id":{"description":"Request correlation id","schema":{"type":"string"}},"X-Credits-Remaining":{"description":"Credits left after this call","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per window","schema":{"type":"string"}},"X-RateLimit-Remaining":{"description":"Requests left in the window","schema":{"type":"string"}},"X-RateLimit-Reset":{"description":"Window reset, unix seconds","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Session"}},"next_cursor":{"type":["string","null"]}},"required":["data","next_cursor"],"additionalProperties":false}}}},"400":{"description":"`request_invalid`: request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The key's scope does not cover this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"`internal`: unexpected server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/sessions/{id}":{"get":{"operationId":"getSession","summary":"Read a session by id or name","tags":["sessions"],"x-kaab-scope":"read","x-kaab-action":"session.read","x-kaab-session-auth":true,"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true}],"responses":{"200":{"description":"Session","headers":{"X-Kaab-Request-Id":{"description":"Request correlation id","schema":{"type":"string"}},"X-Credits-Remaining":{"description":"Credits left after this call","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per window","schema":{"type":"string"}},"X-RateLimit-Remaining":{"description":"Requests left in the window","schema":{"type":"string"}},"X-RateLimit-Reset":{"description":"Window reset, unix seconds","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Session"}}}},"400":{"description":"`request_invalid`: request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The key's scope does not cover this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"`internal`: unexpected server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"operationId":"updateSession","summary":"Rename a session or replace its storage state","tags":["sessions"],"x-kaab-scope":"run","x-kaab-action":"session.write","x-kaab-session-auth":true,"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{1,62}$"},"concurrency":{"type":"string","enum":["exclusive","shared"]},"refresh":{"type":["object","null"],"properties":{"program":{"type":"string","minLength":1},"inputs":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["program"],"additionalProperties":false},"storage_state":{"type":"object","properties":{"cookies":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"value":{"type":"string"},"domain":{"type":"string"},"path":{"type":"string"},"expires":{"type":"number"},"httpOnly":{"type":"boolean"},"secure":{"type":"boolean"},"sameSite":{"type":"string","enum":["Strict","Lax","None"]}},"required":["name","value","domain","path","expires","httpOnly","secure","sameSite"],"additionalProperties":false}},"origins":{"type":"array","items":{"type":"object","properties":{"origin":{"type":"string"},"localStorage":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"value":{"type":"string"}},"required":["name","value"],"additionalProperties":false}}},"required":["origin","localStorage"],"additionalProperties":false}}},"required":["cookies","origins"],"additionalProperties":false}},"additionalProperties":false}}}},"responses":{"200":{"description":"Session","headers":{"X-Kaab-Request-Id":{"description":"Request correlation id","schema":{"type":"string"}},"X-Credits-Remaining":{"description":"Credits left after this call","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per window","schema":{"type":"string"}},"X-RateLimit-Remaining":{"description":"Requests left in the window","schema":{"type":"string"}},"X-RateLimit-Reset":{"description":"Window reset, unix seconds","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Session"}}}},"400":{"description":"`request_invalid`: request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"`insufficient_credits`: top up to continue","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The key's scope does not cover this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflicting state (see `error.code`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Semantically invalid request (see `error.code`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"`internal`: unexpected server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"operationId":"deleteSession","summary":"Delete a session","tags":["sessions"],"x-kaab-scope":"run","x-kaab-action":"session.write","x-kaab-session-auth":true,"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true}],"responses":{"204":{"description":"Deleted","headers":{"X-Kaab-Request-Id":{"description":"Request correlation id","schema":{"type":"string"}},"X-Credits-Remaining":{"description":"Credits left after this call","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per window","schema":{"type":"string"}},"X-RateLimit-Remaining":{"description":"Requests left in the window","schema":{"type":"string"}},"X-RateLimit-Reset":{"description":"Window reset, unix seconds","schema":{"type":"string"}}}},"400":{"description":"`request_invalid`: request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"`insufficient_credits`: top up to continue","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The key's scope does not cover this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflicting state (see `error.code`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Semantically invalid request (see `error.code`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"`internal`: unexpected server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/sessions/{id}/verify":{"post":{"operationId":"verifySession","summary":"Run the validity probe","tags":["sessions"],"x-kaab-scope":"run","x-kaab-action":"session.write","x-kaab-session-auth":true,"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true}],"responses":{"200":{"description":"Probe result","headers":{"X-Kaab-Request-Id":{"description":"Request correlation id","schema":{"type":"string"}},"X-Credits-Remaining":{"description":"Credits left after this call","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per window","schema":{"type":"string"}},"X-RateLimit-Remaining":{"description":"Requests left in the window","schema":{"type":"string"}},"X-RateLimit-Reset":{"description":"Window reset, unix seconds","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["valid","expired","unknown"]},"checked_at":{"type":"string","format":"date-time"}},"required":["status","checked_at"],"additionalProperties":false}}}},"400":{"description":"`request_invalid`: request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"`insufficient_credits`: top up to continue","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The key's scope does not cover this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflicting state (see `error.code`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Semantically invalid request (see `error.code`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"`internal`: unexpected server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/sessions/{id}/refresh":{"post":{"operationId":"refreshSession","summary":"Enqueue the session's refresh program","tags":["sessions"],"x-kaab-scope":"run","x-kaab-action":"session.write","parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true}],"responses":{"202":{"description":"Refresh job","headers":{"X-Kaab-Request-Id":{"description":"Request correlation id","schema":{"type":"string"}},"X-Credits-Remaining":{"description":"Credits left after this call","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per window","schema":{"type":"string"}},"X-RateLimit-Remaining":{"description":"Requests left in the window","schema":{"type":"string"}},"X-RateLimit-Reset":{"description":"Window reset, unix seconds","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}}},"400":{"description":"`request_invalid`: request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"`insufficient_credits`: top up to continue","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The key's scope does not cover this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflicting state (see `error.code`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Semantically invalid request (see `error.code`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"`internal`: unexpected server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/proposals":{"get":{"operationId":"listProposals","summary":"List proposals","tags":["proposals"],"x-kaab-scope":"read","x-kaab-action":"proposal.read","x-kaab-session-auth":true,"parameters":[{"in":"query","name":"limit","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"in":"query","name":"cursor","schema":{"type":"string","minLength":1}},{"in":"query","name":"status","schema":{"type":"string","enum":["pending","approved","rejected","expired"]}},{"in":"query","name":"program","schema":{"type":"string","minLength":1}},{"in":"query","name":"kind","schema":{"type":"string","enum":["relocate","dismiss","insert_steps","parser_config","api_discovery"]}}],"responses":{"200":{"description":"Proposal page","headers":{"X-Kaab-Request-Id":{"description":"Request correlation id","schema":{"type":"string"}},"X-Credits-Remaining":{"description":"Credits left after this call","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per window","schema":{"type":"string"}},"X-RateLimit-Remaining":{"description":"Requests left in the window","schema":{"type":"string"}},"X-RateLimit-Reset":{"description":"Window reset, unix seconds","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Proposal"}},"next_cursor":{"type":["string","null"]}},"required":["data","next_cursor"],"additionalProperties":false}}}},"400":{"description":"`request_invalid`: request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The key's scope does not cover this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"`internal`: unexpected server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/proposals/{id}":{"get":{"operationId":"getProposal","summary":"Read a proposal","tags":["proposals"],"x-kaab-scope":"read","x-kaab-action":"proposal.read","x-kaab-session-auth":true,"parameters":[{"in":"path","name":"id","schema":{"type":"string","pattern":"^prp_[0-9a-hjkmnp-tv-z]{26}$"},"required":true}],"responses":{"200":{"description":"Proposal","headers":{"X-Kaab-Request-Id":{"description":"Request correlation id","schema":{"type":"string"}},"X-Credits-Remaining":{"description":"Credits left after this call","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per window","schema":{"type":"string"}},"X-RateLimit-Remaining":{"description":"Requests left in the window","schema":{"type":"string"}},"X-RateLimit-Reset":{"description":"Window reset, unix seconds","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Proposal"}}}},"400":{"description":"`request_invalid`: request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The key's scope does not cover this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"`internal`: unexpected server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/proposals/{id}/approve":{"post":{"operationId":"approveProposal","summary":"Approve a proposal, optionally promoting it to a new version","tags":["proposals"],"x-kaab-scope":"run","x-kaab-action":"proposal.decide","x-kaab-session-auth":true,"parameters":[{"in":"path","name":"id","schema":{"type":"string","pattern":"^prp_[0-9a-hjkmnp-tv-z]{26}$"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"promote":{"type":"boolean","default":false},"remember":{"type":"string","enum":["none","site"],"default":"none"},"notes":{"type":"string","maxLength":1000}},"additionalProperties":false}}}},"responses":{"200":{"description":"Proposal","headers":{"X-Kaab-Request-Id":{"description":"Request correlation id","schema":{"type":"string"}},"X-Credits-Remaining":{"description":"Credits left after this call","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per window","schema":{"type":"string"}},"X-RateLimit-Remaining":{"description":"Requests left in the window","schema":{"type":"string"}},"X-RateLimit-Reset":{"description":"Window reset, unix seconds","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Proposal"}}}},"400":{"description":"`request_invalid`: request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"`insufficient_credits`: top up to continue","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The key's scope does not cover this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflicting state (see `error.code`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Semantically invalid request (see `error.code`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"`internal`: unexpected server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/proposals/{id}/reject":{"post":{"operationId":"rejectProposal","summary":"Reject a proposal","tags":["proposals"],"x-kaab-scope":"run","x-kaab-action":"proposal.decide","x-kaab-session-auth":true,"parameters":[{"in":"path","name":"id","schema":{"type":"string","pattern":"^prp_[0-9a-hjkmnp-tv-z]{26}$"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string","maxLength":1000}},"additionalProperties":false}}}},"responses":{"200":{"description":"Proposal","headers":{"X-Kaab-Request-Id":{"description":"Request correlation id","schema":{"type":"string"}},"X-Credits-Remaining":{"description":"Credits left after this call","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per window","schema":{"type":"string"}},"X-RateLimit-Remaining":{"description":"Requests left in the window","schema":{"type":"string"}},"X-RateLimit-Reset":{"description":"Window reset, unix seconds","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Proposal"}}}},"400":{"description":"`request_invalid`: request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"`insufficient_credits`: top up to continue","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The key's scope does not cover this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflicting state (see `error.code`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Semantically invalid request (see `error.code`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"`internal`: unexpected server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/proposals/{id}/edit":{"post":{"operationId":"editProposal","summary":"Replace the proposed change before approval","tags":["proposals"],"x-kaab-scope":"run","x-kaab-action":"proposal.decide","x-kaab-session-auth":true,"parameters":[{"in":"path","name":"id","schema":{"type":"string","pattern":"^prp_[0-9a-hjkmnp-tv-z]{26}$"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"new":{"type":"object","additionalProperties":{}}},"required":["new"],"additionalProperties":false}}}},"responses":{"200":{"description":"Proposal","headers":{"X-Kaab-Request-Id":{"description":"Request correlation id","schema":{"type":"string"}},"X-Credits-Remaining":{"description":"Credits left after this call","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per window","schema":{"type":"string"}},"X-RateLimit-Remaining":{"description":"Requests left in the window","schema":{"type":"string"}},"X-RateLimit-Reset":{"description":"Window reset, unix seconds","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Proposal"}}}},"400":{"description":"`request_invalid`: request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"`insufficient_credits`: top up to continue","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The key's scope does not cover this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflicting state (see `error.code`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Semantically invalid request (see `error.code`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"`internal`: unexpected server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/schedules":{"post":{"operationId":"createSchedule","summary":"Create a cron schedule for a program","tags":["schedules"],"x-kaab-scope":"run","x-kaab-action":"schedule.write","x-kaab-session-auth":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"program":{"type":"string","minLength":1},"inputs":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}},"cron":{"type":"string","pattern":"^\\S+\\s+\\S+\\s+\\S+\\s+\\S+\\s+\\S+$"},"timezone":{"type":"string","minLength":1,"default":"UTC"},"change_detection":{"type":"object","properties":{"enabled":{"type":"boolean"},"fields":{"type":"array","items":{"type":"string","minLength":1}}},"required":["enabled"],"additionalProperties":false},"webhook_url":{"type":"string","format":"uri"},"options":{"type":"object","properties":{"region":{"type":"string","enum":["eu","us"]},"max_tier":{"type":"string","enum":["http","browser","stealth"]},"prefer_tier":{"type":"string","enum":["http","browser","stealth"]},"assets":{"type":"string","enum":["block","allow"]},"block_urls":{"type":"array","items":{"type":"string","minLength":1,"maxLength":500},"maxItems":50},"proxy":{"type":"object","properties":{"mode":{"type":"string","enum":["platform","byo"]},"byo_id":{"type":"string","pattern":"^byo_[0-9a-hjkmnp-tv-z]{26}$"},"country":{"type":"string","pattern":"^[A-Z]{2}$"},"pool":{"type":"string","enum":["datacenter","residential","mobile"]},"fallback":{"type":"string","enum":["platform","none"]}},"additionalProperties":false},"llm":{"type":"object","properties":{"byo_id":{"type":"string","pattern":"^byo_[0-9a-hjkmnp-tv-z]{26}$"}},"additionalProperties":false},"captcha":{"type":"object","properties":{"byo_id":{"type":"string","pattern":"^byo_[0-9a-hjkmnp-tv-z]{26}$"}},"additionalProperties":false},"session":{"type":"string","minLength":1},"resume_from_session":{"type":"boolean"},"session_probe":{"type":"string","enum":["http","browser"]},"cache":{"type":"object","properties":{"max_age":{"type":"integer","minimum":0,"maximum":86400}},"required":["max_age"],"additionalProperties":false},"viewport":{"type":"object","properties":{"width":{"type":"integer","minimum":320,"maximum":3840},"height":{"type":"integer","minimum":240,"maximum":2160}},"required":["width","height"],"additionalProperties":false},"browser_profile":{"type":"string","enum":["desktop","mobile"]},"engine":{"type":"string","enum":["chromium","firefox"]},"fill_mode":{"type":"string","enum":["insert","type"]},"follow_popups":{"type":"boolean"},"locale":{"type":"string","minLength":2},"timezone":{"type":"string","minLength":1},"max_duration_ms":{"type":"integer","minimum":1000,"maximum":3600000},"max_credits":{"type":"integer","minimum":1},"max_steps":{"type":"integer","minimum":1,"maximum":200},"headers":{"type":"object","additionalProperties":{"type":"string"}},"canary":{"type":"object","properties":{"enabled":{"type":"boolean"},"cron":{"type":"string","minLength":1},"url":{"type":"string"},"inputs":{"type":"object","additionalProperties":{}}},"additionalProperties":false},"obstacles":{"type":"object","properties":{"allow_hide":{"type":"boolean"},"ignore":{"type":"array","items":{"type":"string","minLength":1},"maxItems":20}},"additionalProperties":false}},"additionalProperties":false},"overlap_policy":{"type":"string","enum":["skip","queue"],"default":"skip"},"catch_up":{"type":"boolean","default":false}},"required":["program","cron"],"additionalProperties":false}}}},"responses":{"201":{"description":"Schedule","headers":{"X-Kaab-Request-Id":{"description":"Request correlation id","schema":{"type":"string"}},"X-Credits-Remaining":{"description":"Credits left after this call","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per window","schema":{"type":"string"}},"X-RateLimit-Remaining":{"description":"Requests left in the window","schema":{"type":"string"}},"X-RateLimit-Reset":{"description":"Window reset, unix seconds","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Schedule"}}}},"400":{"description":"`request_invalid`: request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"`insufficient_credits`: top up to continue","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The key's scope does not cover this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflicting state (see `error.code`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Semantically invalid request (see `error.code`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"`internal`: unexpected server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"get":{"operationId":"listSchedules","summary":"List schedules","tags":["schedules"],"x-kaab-scope":"read","x-kaab-action":"schedule.read","x-kaab-session-auth":true,"parameters":[{"in":"query","name":"limit","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"in":"query","name":"cursor","schema":{"type":"string","minLength":1}},{"in":"query","name":"status","schema":{"type":"string","enum":["active","paused"]}},{"in":"query","name":"program","schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Schedule page","headers":{"X-Kaab-Request-Id":{"description":"Request correlation id","schema":{"type":"string"}},"X-Credits-Remaining":{"description":"Credits left after this call","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per window","schema":{"type":"string"}},"X-RateLimit-Remaining":{"description":"Requests left in the window","schema":{"type":"string"}},"X-RateLimit-Reset":{"description":"Window reset, unix seconds","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Schedule"}},"next_cursor":{"type":["string","null"]}},"required":["data","next_cursor"],"additionalProperties":false}}}},"400":{"description":"`request_invalid`: request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The key's scope does not cover this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"`internal`: unexpected server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/schedules/{id}":{"get":{"operationId":"getSchedule","summary":"Read a schedule","tags":["schedules"],"x-kaab-scope":"read","x-kaab-action":"schedule.read","x-kaab-session-auth":true,"parameters":[{"in":"path","name":"id","schema":{"type":"string","pattern":"^sch_[0-9a-hjkmnp-tv-z]{26}$"},"required":true}],"responses":{"200":{"description":"Schedule","headers":{"X-Kaab-Request-Id":{"description":"Request correlation id","schema":{"type":"string"}},"X-Credits-Remaining":{"description":"Credits left after this call","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per window","schema":{"type":"string"}},"X-RateLimit-Remaining":{"description":"Requests left in the window","schema":{"type":"string"}},"X-RateLimit-Reset":{"description":"Window reset, unix seconds","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Schedule"}}}},"400":{"description":"`request_invalid`: request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The key's scope does not cover this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"`internal`: unexpected server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"operationId":"updateSchedule","summary":"Change a schedule","tags":["schedules"],"x-kaab-scope":"run","x-kaab-action":"schedule.write","x-kaab-session-auth":true,"parameters":[{"in":"path","name":"id","schema":{"type":"string","pattern":"^sch_[0-9a-hjkmnp-tv-z]{26}$"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"inputs":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]},"description":"`secret` inputs left out keep their stored value; `null` removes one."},"cron":{"type":"string","pattern":"^\\S+\\s+\\S+\\s+\\S+\\s+\\S+\\s+\\S+$"},"timezone":{"type":"string","minLength":1},"change_detection":{"type":"object","properties":{"enabled":{"type":"boolean"},"fields":{"type":"array","items":{"type":"string","minLength":1}}},"required":["enabled"],"additionalProperties":false},"webhook_url":{"type":["string","null"],"format":"uri"},"options":{"type":"object","properties":{"region":{"type":"string","enum":["eu","us"]},"max_tier":{"type":"string","enum":["http","browser","stealth"]},"prefer_tier":{"type":"string","enum":["http","browser","stealth"]},"assets":{"type":"string","enum":["block","allow"]},"block_urls":{"type":"array","items":{"type":"string","minLength":1,"maxLength":500},"maxItems":50},"proxy":{"type":"object","properties":{"mode":{"type":"string","enum":["platform","byo"]},"byo_id":{"type":"string","pattern":"^byo_[0-9a-hjkmnp-tv-z]{26}$"},"country":{"type":"string","pattern":"^[A-Z]{2}$"},"pool":{"type":"string","enum":["datacenter","residential","mobile"]},"fallback":{"type":"string","enum":["platform","none"]}},"additionalProperties":false},"llm":{"type":"object","properties":{"byo_id":{"type":"string","pattern":"^byo_[0-9a-hjkmnp-tv-z]{26}$"}},"additionalProperties":false},"captcha":{"type":"object","properties":{"byo_id":{"type":"string","pattern":"^byo_[0-9a-hjkmnp-tv-z]{26}$"}},"additionalProperties":false},"session":{"type":"string","minLength":1},"resume_from_session":{"type":"boolean"},"session_probe":{"type":"string","enum":["http","browser"]},"cache":{"type":"object","properties":{"max_age":{"type":"integer","minimum":0,"maximum":86400}},"required":["max_age"],"additionalProperties":false},"viewport":{"type":"object","properties":{"width":{"type":"integer","minimum":320,"maximum":3840},"height":{"type":"integer","minimum":240,"maximum":2160}},"required":["width","height"],"additionalProperties":false},"browser_profile":{"type":"string","enum":["desktop","mobile"]},"engine":{"type":"string","enum":["chromium","firefox"]},"fill_mode":{"type":"string","enum":["insert","type"]},"follow_popups":{"type":"boolean"},"locale":{"type":"string","minLength":2},"timezone":{"type":"string","minLength":1},"max_duration_ms":{"type":"integer","minimum":1000,"maximum":3600000},"max_credits":{"type":"integer","minimum":1},"max_steps":{"type":"integer","minimum":1,"maximum":200},"headers":{"type":"object","additionalProperties":{"type":"string"}},"canary":{"type":"object","properties":{"enabled":{"type":"boolean"},"cron":{"type":"string","minLength":1},"url":{"type":"string"},"inputs":{"type":"object","additionalProperties":{}}},"additionalProperties":false},"obstacles":{"type":"object","properties":{"allow_hide":{"type":"boolean"},"ignore":{"type":"array","items":{"type":"string","minLength":1},"maxItems":20}},"additionalProperties":false}},"additionalProperties":false},"overlap_policy":{"type":"string","enum":["skip","queue"]},"catch_up":{"type":"boolean"}},"additionalProperties":false}}}},"responses":{"200":{"description":"Schedule","headers":{"X-Kaab-Request-Id":{"description":"Request correlation id","schema":{"type":"string"}},"X-Credits-Remaining":{"description":"Credits left after this call","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per window","schema":{"type":"string"}},"X-RateLimit-Remaining":{"description":"Requests left in the window","schema":{"type":"string"}},"X-RateLimit-Reset":{"description":"Window reset, unix seconds","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Schedule"}}}},"400":{"description":"`request_invalid`: request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"`insufficient_credits`: top up to continue","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The key's scope does not cover this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflicting state (see `error.code`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Semantically invalid request (see `error.code`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"`internal`: unexpected server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"operationId":"deleteSchedule","summary":"Delete a schedule","tags":["schedules"],"x-kaab-scope":"run","x-kaab-action":"schedule.write","x-kaab-session-auth":true,"parameters":[{"in":"path","name":"id","schema":{"type":"string","pattern":"^sch_[0-9a-hjkmnp-tv-z]{26}$"},"required":true}],"responses":{"204":{"description":"Deleted","headers":{"X-Kaab-Request-Id":{"description":"Request correlation id","schema":{"type":"string"}},"X-Credits-Remaining":{"description":"Credits left after this call","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per window","schema":{"type":"string"}},"X-RateLimit-Remaining":{"description":"Requests left in the window","schema":{"type":"string"}},"X-RateLimit-Reset":{"description":"Window reset, unix seconds","schema":{"type":"string"}}}},"400":{"description":"`request_invalid`: request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"`insufficient_credits`: top up to continue","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The key's scope does not cover this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflicting state (see `error.code`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Semantically invalid request (see `error.code`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"`internal`: unexpected server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/schedules/{id}/pause":{"post":{"operationId":"pauseSchedule","summary":"Pause a schedule","tags":["schedules"],"x-kaab-scope":"run","x-kaab-action":"schedule.write","x-kaab-session-auth":true,"parameters":[{"in":"path","name":"id","schema":{"type":"string","pattern":"^sch_[0-9a-hjkmnp-tv-z]{26}$"},"required":true}],"responses":{"200":{"description":"Schedule","headers":{"X-Kaab-Request-Id":{"description":"Request correlation id","schema":{"type":"string"}},"X-Credits-Remaining":{"description":"Credits left after this call","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per window","schema":{"type":"string"}},"X-RateLimit-Remaining":{"description":"Requests left in the window","schema":{"type":"string"}},"X-RateLimit-Reset":{"description":"Window reset, unix seconds","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Schedule"}}}},"400":{"description":"`request_invalid`: request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"`insufficient_credits`: top up to continue","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The key's scope does not cover this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflicting state (see `error.code`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Semantically invalid request (see `error.code`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"`internal`: unexpected server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/schedules/{id}/resume":{"post":{"operationId":"resumeSchedule","summary":"Resume a paused schedule","tags":["schedules"],"x-kaab-scope":"run","x-kaab-action":"schedule.write","x-kaab-session-auth":true,"parameters":[{"in":"path","name":"id","schema":{"type":"string","pattern":"^sch_[0-9a-hjkmnp-tv-z]{26}$"},"required":true}],"responses":{"200":{"description":"Schedule","headers":{"X-Kaab-Request-Id":{"description":"Request correlation id","schema":{"type":"string"}},"X-Credits-Remaining":{"description":"Credits left after this call","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per window","schema":{"type":"string"}},"X-RateLimit-Remaining":{"description":"Requests left in the window","schema":{"type":"string"}},"X-RateLimit-Reset":{"description":"Window reset, unix seconds","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Schedule"}}}},"400":{"description":"`request_invalid`: request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"`insufficient_credits`: top up to continue","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The key's scope does not cover this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflicting state (see `error.code`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Semantically invalid request (see `error.code`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"`internal`: unexpected server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/schedules/{id}/runs":{"get":{"operationId":"listScheduleRuns","summary":"List the runs of a schedule","tags":["schedules"],"x-kaab-scope":"read","x-kaab-action":"schedule.read","x-kaab-session-auth":true,"parameters":[{"in":"path","name":"id","schema":{"type":"string","pattern":"^sch_[0-9a-hjkmnp-tv-z]{26}$"},"required":true},{"in":"query","name":"limit","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"in":"query","name":"cursor","schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Run page","headers":{"X-Kaab-Request-Id":{"description":"Request correlation id","schema":{"type":"string"}},"X-Credits-Remaining":{"description":"Credits left after this call","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per window","schema":{"type":"string"}},"X-RateLimit-Remaining":{"description":"Requests left in the window","schema":{"type":"string"}},"X-RateLimit-Reset":{"description":"Window reset, unix seconds","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"job_id":{"type":["string","null"],"pattern":"^job_[0-9a-hjkmnp-tv-z]{26}$"},"scheduled_for":{"type":["string","null"],"format":"date-time"},"started_at":{"type":"string","format":"date-time"},"finished_at":{"type":["string","null"],"format":"date-time"},"status":{"type":["string","null"],"enum":["queued","running","awaiting_input","needs_attention","succeeded","failed","canceled",null]},"skipped":{"type":"boolean"},"skip_reason":{"type":["string","null"],"enum":["overlap","missed","no_credits","program_unavailable","test_quota","byo_unavailable","fire_failed",null]},"changed":{"type":["boolean","null"]},"diff_url":{"type":["string","null"]}},"required":["job_id","scheduled_for","started_at","finished_at","status","skipped","skip_reason","changed","diff_url"],"additionalProperties":false}},"next_cursor":{"type":["string","null"]}},"required":["data","next_cursor"],"additionalProperties":false}}}},"400":{"description":"`request_invalid`: request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The key's scope does not cover this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"`internal`: unexpected server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/schedules/{id}/runs/{job_id}/diff":{"get":{"operationId":"getScheduleRunDiff","summary":"Redirect to a presigned URL of a run's JSON Patch against the previous run","tags":["schedules"],"x-kaab-scope":"read","x-kaab-action":"schedule.read","parameters":[{"in":"path","name":"id","schema":{"type":"string","pattern":"^sch_[0-9a-hjkmnp-tv-z]{26}$"},"required":true},{"in":"path","name":"job_id","schema":{"type":"string","pattern":"^job_[0-9a-hjkmnp-tv-z]{26}$"},"required":true}],"responses":{"302":{"description":"Presigned diff URL, valid 15 minutes","headers":{"X-Kaab-Request-Id":{"description":"Request correlation id","schema":{"type":"string"}},"X-Credits-Remaining":{"description":"Credits left after this call","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per window","schema":{"type":"string"}},"X-RateLimit-Remaining":{"description":"Requests left in the window","schema":{"type":"string"}},"X-RateLimit-Reset":{"description":"Window reset, unix seconds","schema":{"type":"string"}},"Location":{"description":"Location","schema":{"type":"string"}}}},"400":{"description":"`request_invalid`: request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The key's scope does not cover this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"`internal`: unexpected server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/webhooks":{"post":{"operationId":"createWebhook","summary":"Register a webhook endpoint; the secret is shown once","tags":["webhooks"],"x-kaab-scope":"admin","x-kaab-action":"webhook.manage","x-kaab-session-auth":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"events":{"type":"array","items":{"type":"string"},"minItems":1,"maxItems":50},"description":{"type":"string","maxLength":1000},"mode":{"type":"string","enum":["live","test","both"],"default":"both"},"format":{"type":"string","enum":["standard","discord","slack"],"default":"standard"}},"required":["url","events"],"additionalProperties":false}}}},"responses":{"201":{"description":"Webhook","headers":{"X-Kaab-Request-Id":{"description":"Request correlation id","schema":{"type":"string"}},"X-Credits-Remaining":{"description":"Credits left after this call","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per window","schema":{"type":"string"}},"X-RateLimit-Remaining":{"description":"Requests left in the window","schema":{"type":"string"}},"X-RateLimit-Reset":{"description":"Window reset, unix seconds","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","pattern":"^whk_[0-9a-hjkmnp-tv-z]{26}$"},"object":{"type":"string","const":"webhook"},"url":{"type":"string","format":"uri"},"events":{"type":"array","items":{"type":"string"},"minItems":1},"mode":{"type":"string","enum":["live","test","both"]},"format":{"type":"string","enum":["standard","discord","slack"]},"status":{"type":"string","enum":["active","disabled"]},"description":{"type":["string","null"]},"disabled_reason":{"type":["string","null"]},"previous_secret_expires_at":{"type":["string","null"],"format":"date-time"},"created_at":{"type":"string","format":"date-time"},"secret":{"type":"string"}},"required":["id","object","url","events","mode","format","status","description","disabled_reason","previous_secret_expires_at","created_at","secret"],"additionalProperties":false}}}},"400":{"description":"`request_invalid`: request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"`insufficient_credits`: top up to continue","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The key's scope does not cover this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflicting state (see `error.code`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Semantically invalid request (see `error.code`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"`internal`: unexpected server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"get":{"operationId":"listWebhooks","summary":"List webhook endpoints","tags":["webhooks"],"x-kaab-scope":"admin","x-kaab-action":"webhook.read","x-kaab-session-auth":true,"parameters":[{"in":"query","name":"limit","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"in":"query","name":"cursor","schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Webhook page","headers":{"X-Kaab-Request-Id":{"description":"Request correlation id","schema":{"type":"string"}},"X-Credits-Remaining":{"description":"Credits left after this call","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per window","schema":{"type":"string"}},"X-RateLimit-Remaining":{"description":"Requests left in the window","schema":{"type":"string"}},"X-RateLimit-Reset":{"description":"Window reset, unix seconds","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Webhook"}},"next_cursor":{"type":["string","null"]}},"required":["data","next_cursor"],"additionalProperties":false}}}},"400":{"description":"`request_invalid`: request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The key's scope does not cover this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"`internal`: unexpected server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/webhooks/{id}":{"get":{"operationId":"getWebhook","summary":"Read a webhook endpoint","tags":["webhooks"],"x-kaab-scope":"admin","x-kaab-action":"webhook.read","x-kaab-session-auth":true,"parameters":[{"in":"path","name":"id","schema":{"type":"string","pattern":"^whk_[0-9a-hjkmnp-tv-z]{26}$"},"required":true}],"responses":{"200":{"description":"Webhook","headers":{"X-Kaab-Request-Id":{"description":"Request correlation id","schema":{"type":"string"}},"X-Credits-Remaining":{"description":"Credits left after this call","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per window","schema":{"type":"string"}},"X-RateLimit-Remaining":{"description":"Requests left in the window","schema":{"type":"string"}},"X-RateLimit-Reset":{"description":"Window reset, unix seconds","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Webhook"}}}},"400":{"description":"`request_invalid`: request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The key's scope does not cover this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"`internal`: unexpected server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"operationId":"updateWebhook","summary":"Change a webhook endpoint","tags":["webhooks"],"x-kaab-scope":"admin","x-kaab-action":"webhook.manage","x-kaab-session-auth":true,"parameters":[{"in":"path","name":"id","schema":{"type":"string","pattern":"^whk_[0-9a-hjkmnp-tv-z]{26}$"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"events":{"type":"array","items":{"type":"string"},"minItems":1,"maxItems":50},"description":{"type":["string","null"],"maxLength":1000},"mode":{"type":"string","enum":["live","test","both"]},"format":{"type":"string","enum":["standard","discord","slack"]},"status":{"type":"string","enum":["active","disabled"]}},"additionalProperties":false}}}},"responses":{"200":{"description":"Webhook","headers":{"X-Kaab-Request-Id":{"description":"Request correlation id","schema":{"type":"string"}},"X-Credits-Remaining":{"description":"Credits left after this call","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per window","schema":{"type":"string"}},"X-RateLimit-Remaining":{"description":"Requests left in the window","schema":{"type":"string"}},"X-RateLimit-Reset":{"description":"Window reset, unix seconds","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Webhook"}}}},"400":{"description":"`request_invalid`: request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"`insufficient_credits`: top up to continue","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The key's scope does not cover this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflicting state (see `error.code`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Semantically invalid request (see `error.code`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"`internal`: unexpected server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"operationId":"deleteWebhook","summary":"Delete a webhook endpoint","tags":["webhooks"],"x-kaab-scope":"admin","x-kaab-action":"webhook.manage","x-kaab-session-auth":true,"parameters":[{"in":"path","name":"id","schema":{"type":"string","pattern":"^whk_[0-9a-hjkmnp-tv-z]{26}$"},"required":true}],"responses":{"204":{"description":"Deleted","headers":{"X-Kaab-Request-Id":{"description":"Request correlation id","schema":{"type":"string"}},"X-Credits-Remaining":{"description":"Credits left after this call","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per window","schema":{"type":"string"}},"X-RateLimit-Remaining":{"description":"Requests left in the window","schema":{"type":"string"}},"X-RateLimit-Reset":{"description":"Window reset, unix seconds","schema":{"type":"string"}}}},"400":{"description":"`request_invalid`: request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"`insufficient_credits`: top up to continue","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The key's scope does not cover this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflicting state (see `error.code`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Semantically invalid request (see `error.code`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"`internal`: unexpected server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/webhooks/{id}/rotate-secret":{"post":{"operationId":"rotateWebhookSecret","summary":"Rotate the signing secret","tags":["webhooks"],"x-kaab-scope":"admin","x-kaab-action":"webhook.manage","x-kaab-session-auth":true,"parameters":[{"in":"path","name":"id","schema":{"type":"string","pattern":"^whk_[0-9a-hjkmnp-tv-z]{26}$"},"required":true}],"responses":{"200":{"description":"Webhook","headers":{"X-Kaab-Request-Id":{"description":"Request correlation id","schema":{"type":"string"}},"X-Credits-Remaining":{"description":"Credits left after this call","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per window","schema":{"type":"string"}},"X-RateLimit-Remaining":{"description":"Requests left in the window","schema":{"type":"string"}},"X-RateLimit-Reset":{"description":"Window reset, unix seconds","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","pattern":"^whk_[0-9a-hjkmnp-tv-z]{26}$"},"object":{"type":"string","const":"webhook"},"url":{"type":"string","format":"uri"},"events":{"type":"array","items":{"type":"string"},"minItems":1},"mode":{"type":"string","enum":["live","test","both"]},"format":{"type":"string","enum":["standard","discord","slack"]},"status":{"type":"string","enum":["active","disabled"]},"description":{"type":["string","null"]},"disabled_reason":{"type":["string","null"]},"previous_secret_expires_at":{"type":["string","null"],"format":"date-time"},"created_at":{"type":"string","format":"date-time"},"secret":{"type":"string"}},"required":["id","object","url","events","mode","format","status","description","disabled_reason","previous_secret_expires_at","created_at","secret"],"additionalProperties":false}}}},"400":{"description":"`request_invalid`: request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"`insufficient_credits`: top up to continue","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The key's scope does not cover this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflicting state (see `error.code`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Semantically invalid request (see `error.code`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"`internal`: unexpected server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/webhooks/{id}/deliveries":{"get":{"operationId":"listWebhookDeliveries","summary":"List delivery attempts","tags":["webhooks"],"x-kaab-scope":"admin","x-kaab-action":"webhook.read","x-kaab-session-auth":true,"parameters":[{"in":"path","name":"id","schema":{"type":"string","pattern":"^whk_[0-9a-hjkmnp-tv-z]{26}$"},"required":true},{"in":"query","name":"limit","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"in":"query","name":"cursor","schema":{"type":"string","minLength":1}},{"in":"query","name":"status","schema":{"type":"string","enum":["pending","succeeded","failed","exhausted"]}},{"in":"query","name":"event_type","schema":{"type":"string","enum":["job.queued","job.blocked","job.started","job.awaiting_input","job.needs_attention","job.succeeded","job.failed","job.canceled","batch.completed","proposal.created","proposal.decided","schedule.run","schedule.changed","schedule.paused","schedule.failing","session.expired","program.drift_detected","credits.low","credits.exhausted","credits.recharged","byo.unhealthy","byo.recovered","webhook.disabled","ping"]}}],"responses":{"200":{"description":"Delivery page","headers":{"X-Kaab-Request-Id":{"description":"Request correlation id","schema":{"type":"string"}},"X-Credits-Remaining":{"description":"Credits left after this call","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per window","schema":{"type":"string"}},"X-RateLimit-Remaining":{"description":"Requests left in the window","schema":{"type":"string"}},"X-RateLimit-Reset":{"description":"Window reset, unix seconds","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/WebhookDelivery"}},"next_cursor":{"type":["string","null"]}},"required":["data","next_cursor"],"additionalProperties":false}}}},"400":{"description":"`request_invalid`: request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The key's scope does not cover this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"`internal`: unexpected server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/webhooks/{id}/deliveries/{delivery_id}/resend":{"post":{"operationId":"resendWebhookDelivery","summary":"Resend one delivery as a new attempt row; the original is never changed","tags":["webhooks"],"x-kaab-scope":"admin","x-kaab-action":"webhook.manage","x-kaab-session-auth":true,"parameters":[{"in":"path","name":"id","schema":{"type":"string","pattern":"^whk_[0-9a-hjkmnp-tv-z]{26}$"},"required":true},{"in":"path","name":"delivery_id","schema":{"type":"string","pattern":"^dlv_[0-9a-hjkmnp-tv-z]{26}$"},"required":true}],"responses":{"202":{"description":"Delivery","headers":{"X-Kaab-Request-Id":{"description":"Request correlation id","schema":{"type":"string"}},"X-Credits-Remaining":{"description":"Credits left after this call","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per window","schema":{"type":"string"}},"X-RateLimit-Remaining":{"description":"Requests left in the window","schema":{"type":"string"}},"X-RateLimit-Reset":{"description":"Window reset, unix seconds","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookDelivery"}}}},"400":{"description":"`request_invalid`: request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"`insufficient_credits`: top up to continue","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The key's scope does not cover this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflicting state (see `error.code`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Semantically invalid request (see `error.code`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"`internal`: unexpected server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/webhooks/{id}/test":{"post":{"operationId":"testWebhook","summary":"Send a `ping` event to the endpoint and wait up to 10 s for its answer","tags":["webhooks"],"x-kaab-scope":"admin","x-kaab-action":"webhook.manage","x-kaab-session-auth":true,"parameters":[{"in":"path","name":"id","schema":{"type":"string","pattern":"^whk_[0-9a-hjkmnp-tv-z]{26}$"},"required":true}],"responses":{"200":{"description":"Delivery","headers":{"X-Kaab-Request-Id":{"description":"Request correlation id","schema":{"type":"string"}},"X-Credits-Remaining":{"description":"Credits left after this call","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per window","schema":{"type":"string"}},"X-RateLimit-Remaining":{"description":"Requests left in the window","schema":{"type":"string"}},"X-RateLimit-Reset":{"description":"Window reset, unix seconds","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookDelivery"}}}},"400":{"description":"`request_invalid`: request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"`insufficient_credits`: top up to continue","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The key's scope does not cover this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflicting state (see `error.code`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Semantically invalid request (see `error.code`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"`internal`: unexpected server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/org/webhook-secret/rotate":{"post":{"operationId":"rotateOrgWebhookSecret","summary":"Rotate the secret ad-hoc `webhook_url` deliveries are signed with; shown once","tags":["org"],"x-kaab-scope":"admin","x-kaab-action":"webhook.manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false}}}},"responses":{"200":{"description":"Signing secret","headers":{"X-Kaab-Request-Id":{"description":"Request correlation id","schema":{"type":"string"}},"X-Credits-Remaining":{"description":"Credits left after this call","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per window","schema":{"type":"string"}},"X-RateLimit-Remaining":{"description":"Requests left in the window","schema":{"type":"string"}},"X-RateLimit-Reset":{"description":"Window reset, unix seconds","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","const":"webhook_signing_secret"},"secret":{"type":"string"},"previous_secret_expires_at":{"type":["string","null"],"format":"date-time"},"created_at":{"type":"string","format":"date-time"}},"required":["object","secret","previous_secret_expires_at","created_at"],"additionalProperties":false}}}},"400":{"description":"`request_invalid`: request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"`insufficient_credits`: top up to continue","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The key's scope does not cover this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflicting state (see `error.code`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Semantically invalid request (see `error.code`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"`internal`: unexpected server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/org":{"get":{"operationId":"getOrg","summary":"Read the calling organisation","tags":["org"],"x-kaab-scope":"read","x-kaab-action":"org.read","x-kaab-session-auth":true,"responses":{"200":{"description":"Organisation","headers":{"X-Kaab-Request-Id":{"description":"Request correlation id","schema":{"type":"string"}},"X-Credits-Remaining":{"description":"Credits left after this call","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per window","schema":{"type":"string"}},"X-RateLimit-Remaining":{"description":"Requests left in the window","schema":{"type":"string"}},"X-RateLimit-Reset":{"description":"Window reset, unix seconds","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Org"}}}},"400":{"description":"`request_invalid`: request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The key's scope does not cover this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"`internal`: unexpected server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/credits":{"get":{"operationId":"getCredits","summary":"Read credit balance and pools","tags":["credits"],"x-kaab-scope":"read","x-kaab-action":"billing.read","x-kaab-session-auth":true,"responses":{"200":{"description":"Credits","headers":{"X-Kaab-Request-Id":{"description":"Request correlation id","schema":{"type":"string"}},"X-Credits-Remaining":{"description":"Credits left after this call","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per window","schema":{"type":"string"}},"X-RateLimit-Remaining":{"description":"Requests left in the window","schema":{"type":"string"}},"X-RateLimit-Reset":{"description":"Window reset, unix seconds","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Credits"}}}},"400":{"description":"`request_invalid`: request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The key's scope does not cover this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"`internal`: unexpected server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/ledger":{"get":{"operationId":"listLedgerEntries","summary":"List ledger entries","tags":["ledger"],"x-kaab-scope":"read","x-kaab-action":"billing.read","x-kaab-session-auth":true,"parameters":[{"in":"query","name":"limit","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"in":"query","name":"cursor","schema":{"type":"string","minLength":1}},{"in":"query","name":"type","schema":{"type":"string","enum":["purchase","grant","subscription_allowance","reserve","settle","release","refund","expire","adjust"]}}],"responses":{"200":{"description":"Ledger page","headers":{"X-Kaab-Request-Id":{"description":"Request correlation id","schema":{"type":"string"}},"X-Credits-Remaining":{"description":"Credits left after this call","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per window","schema":{"type":"string"}},"X-RateLimit-Remaining":{"description":"Requests left in the window","schema":{"type":"string"}},"X-RateLimit-Reset":{"description":"Window reset, unix seconds","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/LedgerEntry"}},"next_cursor":{"type":["string","null"]}},"required":["data","next_cursor"],"additionalProperties":false}}}},"400":{"description":"`request_invalid`: request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The key's scope does not cover this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"`internal`: unexpected server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/usage":{"get":{"operationId":"getUsage","summary":"Aggregated usage over a period","tags":["usage"],"x-kaab-scope":"read","x-kaab-action":"usage.read","x-kaab-session-auth":true,"parameters":[{"in":"query","name":"from","schema":{"type":"string","format":"date-time"},"required":true},{"in":"query","name":"to","schema":{"type":"string","format":"date-time"},"required":true},{"in":"query","name":"group_by","schema":{"type":"string","enum":["day","program","tier","tag"],"default":"day"}}],"responses":{"200":{"description":"Usage","headers":{"X-Kaab-Request-Id":{"description":"Request correlation id","schema":{"type":"string"}},"X-Credits-Remaining":{"description":"Credits left after this call","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per window","schema":{"type":"string"}},"X-RateLimit-Remaining":{"description":"Requests left in the window","schema":{"type":"string"}},"X-RateLimit-Reset":{"description":"Window reset, unix seconds","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"jobs":{"type":"integer","minimum":0},"credits":{"type":"number"},"compute":{"type":"number"},"proxy_mb":{"type":"number"},"llm_tokens":{"type":"number"},"captcha":{"type":"number"}},"required":["key","jobs","credits","compute","proxy_mb","llm_tokens","captcha"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}},"400":{"description":"`request_invalid`: request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The key's scope does not cover this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"`internal`: unexpected server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api-keys":{"get":{"operationId":"listApiKeys","summary":"List API keys","tags":["api-keys"],"x-kaab-scope":"admin","x-kaab-action":"key.read","x-kaab-session-auth":true,"parameters":[{"in":"query","name":"limit","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"in":"query","name":"cursor","schema":{"type":"string","minLength":1}},{"in":"query","name":"mode","schema":{"type":"string","enum":["live","test"]}}],"responses":{"200":{"description":"Key page","headers":{"X-Kaab-Request-Id":{"description":"Request correlation id","schema":{"type":"string"}},"X-Credits-Remaining":{"description":"Credits left after this call","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per window","schema":{"type":"string"}},"X-RateLimit-Remaining":{"description":"Requests left in the window","schema":{"type":"string"}},"X-RateLimit-Reset":{"description":"Window reset, unix seconds","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ApiKey"}},"next_cursor":{"type":["string","null"]}},"required":["data","next_cursor"],"additionalProperties":false}}}},"400":{"description":"`request_invalid`: request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The key's scope does not cover this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"`internal`: unexpected server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"operationId":"createApiKey","summary":"Create an API key; the secret is shown once","tags":["api-keys"],"x-kaab-scope":"admin","x-kaab-action":"key.manage","x-kaab-session-auth":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":64},"scopes":{"type":"array","items":{"type":"string","enum":["run","read","admin"]},"minItems":1},"mode":{"type":"string","enum":["live","test"],"default":"live"},"expires_at":{"type":"string","format":"date-time"}},"required":["name","scopes"],"additionalProperties":false}}}},"responses":{"201":{"description":"Key","headers":{"X-Kaab-Request-Id":{"description":"Request correlation id","schema":{"type":"string"}},"X-Credits-Remaining":{"description":"Credits left after this call","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per window","schema":{"type":"string"}},"X-RateLimit-Remaining":{"description":"Requests left in the window","schema":{"type":"string"}},"X-RateLimit-Reset":{"description":"Window reset, unix seconds","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","pattern":"^key_[0-9a-hjkmnp-tv-z]{26}$"},"object":{"type":"string","const":"api_key"},"name":{"type":"string"},"prefix":{"type":"string"},"scopes":{"type":"array","items":{"type":"string","enum":["run","read","admin"]},"minItems":1},"mode":{"type":"string","enum":["live","test"]},"last_used_at":{"type":["string","null"],"format":"date-time"},"expires_at":{"type":["string","null"],"format":"date-time"},"created_at":{"type":"string","format":"date-time"},"key":{"type":"string","pattern":"^sk_(live|test)_[A-Za-z0-9]{32,}$"}},"required":["id","object","name","prefix","scopes","mode","last_used_at","expires_at","created_at","key"],"additionalProperties":false}}}},"400":{"description":"`request_invalid`: request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"`insufficient_credits`: top up to continue","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The key's scope does not cover this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflicting state (see `error.code`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Semantically invalid request (see `error.code`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"`internal`: unexpected server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api-keys/{id}/rotate":{"post":{"operationId":"rotateApiKey","summary":"Rotate an API key with an optional grace period","tags":["api-keys"],"x-kaab-scope":"admin","x-kaab-action":"key.manage","x-kaab-session-auth":true,"parameters":[{"in":"path","name":"id","schema":{"type":"string","pattern":"^key_[0-9a-hjkmnp-tv-z]{26}$"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"grace_seconds":{"type":"integer","minimum":0,"maximum":86400,"default":0}},"additionalProperties":false}}}},"responses":{"200":{"description":"Key","headers":{"X-Kaab-Request-Id":{"description":"Request correlation id","schema":{"type":"string"}},"X-Credits-Remaining":{"description":"Credits left after this call","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per window","schema":{"type":"string"}},"X-RateLimit-Remaining":{"description":"Requests left in the window","schema":{"type":"string"}},"X-RateLimit-Reset":{"description":"Window reset, unix seconds","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","pattern":"^key_[0-9a-hjkmnp-tv-z]{26}$"},"object":{"type":"string","const":"api_key"},"name":{"type":"string"},"prefix":{"type":"string"},"scopes":{"type":"array","items":{"type":"string","enum":["run","read","admin"]},"minItems":1},"mode":{"type":"string","enum":["live","test"]},"last_used_at":{"type":["string","null"],"format":"date-time"},"expires_at":{"type":["string","null"],"format":"date-time"},"created_at":{"type":"string","format":"date-time"},"key":{"type":"string","pattern":"^sk_(live|test)_[A-Za-z0-9]{32,}$"}},"required":["id","object","name","prefix","scopes","mode","last_used_at","expires_at","created_at","key"],"additionalProperties":false}}}},"400":{"description":"`request_invalid`: request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"`insufficient_credits`: top up to continue","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The key's scope does not cover this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflicting state (see `error.code`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Semantically invalid request (see `error.code`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"`internal`: unexpected server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api-keys/{id}":{"delete":{"operationId":"revokeApiKey","summary":"Revoke an API key","tags":["api-keys"],"x-kaab-scope":"admin","x-kaab-action":"key.manage","x-kaab-session-auth":true,"parameters":[{"in":"path","name":"id","schema":{"type":"string","pattern":"^key_[0-9a-hjkmnp-tv-z]{26}$"},"required":true}],"responses":{"204":{"description":"Revoked","headers":{"X-Kaab-Request-Id":{"description":"Request correlation id","schema":{"type":"string"}},"X-Credits-Remaining":{"description":"Credits left after this call","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per window","schema":{"type":"string"}},"X-RateLimit-Remaining":{"description":"Requests left in the window","schema":{"type":"string"}},"X-RateLimit-Reset":{"description":"Window reset, unix seconds","schema":{"type":"string"}}}},"400":{"description":"`request_invalid`: request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"`insufficient_credits`: top up to continue","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The key's scope does not cover this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflicting state (see `error.code`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Semantically invalid request (see `error.code`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"`internal`: unexpected server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/byo-providers":{"get":{"operationId":"listByoProviders","summary":"List bring-your-own providers","tags":["byo-providers"],"x-kaab-scope":"admin","x-kaab-action":"byo.read","x-kaab-session-auth":true,"parameters":[{"in":"query","name":"limit","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"in":"query","name":"cursor","schema":{"type":"string","minLength":1}},{"in":"query","name":"kind","schema":{"type":"string","enum":["proxy","llm","captcha"]}}],"responses":{"200":{"description":"Provider page","headers":{"X-Kaab-Request-Id":{"description":"Request correlation id","schema":{"type":"string"}},"X-Credits-Remaining":{"description":"Credits left after this call","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per window","schema":{"type":"string"}},"X-RateLimit-Remaining":{"description":"Requests left in the window","schema":{"type":"string"}},"X-RateLimit-Reset":{"description":"Window reset, unix seconds","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ByoProvider"}},"next_cursor":{"type":["string","null"]}},"required":["data","next_cursor"],"additionalProperties":false}}}},"400":{"description":"`request_invalid`: request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The key's scope does not cover this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"`internal`: unexpected server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"operationId":"createByoProvider","summary":"Register a bring-your-own provider","tags":["byo-providers"],"x-kaab-scope":"admin","x-kaab-action":"byo.manage","x-kaab-session-auth":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"proxy"},"name":{"type":"string","minLength":1,"maxLength":64},"config":{"type":"object","properties":{"type":{"type":"string","enum":["static","list","gateway"]},"vendor":{"type":"string","enum":["brightdata","oxylabs","decodo","iproyal","webshare"]},"url":{"type":"string","pattern":"^(https?|socks5h?):\\/\\/[^\\s]+$","minLength":1,"maxLength":2048},"urls":{"type":"array","items":{"type":"string","pattern":"^(https?|socks5h?):\\/\\/[^\\s]+$","minLength":1,"maxLength":2048},"minItems":1,"maxItems":1000},"api_key":{"type":"string","minLength":1,"maxLength":512},"pool":{"type":"string","enum":["datacenter","residential","mobile"],"default":"datacenter"},"country":{"type":"string","pattern":"^[A-Z]{2}$"}},"required":["type"],"additionalProperties":false}},"required":["kind","name","config"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"llm"},"name":{"type":"string","minLength":1,"maxLength":64},"config":{"type":"object","properties":{"vendor":{"type":"string","enum":["openai","anthropic","gemini","azure_openai","openai_compatible"]},"api_key":{"type":"string","minLength":1,"maxLength":512},"base_url":{"type":"string","format":"uri"},"model":{"type":"string","minLength":1,"maxLength":128}},"required":["vendor","api_key","model"],"additionalProperties":false}},"required":["kind","name","config"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"captcha"},"name":{"type":"string","minLength":1,"maxLength":64},"config":{"type":"object","properties":{"vendor":{"type":"string","enum":["2captcha","capsolver"]},"api_key":{"type":"string","minLength":1,"maxLength":512}},"required":["vendor","api_key"],"additionalProperties":false}},"required":["kind","name","config"],"additionalProperties":false}]}}}},"responses":{"201":{"description":"Provider","headers":{"X-Kaab-Request-Id":{"description":"Request correlation id","schema":{"type":"string"}},"X-Credits-Remaining":{"description":"Credits left after this call","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per window","schema":{"type":"string"}},"X-RateLimit-Remaining":{"description":"Requests left in the window","schema":{"type":"string"}},"X-RateLimit-Reset":{"description":"Window reset, unix seconds","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ByoProvider"}}}},"400":{"description":"`request_invalid`: request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"`insufficient_credits`: top up to continue","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The key's scope does not cover this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflicting state (see `error.code`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Semantically invalid request (see `error.code`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"`internal`: unexpected server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/byo-providers/{id}":{"get":{"operationId":"getByoProvider","summary":"Read a bring-your-own provider","tags":["byo-providers"],"x-kaab-scope":"admin","x-kaab-action":"byo.read","x-kaab-session-auth":true,"parameters":[{"in":"path","name":"id","schema":{"type":"string","pattern":"^byo_[0-9a-hjkmnp-tv-z]{26}$"},"required":true}],"responses":{"200":{"description":"Provider","headers":{"X-Kaab-Request-Id":{"description":"Request correlation id","schema":{"type":"string"}},"X-Credits-Remaining":{"description":"Credits left after this call","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per window","schema":{"type":"string"}},"X-RateLimit-Remaining":{"description":"Requests left in the window","schema":{"type":"string"}},"X-RateLimit-Reset":{"description":"Window reset, unix seconds","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ByoProvider"}}}},"400":{"description":"`request_invalid`: request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The key's scope does not cover this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"`internal`: unexpected server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"operationId":"updateByoProvider","summary":"Change a bring-your-own provider","tags":["byo-providers"],"x-kaab-scope":"admin","x-kaab-action":"byo.manage","x-kaab-session-auth":true,"parameters":[{"in":"path","name":"id","schema":{"type":"string","pattern":"^byo_[0-9a-hjkmnp-tv-z]{26}$"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":64},"config":{"type":"object","additionalProperties":{}}},"additionalProperties":false}}}},"responses":{"200":{"description":"Provider","headers":{"X-Kaab-Request-Id":{"description":"Request correlation id","schema":{"type":"string"}},"X-Credits-Remaining":{"description":"Credits left after this call","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per window","schema":{"type":"string"}},"X-RateLimit-Remaining":{"description":"Requests left in the window","schema":{"type":"string"}},"X-RateLimit-Reset":{"description":"Window reset, unix seconds","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ByoProvider"}}}},"400":{"description":"`request_invalid`: request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"`insufficient_credits`: top up to continue","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The key's scope does not cover this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflicting state (see `error.code`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Semantically invalid request (see `error.code`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"`internal`: unexpected server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"operationId":"deleteByoProvider","summary":"Delete a bring-your-own provider","tags":["byo-providers"],"x-kaab-scope":"admin","x-kaab-action":"byo.manage","x-kaab-session-auth":true,"parameters":[{"in":"path","name":"id","schema":{"type":"string","pattern":"^byo_[0-9a-hjkmnp-tv-z]{26}$"},"required":true}],"responses":{"204":{"description":"Deleted","headers":{"X-Kaab-Request-Id":{"description":"Request correlation id","schema":{"type":"string"}},"X-Credits-Remaining":{"description":"Credits left after this call","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per window","schema":{"type":"string"}},"X-RateLimit-Remaining":{"description":"Requests left in the window","schema":{"type":"string"}},"X-RateLimit-Reset":{"description":"Window reset, unix seconds","schema":{"type":"string"}}}},"400":{"description":"`request_invalid`: request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"`insufficient_credits`: top up to continue","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The key's scope does not cover this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflicting state (see `error.code`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Semantically invalid request (see `error.code`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"`internal`: unexpected server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/byo-providers/{id}/test":{"post":{"operationId":"testByoProvider","summary":"Health-check a bring-your-own provider","tags":["byo-providers"],"x-kaab-scope":"admin","x-kaab-action":"byo.manage","x-kaab-session-auth":true,"parameters":[{"in":"path","name":"id","schema":{"type":"string","pattern":"^byo_[0-9a-hjkmnp-tv-z]{26}$"},"required":true}],"responses":{"200":{"description":"Test result","headers":{"X-Kaab-Request-Id":{"description":"Request correlation id","schema":{"type":"string"}},"X-Credits-Remaining":{"description":"Credits left after this call","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per window","schema":{"type":"string"}},"X-RateLimit-Remaining":{"description":"Requests left in the window","schema":{"type":"string"}},"X-RateLimit-Reset":{"description":"Window reset, unix seconds","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"latency_ms":{"type":["integer","null"],"minimum":0},"detail":{"type":"string"},"egress_ip":{"type":"string"}},"required":["ok","latency_ms","detail"],"additionalProperties":false}}}},"400":{"description":"`request_invalid`: request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"`insufficient_credits`: top up to continue","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The key's scope does not cover this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflicting state (see `error.code`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Semantically invalid request (see `error.code`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"`internal`: unexpected server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/org/data-deletion":{"post":{"operationId":"requestDataDeletion","summary":"Purge the organisation's data within 24 hours","tags":["org"],"x-kaab-scope":"admin","x-kaab-action":"org.update","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"confirm":{"type":"string","minLength":1}},"required":["confirm"],"additionalProperties":false}}}},"responses":{"202":{"description":"Scheduled","headers":{"X-Kaab-Request-Id":{"description":"Request correlation id","schema":{"type":"string"}},"X-Credits-Remaining":{"description":"Credits left after this call","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per window","schema":{"type":"string"}},"X-RateLimit-Remaining":{"description":"Requests left in the window","schema":{"type":"string"}},"X-RateLimit-Reset":{"description":"Window reset, unix seconds","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","pattern":"^exp_[0-9a-hjkmnp-tv-z]{26}$"},"scheduled_for":{"type":"string","format":"date-time"}},"required":["id","scheduled_for"],"additionalProperties":false}}}},"400":{"description":"`request_invalid`: request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"`insufficient_credits`: top up to continue","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The key's scope does not cover this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflicting state (see `error.code`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Semantically invalid request (see `error.code`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"`internal`: unexpected server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/sites/{hostname}":{"get":{"operationId":"getSiteProfile","summary":"Read the learned site profile visible to the organisation","tags":["sites"],"x-kaab-scope":"read","x-kaab-action":"org.read","x-kaab-session-auth":true,"parameters":[{"in":"path","name":"hostname","schema":{"type":"string","minLength":1},"required":true}],"responses":{"200":{"description":"Site profile","headers":{"X-Kaab-Request-Id":{"description":"Request correlation id","schema":{"type":"string"}},"X-Credits-Remaining":{"description":"Credits left after this call","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per window","schema":{"type":"string"}},"X-RateLimit-Remaining":{"description":"Requests left in the window","schema":{"type":"string"}},"X-RateLimit-Reset":{"description":"Window reset, unix seconds","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SiteProfile"}}}},"400":{"description":"`request_invalid`: request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The key's scope does not cover this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limited; see `Retry-After`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"`internal`: unexpected server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"`Authorization: Bearer sk_live_…` or `sk_test_…`"}},"schemas":{"Job":{"type":"object","properties":{"id":{"type":"string","pattern":"^job_[0-9a-hjkmnp-tv-z]{26}$"},"object":{"type":"string","const":"job"},"mode":{"type":"string","enum":["live","test"]},"status":{"type":"string","enum":["queued","running","awaiting_input","needs_attention","succeeded","failed","canceled"]},"reason":{"type":["string","null"],"enum":["obstacle","drift","unknown_page","session_expired","side_effect_ambiguous","captcha",null]},"program":{"type":"object","properties":{"id":{"type":["string","null"],"pattern":"^prg_[0-9a-hjkmnp-tv-z]{26}$"},"name":{"type":["string","null"]},"version":{"type":["integer","null"],"minimum":1},"version_id":{"type":["string","null"],"pattern":"^pv_[0-9a-hjkmnp-tv-z]{26}$"}},"required":["id","name","version","version_id"],"additionalProperties":false},"inputs_hash":{"type":["string","null"]},"data":{"type":["object","null"],"additionalProperties":{}},"raw":{"type":["object","null"],"additionalProperties":{}},"warnings":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string","enum":["null_marker","parse_failed","out_of_range","required_missing","list_short","fill_rate_drop","escalated","healed_locator_used","obstacle_dismissed","field_empty","step_skipped","cache_hit","byo_fallback_used","pdf_source_not_extractable","pdf_no_text","pdf_pages_truncated","redirect_not_followed","pagination_incomplete","captcha_inject_navigated"]},"field":{"type":["string","null"]},"raw":{"type":["string","null"]},"step":{"type":["string","null"]},"message":{"type":"string"},"detail":{"type":"string"},"count":{"type":"integer","minimum":1},"of":{"type":"integer","minimum":0},"hint":{"type":"object","properties":{"date_format":{"type":"string"},"date_formats":{"type":"array","items":{"type":"string"}},"ambiguous":{"type":"boolean","const":true},"locale":{"type":"string"}},"additionalProperties":false}},"required":["code"],"additionalProperties":false}},"meta":{"type":"object","properties":{"tier":{"type":["string","null"],"enum":["http","browser","stealth",null]},"tier_requested":{"type":"string","enum":["http","browser","stealth"]},"escalations":{"type":"array","items":{"type":"object","properties":{"from":{"type":"string","enum":["http","browser","stealth"]},"to":{"type":"string","enum":["http","browser","stealth"]},"reason":{"type":"string"}},"required":["from","to","reason"],"additionalProperties":false}},"region":{"type":"string","enum":["eu","us"]},"final_url":{"type":["string","null"]},"cache":{"type":"string","enum":["hit","miss"]},"duration_ms":{"type":"integer","minimum":0},"parked_ms":{"type":"integer","minimum":0},"dry_run":{"type":"boolean"},"stopped_at":{"type":"string"},"resumed_from":{"type":"string","enum":["page","checkpoint","replay"]},"blocked_reason":{"type":"string","enum":["insufficient_credits","session_locked"]},"proxy":{"type":"object","properties":{"mode":{"type":"string","enum":["platform","byo"]},"pool":{"type":["string","null"],"enum":["datacenter","residential","mobile",null]},"country":{"type":["string","null"],"minLength":2,"maxLength":2}},"required":["mode","pool","country"],"additionalProperties":false},"session":{"type":["object","null"],"properties":{"id":{"type":"string","pattern":"^ses_[0-9a-hjkmnp-tv-z]{26}$"},"name":{"type":"string"},"saved":{"type":"boolean"}},"required":["id","name","saved"],"additionalProperties":false},"assets":{"type":"object","properties":{"blocked_requests":{"type":"integer","minimum":0},"blocked_bytes_estimate":{"type":"integer","minimum":0}},"required":["blocked_requests","blocked_bytes_estimate"],"additionalProperties":false},"credits":{"type":"object","properties":{"reserved":{"type":"number"},"settled":{"type":["number","null"]},"breakdown":{"type":"object","properties":{"compute":{"type":"number"},"proxy":{"type":"number"},"llm":{"type":"number"},"captcha":{"type":"number"}},"required":["compute","proxy","llm","captcha"],"additionalProperties":false}},"required":["reserved","settled","breakdown"],"additionalProperties":false},"steps":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"action":{"type":"string"},"status":{"type":"string","enum":["ok","failed","skipped","parked"]},"duration_ms":{"type":"integer","minimum":0},"healed":{"type":"boolean"}},"required":["path","action","status","duration_ms","healed"],"additionalProperties":false}},"snapshot":{"type":["string","null"]},"artifacts":{"type":"object","additionalProperties":{"type":"string"}},"vars":{"type":"object","additionalProperties":{}}},"required":["tier","tier_requested","escalations","region","final_url","cache","duration_ms","parked_ms"],"additionalProperties":false},"error":{"type":["object","null"],"properties":{"code":{"type":"string","enum":["blocked","timeout","session_expired","validation_failed","input_expired","side_effect_ambiguous","insufficient_credits","max_credits_exceeded","max_tier_exceeded","max_steps_exceeded","ssrf_blocked","target_disallowed","byo_proxy_unreachable","byo_proxy_blocked","byo_llm_auth_failed","byo_llm_rate_limited","byo_llm_quota_exceeded","byo_captcha_auth_failed","byo_captcha_balance","byo_provider_failing","byo_in_use","program_invalid","request_invalid","idempotency_conflict","session_locked_timeout","session_locked","session_engine_mismatch","job_not_waiting","fence_open","loop_exhausted","target_ambiguous","canceled","not_found","program_not_found","program_has_schedules","secret_storage_disabled","not_implemented","two_factor_required","reauth_required","rate_limited","payment_method_required","billing_unavailable","test_quota_exceeded","plan_required","plan_managed","login_flow_rate_limited","schedule_interval_too_small","live_unavailable","pdf_not_pdf","pdf_too_large","pdf_malware","pdf_scanner_unavailable","pdf_encrypted","pdf_too_complex","pdf_malformed","pdf_active_content","pdf_source_missing","internal"]},"message":{"type":"string"},"tier":{"type":["string","null"],"enum":["http","browser","stealth",null]},"retryable":{"type":"boolean"},"step":{"type":["string","null"]},"snapshot":{"type":["string","null"]},"details":{"type":"object","additionalProperties":{}}},"required":["code","message","tier","retryable","step"],"additionalProperties":false},"input_request":{"type":["object","null"],"properties":{"name":{"type":"string"},"prompt":{"type":"string"},"type":{"type":"string","enum":["string","number","secret"]},"pattern":{"type":["string","null"]},"keep_alive_until":{"type":["string","null"],"format":"date-time"},"expires_at":{"type":"string","format":"date-time"},"collect":{"type":"string","enum":["api","hosted"]},"screenshot":{"type":["string","null"]},"resolve_url":{"type":["string","null"],"format":"uri"}},"required":["name","prompt","type","pattern","keep_alive_until","expires_at","collect","screenshot","resolve_url"],"additionalProperties":false},"attention":{"type":["object","null"],"properties":{"reason":{"type":"string","enum":["obstacle","drift","unknown_page","session_expired","side_effect_ambiguous","captcha"]},"step":{"type":"string"},"detail":{"type":"string"},"screenshot":{"type":["string","null"]},"snapshot":{"type":["string","null"]},"checkpoint":{"type":["string","null"]},"expires_at":{"type":"string","format":"date-time"},"proposals":{"type":"array","items":{"$ref":"#/components/schemas/Proposal"}},"resolve_url":{"type":["string","null"],"format":"uri"},"actions":{"type":"array","items":{"type":"string","enum":["apply","skip_step","retry_from","takeover","abort"]}}},"required":["reason","step","detail","screenshot","snapshot","checkpoint","expires_at","proposals","resolve_url","actions"],"additionalProperties":false},"progress":{"type":["object","null"],"properties":{"step":{"type":"integer","minimum":0},"of":{"type":"integer","minimum":0},"checkpoint":{"type":["string","null"]}},"required":["step","of","checkpoint"],"additionalProperties":false},"tags":{"type":"array","items":{"type":"string","minLength":1,"maxLength":64},"maxItems":20},"webhook_url":{"type":["string","null"],"format":"uri"},"created_at":{"type":"string","format":"date-time"},"started_at":{"type":["string","null"],"format":"date-time"},"finished_at":{"type":["string","null"],"format":"date-time"},"expires_at":{"type":["string","null"],"format":"date-time"}},"required":["id","object","mode","status","reason","program","inputs_hash","data","raw","warnings","meta","error","input_request","attention","progress","tags","webhook_url","created_at","started_at","finished_at","expires_at"],"additionalProperties":false},"StepRecord":{"type":"object","properties":{"step_path":{"type":"string"},"iteration":{"type":"integer","minimum":0},"attempt":{"type":"integer","minimum":0},"action":{"type":"string"},"status":{"type":"string","enum":["ok","failed","skipped","parked"]},"tier":{"type":"string","enum":["http","browser","stealth"]},"started_at":{"type":"string","format":"date-time"},"finished_at":{"type":["string","null"],"format":"date-time"},"duration_ms":{"type":["integer","null"],"minimum":0},"snapshot":{"type":["string","null"]},"screenshot":{"type":["string","null"]},"error":{"type":["object","null"],"properties":{"code":{"type":"string","enum":["blocked","timeout","session_expired","validation_failed","input_expired","side_effect_ambiguous","insufficient_credits","max_credits_exceeded","max_tier_exceeded","max_steps_exceeded","ssrf_blocked","target_disallowed","byo_proxy_unreachable","byo_proxy_blocked","byo_llm_auth_failed","byo_llm_rate_limited","byo_llm_quota_exceeded","byo_captcha_auth_failed","byo_captcha_balance","byo_provider_failing","byo_in_use","program_invalid","request_invalid","idempotency_conflict","session_locked_timeout","session_locked","session_engine_mismatch","job_not_waiting","fence_open","loop_exhausted","target_ambiguous","canceled","not_found","program_not_found","program_has_schedules","secret_storage_disabled","not_implemented","two_factor_required","reauth_required","rate_limited","payment_method_required","billing_unavailable","test_quota_exceeded","plan_required","plan_managed","login_flow_rate_limited","schedule_interval_too_small","live_unavailable","pdf_not_pdf","pdf_too_large","pdf_malware","pdf_scanner_unavailable","pdf_encrypted","pdf_too_complex","pdf_malformed","pdf_active_content","pdf_source_missing","internal"]},"message":{"type":"string"},"tier":{"type":["string","null"],"enum":["http","browser","stealth",null]},"retryable":{"type":"boolean"},"step":{"type":["string","null"]},"snapshot":{"type":["string","null"]},"details":{"type":"object","additionalProperties":{}}},"required":["code","message","tier","retryable","step"],"additionalProperties":false},"warnings":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string","enum":["null_marker","parse_failed","out_of_range","required_missing","list_short","fill_rate_drop","escalated","healed_locator_used","obstacle_dismissed","field_empty","step_skipped","cache_hit","byo_fallback_used","pdf_source_not_extractable","pdf_no_text","pdf_pages_truncated","redirect_not_followed","pagination_incomplete","captcha_inject_navigated"]},"field":{"type":["string","null"]},"raw":{"type":["string","null"]},"step":{"type":["string","null"]},"message":{"type":"string"},"detail":{"type":"string"},"count":{"type":"integer","minimum":1},"of":{"type":"integer","minimum":0},"hint":{"type":"object","properties":{"date_format":{"type":"string"},"date_formats":{"type":"array","items":{"type":"string"}},"ambiguous":{"type":"boolean","const":true},"locale":{"type":"string"}},"additionalProperties":false}},"required":["code"],"additionalProperties":false}},"healed":{"type":["object","null"],"properties":{"target":{"type":"string"},"from":{"type":"object","additionalProperties":{}},"to":{"type":"object","additionalProperties":{}},"confidence":{"type":"number","minimum":0,"maximum":1},"proposal_id":{"type":["string","null"],"pattern":"^prp_[0-9a-hjkmnp-tv-z]{26}$"}},"required":["target","from","to","confidence","proposal_id"],"additionalProperties":false},"obstacle":{"type":["object","null"],"additionalProperties":{}},"result_preview":{"type":["string","null"]}},"required":["step_path","iteration","attempt","action","status","tier","started_at","finished_at","duration_ms","snapshot","screenshot","error","warnings","healed","obstacle","result_preview"],"additionalProperties":false},"Batch":{"type":"object","properties":{"id":{"type":"string","pattern":"^bat_[0-9a-hjkmnp-tv-z]{26}$"},"object":{"type":"string","const":"batch"},"total":{"type":"integer","minimum":0},"queued":{"type":"integer","minimum":0},"running":{"type":"integer","minimum":0},"succeeded":{"type":"integer","minimum":0},"failed":{"type":"integer","minimum":0},"canceled":{"type":"integer","minimum":0},"webhook_url":{"type":["string","null"],"format":"uri"},"job_ids_url":{"type":"string"},"finished_at":{"type":["string","null"],"format":"date-time"},"created_at":{"type":"string","format":"date-time"}},"required":["id","object","total","queued","running","succeeded","failed","canceled","webhook_url","job_ids_url","finished_at","created_at"],"additionalProperties":false},"Program":{"type":"object","properties":{"id":{"type":"string","pattern":"^prg_[0-9a-hjkmnp-tv-z]{26}$"},"object":{"type":"string","const":"program"},"name":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{1,62}$"},"description":{"type":["string","null"]},"latest_version":{"type":"integer","minimum":0},"aliases":{"type":"object","additionalProperties":{"type":"integer","minimum":1}},"canary":{"type":["object","null"],"properties":{"enabled":{"type":"boolean"},"cron":{"type":["string","null"],"minLength":1},"url":{"type":["string","null"]},"alias":{"type":"string","pattern":"^[a-z][a-z0-9-]{0,31}$"}},"required":["cron"],"additionalProperties":false},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","object","name","description","latest_version","aliases","canary","created_at","updated_at"],"additionalProperties":false},"ProgramVersion":{"type":"object","properties":{"id":{"type":"string","pattern":"^pv_[0-9a-hjkmnp-tv-z]{26}$"},"object":{"type":"string","const":"program_version"},"program_id":{"type":"string","pattern":"^prg_[0-9a-hjkmnp-tv-z]{26}$"},"version":{"type":"integer","minimum":1},"status":{"type":"string","enum":["draft","published","archived"]},"definition":{"$ref":"#/components/schemas/ProgramDefinition"},"definition_hash":{"type":"string"},"lint":{"$ref":"#/components/schemas/LintResult"},"notes":{"type":["string","null"]},"source":{"type":"string","enum":["manual","api","proposal","takeover"]},"created_at":{"type":"string","format":"date-time"},"published_at":{"type":["string","null"],"format":"date-time"}},"required":["id","object","program_id","version","status","definition","definition_hash","lint","notes","source","created_at","published_at"],"additionalProperties":false},"LintResult":{"type":"object","properties":{"errors":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string","enum":["E001","E002","E003","E004","E005","E006","E007","E008","E009","E010","E011","E012","E013","E014","W001","W002","W003","W004","W005","W006","W007","W008","W009","W010"]},"path":{"type":"string"},"message":{"type":"string"}},"required":["code","path","message"],"additionalProperties":false}},"warnings":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string","enum":["E001","E002","E003","E004","E005","E006","E007","E008","E009","E010","E011","E012","E013","E014","W001","W002","W003","W004","W005","W006","W007","W008","W009","W010"]},"path":{"type":"string"},"message":{"type":"string"}},"required":["code","path","message"],"additionalProperties":false}}},"required":["errors","warnings"],"additionalProperties":false},"Session":{"type":"object","properties":{"id":{"type":"string","pattern":"^ses_[0-9a-hjkmnp-tv-z]{26}$"},"object":{"type":"string","const":"session"},"name":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{1,62}$"},"origins":{"type":"array","items":{"type":"string"}},"status":{"type":"string","enum":["valid","expired","unknown"]},"concurrency":{"type":"string","enum":["exclusive","shared"]},"refresh":{"type":["object","null"],"properties":{"program":{"type":"string","minLength":1},"has_inputs":{"type":"boolean"}},"required":["program","has_inputs"],"additionalProperties":false},"last_verified_at":{"type":["string","null"],"format":"date-time"},"last_used_at":{"type":["string","null"],"format":"date-time"},"locked_by":{"type":["string","null"],"pattern":"^job_[0-9a-hjkmnp-tv-z]{26}$"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","object","name","origins","status","concurrency","refresh","last_verified_at","last_used_at","locked_by","created_at","updated_at"],"additionalProperties":false},"Proposal":{"type":"object","properties":{"id":{"type":"string","pattern":"^prp_[0-9a-hjkmnp-tv-z]{26}$"},"object":{"type":"string","const":"proposal"},"kind":{"type":"string","enum":["relocate","dismiss","insert_steps","parser_config","api_discovery"]},"status":{"type":"string","enum":["pending","approved","rejected","expired"]},"program":{"type":"object","properties":{"id":{"type":"string","pattern":"^prg_[0-9a-hjkmnp-tv-z]{26}$"},"name":{"type":"string"},"version":{"type":"integer","minimum":1},"version_id":{"type":"string","pattern":"^pv_[0-9a-hjkmnp-tv-z]{26}$"}},"required":["id","name","version","version_id"],"additionalProperties":false},"job_id":{"type":["string","null"],"pattern":"^job_[0-9a-hjkmnp-tv-z]{26}$"},"target":{"type":"string"},"confidence":{"type":["number","null"],"minimum":0,"maximum":1},"source":{"type":"string","enum":["heuristic","llm","takeover","canary"]},"payload":{"type":"object","properties":{"old":{"type":"object","additionalProperties":{}},"new":{"type":"object","additionalProperties":{}},"samples":{"type":"object","additionalProperties":{}},"fingerprints":{"type":"object","additionalProperties":{}},"bboxes":{"type":"object","additionalProperties":{}},"evidence":{"type":"array","items":{"type":"object","additionalProperties":{}}},"screenshots":{"type":"object","properties":{"old":{"type":["string","null"]},"new":{"type":["string","null"]}},"additionalProperties":false},"obstacle":{"type":"object","additionalProperties":{}},"action":{"type":"object","additionalProperties":{}},"hostname":{"type":"string"},"steps":{"type":"array","items":{"type":"object","additionalProperties":{}}},"recording_key":{"type":"string"},"live_id":{"type":"string"}},"additionalProperties":false},"created_at":{"type":"string","format":"date-time"},"expires_at":{"type":"string","format":"date-time"},"decided_at":{"type":["string","null"],"format":"date-time"},"decision":{"type":["object","null"],"properties":{"promote":{"type":"boolean"},"remember":{"type":"string","enum":["none","site"]},"by":{"anyOf":[{"type":"string","pattern":"^usr_[0-9a-hjkmnp-tv-z]{26}$"},{"type":"string","pattern":"^key_[0-9a-hjkmnp-tv-z]{26}$"}]},"notes":{"type":["string","null"],"maxLength":1000}},"required":["promote","remember","by"],"additionalProperties":false}},"required":["id","object","kind","status","program","job_id","target","confidence","source","payload","created_at","expires_at","decided_at","decision"],"additionalProperties":false},"Schedule":{"type":"object","properties":{"id":{"type":"string","pattern":"^sch_[0-9a-hjkmnp-tv-z]{26}$"},"object":{"type":"string","const":"schedule"},"program":{"type":"string"},"inputs":{"type":["object","null"],"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}},"cron":{"type":"string","pattern":"^\\S+\\s+\\S+\\s+\\S+\\s+\\S+\\s+\\S+$"},"timezone":{"type":"string","minLength":1},"status":{"type":"string","enum":["active","paused"]},"paused_reason":{"type":["string","null"],"enum":["manual","credits",null]},"mode":{"type":"string","enum":["live","test"]},"change_detection":{"type":"object","properties":{"enabled":{"type":"boolean"},"fields":{"type":"array","items":{"type":"string","minLength":1}}},"required":["enabled"],"additionalProperties":false},"overlap_policy":{"type":"string","enum":["skip","queue"]},"catch_up":{"type":"boolean"},"webhook_url":{"type":["string","null"],"format":"uri"},"last_run_at":{"type":["string","null"],"format":"date-time"},"next_run_at":{"type":["string","null"],"format":"date-time"},"created_at":{"type":"string","format":"date-time"}},"required":["id","object","program","inputs","cron","timezone","status","paused_reason","mode","change_detection","overlap_policy","catch_up","webhook_url","last_run_at","next_run_at","created_at"],"additionalProperties":false},"Webhook":{"type":"object","properties":{"id":{"type":"string","pattern":"^whk_[0-9a-hjkmnp-tv-z]{26}$"},"object":{"type":"string","const":"webhook"},"url":{"type":"string","format":"uri"},"events":{"type":"array","items":{"type":"string"},"minItems":1},"mode":{"type":"string","enum":["live","test","both"]},"format":{"type":"string","enum":["standard","discord","slack"]},"status":{"type":"string","enum":["active","disabled"]},"description":{"type":["string","null"]},"disabled_reason":{"type":["string","null"]},"previous_secret_expires_at":{"type":["string","null"],"format":"date-time"},"created_at":{"type":"string","format":"date-time"}},"required":["id","object","url","events","mode","format","status","description","disabled_reason","previous_secret_expires_at","created_at"],"additionalProperties":false},"WebhookDelivery":{"type":"object","properties":{"id":{"type":"string","pattern":"^dlv_[0-9a-hjkmnp-tv-z]{26}$"},"object":{"type":"string","const":"webhook_delivery"},"endpoint_id":{"type":"string","pattern":"^whk_[0-9a-hjkmnp-tv-z]{26}$"},"event_id":{"type":"string","pattern":"^evt_[0-9a-hjkmnp-tv-z]{26}$"},"event_type":{"type":"string","enum":["job.queued","job.blocked","job.started","job.awaiting_input","job.needs_attention","job.succeeded","job.failed","job.canceled","batch.completed","proposal.created","proposal.decided","schedule.run","schedule.changed","schedule.paused","schedule.failing","session.expired","program.drift_detected","credits.low","credits.exhausted","credits.recharged","byo.unhealthy","byo.recovered","webhook.disabled","ping"]},"origin":{"type":"string","enum":["planned","resend","test"]},"attempt":{"type":"integer","minimum":1},"status":{"type":"string","enum":["pending","succeeded","failed","exhausted"]},"response_code":{"type":["integer","null"]},"response_ms":{"type":["integer","null"]},"response_body":{"type":["string","null"]},"error":{"type":["string","null"]},"next_retry_at":{"type":["string","null"],"format":"date-time"},"last_attempt_at":{"type":["string","null"],"format":"date-time"},"created_at":{"type":"string","format":"date-time"}},"required":["id","object","endpoint_id","event_id","event_type","origin","attempt","status","response_code","response_ms","response_body","error","next_retry_at","last_attempt_at","created_at"],"additionalProperties":false},"WebhookEvent":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","pattern":"^evt_[0-9a-hjkmnp-tv-z]{26}$"},"type":{"type":"string","const":"job.queued"},"created_at":{"type":"string","format":"date-time"},"org":{"type":"string","pattern":"^org_[0-9a-hjkmnp-tv-z]{26}$"},"mode":{"type":"string","enum":["live","test"]},"data":{"type":"object","properties":{"job":{"type":"string","pattern":"^job_[0-9a-hjkmnp-tv-z]{26}$"},"program":{"type":["string","null"]},"reason":{"anyOf":[{"type":"string","enum":["obstacle","drift","unknown_page","session_expired","side_effect_ambiguous","captcha"]},{"type":"string","enum":["blocked","timeout","session_expired","validation_failed","input_expired","side_effect_ambiguous","insufficient_credits","max_credits_exceeded","max_tier_exceeded","max_steps_exceeded","ssrf_blocked","target_disallowed","byo_proxy_unreachable","byo_proxy_blocked","byo_llm_auth_failed","byo_llm_rate_limited","byo_llm_quota_exceeded","byo_captcha_auth_failed","byo_captcha_balance","byo_provider_failing","byo_in_use","program_invalid","request_invalid","idempotency_conflict","session_locked_timeout","session_locked","session_engine_mismatch","job_not_waiting","fence_open","loop_exhausted","target_ambiguous","canceled","not_found","program_not_found","program_has_schedules","secret_storage_disabled","not_implemented","two_factor_required","reauth_required","rate_limited","payment_method_required","billing_unavailable","test_quota_exceeded","plan_required","plan_managed","login_flow_rate_limited","schedule_interval_too_small","live_unavailable","pdf_not_pdf","pdf_too_large","pdf_malware","pdf_scanner_unavailable","pdf_encrypted","pdf_too_complex","pdf_malformed","pdf_active_content","pdf_source_missing","internal"]}]},"url":{"type":"string","format":"uri"}},"required":["job","program","url"],"additionalProperties":false}},"required":["id","type","created_at","org","mode","data"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^evt_[0-9a-hjkmnp-tv-z]{26}$"},"type":{"type":"string","const":"job.blocked"},"created_at":{"type":"string","format":"date-time"},"org":{"type":"string","pattern":"^org_[0-9a-hjkmnp-tv-z]{26}$"},"mode":{"type":"string","enum":["live","test"]},"data":{"type":"object","properties":{"job":{"type":"string","pattern":"^job_[0-9a-hjkmnp-tv-z]{26}$"},"program":{"type":["string","null"]},"reason":{"anyOf":[{"type":"string","enum":["obstacle","drift","unknown_page","session_expired","side_effect_ambiguous","captcha"]},{"type":"string","enum":["blocked","timeout","session_expired","validation_failed","input_expired","side_effect_ambiguous","insufficient_credits","max_credits_exceeded","max_tier_exceeded","max_steps_exceeded","ssrf_blocked","target_disallowed","byo_proxy_unreachable","byo_proxy_blocked","byo_llm_auth_failed","byo_llm_rate_limited","byo_llm_quota_exceeded","byo_captcha_auth_failed","byo_captcha_balance","byo_provider_failing","byo_in_use","program_invalid","request_invalid","idempotency_conflict","session_locked_timeout","session_locked","session_engine_mismatch","job_not_waiting","fence_open","loop_exhausted","target_ambiguous","canceled","not_found","program_not_found","program_has_schedules","secret_storage_disabled","not_implemented","two_factor_required","reauth_required","rate_limited","payment_method_required","billing_unavailable","test_quota_exceeded","plan_required","plan_managed","login_flow_rate_limited","schedule_interval_too_small","live_unavailable","pdf_not_pdf","pdf_too_large","pdf_malware","pdf_scanner_unavailable","pdf_encrypted","pdf_too_complex","pdf_malformed","pdf_active_content","pdf_source_missing","internal"]}]},"url":{"type":"string","format":"uri"}},"required":["job","program","url"],"additionalProperties":false}},"required":["id","type","created_at","org","mode","data"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^evt_[0-9a-hjkmnp-tv-z]{26}$"},"type":{"type":"string","const":"job.started"},"created_at":{"type":"string","format":"date-time"},"org":{"type":"string","pattern":"^org_[0-9a-hjkmnp-tv-z]{26}$"},"mode":{"type":"string","enum":["live","test"]},"data":{"type":"object","properties":{"job":{"type":"string","pattern":"^job_[0-9a-hjkmnp-tv-z]{26}$"},"program":{"type":["string","null"]},"reason":{"anyOf":[{"type":"string","enum":["obstacle","drift","unknown_page","session_expired","side_effect_ambiguous","captcha"]},{"type":"string","enum":["blocked","timeout","session_expired","validation_failed","input_expired","side_effect_ambiguous","insufficient_credits","max_credits_exceeded","max_tier_exceeded","max_steps_exceeded","ssrf_blocked","target_disallowed","byo_proxy_unreachable","byo_proxy_blocked","byo_llm_auth_failed","byo_llm_rate_limited","byo_llm_quota_exceeded","byo_captcha_auth_failed","byo_captcha_balance","byo_provider_failing","byo_in_use","program_invalid","request_invalid","idempotency_conflict","session_locked_timeout","session_locked","session_engine_mismatch","job_not_waiting","fence_open","loop_exhausted","target_ambiguous","canceled","not_found","program_not_found","program_has_schedules","secret_storage_disabled","not_implemented","two_factor_required","reauth_required","rate_limited","payment_method_required","billing_unavailable","test_quota_exceeded","plan_required","plan_managed","login_flow_rate_limited","schedule_interval_too_small","live_unavailable","pdf_not_pdf","pdf_too_large","pdf_malware","pdf_scanner_unavailable","pdf_encrypted","pdf_too_complex","pdf_malformed","pdf_active_content","pdf_source_missing","internal"]}]},"url":{"type":"string","format":"uri"}},"required":["job","program","url"],"additionalProperties":false}},"required":["id","type","created_at","org","mode","data"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^evt_[0-9a-hjkmnp-tv-z]{26}$"},"type":{"type":"string","const":"job.awaiting_input"},"created_at":{"type":"string","format":"date-time"},"org":{"type":"string","pattern":"^org_[0-9a-hjkmnp-tv-z]{26}$"},"mode":{"type":"string","enum":["live","test"]},"data":{"type":"object","properties":{"job":{"type":"string","pattern":"^job_[0-9a-hjkmnp-tv-z]{26}$"},"program":{"type":["string","null"]},"reason":{"anyOf":[{"type":"string","enum":["obstacle","drift","unknown_page","session_expired","side_effect_ambiguous","captcha"]},{"type":"string","enum":["blocked","timeout","session_expired","validation_failed","input_expired","side_effect_ambiguous","insufficient_credits","max_credits_exceeded","max_tier_exceeded","max_steps_exceeded","ssrf_blocked","target_disallowed","byo_proxy_unreachable","byo_proxy_blocked","byo_llm_auth_failed","byo_llm_rate_limited","byo_llm_quota_exceeded","byo_captcha_auth_failed","byo_captcha_balance","byo_provider_failing","byo_in_use","program_invalid","request_invalid","idempotency_conflict","session_locked_timeout","session_locked","session_engine_mismatch","job_not_waiting","fence_open","loop_exhausted","target_ambiguous","canceled","not_found","program_not_found","program_has_schedules","secret_storage_disabled","not_implemented","two_factor_required","reauth_required","rate_limited","payment_method_required","billing_unavailable","test_quota_exceeded","plan_required","plan_managed","login_flow_rate_limited","schedule_interval_too_small","live_unavailable","pdf_not_pdf","pdf_too_large","pdf_malware","pdf_scanner_unavailable","pdf_encrypted","pdf_too_complex","pdf_malformed","pdf_active_content","pdf_source_missing","internal"]}]},"url":{"type":"string","format":"uri"}},"required":["job","program","url"],"additionalProperties":false}},"required":["id","type","created_at","org","mode","data"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^evt_[0-9a-hjkmnp-tv-z]{26}$"},"type":{"type":"string","const":"job.needs_attention"},"created_at":{"type":"string","format":"date-time"},"org":{"type":"string","pattern":"^org_[0-9a-hjkmnp-tv-z]{26}$"},"mode":{"type":"string","enum":["live","test"]},"data":{"type":"object","properties":{"job":{"type":"string","pattern":"^job_[0-9a-hjkmnp-tv-z]{26}$"},"program":{"type":["string","null"]},"reason":{"anyOf":[{"type":"string","enum":["obstacle","drift","unknown_page","session_expired","side_effect_ambiguous","captcha"]},{"type":"string","enum":["blocked","timeout","session_expired","validation_failed","input_expired","side_effect_ambiguous","insufficient_credits","max_credits_exceeded","max_tier_exceeded","max_steps_exceeded","ssrf_blocked","target_disallowed","byo_proxy_unreachable","byo_proxy_blocked","byo_llm_auth_failed","byo_llm_rate_limited","byo_llm_quota_exceeded","byo_captcha_auth_failed","byo_captcha_balance","byo_provider_failing","byo_in_use","program_invalid","request_invalid","idempotency_conflict","session_locked_timeout","session_locked","session_engine_mismatch","job_not_waiting","fence_open","loop_exhausted","target_ambiguous","canceled","not_found","program_not_found","program_has_schedules","secret_storage_disabled","not_implemented","two_factor_required","reauth_required","rate_limited","payment_method_required","billing_unavailable","test_quota_exceeded","plan_required","plan_managed","login_flow_rate_limited","schedule_interval_too_small","live_unavailable","pdf_not_pdf","pdf_too_large","pdf_malware","pdf_scanner_unavailable","pdf_encrypted","pdf_too_complex","pdf_malformed","pdf_active_content","pdf_source_missing","internal"]}]},"url":{"type":"string","format":"uri"}},"required":["job","program","url"],"additionalProperties":false}},"required":["id","type","created_at","org","mode","data"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^evt_[0-9a-hjkmnp-tv-z]{26}$"},"type":{"type":"string","const":"job.succeeded"},"created_at":{"type":"string","format":"date-time"},"org":{"type":"string","pattern":"^org_[0-9a-hjkmnp-tv-z]{26}$"},"mode":{"type":"string","enum":["live","test"]},"data":{"type":"object","properties":{"job":{"type":"string","pattern":"^job_[0-9a-hjkmnp-tv-z]{26}$"},"program":{"type":["string","null"]},"reason":{"anyOf":[{"type":"string","enum":["obstacle","drift","unknown_page","session_expired","side_effect_ambiguous","captcha"]},{"type":"string","enum":["blocked","timeout","session_expired","validation_failed","input_expired","side_effect_ambiguous","insufficient_credits","max_credits_exceeded","max_tier_exceeded","max_steps_exceeded","ssrf_blocked","target_disallowed","byo_proxy_unreachable","byo_proxy_blocked","byo_llm_auth_failed","byo_llm_rate_limited","byo_llm_quota_exceeded","byo_captcha_auth_failed","byo_captcha_balance","byo_provider_failing","byo_in_use","program_invalid","request_invalid","idempotency_conflict","session_locked_timeout","session_locked","session_engine_mismatch","job_not_waiting","fence_open","loop_exhausted","target_ambiguous","canceled","not_found","program_not_found","program_has_schedules","secret_storage_disabled","not_implemented","two_factor_required","reauth_required","rate_limited","payment_method_required","billing_unavailable","test_quota_exceeded","plan_required","plan_managed","login_flow_rate_limited","schedule_interval_too_small","live_unavailable","pdf_not_pdf","pdf_too_large","pdf_malware","pdf_scanner_unavailable","pdf_encrypted","pdf_too_complex","pdf_malformed","pdf_active_content","pdf_source_missing","internal"]}]},"url":{"type":"string","format":"uri"}},"required":["job","program","url"],"additionalProperties":false}},"required":["id","type","created_at","org","mode","data"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^evt_[0-9a-hjkmnp-tv-z]{26}$"},"type":{"type":"string","const":"job.failed"},"created_at":{"type":"string","format":"date-time"},"org":{"type":"string","pattern":"^org_[0-9a-hjkmnp-tv-z]{26}$"},"mode":{"type":"string","enum":["live","test"]},"data":{"type":"object","properties":{"job":{"type":"string","pattern":"^job_[0-9a-hjkmnp-tv-z]{26}$"},"program":{"type":["string","null"]},"reason":{"anyOf":[{"type":"string","enum":["obstacle","drift","unknown_page","session_expired","side_effect_ambiguous","captcha"]},{"type":"string","enum":["blocked","timeout","session_expired","validation_failed","input_expired","side_effect_ambiguous","insufficient_credits","max_credits_exceeded","max_tier_exceeded","max_steps_exceeded","ssrf_blocked","target_disallowed","byo_proxy_unreachable","byo_proxy_blocked","byo_llm_auth_failed","byo_llm_rate_limited","byo_llm_quota_exceeded","byo_captcha_auth_failed","byo_captcha_balance","byo_provider_failing","byo_in_use","program_invalid","request_invalid","idempotency_conflict","session_locked_timeout","session_locked","session_engine_mismatch","job_not_waiting","fence_open","loop_exhausted","target_ambiguous","canceled","not_found","program_not_found","program_has_schedules","secret_storage_disabled","not_implemented","two_factor_required","reauth_required","rate_limited","payment_method_required","billing_unavailable","test_quota_exceeded","plan_required","plan_managed","login_flow_rate_limited","schedule_interval_too_small","live_unavailable","pdf_not_pdf","pdf_too_large","pdf_malware","pdf_scanner_unavailable","pdf_encrypted","pdf_too_complex","pdf_malformed","pdf_active_content","pdf_source_missing","internal"]}]},"url":{"type":"string","format":"uri"}},"required":["job","program","url"],"additionalProperties":false}},"required":["id","type","created_at","org","mode","data"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^evt_[0-9a-hjkmnp-tv-z]{26}$"},"type":{"type":"string","const":"job.canceled"},"created_at":{"type":"string","format":"date-time"},"org":{"type":"string","pattern":"^org_[0-9a-hjkmnp-tv-z]{26}$"},"mode":{"type":"string","enum":["live","test"]},"data":{"type":"object","properties":{"job":{"type":"string","pattern":"^job_[0-9a-hjkmnp-tv-z]{26}$"},"program":{"type":["string","null"]},"reason":{"anyOf":[{"type":"string","enum":["obstacle","drift","unknown_page","session_expired","side_effect_ambiguous","captcha"]},{"type":"string","enum":["blocked","timeout","session_expired","validation_failed","input_expired","side_effect_ambiguous","insufficient_credits","max_credits_exceeded","max_tier_exceeded","max_steps_exceeded","ssrf_blocked","target_disallowed","byo_proxy_unreachable","byo_proxy_blocked","byo_llm_auth_failed","byo_llm_rate_limited","byo_llm_quota_exceeded","byo_captcha_auth_failed","byo_captcha_balance","byo_provider_failing","byo_in_use","program_invalid","request_invalid","idempotency_conflict","session_locked_timeout","session_locked","session_engine_mismatch","job_not_waiting","fence_open","loop_exhausted","target_ambiguous","canceled","not_found","program_not_found","program_has_schedules","secret_storage_disabled","not_implemented","two_factor_required","reauth_required","rate_limited","payment_method_required","billing_unavailable","test_quota_exceeded","plan_required","plan_managed","login_flow_rate_limited","schedule_interval_too_small","live_unavailable","pdf_not_pdf","pdf_too_large","pdf_malware","pdf_scanner_unavailable","pdf_encrypted","pdf_too_complex","pdf_malformed","pdf_active_content","pdf_source_missing","internal"]}]},"url":{"type":"string","format":"uri"}},"required":["job","program","url"],"additionalProperties":false}},"required":["id","type","created_at","org","mode","data"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^evt_[0-9a-hjkmnp-tv-z]{26}$"},"type":{"type":"string","const":"batch.completed"},"created_at":{"type":"string","format":"date-time"},"org":{"type":"string","pattern":"^org_[0-9a-hjkmnp-tv-z]{26}$"},"mode":{"type":"string","enum":["live","test"]},"data":{"type":"object","properties":{"batch":{"type":"string","pattern":"^bat_[0-9a-hjkmnp-tv-z]{26}$"},"total":{"type":"integer","minimum":0},"url":{"type":"string","format":"uri"}},"required":["batch","total","url"],"additionalProperties":false}},"required":["id","type","created_at","org","mode","data"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^evt_[0-9a-hjkmnp-tv-z]{26}$"},"type":{"type":"string","const":"proposal.created"},"created_at":{"type":"string","format":"date-time"},"org":{"type":"string","pattern":"^org_[0-9a-hjkmnp-tv-z]{26}$"},"mode":{"type":"string","enum":["live","test"]},"data":{"type":"object","properties":{"proposal":{"type":"string","pattern":"^prp_[0-9a-hjkmnp-tv-z]{26}$"},"program":{"type":"string"},"job":{"type":["string","null"],"pattern":"^job_[0-9a-hjkmnp-tv-z]{26}$"},"kind":{"type":"string","enum":["relocate","dismiss","insert_steps","parser_config","api_discovery"]},"decision":{"type":"string","enum":["approved","rejected"]},"url":{"type":"string","format":"uri"}},"required":["proposal","program","job","url"],"additionalProperties":false}},"required":["id","type","created_at","org","mode","data"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^evt_[0-9a-hjkmnp-tv-z]{26}$"},"type":{"type":"string","const":"proposal.decided"},"created_at":{"type":"string","format":"date-time"},"org":{"type":"string","pattern":"^org_[0-9a-hjkmnp-tv-z]{26}$"},"mode":{"type":"string","enum":["live","test"]},"data":{"type":"object","properties":{"proposal":{"type":"string","pattern":"^prp_[0-9a-hjkmnp-tv-z]{26}$"},"program":{"type":"string"},"job":{"type":["string","null"],"pattern":"^job_[0-9a-hjkmnp-tv-z]{26}$"},"kind":{"type":"string","enum":["relocate","dismiss","insert_steps","parser_config","api_discovery"]},"decision":{"type":"string","enum":["approved","rejected"]},"url":{"type":"string","format":"uri"}},"required":["proposal","program","job","url"],"additionalProperties":false}},"required":["id","type","created_at","org","mode","data"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^evt_[0-9a-hjkmnp-tv-z]{26}$"},"type":{"type":"string","const":"schedule.run"},"created_at":{"type":"string","format":"date-time"},"org":{"type":"string","pattern":"^org_[0-9a-hjkmnp-tv-z]{26}$"},"mode":{"type":"string","enum":["live","test"]},"data":{"type":"object","properties":{"schedule":{"type":"string","pattern":"^sch_[0-9a-hjkmnp-tv-z]{26}$"},"job":{"type":"string","pattern":"^job_[0-9a-hjkmnp-tv-z]{26}$"},"status":{"type":"string","enum":["queued","running","awaiting_input","needs_attention","succeeded","failed","canceled"]},"changed":{"type":"boolean"},"url":{"type":"string","format":"uri"}},"required":["schedule","job","status","url"],"additionalProperties":false}},"required":["id","type","created_at","org","mode","data"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^evt_[0-9a-hjkmnp-tv-z]{26}$"},"type":{"type":"string","const":"schedule.changed"},"created_at":{"type":"string","format":"date-time"},"org":{"type":"string","pattern":"^org_[0-9a-hjkmnp-tv-z]{26}$"},"mode":{"type":"string","enum":["live","test"]},"data":{"type":"object","properties":{"schedule":{"type":"string","pattern":"^sch_[0-9a-hjkmnp-tv-z]{26}$"},"job":{"type":"string","pattern":"^job_[0-9a-hjkmnp-tv-z]{26}$"},"changed_paths":{"type":"array","items":{"type":"string"},"maxItems":50},"changed_paths_truncated":{"type":"boolean"},"url":{"type":"string","format":"uri"},"diff_url":{"type":"string","format":"uri"}},"required":["schedule","job","changed_paths","url","diff_url"],"additionalProperties":false}},"required":["id","type","created_at","org","mode","data"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^evt_[0-9a-hjkmnp-tv-z]{26}$"},"type":{"type":"string","const":"schedule.paused"},"created_at":{"type":"string","format":"date-time"},"org":{"type":"string","pattern":"^org_[0-9a-hjkmnp-tv-z]{26}$"},"mode":{"type":"string","enum":["live","test"]},"data":{"type":"object","properties":{"schedule":{"type":"string","pattern":"^sch_[0-9a-hjkmnp-tv-z]{26}$"},"reason":{"type":"string","enum":["manual","credits"]},"url":{"type":"string","format":"uri"}},"required":["schedule","reason","url"],"additionalProperties":false}},"required":["id","type","created_at","org","mode","data"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^evt_[0-9a-hjkmnp-tv-z]{26}$"},"type":{"type":"string","const":"schedule.failing"},"created_at":{"type":"string","format":"date-time"},"org":{"type":"string","pattern":"^org_[0-9a-hjkmnp-tv-z]{26}$"},"mode":{"type":"string","enum":["live","test"]},"data":{"type":"object","properties":{"schedule":{"type":"string","pattern":"^sch_[0-9a-hjkmnp-tv-z]{26}$"},"job":{"type":"string","pattern":"^job_[0-9a-hjkmnp-tv-z]{26}$"},"failure_streak":{"type":"integer","minimum":1},"url":{"type":"string","format":"uri"}},"required":["schedule","job","failure_streak","url"],"additionalProperties":false}},"required":["id","type","created_at","org","mode","data"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^evt_[0-9a-hjkmnp-tv-z]{26}$"},"type":{"type":"string","const":"session.expired"},"created_at":{"type":"string","format":"date-time"},"org":{"type":"string","pattern":"^org_[0-9a-hjkmnp-tv-z]{26}$"},"mode":{"type":"string","enum":["live","test"]},"data":{"type":"object","properties":{"session":{"type":"string","pattern":"^ses_[0-9a-hjkmnp-tv-z]{26}$"},"name":{"type":"string"},"url":{"type":"string","format":"uri"}},"required":["session","name","url"],"additionalProperties":false}},"required":["id","type","created_at","org","mode","data"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^evt_[0-9a-hjkmnp-tv-z]{26}$"},"type":{"type":"string","const":"program.drift_detected"},"created_at":{"type":"string","format":"date-time"},"org":{"type":"string","pattern":"^org_[0-9a-hjkmnp-tv-z]{26}$"},"mode":{"type":"string","enum":["live","test"]},"data":{"type":"object","properties":{"program":{"type":"string","pattern":"^prg_[0-9a-hjkmnp-tv-z]{26}$"},"program_version_id":{"type":"string","pattern":"^pv_[0-9a-hjkmnp-tv-z]{26}$"},"field":{"type":"string"},"kind":{"type":"string","enum":["fill_rate_drop","parse_rate_drop","list_len_drop","value_shift","canary_failure"]},"detail":{"type":"string"},"source":{"type":"string","enum":["statistics","canary"]},"at":{"type":"string","format":"date-time"},"job":{"type":"string","pattern":"^job_[0-9a-hjkmnp-tv-z]{26}$"},"url":{"type":"string","format":"uri"}},"required":["program","program_version_id","field","kind","detail","source","at","url"],"additionalProperties":false}},"required":["id","type","created_at","org","mode","data"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^evt_[0-9a-hjkmnp-tv-z]{26}$"},"type":{"type":"string","const":"credits.low"},"created_at":{"type":"string","format":"date-time"},"org":{"type":"string","pattern":"^org_[0-9a-hjkmnp-tv-z]{26}$"},"mode":{"type":"string","enum":["live","test"]},"data":{"type":"object","properties":{"balance":{"type":"number"},"level":{"type":"integer","minimum":0,"maximum":100},"threshold":{"type":"number"},"url":{"type":"string","format":"uri"}},"required":["balance","url"],"additionalProperties":false}},"required":["id","type","created_at","org","mode","data"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^evt_[0-9a-hjkmnp-tv-z]{26}$"},"type":{"type":"string","const":"credits.exhausted"},"created_at":{"type":"string","format":"date-time"},"org":{"type":"string","pattern":"^org_[0-9a-hjkmnp-tv-z]{26}$"},"mode":{"type":"string","enum":["live","test"]},"data":{"type":"object","properties":{"balance":{"type":"number"},"level":{"type":"integer","minimum":0,"maximum":100},"threshold":{"type":"number"},"url":{"type":"string","format":"uri"}},"required":["balance","url"],"additionalProperties":false}},"required":["id","type","created_at","org","mode","data"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^evt_[0-9a-hjkmnp-tv-z]{26}$"},"type":{"type":"string","const":"credits.recharged"},"created_at":{"type":"string","format":"date-time"},"org":{"type":"string","pattern":"^org_[0-9a-hjkmnp-tv-z]{26}$"},"mode":{"type":"string","enum":["live","test"]},"data":{"type":"object","properties":{"balance":{"type":"number"},"level":{"type":"integer","minimum":0,"maximum":100},"threshold":{"type":"number"},"url":{"type":"string","format":"uri"}},"required":["balance","url"],"additionalProperties":false}},"required":["id","type","created_at","org","mode","data"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^evt_[0-9a-hjkmnp-tv-z]{26}$"},"type":{"type":"string","const":"byo.unhealthy"},"created_at":{"type":"string","format":"date-time"},"org":{"type":"string","pattern":"^org_[0-9a-hjkmnp-tv-z]{26}$"},"mode":{"type":"string","enum":["live","test"]},"data":{"type":"object","properties":{"byo":{"type":"string","pattern":"^byo_[0-9a-hjkmnp-tv-z]{26}$"},"kind":{"type":"string","enum":["proxy","llm","captcha"]},"status":{"type":"string","enum":["untested","healthy","degraded","failing"]},"detail":{"type":"string"},"url":{"type":"string","format":"uri"}},"required":["byo","kind","status","url"],"additionalProperties":false}},"required":["id","type","created_at","org","mode","data"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^evt_[0-9a-hjkmnp-tv-z]{26}$"},"type":{"type":"string","const":"byo.recovered"},"created_at":{"type":"string","format":"date-time"},"org":{"type":"string","pattern":"^org_[0-9a-hjkmnp-tv-z]{26}$"},"mode":{"type":"string","enum":["live","test"]},"data":{"type":"object","properties":{"byo":{"type":"string","pattern":"^byo_[0-9a-hjkmnp-tv-z]{26}$"},"kind":{"type":"string","enum":["proxy","llm","captcha"]},"status":{"type":"string","enum":["untested","healthy","degraded","failing"]},"detail":{"type":"string"},"url":{"type":"string","format":"uri"}},"required":["byo","kind","status","url"],"additionalProperties":false}},"required":["id","type","created_at","org","mode","data"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^evt_[0-9a-hjkmnp-tv-z]{26}$"},"type":{"type":"string","const":"webhook.disabled"},"created_at":{"type":"string","format":"date-time"},"org":{"type":"string","pattern":"^org_[0-9a-hjkmnp-tv-z]{26}$"},"mode":{"type":"string","enum":["live","test"]},"data":{"type":"object","properties":{"webhook":{"type":"string","pattern":"^whk_[0-9a-hjkmnp-tv-z]{26}$"},"reason":{"type":"string","const":"auto"},"failure_streak":{"type":"integer","minimum":0},"failing_since":{"type":"string","format":"date-time"},"url":{"type":"string","format":"uri"}},"required":["webhook","reason","failure_streak","failing_since","url"],"additionalProperties":false}},"required":["id","type","created_at","org","mode","data"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","pattern":"^evt_[0-9a-hjkmnp-tv-z]{26}$"},"type":{"type":"string","const":"ping"},"created_at":{"type":"string","format":"date-time"},"org":{"type":"string","pattern":"^org_[0-9a-hjkmnp-tv-z]{26}$"},"mode":{"type":"string","enum":["live","test"]},"data":{"type":"object","properties":{"webhook":{"type":"string","pattern":"^whk_[0-9a-hjkmnp-tv-z]{26}$"},"url":{"type":"string","format":"uri"}},"required":["webhook","url"],"additionalProperties":false}},"required":["id","type","created_at","org","mode","data"],"additionalProperties":false}]},"ApiKey":{"type":"object","properties":{"id":{"type":"string","pattern":"^key_[0-9a-hjkmnp-tv-z]{26}$"},"object":{"type":"string","const":"api_key"},"name":{"type":"string"},"prefix":{"type":"string"},"scopes":{"type":"array","items":{"type":"string","enum":["run","read","admin"]},"minItems":1},"mode":{"type":"string","enum":["live","test"]},"last_used_at":{"type":["string","null"],"format":"date-time"},"expires_at":{"type":["string","null"],"format":"date-time"},"created_at":{"type":"string","format":"date-time"}},"required":["id","object","name","prefix","scopes","mode","last_used_at","expires_at","created_at"],"additionalProperties":false},"ByoProvider":{"type":"object","properties":{"id":{"type":"string","pattern":"^byo_[0-9a-hjkmnp-tv-z]{26}$"},"object":{"type":"string","const":"byo_provider"},"kind":{"type":"string","enum":["proxy","llm","captcha"]},"name":{"type":"string"},"status":{"type":"string","enum":["untested","healthy","degraded","failing"]},"last_health_at":{"type":["string","null"],"format":"date-time"},"health":{"type":"object","properties":{"checked_at":{"type":"string","format":"date-time"},"ok":{"type":"boolean"},"latency_ms":{"type":["integer","null"],"minimum":0},"detail":{"type":"string"}},"required":["checked_at","ok","latency_ms","detail"],"additionalProperties":false},"config_public":{"type":"object","additionalProperties":{}},"created_at":{"type":"string","format":"date-time"}},"required":["id","object","kind","name","status","last_health_at","config_public","created_at"],"additionalProperties":false},"Org":{"type":"object","properties":{"id":{"type":"string","pattern":"^org_[0-9a-hjkmnp-tv-z]{26}$"},"object":{"type":"string","const":"org"},"name":{"type":"string"},"slug":{"type":"string"},"plan":{"type":"string"},"region":{"type":"string","enum":["eu","us"]},"created_at":{"type":"string","format":"date-time"},"quotas":{"type":"object","properties":{"http":{"type":"object","properties":{"limit":{"type":"integer","minimum":0},"in_use":{"type":"integer","minimum":0}},"required":["limit","in_use"],"additionalProperties":false},"browser":{"type":"object","properties":{"limit":{"type":"integer","minimum":0},"in_use":{"type":"integer","minimum":0}},"required":["limit","in_use"],"additionalProperties":false},"stealth":{"type":"object","properties":{"limit":{"type":"integer","minimum":0},"in_use":{"type":"integer","minimum":0}},"required":["limit","in_use"],"additionalProperties":false}},"required":["http","browser","stealth"],"additionalProperties":false}},"required":["id","object","name","slug","plan","region","created_at","quotas"],"additionalProperties":false},"Credits":{"type":"object","properties":{"balance":{"type":"number"},"reserved":{"type":"number"},"available":{"type":"number"},"pools":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["promo","allowance","purchased","overage"]},"amount":{"type":"number"},"expires_at":{"type":["string","null"],"format":"date-time"}},"required":["type","amount","expires_at"],"additionalProperties":false}},"auto_recharge":{"type":["object","null"],"properties":{"threshold":{"type":"number"},"amount":{"type":"number"}},"required":["threshold","amount"],"additionalProperties":false}},"required":["balance","reserved","available","pools","auto_recharge"],"additionalProperties":false},"LedgerEntry":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","const":"ledger_entry"},"type":{"type":"string","enum":["purchase","grant","subscription_allowance","reserve","settle","release","refund","expire","adjust"]},"amount":{"type":"number"},"pool":{"type":"string","enum":["promo","allowance","purchased","overage"]},"expires_at":{"type":["string","null"],"format":"date-time"},"job_id":{"type":["string","null"],"pattern":"^job_[0-9a-hjkmnp-tv-z]{26}$"},"live_session_id":{"type":["string","null"],"pattern":"^lv_[0-9a-hjkmnp-tv-z]{26}$"},"description":{"type":"string"},"breakdown":{"type":["object","null"],"additionalProperties":{"type":"number"}},"created_at":{"type":"string","format":"date-time"}},"required":["id","object","type","amount","pool","expires_at","job_id","live_session_id","description","breakdown","created_at"],"additionalProperties":false},"SiteProfile":{"type":"object","properties":{"hostname":{"type":"string"},"object":{"type":"string","const":"site_profile"},"tier_required":{"type":"string","enum":["http","browser","stealth"]},"tier_confidence":{"type":"number","minimum":0,"maximum":1},"known_obstacles_count":{"type":"integer","minimum":0},"api_endpoints_count":{"type":"integer","minimum":0},"last_blocked_at":{"type":["string","null"],"format":"date-time"}},"required":["hostname","object","tier_required","tier_confidence","known_obstacles_count","api_endpoints_count","last_blocked_at"],"additionalProperties":false},"ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["blocked","timeout","session_expired","validation_failed","input_expired","side_effect_ambiguous","insufficient_credits","max_credits_exceeded","max_tier_exceeded","max_steps_exceeded","ssrf_blocked","target_disallowed","byo_proxy_unreachable","byo_proxy_blocked","byo_llm_auth_failed","byo_llm_rate_limited","byo_llm_quota_exceeded","byo_captcha_auth_failed","byo_captcha_balance","byo_provider_failing","byo_in_use","program_invalid","request_invalid","idempotency_conflict","session_locked_timeout","session_locked","session_engine_mismatch","job_not_waiting","fence_open","loop_exhausted","target_ambiguous","canceled","not_found","program_not_found","program_has_schedules","secret_storage_disabled","not_implemented","two_factor_required","reauth_required","rate_limited","payment_method_required","billing_unavailable","test_quota_exceeded","plan_required","plan_managed","login_flow_rate_limited","schedule_interval_too_small","live_unavailable","pdf_not_pdf","pdf_too_large","pdf_malware","pdf_scanner_unavailable","pdf_encrypted","pdf_too_complex","pdf_malformed","pdf_active_content","pdf_source_missing","internal"]},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{}},"request_id":{"type":"string"}},"required":["code","message","request_id"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"ProgramDefinition":{"type":"object","description":"A Kaabist program definition. Full grammar: https://kaab.ist/schemas/program-1.json","externalDocs":{"url":"https://kaab.ist/schemas/program-1.json","description":"Program JSON Schema"}},"ExtractSchema":{"type":"object","description":"A Kaabist extract schema. Full grammar: https://kaab.ist/schemas/program-1.json"}}}}