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

Lists the tasks in a queue.

By default, only the `https://docs.cloud.google.com/tasks/docs/reference/rest/v2/projects.locations.queues.tasks#View.ENUM_VALUES.BASIC` view is retrieved due to performance considerations; `https://docs.cloud.google.com/tasks/docs/reference/rest/v2/projects.locations.queues.tasks/list#body.QUERY_PARAMETERS.response_view` controls the subset of information which is returned.

The tasks may be returned in any order. The ordering may change at any time.

### HTTP request

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

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

### Path parameters

| Parameters ||
|---|---|
| `parent` | `string` Required. The queue name. For example: `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` Authorization requires the following [IAM](https://cloud.google.com/iam/docs/) permission on the specified resource `parent`: - `cloudtasks.tasks.list` |

### Query parameters

| Parameters ||
|---|---|
| `responseView` | ``enum (`https://docs.cloud.google.com/tasks/docs/reference/rest/v2/projects.locations.queues.tasks#View`)`` The responseView specifies which subset of the `https://docs.cloud.google.com/tasks/docs/reference/rest/v2/projects.locations.queues.tasks#Task` will be returned. By default responseView is `https://docs.cloud.google.com/tasks/docs/reference/rest/v2/projects.locations.queues.tasks#View.ENUM_VALUES.BASIC`; not all information is retrieved by default because some data, such as payloads, might be desirable to return only when needed because of its large size or because of the sensitivity of data that it contains. Authorization for `https://docs.cloud.google.com/tasks/docs/reference/rest/v2/projects.locations.queues.tasks#View.ENUM_VALUES.FULL` requires `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) permission on the `https://docs.cloud.google.com/tasks/docs/reference/rest/v2/projects.locations.queues.tasks#Task` resource. |
| `pageSize` | `integer` Maximum page size. Fewer tasks than requested might be returned, even if more tasks exist; use `https://docs.cloud.google.com/tasks/docs/reference/rest/v2/projects.locations.queues.tasks/list#body.ListTasksResponse.FIELDS.next_page_token` in the response to determine if more tasks exist. The maximum page size is 1000. If unspecified, the page size will be the maximum. |
| `pageToken` | `string` A token identifying the page of results to return. To request the first page results, pageToken must be empty. To request the next page of results, pageToken must be the value of `https://docs.cloud.google.com/tasks/docs/reference/rest/v2/projects.locations.queues.tasks/list#body.ListTasksResponse.FIELDS.next_page_token` returned from the previous call to `https://docs.cloud.google.com/tasks/docs/reference/rest/v2/projects.locations.queues.tasks/list#google.cloud.tasks.v2.CloudTasks.ListTasks` method. The page token is valid for only 2 hours. |

### Request body

The request body must be empty.

### Response body

Response message for listing tasks using `https://docs.cloud.google.com/tasks/docs/reference/rest/v2/projects.locations.queues.tasks/list#google.cloud.tasks.v2.CloudTasks.ListTasks`.

If successful, the response body contains data with the following structure:

| JSON representation |
|---|
| ``` { "tasks": [ { object (`https://docs.cloud.google.com/tasks/docs/reference/rest/v2/projects.locations.queues.tasks#Task`) } ], "nextPageToken": string } ``` |

| Fields ||
|---|---|
| `tasks[]` | ``object (`https://docs.cloud.google.com/tasks/docs/reference/rest/v2/projects.locations.queues.tasks#Task`)`` The list of tasks. |
| `nextPageToken` | `string` A token to retrieve next page of results. To return the next page of results, call `https://docs.cloud.google.com/tasks/docs/reference/rest/v2/projects.locations.queues.tasks/list#google.cloud.tasks.v2.CloudTasks.ListTasks` with this value as the `https://docs.cloud.google.com/tasks/docs/reference/rest/v2/projects.locations.queues.tasks/list#body.QUERY_PARAMETERS.page_token`. If the nextPageToken is empty, there are no more results. |

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