---
title: "Get and lock default request queue head"
method: POST
path: "/v2/actor-runs/{runId}/request-queue/head/lock"
tags: ["Default request queue"]
---

# Get and lock default request queue head

`POST /v2/actor-runs/{runId}/request-queue/head/lock`

Returns the given number of first requests from the default request queue of the Actor run
and locks them for the given time.

This endpoint is a shortcut for getting the run's `defaultRequestQueueId` and then using the
[Get head and lock](/api/v2/request-queue-head-lock-post) endpoint.

## Path parameters

- `runId` string, required

## Query parameters

- `lockSecs` number, double, required
- `limit` number, double
- `clientKey` string

## Response `201`

- HeadAndLockResponse — Response containing locked requests from the request queue head.
  - `data` LockedRequestQueueHead, required — A batch of locked requests from the request queue head.
    - `limit` integer, required — The maximum number of requests returned.
    - `queueModifiedAt` string, date-time, required — The timestamp when the request queue was last modified. Modifications include adding, updating, or removing requests, as well as locking or unlocking requests in the request queue.
    - `queueHasLockedRequests` boolean — Whether the request queue contains requests locked by any client (either the one calling the endpoint or a different one).
    - `clientKey` string — The client key used for locking the requests.
    - `hadMultipleClients` boolean, required — Whether the request queue has been accessed by multiple different clients.
    - `lockSecs` integer, required — The number of seconds the locks will be held.
    - `items` LockedHeadRequest[], required — The array of locked requests from the request queue head.
      - `id` 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.
      - `url` string, required — 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.
      - `lockExpiresAt` string, date-time, required — The timestamp when the lock on this request expires.

## 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.
- `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)
