---
title: "Add requests"
method: POST
path: "/v2/request-queues/{queueId}/requests/batch"
tags: ["Storage/Request queues"]
---

# Add requests

`POST /v2/request-queues/{queueId}/requests/batch`

Adds requests to the queue in batch. The maximum requests in batch is limited
to 25. The response contains an array of unprocessed and processed requests.
If any add operation fails because the request queue rate limit is exceeded
or an internal failure occurs,
the failed request is returned in the unprocessedRequests response
parameter.
You can resend these requests to add. It is recommended to use an
exponential backoff algorithm for these retries.
If a request with the same `uniqueKey` was already present in the queue,
then it returns an ID of the existing request.

## Path parameters

- `queueId` string, required

## Query parameters

- `clientKey` string
- `forefront` string

## Request body

- RequestBase[]
  - `uniqueKey` string — A unique key used for request de-duplication. Requests with the same unique key are considered identical.
  - `url` string — The URL of the request.
  - `method` 'GET' | 'HEAD' | 'POST' | 'PUT' | 'DELETE' | 'CONNECT' | 'OPTIONS' | 'TRACE' | 'PATCH'
  - `retryCount` integer — The number of times this request has been retried.
  - `loadedUrl` string, nullable — The final URL that was loaded, after redirects (if any).
  - `payload` union — The request payload, typically used with POST or PUT requests.
    - string
    - object
  - `headers` object, nullable — HTTP headers sent with the request.
  - `userData` RequestUserData — Custom user data attached to the request. Can contain arbitrary fields.
  - `noRetry` boolean, nullable — Indicates whether the request should not be retried if processing fails.
  - `errorMessages` string[], nullable — Error messages recorded from failed processing attempts.
  - `handledAt` string, date-time, nullable — The timestamp when the request was marked as handled, if applicable.

## Response `201`

- BatchAddResponse — Response containing the result of a batch add operation.
  - `data` BatchAddResult, required — Result of a batch add operation containing successfully processed and failed requests.
    - `processedRequests` AddedRequest[], required — Requests that were successfully added to the request queue.
      - `requestId` string, required — A unique identifier assigned to the request.
      - `uniqueKey` string, required — A unique key used for request de-duplication. Requests with the same unique key are considered identical.
      - `wasAlreadyPresent` boolean, required — Indicates whether a request with the same unique key already existed in the request queue. If true, no new request was created.
      - `wasAlreadyHandled` boolean, required — Indicates whether a request with the same unique key has already been processed by the request queue.
    - `unprocessedRequests` RequestDraft[], required — Requests that failed to be added and can be retried.
      - `id` string — A unique identifier assigned to the request.
      - `uniqueKey` string, required — A unique key used for request de-duplication. Requests with the same unique key are considered identical.
      - `url` string, required — The URL of the request.
      - `method` 'GET' | 'HEAD' | 'POST' | 'PUT' | 'DELETE' | 'CONNECT' | 'OPTIONS' | 'TRACE' | 'PATCH'

## Other responses

- `400` — Bad request - invalid input parameters or request body.
- `401` — Unauthorized - authentication required or invalid token.
- `403` — Forbidden - insufficient permissions to perform this action.
- `404` — Not found - the requested resource does not exist.
- `405` — Method not allowed.
- `413` — Payload too large - the request body exceeds the size limit.
- `415` — Unsupported media type - the Content-Encoding of the request is not supported.
- `429` — Too many requests - rate limit exceeded.

---

[API](https://skmtc.net/apify/apis/apify-api.md) · [All operations](https://skmtc.net/apify/apis/apify-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/apify/apify-api/versions/01a71794279b/schema)
