- [HTTP request](https://developers.google.com/workspace/gmail/admin-quarantine/reference/rest/v1/customers.quarantinedMessages/search.md.txt#body.HTTP_TEMPLATE)
- [Path parameters](https://developers.google.com/workspace/gmail/admin-quarantine/reference/rest/v1/customers.quarantinedMessages/search.md.txt#body.PATH_PARAMETERS)
- [Request body](https://developers.google.com/workspace/gmail/admin-quarantine/reference/rest/v1/customers.quarantinedMessages/search.md.txt#body.request_body)
  - [JSON representation](https://developers.google.com/workspace/gmail/admin-quarantine/reference/rest/v1/customers.quarantinedMessages/search.md.txt#body.request_body.SCHEMA_REPRESENTATION)
- [Response body](https://developers.google.com/workspace/gmail/admin-quarantine/reference/rest/v1/customers.quarantinedMessages/search.md.txt#body.response_body)
  - [JSON representation](https://developers.google.com/workspace/gmail/admin-quarantine/reference/rest/v1/customers.quarantinedMessages/search.md.txt#body.SearchQuarantinedMessagesResponse.SCHEMA_REPRESENTATION)
- [Authorization scopes](https://developers.google.com/workspace/gmail/admin-quarantine/reference/rest/v1/customers.quarantinedMessages/search.md.txt#body.aspect)

<br />

> [!WARNING]
> **Developer Preview:** Available as part of the [Google Workspace Developer Preview Program](https://developers.google.com/workspace/preview.md.txt), which grants early access to certain features.

Searches for quarantined messages using specific search queries.

<br />

### HTTP request

`POST https://mailadminquarantine.googleapis.com/v1/{parent=customers/*}/quarantinedMessages:search`

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

### Path parameters

| Parameters ||
|---|---|
| `parent` | `string` Required. The parent resource, which owns this collection of messages. Format: customers/{customer_id} |

### Request body

The request body contains data with the following structure:

| JSON representation |
|---|
| ``` { "pageSize": integer, "pageToken": string, "filter": string, "query": string } ``` |

| Fields ||
|---|---|
| `pageSize` | `integer` Optional. The maximum number of items to return. |
| `pageToken` | `string` Optional. The nextPageToken value returned from a previous search call. |
| `filter` | `string` Optional. Filter results by status, direction, or quarantine. The filter includes three optional parts: `status`, `direction`, and `quarantine`, which are always connected using the `AND` logical operator. The filter expression must follow the syntax of [AIP-160](https://google.aip.dev/160). Example: "status = PENDING_TRIAGE AND direction = OUTBOUND AND quarantine = customers/123/quarantines/1" |
| `query` | `string` Optional. A Gmail-specific search query in Caribou query format. |

### Response body

Response message for \[quarantinedMessages.search\]\[\].

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

| JSON representation |
|---|
| ``` { "quarantinedMessages": [ { object (`QuarantinedMessage`) } ], "nextPageToken": string, "unreachable": [ string ] } ``` |

| Fields ||
|---|---|
| `quarantinedMessages[]` | ``object (`QuarantinedMessage`)`` The list of quarantined messages matching the search query. |
| `nextPageToken` | `string` A token to retrieve the next page of results. |
| `unreachable[]` | `string` Accounts for which the service could not retrieve quarantined messages. |

### Authorization scopes

Requires one of the following OAuth scopes:

- `https://www.googleapis.com/auth/gmail.admin.quarantine`
- `https://www.googleapis.com/auth/gmail.admin.quarantine.readonly`

For more information, see the [Authorization guide](https://developers.google.com/workspace/gmail/admin-quarantine/guides/authorize.md.txt).