> [!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.

The Mail Admin Quarantine API enforces per-minute usage quotas for each Google Cloud project to
protect the Google Workspace infrastructure that searches and retrieves
quarantined messages. The quotas are grouped by the type of work a method
performs.

## Quotas

The following table lists the quotas. Each quota is **per minute per
Cloud project**, and counts all requests that the project makes across
all Google Workspace customers and impersonated administrators.

| Quota | Value | Methods |
|---|---|---|
| Search and list requests | 60 requests per minute | [`customers.quarantinedMessages.list`](https://developers.google.com/workspace/gmail/admin-quarantine/reference/rest/v1/customers.quarantinedMessages/list.md.txt), [`customers.quarantinedMessages.search`](https://developers.google.com/workspace/gmail/admin-quarantine/reference/rest/v1/customers.quarantinedMessages/search.md.txt) |
| Read requests | 1,200 requests per minute | [`customers.quarantinedMessages.get`](https://developers.google.com/workspace/gmail/admin-quarantine/reference/rest/v1/customers.quarantinedMessages/get.md.txt), [`customers.quarantines.get`](https://developers.google.com/workspace/gmail/admin-quarantine/reference/rest/v1/customers.quarantines/get.md.txt), [`customers.quarantines.list`](https://developers.google.com/workspace/gmail/admin-quarantine/reference/rest/v1/customers.quarantines/list.md.txt), [`customers.operations.get`](https://developers.google.com/workspace/gmail/admin-quarantine/reference/rest/v1/customers.operations/get.md.txt) |
| Write requests | 300 requests per minute | [`customers.quarantinedMessages.release`](https://developers.google.com/workspace/gmail/admin-quarantine/reference/rest/v1/customers.quarantinedMessages/release.md.txt), [`customers.quarantinedMessages.deny`](https://developers.google.com/workspace/gmail/admin-quarantine/reference/rest/v1/customers.quarantinedMessages/deny.md.txt), [`customers.quarantinedMessages.batchRelease`](https://developers.google.com/workspace/gmail/admin-quarantine/reference/rest/v1/customers.quarantinedMessages/batchRelease.md.txt), [`customers.quarantinedMessages.batchDeny`](https://developers.google.com/workspace/gmail/admin-quarantine/reference/rest/v1/customers.quarantinedMessages/batchDeny.md.txt) |

Each API call counts as one request, regardless of the page size or, for batch
methods, the number of messages in the batch. For example, a `batchRelease`
request with 500 messages consumes one write request.

You can view your project's current quota usage in the Google Cloud console under
[**APIs \& Services \> Enabled APIs \& services \> Admin Quarantine API \> Quotas \& System Limits**](https://console.cloud.google.com/apis/api/mailadminquarantine.googleapis.com/quotas).

## Request constraints

| Constraint | Value |
|---|---|
| Maximum `pageSize` for `list` and `search` requests | 300 messages |
| Maximum messages per `batchRelease` or `batchDeny` request | 500 messages |
| Search and list window | Messages received in the last 30 days |

## Resolve quota errors

When your project exceeds a quota, the API returns an HTTP `429` error with
the status `RESOURCE_EXHAUSTED`:

```json
{
  "error": {
    "code": 429,
    "message": "Quota exceeded for quota metric 'Search and list quarantined messages requests' and limit 'Search and list requests per minute per project' of service 'mailadminquarantine.googleapis.com' for consumer 'project_number:123456789012'.",
    "status": "RESOURCE_EXHAUSTED"
  }
}
```

To stay within the quotas:

- **Retry with exponential backoff.** When you receive a `429` error, wait before retrying and increase the wait time after each failed attempt. For details, see [Exponential backoff](https://cloud.google.com/storage/docs/retry-strategy#exponential-backoff).
- **Use the largest useful page size.** Search and list requests have the smallest quota. Request up to 300 messages per page instead of many small pages.
- **Use filters.** Narrow `search` requests with a `filter` or `query` so that you retrieve only the messages you need.
- **Use batch methods for bulk actions.** A single `batchRelease` or `batchDeny` request can release or deny up to 500 messages, compared to one message per `release` or `deny` call.
- **Poll operations sparingly.** When you wait for a batch operation, call the `get` method of the `customers.operations` resource every few seconds rather than continuously.
- **Sync incrementally.** Instead of re-listing the entire quarantine on each run, filter on `status = PENDING_TRIAGE` and process only new messages.

Quota increases aren't available during Developer Preview. If your use case
requires higher quotas, share your feedback through the
[Google Workspace Developer Preview Program](https://developers.google.com/workspace/preview.md.txt).