Submit batch job
submitBatch(params, options?): BatchSubmitResponse
Submit a batch of up to 100 video tasks (transcripts or basic metadata) for asynchronous execution. Tasks are queued and executed concurrently across a background worker pool (default 10, maximum 20 concurrent workers). The call returns immediately with 202 Accepted containing a unique id. Poll GET /v1/batch/{id} to retrieve task results once processing finishes.
Security
API Key
All requests require a valid API key from the developer dashboard.
Headers: Authorization: Bearer YOUR_API_KEYorX-API-Key: YOUR_API_KEY
See Authentication for headers and rate limits.
Headers
| Parameter | Type | Required | Description |
|---|---|---|---|
Idempotency-Keyheader | string | No | Makes the submit safe to retry. Send any unique string of 1 to 255 printable ASCII characters, such as a UUID. Reuse it when you retry the same request after a timeout or network error. For 24 hours, the same key with the same body returns the original job ( |
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
tasksbody | BatchTask[] | Yes | Array of up to 100 task objects to execute in the batch job. |
↳ id | string | No | Caller-defined task identifier echoed in the result. |
↳ type | string | Yes | Task type: |
↳ video_id | string | Yes | 11-character YouTube video ID. |
↳ format | string | No | Transcript format when |
concurrencybody | number | No | Number of concurrent workers executing tasks in the batch (default 10, maximum 20). |
Response (HTTP 202)
{
"id": string, // Unique batch job identifier (e.g. "batch_1789995131572858354_84b12de0")
"status": string, // Initial job status ("pending")
"total": number, // Total number of submitted tasks
"estimated_credits": number, // Maximum estimated credits reserved for this batch (1 credit / task)
"created_at": string // ISO 8601 creation timestamp
}| Response header | When |
|---|---|
Idempotent-Replayed: true | The request repeated an Idempotency-Key from the last 24 hours with the same body. The response describes the job created by the first request; no new job was started and no credits were reserved. |
Fair credit accounting & upfront reservation
Your account balance is checked against estimated_credits upon submission (1 credit reserved per task). In batch execution, every successfully completed task consumes 1 credit (both for transcript and basic_info). Please note: while individual single GET /v1/videos/{id}/basic-info calls are free, batch processing of basic_info is billed at 1 credit per successful task due to high-concurrency server cluster capacity. Unused reserved credits are released immediately when the job finishes. Failed tasks cost 0 credits.