Business — entry 005 of 19

Gmail

Verified Jul 2026

The Gmail API gives OAuth-scoped programmatic access to a user's mailbox: reading, searching, sending, and organizing messages, threads, labels, and drafts, with message bodies transported as base64url-encoded MIME inside JSON. It requires a Google OAuth 2.0 bearer token, confirmed live via a `WWW-Authenticate: Bearer realm="https://accounts.google.com/"` challenge on an unauthenticated request, and unlike most server-side email APIs it explicitly supports cross-origin browser calls, echoing the request Origin on both a GET and an OPTIONS preflight.

emailinbox-managementoauthgoogle-workspace
AuthenticationOAuthRequires an OAuth flow; expect app registration.
HTTPSSupportedTraffic is encrypted in transit.
CORSEnabledCallable directly from browser JavaScript.
PricingFreeNo paid tier — free for the documented use case.
FormatsJSONResponses can be requested as JSON.

GreatAPIs Score

Score77out of 100
Authentication8/25OAuth flow required
Pricing20/20Free to use
Docs20/20Machine-readable spec file bundled
Formats9/15Single response format
Freshness20/20Verified within 6 months

Embed this badge

Scored 77 on greatapis.com
<a href="https://greatapis.com/api/gmail/"><img src="https://greatapis.com/badge/gmail.svg" alt="Scored 77 on greatapis.com"></a>

Auth quickstart

  1. Register an app / run the OAuth flow to obtain a bearer token.
  2. Send it as an Authorization headerAuthorization: Bearer <token>
Stored keyNo key stored

Your key is stored only in this browser (localStorage) and sent directly to the API — never to greatapis.

Endpoints

Servers
https://gmail.googleapis.com/
Auth
Oauth2Oauth2c
users79
GET/gmail/v1/users/{userId}/drafts
Parameters
NameInRequiredType
userIdpathyesstring
includeSpamTrashquerynoboolean
maxResultsquerynointeger
pageTokenquerynostring
qquerynostring
Responses
StatusDescriptionSchema
200Successful responseListDraftsResponse
POST/gmail/v1/users/{userId}/drafts
Parameters
NameInRequiredType
userIdpathyesstring
Request body

message/cpimDraft

Responses
StatusDescriptionSchema
200Successful responseDraft
POST/gmail/v1/users/{userId}/drafts/send
Parameters
NameInRequiredType
userIdpathyesstring
Request body

message/cpimDraft

Responses
StatusDescriptionSchema
200Successful responseMessage
GET/gmail/v1/users/{userId}/drafts/{id}
Parameters
NameInRequiredType
userIdpathyesstring
idpathyesstring
formatquerynostring
Responses
StatusDescriptionSchema
200Successful responseDraft
PUT/gmail/v1/users/{userId}/drafts/{id}
Parameters
NameInRequiredType
userIdpathyesstring
idpathyesstring
Request body

message/cpimDraft

Responses
StatusDescriptionSchema
200Successful responseDraft
DELETE/gmail/v1/users/{userId}/drafts/{id}
Parameters
NameInRequiredType
userIdpathyesstring
idpathyesstring
Responses
StatusDescriptionSchema
200Successful response
GET/gmail/v1/users/{userId}/history
Parameters
NameInRequiredType
userIdpathyesstring
historyTypesquerynoarray
labelIdquerynostring
maxResultsquerynointeger
pageTokenquerynostring
startHistoryIdquerynostring
Responses
StatusDescriptionSchema
200Successful responseListHistoryResponse
GET/gmail/v1/users/{userId}/labels
Parameters
NameInRequiredType
userIdpathyesstring
Responses
StatusDescriptionSchema
200Successful responseListLabelsResponse
POST/gmail/v1/users/{userId}/labels
Parameters
NameInRequiredType
userIdpathyesstring
Request body

application/jsonLabel

Responses
StatusDescriptionSchema
200Successful responseLabel
GET/gmail/v1/users/{userId}/labels/{id}
Parameters
NameInRequiredType
userIdpathyesstring
idpathyesstring
Responses
StatusDescriptionSchema
200Successful responseLabel
PUT/gmail/v1/users/{userId}/labels/{id}
Parameters
NameInRequiredType
userIdpathyesstring
idpathyesstring
Request body

application/jsonLabel

Responses
StatusDescriptionSchema
200Successful responseLabel
PATCH/gmail/v1/users/{userId}/labels/{id}
Parameters
NameInRequiredType
userIdpathyesstring
idpathyesstring
Request body

application/jsonLabel

Responses
StatusDescriptionSchema
200Successful responseLabel
DELETE/gmail/v1/users/{userId}/labels/{id}
Parameters
NameInRequiredType
userIdpathyesstring
idpathyesstring
Responses
StatusDescriptionSchema
200Successful response
GET/gmail/v1/users/{userId}/messages
Parameters
NameInRequiredType
userIdpathyesstring
includeSpamTrashquerynoboolean
labelIdsquerynoarray
maxResultsquerynointeger
pageTokenquerynostring
qquerynostring
Responses
StatusDescriptionSchema
200Successful responseListMessagesResponse
POST/gmail/v1/users/{userId}/messages
Parameters
NameInRequiredType
userIdpathyesstring
deletedquerynoboolean
internalDateSourcequerynostring
Request body

message/cpimMessage

Responses
StatusDescriptionSchema
200Successful responseMessage
POST/gmail/v1/users/{userId}/messages/batchDelete
Parameters
NameInRequiredType
userIdpathyesstring
Request body

application/jsonBatchDeleteMessagesRequest

Responses
StatusDescriptionSchema
200Successful response
POST/gmail/v1/users/{userId}/messages/batchModify
Parameters
NameInRequiredType
userIdpathyesstring
Request body

application/jsonBatchModifyMessagesRequest

Responses
StatusDescriptionSchema
200Successful response
POST/gmail/v1/users/{userId}/messages/import
Parameters
NameInRequiredType
userIdpathyesstring
deletedquerynoboolean
internalDateSourcequerynostring
neverMarkSpamquerynoboolean
processForCalendarquerynoboolean
Request body

message/cpimMessage

Responses
StatusDescriptionSchema
200Successful responseMessage
POST/gmail/v1/users/{userId}/messages/send
Parameters
NameInRequiredType
userIdpathyesstring
Request body

message/cpimMessage

Responses
StatusDescriptionSchema
200Successful responseMessage
GET/gmail/v1/users/{userId}/messages/{id}
Parameters
NameInRequiredType
userIdpathyesstring
idpathyesstring
formatquerynostring
metadataHeadersquerynoarray
Responses
StatusDescriptionSchema
200Successful responseMessage
DELETE/gmail/v1/users/{userId}/messages/{id}
Parameters
NameInRequiredType
userIdpathyesstring
idpathyesstring
Responses
StatusDescriptionSchema
200Successful response
POST/gmail/v1/users/{userId}/messages/{id}/modify
Parameters
NameInRequiredType
userIdpathyesstring
idpathyesstring
Request body

application/jsonModifyMessageRequest

Responses
StatusDescriptionSchema
200Successful responseMessage
POST/gmail/v1/users/{userId}/messages/{id}/trash
Parameters
NameInRequiredType
userIdpathyesstring
idpathyesstring
Responses
StatusDescriptionSchema
200Successful responseMessage
POST/gmail/v1/users/{userId}/messages/{id}/untrash
Parameters
NameInRequiredType
userIdpathyesstring
idpathyesstring
Responses
StatusDescriptionSchema
200Successful responseMessage
GET/gmail/v1/users/{userId}/messages/{messageId}/attachments/{id}
Parameters
NameInRequiredType
userIdpathyesstring
messageIdpathyesstring
idpathyesstring
Responses
StatusDescriptionSchema
200Successful responseMessagePartBody
GET/gmail/v1/users/{userId}/profile
Parameters
NameInRequiredType
userIdpathyesstring
Responses
StatusDescriptionSchema
200Successful responseProfile
GET/gmail/v1/users/{userId}/settings/autoForwarding
Parameters
NameInRequiredType
userIdpathyesstring
Responses
StatusDescriptionSchema
200Successful responseAutoForwarding
PUT/gmail/v1/users/{userId}/settings/autoForwarding
Parameters
NameInRequiredType
userIdpathyesstring
Request body

application/jsonAutoForwarding

Responses
StatusDescriptionSchema
200Successful responseAutoForwarding
GET/gmail/v1/users/{userId}/settings/cse/identities
Parameters
NameInRequiredType
userIdpathyesstring
pageSizequerynointeger
pageTokenquerynostring
Responses
StatusDescriptionSchema
200Successful responseListCseIdentitiesResponse
POST/gmail/v1/users/{userId}/settings/cse/identities
Parameters
NameInRequiredType
userIdpathyesstring
Request body

application/jsonCseIdentity

Responses
StatusDescriptionSchema
200Successful responseCseIdentity
GET/gmail/v1/users/{userId}/settings/cse/identities/{cseEmailAddress}
Parameters
NameInRequiredType
userIdpathyesstring
cseEmailAddresspathyesstring
Responses
StatusDescriptionSchema
200Successful responseCseIdentity
DELETE/gmail/v1/users/{userId}/settings/cse/identities/{cseEmailAddress}
Parameters
NameInRequiredType
userIdpathyesstring
cseEmailAddresspathyesstring
Responses
StatusDescriptionSchema
200Successful response
PATCH/gmail/v1/users/{userId}/settings/cse/identities/{emailAddress}
Parameters
NameInRequiredType
userIdpathyesstring
emailAddresspathyesstring
Request body

application/jsonCseIdentity

Responses
StatusDescriptionSchema
200Successful responseCseIdentity
GET/gmail/v1/users/{userId}/settings/cse/keypairs
Parameters
NameInRequiredType
userIdpathyesstring
pageSizequerynointeger
pageTokenquerynostring
Responses
StatusDescriptionSchema
200Successful responseListCseKeyPairsResponse
POST/gmail/v1/users/{userId}/settings/cse/keypairs
Parameters
NameInRequiredType
userIdpathyesstring
Request body

application/jsonCseKeyPair

Responses
StatusDescriptionSchema
200Successful responseCseKeyPair
GET/gmail/v1/users/{userId}/settings/cse/keypairs/{keyPairId}
Parameters
NameInRequiredType
userIdpathyesstring
keyPairIdpathyesstring
Responses
StatusDescriptionSchema
200Successful responseCseKeyPair
POST/gmail/v1/users/{userId}/settings/cse/keypairs/{keyPairId}:disable
Parameters
NameInRequiredType
userIdpathyesstring
keyPairIdpathyesstring
Request body

application/jsonDisableCseKeyPairRequest

Responses
StatusDescriptionSchema
200Successful responseCseKeyPair
POST/gmail/v1/users/{userId}/settings/cse/keypairs/{keyPairId}:enable
Parameters
NameInRequiredType
userIdpathyesstring
keyPairIdpathyesstring
Request body

application/jsonEnableCseKeyPairRequest

Responses
StatusDescriptionSchema
200Successful responseCseKeyPair
POST/gmail/v1/users/{userId}/settings/cse/keypairs/{keyPairId}:obliterate
Parameters
NameInRequiredType
userIdpathyesstring
keyPairIdpathyesstring
Request body

application/jsonObliterateCseKeyPairRequest

Responses
StatusDescriptionSchema
200Successful response
GET/gmail/v1/users/{userId}/settings/delegates
Parameters
NameInRequiredType
userIdpathyesstring
Responses
StatusDescriptionSchema
200Successful responseListDelegatesResponse
POST/gmail/v1/users/{userId}/settings/delegates
Parameters
NameInRequiredType
userIdpathyesstring
Request body

application/jsonDelegate

Responses
StatusDescriptionSchema
200Successful responseDelegate
GET/gmail/v1/users/{userId}/settings/delegates/{delegateEmail}
Parameters
NameInRequiredType
userIdpathyesstring
delegateEmailpathyesstring
Responses
StatusDescriptionSchema
200Successful responseDelegate
DELETE/gmail/v1/users/{userId}/settings/delegates/{delegateEmail}
Parameters
NameInRequiredType
userIdpathyesstring
delegateEmailpathyesstring
Responses
StatusDescriptionSchema
200Successful response
GET/gmail/v1/users/{userId}/settings/filters
Parameters
NameInRequiredType
userIdpathyesstring
Responses
StatusDescriptionSchema
200Successful responseListFiltersResponse
POST/gmail/v1/users/{userId}/settings/filters
Parameters
NameInRequiredType
userIdpathyesstring
Request body

application/jsonFilter

Responses
StatusDescriptionSchema
200Successful responseFilter
GET/gmail/v1/users/{userId}/settings/filters/{id}
Parameters
NameInRequiredType
userIdpathyesstring
idpathyesstring
Responses
StatusDescriptionSchema
200Successful responseFilter
DELETE/gmail/v1/users/{userId}/settings/filters/{id}
Parameters
NameInRequiredType
userIdpathyesstring
idpathyesstring
Responses
StatusDescriptionSchema
200Successful response
GET/gmail/v1/users/{userId}/settings/forwardingAddresses
Parameters
NameInRequiredType
userIdpathyesstring
Responses
StatusDescriptionSchema
200Successful responseListForwardingAddressesResponse
POST/gmail/v1/users/{userId}/settings/forwardingAddresses
Parameters
NameInRequiredType
userIdpathyesstring
Request body

application/jsonForwardingAddress

Responses
StatusDescriptionSchema
200Successful responseForwardingAddress
GET/gmail/v1/users/{userId}/settings/forwardingAddresses/{forwardingEmail}
Parameters
NameInRequiredType
userIdpathyesstring
forwardingEmailpathyesstring
Responses
StatusDescriptionSchema
200Successful responseForwardingAddress
DELETE/gmail/v1/users/{userId}/settings/forwardingAddresses/{forwardingEmail}
Parameters
NameInRequiredType
userIdpathyesstring
forwardingEmailpathyesstring
Responses
StatusDescriptionSchema
200Successful response
GET/gmail/v1/users/{userId}/settings/imap
Parameters
NameInRequiredType
userIdpathyesstring
Responses
StatusDescriptionSchema
200Successful responseImapSettings
PUT/gmail/v1/users/{userId}/settings/imap
Parameters
NameInRequiredType
userIdpathyesstring
Request body

application/jsonImapSettings

Responses
StatusDescriptionSchema
200Successful responseImapSettings
GET/gmail/v1/users/{userId}/settings/language
Parameters
NameInRequiredType
userIdpathyesstring
Responses
StatusDescriptionSchema
200Successful responseLanguageSettings
PUT/gmail/v1/users/{userId}/settings/language
Parameters
NameInRequiredType
userIdpathyesstring
Request body

application/jsonLanguageSettings

Responses
StatusDescriptionSchema
200Successful responseLanguageSettings
GET/gmail/v1/users/{userId}/settings/pop
Parameters
NameInRequiredType
userIdpathyesstring
Responses
StatusDescriptionSchema
200Successful responsePopSettings
PUT/gmail/v1/users/{userId}/settings/pop
Parameters
NameInRequiredType
userIdpathyesstring
Request body

application/jsonPopSettings

Responses
StatusDescriptionSchema
200Successful responsePopSettings
GET/gmail/v1/users/{userId}/settings/sendAs
Parameters
NameInRequiredType
userIdpathyesstring
Responses
StatusDescriptionSchema
200Successful responseListSendAsResponse
POST/gmail/v1/users/{userId}/settings/sendAs
Parameters
NameInRequiredType
userIdpathyesstring
Request body

application/jsonSendAs

Responses
StatusDescriptionSchema
200Successful responseSendAs
GET/gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}
Parameters
NameInRequiredType
userIdpathyesstring
sendAsEmailpathyesstring
Responses
StatusDescriptionSchema
200Successful responseSendAs
PUT/gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}
Parameters
NameInRequiredType
userIdpathyesstring
sendAsEmailpathyesstring
Request body

application/jsonSendAs

Responses
StatusDescriptionSchema
200Successful responseSendAs
PATCH/gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}
Parameters
NameInRequiredType
userIdpathyesstring
sendAsEmailpathyesstring
Request body

application/jsonSendAs

Responses
StatusDescriptionSchema
200Successful responseSendAs
DELETE/gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}
Parameters
NameInRequiredType
userIdpathyesstring
sendAsEmailpathyesstring
Responses
StatusDescriptionSchema
200Successful response
GET/gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}/smimeInfo
Parameters
NameInRequiredType
userIdpathyesstring
sendAsEmailpathyesstring
Responses
StatusDescriptionSchema
200Successful responseListSmimeInfoResponse
POST/gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}/smimeInfo
Parameters
NameInRequiredType
userIdpathyesstring
sendAsEmailpathyesstring
Request body

application/jsonSmimeInfo

Responses
StatusDescriptionSchema
200Successful responseSmimeInfo
GET/gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}/smimeInfo/{id}
Parameters
NameInRequiredType
userIdpathyesstring
sendAsEmailpathyesstring
idpathyesstring
Responses
StatusDescriptionSchema
200Successful responseSmimeInfo
DELETE/gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}/smimeInfo/{id}
Parameters
NameInRequiredType
userIdpathyesstring
sendAsEmailpathyesstring
idpathyesstring
Responses
StatusDescriptionSchema
200Successful response
POST/gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}/smimeInfo/{id}/setDefault
Parameters
NameInRequiredType
userIdpathyesstring
sendAsEmailpathyesstring
idpathyesstring
Responses
StatusDescriptionSchema
200Successful response
POST/gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}/verify
Parameters
NameInRequiredType
userIdpathyesstring
sendAsEmailpathyesstring
Responses
StatusDescriptionSchema
200Successful response
GET/gmail/v1/users/{userId}/settings/vacation
Parameters
NameInRequiredType
userIdpathyesstring
Responses
StatusDescriptionSchema
200Successful responseVacationSettings
PUT/gmail/v1/users/{userId}/settings/vacation
Parameters
NameInRequiredType
userIdpathyesstring
Request body

application/jsonVacationSettings

Responses
StatusDescriptionSchema
200Successful responseVacationSettings
POST/gmail/v1/users/{userId}/stop
Parameters
NameInRequiredType
userIdpathyesstring
Responses
StatusDescriptionSchema
200Successful response
GET/gmail/v1/users/{userId}/threads
Parameters
NameInRequiredType
userIdpathyesstring
includeSpamTrashquerynoboolean
labelIdsquerynoarray
maxResultsquerynointeger
pageTokenquerynostring
qquerynostring
Responses
StatusDescriptionSchema
200Successful responseListThreadsResponse
GET/gmail/v1/users/{userId}/threads/{id}
Parameters
NameInRequiredType
userIdpathyesstring
idpathyesstring
formatquerynostring
metadataHeadersquerynoarray
Responses
StatusDescriptionSchema
200Successful responseThread
DELETE/gmail/v1/users/{userId}/threads/{id}
Parameters
NameInRequiredType
userIdpathyesstring
idpathyesstring
Responses
StatusDescriptionSchema
200Successful response
POST/gmail/v1/users/{userId}/threads/{id}/modify
Parameters
NameInRequiredType
userIdpathyesstring
idpathyesstring
Request body

application/jsonModifyThreadRequest

Responses
StatusDescriptionSchema
200Successful responseThread
POST/gmail/v1/users/{userId}/threads/{id}/trash
Parameters
NameInRequiredType
userIdpathyesstring
idpathyesstring
Responses
StatusDescriptionSchema
200Successful responseThread
POST/gmail/v1/users/{userId}/threads/{id}/untrash
Parameters
NameInRequiredType
userIdpathyesstring
idpathyesstring
Responses
StatusDescriptionSchema
200Successful responseThread
POST/gmail/v1/users/{userId}/watch
Parameters
NameInRequiredType
userIdpathyesstring
Request body

application/jsonWatchRequest

Responses
StatusDescriptionSchema
200Successful responseWatchResponse

Try it

Developer reference

Base URLhttps://gmail.googleapis.com
Rate limit

Google's Gmail API usage-limits docs (developers.google.com/workspace/gmail/api/reference/quota) publish a per-user-per-minute quota-unit model rather than flat request counts: each project gets 1,200,000 quota units/minute, and each user within it 6,000 quota units/minute, with individual methods costing a fixed number of units (messages.list is 5, messages.get is 20, messages.send is 100). Exceeding a limit returns a 403 with reason rateLimitExceeded/userRateLimitExceeded (or a 429 for daily/bandwidth/concurrency caps), and Google recommends truncated exponential backoff before retrying. Standard use remains free; Google's docs note billing on quota overage is planned to start later in 2026.

Key endpoints
  • GET/gmail/v1/users/{userId}/profile
  • GET/gmail/v1/users/{userId}/messages
  • GET/gmail/v1/users/{userId}/messages/{id}
  • POST/gmail/v1/users/{userId}/messages/send
  • GET/gmail/v1/users/{userId}/labels