API reference · EmailPOST /api/email/webhooks/google
Receive Google Gmail Pub/Sub webhook Receives Google Pub/Sub push notifications for Gmail watches. Standard session and API-key middleware are bypassed; the handler requires an Authorization: Bearer Google-signed JWT, decodes the Pub/Sub message data into a Gmail notification with emailAddress and historyId, resolves the tenant and email provider by subscription name or mailbox, validates Google configuration, and enqueues a pointer-only job into the unified inbound email queue. It does not fetch or return email content.
Request body Content type: application/json · schema GooglePubSubPushBody
data string Required
Base64-encoded Gmail notification JSON containing emailAddress and historyId.
messageId string Required
Google Pub/Sub message ID.
publishTime string Required
ISO timestamp when Pub/Sub published the message.
subscription string Required
Full Pub/Sub subscription path, such as projects/{project}/subscriptions/{subscriptionName}.
Response body Success response 200
success boolean Required
Webhook was accepted.
Enum: true
queued boolean Required
The notification was enqueued for asynchronous processing.
Enum: true
handoff string Required
Queue handoff mechanism used for the Gmail notification pointer.
Enum: unified_pointer_queue
providerId string <uuid> Required
Resolved email_providers.id for the Gmail mailbox.
tenant string Required
Tenant identifier owning the provider.
historyId string Required
Gmail history ID from the decoded notification.
jobId string <uuid> Required
UUID assigned to the Redis queue job.
queueDepth integer Required
Redis queue depth after enqueue.
success boolean Required
Webhook request was accepted but no job was enqueued.
Enum: true
message string Required
Reason the webhook did not enqueue work.
Enum: No data to processNo provider foundNo google config found
Response codes 200
Webhook accepted. Either a queue job was enqueued, or the notification was safely skipped.
400
Permanent parse or validation error; Pub/Sub should not retry.
401
Bearer JWT is missing or invalid.
503
Transient enqueue or processing failure; Pub/Sub may retry.