canonical: https://jentic.com/apis/googleapis.com/gmail-postmaster-tools

# Google Gmail Postmaster Tools API

The Gmail Postmaster Tools API gives high-volume senders programmatic access to deliverability metrics that were previously only viewable in the Postmaster Tools UI. Senders can pull spam rates, IP and domain reputation, authentication results (SPF, DKIM, DMARC), feedback loop identifiers, and delivery error breakdowns for domains they have verified. The data is aggregated daily and is intended to help senders diagnose deliverability problems before they become reputation-damaging. The API exposes domain registration metadata along with per-day traffic statistics for each verified sending domain.

## For AI agents

Pull Gmail deliverability data for verified sending domains, including spam rates, IP and domain reputation, and authentication pass rates.

## Scope

Does not send mail, manage Gmail mailboxes, or register new domains - use for reading deliverability metrics on already-verified sending domains only.

## Capabilities

- List verified sending domains registered to the authenticated postmaster account
- Retrieve registration details and verification status for a specific Gmail Postmaster domain
- Fetch daily traffic statistics including user-reported spam rate and bulk-vs-personal volume splits
- Pull SPF, DKIM, and DMARC authentication success rates for outbound mail to Gmail recipients
- Track domain and IP reputation classifications (high, medium, low, bad) over time
- Surface delivery error breakdowns to diagnose why messages are bouncing or being filtered

## Use cases

### Deliverability Monitoring Dashboard

Email operations teams use the Gmail Postmaster Tools API to power internal deliverability dashboards that track spam rate, domain reputation, and authentication pass rates across all verified sending domains. The API returns per-day traffic statistics so dashboards can plot trends, alert on regressions, and correlate reputation drops with content or volume changes. This replaces manual UI checks across multiple domains and lets teams catch deliverability problems before they trigger throttling.

Example prompt: List all domains registered in Postmaster Tools, then for each domain fetch the last 7 days of traffic stats and flag any day where userReportedSpamRatio exceeds 0.003.

### Authentication Compliance Audits

Compliance and security teams pull SPF, DKIM, and DMARC pass-rate data from the Postmaster Tools API to verify that outbound email from each business domain is correctly authenticated. The traffic stats endpoint reports the percentage of mail that passed each authentication check, so teams can spot misconfigured subdomains, unauthorised senders, or expired DKIM keys. Integration with a ticketing system lets failed-auth percentages over a threshold open an investigation automatically.

Example prompt: For domain marketing.example.com, fetch traffic stats for the last 30 days and compute the average DKIM and SPF success ratios; alert if either drops below 0.95.

### AI Agent Deliverability Triage

An AI agent surfaces Gmail deliverability problems to email teams by pulling Postmaster Tools traffic stats through Jentic. When a CRM or marketing platform reports a campaign underperformance, the agent fetches the relevant domain's spam rate, reputation, and delivery errors for the campaign window and produces a plain-language diagnosis. Agents call the API with a scoped credential issued by Jentic so raw OAuth tokens never enter the agent context.

Example prompt: Given a campaign that ran on 2026-06-01 from sender marketing.example.com, fetch that day's traffic stats from Postmaster Tools and summarise whether spam rate, IP reputation, or authentication was the most likely cause of underperformance.

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| GET | /v1/domains | List verified domains in the postmaster account |
| GET | /v1/{+name} | Get registration and verification details for a specific domain |
| GET | /v1/{+parent}/trafficStats | List daily traffic statistics for a domain |

## Key resources

- **Domains** — List and inspect verified sending domains registered to the postmaster account
- **TrafficStats** — Retrieve daily traffic statistics including spam rate, reputation, authentication results, and delivery errors for a specific domain

## Why Jentic

- **Setup:** Wiring Gmail Postmaster Tools by hand means standing up Google OAuth2, narrowing to the postmaster.readonly scope, refreshing access tokens, and parsing its resource-name paths yourself. Through Jentic you install once, import the Gmail Postmaster Tools API from the API Directory, store the OAuth credential once, and your agent calls it.
- **Permission scoping:** The domain travels in the resource-name path (/v1/{name}/trafficStats), so a rule can pin your agent to one verified sending domain: it reads that domain's deliverability metrics and nothing else. You choose the operations it may call, and since every endpoint here is read-only, the agent only ever fetches traffic stats and domain records.
- **Credential handling:** Your Google OAuth credential is stored once, encrypted, by your own Jentic One instance and injected at execution time as a short-lived postmaster.readonly access token. The refresh token never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'get gmail spam rate' or 'read domain deliverability metrics', and Jentic returns the matching trafficStats operation with its input schema so the agent calls the right path without browsing Google's discovery doc.

## Related APIs

- **Gmail API** — Gmail API sends and reads mail; Postmaster Tools API reports on how Gmail received mail you sent.
- **Admin SDK** — Admin SDK manages Workspace users and domains; Postmaster Tools reports on outbound mail reputation.
- **Groups Settings API** — Manages group permissions inside Workspace, often paired with Postmaster monitoring for distribution lists.

## FAQ

### What authentication does the Gmail Postmaster Tools API use?

The API uses Google OAuth 2.0 with the postmaster.readonly scope. Through Jentic, the OAuth token is held in the Jentic credential vault and exchanged for a scoped access token at execution time, so raw tokens never reach the agent context.

### Can I retrieve historical spam rates with the Gmail Postmaster Tools API?

Yes. Call GET /v1/{+parent}/trafficStats on a verified domain to list daily traffic statistics, each of which includes userReportedSpamRatio and inboundEncryptionRatio. Google retains stats for a rolling window, so backfill beyond that window is not available.

### What are the rate limits for the Gmail Postmaster Tools API?

Google enforces a default per-project quota for the Postmaster Tools API (currently 1,200 queries per minute per project). Quotas are managed in the Google Cloud Console and can be increased on request.

### How do I pull yesterday's traffic stats through Jentic?

Search Jentic with 'get gmail postmaster traffic stats', load the listTrafficStats operation under /v1/{+parent}/trafficStats, then execute it with the parent set to domains/{your-domain}. Jentic returns the daily stats array including spam rate, reputation buckets, and authentication ratios.

### Can I add new domains via the Gmail Postmaster Tools API?

No. Domain registration and DNS verification must be completed in the Postmaster Tools web UI before the API will return data for them. The API exposes only read endpoints for listing and reading domains and their stats.

### Can I limit what my agent is allowed to do with the Gmail Postmaster Tools API?

Yes. Because you run Jentic One yourself, your own rules decide which operations and credentials the agent may use, and every endpoint in this API is read-only, so the agent can only list domains and fetch traffic stats, never register domains or send mail. Since the verified domain travels in the resource-name path (/v1/{name}/trafficStats), you can pin the agent to a single sending domain, letting it read that domain's spam rate, reputation, and authentication metrics and nothing else. You choose exactly which operations it may call and which stored OAuth credential it may use.
