{"openapi":"3.1.0","info":{"title":"Patchwell","description":"Tools for AI agents. Every result says what it changed and why.","version":"1.0"},"paths":{"/v1/tools":{"get":{"summary":"List the tools, prices and limits","operationId":"list_tools","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing or invalid key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/credits/trial":{"post":{"summary":"Get a free key with $1 of credit (email, no card)","description":"Instant free key ($1 credit, no card). Limits live in payments.trial; the network is the visitor's IP\nas Cloudflare saw it (the daily cap bounds anyone who reaches the origin directly).","operationId":"create_trial_key","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing or invalid key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["email"],"properties":{"email":{"type":"string","format":"email"}}}}}}}},"/v1/account/privacy":{"get":{"summary":"This key's research-retention setting","operationId":"get_privacy","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing or invalid key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"summary":"Turn research retention on or off for this key","description":"Instant and permanent: false stops keeping research questions for this key and deletes any already kept.","operationId":"set_privacy","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing or invalid key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/credits/balance":{"get":{"summary":"A prepaid key's balance","operationId":"get_balance","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing or invalid key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/status":{"get":{"summary":"Each tool's status from the latest monitor checks, and recent incidents","description":"Each public tool's status from the monitor's latest checks (health_probe), and recent incidents.","operationId":"get_status","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing or invalid key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/transcribe":{"post":{"summary":"Transcribe audio or video with word timings and speaker labels","operationId":"transcribe","responses":{"200":{"description":"The result. Without Prefer: respond-async (or wait), a job still running when the request times out (about 100 s) also comes back as 200 with {status: running, job_id, status_url}: check status, then poll status_url.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/TranscribeResult"},{"$ref":"#/components/schemas/JobRunning"}]}}}},"401":{"description":"Missing or invalid key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"202":{"description":"Still running: poll Location (GET /v1/jobs/{job_id}) after Retry-After seconds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobRunning"}}}},"402":{"description":"Not enough credit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Same Idempotency-Key still running","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TranscribeRequest"}}}},"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":200},"description":"Retries with the same key return the first response and are never charged twice."},{"name":"Prefer","in":"header","required":false,"schema":{"type":"string","example":"respond-async"},"description":"respond-async: return a running job at once (202)."}]}},"/v1/research":{"post":{"summary":"Answer a question from the live web, every claim cited","operationId":"research","responses":{"200":{"description":"The result. Without Prefer: respond-async (or wait), a job still running when the request times out (about 100 s) also comes back as 200 with {status: running, job_id, status_url}: check status, then poll status_url.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ResearchResult"},{"$ref":"#/components/schemas/JobRunning"}]}}}},"401":{"description":"Missing or invalid key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"202":{"description":"Still running: poll Location (GET /v1/jobs/{job_id}) after Retry-After seconds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobRunning"}}}},"402":{"description":"Not enough credit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Same Idempotency-Key still running","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResearchRequest"}}}},"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":200},"description":"Retries with the same key return the first response and are never charged twice."},{"name":"Prefer","in":"header","required":false,"schema":{"type":"string","example":"respond-async"},"description":"respond-async: return a running job at once (202)."}]}},"/v1/clip":{"post":{"summary":"A few seconds of a recording as MP3, to hear an unsure spot","description":"A few seconds of the media you transcribed, as MP3, to listen to a spot marked unsure. Free.","operationId":"listen_clip","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing or invalid key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/jobs/{job_id}":{"get":{"summary":"Get a long job's status or result","operationId":"get_job","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"description":"Missing or invalid key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/batches":{"get":{"summary":"Your recent batches","operationId":"list_batches","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing or invalid key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"summary":"Queue many items for one tool, run in parallel at your share","operationId":"create_batch","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing or invalid key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/batches/{bid}":{"get":{"summary":"A batch's status, progress, counts and spend","operationId":"get_batch","parameters":[{"name":"bid","in":"path","required":true,"schema":{"type":"string","title":"Bid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"description":"Missing or invalid key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/batches/{bid}/cancel":{"post":{"summary":"Stop starting new items (running ones finish)","operationId":"cancel_batch","parameters":[{"name":"bid","in":"path","required":true,"schema":{"type":"string","title":"Bid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"description":"Missing or invalid key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/batches/{bid}/results":{"get":{"summary":"Finished items as JSON lines (readable while it runs)","description":"One JSON line per finished item (index, custom_id, status, result or error), in finishing order. Readable\nwhile the batch runs. ?status=failed for the failures only; offset / limit to page.","operationId":"get_batch_results","parameters":[{"name":"bid","in":"path","required":true,"schema":{"type":"string","title":"Bid"}},{"name":"status","in":"query","required":false,"schema":{"type":"string","default":"","title":"Status"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"description":"Missing or invalid key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/quotes":{"post":{"summary":"What a batch would cost and how long it takes, before it runs","description":"What a batch would cost and how long it takes at this key's share, before anything runs. Free.","operationId":"quote_batch","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing or invalid key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/jobs/{job_id}/cancel":{"post":{"summary":"Stop a running job; nothing is charged","description":"Stop a running job. It costs nothing: its whole reservation comes back.","operationId":"cancel_job","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"description":"Missing or invalid key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/me":{"get":{"summary":"Check a key: its type, balance and tools","description":"A key check for any automation's credential test: which key this is, its balance, and the tools.","operationId":"me","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing or invalid key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/clean_data":{"post":{"summary":"Clean a CSV, Excel or JSON file into typed, deduplicated rows","operationId":"clean_data","responses":{"200":{"description":"The result. Without Prefer: respond-async (or wait), a job still running when the request times out (about 100 s) also comes back as 200 with {status: running, job_id, status_url}: check status, then poll status_url.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/CleanDataResult"},{"$ref":"#/components/schemas/JobRunning"}]}}}},"401":{"description":"Missing or invalid key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"202":{"description":"Still running: poll Location (GET /v1/jobs/{job_id}) after Retry-After seconds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobRunning"}}}},"402":{"description":"Not enough credit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Same Idempotency-Key still running","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CleanDataRequest"}}}},"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":200},"description":"Retries with the same key return the first response and are never charged twice."},{"name":"Prefer","in":"header","required":false,"schema":{"type":"string","example":"respond-async"},"description":"respond-async: return a running job at once (202)."}]}},"/v1/clean_data/only_new/{state}":{"delete":{"summary":"Forget an only_new state (the next run returns every row)","description":"Forget an only_new state, so the next run returns every row again.","operationId":"reset_only_new","parameters":[{"name":"state","in":"path","required":true,"schema":{"type":"string","title":"State"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"description":"Missing or invalid key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/presets/{name}":{"put":{"summary":"Save a named configuration for one tool","description":"Save a named configuration for one tool: {\"tool\": \"transcribe\", \"params\": {...}}.","operationId":"put_preset","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string","title":"Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"description":"Missing or invalid key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"summary":"Read a saved configuration","operationId":"get_preset","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string","title":"Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"description":"Missing or invalid key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"summary":"Delete a saved configuration","operationId":"delete_preset","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string","title":"Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"description":"Missing or invalid key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/presets":{"get":{"summary":"List saved configurations","operationId":"list_presets","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing or invalid key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/account/webhook-secret":{"get":{"summary":"The secret that signs your webhooks","description":"The secret that signs webhooks for this key (verify Patchwell-Signature with it).","operationId":"get_webhook_secret","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing or invalid key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/webhooks/deliveries":{"get":{"summary":"Recent webhook deliveries and their outcome","description":"The last 50 webhook deliveries for this key, with every attempt's status.","operationId":"list_webhook_deliveries","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing or invalid key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/webhooks/deliveries/{delivery_id}/redeliver":{"post":{"summary":"Send a past webhook delivery again (free)","description":"Send a past delivery again (free): the same payload, signed again, under a new delivery id with\nredelivery_of naming the first. Deliveries are kept 7 days; results over 4 MB aren't kept (read the job).","operationId":"redeliver_webhook","parameters":[{"name":"delivery_id","in":"path","required":true,"schema":{"type":"string","title":"Delivery Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"description":"Missing or invalid key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/rename":{"post":{"summary":"Rename speakers in a transcript result","description":"Rename speakers in a transcript result: {\"result\": <transcribe JSON>, \"speaker_names\": {\"2\": \"Dana\"}}.\nReturns the result with names in speakers, turns, text, SRT and VTT. Free and stateless.","operationId":"rename_speakers","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing or invalid key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/export":{"post":{"summary":"Turn a result into a file (csv, xlsx, docx, md, srt, vtt, txt)","description":"Turn a result into a file. Transcripts (the JSON transcribe returned): srt, vtt, txt, md, csv or docx.\nCleaned data (the JSON clean_data returned, or just its rows and columns): csv or xlsx. Free and\nstateless: the result you send is converted and returned, nothing is kept.","operationId":"export","parameters":[{"name":"format","in":"query","required":false,"schema":{"type":"string","default":"md","title":"Format"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"description":"Missing or invalid key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"schemas":{"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"Error":{"type":"object","required":["error","code","retryable","docs_url","request_id"],"properties":{"error":{"type":"string","description":"One sentence for a person."},"code":{"type":"string","enum":["invalid_input","unauthorized","insufficient_credit","forbidden","not_found","method_not_allowed","too_large","idempotency_in_progress","idempotency_mismatch","rate_limited","source_unavailable","unavailable","tool_paused","internal","cancelled","expired"],"description":"Stable: branch on this, never on the text."},"retryable":{"type":"boolean","description":"True when the same request sent again can succeed."},"docs_url":{"type":"string","format":"uri"},"request_id":{"type":"string","description":"Also the X-Request-Id header; quote it to support."},"param":{"type":"string","description":"The first invalid field, when there is one."},"detail":{"description":"Older field kept for compatibility (a 422's field list)."},"how":{"type":"string"},"get_key":{"type":"string","format":"uri"}}},"JobRunning":{"type":"object","required":["status","job_id"],"properties":{"status":{"type":"string","enum":["running"]},"job_id":{"type":"string"},"status_url":{"type":"string","format":"uri"},"poll_after_s":{"type":"integer"},"next":{"type":"string"}}},"TranscribeRequest":{"properties":{"url":{"title":"Url","type":"string"},"language":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Language"},"speakers":{"default":true,"title":"Speakers","type":"boolean"},"punctuation":{"default":true,"title":"Punctuation","type":"boolean"},"max_seconds":{"anyOf":[{"exclusiveMinimum":0,"maximum":86400,"type":"number"},{"type":"null"}],"default":null,"title":"Max Seconds"},"split_into":{"anyOf":[{"maximum":48,"minimum":1,"type":"integer"},{"type":"null"}],"default":null,"title":"Split Into"},"callback_url":{"type":"string","format":"uri","description":"POST the finished result here, signed with your webhook secret (header Patchwell-Signature: t=<unix>,v1=<hex HMAC-SHA256 of t.body>)."},"wait":{"type":"number","minimum":0,"maximum":100,"description":"Seconds to hold the request for a long job (default 100). 0 returns a job id at once as 202 with Location and Retry-After. Same as the header Prefer: respond-async."},"preset":{"type":"string","description":"Apply a configuration saved with PUT /v1/presets/{name}."}},"required":["url"],"title":"TranscribeRequest","type":"object"},"TranscribeResult":{"type":"object","properties":{"text":{"type":"string"},"language":{"type":"string"},"duration_s":{"type":"number"},"words":{"type":"array","items":{"type":"object","properties":{"w":{"type":"string"},"s":{"type":"number"},"e":{"type":"number"},"p":{"type":"number"},"spk":{"type":"integer"}}}},"segments":{"type":"array","items":{"type":"object"}},"speakers":{"type":"array","items":{"type":"object"}},"srt":{"type":"string"},"vtt":{"type":"string"},"flags":{"type":"array","items":{"type":"object"}},"quality":{"type":"object","description":"Measured facts: words, words_per_minute, uncertain_word_share (words Whisper gave under 50%), removed_word_share (invented phrases and loops the guards removed), notes, and likely_usable (false only in clear cases: no speech, mostly uncertain, mostly removed)."},"billing":{"type":"object","properties":{"price":{"type":"number","description":"USD charged for this call."},"units":{"type":"number"}}},"schema_version":{"type":"string","pattern":"^1\\.\\d+$","description":"Major.minor (e.g. \"1.5\"). A minor bump only adds fields. Compare the parts as integers, not as one decimal number."}}},"CleanDataRequest":{"properties":{"url":{"default":"","title":"Url","type":"string"},"filename":{"default":"","title":"Filename","type":"string"},"content_base64":{"default":"","title":"Content Base64","type":"string"},"dedupe_on":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"string"}],"default":"auto","title":"Dedupe On"},"required":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"default":null,"title":"Required"},"hints":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"default":null,"title":"Hints"},"recipe":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"default":null,"title":"Recipe"},"phone_region":{"default":"US","title":"Phone Region","type":"string"},"phone_format":{"default":"national","title":"Phone Format","type":"string"},"sheet":{"default":"","title":"Sheet","type":"string"},"header_row":{"anyOf":[{"type":"integer"},{"type":"null"}],"default":null,"title":"Header Row"},"fix_email_typos":{"default":true,"title":"Fix Email Typos","type":"boolean"},"table":{"anyOf":[{"maximum":100,"minimum":1,"type":"integer"},{"type":"null"}],"default":null,"title":"Table"},"min_duplicate_confidence":{"default":0.5,"maximum":1,"minimum":0,"title":"Min Duplicate Confidence","type":"number"},"encoding":{"default":"","maxLength":40,"title":"Encoding","type":"string"},"keep_raw":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"default":null,"title":"Keep Raw"},"rows":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"default":null,"title":"Rows"},"csv_text":{"default":"","title":"Csv Text","type":"string"},"inputs":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"maxItems":20,"type":"array"},{"type":"null"}],"default":null,"title":"Inputs"},"only_new":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"default":null,"title":"Only New"},"check_email_domains":{"default":true,"title":"Check Email Domains","type":"boolean"},"rules":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"maxItems":100,"type":"array"},{"type":"null"}],"default":null,"title":"Rules"},"target":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"default":null,"title":"Target"},"output":{"default":"full","title":"Output","type":"string"},"preview":{"default":false,"title":"Preview","type":"boolean"},"apply_clusters":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Apply Clusters"},"callback_url":{"type":"string","format":"uri","description":"POST the finished result here, signed with your webhook secret (header Patchwell-Signature: t=<unix>,v1=<hex HMAC-SHA256 of t.body>)."},"wait":{"type":"number","minimum":0,"maximum":100,"description":"Seconds to hold the request for a long job (default 100). 0 returns a job id at once as 202 with Location and Retry-After. Same as the header Prefer: respond-async."},"preset":{"type":"string","description":"Apply a configuration saved with PUT /v1/presets/{name}."}},"title":"CleanDataRequest","type":"object"},"CleanDataResult":{"type":"object","properties":{"rows":{"type":"array","items":{"type":"object"}},"changes":{"type":"array","items":{"type":"object"}},"review":{"type":"array","items":{"type":"object"}},"columns":{"type":"object"},"quality":{"type":"object"},"schema":{"type":"object"},"recipe":{"type":"object"},"stats":{"type":"object"},"ingest":{"type":"object"},"other_tables":{"type":"array","items":{"type":"object"}},"billing":{"type":"object","properties":{"price":{"type":"number","description":"USD charged for this call."},"units":{"type":"number"}}},"schema_version":{"type":"string","pattern":"^1\\.\\d+$","description":"Major.minor (e.g. \"1.5\"). A minor bump only adds fields. Compare the parts as integers, not as one decimal number."}}},"ResearchRequest":{"type":"object","required":["ask"],"properties":{"depth":{"type":"string","enum":["standard","deep"],"default":"standard","description":"deep: hard multi-step questions, 3 units ($0.06)."},"private":{"type":"boolean","default":false,"description":"Keep the question inside Modal, the cloud Patchwell runs on (no outside model company). Same price."},"ask":{"type":"string","maxLength":4000,"description":"The question."},"context":{"type":"string","maxLength":4000,"description":"Anything the answer should take into account."},"want":{"type":"string","enum":["text","json"],"default":"text"},"retain":{"type":"boolean","description":"Keep this question for 30 days to improve answers (default: the key's setting)."},"callback_url":{"type":"string","format":"uri","description":"POST the finished result here, signed with your webhook secret (header Patchwell-Signature: t=<unix>,v1=<hex HMAC-SHA256 of t.body>)."},"wait":{"type":"number","minimum":0,"maximum":100,"description":"Seconds to hold the request for a long job (default 100). 0 returns a job id at once as 202 with Location and Retry-After. Same as the header Prefer: respond-async."},"preset":{"type":"string","description":"Apply a configuration saved with PUT /v1/presets/{name}."}},"title":"ResearchRequest"},"ResearchResult":{"type":"object","properties":{"answer":{"type":"string"},"claims":{"type":"array","items":{"type":"object"}},"sources":{"type":"array","items":{"type":"object"}},"gaps":{"type":"array","items":{"type":"string"}},"confidence":{"type":"string"},"refused":{"type":"boolean"},"billing":{"type":"object","properties":{"price":{"type":"number","description":"USD charged for this call."},"units":{"type":"number"}}},"schema_version":{"type":"string","pattern":"^1\\.\\d+$","description":"Major.minor (e.g. \"1.5\"). A minor bump only adds fields. Compare the parts as integers, not as one decimal number."}}}},"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Your key: Authorization: Bearer pw_live_... A free one with $1 of credit is one POST to /v1/credits/trial."}}},"servers":[{"url":"https://patchwell.io"}],"security":[{"bearerAuth":[]}],"webhooks":{"transcribe.completed":{"post":{"summary":"A job finished (header Patchwell-Event: <tool>.completed or <tool>.failed)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["event","delivery_id","job_id","tool","schema_version","created","result"],"properties":{"event":{"type":"string","enum":["transcribe.completed","transcribe.failed","clean_data.completed","clean_data.failed","research.completed","research.failed"]},"delivery_id":{"type":"string","description":"The same on every retry of one delivery: drop duplicates by it."},"redelivery_of":{"type":"string","description":"Only on a delivery sent again with POST /v1/webhooks/deliveries/{id}/redeliver: the delivery_id it repeats."},"job_id":{"type":["string","null"]},"tool":{"type":"string","enum":["transcribe","clean_data","research"]},"schema_version":{"type":"string","pattern":"^1\\.\\d+$","description":"Major.minor (e.g. \"1.5\"). A minor bump only adds fields. Compare the parts as integers, not as one decimal number."},"created":{"type":"integer","description":"Unix seconds."},"result":{"type":"object","description":"The result exactly as GET /v1/jobs/{id} returns it: status done, or failed / cancelled with error, code and retryable."}}}}},"description":"Headers: Patchwell-Event, Patchwell-Delivery (the same on every retry: drop duplicates by it) and Patchwell-Signature: t=<unix seconds>,v1=<hex HMAC-SHA256 of '<t>.<raw body>' with your webhook secret>. Reject a delivery whose signature doesn't match or whose t is more than 5 minutes old. Verifiers in Python, JS and n8n: /quickstart#webhooks."},"responses":{"200":{"description":"Return any 2xx to acknowledge; other answers are retried for about two hours."}}}},"transcribe.failed":{"post":{"summary":"A job finished (header Patchwell-Event: <tool>.completed or <tool>.failed)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["event","delivery_id","job_id","tool","schema_version","created","result"],"properties":{"event":{"type":"string","enum":["transcribe.completed","transcribe.failed","clean_data.completed","clean_data.failed","research.completed","research.failed"]},"delivery_id":{"type":"string","description":"The same on every retry of one delivery: drop duplicates by it."},"redelivery_of":{"type":"string","description":"Only on a delivery sent again with POST /v1/webhooks/deliveries/{id}/redeliver: the delivery_id it repeats."},"job_id":{"type":["string","null"]},"tool":{"type":"string","enum":["transcribe","clean_data","research"]},"schema_version":{"type":"string","pattern":"^1\\.\\d+$","description":"Major.minor (e.g. \"1.5\"). A minor bump only adds fields. Compare the parts as integers, not as one decimal number."},"created":{"type":"integer","description":"Unix seconds."},"result":{"type":"object","description":"The result exactly as GET /v1/jobs/{id} returns it: status done, or failed / cancelled with error, code and retryable."}}}}},"description":"Headers: Patchwell-Event, Patchwell-Delivery (the same on every retry: drop duplicates by it) and Patchwell-Signature: t=<unix seconds>,v1=<hex HMAC-SHA256 of '<t>.<raw body>' with your webhook secret>. Reject a delivery whose signature doesn't match or whose t is more than 5 minutes old. Verifiers in Python, JS and n8n: /quickstart#webhooks."},"responses":{"200":{"description":"Return any 2xx to acknowledge; other answers are retried for about two hours."}}}},"clean_data.completed":{"post":{"summary":"A job finished (header Patchwell-Event: <tool>.completed or <tool>.failed)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["event","delivery_id","job_id","tool","schema_version","created","result"],"properties":{"event":{"type":"string","enum":["transcribe.completed","transcribe.failed","clean_data.completed","clean_data.failed","research.completed","research.failed"]},"delivery_id":{"type":"string","description":"The same on every retry of one delivery: drop duplicates by it."},"redelivery_of":{"type":"string","description":"Only on a delivery sent again with POST /v1/webhooks/deliveries/{id}/redeliver: the delivery_id it repeats."},"job_id":{"type":["string","null"]},"tool":{"type":"string","enum":["transcribe","clean_data","research"]},"schema_version":{"type":"string","pattern":"^1\\.\\d+$","description":"Major.minor (e.g. \"1.5\"). A minor bump only adds fields. Compare the parts as integers, not as one decimal number."},"created":{"type":"integer","description":"Unix seconds."},"result":{"type":"object","description":"The result exactly as GET /v1/jobs/{id} returns it: status done, or failed / cancelled with error, code and retryable."}}}}},"description":"Headers: Patchwell-Event, Patchwell-Delivery (the same on every retry: drop duplicates by it) and Patchwell-Signature: t=<unix seconds>,v1=<hex HMAC-SHA256 of '<t>.<raw body>' with your webhook secret>. Reject a delivery whose signature doesn't match or whose t is more than 5 minutes old. Verifiers in Python, JS and n8n: /quickstart#webhooks."},"responses":{"200":{"description":"Return any 2xx to acknowledge; other answers are retried for about two hours."}}}},"clean_data.failed":{"post":{"summary":"A job finished (header Patchwell-Event: <tool>.completed or <tool>.failed)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["event","delivery_id","job_id","tool","schema_version","created","result"],"properties":{"event":{"type":"string","enum":["transcribe.completed","transcribe.failed","clean_data.completed","clean_data.failed","research.completed","research.failed"]},"delivery_id":{"type":"string","description":"The same on every retry of one delivery: drop duplicates by it."},"redelivery_of":{"type":"string","description":"Only on a delivery sent again with POST /v1/webhooks/deliveries/{id}/redeliver: the delivery_id it repeats."},"job_id":{"type":["string","null"]},"tool":{"type":"string","enum":["transcribe","clean_data","research"]},"schema_version":{"type":"string","pattern":"^1\\.\\d+$","description":"Major.minor (e.g. \"1.5\"). A minor bump only adds fields. Compare the parts as integers, not as one decimal number."},"created":{"type":"integer","description":"Unix seconds."},"result":{"type":"object","description":"The result exactly as GET /v1/jobs/{id} returns it: status done, or failed / cancelled with error, code and retryable."}}}}},"description":"Headers: Patchwell-Event, Patchwell-Delivery (the same on every retry: drop duplicates by it) and Patchwell-Signature: t=<unix seconds>,v1=<hex HMAC-SHA256 of '<t>.<raw body>' with your webhook secret>. Reject a delivery whose signature doesn't match or whose t is more than 5 minutes old. Verifiers in Python, JS and n8n: /quickstart#webhooks."},"responses":{"200":{"description":"Return any 2xx to acknowledge; other answers are retried for about two hours."}}}},"research.completed":{"post":{"summary":"A job finished (header Patchwell-Event: <tool>.completed or <tool>.failed)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["event","delivery_id","job_id","tool","schema_version","created","result"],"properties":{"event":{"type":"string","enum":["transcribe.completed","transcribe.failed","clean_data.completed","clean_data.failed","research.completed","research.failed"]},"delivery_id":{"type":"string","description":"The same on every retry of one delivery: drop duplicates by it."},"redelivery_of":{"type":"string","description":"Only on a delivery sent again with POST /v1/webhooks/deliveries/{id}/redeliver: the delivery_id it repeats."},"job_id":{"type":["string","null"]},"tool":{"type":"string","enum":["transcribe","clean_data","research"]},"schema_version":{"type":"string","pattern":"^1\\.\\d+$","description":"Major.minor (e.g. \"1.5\"). A minor bump only adds fields. Compare the parts as integers, not as one decimal number."},"created":{"type":"integer","description":"Unix seconds."},"result":{"type":"object","description":"The result exactly as GET /v1/jobs/{id} returns it: status done, or failed / cancelled with error, code and retryable."}}}}},"description":"Headers: Patchwell-Event, Patchwell-Delivery (the same on every retry: drop duplicates by it) and Patchwell-Signature: t=<unix seconds>,v1=<hex HMAC-SHA256 of '<t>.<raw body>' with your webhook secret>. Reject a delivery whose signature doesn't match or whose t is more than 5 minutes old. Verifiers in Python, JS and n8n: /quickstart#webhooks."},"responses":{"200":{"description":"Return any 2xx to acknowledge; other answers are retried for about two hours."}}}},"research.failed":{"post":{"summary":"A job finished (header Patchwell-Event: <tool>.completed or <tool>.failed)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["event","delivery_id","job_id","tool","schema_version","created","result"],"properties":{"event":{"type":"string","enum":["transcribe.completed","transcribe.failed","clean_data.completed","clean_data.failed","research.completed","research.failed"]},"delivery_id":{"type":"string","description":"The same on every retry of one delivery: drop duplicates by it."},"redelivery_of":{"type":"string","description":"Only on a delivery sent again with POST /v1/webhooks/deliveries/{id}/redeliver: the delivery_id it repeats."},"job_id":{"type":["string","null"]},"tool":{"type":"string","enum":["transcribe","clean_data","research"]},"schema_version":{"type":"string","pattern":"^1\\.\\d+$","description":"Major.minor (e.g. \"1.5\"). A minor bump only adds fields. Compare the parts as integers, not as one decimal number."},"created":{"type":"integer","description":"Unix seconds."},"result":{"type":"object","description":"The result exactly as GET /v1/jobs/{id} returns it: status done, or failed / cancelled with error, code and retryable."}}}}},"description":"Headers: Patchwell-Event, Patchwell-Delivery (the same on every retry: drop duplicates by it) and Patchwell-Signature: t=<unix seconds>,v1=<hex HMAC-SHA256 of '<t>.<raw body>' with your webhook secret>. Reject a delivery whose signature doesn't match or whose t is more than 5 minutes old. Verifiers in Python, JS and n8n: /quickstart#webhooks."},"responses":{"200":{"description":"Return any 2xx to acknowledge; other answers are retried for about two hours."}}}}}}