- [HTTP request](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants.agents/list#body.HTTP_TEMPLATE)
- [Path parameters](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants.agents/list#body.PATH_PARAMETERS)
- [Query parameters](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants.agents/list#body.QUERY_PARAMETERS)
- [Request body](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants.agents/list#body.request_body)
- [Response body](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants.agents/list#body.response_body)
  - [JSON representation](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants.agents/list#body.ListAgentsResponse.SCHEMA_REPRESENTATION)
- [Authorization scopes](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants.agents/list#body.aspect)
- [IAM Permissions](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants.agents/list#body.aspect_1)

Lists all `https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants.agents#Agent`s under an `https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants#Assistant` which were created by the caller.

### HTTP request

Choose an endpoint:
global us   
`GET https://discoveryengine.googleapis.com/v1alpha/{parent=projects/*/locations/*/collections/*/engines/*/assistants/*}/agents`

<br />

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

### Path parameters

| Parameters ||
|---|---|
| `parent` | `string` Required. The parent resource name. Format: `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/assistants/{assistant}` |

### Query parameters

| Parameters ||
|---|---|
| `pageSize` | `integer` Optional. Maximum number of `https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants.agents#Agent`s to return. If unspecified, defaults to 100. The maximum allowed value is 1000; anything above that will be coerced down to 1000. |
| `pageToken` | `string` Optional. A page token `https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants.agents/list#body.ListAgentsResponse.FIELDS.next_page_token`, received from a previous `https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants.agents/list#google.cloud.discoveryengine.v1alpha.AgentService.ListAgents` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants.agents/list#google.cloud.discoveryengine.v1alpha.AgentService.ListAgents` must match the call that provided the page token. |
| `orderBy` | `string` Optional. A comma-separated list of fields to order by, sorted in ascending order. Use "desc" after a field name for descending. Supported fields: - `updateTime` - `isPinned` Example: - "updateTime desc" - "isPinned desc,updateTime desc": list agents by isPinned first, then by updateTime. |
| `filter` | `string` Optional. Filters the `https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants.agents#Agent`s list. Supported fields: - `displayName`: display name of the agent. Supports `=`, `:`. - `id`: ID of the agent. Supports `=`. - `state`: state of the agent. Supports `=`. - `createTime`: timestamp when the agent was created. Supports `=`, `>`, `<`, `>=`, `<=`. - `updateTime`: timestamp when the agent was last updated. Supports `=`, `>`, `<`, `>=`, `<=`. Examples: - `displayName = "My Agent"` - `createTime > "2023-01-01T00:00:00Z"` |

### Request body

The request body must be empty.

### Response body

Response message for the `https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants.agents/list#google.cloud.discoveryengine.v1alpha.AgentService.ListAgents` method.

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

| JSON representation |
|---|
| ``` { "agents": [ { object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants.agents#Agent`) } ], "nextPageToken": string } ``` |

| Fields ||
|---|---|
| `agents[]` | ``object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants.agents#Agent`)`` The agents visible to the caller under the parent `https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants#Assistant`. |
| `nextPageToken` | `string` A token that can be sent as `https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants.agents/list#body.QUERY_PARAMETERS.page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages. |

### Authorization scopes

Requires one of the following OAuth scopes:

- `https://www.googleapis.com/auth/cloud-platform`
- `https://www.googleapis.com/auth/discoveryengine.assist.readwrite`
- `https://www.googleapis.com/auth/discoveryengine.readwrite`
- `https://www.googleapis.com/auth/discoveryengine.serving.readwrite`

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

### IAM Permissions

Requires the following [IAM](https://cloud.google.com/iam/docs) permission on the `parent` resource:

- `discoveryengine.agents.list`

For more information, see the [IAM documentation](https://cloud.google.com/iam/docs).