Destination type

Gmail Destination

Use Gmail destinations when routed events should become email notifications, operational alerts, support handoffs, customer-facing messages, or manual review emails.

GMAILGmail send APIPOSTGoogle Workspace
Gmail destination delivery flowFastHook routes accepted events through a connection to a Gmail destination and stores delivery attempt evidence.AcceptedRequestsource verifiedConnectionRoute branchfilters and transformsretry policyGMAILGmailGmail send APIPOSTAttemptEvidencestatus + bodyDestination config owns target, auth, method, rate limit, disabled state, and delivery attempt evidence.
For Gmail destinations, FastHook renders message templates, sends through Gmail API, and stores the send response as delivery attempt evidence.

When to use this destination type

Choose GMAIL when the receiver target is Gmail send API. Destinations are outbound delivery targets: they do not decide whether a source request should be accepted, and they do not own connection filters or transformations. They own where the final delivery goes and how FastHook should authenticate, pace, disable, and inspect that delivery.

A destination can be reused by multiple connections when several source branches should feed the same receiver. Reuse keeps receiver capacity, credentials, and attempt evidence attached to one destination id.

FastHook dashboard fields

In the dashboard, create a destination, set Destination Type to GMAIL, then fill the fields below.

To

One or more recipient templates, separated by line, comma, or semicolon.

Cc and Bcc

Optional recipient templates for copied messages.

Subject

Message subject with template tokens.

Text body

Plain-text message body. Defaults to the event payload.

HTML body

Optional HTML message body.

OAuth2 Gmail send access

Google OAuth connection with Gmail send permission.

API config fields

The REST API stores destination-specific behavior under config. Use PATCH for focused edits and PUT only when your request contains the full config you want to keep.

config.to

Required recipient template or list of recipient templates.

config.cc

Optional cc recipient template or list.

config.bcc

Optional bcc recipient template or list.

config.reply_to

Optional Reply-To address.

config.subject

Subject template. Defaults to FastHook event {{event_id}}.

config.text_template

Plain-text body template. Defaults to {{payload}}.

config.html_template

Optional HTML body template.

config.auth_type

GOOGLE_OAUTH_REFRESH_TOKEN.

config.auth

OAuth client credentials, refresh token, and gmail.send scope.

Gmail destination config
{
  "name": "ops-email-alerts",
  "type": "GMAIL",
  "config": {
    "to": [
      "ops@example.com",
      "{{payload.owner.email}}"
    ],
    "cc": [
      "support@example.com"
    ],
    "subject": "FastHook event {{event_id}}",
    "text_template": "A webhook event needs review.\n\n{{payload}}",
    "html_template": "<pre>{{payload}}</pre>",
    "reply_to": "support@example.com",
    "auth_type": "GOOGLE_OAUTH_REFRESH_TOKEN",
    "auth": {
      "client_id": "google-client-id",
      "client_secret": "google-client-secret",
      "refresh_token": "google-refresh-token",
      "scope": "https://www.googleapis.com/auth/gmail.send"
    },
    "rate_limit": 1,
    "rate_limit_period": "second"
  }
}
Create Gmail destination with cURL
curl -X POST "https://api.fasthook.io/v1/destinations" \
  -H "Authorization: Bearer $FASTHOOK_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "ops-email-alerts",
  "type": "GMAIL",
  "config": {
    "to": [
      "ops@example.com",
      "{{payload.owner.email}}"
    ],
    "cc": [
      "support@example.com"
    ],
    "subject": "FastHook event {{event_id}}",
    "text_template": "A webhook event needs review.\n\n{{payload}}",
    "html_template": "<pre>{{payload}}</pre>",
    "reply_to": "support@example.com",
    "auth_type": "GOOGLE_OAUTH_REFRESH_TOKEN",
    "auth": {
      "client_id": "google-client-id",
      "client_secret": "google-client-secret",
      "refresh_token": "google-refresh-token",
      "scope": "https://www.googleapis.com/auth/gmail.send"
    },
    "rate_limit": 1,
    "rate_limit_period": "second"
  }
}'

Authentication

Destination authentication is outbound. It helps the receiver trust or accept FastHook delivery, and it is separate from source authentication that verifies the original webhook producer.

  • Google OAuth refresh token with gmail.send scope

HTTP methods and rate limit

This destination type uses the methods below for delivery attempts. Rate limits apply at the destination boundary, so every connection that targets the same destination shares that capacity.

POST

Rate limit: Locked to 1 request per second.

Delivery behavior

  • Recipient, subject, text, and HTML fields can use FastHook template tokens such as {{event_id}} and {{payload.customer.email}}.
  • FastHook sends through Gmail with the configured OAuth refresh token and gmail.send scope.
  • Gmail destinations are locked to 1 request per second to avoid Gmail API send bursts.
  • Use Gmail for human notification workflows, not high-volume machine-to-machine delivery.

Setup checklist

  1. Create a destination and choose GMAIL as the destination type.
  2. Add at least one To recipient. Use static addresses or template values from the payload.
  3. Set the subject and text or HTML body templates.
  4. Connect Google with Gmail send access.
  5. Connect the destination through filters so only email-worthy events create messages.

Troubleshooting

Saving fails because recipients are missing.

Add at least one To recipient and a non-empty subject.

Saving fails because OAuth is missing.

Connect Google with Gmail send access so FastHook can store a refresh token.

Too many emails are sent.

Put filters on the connection before the Gmail destination and keep the built-in 1 request per second pacing.

Related docs