{"openapi":"3.1.0","info":{"title":"TubeExtract API","version":"1.0.0","summary":"Structured extraction and NER from YouTube videos.","description":"Describe the fields you want as a schema, send 1–200 video URLs in one POST, and collect typed rows extracted from each video's caption track. Authenticate with an API key in the X-API-Key header (Authorization: Bearer also works). An AI agent can get a key with its user's confirmation, without anyone copying one: the steps and endpoints are at https://tubeextract.dev/auth.md and are not part of this document. Guides and examples: https://tubeextract.dev/docs","contact":{"name":"TubeExtract support","email":"support@tubeextract.dev","url":"https://tubeextract.dev/docs"},"termsOfService":"https://tubeextract.dev/terms"},"externalDocs":{"description":"Documentation","url":"https://tubeextract.dev/docs"},"servers":[{"url":"https://api.tubeextract.dev"}],"security":[{"apiKeyHeader":[]},{"bearerAuth":[]}],"tags":[{"name":"Jobs","description":"Submit videos and collect rows."},{"name":"Schemas","description":"Saved, versioned schemas."},{"name":"Webhooks","description":"Endpoints told when a job settles."},{"name":"Keys","description":"API keys for this workspace."},{"name":"Account","description":"Credits and usage."}],"paths":{"/v1":{"post":{"operationId":"createJob","tags":["Jobs"],"summary":"Submit a job","description":"Queues 1–200 videos against one schema and answers 202 with a job id. Credits are 10 per started minute of video, charged before extraction; a failed video is never charged.","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string"},"description":"Replays the first successful response instead of queueing the work twice. Reusing a key with a different body is a 409."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateJobRequest"}}}},"responses":{"202":{"description":"Accepted and queued. Collect the rows with getJob.","headers":{"Idempotent-Replay":{"description":"`true` when this response is a replay of an earlier one with the same Idempotency-Key.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobCreated"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/InsufficientCredits"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"get":{"operationId":"listJobs","tags":["Jobs"],"summary":"List jobs","description":"Newest first. The list never carries rows or per-video entries: each job reports `video_count` instead of `videos`.","parameters":[{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["succeeded","running","failed"]}},{"name":"search","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":120}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0}}],"responses":{"200":{"description":"A page of jobs.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobList"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/v1/{jobId}":{"get":{"operationId":"getJob","tags":["Jobs"],"summary":"Get a job and collect its rows","description":"`videos` has one entry per submitted video. `results` is a deprecated alias of it, in the form the first release returned (no `url`; `rows` as `{ results: [...] }` for a multiple schema) and null until the job settles; new code reads `videos`. Rows are withheld (`rows: null`) while any video is queued or processing, so polling is free and destroys nothing. The first read that finds the job settled returns the rows AND DELETES THEM, together with each video's submitted `url`; every later read returns `status: \"done\"` with `rows: null` and `url: null`.","parameters":[{"name":"jobId","in":"path","required":true,"schema":{"type":"string"},"description":"The id returned by createJob."}],"responses":{"200":{"description":"The job.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/v1/usage":{"get":{"operationId":"getUsage","tags":["Account"],"summary":"Credits, plan and usage for this billing cycle","responses":{"200":{"description":"Usage.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Usage"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/v1/schemas":{"get":{"operationId":"listSchemas","tags":["Schemas"],"summary":"List saved schemas","responses":{"200":{"description":"Saved schemas at their latest version.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SchemaList"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"operationId":"createSchema","tags":["Schemas"],"summary":"Save a schema","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSchemaRequest"}}}},"responses":{"201":{"description":"Saved as version 1.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SchemaCreated"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/v1/schemas/{id}":{"get":{"operationId":"getSchema","tags":["Schemas"],"summary":"Get a saved schema with every version","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The schema id."}],"responses":{"200":{"description":"The schema.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SchemaDetail"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/v1/schemas/{id}/versions":{"post":{"operationId":"publishSchemaVersion","tags":["Schemas"],"summary":"Publish a new version of a saved schema","description":"Versions are never edited in place, so a finished job never starts describing work it did not do.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The schema id."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublishSchemaVersionRequest"}}}},"responses":{"201":{"description":"The new version.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SchemaVersionCreated"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/v1/webhooks":{"get":{"operationId":"listWebhooks","tags":["Webhooks"],"summary":"List webhook endpoints","responses":{"200":{"description":"Endpoints.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookList"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"operationId":"createWebhook","tags":["Webhooks"],"summary":"Add a webhook endpoint","description":"Paid plans only. The response carries the signing secret, which the dashboard also shows.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWebhookRequest"}}}},"responses":{"201":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookCreated"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/v1/webhooks/{id}":{"delete":{"operationId":"deleteWebhook","tags":["Webhooks"],"summary":"Remove a webhook endpoint","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The endpoint id."}],"responses":{"204":{"description":"Removed."},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/v1/keys":{"get":{"operationId":"listKeys","tags":["Keys"],"summary":"List API keys","responses":{"200":{"description":"Keys, masked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KeyList"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"operationId":"createKey","tags":["Keys"],"summary":"Create an API key","description":"The only response that ever contains the full key.","requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateKeyRequest"}}}},"responses":{"201":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KeyCreated"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/v1/keys/{id}":{"delete":{"operationId":"revokeKey","tags":["Keys"],"summary":"Revoke an API key","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The key id."}],"responses":{"204":{"description":"Revoked."},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}}},"webhooks":{"jobSettled":{"post":{"operationId":"jobEvent","summary":"A job event delivered to your endpoint","description":"One of `job.completed`, `job.failed`, `batch.completed`. The event carries the job id, never the rows: collect them with getJob. Signed; see https://tubeextract.dev/docs/reference/webhooks for verification.","requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"responses":{"200":{"description":"Any 2xx acknowledges the delivery; anything else is retried."}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Also accepted: `Authorization: Bearer tbx_live_...`"},"apiKeyHeader":{"type":"apiKey","in":"header","name":"x-api-key","description":"`X-API-Key: tbx_live_...`"}},"schemas":{"UserSchema":{"anyOf":[{"type":"object","properties":{"columns":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-zA-Z][a-zA-Z0-9_]*$"},"description":{"type":"string","minLength":1,"maxLength":400},"type":{"type":"string","enum":["verbatim-string","string","number","integer","boolean","date","enum","exact","text","choice","verbatim-string[]","string[]","number[]","integer[]","boolean[]","date[]","exact[]","text[]"]},"options":{"type":"array","items":{"type":"string","minLength":1,"maxLength":80},"maxItems":20},"multiple":{"type":"boolean"}},"required":["name"],"additionalProperties":true},"minItems":1,"maxItems":12},"multiple":{"type":"boolean"},"max_rows":{"type":"integer","minimum":1,"maximum":500}},"required":["columns"],"additionalProperties":true},{"type":"object","properties":{"template":{"type":"object","additionalProperties":{}},"descriptions":{"type":"object","additionalProperties":{"type":"string","maxLength":400},"default":{}},"max_rows":{"type":"integer","minimum":1,"maximum":500}},"required":["template"],"additionalProperties":true},{"type":"array","minItems":1,"maxItems":12,"items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-zA-Z][a-zA-Z0-9_]*$"},"description":{"type":"string","minLength":1,"maxLength":400},"type":{"type":"string","enum":["verbatim-string","string","number","integer","boolean","date","enum","exact","text","choice","verbatim-string[]","string[]","number[]","integer[]","boolean[]","date[]","exact[]","text[]"]},"options":{"type":"array","items":{"type":"string","minLength":1,"maxLength":80},"maxItems":20},"multiple":{"type":"boolean"}},"required":["name"],"additionalProperties":true},"description":"Only on createJob: the columns alone, with `multiple` and `max_rows` beside `schema` in the request body."}],"description":"What to extract. Either a column list or a typed JSON template plus a description per field; both are stored as the column form. A column's `description` is optional (the name is used when it is left out). `type` may end in `[]`, e.g. `string[]`, for a column that holds a list of values. Column rules the API checks: names are unique; the first column names each row, so it cannot be `multiple`; an `enum` column needs at least two `options` and cannot be `multiple`; `options` only apply to `enum`; `max_rows` only applies when `multiple` is true (or the template is a list). A column's type is part of what the model reads."},"CreateJobRequest":{"type":"object","properties":{"videos":{"type":"array","items":{"type":"string","minLength":1},"minItems":1,"maxItems":200,"description":"1–200 YouTube URLs or video ids. Always a list, including for one video."},"webhook_url":{"type":"string","format":"uri","pattern":"^https://","description":"An https:// URL told when the job settles. Paid plans only."},"schema_id":{"type":"string","minLength":1,"description":"A saved schema's id. Send this or `schema`, not both."},"schema_version":{"type":"integer","exclusiveMinimum":0,"description":"Which version of the saved schema to run; the latest when omitted."},"schema":{"$ref":"#/components/schemas/UserSchema","description":"An inline schema: an array of columns (with `multiple` beside it), or the object form `{ columns, multiple, max_rows }`. Send this or `schema_id`, not both."},"multiple":{"type":"boolean","description":"With `schema` as an array of columns: true returns a list of rows, one for every mention the video makes, in the order they come up (the same entity can appear on several rows; deduplicate as your analysis needs); false returns one object per video."},"max_rows":{"type":"integer","minimum":1,"maximum":500,"description":"With `multiple`: keep at most this many rows per video."}},"required":["videos"],"additionalProperties":true,"oneOf":[{"required":["schema"]},{"required":["schema_id"]}]},"CreateSchemaRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-z0-9][a-z0-9-]*$"},"description":{"anyOf":[{"type":"string","maxLength":280},{"type":"null"}]},"schema":{"$ref":"#/components/schemas/UserSchema","description":"An inline schema: an array of columns (with `multiple` beside it), or the object form `{ columns, multiple, max_rows }`. Send this or `schema_id`, not both."}},"required":["name","schema"],"additionalProperties":true},"PublishSchemaVersionRequest":{"type":"object","properties":{"description":{"anyOf":[{"type":"string","maxLength":280},{"type":"null"}]},"schema":{"$ref":"#/components/schemas/UserSchema","description":"An inline schema: an array of columns (with `multiple` beside it), or the object form `{ columns, multiple, max_rows }`. Send this or `schema_id`, not both."}},"additionalProperties":true,"required":["schema"]},"CreateWebhookRequest":{"type":"object","properties":{"url":{"type":"string","format":"uri","pattern":"^https://"},"events":{"type":"array","items":{"type":"string","enum":["job.completed","job.failed","batch.completed"]},"minItems":1}},"required":["url"],"additionalProperties":true},"CreateKeyRequest":{"type":"object","properties":{"label":{"anyOf":[{"type":"string","minLength":1,"maxLength":100},{"type":"null"}]},"note":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"environment":{"type":"string","enum":["live","test"]}},"additionalProperties":true},"Job":{"type":"object","properties":{"job_id":{"type":"string"},"status":{"type":"string","enum":["queued","processing","done","failed","partial"]},"schema":{"type":["string","null"]},"credits_charged":{"type":"integer"},"counts":{"type":"object","properties":{"queued":{"type":"integer"},"processing":{"type":"integer"},"done":{"type":"integer"},"failed":{"type":"integer"}},"required":["queued","processing","done","failed"],"additionalProperties":false},"created_at":{"type":"string"},"completed_at":{"type":["string","null"]},"videos":{"type":"array","items":{"type":"object","properties":{"url":{"type":["string","null"]},"video_id":{"type":["string","null"]},"status":{"type":"string","enum":["queued","processing","done","failed"]},"rows":{"anyOf":[{"anyOf":[{"type":"array","items":{"type":"object","additionalProperties":{}}},{"type":"object","additionalProperties":{}}]},{"type":"null"}]},"usage":{"type":"object","properties":{"credits_charged":{"type":"integer"},"row_count":{"anyOf":[{"type":"integer"},{"type":"null"}]},"document_chars":{"anyOf":[{"type":"integer"},{"type":"null"}]},"chunk_count":{"anyOf":[{"type":"integer"},{"type":"null"}]},"duration_seconds":{"type":["number","null"]}},"required":["credits_charged","row_count","document_chars","chunk_count","duration_seconds"],"additionalProperties":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["no_captions","video_unavailable","schema_invalid","captions_fetch_failed","internal_error","insufficient_credits"]},"message":{"type":"string"},"retryable":{"type":"boolean"}},"required":["code","message","retryable"],"additionalProperties":false},"credits_charged":{"type":"integer"}},"required":["url","video_id","status"],"additionalProperties":false}},"results":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"video_id":{"type":["string","null"]},"status":{"type":"string","enum":["queued","processing","done","failed"]},"rows":{"anyOf":[{"type":"object","additionalProperties":{}},{"type":"null"}]},"usage":{"type":"object","properties":{"credits_charged":{"type":"integer"},"row_count":{"anyOf":[{"type":"integer"},{"type":"null"}]},"document_chars":{"anyOf":[{"type":"integer"},{"type":"null"}]},"chunk_count":{"anyOf":[{"type":"integer"},{"type":"null"}]},"duration_seconds":{"type":["number","null"]}},"required":["credits_charged","row_count","document_chars","chunk_count","duration_seconds"],"additionalProperties":false},"error":{"type":"object","properties":{"code":{"type":"string","enum":["no_captions","video_unavailable","schema_invalid","captions_fetch_failed","internal_error","insufficient_credits"]},"message":{"type":"string"},"retryable":{"type":"boolean"}},"required":["code","message","retryable"],"additionalProperties":false},"credits_charged":{"type":"integer"}},"required":["video_id","status"],"additionalProperties":false}},{"type":"null"}]}},"required":["job_id","status","schema","credits_charged","counts","created_at","completed_at","videos","results"],"additionalProperties":false},"JobList":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"job_id":{"type":"string"},"status":{"type":"string","enum":["queued","processing","done","failed","partial"]},"schema":{"type":["string","null"]},"credits_charged":{"type":"integer"},"counts":{"type":"object","properties":{"queued":{"type":"integer"},"processing":{"type":"integer"},"done":{"type":"integer"},"failed":{"type":"integer"}},"required":["queued","processing","done","failed"],"additionalProperties":false},"created_at":{"type":"string"},"completed_at":{"type":["string","null"]},"video_count":{"type":"integer"}},"required":["job_id","status","schema","credits_charged","counts","created_at","completed_at","video_count"],"additionalProperties":false}},"pagination":{"type":"object","properties":{"total":{"type":"integer"},"limit":{"type":"integer"},"offset":{"type":"integer"},"has_more":{"type":"boolean"}},"required":["total","limit","offset","has_more"],"additionalProperties":false}},"required":["data","pagination"],"additionalProperties":false},"JobCreated":{"type":"object","properties":{"job_id":{"type":"string"},"status":{"type":"string","const":"queued"},"videos":{"type":"integer"},"items":{"type":"array","items":{"type":"object","properties":{"url":{"type":["string","null"]},"video_id":{"type":["string","null"]},"status":{"type":"string","const":"queued"}},"required":["url","video_id","status"],"additionalProperties":false}}},"required":["job_id","status","videos","items"],"additionalProperties":false},"Usage":{"type":"object","properties":{"credits":{"type":"object","properties":{"balance":{"type":"integer"},"used_this_cycle":{"type":"integer"},"cycle_allowance":{"type":"integer"},"hard_cap":{"anyOf":[{"type":"integer"},{"type":"null"}]}},"required":["balance","used_this_cycle","cycle_allowance","hard_cap"],"additionalProperties":false},"cycle":{"type":"object","properties":{"started_at":{"type":"string"},"ends_at":{"type":["string","null"]}},"required":["started_at","ends_at"],"additionalProperties":false},"plan":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"requests_per_minute":{"type":"integer"}},"required":["id","name","requests_per_minute"],"additionalProperties":false},"jobs":{"type":"object","properties":{"queued":{"type":"integer"},"processing":{"type":"integer"},"done":{"type":"integer"},"failed":{"type":"integer"},"total":{"type":"integer"}},"required":["queued","processing","done","failed","total"],"additionalProperties":false},"videos_processed":{"type":"integer"},"failures_by_code":{"type":"object","additionalProperties":{"type":"integer"}},"daily":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"credits":{"type":"integer"}},"required":["date","credits"],"additionalProperties":false}}},"required":["credits","cycle","plan","jobs","videos_processed","failures_by_code","daily"],"additionalProperties":false},"SchemaList":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"version":{"type":"integer"},"label":{"type":"string"},"schema":{"type":"object","additionalProperties":{}},"created_at":{"type":"string"}},"required":["id","name","description","version","label","schema","created_at"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false},"SchemaCreated":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"version":{"type":"integer"}},"required":["id","name","version"],"additionalProperties":false},"SchemaDetail":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"latest_version":{"type":"integer"},"versions":{"type":"array","items":{"type":"object","properties":{"version":{"type":"integer"},"schema":{"type":"object","additionalProperties":{}},"created_at":{"type":"string"}},"required":["version","schema","created_at"],"additionalProperties":false}}},"required":["id","name","description","latest_version","versions"],"additionalProperties":false},"SchemaVersionCreated":{"type":"object","properties":{"id":{"type":"string"},"version":{"type":"integer"}},"required":["id","version"],"additionalProperties":false},"WebhookList":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"events":{"type":"array","items":{"type":"string","enum":["job.completed","job.failed","batch.completed"]}},"disabled":{"type":"boolean"},"created_at":{"type":"string"}},"required":["id","url","events","disabled","created_at"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false},"WebhookCreated":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"secret":{"type":"string"}},"required":["id","url","secret"],"additionalProperties":false},"KeyList":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":["string","null"]},"masked_key":{"type":"string"},"environment":{"type":"string","enum":["live","test"]},"last_used_at":{"type":["string","null"]},"revoked_at":{"type":["string","null"]},"created_at":{"type":"string"}},"required":["id","label","masked_key","environment","last_used_at","revoked_at","created_at"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false},"KeyCreated":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string"},"label":{"type":["string","null"]}},"required":["id","key","label"],"additionalProperties":false},"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","not_found","invalid_request","schema_invalid","schema_not_found","insufficient_credits","batch_too_large","idempotency_conflict","plan_limit","rate_limited","email_unverified","internal_error"]},"message":{"type":"string"},"details":{}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}},"responses":{"BadRequest":{"description":"`invalid_request`, `schema_invalid` or `batch_too_large`. `details` carries the field errors.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Unauthorized":{"description":"`unauthorized`: the key is missing, unknown or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"InsufficientCredits":{"description":"`insufficient_credits`: out of credits, or the hard cap is reached.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Forbidden":{"description":"`forbidden`, `plan_limit` or `email_unverified`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"NotFound":{"description":"`not_found` or `schema_not_found`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Conflict":{"description":"`idempotency_conflict`: the Idempotency-Key was used with a different body.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"RateLimited":{"description":"`rate_limited`: over the plan's requests per minute.","headers":{"Retry-After":{"description":"Seconds to wait.","schema":{"type":"integer"}},"X-RateLimit-Limit":{"schema":{"type":"integer"}},"X-RateLimit-Remaining":{"schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"InternalError":{"description":"`internal_error`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}