---
title: "Run up to 20 endpoint calls in one request"
method: POST
path: "/v1/batch"
tags: ["Batch"]
---

# Run up to 20 endpoint calls in one request

`POST /v1/batch`

## Request

- Base URL: `https://api.captapi.com`
- URL: `https://api.captapi.com/v1/batch`
- Auth: one of:
  - HTTP bearer
  - API key in header `X-API-Key`

Runs up to 20 Captapi GET calls in one request, 10 at a time, through the same auth, credit, cache and rate-limit pipeline as direct calls. Each item is billed exactly like the direct call and failed items are not billed. Results keep input order; each one carries the item's HTTP status and its full response body. A failed item's body uses the standard error envelope {success: false, error: {code, message, retryable}}, including BATCH_ITEM_TIMEOUT and BATCH_ITEM_FAILED when the item could not finish. An unknown path fails the whole batch with 400 before anything runs.

## Request body

- BatchRequest
  - `requests` BatchItem[], required
    - `path` string, required: Captapi GET path, e.g. /v1/youtube/video-details
    - `params` object

## Response `200`

Success.

- object
  - `success` unknown, required
  - `data` object, required
    - `total` integer
    - `succeeded` integer
    - `failed` integer
    - `results` object[]
      - `path` string
      - `params` object
        - `url` string
      - `status` integer
      - `body` object
        - `success` boolean
        - `data` object
          - `platform` string
          - `username` string
        - `error` object
          - `code` string
          - `message` string
          - `retryable` boolean

## Other responses

- `400`: Bad request: wrong platform URL, unknown endpoint, or an invalid parameter value. Not billed.
- `401`: Missing, invalid or revoked API key. Not billed.
- `404`: The resource does not exist or is not public. Not billed.
- `422`: A required parameter is missing or has the wrong type. Not billed.
- `429`: Rate limit reached. Wait for Retry-After seconds. Not billed.

---

[API](https://skmtc.dev/captapi/apis/captapi-api.md) · [All operations](https://skmtc.dev/captapi/apis/captapi-api/llms.txt) · [OpenAPI document](https://skmtc.dev/captapi/apis/captapi-api/revisions/c9b9ac5ff1bd?raw)
