The Postmaster Tools API is a RESTful API that provides programmatic access to email traffic metrics (like spam reports, delivery errors etc) otherwise available through the Gmail Postmaster Tools UI currently.

- [REST Resource: v2.domainStats](https://developers.google.com/workspace/gmail/postmaster/reference/rest/v2#v2.domainStats)
- [REST Resource: v2.domains](https://developers.google.com/workspace/gmail/postmaster/reference/rest/v2#v2.domains)
- [REST Resource: v2.domains.domainStats](https://developers.google.com/workspace/gmail/postmaster/reference/rest/v2#v2.domains.domainStats)
- [REST Resource: v2.domains.users](https://developers.google.com/workspace/gmail/postmaster/reference/rest/v2#v2.domains.users)

## Service: gmailpostmastertools.googleapis.com

To call this service, we recommend that you use the Google-provided [client libraries](https://cloud.google.com/apis/docs/client-libraries-explained). If your application needs to use your own libraries to call this service, use the following information when you make the API requests.

### Discovery document

A [Discovery Document](https://developers.google.com/discovery/v1/reference/apis) is a machine-readable specification for describing and consuming REST APIs. It is used to build client libraries, IDE plugins, and other tools that interact with Google APIs. One service may provide multiple discovery documents. This service provides the following discovery document:

- <https://gmailpostmastertools.googleapis.com/$discovery/rest?version=v2>

### Service endpoint

A [service endpoint](https://cloud.google.com/apis/design/glossary#api_service_endpoint) is a base URL that specifies the network address of an API service. One service might have multiple service endpoints. This service has the following service endpoint and all URIs below are relative to this service endpoint:

- `https://gmailpostmastertools.googleapis.com`

## REST Resource: [v2.domainStats](https://developers.google.com/workspace/gmail/postmaster/reference/rest/v2/domainStats)

| Methods ||
|---|---|
| `https://developers.google.com/workspace/gmail/postmaster/reference/rest/v2/domainStats/batchQuery` | `POST /v2/domainStats:batchQuery` Executes a batch of QueryDomainStats requests for multiple domains. |

## REST Resource: [v2.domains](https://developers.google.com/workspace/gmail/postmaster/reference/rest/v2/domains)

| Methods ||
|---|---|
| `https://developers.google.com/workspace/gmail/postmaster/reference/rest/v2/domains/create` | `POST /v2/domains` Adds a domain to the user's account. |
| `https://developers.google.com/workspace/gmail/postmaster/reference/rest/v2/domains/delete` | `DELETE /v2/{name=domains/*}` Deletes a domain from the user's account. |
| `https://developers.google.com/workspace/gmail/postmaster/reference/rest/v2/domains/get` | `GET /v2/{name=domains/*}` Retrieves detailed information about a domain registered by you. |
| `https://developers.google.com/workspace/gmail/postmaster/reference/rest/v2/domains/getComplianceStatus` | `GET /v2/{name=domains/*/complianceStatus}` Retrieves the compliance status for a given domain. |
| `https://developers.google.com/workspace/gmail/postmaster/reference/rest/v2/domains/getVerificationToken` | `GET /v2/{name=domains/*/verificationToken}` Gets a verification token used for verifying a user's ownership over a domain. |
| `https://developers.google.com/workspace/gmail/postmaster/reference/rest/v2/domains/list` | `GET /v2/domains` Retrieves a list of all domains registered by you, along with their corresponding metadata. |
| `https://developers.google.com/workspace/gmail/postmaster/reference/rest/v2/domains/verify` | `POST /v2/{name=domains/*}:verify` Verifies a user's ownership of a domain at the DNS level. |

## REST Resource: [v2.domains.domainStats](https://developers.google.com/workspace/gmail/postmaster/reference/rest/v2/domains.domainStats)

| Methods ||
|---|---|
| `https://developers.google.com/workspace/gmail/postmaster/reference/rest/v2/domains.domainStats/query` | `POST /v2/{parent=domains/*}/domainStats:query` Retrieves a list of domain statistics for a given domain and time period. |

## REST Resource: [v2.domains.users](https://developers.google.com/workspace/gmail/postmaster/reference/rest/v2/domains.users)

| Methods ||
|---|---|
| `https://developers.google.com/workspace/gmail/postmaster/reference/rest/v2/domains.users/create` | `POST /v2/{parent=domains/*}/users` Creates a user, who has access to a domain. |
| `https://developers.google.com/workspace/gmail/postmaster/reference/rest/v2/domains.users/delete` | `DELETE /v2/{name=domains/*/users/*}` Deletes a user from a domain. |
| `https://developers.google.com/workspace/gmail/postmaster/reference/rest/v2/domains.users/get` | `GET /v2/{name=domains/*/users/*}` Retrieves detailed information about a user that has access to a domain. |
| `https://developers.google.com/workspace/gmail/postmaster/reference/rest/v2/domains.users/list` | `GET /v2/{parent=domains/*}/users` Lists the users that have access to a domain. |
| `https://developers.google.com/workspace/gmail/postmaster/reference/rest/v2/domains.users/patch` | `PATCH /v2/{user.name=domains/*/users/*}` Updates a user for a domain. |