# Method: projects.locations.collections.dataObjects.query

Queries data objects.

### HTTP request

`POST https://vectorsearch.googleapis.com/v1/{parent}/dataObjects:query`

### Path parameters

| Parameters ||
|---|---|
| `parent` | `string` Required. The resource name of the Collection for which to query. Format: `projects/{project}/locations/{location}/collections/{collection}` |

### Request body

The request body contains data with the following structure:

| JSON representation |
|---|
| ``` { "filter": { object }, "outputFields": { object (`https://docs.cloud.google.com/gemini-enterprise-agent-platform/build/vector-search-2/reference/rest/v1/OutputFields`) }, "pageSize": integer, "pageToken": string } ``` |

| Fields ||
|---|---|
| `filter` | ``object (`https://protobuf.dev/reference/protobuf/google.protobuf#struct` format)`` Optional. A JSON filter expression, e.g. {"genre": {"$eq": "sci-fi"}}, represented as a google.protobuf.Struct. |
| `outputFields` | ``object (`https://docs.cloud.google.com/gemini-enterprise-agent-platform/build/vector-search-2/reference/rest/v1/OutputFields`)`` Optional. Mask specifying which fields to return. |
| `pageSize` | `integer` Optional. The standard list page size. Default is 100. The maximum value is 1000; values above 1000 will be coerced to 1000. |
| `pageToken` | `string` Optional. The standard list page token. Typically obtained via `https://docs.cloud.google.com/gemini-enterprise-agent-platform/build/vector-search-2/reference/rest/v1/projects.locations.collections.dataObjects/query#body.QueryDataObjectsResponse.FIELDS.next_page_token` of the previous `https://docs.cloud.google.com/gemini-enterprise-agent-platform/build/vector-search-2/reference/rest/v1/projects.locations.collections.dataObjects/query#google.cloud.vectorsearch.v1.DataObjectSearchService.QueryDataObjects` call. |

### Response body

Response message for `https://docs.cloud.google.com/gemini-enterprise-agent-platform/build/vector-search-2/reference/rest/v1/projects.locations.collections.dataObjects/query#google.cloud.vectorsearch.v1.DataObjectSearchService.QueryDataObjects`.

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

| JSON representation |
|---|
| ``` { "dataObjects": [ { object (`https://docs.cloud.google.com/gemini-enterprise-agent-platform/build/vector-search-2/reference/rest/v1/projects.locations.collections.dataObjects#DataObject`) } ], "nextPageToken": string } ``` |

| Fields ||
|---|---|
| `dataObjects[]` | ``object (`https://docs.cloud.google.com/gemini-enterprise-agent-platform/build/vector-search-2/reference/rest/v1/projects.locations.collections.dataObjects#DataObject`)`` Output only. The list of dataObjects that match the query. |
| `nextPageToken` | `string` Output only. A token to retrieve next page of results. Pass to \[DataObjectSearchService.QueryDataObjectsRequest.page_token\]\[\] to obtain that page. |

### Authorization scopes

Requires the following OAuth scope:

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

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:

- `vectorsearch.dataObjects.query`

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