Business — entry 005 of 19
Gmail
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.
GreatAPIs Score
Auth quickstart
- Register an app / run the OAuth flow to obtain a bearer token.
- Send it as an Authorization header
Authorization: Bearer <token>
Your key is stored only in this browser (localStorage) and sent directly to the API — never to greatapis.
Endpoints
users79
GET/gmail/v1/users/{userId}/drafts
| Name | In | Required | Type |
|---|---|---|---|
userId | path | yes | string |
includeSpamTrash | query | no | boolean |
maxResults | query | no | integer |
pageToken | query | no | string |
q | query | no | string |
| Status | Description | Schema |
|---|---|---|
200 | Successful response | ListDraftsResponse |
POST/gmail/v1/users/{userId}/drafts
| Name | In | Required | Type |
|---|---|---|---|
userId | path | yes | string |
message/cpim — Draft
| Status | Description | Schema |
|---|---|---|
200 | Successful response | Draft |
POST/gmail/v1/users/{userId}/drafts/send
| Name | In | Required | Type |
|---|---|---|---|
userId | path | yes | string |
message/cpim — Draft
| Status | Description | Schema |
|---|---|---|
200 | Successful response | Message |
GET/gmail/v1/users/{userId}/drafts/{id}
| Name | In | Required | Type |
|---|---|---|---|
userId | path | yes | string |
id | path | yes | string |
format | query | no | string |
| Status | Description | Schema |
|---|---|---|
200 | Successful response | Draft |
PUT/gmail/v1/users/{userId}/drafts/{id}
| Name | In | Required | Type |
|---|---|---|---|
userId | path | yes | string |
id | path | yes | string |
message/cpim — Draft
| Status | Description | Schema |
|---|---|---|
200 | Successful response | Draft |
DELETE/gmail/v1/users/{userId}/drafts/{id}
| Name | In | Required | Type |
|---|---|---|---|
userId | path | yes | string |
id | path | yes | string |
| Status | Description | Schema |
|---|---|---|
200 | Successful response | — |
GET/gmail/v1/users/{userId}/history
| Name | In | Required | Type |
|---|---|---|---|
userId | path | yes | string |
historyTypes | query | no | array |
labelId | query | no | string |
maxResults | query | no | integer |
pageToken | query | no | string |
startHistoryId | query | no | string |
| Status | Description | Schema |
|---|---|---|
200 | Successful response | ListHistoryResponse |
GET/gmail/v1/users/{userId}/labels
| Name | In | Required | Type |
|---|---|---|---|
userId | path | yes | string |
| Status | Description | Schema |
|---|---|---|
200 | Successful response | ListLabelsResponse |
POST/gmail/v1/users/{userId}/labels
| Name | In | Required | Type |
|---|---|---|---|
userId | path | yes | string |
application/json — Label
| Status | Description | Schema |
|---|---|---|
200 | Successful response | Label |
GET/gmail/v1/users/{userId}/labels/{id}
| Name | In | Required | Type |
|---|---|---|---|
userId | path | yes | string |
id | path | yes | string |
| Status | Description | Schema |
|---|---|---|
200 | Successful response | Label |
PUT/gmail/v1/users/{userId}/labels/{id}
| Name | In | Required | Type |
|---|---|---|---|
userId | path | yes | string |
id | path | yes | string |
application/json — Label
| Status | Description | Schema |
|---|---|---|
200 | Successful response | Label |
PATCH/gmail/v1/users/{userId}/labels/{id}
| Name | In | Required | Type |
|---|---|---|---|
userId | path | yes | string |
id | path | yes | string |
application/json — Label
| Status | Description | Schema |
|---|---|---|
200 | Successful response | Label |
DELETE/gmail/v1/users/{userId}/labels/{id}
| Name | In | Required | Type |
|---|---|---|---|
userId | path | yes | string |
id | path | yes | string |
| Status | Description | Schema |
|---|---|---|
200 | Successful response | — |
GET/gmail/v1/users/{userId}/messages
| Name | In | Required | Type |
|---|---|---|---|
userId | path | yes | string |
includeSpamTrash | query | no | boolean |
labelIds | query | no | array |
maxResults | query | no | integer |
pageToken | query | no | string |
q | query | no | string |
| Status | Description | Schema |
|---|---|---|
200 | Successful response | ListMessagesResponse |
POST/gmail/v1/users/{userId}/messages
| Name | In | Required | Type |
|---|---|---|---|
userId | path | yes | string |
deleted | query | no | boolean |
internalDateSource | query | no | string |
message/cpim — Message
| Status | Description | Schema |
|---|---|---|
200 | Successful response | Message |
POST/gmail/v1/users/{userId}/messages/batchDelete
| Name | In | Required | Type |
|---|---|---|---|
userId | path | yes | string |
application/json — BatchDeleteMessagesRequest
| Status | Description | Schema |
|---|---|---|
200 | Successful response | — |
POST/gmail/v1/users/{userId}/messages/batchModify
| Name | In | Required | Type |
|---|---|---|---|
userId | path | yes | string |
application/json — BatchModifyMessagesRequest
| Status | Description | Schema |
|---|---|---|
200 | Successful response | — |
POST/gmail/v1/users/{userId}/messages/import
| Name | In | Required | Type |
|---|---|---|---|
userId | path | yes | string |
deleted | query | no | boolean |
internalDateSource | query | no | string |
neverMarkSpam | query | no | boolean |
processForCalendar | query | no | boolean |
message/cpim — Message
| Status | Description | Schema |
|---|---|---|
200 | Successful response | Message |
POST/gmail/v1/users/{userId}/messages/send
| Name | In | Required | Type |
|---|---|---|---|
userId | path | yes | string |
message/cpim — Message
| Status | Description | Schema |
|---|---|---|
200 | Successful response | Message |
GET/gmail/v1/users/{userId}/messages/{id}
| Name | In | Required | Type |
|---|---|---|---|
userId | path | yes | string |
id | path | yes | string |
format | query | no | string |
metadataHeaders | query | no | array |
| Status | Description | Schema |
|---|---|---|
200 | Successful response | Message |
DELETE/gmail/v1/users/{userId}/messages/{id}
| Name | In | Required | Type |
|---|---|---|---|
userId | path | yes | string |
id | path | yes | string |
| Status | Description | Schema |
|---|---|---|
200 | Successful response | — |
POST/gmail/v1/users/{userId}/messages/{id}/modify
| Name | In | Required | Type |
|---|---|---|---|
userId | path | yes | string |
id | path | yes | string |
application/json — ModifyMessageRequest
| Status | Description | Schema |
|---|---|---|
200 | Successful response | Message |
POST/gmail/v1/users/{userId}/messages/{id}/trash
| Name | In | Required | Type |
|---|---|---|---|
userId | path | yes | string |
id | path | yes | string |
| Status | Description | Schema |
|---|---|---|
200 | Successful response | Message |
POST/gmail/v1/users/{userId}/messages/{id}/untrash
| Name | In | Required | Type |
|---|---|---|---|
userId | path | yes | string |
id | path | yes | string |
| Status | Description | Schema |
|---|---|---|
200 | Successful response | Message |
GET/gmail/v1/users/{userId}/messages/{messageId}/attachments/{id}
| Name | In | Required | Type |
|---|---|---|---|
userId | path | yes | string |
messageId | path | yes | string |
id | path | yes | string |
| Status | Description | Schema |
|---|---|---|
200 | Successful response | MessagePartBody |
GET/gmail/v1/users/{userId}/profile
| Name | In | Required | Type |
|---|---|---|---|
userId | path | yes | string |
| Status | Description | Schema |
|---|---|---|
200 | Successful response | Profile |
GET/gmail/v1/users/{userId}/settings/autoForwarding
| Name | In | Required | Type |
|---|---|---|---|
userId | path | yes | string |
| Status | Description | Schema |
|---|---|---|
200 | Successful response | AutoForwarding |
PUT/gmail/v1/users/{userId}/settings/autoForwarding
| Name | In | Required | Type |
|---|---|---|---|
userId | path | yes | string |
application/json — AutoForwarding
| Status | Description | Schema |
|---|---|---|
200 | Successful response | AutoForwarding |
GET/gmail/v1/users/{userId}/settings/cse/identities
| Name | In | Required | Type |
|---|---|---|---|
userId | path | yes | string |
pageSize | query | no | integer |
pageToken | query | no | string |
| Status | Description | Schema |
|---|---|---|
200 | Successful response | ListCseIdentitiesResponse |
POST/gmail/v1/users/{userId}/settings/cse/identities
| Name | In | Required | Type |
|---|---|---|---|
userId | path | yes | string |
application/json — CseIdentity
| Status | Description | Schema |
|---|---|---|
200 | Successful response | CseIdentity |
GET/gmail/v1/users/{userId}/settings/cse/identities/{cseEmailAddress}
| Name | In | Required | Type |
|---|---|---|---|
userId | path | yes | string |
cseEmailAddress | path | yes | string |
| Status | Description | Schema |
|---|---|---|
200 | Successful response | CseIdentity |
DELETE/gmail/v1/users/{userId}/settings/cse/identities/{cseEmailAddress}
| Name | In | Required | Type |
|---|---|---|---|
userId | path | yes | string |
cseEmailAddress | path | yes | string |
| Status | Description | Schema |
|---|---|---|
200 | Successful response | — |
PATCH/gmail/v1/users/{userId}/settings/cse/identities/{emailAddress}
| Name | In | Required | Type |
|---|---|---|---|
userId | path | yes | string |
emailAddress | path | yes | string |
application/json — CseIdentity
| Status | Description | Schema |
|---|---|---|
200 | Successful response | CseIdentity |
GET/gmail/v1/users/{userId}/settings/cse/keypairs
| Name | In | Required | Type |
|---|---|---|---|
userId | path | yes | string |
pageSize | query | no | integer |
pageToken | query | no | string |
| Status | Description | Schema |
|---|---|---|
200 | Successful response | ListCseKeyPairsResponse |
POST/gmail/v1/users/{userId}/settings/cse/keypairs
| Name | In | Required | Type |
|---|---|---|---|
userId | path | yes | string |
application/json — CseKeyPair
| Status | Description | Schema |
|---|---|---|
200 | Successful response | CseKeyPair |
GET/gmail/v1/users/{userId}/settings/cse/keypairs/{keyPairId}
| Name | In | Required | Type |
|---|---|---|---|
userId | path | yes | string |
keyPairId | path | yes | string |
| Status | Description | Schema |
|---|---|---|
200 | Successful response | CseKeyPair |
POST/gmail/v1/users/{userId}/settings/cse/keypairs/{keyPairId}:disable
| Name | In | Required | Type |
|---|---|---|---|
userId | path | yes | string |
keyPairId | path | yes | string |
application/json — DisableCseKeyPairRequest
| Status | Description | Schema |
|---|---|---|
200 | Successful response | CseKeyPair |
POST/gmail/v1/users/{userId}/settings/cse/keypairs/{keyPairId}:enable
| Name | In | Required | Type |
|---|---|---|---|
userId | path | yes | string |
keyPairId | path | yes | string |
application/json — EnableCseKeyPairRequest
| Status | Description | Schema |
|---|---|---|
200 | Successful response | CseKeyPair |
POST/gmail/v1/users/{userId}/settings/cse/keypairs/{keyPairId}:obliterate
| Name | In | Required | Type |
|---|---|---|---|
userId | path | yes | string |
keyPairId | path | yes | string |
application/json — ObliterateCseKeyPairRequest
| Status | Description | Schema |
|---|---|---|
200 | Successful response | — |
GET/gmail/v1/users/{userId}/settings/delegates
| Name | In | Required | Type |
|---|---|---|---|
userId | path | yes | string |
| Status | Description | Schema |
|---|---|---|
200 | Successful response | ListDelegatesResponse |
POST/gmail/v1/users/{userId}/settings/delegates
| Name | In | Required | Type |
|---|---|---|---|
userId | path | yes | string |
application/json — Delegate
| Status | Description | Schema |
|---|---|---|
200 | Successful response | Delegate |
GET/gmail/v1/users/{userId}/settings/delegates/{delegateEmail}
| Name | In | Required | Type |
|---|---|---|---|
userId | path | yes | string |
delegateEmail | path | yes | string |
| Status | Description | Schema |
|---|---|---|
200 | Successful response | Delegate |
DELETE/gmail/v1/users/{userId}/settings/delegates/{delegateEmail}
| Name | In | Required | Type |
|---|---|---|---|
userId | path | yes | string |
delegateEmail | path | yes | string |
| Status | Description | Schema |
|---|---|---|
200 | Successful response | — |
GET/gmail/v1/users/{userId}/settings/filters
| Name | In | Required | Type |
|---|---|---|---|
userId | path | yes | string |
| Status | Description | Schema |
|---|---|---|
200 | Successful response | ListFiltersResponse |
POST/gmail/v1/users/{userId}/settings/filters
| Name | In | Required | Type |
|---|---|---|---|
userId | path | yes | string |
application/json — Filter
| Status | Description | Schema |
|---|---|---|
200 | Successful response | Filter |
GET/gmail/v1/users/{userId}/settings/filters/{id}
| Name | In | Required | Type |
|---|---|---|---|
userId | path | yes | string |
id | path | yes | string |
| Status | Description | Schema |
|---|---|---|
200 | Successful response | Filter |
DELETE/gmail/v1/users/{userId}/settings/filters/{id}
| Name | In | Required | Type |
|---|---|---|---|
userId | path | yes | string |
id | path | yes | string |
| Status | Description | Schema |
|---|---|---|
200 | Successful response | — |
GET/gmail/v1/users/{userId}/settings/forwardingAddresses
| Name | In | Required | Type |
|---|---|---|---|
userId | path | yes | string |
| Status | Description | Schema |
|---|---|---|
200 | Successful response | ListForwardingAddressesResponse |
POST/gmail/v1/users/{userId}/settings/forwardingAddresses
| Name | In | Required | Type |
|---|---|---|---|
userId | path | yes | string |
application/json — ForwardingAddress
| Status | Description | Schema |
|---|---|---|
200 | Successful response | ForwardingAddress |
GET/gmail/v1/users/{userId}/settings/forwardingAddresses/{forwardingEmail}
| Name | In | Required | Type |
|---|---|---|---|
userId | path | yes | string |
forwardingEmail | path | yes | string |
| Status | Description | Schema |
|---|---|---|
200 | Successful response | ForwardingAddress |
DELETE/gmail/v1/users/{userId}/settings/forwardingAddresses/{forwardingEmail}
| Name | In | Required | Type |
|---|---|---|---|
userId | path | yes | string |
forwardingEmail | path | yes | string |
| Status | Description | Schema |
|---|---|---|
200 | Successful response | — |
GET/gmail/v1/users/{userId}/settings/imap
| Name | In | Required | Type |
|---|---|---|---|
userId | path | yes | string |
| Status | Description | Schema |
|---|---|---|
200 | Successful response | ImapSettings |
PUT/gmail/v1/users/{userId}/settings/imap
| Name | In | Required | Type |
|---|---|---|---|
userId | path | yes | string |
application/json — ImapSettings
| Status | Description | Schema |
|---|---|---|
200 | Successful response | ImapSettings |
GET/gmail/v1/users/{userId}/settings/language
| Name | In | Required | Type |
|---|---|---|---|
userId | path | yes | string |
| Status | Description | Schema |
|---|---|---|
200 | Successful response | LanguageSettings |
PUT/gmail/v1/users/{userId}/settings/language
| Name | In | Required | Type |
|---|---|---|---|
userId | path | yes | string |
application/json — LanguageSettings
| Status | Description | Schema |
|---|---|---|
200 | Successful response | LanguageSettings |
GET/gmail/v1/users/{userId}/settings/pop
| Name | In | Required | Type |
|---|---|---|---|
userId | path | yes | string |
| Status | Description | Schema |
|---|---|---|
200 | Successful response | PopSettings |
PUT/gmail/v1/users/{userId}/settings/pop
| Name | In | Required | Type |
|---|---|---|---|
userId | path | yes | string |
application/json — PopSettings
| Status | Description | Schema |
|---|---|---|
200 | Successful response | PopSettings |
GET/gmail/v1/users/{userId}/settings/sendAs
| Name | In | Required | Type |
|---|---|---|---|
userId | path | yes | string |
| Status | Description | Schema |
|---|---|---|
200 | Successful response | ListSendAsResponse |
POST/gmail/v1/users/{userId}/settings/sendAs
| Name | In | Required | Type |
|---|---|---|---|
userId | path | yes | string |
application/json — SendAs
| Status | Description | Schema |
|---|---|---|
200 | Successful response | SendAs |
GET/gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}
| Name | In | Required | Type |
|---|---|---|---|
userId | path | yes | string |
sendAsEmail | path | yes | string |
| Status | Description | Schema |
|---|---|---|
200 | Successful response | SendAs |
PUT/gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}
| Name | In | Required | Type |
|---|---|---|---|
userId | path | yes | string |
sendAsEmail | path | yes | string |
application/json — SendAs
| Status | Description | Schema |
|---|---|---|
200 | Successful response | SendAs |
PATCH/gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}
| Name | In | Required | Type |
|---|---|---|---|
userId | path | yes | string |
sendAsEmail | path | yes | string |
application/json — SendAs
| Status | Description | Schema |
|---|---|---|
200 | Successful response | SendAs |
DELETE/gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}
| Name | In | Required | Type |
|---|---|---|---|
userId | path | yes | string |
sendAsEmail | path | yes | string |
| Status | Description | Schema |
|---|---|---|
200 | Successful response | — |
GET/gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}/smimeInfo
| Name | In | Required | Type |
|---|---|---|---|
userId | path | yes | string |
sendAsEmail | path | yes | string |
| Status | Description | Schema |
|---|---|---|
200 | Successful response | ListSmimeInfoResponse |
POST/gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}/smimeInfo
| Name | In | Required | Type |
|---|---|---|---|
userId | path | yes | string |
sendAsEmail | path | yes | string |
application/json — SmimeInfo
| Status | Description | Schema |
|---|---|---|
200 | Successful response | SmimeInfo |
GET/gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}/smimeInfo/{id}
| Name | In | Required | Type |
|---|---|---|---|
userId | path | yes | string |
sendAsEmail | path | yes | string |
id | path | yes | string |
| Status | Description | Schema |
|---|---|---|
200 | Successful response | SmimeInfo |
DELETE/gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}/smimeInfo/{id}
| Name | In | Required | Type |
|---|---|---|---|
userId | path | yes | string |
sendAsEmail | path | yes | string |
id | path | yes | string |
| Status | Description | Schema |
|---|---|---|
200 | Successful response | — |
POST/gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}/smimeInfo/{id}/setDefault
| Name | In | Required | Type |
|---|---|---|---|
userId | path | yes | string |
sendAsEmail | path | yes | string |
id | path | yes | string |
| Status | Description | Schema |
|---|---|---|
200 | Successful response | — |
POST/gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}/verify
| Name | In | Required | Type |
|---|---|---|---|
userId | path | yes | string |
sendAsEmail | path | yes | string |
| Status | Description | Schema |
|---|---|---|
200 | Successful response | — |
GET/gmail/v1/users/{userId}/settings/vacation
| Name | In | Required | Type |
|---|---|---|---|
userId | path | yes | string |
| Status | Description | Schema |
|---|---|---|
200 | Successful response | VacationSettings |
PUT/gmail/v1/users/{userId}/settings/vacation
| Name | In | Required | Type |
|---|---|---|---|
userId | path | yes | string |
application/json — VacationSettings
| Status | Description | Schema |
|---|---|---|
200 | Successful response | VacationSettings |
POST/gmail/v1/users/{userId}/stop
| Name | In | Required | Type |
|---|---|---|---|
userId | path | yes | string |
| Status | Description | Schema |
|---|---|---|
200 | Successful response | — |
GET/gmail/v1/users/{userId}/threads
| Name | In | Required | Type |
|---|---|---|---|
userId | path | yes | string |
includeSpamTrash | query | no | boolean |
labelIds | query | no | array |
maxResults | query | no | integer |
pageToken | query | no | string |
q | query | no | string |
| Status | Description | Schema |
|---|---|---|
200 | Successful response | ListThreadsResponse |
GET/gmail/v1/users/{userId}/threads/{id}
| Name | In | Required | Type |
|---|---|---|---|
userId | path | yes | string |
id | path | yes | string |
format | query | no | string |
metadataHeaders | query | no | array |
| Status | Description | Schema |
|---|---|---|
200 | Successful response | Thread |
DELETE/gmail/v1/users/{userId}/threads/{id}
| Name | In | Required | Type |
|---|---|---|---|
userId | path | yes | string |
id | path | yes | string |
| Status | Description | Schema |
|---|---|---|
200 | Successful response | — |
POST/gmail/v1/users/{userId}/threads/{id}/modify
| Name | In | Required | Type |
|---|---|---|---|
userId | path | yes | string |
id | path | yes | string |
application/json — ModifyThreadRequest
| Status | Description | Schema |
|---|---|---|
200 | Successful response | Thread |
POST/gmail/v1/users/{userId}/threads/{id}/trash
| Name | In | Required | Type |
|---|---|---|---|
userId | path | yes | string |
id | path | yes | string |
| Status | Description | Schema |
|---|---|---|
200 | Successful response | Thread |
POST/gmail/v1/users/{userId}/threads/{id}/untrash
| Name | In | Required | Type |
|---|---|---|---|
userId | path | yes | string |
id | path | yes | string |
| Status | Description | Schema |
|---|---|---|
200 | Successful response | Thread |
POST/gmail/v1/users/{userId}/watch
| Name | In | Required | Type |
|---|---|---|---|
userId | path | yes | string |
application/json — WatchRequest
| Status | Description | Schema |
|---|---|---|
200 | Successful response | WatchResponse |
Try it
Developer reference
https://gmail.googleapis.comGoogle'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.
- 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