Mail Admin Quarantine API usage quotas

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, customers.quarantinedMessages.search
Read requests 1,200 requests per minute customers.quarantinedMessages.get, customers.quarantines.get, customers.quarantines.list, customers.operations.get
Write requests 300 requests per minute customers.quarantinedMessages.release, customers.quarantinedMessages.deny, customers.quarantinedMessages.batchRelease, customers.quarantinedMessages.batchDeny

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.

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:

{
  "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.
  • 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.