The Gmail API lets you view and manage Gmail mailbox data like threads, messages, and labels.
- REST Resource: v1.users
- REST Resource: v1.users.drafts
- REST Resource: v1.users.history
- REST Resource: v1.users.labels
- REST Resource: v1.users.messages
- REST Resource: v1.users.messages.attachments
- REST Resource: v1.users.settings
- REST Resource: v1.users.settings.cse.identities
- REST Resource: v1.users.settings.cse.keypairs
- REST Resource: v1.users.settings.delegates
- REST Resource: v1.users.settings.filters
- REST Resource: v1.users.settings.forwardingAddresses
- REST Resource: v1.users.settings.sendAs
- REST Resource: v1.users.settings.sendAs.smimeInfo
- REST Resource: v1.users.threads
Service: gmail.googleapis.com
To call this service, we recommend that you use the Google-provided client libraries. If your application needs to use your own libraries to call this service, use the following information when you make the API requests.
Discovery document
A Discovery Document is a machine-readable specification for describing and consuming REST APIs. It is used to build client libraries, IDE plugins, and other tools that interact with Google APIs. One service may provide multiple discovery documents. This service provides the following discovery document:
Service endpoint
A service endpoint is a base URL that specifies the network address of an API service. One service might have multiple service endpoints. This service has the following service endpoint and all URIs below are relative to this service endpoint:
- https://gmail.googleapis.com
REST Resource: v1.users
| Methods | |
|---|---|
| getProfile | GET /gmail/v1/users/{userId}/profileGets the current user's Gmail profile. | 
| stop | POST /gmail/v1/users/{userId}/stopStop receiving push notifications for the given user mailbox. | 
| watch | POST /gmail/v1/users/{userId}/watchSet up or update a push notification watch on the given user mailbox. | 
REST Resource: v1.users.drafts
| Methods | |
|---|---|
| create | POST /gmail/v1/users/{userId}/draftsPOST /upload/gmail/v1/users/{userId}/draftsCreates a new draft with the DRAFTlabel. | 
| delete | DELETE /gmail/v1/users/{userId}/drafts/{id}Immediately and permanently deletes the specified draft. | 
| get | GET /gmail/v1/users/{userId}/drafts/{id}Gets the specified draft. | 
| list | GET /gmail/v1/users/{userId}/draftsLists the drafts in the user's mailbox. | 
| send | POST /gmail/v1/users/{userId}/drafts/sendPOST /upload/gmail/v1/users/{userId}/drafts/sendSends the specified, existing draft to the recipients in the To,Cc, andBccheaders. | 
| update | PUT /gmail/v1/users/{userId}/drafts/{id}PUT /upload/gmail/v1/users/{userId}/drafts/{id}Replaces a draft's content. | 
REST Resource: v1.users.history
| Methods | |
|---|---|
| list | GET /gmail/v1/users/{userId}/historyLists the history of all changes to the given mailbox. | 
REST Resource: v1.users.labels
| Methods | |
|---|---|
| create | POST /gmail/v1/users/{userId}/labelsCreates a new label. | 
| delete | DELETE /gmail/v1/users/{userId}/labels/{id}Immediately and permanently deletes the specified label and removes it from any messages and threads that it is applied to. | 
| get | GET /gmail/v1/users/{userId}/labels/{id}Gets the specified label. | 
| list | GET /gmail/v1/users/{userId}/labelsLists all labels in the user's mailbox. | 
| patch | PATCH /gmail/v1/users/{userId}/labels/{id}Patch the specified label. | 
| update | PUT /gmail/v1/users/{userId}/labels/{id}Updates the specified label. | 
REST Resource: v1.users.messages
| Methods | |
|---|---|
| batchDelete | POST /gmail/v1/users/{userId}/messages/batchDeleteDeletes many messages by message ID. | 
| batchModify | POST /gmail/v1/users/{userId}/messages/batchModifyModifies the labels on the specified messages. | 
| delete | DELETE /gmail/v1/users/{userId}/messages/{id}Immediately and permanently deletes the specified message. | 
| get | GET /gmail/v1/users/{userId}/messages/{id}Gets the specified message. | 
| import | POST /gmail/v1/users/{userId}/messages/importPOST /upload/gmail/v1/users/{userId}/messages/importImports a message into only this user's mailbox, with standard email delivery scanning and classification similar to receiving via SMTP. | 
| insert | POST /gmail/v1/users/{userId}/messagesPOST /upload/gmail/v1/users/{userId}/messagesDirectly inserts a message into only this user's mailbox similar to IMAP APPEND, bypassing most scanning and classification. | 
| list | GET /gmail/v1/users/{userId}/messagesLists the messages in the user's mailbox. | 
| modify | POST /gmail/v1/users/{userId}/messages/{id}/modifyModifies the labels on the specified message. | 
| send | POST /gmail/v1/users/{userId}/messages/sendPOST /upload/gmail/v1/users/{userId}/messages/sendSends the specified message to the recipients in the To,Cc, andBccheaders. | 
| trash | POST /gmail/v1/users/{userId}/messages/{id}/trashMoves the specified message to the trash. | 
| untrash | POST /gmail/v1/users/{userId}/messages/{id}/untrashRemoves the specified message from the trash. | 
REST Resource: v1.users.messages.attachments
| Methods | |
|---|---|
| get | GET /gmail/v1/users/{userId}/messages/{messageId}/attachments/{id}Gets the specified message attachment. | 
REST Resource: v1.users.settings
| Methods | |
|---|---|
| getAutoForwarding | GET /gmail/v1/users/{userId}/settings/autoForwardingGets the auto-forwarding setting for the specified account. | 
| getImap | GET /gmail/v1/users/{userId}/settings/imapGets IMAP settings. | 
| getLanguage | GET /gmail/v1/users/{userId}/settings/languageGets language settings. | 
| getPop | GET /gmail/v1/users/{userId}/settings/popGets POP settings. | 
| getVacation | GET /gmail/v1/users/{userId}/settings/vacationGets vacation responder settings. | 
| updateAutoForwarding | PUT /gmail/v1/users/{userId}/settings/autoForwardingUpdates the auto-forwarding setting for the specified account. | 
| updateImap | PUT /gmail/v1/users/{userId}/settings/imapUpdates IMAP settings. | 
| updateLanguage | PUT /gmail/v1/users/{userId}/settings/languageUpdates language settings. | 
| updatePop | PUT /gmail/v1/users/{userId}/settings/popUpdates POP settings. | 
| updateVacation | PUT /gmail/v1/users/{userId}/settings/vacationUpdates vacation responder settings. | 
REST Resource: v1.users.settings.cse.identities
| Methods | |
|---|---|
| create | POST /gmail/v1/users/{userId}/settings/cse/identitiesCreates and configures a client-side encryption identity that's authorized to send mail from the user account. | 
| delete | DELETE /gmail/v1/users/{userId}/settings/cse/identities/{cseEmailAddress}Deletes a client-side encryption identity. | 
| get | GET /gmail/v1/users/{userId}/settings/cse/identities/{cseEmailAddress}Retrieves a client-side encryption identity configuration. | 
| list | GET /gmail/v1/users/{userId}/settings/cse/identitiesLists the client-side encrypted identities for an authenticated user. | 
| patch | PATCH /gmail/v1/users/{userId}/settings/cse/identities/{emailAddress}Associates a different key pair with an existing client-side encryption identity. | 
REST Resource: v1.users.settings.cse.keypairs
| Methods | |
|---|---|
| create | POST /gmail/v1/users/{userId}/settings/cse/keypairsCreates and uploads a client-side encryption S/MIME public key certificate chain and private key metadata for the authenticated user. | 
| disable | POST /gmail/v1/users/{userId}/settings/cse/keypairs/{keyPairId}:disableTurns off a client-side encryption key pair. | 
| enable | POST /gmail/v1/users/{userId}/settings/cse/keypairs/{keyPairId}:enableTurns on a client-side encryption key pair that was turned off. | 
| get | GET /gmail/v1/users/{userId}/settings/cse/keypairs/{keyPairId}Retrieves an existing client-side encryption key pair. | 
| list | GET /gmail/v1/users/{userId}/settings/cse/keypairsLists client-side encryption key pairs for an authenticated user. | 
| obliterate | POST /gmail/v1/users/{userId}/settings/cse/keypairs/{keyPairId}:obliterateDeletes a client-side encryption key pair permanently and immediately. | 
REST Resource: v1.users.settings.delegates
| Methods | |
|---|---|
| create | POST /gmail/v1/users/{userId}/settings/delegatesAdds a delegate with its verification status set directly to accepted, without sending any verification email. | 
| delete | DELETE /gmail/v1/users/{userId}/settings/delegates/{delegateEmail}Removes the specified delegate (which can be of any verification status), and revokes any verification that may have been required for using it. | 
| get | GET /gmail/v1/users/{userId}/settings/delegates/{delegateEmail}Gets the specified delegate. | 
| list | GET /gmail/v1/users/{userId}/settings/delegatesLists the delegates for the specified account. | 
REST Resource: v1.users.settings.filters
| Methods | |
|---|---|
| create | POST /gmail/v1/users/{userId}/settings/filtersCreates a filter. | 
| delete | DELETE /gmail/v1/users/{userId}/settings/filters/{id}Immediately and permanently deletes the specified filter. | 
| get | GET /gmail/v1/users/{userId}/settings/filters/{id}Gets a filter. | 
| list | GET /gmail/v1/users/{userId}/settings/filtersLists the message filters of a Gmail user. | 
REST Resource: v1.users.settings.forwardingAddresses
| Methods | |
|---|---|
| create | POST /gmail/v1/users/{userId}/settings/forwardingAddressesCreates a forwarding address. | 
| delete | DELETE /gmail/v1/users/{userId}/settings/forwardingAddresses/{forwardingEmail}Deletes the specified forwarding address and revokes any verification that may have been required. | 
| get | GET /gmail/v1/users/{userId}/settings/forwardingAddresses/{forwardingEmail}Gets the specified forwarding address. | 
| list | GET /gmail/v1/users/{userId}/settings/forwardingAddressesLists the forwarding addresses for the specified account. | 
REST Resource: v1.users.settings.sendAs
| Methods | |
|---|---|
| create | POST /gmail/v1/users/{userId}/settings/sendAsCreates a custom "from" send-as alias. | 
| delete | DELETE /gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}Deletes the specified send-as alias. | 
| get | GET /gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}Gets the specified send-as alias. | 
| list | GET /gmail/v1/users/{userId}/settings/sendAsLists the send-as aliases for the specified account. | 
| patch | PATCH /gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}Patch the specified send-as alias. | 
| update | PUT /gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}Updates a send-as alias. | 
| verify | POST /gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}/verifySends a verification email to the specified send-as alias address. | 
REST Resource: v1.users.settings.sendAs.smimeInfo
| Methods | |
|---|---|
| delete | DELETE /gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}/smimeInfo/{id}Deletes the specified S/MIME config for the specified send-as alias. | 
| get | GET /gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}/smimeInfo/{id}Gets the specified S/MIME config for the specified send-as alias. | 
| insert | POST /gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}/smimeInfoInsert (upload) the given S/MIME config for the specified send-as alias. | 
| list | GET /gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}/smimeInfoLists S/MIME configs for the specified send-as alias. | 
| setDefault | POST /gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}/smimeInfo/{id}/setDefaultSets the default S/MIME config for the specified send-as alias. | 
REST Resource: v1.users.threads
| Methods | |
|---|---|
| delete | DELETE /gmail/v1/users/{userId}/threads/{id}Immediately and permanently deletes the specified thread. | 
| get | GET /gmail/v1/users/{userId}/threads/{id}Gets the specified thread. | 
| list | GET /gmail/v1/users/{userId}/threadsLists the threads in the user's mailbox. | 
| modify | POST /gmail/v1/users/{userId}/threads/{id}/modifyModifies the labels applied to the thread. | 
| trash | POST /gmail/v1/users/{userId}/threads/{id}/trashMoves the specified thread to the trash. | 
| untrash | POST /gmail/v1/users/{userId}/threads/{id}/untrashRemoves the specified thread from the trash. |