Google API
Google ID tokens use RS256 signatures. Verify them with the public keys at /oauth2/v3/certs, the instance issuer, your client ID, and the request nonce. Signing keys last for the server process; restarting it invalidates earlier tokens.
OAuth 2.0, OpenID Connect, and mutable Google Workspace-style surfaces for local inbox, calendar, and drive flows.
OAuth & OpenID Connect
GET /o/oauth2/v2/auth- authorization endpointPOST /oauth2/token- token exchangeGET /oauth2/v2/userinfo- get user infoGET /.well-known/openid-configuration- OIDC discovery documentGET /oauth2/v3/certs- JSON Web Key Set (JWKS)
Gmail
GET /gmail/v1/users/:userId/messages- list messages (q,labelIds,maxResults,pageToken)GET /gmail/v1/users/:userId/messages/:id- get message (full,metadata,minimal,rawformats)GET /gmail/v1/users/:userId/messages/:messageId/attachments/:id- get attachmentPOST /gmail/v1/users/:userId/messages/send- send message (raw MIME or structured fields)POST /gmail/v1/users/:userId/messages/import- import inbox mailPOST /gmail/v1/users/:userId/messages- insert a message directlyPOST /gmail/v1/users/:userId/messages/:id/modify- add/remove labelsPOST /gmail/v1/users/:userId/messages/batchModify- batch label changesPOST /gmail/v1/users/:userId/messages/:id/trash- trash messagePOST /gmail/v1/users/:userId/messages/:id/untrash- untrash message
Gmail Drafts
GET /gmail/v1/users/:userId/drafts- list draftsPOST /gmail/v1/users/:userId/drafts- create draftGET /gmail/v1/users/:userId/drafts/:id- get draftPUT /gmail/v1/users/:userId/drafts/:id- update draftPOST /gmail/v1/users/:userId/drafts/:id/send- send draftDELETE /gmail/v1/users/:userId/drafts/:id- delete draft
Gmail Threads
GET /gmail/v1/users/:userId/threads- list threadsGET /gmail/v1/users/:userId/threads/:id- get threadPOST /gmail/v1/users/:userId/threads/:id/modify- add/remove labels across a thread
Gmail Labels
GET /gmail/v1/users/:userId/labels- list labelsPOST /gmail/v1/users/:userId/labels- create labelPATCH /gmail/v1/users/:userId/labels/:id- update labelDELETE /gmail/v1/users/:userId/labels/:id- delete label
Gmail History & Push
GET /gmail/v1/users/:userId/history- list history changesGET /gmail/v1/users/:userId/profile- mailbox address, totals and current history idPOST /gmail/v1/users/:userId/watch- push notifications to the topic's Pub/Sub push subscriptions (expires after 7 days)POST /gmail/v1/users/:userId/stop- stop push notifications
Gmail push: users.watch notifies the topic's Cloud Pub/Sub push subscriptions after a matching mailbox change (labelIds with INCLUDE or EXCLUDE), at most once a second per user, as Gmail does. Pub/Sub is not emulated, so configure push subscriptions with the pubsub_push_subscriptions seed field or POST /_emulate/google/pubsub/subscriptions:
google:
pubsub_push_subscriptions:
- name: projects/demo/subscriptions/gmail-push
topic: projects/demo/topics/gmail
push_endpoint: https://app.example.test/push
audience: https://app.example.test/pushEach push is the Pub/Sub-wrapped body (message.data is base64 {"emailAddress","historyId"}, plus messageId, publishTime and subscription) with Authorization: Bearer <OIDC token>. The token is RS256, with aud (the audience, or the push endpoint), email (default gmail-push@{project}.iam.gserviceaccount.com), email_verified, sub, azp, iat and exp. Google signs with its own keys and iss https://accounts.google.com; the emulator signs with its OIDC key, so point the receiver's verifier at the emulator: JWKS <base>/oauth2/v3/certs and issuer <base>.
For a test the emulator cannot reach:
POST /_emulate/google/gmail/arrivewith{"to":"user@example.com","from":"a@example.com","subject":"hi","text":"hello","headers":[{"name":"List-Id","value":"..."}]}delivers mail to the INBOX and notifies the watch.POST /_emulate/google/gmail/preview-pushwith{"email":"user@example.com"}returns each push's URL, headers (with the signed token) and body without sending them.GET /_emulate/google/pubsub/deliverieslists the pushes made and whether each was acknowledged (102, 200, 201, 202 or 204).
Gmail Settings
GET /gmail/v1/users/:userId/settings/filters- list filtersPOST /gmail/v1/users/:userId/settings/filters- create filterDELETE /gmail/v1/users/:userId/settings/filters/:id- delete filterGET /gmail/v1/users/:userId/settings/forwardingAddresses- list forwarding addressesGET /gmail/v1/users/:userId/settings/sendAs- list send-as aliases
Calendar
GET /calendar/v3/users/:userId/calendarList- list calendarsGET /calendar/v3/calendars/:calendarId/events- list eventsPOST /calendar/v3/calendars/:calendarId/events- create eventDELETE /calendar/v3/calendars/:calendarId/events/:eventId- delete eventPOST /calendar/v3/freeBusy- query free/busy
Drive
GET /drive/v3/files- list filesGET /drive/v3/files/:fileId- get file metadataPOST /drive/v3/files- create file metadataPATCH /drive/v3/files/:fileId- update file metadataPUT /drive/v3/files/:fileId- update file contentDELETE /drive/v3/files/:fileId- delete a file or folderPOST /upload/drive/v3/files- upload file