# Create request queue


```
POST 
https://api.apify.com/v2/request-queues
```


Creates a request queue and returns its object. Keep in mind that requests stored under unnamed queue follows [data retention period](https://docs.apify.com/platform/storage#data-retention).

It creates a queue of given name if the parameter name is used. If a queue with the given name already exists then the endpoint returns its object.

## Request

### Query Parameters

* **name** string

  Custom unique name to easily identify the queue in the future.

  **Example:** `example-com`

<!-- -->

### Status 201

**Response Headers**

* **Location**


```
{
  "data": {
    "id": "WkzbQMuFYuamGv3YF",
    "name": "some-name",
    "userId": "wRsJZtadYvn4mBZmm",
    "createdAt": "2019-12-12T07:34:14.202Z",
    "modifiedAt": "2030-12-13T08:36:13.202Z",
    "accessedAt": "2019-12-14T08:36:13.202Z",
    "totalRequestCount": 870,
    "handledRequestCount": 100,
    "pendingRequestCount": 670,
    "hadMultipleClients": true,
    "consoleUrl": "https://api.apify.com/v2/request-queues/27TmTznX9YPeAYhkC",
    "stats": {
      "deleteCount": 0,
      "headItemReadCount": 5,
      "readCount": 100,
      "storageBytes": 1024,
      "writeCount": 10
    },
    "generalAccess": "RESTRICTED"
  }
}
```


**Schema**

* **data** object required

  A request queue object containing metadata and statistics.

  * **id** string required

    A unique identifier assigned to the request queue.

    **Example:** `WkzbQMuFYuamGv3YF`

  * **name** string

    The name of the request queue.

    **Example:** `some-name`

  * **userId** string required

    The ID of the user who owns the request queue.

    **Example:** `wRsJZtadYvn4mBZmm`

  * **createdAt** string\<date-time> required

    The timestamp when the request queue was created.

    **Example:** `2019-12-12T07:34:14.202Z`

  * **modifiedAt** 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.

    **Example:** `2030-12-13T08:36:13.202Z`

  * **accessedAt** string\<date-time> required

    The timestamp when the request queue was last accessed.

    **Example:** `2019-12-14T08:36:13.202Z`

  * **totalRequestCount** integer required

    The total number of requests in the request queue.

    **Possible values:** `>= 0`

    **Example:** `870`

  * **handledRequestCount** integer required

    The number of requests that have been handled.

    **Possible values:** `>= 0`

    **Example:** `100`

  * **pendingRequestCount** integer required

    The number of requests that are pending and have not been handled yet.

    **Possible values:** `>= 0`

    **Example:** `670`

  * **hadMultipleClients** boolean required

    Whether the request queue has been accessed by multiple different clients.

    **Example:** `true`

  * **consoleUrl** string\<uri> required

    The URL to view the request queue in the Apify console.

    **Example:** `https://api.apify.com/v2/request-queues/27TmTznX9YPeAYhkC`

  * **stats** object

    Statistics about request queue operations and storage.

    * **deleteCount** integer

      The number of delete operations performed on the request queue.

      **Example:** `0`

    * **headItemReadCount** integer

      The number of times requests from the head were read.

      **Example:** `5`

    * **readCount** integer

      The total number of read operations performed on the request queue.

      **Example:** `100`

    * **storageBytes** integer

      The total storage size in bytes used by the request queue.

      **Example:** `1024`

    * **writeCount** integer

      The total number of write operations performed on the request queue.

      **Example:** `10`

  * **generalAccess** GeneralAccess (string)

    Defines the general access level for the resource.

    **Possible values:** \[`ANYONE_WITH_ID_CAN_READ`, `ANYONE_WITH_NAME_CAN_READ`, `FOLLOW_USER_SETTING`, `RESTRICTED`]

    **Example:** `RESTRICTED`

### Status 400

Bad request - invalid input parameters or request body.


```
{
  "error": {
    "type": "invalid-input",
    "message": "Invalid input: The request body contains invalid data."
  }
}
```


**Schema**

* **error** object required

  * **type** string required\
    **Example:** `run-failed`
  * **message** string required\
    **Example:** `Actor run did not succeed (run ID: 55uatRrZib4xbZs, status: FAILED)`

### Status 401

Unauthorized - authentication required or invalid token.


```
{
  "error": {
    "type": "token-not-valid",
    "message": "Authentication token is not valid."
  }
}
```


**Schema**

* **error** object required

  * **type** string required\
    **Example:** `run-failed`
  * **message** string required\
    **Example:** `Actor run did not succeed (run ID: 55uatRrZib4xbZs, status: FAILED)`

### Status 403

Forbidden - insufficient permissions to perform this action.


```
{
  "error": {
    "type": "permission-denied",
    "message": "You do not have permission to perform this action."
  }
}
```


**Schema**

* **error** object required

  * **type** string required\
    **Example:** `run-failed`
  * **message** string required\
    **Example:** `Actor run did not succeed (run ID: 55uatRrZib4xbZs, status: FAILED)`

### Status 405

Method not allowed.


```
{
  "error": {
    "type": "method-not-allowed",
    "message": "This API end-point can only be accessed using the following HTTP methods: OPTIONS,GET"
  }
}
```


**Schema**

* **error** object required

  * **type** string required\
    **Example:** `run-failed`
  * **message** string required\
    **Example:** `Actor run did not succeed (run ID: 55uatRrZib4xbZs, status: FAILED)`

### Status 429

Too many requests - rate limit exceeded.


```
{
  "error": {
    "type": "rate-limit-exceeded",
    "message": "You have exceeded the rate limit. Please try again later."
  }
}
```


**Schema**

* **error** object required

  * **type** string required\
    **Example:** `run-failed`
  * **message** string required\
    **Example:** `Actor run did not succeed (run ID: 55uatRrZib4xbZs, status: FAILED)`
