Google Gmail Users API

The Users API from Google Gmail — 48 operation(s) for users.

GitHub OpenAPI
Pull this API's OpenAPI, operations, scores and pricing into your own code or AI agent with a free APIs.io key — sign in with GitHub, Google or LinkedIn. No form to fill in; signing in shares your email address with us (Privacy).
Business capability
Mailbox & Calendar Sync AE-150.80

Operations 79

Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay

POST /gmail/v1/users/{userId}/stop Stop push notifications for a mailbox · Stop users #
Ask an LLM
“How do I turn off push notifications for a user's mailbox?”
“Can I stop push delivery for one mailbox without affecting others?”
Tell an agent destructive · confirm first
Stop push notifications for mailbox {user}.
Turn off push delivery on {user}'s mailbox.
POST /gmail/v1/users/{userId}/watch Set up push notifications for a mailbox · Watch users #
Ask an LLM
“How do I get push notifications when a user's mailbox changes?”
“Can I restrict push notifications to certain labels?”
Tell an agent
Watch mailbox {user} for changes and send pushes to topic {topic}.
Set up push notifications on {user} for labels {labels}.
GET /gmail/v1/users/{userId}/profile Get a user's Gmail profile · Get profile users #
Ask an LLM
“What is the current user's Gmail profile?”
“Can I fetch my own Gmail profile details?”
Tell an agent
Get the Gmail profile for {user}.
Show my Gmail profile.
PUT /gmail/v1/users/{userId}/settings/imap Update IMAP settings · Update imap settings #
Ask an LLM
“How do I turn IMAP on or off for a user?”
“Can I change the expunge behavior on a mailbox's IMAP settings?”
Tell an agent
Set IMAP enabled to {enabled} for {user}.
Change the expunge behavior on {user}'s IMAP settings to {behavior}.
GET /gmail/v1/users/{userId}/settings/imap Get IMAP settings · Get imap settings #
Ask an LLM
“Are IMAP settings enabled for a user's account?”
“What IMAP settings does a mailbox have?”
Tell an agent
Get IMAP settings for {user}.
Show whether IMAP is on for {user}.
PUT /gmail/v1/users/{userId}/settings/vacation Update vacation responder settings · Update vacation settings #
Ask an LLM
“How do I turn on an auto-reply for a user?”
“Can I restrict vacation replies to contacts or the domain?”
Tell an agent
Enable auto-reply for {user} from {start} to {end}.
Set vacation responder for {user} to reply {body} to {contacts} only.
GET /gmail/v1/users/{userId}/settings/vacation Get vacation responder settings · Get vacation settings #
Ask an LLM
“Is the vacation responder on for a user's mailbox?”
“When does a user's auto-reply go on and off?”
Tell an agent
Get vacation settings for {user}.
Show the auto-reply schedule for {user}.
GET /gmail/v1/users/{userId}/settings/autoForwarding Get auto-forwarding settings · Get auto forwarding settings #
Ask an LLM
“Is email forwarding enabled for a user's account?”
“Where are incoming messages being forwarded to?”
Tell an agent
Get auto-forwarding settings for {user}.
Show the forwarding address for {user}.
PUT /gmail/v1/users/{userId}/settings/autoForwarding Update auto-forwarding settings · Update auto forwarding settings #
Ask an LLM
“How do I forward all incoming mail to another address?”
“Can I choose what happens to messages after they are forwarded?”
Tell an agent
Forward all mail for {user} to {address}.
Set forwarding disposition for {user} to {disposition}.
PUT /gmail/v1/users/{userId}/settings/pop Update POP settings · Update pop settings #
Ask an LLM
“How do I change the POP access window for a user?”
“Can I choose what happens to messages after they are fetched by POP?”
Tell an agent
Set POP access window for {user} to {window}.
Change the POP disposition for {user} to {disposition}.
GET /gmail/v1/users/{userId}/settings/pop Get POP settings · Get pop settings #
Ask an LLM
“Are POP settings enabled for a user's account?”
“What POP access window is set on a mailbox?”
Tell an agent
Get POP settings for {user}.
Show the POP access window for {user}.
PUT /gmail/v1/users/{userId}/settings/language Update language settings · Update language settings #
Ask an LLM
“How do I change the language Gmail is displayed in?”
“Does the language I set for a user actually get saved?”
Tell an agent
Set the display language for {user} to {language}.
Change Gmail's interface language for {user} to {language}.
GET /gmail/v1/users/{userId}/settings/language Get language settings · Get language settings #
Ask an LLM
“What language is a user's Gmail interface set to?”
“Can I check the display language of a mailbox?”
Tell an agent
Get language settings for {user}.
Show the display language of {user}'s Gmail.
POST /gmail/v1/users/{userId}/settings/cse/keypairs/{keyPairId}:obliterate Permanently delete a client-side encryption key pair · Obliterate keypairs #
Ask an LLM
“How do I permanently delete a CSE key pair that's been off for over 30 days?”
“Can I obliterate a client-side encryption key pair?”
Tell an agent destructive · confirm first
Obliterate CSE key pair {key} for {user}.
Permanently delete the disabled key pair {key} on {user}.
GET /gmail/v1/users/{userId}/settings/cse/keypairs List client-side encryption key pairs · List keypairs #
Ask an LLM
“Which client-side encryption key pairs exist for a user?”
“Can I page through a user's CSE key pairs?”
Tell an agent
List CSE key pairs for {user}.
Show the first {size} client-side encryption key pairs for {user}.
POST /gmail/v1/users/{userId}/settings/cse/keypairs Create a client-side encryption key pair · Create keypairs #
Ask an LLM
“How do I upload a client-side encryption S/MIME certificate chain for email?”
“Can I validate the PKCS#7 certificate chain when creating a key pair?”
Tell an agent
Create a client-side encryption key pair for {userId} with PKCS#7 chain {pkcs7}.
Upload a key pair for {userId} from {pkcs7} and validate its chain as {chainValidation}.
POST /gmail/v1/users/{userId}/settings/cse/keypairs/{keyPairId}:disable Turn off a client-side encryption key pair · Disable keypairs #
Ask an LLM
“How do I stop a user from decrypting CSE messages with a key pair?”
“Can I disable a client-side encryption key pair?”
Tell an agent destructive · confirm first
Disable CSE key pair {key} for {user}.
Turn off client-side encryption key pair {key} on {user}.
POST /gmail/v1/users/{userId}/settings/cse/keypairs/{keyPairId}:enable Turn on a client-side encryption key pair · Enable keypairs #
Ask an LLM
“How do I reactivate a disabled client-side encryption key pair?”
“Can I re-enable a CSE key pair that was turned off?”
Tell an agent
Enable CSE key pair {key} for {user}.
Reactivate client-side encryption key pair {key} on {user}.
GET /gmail/v1/users/{userId}/settings/cse/keypairs/{keyPairId} Get a client-side encryption key pair · Get keypairs #
Ask an LLM
“What are the details of one client-side encryption key pair?”
“Can I look up a CSE key pair by its ID?”
Tell an agent
Get CSE key pair {key} for {user}.
Show the state of client-side encryption key pair {key} on {user}.
GET /gmail/v1/users/{userId}/settings/cse/identities List client-side encrypted identities · List identities #
Ask an LLM
“Which identities are protected by client-side encryption for a user?”
“Can I list the CSE identities a user has?”
Tell an agent
List CSE identities for {user}.
Show the first {size} client-side encrypted identities for {user}.
POST /gmail/v1/users/{userId}/settings/cse/identities Create a client-side encryption send-as identity · Create identities #
Ask an LLM
“How do I get my S/MIME certificate published so colleagues can send encrypted mail to me?”
“Can a CSE identity use different key pairs for signing and encryption?”
Tell an agent
Create a client-side encryption identity for {emailAddress} on {userId}.
Create a CSE identity for {emailAddress} on {userId} using key pair {primaryKeyPairId}.
GET /gmail/v1/users/{userId}/settings/cse/identities/{cseEmailAddress} Get a client-side encryption identity · Get identities #
Ask an LLM
“What key pair is configured on a client-side encryption identity?”
“Can I view the signing and encrypting key pairs for one identity?”
Tell an agent
Get the client-side encryption identity {cseEmailAddress} for {userId}.
Show the key pair configuration of CSE identity {cseEmailAddress} on {userId}.
PATCH /gmail/v1/users/{userId}/settings/cse/identities/{cseEmailAddress} Switch the key pair on an identity · Patch identities #
Ask an LLM
“Can I move an existing client-side encryption identity to a different key pair?”
“Why would I change the encryption key on an identity I already created?”
Tell an agent
Point identity {cseEmailAddress} of {userId} at key pair {primaryKeyPairId}.
Update CSE identity {cseEmailAddress} for {userId} to sign and encrypt with {signAndEncryptKeyPairs}.
DELETE /gmail/v1/users/{userId}/settings/cse/identities/{cseEmailAddress} Delete a client-side encryption identity · Delete identities #
Ask an LLM
“Can I stop colleagues from sending encrypted mail to me?”
“What happens to my CSE identity when I delete it?”
Tell an agent destructive · confirm first
Delete the client-side encryption identity {cseEmailAddress} for {userId}.
Remove CSE identity {cseEmailAddress} on {userId} so it can no longer send encrypted mail.
POST /gmail/v1/users/{userId}/settings/filters Create a message filter · Create filters #
Ask an LLM
“How do I automatically archive messages from a particular sender?”
“What's the maximum number of filters I can create?”
Tell an agent
Create a filter for {userId} matching {criteria} that {action}.
Add a new Gmail filter for {userId}.
GET /gmail/v1/users/{userId}/settings/filters List message filters · List filters #
Ask an LLM
“Which filters are set up on my Gmail account?”
“How many message filters do I have?”
Tell an agent
List all message filters for {userId}.
Show my Gmail filters.
GET /gmail/v1/users/{userId}/settings/filters/{id} Get a message filter · Get filters #
Ask an LLM
“What criteria and action does a specific filter use?”
“Can I fetch one Gmail filter by its ID?”
Tell an agent
Get filter {id} for {userId}.
Show the matching criteria and action of Gmail filter {id}.
DELETE /gmail/v1/users/{userId}/settings/filters/{id} Delete a message filter · Delete filters #
Ask an LLM
“How do I permanently remove a Gmail filter?”
“Can I delete a filter by its ID?”
Tell an agent destructive · confirm first
Delete filter {id} from {userId}.
Permanently remove Gmail filter {id}.
DELETE /gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail} Delete a send-as alias · Delete sendAs #
Ask an LLM
“How do I stop using a custom send-as alias?”
“Can I delete a send-as alias I no longer send mail from?”
Tell an agent destructive · confirm first
Delete send-as alias {sendAsEmail} from {userId}.
Remove the custom from address {sendAsEmail}.
PATCH /gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail} Patch a send-as alias · Patch sendAs #
Ask an LLM
“Can I change only the reply-to address on a send-as alias?”
“How do I mark a send-as alias as a treated-as-alias?”
Tell an agent
Set the reply-to address on send-as alias {sendAsEmail} for {userId} to {replyToAddress}.
Patch send-as alias {sendAsEmail} so it is treated as an alias: {treatAsAlias}.
GET /gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail} Get a send-as alias · Get sendAs #
Ask an LLM
“What signature and reply-to address are set on a send-as alias?”
“Can I look up one send-as alias by its email address?”
Tell an agent
Get the send-as alias {sendAsEmail} for {userId}.
Show the signature on send-as alias {sendAsEmail}.
PUT /gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail} Update a send-as alias · Update sendAs #
Ask an LLM
“How do I change the signature on a send-as alias?”
“Can I make a custom send-as alias the default from address?”
Tell an agent
Set the signature on send-as alias {sendAsEmail} for {userId} to {signature}.
Make {displayName} the default from address for {userId} by updating send-as alias {sendAsEmail}.
POST /gmail/v1/users/{userId}/settings/sendAs Create a custom send-as alias · Create sendAs #
Ask an LLM
“How do I add a custom from address to my Gmail account?”
“Does creating a send-as alias send a verification email?”
Tell an agent
Create a custom send-as alias {sendAsEmail} for {userId}.
Add send-as alias {sendAsEmail} with signature {signature} for {userId}.
GET /gmail/v1/users/{userId}/settings/sendAs List send-as aliases · List sendAs #
Ask an LLM
“Which addresses can I send email from in Gmail?”
“Does the send-as list include my primary address?”
Tell an agent
List the send-as aliases for {userId}.
Show every From address I can send as.
POST /gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}/verify Send a verification email for a send-as alias · Verify sendAs #
Ask an LLM
“How do I verify a custom from address I added to Gmail?”
“Can I resend the verification email for a send-as alias?”
Tell an agent
Send a verification email for send-as alias {sendAsEmail} on {userId}.
Resend the verification for custom from address {sendAsEmail}.
GET /gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}/smimeInfo/{id} Get an S/MIME config for a send-as alias · Get smimeInfo #
Ask an LLM
“What certificate and expiration does a send-as alias's S/MIME config have?”
“Can I fetch one S/MIME config by its ID?”
Tell an agent
Get S/MIME config {id} for send-as alias {sendAsEmail} on {userId}.
Show the certificate expiration of S/MIME config {id} on {sendAsEmail}.
DELETE /gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}/smimeInfo/{id} Delete an S/MIME config for a send-as alias · Delete smimeInfo #
Ask an LLM
“How do I remove an S/MIME certificate from a send-as alias?”
“Can I delete a send-as S/MIME config by its ID?”
Tell an agent destructive · confirm first
Delete S/MIME config {id} from send-as alias {sendAsEmail} on {userId}.
Remove the S/MIME certificate {id} on {sendAsEmail}.
POST /gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}/smimeInfo Upload an S/MIME config to a send-as alias · Insert smimeInfo #
Ask an LLM
“How do I upload an S/MIME certificate so I can send encrypted mail from a send-as alias?”
“Does the S/MIME certificate have to be in PKCS#12 format?”
Tell an agent
Upload S/MIME config {issuerCn} to send-as alias {sendAsEmail} on {userId}.
Add certificate {issuerCn} to {sendAsEmail} using PKCS#12 {pkcs12}.
GET /gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}/smimeInfo List S/MIME certificates for a send-as alias · List smimeInfo #
Ask an LLM
“Which S/MIME certificates are set up on a send-as alias?”
“Can I see the default certificate for an alias?”
Tell an agent
List S/MIME configs for send-as alias {sendAsEmail} of {userId}.
Show the S/MIME certificates on {sendAsEmail} for account {userId}.
POST /gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}/smimeInfo/{id}/setDefault Set the default S/MIME certificate for an alias · Set default smimeInfo #
Ask an LLM
“How do I make one S/MIME certificate the default for an alias?”
“Can I change which certificate is used when sending from an alias?”
Tell an agent
Set certificate {id} as default for send-as alias {sendAsEmail} on {userId}.
Make {id} the default S/MIME config on {sendAsEmail} for account {userId}.
GET /gmail/v1/users/{userId}/settings/delegates/{delegateEmail} Get a delegate · Get delegates #
Ask an LLM
“How do I check whether a delegate has been added to my account?”
“Can I look up a delegate by its email address?”
Tell an agent
Get the delegate {delegateEmail} for user {userId}.
Show whether {delegateEmail} is a delegate of {userId}.
DELETE /gmail/v1/users/{userId}/settings/delegates/{delegateEmail} Remove a delegate · Delete delegates #
Ask an LLM
“How do I stop a delegate from accessing my mailbox?”
“Can I revoke a delegate's access without sending a verification email?”
Tell an agent destructive · confirm first
Remove delegate {delegateEmail} from user {userId}.
Revoke the delegate {delegateEmail} on {userId}.
GET /gmail/v1/users/{userId}/settings/delegates List delegates · List delegates #
Ask an LLM
“Who are the delegates on my account?”
“How many delegates does a user have?”
Tell an agent
List the delegates for user {userId}.
Show all delegate addresses on {userId}.
POST /gmail/v1/users/{userId}/settings/delegates Add a delegate · Create delegates #
Ask an LLM
“How do I add someone as a delegate on my account?”
“Can I add a delegate without sending a verification email?”
Tell an agent
Add delegate {delegateEmail} to user {userId}.
Make {delegateEmail} a delegate of {userId} with verification status {verificationStatus}.
DELETE /gmail/v1/users/{userId}/settings/forwardingAddresses/{forwardingEmail} Remove a forwarding address · Delete forwardingAddresses #
Ask an LLM
“How do I stop forwarding emails to a given address?”
“Can I delete a forwarding address from my account?”
Tell an agent destructive · confirm first
Delete forwarding address {forwardingEmail} from user {userId}.
Stop forwarding to {forwardingEmail} on {userId}.
GET /gmail/v1/users/{userId}/settings/forwardingAddresses/{forwardingEmail} Get a forwarding address · Get forwardingAddresses #
Ask an LLM
“How do I check whether an email address is set up for forwarding?”
“Can I look up one forwarding address on my account?”
Tell an agent
Get forwarding address {forwardingEmail} for user {userId}.
Show whether {forwardingEmail} is a forwarding address on {userId}.
GET /gmail/v1/users/{userId}/settings/forwardingAddresses List forwarding addresses · List forwardingAddresses #
Ask an LLM
“Which email addresses receive my forwarded mail?”
“How do I see all my forwarding addresses?”
Tell an agent
List the forwarding addresses for user {userId}.
Show every forwarded email address on {userId}.
POST /gmail/v1/users/{userId}/settings/forwardingAddresses Add a forwarding address · Create forwardingAddresses #
Ask an LLM
“How do I forward my mail to another email address?”
“Does adding a forwarding address require verification?”
Tell an agent
Add forwarding address {forwardingEmail} to user {userId}.
Set up forwarding to {forwardingEmail} on {userId} with verification status {verificationStatus}.
GET /gmail/v1/users/{userId}/drafts List drafts · List drafts #
Ask an LLM
“Which draft messages have I saved but not sent?”
“Can I include drafts in SPAM or TRASH when listing them?”
Tell an agent
List my unsent drafts for user {userId}.
Show drafts on {userId} matching {q}.
POST /gmail/v1/users/{userId}/drafts Create a draft · Create drafts #
Ask an LLM
“How do I save a draft email before sending it?”
“Can I create a draft with a specific message body?”
Tell an agent
Create a draft for user {userId} with message {message}.
Save a new draft on {userId} using {message}.
GET /gmail/v1/users/{userId}/drafts/{id} Get a draft · Get drafts #
Ask an LLM
“How do I open a saved draft to edit it?”
“Can I fetch a draft by its ID?”
Tell an agent
Get draft {id} for user {userId}.
Show the content of saved draft {id} on {userId}.
DELETE /gmail/v1/users/{userId}/drafts/{id} Delete a draft · Delete drafts #
Ask an LLM
“How do I permanently delete a draft I saved?”
“Does deleting a draft move it to trash?”
Tell an agent destructive · confirm first
Delete draft {id} for user {userId}.
Permanently remove saved draft {id} from {userId}.
PUT /gmail/v1/users/{userId}/drafts/{id} Replace a draft's content · Update drafts #
Ask an LLM
“How do I overwrite the content of a draft I already saved?”
“Can I change the message body of an existing draft?”
Tell an agent
Replace the content of draft {id} for user {userId} with {message}.
Update saved draft {id} on {userId} to contain {message}.
POST /gmail/v1/users/{userId}/drafts/send Send a saved draft · Send drafts #
Ask an LLM
“How do I send a draft I saved earlier?”
“Can I send an existing draft to its recipients without composing it again?”
Tell an agent
Send saved draft {id} from {userId}'s account.
Send the existing draft {id} for {userId} with message content {message}.
GET /gmail/v1/users/{userId}/history List mailbox changes · List history #
Ask an LLM
“How do I sync my client with Gmail by watching mailbox changes?”
“Can I list only the change types I care about?”
Tell an agent
List mailbox changes for user {userId}.
Show changes to {userId} of type {historyTypes}.
POST /gmail/v1/users/{userId}/messages/send Send an email · Send messages #
Ask an LLM
“How do I send an email to recipients in the To, Cc and Bcc fields?”
“Can I send an email from a draft's raw MIME body?”
Tell an agent
Send message {raw} to user {userId}.
Send an email with payload {payload} from {userId}.
GET /gmail/v1/users/{userId}/messages/{id} Get an email · Get messages #
Ask an LLM
“How do I read a specific email by its ID?”
“Can I fetch an email's headers only?”
Tell an agent
Get message {id} for user {userId}.
Show the full email {id} on {userId} in {format} format.
DELETE /gmail/v1/users/{userId}/messages/{id} Permanently delete an email · Delete messages #
Ask an LLM
“How do I permanently delete an email so it can't be undone?”
“Is there a way to delete an email without moving it to trash?”
Tell an agent destructive · confirm first
Permanently delete message {id} for user {userId}.
Erase email {id} from {userId} for good.
POST /gmail/v1/users/{userId}/messages/import Import an email into the mailbox · Import messages #
Ask an LLM
“How do I import an email into my mailbox as if it arrived by SMTP?”
“Can I import an email and mark it never as spam?”
Tell an agent
Import message {raw} into user {userId}.
Import {raw} into {userId} with never-mark-spam {neverMarkSpam}.
POST /gmail/v1/users/{userId}/messages/batchModify Apply labels to many messages · Batch modify messages #
Ask an LLM
“How do I apply a label to a batch of messages at once?”
“Can I remove classification labels from several messages in one request?”
Tell an agent
Apply labels {addLabelIds} to messages {ids} for user {userId}.
Remove labels {removeLabelIds} from messages {ids} on {userId}.
POST /gmail/v1/users/{userId}/messages/{id}/modify Add or remove labels on a message · Modify messages #
Ask an LLM
“How do I add a label to a single message?”
“Can I remove classification labels from one message?”
Tell an agent
Add labels {addLabelIds} to message {id} for user {userId}.
Remove labels {removeLabelIds} from message {id} in {userId}.
POST /gmail/v1/users/{userId}/messages/{id}/trash Move a message to the trash · Trash messages #
Ask an LLM
“How do I move a single message to the trash?”
“Can I trash one email without touching the rest of the conversation?”
Tell an agent destructive · confirm first
Trash message {id} for user {userId}.
Move email {id} to the trash.
POST /gmail/v1/users/{userId}/messages Insert a raw message into a mailbox · Insert messages #
Ask an LLM
“How do I add a raw MIME email directly into a mailbox?”
“Can I insert a message without it being scanned or classified?”
Tell an agent
Insert raw message {raw} into {userId}'s mailbox.
Add a new message to {userId} with internal date {internalDate}.
GET /gmail/v1/users/{userId}/messages List a user's messages · List messages #
Ask an LLM
“How do I list all messages in a user's inbox?”
“Can I include spam and trash messages in a message list?”
Tell an agent
List messages for user {userId}.
Show messages in {userId} matching {q}.
POST /gmail/v1/users/{userId}/messages/batchDelete Delete many messages by ID · Batch delete messages #
Ask an LLM
“How do I delete several messages at once by their IDs?”
“Are there any guarantees that batch-deleted messages actually existed?”
Tell an agent destructive · confirm first
Delete messages {ids} for user {userId}.
Permanently remove these email IDs from {userId}'s mailbox.
POST /gmail/v1/users/{userId}/messages/{id}/untrash Restore a message from the trash · Untrash messages #
Ask an LLM
“How do I bring a single trashed message back to the inbox?”
“Can I untrash one email without affecting the rest of the conversation?”
Tell an agent
Restore message {id} from the trash for user {userId}.
Move trashed email {id} back into {userId}'s inbox.
GET /gmail/v1/users/{userId}/messages/{messageId}/attachments/{id} Download a message attachment · Get attachments #
Ask an LLM
“How do I download an attachment from a message?”
“Can I fetch a single attachment by its ID?”
Tell an agent
Download attachment {id} from message {messageId} for user {userId}.
Get the file attachment {id} on email {messageId}.
DELETE /gmail/v1/users/{userId}/labels/{id} Delete a label · Delete labels #
Ask an LLM
“How do I delete a label and remove it from every message?”
“Is deleting a label permanent?”
Tell an agent destructive · confirm first
Delete label {id} for user {userId}.
Permanently remove label {id}.
GET /gmail/v1/users/{userId}/labels/{id} Get a label · Get labels #
Ask an LLM
“How do I look up the color and visibility of a label?”
“What type is a given label?”
Tell an agent
Get label {id} for user {userId}.
Show the details of label {id}.
PUT /gmail/v1/users/{userId}/labels/{id} Update a label's name or color · Update labels #
Ask an LLM
“How do I rename an existing label?”
“Can I change a label's color?”
Tell an agent
Rename label {id} to {name} for user {userId}.
Set the color of label {id} to {color}.
PATCH /gmail/v1/users/{userId}/labels/{id} Patch a label's settings · Patch labels #
Ask an LLM
“Can I change a label's visibility without replacing its name?”
“How do I patch only some fields of a label?”
Tell an agent
Patch label {id} in {userId} with visibility {labelListVisibility}.
Update label {id} so messages are {messageListVisibility} in the list.
GET /gmail/v1/users/{userId}/labels List a user's labels · List labels #
Ask an LLM
“What labels exist in a user's mailbox?”
“Which labels are visible in the label list?”
Tell an agent
List all labels for user {userId}.
Show the labels in {userId}'s mailbox.
POST /gmail/v1/users/{userId}/labels Create a label · Create labels #
Ask an LLM
“How do I create a new label to organize messages?”
“Can I set a color when creating a label?”
Tell an agent
Create label {name} for user {userId}.
Create a label {name} with color {color}.
POST /gmail/v1/users/{userId}/threads/{id}/untrash Restore a thread from the trash · Untrash threads #
Ask an LLM
“How do I bring an entire trashed thread back to the inbox?”
“Does untrashing a thread restore all its messages?”
Tell an agent
Restore thread {id} from the trash for user {userId}.
Move trashed thread {id} back into {userId}'s mailbox.
POST /gmail/v1/users/{userId}/threads/{id}/modify Add or remove labels on a thread · Modify threads #
Ask an LLM
“How do I label every message in a conversation at once?”
“Can I remove a label from an entire thread?”
Tell an agent
Add labels {addLabelIds} to thread {id} for user {userId}.
Remove labels {removeLabelIds} from thread {id} in {userId}.
GET /gmail/v1/users/{userId}/threads/{id} Get a thread · Get threads #
Ask an LLM
“How do I read one conversation thread?”
“Can I fetch a thread's messages in full or metadata format?”
Tell an agent
Get thread {id} for user {userId}.
Show thread {id} with format {format}.
DELETE /gmail/v1/users/{userId}/threads/{id} Permanently delete a thread · Delete threads #
Ask an LLM
“How do I permanently delete a whole conversation thread?”
“Is deleting a thread reversible?”
Tell an agent destructive · confirm first
Permanently delete thread {id} for user {userId}.
Delete the entire conversation thread {id}.
GET /gmail/v1/users/{userId}/threads List a user's threads · List threads #
Ask an LLM
“How do I list a user's conversation threads?”
“Can I search threads by query?”
Tell an agent
List threads for user {userId}.
Show threads in {userId} matching {q}.
POST /gmail/v1/users/{userId}/threads/{id}/trash Move a thread to the trash · Trash threads #
Ask an LLM
“How do I move an entire conversation thread to the trash?”
“Can I trash a thread without deleting it?”
Tell an agent destructive · confirm first
Trash thread {id} for user {userId}.
Move conversation thread {id} to the trash.

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/google-gmail:google-gmail-users-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

google-gmail-users-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Gmail Users API
  version: v1
  description: Generated from Google's published Discovery document for Gmail API (gmail v1, revision 20261106). 79 operation(s).
  contact:
    name: Google
    url: https://developers.google.com/
  termsOfService: https://developers.google.com/terms
servers:
- url: https://gmail.googleapis.com
tags:


# --- truncated at 32 KB (195 KB total) ---
# Full source: https://artifacts.apis.io/google-gmail/openapi/google-gmail-users-api-openapi.yml