Public APIs
Gmail favicon

Gmail

Business

Flexible, RESTful access to the user's inbox.

Gmail's website screenshot

About Gmail

The Gmail API is a RESTful API for programmatic access to Gmail mailboxes and sending mail. It supports read-only mail extraction, indexing, and backup; automated or programmatic message sending; email account migration; message organization through filtering and sorting; and standardization of email signatures across an organization.

The API operates on core resources including messages, threads, drafts, and labels. Labels can be system-defined (such as INBOX, TRASH, or SPAM) or user-created, and are used to organize messages and threads. Messages, once created, are immutable, while drafts represent unsent messages that can be edited before sending. Threads group related messages into conversations.

Additional capabilities include managing filters that evaluate incoming messages against matching criteria and trigger actions like labeling or forwarding; configuring forwarding addresses and send-as aliases; managing delegate access within a Google Workspace organization; uploading S/MIME certificates for encrypted and signed email; and receiving push notifications via Google Cloud Pub/Sub when mailbox changes occur, removing the need for continuous polling. The API is intended for web applications requiring authorized access to a user's Gmail data.

Key features

  • Read, send, and manage Gmail messages and drafts via a RESTful API
  • Organize mail with system and user-created labels
  • Configure filters that auto-apply labels or forward matching messages
  • Push notifications via Google Cloud Pub/Sub to watch mailboxes for changes
  • Manage delegates, aliases, and S/MIME certificates for secure sending
  • Batch requests supported for performance

Frequently asked questions

What can the Gmail API be used for?

It supports read-only mail extraction, indexing and backup, automated or programmatic message sending, email account migration, and message organization/filtering.

What platforms and languages are supported?

Quickstarts are provided for JavaScript, Java, Python, Apps Script, Go, and Node.js.

How does the API notify apps of new mail without polling?

It integrates with Google Cloud Pub/Sub push notifications, letting apps watch a mailbox and receive webhooks when changes like new messages occur.

Can multiple users share access to a mailbox?

Yes, a delegator can grant mailbox access to a delegate within the same Google Workspace organization, allowing the delegate to read, send, and delete messages.

Does the API support secure, signed email sending?

Yes, users can upload S/MIME certificates to send-as aliases to send encrypted and digitally signed emails.

Advertise here

Featured products

  • SerpApi - Search API favicon
  • Screenshot Scout favicon
  • TalorData favicon
  • CoreClaw favicon

Show your product to thousands of developers

· 100k monthly pageviews
· 7k newsletter subscribers

Advertise your product