---
title: "Gmail API alternative · Workwae"
description: "Use Workwae instead of calling the Gmail API yourself: synced mail, push-style webhooks, send, calendars and contacts behind one API."
url: https://workwae.com/providers/gmail
---

Providers

# A Gmail API alternative for sync, push and send.

Google Workspace and Gmail stay on Google’s API. Workwae runs the history sync, the Pub/Sub watch and the send, and notifies your app with webhooks.

What Google requires

## The Gmail API is yours to operate.

These are Google’s rules, from Google’s own docs. Workwae does not remove consent, verification or quota.

### OAuth client and consent

A Cloud project, an OAuth client and a consent screen. Ask for offline access so a [refresh token](https://workwae.com/glossary#refresh-token) comes back. Users can grant scopes one by one. [OAuth 2.0](https://developers.google.com/identity/protocols/oauth2)

### Restricted Gmail scopes

Gmail scopes are restricted. A production app needs Google verification and a [CASA](https://workwae.com/glossary#casa) assessment. Apps left in Testing get refresh tokens that expire in 7 days. [Gmail scopes](https://developers.google.com/workspace/gmail/api/auth/scopes)

### Push through Pub/Sub

`users.watch` publishes to a topic in the same Cloud project as the OAuth client. A watch lasts at most 7 days. [Gmail push](https://developers.google.com/workspace/gmail/api/guides/push)

### Quota

Methods spend quota units per user, and the project has a daily cap. History reads and sends both count. [Gmail quota](https://developers.google.com/workspace/gmail/api/reference/quota)

What Workwae does

## Sync, webhooks and send, on your app or ours.

### History sync

Mail sync replays `history.list`. When Google says the history id is too old, that mailbox is read again and diffed against the index.

### Watch and renewal

Platform-app accounts watch Workwae’s Pub/Sub topic. A tenant app watches a topic in that app’s project. Watches renew daily. If Google refuses the watch, the account is polled.

### Your Google app, or ours

Register your OAuth client, or use Workwae’s. Ours has not completed CASA. The platform app asks for `gmail.modify`, not the full mail scope, so permanent delete is refused for those accounts; trash works. Gmail over IMAP needs your own app.

### Calendar and contacts

Calendar sync uses a sync token and watch channels on calendars you can write ([Google Calendar](https://workwae.com/providers/google-calendar)). Contacts use the People API and are polled; Google has no contact push. Both need their own scopes on the grant.

SDK

## Connect, then send.

Hosted connect returns a URL. After the user consents, send through the outbox. The shapes match the TypeScript (`@workwae/sdk`) and Python (`workwae`) SDKs.

gmail.tsgmail.py

```ts
const session = await workwae.connectSessions.create({
  redirectUri: "https://app.example.com/mail/connected",
  providers: ["google"],
  externalRef: user.id,
  options: { calendarEnabled: true, contactsEnabled: true },
});

const send = await workwae.outbox.create({
  accountId,
  to: [{ name: "Grace Hopper", address: "grace@example.org" }],
  subject: "Invoice 1001",
  text: "Hi Grace, your invoice is attached.",
});
```

```python
session = workwae.connect_sessions.create(
    redirect_uri="https://app.example.com/mail/connected",
    providers=["google"],
    external_ref=user.id,
    options={"calendar_enabled": True, "contacts_enabled": True},
)

send = workwae.outbox.create(
    account_id=account_id,
    to=[{"name": "Grace Hopper", "address": "grace@example.org"}],
    subject="Invoice 1001",
    text="Hi Grace, your invoice is attached.",
)
```

FAQ

## Questions teams ask.

**Do our users consent to Google or to Workwae?**

They consent on Google’s screen, to Workwae’s app or to the Google app you registered. Workwae’s app has not completed CASA. Restricted Gmail scopes on your app still need your own verification.

**Do we run Pub/Sub?**

Not for Workwae’s app. For your own Google app, the watch topic has to live in that app’s Cloud project, with a push subscription Workwae can receive. Without it, those accounts are polled.

**Can we import refresh tokens we already hold?**

Yes, when your own Google app issued them. Register that client and call `accounts.create` with the refresh token. Google caps refresh tokens at 100 per account per client id.

**Is there a separate government Gmail cloud?**

No. Gmail and Calendar use the same hosts for every Workspace customer. Microsoft government clouds are a [Microsoft](https://workwae.com/providers/microsoft-365) concern.

Early access

## Stop operating the Gmail watch yourself.

Tell us how many Workspace accounts you need to sync.

[Request early access](https://workwae.com/early-access/) [All providers](https://workwae.com/providers/)
