- [HTTP request](https://docs.cloud.google.com/tasks/docs/reference/rest/v2/projects.locations.queues/create#body.HTTP_TEMPLATE)
- [Path parameters](https://docs.cloud.google.com/tasks/docs/reference/rest/v2/projects.locations.queues/create#body.PATH_PARAMETERS)
- [Request body](https://docs.cloud.google.com/tasks/docs/reference/rest/v2/projects.locations.queues/create#body.request_body)
- [Response body](https://docs.cloud.google.com/tasks/docs/reference/rest/v2/projects.locations.queues/create#body.response_body)
- [Authorization scopes](https://docs.cloud.google.com/tasks/docs/reference/rest/v2/projects.locations.queues/create#body.aspect)
- [Try it!](https://docs.cloud.google.com/tasks/docs/reference/rest/v2/projects.locations.queues/create#try-it)

Creates a queue.

Queues created with this method allow tasks to live for a maximum of 31 days. After a task is 31 days old, the task will be deleted regardless of whether it was dispatched or not.

WARNING: Using this method may have unintended side effects if you are using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. Read [Overview of Queue Management and queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using this method.

### HTTP request

`POST https://cloudtasks.googleapis.com/v2/{parent=projects/*/locations/*}/queues`

The URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.

### Path parameters

| Parameters ||
|---|---|
| `parent` | `string` Required. The location name in which the queue will be created. For example: `projects/PROJECT_ID/locations/LOCATION_ID` The list of allowed locations can be obtained by calling Cloud Tasks' implementation of `locations.list`. Authorization requires the following [IAM](https://cloud.google.com/iam/docs/) permission on the specified resource `parent`: - `cloudtasks.queues.create` |

### Request body

The request body contains an instance of `https://docs.cloud.google.com/tasks/docs/reference/rest/v2/projects.locations.queues#Queue`.

### Response body

If successful, the response body contains a newly created instance of `https://docs.cloud.google.com/tasks/docs/reference/rest/v2/projects.locations.queues#Queue`.

### Authorization scopes

Requires one of the following OAuth scopes:

- `https://www.googleapis.com/auth/cloud-platform`
- `https://www.googleapis.com/auth/cloud-tasks`

For more information, see the [Authentication Overview](https://docs.cloud.google.com/docs/authentication#authorization-gcp).