Complete Google OAuth first. PubSub enables real-time email notifications so Inbox Zero is notified immediately when new emails arrive.Documentation Index
Fetch the complete documentation index at: https://docs.getinboxzero.com/llms.txt
Use this file to discover all available pages before exploring further.
1. Create a topic
- Go to the Pub/Sub Topics page in Google Cloud Console.
- Click Create Topic.
- Enter a topic ID (e.g.,
inbox-zero-emails). - Click Create.
2. Grant Gmail publish access
Gmail needs permission to send notifications to your topic. This is the step that allows Google’s servers to push email events into your Pub/Sub topic.- Click your topic name to open it.
- Go to the Permissions tab (you may see it labeled “Info Panel” on the right side — look for the “Permissions” section).
- Click Add Principal.
- In the “New principals” field, enter:
gmail-api-push@system.gserviceaccount.com - In the “Role” dropdown, select Pub/Sub Publisher.
- Click Save.
gmail-api-push@system.gserviceaccount.com is Google’s service account that sends Gmail push notifications. This is not your account — it’s a Google-managed service account used by the Gmail API. See the official docs for more details.3. Create a push subscription
- In your topic, go to the Subscriptions tab.
- Click Create Subscription.
- Set the Delivery type to Push.
- Set the Endpoint URL to:
https://yourdomain.com/api/google/webhook?token=TOKEN - Click Create.
4. Update your environment variables
Set these in your.env file:
GOOGLE_PUBSUB_TOPIC_NAME— the full topic name (e.g.,projects/your-project-id/topics/inbox-zero-emails)GOOGLE_PUBSUB_VERIFICATION_TOKEN— the value ofTOKENyou used in the webhook URL above
/api/google/webhook with upstream authentication, you can set GOOGLE_PUBSUB_VERIFICATION_TOKEN to an empty string to intentionally disable query-parameter verification. Leaving it unset is treated as a misconfiguration.
For local development
Use ngrok to expose your local server:https://abc123.ngrok.io/api/google/webhook?token=TOKEN).