# New Matched Traffic Stats — Google Postmaster Tools

> Emits a new event when traffic stats match certain criteria. See the documentation

- Key: `google_postmaster_tools_api-new-matched-traffic-stats`
- Type: Trigger (Polling)
- Version: 0.1.0
- App: Google Postmaster Tools (`google_postmaster_tools_api`) — https://pipedream.com/apps/google-postmaster-tools-api.md
- This page (HTML): https://pipedream.com/apps/google-postmaster-tools-api/triggers/new-matched-traffic-stats
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/google_postmaster_tools_api/sources/new-matched-traffic-stats/new-matched-traffic-stats.mjs

## Description

Emits a new event when traffic stats match certain criteria. [See the documentation](https://developers.google.com/gmail/postmaster/reference/rest)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `timer` | `$.interface.timer` | Yes | Timer |
| `domain` | `string` | Yes | Select a domain or provide a custom domain name. Options are loaded from the connected account. |
| `matchAllFilters` | `boolean` | No | If true, events will only be emitted if they match all of the selected criteria. The default behavior is matching any of them. |
| `ipReputation` | `string[]` | No | Emit events only when there is at least one IP address in one of the specified categories |
| `domainReputation` | `string[]` | No | Emit events only when the domain reputation matches one of the specified categories |
| `userReportedSpamRatio` | `string` | No | Emit events only when the user reported spam ratio is greater than, or equal to, the specified value (can be a percentage, e.g. 10% or a ratio between 0 and 1, e.g. 0.1) |
| `spfSuccessRatio` | `string` | No | Emit events only when the SPF success ratio is less than the specified value (can be a percentage, e.g. 10% or a ratio between 0 and 1, e.g. 0.1) |
| `dkimSuccessRatio` | `string` | No | Emit events only when the DKIM success ratio is less than the specified value (can be a percentage, e.g. 10% or a ratio between 0 and 1, e.g. 0.1) |
| `dmarcSuccessRatio` | `string` | No | Emit events only when the DMARC success ratio is less than the specified value (can be a percentage, e.g. 10% or a ratio between 0 and 1, e.g. 0.1) |
| `outboundEncryptionRatio` | `string` | No | Emit events only when the outbound encryption ratio is less than the specified value (can be a percentage, e.g. 10% or a ratio between 0 and 1, e.g. 0.1) |
| `inboundEncryptionRatio` | `string` | No | Emit events only when the inbound encryption ratio is less than the specified value (can be a percentage, e.g. 10% or a ratio between 0 and 1, e.g. 0.1) |
| `errorRatio` | `string` | No | Emit events only when the error ratio (in the specified Error Categories, or any if not specified) is greater than, or equal to, the specified value (can be a percentage, e.g. 10% or a ratio between 0 and 1, e.g. 0.1) |
| `errorCategories` | `string` | No | Emit events only when one of the specified categories equals or exceeds the specified Error Ratio |

## Returns

Events emitted by Google Postmaster Tools.

## Run it

**TypeScript**

```ts
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const deployed = await pd.triggers.deploy({
  id: "google_postmaster_tools_api-new-matched-traffic-stats",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    google_postmaster_tools_api: { authProvisionId: "apn_xxxxxxx" },
    timer: { "intervalSeconds": 900 },
    domain: "Domain Name",
  },
  webhookUrl: "https://example.com/webhooks/google-postmaster-tools-api",
})

console.log(deployed.id)
```

**cURL**

```bash
curl -X POST https://api.pipedream.com/v1/connect/{project_id}/triggers/deploy \
  -H "Content-Type: application/json" \
  -H "X-PD-Environment: production" \
  -H "Authorization: Bearer {access_token}" \
  -d '{
    "external_user_id": "{external_user_id}",
    "id": "google_postmaster_tools_api-new-matched-traffic-stats",
    "webhook_url": "https://example.com/webhooks/google-postmaster-tools-api",
    "configured_props": {
      "google_postmaster_tools_api": { "authProvisionId": "apn_xxxxxxx" },
      "timer": { "intervalSeconds": 900 },
      "domain": "Domain Name"
    }
  }'
```

**MCP**

MCP servers expose Google Postmaster Tools actions as on-demand tools.

New Matched Traffic Stats is an event source, so your application deploys it with the Connect SDK or API and then either receives each event at a webhook URL or retrieves events on demand with the trigger events API.

## Event delivery

Every event is sent to the HTTP endpoint you choose when you deploy the source. Or: no webhook required — your app or agent can fetch recent events from the [trigger events API](https://pipedream.com/docs/connect/api-reference/list-trigger-events.md) instead.

---

- App: https://pipedream.com/apps/google-postmaster-tools-api.md · All apps: https://pipedream.com/apps
